Community
Participate
Working Groups
Created attachment 88892 [details] simple patch for this NPE Build ID: 3.3.1 Steps To Reproduce: Call util.getLineSeparator from some custom (non-eclipse) code. A NullPointerException is produced, despite code lower down in the method suggesting that it should work without a platform running. More information: This appears to have worked in the past, e.g. so that the ant script mentioned on the following page would work: http://www.eclipse.org/articles/Article-JET2/jet_tutorial2.html The attached patch is against the R3_3_maintenance cvs branch, although the bug appears to be present in CVS HEAD. Fixing this in the 3.3 branch would be very much appreciated.
> Call util.getLineSeparator from some custom (non-eclipse) code. May you please provide us with some sample code along with a step by step scenario in order for us to try and reproduce this issue. Thanks
Created attachment 88899 [details] example java class I'm attaching a simple class which demonstrates the NPE. This class is trying to use JET to generate a java source file from a jet template. The NPE is raised through calls to jdt's Util.java, via constructors: java.lang.NullPointerException at org.eclipse.jdt.internal.core.util.Util.getLineSeparator(Util.java:882) at org.eclipse.jdt.core.jdom.DOMFactory.<init>(DOMFactory.java:32) at org.eclipse.emf.codegen.jet.JETSkeleton.<init>(JETSkeleton.java:53) at org.eclipse.emf.codegen.jet.JETCompiler.handleDirective(JETCompiler.java:277) at org.eclipse.emf.codegen.jet.JETParser$DelegatingListener.handleDirective(JETParser.java:133) at org.eclipse.emf.codegen.jet.JETParser$Directive.accept(JETParser.java:444) at org.eclipse.emf.codegen.jet.JETParser.parse(JETParser.java:512) at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:631) at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:624) at com.onespatial.maven2.JetMojo.processTemplate(JetMojo.java:75)
org.eclipse.jdt.core.jdom was not designed to run out of the context of an Eclipse workspace. Moreover it is deprecated. Its replacement org.eclipse.jdt.core.dom is known to be able to run out of the context of an Eclipse workspace if binding resolution is not requested. No change planned.
Verified for 3.4M6