MCPcopy Index your code
hub / github.com/apache/tomcat / acceptResult

Method acceptResult

java/org/apache/jasper/compiler/JDTCompiler.java:470–510  ·  view source on GitHub ↗
(CompilationResult result)

Source from the content-addressed store, hash-verified

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];

Callers

nothing calls this directly

Calls 11

createJavacErrorMethod · 0.95
getMessageMethod · 0.95
addMethod · 0.65
getMessageMethod · 0.65
errorMethod · 0.65
toStringMethod · 0.65
writeMethod · 0.65
isErrorMethod · 0.45
isEmptyMethod · 0.45
appendMethod · 0.45
getBytesMethod · 0.45

Tested by

no test coverage detected