[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12966450#action_12966450 ] Felix Meschberger commented on SLING-1809: -- Could it be that the target version is set implicitly when explicitly setting the source version ? So how about setting the target explicitly, too, as we do in the JSP scripting budle ? Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12966452#action_12966452 ] Carsten Ziegeler commented on SLING-1809: - Yes, I think we should set both values - this way we know what is set Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12966535#action_12966535 ] Stefan Guggisberg commented on SLING-1809: -- i have verified that this issue is solved by explicitly setting the target version, e.g. String sourceVersion = if (sourceVersion != null) { props.put(org.eclipse.jdt.core.compiler.source, sourceVersion); props.put(org.eclipse.jdt.core.compiler.compliance, sourceVersion); props.put(org.eclipse.jdt.core.compiler.codegen.targetPlatform, sourceVersion); } CompilerOptions settings = new CompilerOptions(props); Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12965733#action_12965733 ] Stefan Guggisberg commented on SLING-1809: -- the target version is never explicitly set, i.e. it is not related to or specific to target jsr14. according to bertrand the issue is easily reproducible. Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12965149#action_12965149 ] Felix Meschberger commented on SLING-1809: -- I don't think we have to upgrade the compiler for this single reason because the problem is only exhibited when compiling with target jsr14. Since Sling requires Java 5 there is no use compiling for the jsr14 target and thus this issues needs not be fixed IMHO. Note on the jsr14 target: This special (mostly undocumented) target has been introduced while the new Java 5 language features have been developped. This target accepts source level for Java 5 but generates Java 1.4 compatible class files. This is mainly useful for generics, which are not erased anyway. For Enums and Annotations this target is not really usefull because the Java 1.4 runtime library does not provide the required interfaces like java.lang.Enum. Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1809) Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums
[ https://issues.apache.org/jira/browse/SLING-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12915326#action_12915326 ] Bertrand Delacretaz commented on SLING-1809: The tycho project seems to provide a more recent version of the compiler: dependency groupIdorg.sonatype.tycho/groupId artifactIdorg.eclipse.jdt.core/artifactId version3.6.0.v_A58/version /dependency Eclipse compiler used in commons.compiler causes Illegal type in constant pool with enums --- Key: SLING-1809 URL: https://issues.apache.org/jira/browse/SLING-1809 Project: Sling Issue Type: Bug Components: Commons Affects Versions: Commons Compiler 2.0.0 Reporter: Bertrand Delacretaz According to [0] the eclipse compiler can't handle enums in certain environments. The trunk org.apache.sling.commons.compiler bundle embeds (eclipse-jdt) core-3.3.0-v_771.jar which exposes this issue. According to [0] the issue should be fixed in v3.5.2, but the central Maven repository does not provide a more recent version than the one we currently use. To reproduce the problem, install the compiler and java scripting bundle and create a scripted java servlet that uses enums (example below), at runtime this causes: java.lang.VerifyError: (class: enumtest/EnumTest, method: valueOf signature: (Ljava/lang/String;)Lenumtest/EnumTest;) Illegal type in constant pool [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=291985 Here's the example servlet, store in /apps/JavaScriptingTest2/JavaScriptingTest2.java and use JavaScriptingTest2 resource type: package apps.JavaScriptingTest2; import javax.servlet.http.*; import java.io.IOException; public class JavaScriptingTest2 extends HttpServlet { static enum EnumTest { FOO, BAR }; public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.getWriter().write(FOO= + EnumTest.FOO); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.