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 146963 - Editor shows error on MMAPI classes, but project can be compiled, with Java ME platform SDK 3.0, EA
Summary: Editor shows error on MMAPI classes, but project can be compiled, with Java M...
Status: RESOLVED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks: 162137
  Show dependency tree
 
Reported: 2008-09-11 15:11 UTC by martin_sladecek
Modified: 2010-09-23 12:40 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 martin_sladecek 2008-09-11 15:11:06 UTC
Classes that are both in MIDP and MMAPI are taken from MIDP in editor. Compiler uses right order of APIs on classpath.
Comment 1 Petr Suchomel 2008-09-25 14:51:33 UTC
There were some fixes in later releases. Does move to 6.0/6.1 helps you?
Comment 2 martin_sladecek 2008-09-25 14:59:02 UTC
sorry, the version should be 6.5
Comment 3 _ tboudreau 2008-11-12 16:42:47 UTC
Can you explain in more detail what the description of this bug means?  I do not understand it.
Comment 4 martin_sladecek 2008-11-12 17:08:32 UTC
When you edit code with Java ME platform SDK 3.0, EA set as platform, the usage of objects of classes from
javax.microedition.media package might be incorrectly marked as "with errors", but the project can be builded. The
problem is that the editor takes classes from MIDP before the classes from MMAPI. As there are some classes, which are
in both JSRs and they are extended in MMAPI, so the ones in MMAPI should be used.

E.g. PlayerListener.STOPPED_AT_TIME;
will be underlined as the static fields exists only in PlayerListener in MMAPI class.

The cause of this is probably different order of JSRs during the build time and when the editor checks for errors.
Comment 5 _ tboudreau 2008-11-17 23:49:02 UTC
Can you explain a bit about what the platform classpath looks like?  Is there a reason the SDK 3.0 needs multiple copies
of the same classes on the classpath?  That sounds like a bad idea.  A user is likely to code against features that may
not really exist in the deployment target.

Can't this be solved simply by multiple platform definitions depending on what is needed?  I think I'm missing something
here.
Comment 6 martin_sladecek 2008-11-19 08:44:29 UTC
I don't know how the Netbeans takes the classpath for editor and (probably a different one) during the build time.
There are the same classes on classpath, because the MIDP/MMAPI API is defined so, it's nothing SDK 3.0 specific.
Look here: http://java.sun.com/javame/reference/apis/jsr118/ and here http://java.sun.com/javame/reference/apis/jsr135/
(package javax.microedition.media ). When the user chooses MMAPI for his project, the classes from MMAPI should be used,
as they are more "advanced". The building process does so, the editor doesn't.
Comment 7 _ tboudreau 2009-07-19 08:50:23 UTC
We solved this for JavaCard by having project "flavors", and the platform's getClasspath() methods were overloaded to
pass an additional argument - but this required the supporting platform to identify which classes belonged to which
flavor (in a properties file).  

It would be a fairly brittle hack if the IDE is supposed to guess which JARs to include/not include, since there is no
requirement that all vendors package things the same way.
Comment 8 Adam Sotona 2010-09-23 12:40:22 UTC
This issue cannot be fixed on the Jar level as the mentioned class is already a part of MIDP Jar and could not be cut out. Mobility already manages the classpath Jars individually.

The only workaround is to change classpath ordering internally and this was already fixed. Please re-open if the issue still occurs.