Community
Participate
Working Groups
RC2. 1) Create a project P with src/bin as source/output folders 2) Create a package 'p' 3) Create a file in this package that contains: @java.lang.Deprecated package p; Click on the package declaration in the outliner and you get the position of the 'p' in Deprecated. It looks like the first 'p' is highlighted. This looks awkwards.
At least the indexOf(...) should be used to locate the name after the 'package' keyword. This might not support unicode, but this would at least be an improvement.
Created attachment 22969 [details] Possible fix This fix doesn't handle unicode. I don't see how it is possible to handle unicodes without using a scanner. And a scanner is pretty expensive. So this could be a simple solution when no unicode are involved.
>3) Create a file in this package that contains: The file must be named 'package-info.java' The fix is simple and makes sense. Given that a major focus for 3.1 is on J2SE 5.0 I approve this fix for 3.1. Dirk? Please see bug 99903 for a problem related to package-info range in JDT Core.
Also note that I have a different fix since the proposed fix does not take into account comments in front of the package declaration. The fix differs only by using lastIndexOf("package") instead of indexOf("package"). Olivier do you agree in this modification of your patch?
Sure. This would indeed be better. The best solution would remain the use of a scanner, but this might be a little expensive. A scanner would scan for "package" as a keyword and then take the next "name" (identifiers separated by '.'). This solution would handle unicodes.
+1.
Released to HEAD. Reviewed by Markus.
Verified in N20050616-0010.