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 201324

Summary: Java Parser Errors, Dump Files, IDE gets confused
Product: java Reporter: bht <bht>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mmirilovic, tzezula
Priority: P2    
Version: 7.0.1   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:
Attachments: all files in log directory in zip file

Description bht 2011-08-25 13:35:18 UTC
Created attachment 110208 [details]
all files in log directory in zip file

I am getting so many errors that the IDE gets confused and stops marking files as erroneous.

During a conversion of large application from Wicket 1.4.to 1.5, initially there are many errors due to API changes.
I use Menu|Edit|Replace in Projects to fix the most obvious errors.

The new API has issues, too (source files missing) so I add these, too.

It is quite a mess initially, but the IDE should cope with this.

I guess it is all reproducible because I do this under subversion control.

Exception reporter linked me to 126271 from exception reporter bug Exception #525008.


Annotation: An error occurred during parsing of 'C:\_dt\app\gt1\jprj\G1\G1_W\src\java\web\g1\base\MemberApplication.java'. Please report a bug against java/source and attach dump file 'C:\Documents and Settings\Administrator\.netbeans\7.0\var\log\MemberApplication_4.dump'.
Annotation: An error occurred during parsing of 'C:\_dt\app\gt1\jprj\G1\G1_W\src\java\web\g1\base\MemberApplication.java'. Please report a bug against java/source and attach dump file 'C:\Documents and Settings\Administrator\.netbeans\7.0\var\log\MemberApplication_4.dump'.
An error occurred during parsing of 'C:\_dt\app\gt1\jprj\G1\G1_W\src\java\web\g1\base\MemberApplication.java'. Please report a bug against java/source and attach dump file 'C:\Documents and Settings\Administrator\.netbeans\7.0\var\log\MemberApplication_4.dump'.
An error occurred during parsing of 'C:\_dt\app\gt1\jprj\G1\G1_W\src\java\web\g1\base\MemberApplication.java'. Please report a bug against java/source and attach dump file 'C:\Documents and Settings\Administrator\.netbeans\7.0\var\log\MemberApplication_4.dump'.
Caused: java.lang.NullPointerException
	at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:773)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:674)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:701)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:595)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.visitNewClass(Flow.java:1362)
	at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1377)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.scanExpr(Flow.java:555)
	at com.sun.tools.javac.comp.Flow.visitVarDef(Flow.java:833)
	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:730)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:539)
	at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:547)
	at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:843)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:786)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:539)
	at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:547)
	at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:843)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:786)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:539)
	at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:771)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:674)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:701)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:595)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:539)
	at com.sun.tools.javac.comp.Flow.scanDef(Flow.java:525)
	at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:676)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:595)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:1557)
	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1328)
	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1288)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:457)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:436)
	at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:579)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:436)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:160)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:657)
	at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:224)
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:775)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Comment 1 bht 2011-08-26 01:06:27 UTC
Please refer to bug 201317
Comment 2 Dusan Balek 2011-09-01 13:28:26 UTC
Do you have a reproducible test case for the NPE (source(s) and exact steps to reproduce)? If so, could you please attach it to the issue? Thanks.
Comment 3 bht 2011-09-01 22:04:31 UTC
I was able to reproduce this with the following step by step procedure.

The difference is that while the errors are recorded in the log, they are not showing the red icon on the right of the status bar. Also the number of errors are probably less, but it would be great if this testcase would lead to the resolution of at least one kind of error.

- Create new userdir
- Extract WicketExamples from http://netbeans.org/bugzilla/attachment.cgi?id=94576 , from issue http://netbeans.org/bugzilla/show_bug.cgi?id=181173

- Start NetBeans with userdir
- Register GlassFish 3.1.1
- Open project WicketExamples
- In Project Properties|Libraries remove all apache-wicket prefixed jars
- Add a single jar wicket-core-1.5-RC6.jar from http://www.apache.org/dyn/closer.cgi/wicket/1.5-RC6
- Refer to renameing of classes with https://cwiki.apache.org/WICKET/migration-to-wicket-15.html

- Open the first file to see errors in the editor: ServerHostNameAndTimeFilter

The first error is on import org.apache.wicket.IResponseFilter;

Needs to be renamed:
org.apache.wicket.IResponseFilter
org.apache.wicket.response.filter.IResponseFilter

Leave the file open and do a Edit|Replace in Projects

Next Edit|Replace in Projects import org.apache.wicket.RequestCycle;

org.apache.wicket.RequestCycle
org.apache.wicket.request.cycle.RequestCycle 
(all future replace operations are like this, none in file scope)

wait until the scanning finishes.

replace
org.apache.wicket.util.string.JavascriptUtils
org.apache.wicket.util.string.JavaScriptUtils

replace
JavascriptUtils
JavaScriptUtils

Add jar file wicket-util-1.5-RC7.jar (or equivalent 1.5)

Open next file WicketExampleApplication

Replace 
org.apache.wicket.Request
org.apache.wicket.request.Request

Replace
org.apache.wicket.Response
org.apache.wicket.request.Response

Replace
org.apache.wicket.protocol.http.WebRequest
org.apache.wicket.request.http.WebRequest 

In ServerHostNameAndTimeFilter.java, check, need to

replace in sources folder

org.apache.wicket.request.Request.cycle.RequestCycle
org.apache.wicket.request.cycle.RequestCycle

Resolve IResponseFilter - add import

Replace
org.apache.wicket.IResponseFilter
org.apache.wicket.response.filter.IResponseFilter


Open
WicketExampleHeader.java

Continue with this process, adding missing jar files if required.

At THIS stage already, without going any further, I find multiple NullPointerException and others in the log. Not as bad as in the original case. There is an additional complications where one source file is missing from the distribution: org.apache.wicket.IClusterable

I added this to the application's source root at some stage, but I did not get to this stage in the testcase.
Comment 4 bht 2011-10-22 20:19:21 UTC
Marked duplicate of 204089. The testcase of thie could be useful, but closed because the testcase in 204089 is easier.

*** This bug has been marked as a duplicate of bug 204089 ***