This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 180165 - IDE generates @Override annotation when Override annotation not in boot classpath
Summary: IDE generates @Override annotation when Override annotation not in boot class...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks: 179862
  Show dependency tree
 
Reported: 2010-02-02 11:44 UTC by _ tboudreau
Modified: 2010-02-17 22:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2010-02-02 11:44:53 UTC
See issue 179862:  The Java Card platform for classic applets/libraries (A Java Card platform has two separate boot classpaths, one for Java Card 2 projects [no java.lang.String, no floating point], another for Java Card 3 projects [more complete but still no collections and no floating point]).  But Java Card projects are source-level 1.6.

NetBeans generates uncompilable code with @Override when using editor features that generate method overrides (override method, add all abstract methods, add @Override annotation hint, etc.) - they are annotated with @Override, but it cannot be compiled.

I cannot fix this in the Java Card module (see comments on issue 179862).  Need the editor infrastructure either not to generate @Override annotations if the Override annotation is not in the project boot classpath, or a quick hack to allow a Java Platform to provide some token to indicate that annotations of this kind should not be generated.
Comment 1 Quality Engineering 2010-02-03 21:57:47 UTC
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/76d286f8f580
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #180165: override is supported only if the source level > 1.5, and java.lang.Override is available on the classpath.
Comment 2 _ tboudreau 2010-02-03 22:52:05 UTC
So this is fixed?
Comment 3 Jan Lahoda 2010-02-03 23:00:41 UTC
Yes, I hope so.
Comment 4 _ tboudreau 2010-02-03 23:34:57 UTC
Thanks for the super-rapid response!
Comment 5 _ tboudreau 2010-02-16 13:31:44 UTC
Sorry - it looks like this needs to be fixed in GeneratorUtilities.createMethod() in java.source - GeneratorUtils.supportsOverride(CompilationInfo) is not called in the path of the Override Methods hint.
Comment 6 _ tboudreau 2010-02-16 17:27:54 UTC
Hotfixed in main/ 71d0594c59ae

Please review.
Comment 7 Quality Engineering 2010-02-17 22:00:43 UTC
Integrated into 'main-golden', will be available in build *201002180200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/71d0594c59ae
User: Tim Boudreau <tboudreau@netbeans.org>
Log: #180165 - @Override annotations generated in projects (Java Card) where java.lang.Override is not on the boot classpath