[ http://issues.apache.org/jira/browse/SANDBOX-99?page=all ]

Henri Yandell updated SANDBOX-99:
---------------------------------

    Component: JCI

> JCI: Eclipse compiler doesn't handling warnings correctly
> ---------------------------------------------------------
>
>          Key: SANDBOX-99
>          URL: http://issues.apache.org/jira/browse/SANDBOX-99
>      Project: Commons Sandbox
>         Type: Bug

>   Components: JCI
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Patrick Lightbody

>
> The Eclipse compiler won't process classes even if only warnings occur. This
> isn't correct and can lead to some very frustrating debugging :) All you need 
> to
> do is change the ICompilerRequestor anonymous class to (note the new "errors"
> boolean):
>             public void acceptResult(CompilationResult result) {
>                 try {
>                     boolean errors = false;
>                     if (result.hasProblems()) {
>                         if (problemHandler != null) {
>                               final IProblem[] problems = 
> result.getProblems();
>                               for (int i = 0; i < problems.length; i++) {
>                                   final IProblem problem = problems[i];
>                                 boolean error = problem.isError();
>                                 if (error) {
>                                     errors = error;
>                                 }
>                                 problemHandler.handle(
>                                         new CompilationProblem(
>                                                 problem.getID(),
>                                                 new
> String(problem.getOriginatingFileName()),
>                                                 problem.getMessage(),
>                                                 problem.getSourceLineNumber(),
>                                                 problem.getSourceLineNumber(),
>                                                 error
>                                                 ));
>                               }
>                         }
>                     }
>                     if (!errors) {
>                         final ClassFile[] clazzFiles = result.getClassFiles();
>                         for (int i = 0; i < clazzFiles.length; i++) {
>                             final ClassFile clazzFile = clazzFiles[i];
>                             final char[][] compoundName =
> clazzFile.getCompoundName();
>                             final StringBuffer clazzName = new StringBuffer();
>                             for (int j = 0; j < compoundName.length; j++) {
>                                 if (j != 0) {
>                                     clazzName.append('.');
>                                 }
>                                 clazzName.append(compoundName[j]);
>                             }
>                             store.write(clazzName.toString(), 
> clazzFile.getBytes());
>                         }
>                     }
>                 } catch (Exception exc) {
>                     exc.printStackTrace();
>                 }
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to