(Map<String,SmapStratum> smaps)
| 145 | |
| 146 | |
| 147 | @Override |
| 148 | protected void generateClass(Map<String,SmapStratum> smaps) |
| 149 | throws FileNotFoundException, JasperException, Exception { |
| 150 | |
| 151 | long t1 = 0; |
| 152 | if (log.isDebugEnabled()) { |
| 153 | t1 = System.currentTimeMillis(); |
| 154 | } |
| 155 | |
| 156 | String javaEncoding = ctxt.getOptions().getJavaEncoding(); |
| 157 | String javaFileName = ctxt.getServletJavaFileName(); |
| 158 | String classpath = ctxt.getClassPath(); |
| 159 | |
| 160 | StringBuilder errorReport = new StringBuilder(); |
| 161 | |
| 162 | StringBuilder info = new StringBuilder(); |
| 163 | info.append("Compile: javaFileName=").append(javaFileName).append("\n"); |
| 164 | info.append(" classpath=").append(classpath).append("\n"); |
| 165 | |
| 166 | // Start capturing the System.err output for this thread |
| 167 | SystemLogHandler.setThread(); |
| 168 | |
| 169 | // Initializing javac task |
| 170 | getProject(); |
| 171 | Javac javac = (Javac) project.createTask("javac"); |
| 172 | |
| 173 | // Initializing classpath |
| 174 | Path path = new Path(project); |
| 175 | path.setPath(System.getProperty("java.class.path")); |
| 176 | info.append(" cp=").append(System.getProperty("java.class.path")).append("\n"); |
| 177 | StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator); |
| 178 | while (tokenizer.hasMoreElements()) { |
| 179 | String pathElement = tokenizer.nextToken(); |
| 180 | File repository = new File(pathElement); |
| 181 | path.setLocation(repository); |
| 182 | info.append(" cp=").append(repository).append("\n"); |
| 183 | } |
| 184 | |
| 185 | if (log.isTraceEnabled()) { |
| 186 | log.trace("Using classpath: " + System.getProperty("java.class.path") + File.pathSeparator + classpath); |
| 187 | } |
| 188 | |
| 189 | // Initializing sourcepath |
| 190 | Path srcPath = new Path(project); |
| 191 | srcPath.setLocation(options.getScratchDir()); |
| 192 | |
| 193 | info.append(" work dir=").append(options.getScratchDir()).append("\n"); |
| 194 | |
| 195 | // Initialize and set java extensions |
| 196 | String exts = System.getProperty("java.ext.dirs"); |
| 197 | if (exts != null) { |
| 198 | Path extdirs = new Path(project); |
| 199 | extdirs.setPath(exts); |
| 200 | javac.setExtdirs(extdirs); |
| 201 | info.append(" extension dir=").append(exts).append("\n"); |
| 202 | } |
| 203 | |
| 204 | // Configure the compiler object |
nothing calls this directly
no test coverage detected