commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36070] New: - JCI: Eclipse compiler doesn't handling warnings correctly
Date Mon, 08 Aug 2005 06:14:13 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36070>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36070

           Summary: JCI: Eclipse compiler doesn't handling warnings
                    correctly
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: plightbo@gmail.com


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();
                }
            }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message