Community
Participate
Working Groups
Created attachment 229449 [details] Missing carriage return at the end of the error summary output. When compiling a Java file that contains errors using ecj from command line, the error output lacks a final carriage return. This means that the shell prompt or the next output from the invoking shell script appears on the same line as the last line of the ecj error output. For example, you get this output: [mbooth@10-2-5-11 calameo]$ CLASSPATH=/usr/share/java/ecj.jar:. \ java org.eclipse.jdt.internal.compiler.batch.Main Envelope.java ... error output etc ... ---------- 4 problems (4 errors)[mbooth@10-2-5-11 calameo]$ When it would be more desirable to have this output: [mbooth@10-2-5-11 calameo]$ CLASSPATH=/usr/share/java/ecj.jar:. \ java org.eclipse.jdt.internal.compiler.batch.Main Envelope.java ... error output etc ... ---------- 4 problems (4 errors) [mbooth@10-2-5-11 calameo]$ The attached patch makes a small change to the output so that instead of including a final carriage return *only* in EMACS log output mode, we include a final carriage return in every output mode *except* for XML log output mode.
See also the downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=163447
Not a big deal, I'd say. I was thinking maybe this would require adjusting thousands of tests, but luckily most of our tests don't get the error output from the batch compiler by directly from the internal ComilationResult.
Stephan, any plans on this? Could it get into Kepler?
Shankha, please take it forward
Could you please suggest a way to create ecj.jar. I am trying to use export-ecj.xml. C:\Work\JDT-repo3\eclipse.jdt.core>ant -f org.eclipse.jdt.core\scripts\export-ecj.xml Buildfile: C:\Work\JDT-repo3\eclipse.jdt.core\org.eclipse.jdt.core\scripts\export-ecj.xml init: BUILD FAILED C:\Work\JDT-repo3\eclipse.jdt.core\org.eclipse.jdt.core\scripts\export-ecj.xml:24: Unable to create javax script engine for javascript Total time: 0 seconds Thanks
(In reply to comment #5) > Could you please suggest a way to create ecj.jar. Did you try running the ant script from eclipse?
Set the JRE for the build run to JAVA60 for (In reply to comment #5) > Could you please suggest a way to create ecj.jar. > > I am trying to use export-ecj.xml. > > C:\Work\JDT-repo3\eclipse.jdt.core>ant -f > org.eclipse.jdt.core\scripts\export-ecj.xml > Buildfile: > C:\Work\JDT-repo3\eclipse.jdt.core\org.eclipse.jdt.core\scripts\export-ecj. > xml > > init: > > BUILD FAILED > C:\Work\JDT-repo3\eclipse.jdt.core\org.eclipse.jdt.core\scripts\export-ecj. > xml:24: Unable to create javax script engine for javascript > > Total time: 0 seconds > > Thanks Set the JRE for the build. This would solve the above issue.
The problem can be reproduced. The issue is resolved through the patch that is already posted attachment 229449 [details].
Created attachment 232058 [details] Patch RunAllJDTCoreTests : ALL PASS Please review. Way to test: 1) Have a java source file with errors. 2) Build ecj by ruuning export-ecj.xml. 3) java -jar ecj_all.jar Error.java The prompt should be after the error message. Thanks
(In reply to comment #9) > Created attachment 232058 [details] > Patch Comments on the patch: 1. When I use the -log option, the prompt appears on the same line. Looks like even though we request the log to be printed to a file, error messages still get printed on the console. Looks like the patch in comment #0 addresses this. 2. Copyright needs to be updated with year. 3. As per our code convention the else block should appear in the same line as '}' It should be something like: if () { } else { }
Created attachment 232150 [details] Patch Incorporated changes as suggested by Comment 10 Tests: RunAllJDTCoreTests. Thanks
Created attachment 232162 [details] Patch RunAllJDTCoreTests: Results OKAY. All the changes have been incorporated. Thanks
Thanks for the update, I will release once we tag for Kepler.
(In reply to comment #0) > Created attachment 229449 [details] > Missing carriage return at the end of the error summary output. Mat, Thanks for the patch. For this fix and any future contribution, can you please sign the CLA agreement? Some help on doing this can be found here: http://mmilinkov.wordpress.com/2013/06/17/eclipse-clas-are-live/ Or you can simply go to the eclipse project portal, my account and get to the CLA page.
(In reply to comment #14) > Mat, > > Thanks for the patch. For this fix and any future contribution, can you > please sign the CLA agreement? Some help on doing this can be found here: > > http://mmilinkov.wordpress.com/2013/06/17/eclipse-clas-are-live/ > > Or you can simply go to the eclipse project portal, my account and get to > the CLA page. Thanks for reviewing my patch. I have signed the contributor agreement by logging into the portal using my bugzilla credentials.
The patches have been released in master via commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=870bb4f621dd0b8090426a7261d67a43a6dc9aa9 and it's parent.
Verified for SDK-I20130730-0800.
(In reply to comment #17) > Verified for SDK-I20130730-0800. ie Eclipse Luna 4.4 M1