Community
Participate
Working Groups
Build Identifier: I20110613-1736 This is not a report on the OJDT feature itself, but on a basic Helios install with JDT, and the OJDT patch installed after it was erroneously offered by the automatic updates. After the patch, creating a java package or java class in a java project with the name "as" is not allowed (see screenshot). This also has the effect of excluding classes under an "as" package from imported libraries (see screenshot showing exclusion of org.apache.xerces.dom3.as.*). Reproducible: Always Steps to Reproduce: 1. Create new Java class with name "as" 2. see validation failure
Created attachment 202958 [details] screenshot of "'as' is not a valid identifier" error
Created attachment 202959 [details] screenshot of library breakage
Unfortunately in the description I said it was a Helios install. In fact this is an Indigo x86_64 install.
This issue has two parts: It is not intended to offer the OT patch as an *update* if no Object Teams feature was previously installed. This seems to be the same as bug 350133. Even with the OT patch installed we strive for greatest possible compatibility, so in this bug I will investigate whether we can improve the switching in the scanner, so that Object Teams keywords will be accepted as normal Java identifiers in more situations.
Created attachment 203014 [details] fix This patch makes the implementation more conservative: The utility class JavaConventions has no context about the current project, thus we cannot determine whether it is a Java or an OT/J project. To avoid undesired effects in a pure Java project we'll now always assume pure Java here. This means that in OT/J projects a few names are allowed which shouldn't be, but at least the compiler will still detect these. It is better to miss some warnings in OT/J code rather than raising bogus errors in pure Java projects.
Patch has been released. This indeed resolves both issues reported (re new class wizard and package in imported library). In anticipation that more people might be affected by the unintended install when SR1 ships I'm raising the priority and I'll try to get this into the SR1 release. Tests are currently running.
Created attachment 203109 [details] fix part 2 During further testing I found one more location needing the same change: also the indexer skipped packages with name "as", thus several features like code completion, label decoration ... did not see classes inside the "as" package inside the jar file. Fixed by applying the same more conservative settings also for the indexer. The only other client of Scanner.scanIdentifier() is ...dom.SimpleName which has sufficient context to detect OT/J vs. plain Java code.
Also released for 2.1 M2 (r2026)
Verified using build 201201310618