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.
Java Card 3.0.4 classic specification is introducing a syntax using the String type in a new annotation which allows an annotation processor to create source files with declarations of pre-initialized byte arrays with the UTF-8 representation to correspond to the String constants. To support this feature, please upadte the template used for creating a classic applet application project's build-impl.xml file to include support for the annotation processor when the java card platform is a 3.0.4 or higher (defined by the property javacard.version=3.0.4 in the platform.properties file). The annotation processor may be invoked in the compile target as shown below : <target name="compile" depends="-init"> <javac destdir="${build.classes.dir}" source="${javac.source}" target="${javac.target}" nowarn="${javac.deprecation}" debug="${javac.debug}" optimize="no" bootclasspath="${javacard.classic.bootclasspath};${jcdk.lib}/api_classic_annotations.jar" includeAntRuntime="no"> <src path="${src.dir}"/> <src path="${build.classes.dir}"/> <classpath id="compile.path"/> <compilerarg line="-processor com.oracle.javacard.stringproc.StringConstantsProcessor -processorpath \\'${jcdk.lib}/tools.jar;${jcdk.lib}/api_classic_annotations.jar\\'"/> </javac> <condition property="compile.proxies"> <and> <isset property="use.my.proxies"/> <equals arg1="${use.my.proxies}" arg2="true"/> <available file="${src.proxies.dir}" type="dir"/> </and> </condition> <copy todir="${build.classes.dir}"> <fileset dir="${src.dir}" includes="${includes}" excludes="${excludes}"/> </copy> </target>
One other small change is required to support clean Java Card 3.0.4 classic applet development using the string annotation feature. The language subset checker wizard needs to allow the use of the new string annotation declarations and the underlying "String" type and not flag syntax errors during editing. The Class that needs to be updated for allowing classic applets to use String literals in the StringAnnotations is javacard.project/src/org/netbeans/modules/javacard/source/JavaCardErrorProcessor.java. This class lists the types that classic and extended do not support. It should be modified so that for classic, when encountering a String literal it checks first if it is being used within one of the String annotations or not. If not it should flag it as an error. Alternatively, it could be implemented with a tree visitor that visits Annotations and switches off the type usage checks when the annotation is one of the StringSupport annotations.
Implemented. http://hg.netbeans.org/jet-main/rev/403ab50ea912 http://hg.netbeans.org/jet-main/rev/bb0c27d96dfc http://hg.netbeans.org/jet-main/rev/a43844e48e66 http://hg.netbeans.org/jet-main/rev/6e8a32cde317 http://hg.netbeans.org/jet-main/rev/38f454540b5d