(CompilationResult result)
| 468 | |
| 469 | final ICompilerRequestor requestor = new ICompilerRequestor() { |
| 470 | @Override |
| 471 | public void acceptResult(CompilationResult result) { |
| 472 | try { |
| 473 | if (result.hasProblems()) { |
| 474 | IProblem[] problems = result.getProblems(); |
| 475 | for (IProblem problem : problems) { |
| 476 | if (problem.isError()) { |
| 477 | String name = new String(problem.getOriginatingFileName()); |
| 478 | try { |
| 479 | problemList.add(ErrorDispatcher.createJavacError(name, pageNodes, |
| 480 | new StringBuilder(problem.getMessage()), problem.getSourceLineNumber(), |
| 481 | ctxt)); |
| 482 | } catch (JasperException e) { |
| 483 | log.error(Localizer.getMessage("jsp.error.compilation.jdtProblemError"), e); |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | if (problemList.isEmpty()) { |
| 489 | ClassFile[] classFiles = result.getClassFiles(); |
| 490 | for (ClassFile classFile : classFiles) { |
| 491 | char[][] compoundName = classFile.getCompoundName(); |
| 492 | StringBuilder classFileName = new StringBuilder(outputDir).append('/'); |
| 493 | for (int j = 0; j < compoundName.length; j++) { |
| 494 | if (j > 0) { |
| 495 | classFileName.append('/'); |
| 496 | } |
| 497 | classFileName.append(compoundName[j]); |
| 498 | } |
| 499 | byte[] bytes = classFile.getBytes(); |
| 500 | classFileName.append(".class"); |
| 501 | try (FileOutputStream fout = new FileOutputStream(classFileName.toString()); |
| 502 | BufferedOutputStream bos = new BufferedOutputStream(fout)) { |
| 503 | bos.write(bytes); |
| 504 | } |
| 505 | } |
| 506 | } |
| 507 | } catch (IOException ioe) { |
| 508 | log.error(Localizer.getMessage("jsp.error.compilation.jdt"), ioe); |
| 509 | } |
| 510 | } |
| 511 | }; |
| 512 | |
| 513 | ICompilationUnit[] compilationUnits = new ICompilationUnit[classNames.length]; |
nothing calls this directly
no test coverage detected