Summary: | 'as' is not a valid identifier, breaks org.apache.xerces.dom3.as package | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] Objectteams | Reporter: | bugmenot <eclipse_bugzilla123> | ||||||||||
Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||
Severity: | normal | ||||||||||||
Priority: | P2 | CC: | stephan.herrmann | ||||||||||
Version: | 2.0 | ||||||||||||
Target Milestone: | 2.0.1 | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Windows 7 | ||||||||||||
Whiteboard: | |||||||||||||
Attachments: |
|
Description
bugmenot
2011-09-07 23:01:59 EDT
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 |