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 179862 - Compiler arguments for classic applets and libraries don't allow to use annotations in sources
Summary: Compiler arguments for classic applets and libraries don't allow to use annot...
Status: RESOLVED FIXED
Alias: None
Product: javacard
Classification: Unclassified
Component: Java Card (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on: 180165
Blocks:
  Show dependency tree
 
Reported: 2010-01-26 04:06 UTC by msmirnov
Modified: 2010-02-16 17:28 UTC (History)
0 users

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 msmirnov 2010-01-26 04:06:43 UTC
When adding overridden method tp classic Java Card applet or classic library class in 
NetBeans editor the "@Override" annotation is added automatically. However compilation of such class fails with message: 
"cannot find symbol
symbol  : class Override"

This is incorrect because classic applications should support annotations. The reason of the problem is that <javac> target in build-impl.xml completely replace bootclasspath with ${javacard.classic.bootclasspath}.

Suggested Fix:

The issue could be solved by prepending ${javacard.classic.bootclasspath} to standard bootclasspath instead of replacing it.  I.e. remove "bootclasspath" attribute from <javac> task and add the following nested element:

<compilerarg value="-Xbootclasspath/p:${javacard.classic.bootclasspath}"/>
Comment 1 _ tboudreau 2010-02-02 11:44:35 UTC
The suggested fix cannot be used.  It would allow users to compile code using java.lang.String, java.lang.Double and other things that cannot be done in Java Card projects.  

The Java license prohibits us from distributing alternate versions of classes from the JDK, so we cannot distribute our own version of the @Override annotation and put it on the compile-time classpath.

I will investigate eliminating the @Override annotation in Java Card code, through the Java editor APIs.  But really, the Java Card RI boot classpath JAR needs to contain the annotation.  

We have already dealt with a similar issue around the Java infrastructure assuming that java.lang.Object contained a hashCode() method.  Hopefully the fix will be simple.
Comment 2 _ tboudreau 2010-02-03 23:35:37 UTC
The java editor issue is fixed.  Will close this issue once I check the templates to make sure we are not pre-generating any code with @Override annotations.
Comment 3 _ tboudreau 2010-02-16 17:28:32 UTC
Verified working correctly with my hotfix of issue 180165.