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 178240 - Editor allows int, float, double, long but JC-classic VM does not support them
Summary: Editor allows int, float, double, long but JC-classic VM does not support them
Status: RESOLVED FIXED
Alias: None
Product: javacard
Classification: Unclassified
Component: Java Card (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on: 163794
Blocks:
  Show dependency tree
 
Reported: 2009-12-07 06:58 UTC by dkuzmin
Modified: 2010-04-08 21:54 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 dkuzmin 2009-12-07 06:58:52 UTC
Create "classic library project" ClassicLibrary1, add this method to created class:

    public int getValue() {
        return 555;
    }

Build project.

Create "classic applet package", add ClassicLibrary1 project to dependencies using project properties or "libraries" entry in project window.

Change "process" method of generated applet:

    public void process(APDU apdu) {
        classiclibrary1.ClassicLibrary1 x = new classiclibrary1.ClassicLibrary1();
        ISOException.throwIt((short) x.getValue());
    }

Build project. Output:
----
[ INFO: ] Validating Command Line
[ INFO: ] Setting packaging information
[ INFO: ] Package is being created
[ INFO: ] Converter [v3.0.2]
[ INFO: ]     Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
warning: This package requires int support.
error: export file classiclibrary1.exp of package classiclibrary1 not found. 
----

File ClassicLibrary1\dist\classiclibrary1\javacard\classiclibrary1.exp is created by ClassicLibrary1 project build.

Build used is #98.
Comment 1 _ tboudreau 2010-02-16 19:26:56 UTC
Nothing I can do about this.  NetBeans internally uses javac, and Ant uses it to compile;  javac recognizes int as a keyword and compiles it.

Fixing this would at a minimum, require support from the Java module in the form of implementing issue 163794.  

Probably the right way to fix it would be:
 - Java Card RI ships its own patched javac so compilation will fail even when run by Ant
 - Java Platform module enhanced to allow a platform to specify some unsupported keywords / language features
   - Java source module enhanced to look for unsupported keywords / language features
      - Javac enhanced to use list of unsupported keywords/language features

Reducing to P3 - the build process will fail if you are using ints in a classic project.  There is no way to fix this from the Java Card side.
Comment 2 _ tboudreau 2010-04-08 21:54:33 UTC
Fixed - jcproject now uses hard-coded annotation processor to mark such things as errors.  Project can still be compiled, but packager prevents deployment.