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.
Build: NetBeans IDE Dev (Build 100224-bf5861cd660c) VM: Java HotSpot(TM) Client VM, 16.0-b13, Java(TM) SE Runtime Environment, 1.6.0_18-b07 OS: Linux Stacktrace: java.lang.NullPointerException at org.netbeans.module.copyfqn.actions.CopyFQNAction$1.run(CopyFQNAction.java:127) at org.netbeans.module.copyfqn.actions.CopyFQNAction$1.run(CopyFQNAction.java:115) at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:474) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:151) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:135) at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:190)
Created attachment 94491 [details] stacktrace
It happens if we use EditorRegistry.focusedComponent()/Registry.getMostActiveDocument() instead EditorRegistry.lastFocusedComponent(). Looks like this is an regression of issue #179368. BTW, the CopyFQN module was already fixed. To reproduce it, just change the o.n.m.copyfqn.actions.CopyFQNAction:126 and follow these step: 1-Run the changed plugin; 2-Open any java class file; 3-Select any element, an class for example; 4-Go to Edit > Copy FQN and the exception is thrown. If you use the shortcut instead (Ctrl+J Ctrl+C) everything works fine, what I understand is that the editor hos no longer the focus when the action is invoked by menu item.
(In reply to comment #2) > It happens if we use > EditorRegistry.focusedComponent()/Registry.getMostActiveDocument() instead > EditorRegistry.lastFocusedComponent(). Looks like this is an regression of > issue #179368. In this particular case using ER.lastFC() is the right thing to do. I'll look at the changes done for issue #179368 and see if other places need fixing too. But in general R.getMAD() may have returned null and so any code calling it should have been prepared to handle nulls. > BTW, the CopyFQN module was already fixed. So, this is no longer a problem for CopyFQN, right? No one else has complained yet, so I guess the regression is not that bad. Nevertheless I'm going to doublecheck what the changes.
Yes, CopyFQN is already fixed and is no longer a problem. My compain is just about any regression in another places. Thanks for your help.
http://hg.netbeans.org/jet-main/rev/439d8ed95829 http://hg.netbeans.org/main/contrib/rev/e4264700a316