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.
Summary: | NPE from Attr.visitMethodDef | ||
---|---|---|---|
Product: | java | Reporter: | Jesse Glick <jglick> |
Component: | Source | Assignee: | Dusan Balek <dbalek> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | issues |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Exception thrown immediately after, when trying CC on "f.sets"
Dump file Log file excerpt |
Description
Jesse Glick
2007-08-22 16:01:54 UTC
Created attachment 47073 [details]
Exception thrown immediately after, when trying CC on "f.sets"
After a restart, still does not work. After a restart with a deleted var/cache/, still does not work, and still get NPE. Created attachment 47077 [details]
Dump file
Seems it is not so random after all. In a fresh userdir, I cannot reproduce the nonfunctioning of the hint, though not the subsequent NPE. Also forgot to mention: in my own userdir, when trying CC for setSize, it shows the params as "arg1, arg2" though I have src.zip in my JDK. In the fresh userdir, they are shown correctly as "width, height". BTW with the new exception reporter, it would be a better idea for java/source to include all the dump information in the actual detail message of the stack trace, so you could just click Report Problem and have everything of interest sent. I also do not want my log dir filling up with *.dump files (currently I have dozens of them and there is nothing to rotate them). The problem with fix imports seems like a possible duplicate of issue #111976 (unless you actually saw it on a top-level class, which I have never seen myself). The exception is likely to be a different problem. What JDK are you exactly using (output from java -version would be helpful). Thanks. JDK 6u2, and this was on a top-level class. Aha, I can reproduce the non-functioning hint for toplevel class - it happens to me if there is neither package clause nor import section in the file. Presumably some bug in the codegen. The exception is more interesting, as it may be connected to our recent upgrade of javac - unfortunately I was not able to reproduce it so far. For the non-working import please see issue #113356. Right, changing summary of this therefore. I think I may have found something. I normally run on JDK 7 but have been forced to go back to JDK 6 for a while due to critical AWT bugs. However I still have JDK 7 sources associated with my default platform. I can reproduce this bug in my current userdir. Created attachment 47182 [details]
Log file excerpt
Yes, I can reproduce too, with rt.jar from JDK1.6 and src.zip from JDK1.7. When the sources do not match the binaries, we may not be able to make it work 100% (parameter names, etc.), but we should not throw the exception, I think. Dusan, could you please take a look. My JDK versions: java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b05) Java HotSpot(TM) Server VM (build 1.6.0_02-b05, mixed mode) java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b18) Java HotSpot(TM) Server VM (build 1.7.0-ea-b18, mixed mode) 1. Start the IDE with a clean userdir on JDK1.6 2. In Tools/Java Platforms change the associated sources to JDK1.7 src.zip 3. In this source: package javaapplication6; import javax.swing.JFrame; public class Main { public static void main(String[] args) { JFrame f = new JFrame(); f.s| } } call CC at the place marked with '|'. *** This issue has been marked as a duplicate of 114789 *** . *** Issue 114789 has been marked as a duplicate of this issue. *** *** Issue 115045 has been marked as a duplicate of this issue. *** I was most recently able to reliably get this error with the daily from September 14, 2007 when I did the following: Opened a smaller project that had the latest JDK 5.0 for OSX defined as the JDK for the project via Tools | Java Platforms. In this platform definition, I have the location of the JDK source also defined. In one source file, I created a new inner class, which extends JDialog. I wanted to double-check some implementation specifics of JDialog, so I highlighted 'JDialog' in this line: class ImportErrorDialog extends JDialog Did a right-click, chose Navigate | Go To Source. When the JDialog source file was opened - bang. I got the error. I just tried this again from scratch, and got a slightly different error. In this case, when I opened up NB 6, the JDialog .java source file was already open from the last time, but not the selected tab (the source file with the inner class that extends JDialog was the default open tab). I closed the JDialog tab. I again double-clicked on the 'JDialog' token on this line: class ImportErrorDialog extends JDialog Right-clicked on chose the menu option Navigate | Go To Source This time I got: java.lang.NullPointerException at org.netbeans.modules.swingapp.AppFrameworkSupport.getApplicationClassName(AppFrameworkSupport.java:151) at org.netbeans.modules.swingapp.AppFrameworkSupport.isFrameworkEnabledProject(AppFrameworkSupport.java:79) at org.netbeans.modules.swingapp.ActionManager.getActionManager(ActionManager.java:116) at org.netbeans.modules.swingapp.RescanTask.run(ActionRescanJavaSourceTaskFactoryImpl.java:61) at org.netbeans.modules.swingapp.RescanTask.run(ActionRescanJavaSourceTaskFactoryImpl.java:50) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1524) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) [catch] at java.lang.Thread.run(Thread.java:613) This is on Mac OSX, latest patches applied to OS, on latest JDK 5.0 for that platform. *** Issue 119432 has been marked as a duplicate of this issue. *** The last exception by tfrysinger is probably a different issue (in AppFrameworkSupport.getApplicationClassName), please report if separately. Fixed together with issue #102857. *** Issue 129134 has been marked as a duplicate of this issue. *** |