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 183850 - Sources w/ different classpath marked with error badges
Summary: Sources w/ different classpath marked with error badges
Status: RESOLVED FIXED
Alias: None
Product: javacard
Classification: Unclassified
Component: Java Card (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks: 183851
  Show dependency tree
 
Reported: 2010-04-11 20:45 UTC by _ tboudreau
Modified: 2010-04-14 04:39 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 _ tboudreau 2010-04-11 20:45:25 UTC
In Java Card, "classic" (old Java Card 2) projects can include generated "proxies" to work with multi-threaded Java Card 3 projects.  So, for a shareable object, Java Card will generate a "proxy" object which synchronizes access to the non-threaded Java Card 2 object.  We support editing of these generated sources in Java Card 3 (by default they are just generated at compile time).

Proxy sources are in a specific directory for Java Card projects.  That directory has a different classpath which includes the Java Card 3 APIs.

org.netbeans.javacard.project.JCProject's ClassPathProvider provides the correct classpath - it detects if a source is in the proxies source directory and provides a different classpath.

Such sources are, correctly, not marked with errors.

However, the source file itself always has an error badge, and the following is logged:

WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Incorrect error badges detected, file=H:\tmp\ClassicApplet19\proxies\classicapplet19\proxy\Proxy1.java.
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute root=H:\tmp\ClassicApplet19\proxies, files in error=[file:/H:/tmp/ClassicApplet19/proxies/classicapplet19/proxy/Proxy1.java].

To reproduce:
1. Build javacard.kit and javacard.ri.bundle
2. Create a new Java Card > Classic Applet project.
3. Add the following classes:
package classicapplet19;
import javacard.framework.Shareable;
public interface X extends Shareable {
    public byte getFoo();
}
package classicapplet19;
public class XI implements X {
    public byte getFoo() {
        return 42;
    }
}
4. Right click the project and choose Generate SIO Proxies (this will add a new source root).
5. Open the generated Proxy1.java.  No error markings in the editor, but the file's node always has an error badge.

Is there some way to work around this with an additional source group or something?
Comment 1 Dusan Balek 2010-04-13 13:52:07 UTC
The problem is that while indexing the source root, the current Java language infrastructure uses the classpath provided for the source root directory to compile all sources under the given root (for performance reasons). On the other hand, when compiling source opened in editor, it uses the classpath provided for the given source.
So the JCProject's ClassPathProvider should not return the modified classpath only for sources under the proxies source directory but also for the proxies source directory itself.
Comment 2 _ tboudreau 2010-04-13 17:38:31 UTC
Fixed in main/ bdb30c264cb7
Comment 3 Quality Engineering 2010-04-14 04:39:21 UTC
Integrated into 'main-golden', will be available in build *201004140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bdb30c264cb7
User: Tim Boudreau <tboudreau@netbeans.org>
Log: #183850 and 183851 - generated proxy source files get error badged nodes