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 75818 - AssertionError from NNMDRListener when IDE runs with -J-Dnetbeans.javacore.noscan=true
Summary: AssertionError from NNMDRListener when IDE runs with -J-Dnetbeans.javacore.n...
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2006-05-03 09:44 UTC by Jiri Skrivanek
Modified: 2006-06-21 14:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception stack trace (735 bytes, text/plain)
2006-05-03 09:45 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2006-05-03 09:44:35 UTC
The following AssertionError is thrown when you run IDE with
-J-Dnetbeans.javacore.noscan=true and create a Java project from template:

java.lang.AssertionError: Java Extent for classpath root
...\JavaApplication1\src wasn't resolved.

It applies for any project type. Marking P2 because AssertionError is important
thing and because it breaks automated tests.

Build NB55 Beta 200605030200, JDK1.5.0_06, WindowsXP.
Comment 1 Jiri Skrivanek 2006-05-03 09:45:13 UTC
Created attachment 30196 [details]
Exception stack trace
Comment 2 Martin Adamek 2006-05-03 10:37:51 UTC
Interesting. This may have some major implication in initial annotation parsing.
I will investigate more.
Comment 3 Martin Adamek 2006-05-03 10:43:22 UTC
According to Tomas, main point of this flag was disabling of modal scanning in
NB 4.0/4.1, mainly for tests that doesn't use JMI (this use-case is probably
still valid?). Flag should not be used for normal work with IDE.
Comment 4 Jiri Skrivanek 2006-05-03 10:53:22 UTC
Yes, we use this flag to speed-up tests which don't need scanning.
Comment 5 Tomas Hurka 2006-05-03 10:59:42 UTC
This is nonsense. Java project needs to use JMI. Please do not use this flag. There is no point using it for 
NB 5.0 / NB 5.5
Comment 6 Jiri Skrivanek 2006-05-03 11:06:32 UTC
If it is nonsense, should I file a bug to remove this flag from NetBeans code
base? Otherwise why not to use it when you want for example test deploying of
web application? Scanning is just wasting of time in this case.
Comment 7 Jiri Skrivanek 2006-05-03 11:41:28 UTC
I would suggest to remove assertion. Or use just informational severity and log
message only. Null checking is at next line and it seems to be harmless if
method NNMDRListener.resolveType() returns null. 

        assert jmp != null : "Java Extent for classpath root " +
FileUtil.getFileDisplayName(cp.getRoots()[0]) + 
                " wasn't resolved. Probably called BEFORE the root was added to
GlobalPathRegistry?";
        if (jmp == null) {
            return null;
        }
Comment 8 Tomas Hurka 2006-05-03 12:07:58 UTC
It is nonsense to use it when you create new Java project. It does no harm when you use it for openide or 
core tests. Deploying to web server may be fine too, but I do not know what code is involved when you do 
it. 
Comment 9 Daniel Prusa 2006-06-21 13:18:57 UTC
assertion check in NNMDRListener supressed when netbeans.javacore.noscan=true

/cvs/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/Attic/NNMDRListener.java
new revision: 1.1.2.14; previous revision: 1.1.2.13
Comment 10 Jiri Skrivanek 2006-06-21 14:53:09 UTC
Verified. Thanks.