Community
Participate
Working Groups
Build Identifier: 20100617-1415 Creating a package whose name starts with "java" does not show any error hints, and a SecurityException is thrown at compile time. Reproducible: Always Steps to Reproduce: This can be duplicated by creating a package named java.test, creating any class file underneath it, and attempting to run. The following error will be thrown: java.lang.SecurityException: Prohibited package name: java.test at java.lang.ClassLoader.preDefineClass(ClassLoader.java:480)
I didn't find anything in the JLS that would disallow a package starting with "java.", and javac also happily compiles such classes. Only java.lang.ClassLoader#defineClass(..) says that a package name must not start with "java.". Moving to JDT/Core. JavaConventions#validatePackageName(..) should return a warning for such package names. It should not be an error, since the construct is legal and can actually be used for testing purposes (if the classes are loaded via -Xbootclasspath). package java.test; public class C { public static void main(String[] args) { System.out.println("Hello World"); } }
Ayush, please follow-up, thanks
New Gerrit change created: https://git.eclipse.org/r/151490
New Gerrit change created: https://git.eclipse.org/r/151503
@Markus Keller can you please take a look my fix?
(In reply to Ihor Yatsenko from comment #5) > @Markus Keller can you please take a look my fix? Markus is no longer with the team. I will keep this in the radar but no guarantee yet.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.