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: | [68cat] NullPointerException at org.netbeans.module.copyfqn.actions.CopyFQNAction$1.run | ||
---|---|---|---|
Product: | editor | Reporter: | Michel Graciano <hmichel> |
Component: | -- Other -- | Assignee: | issues@editor <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | vstejskal |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 165663 |
Bug Depends on: | 179368 | ||
Bug Blocks: | |||
Attachments: | stacktrace |
Description
Michel Graciano
2010-02-24 09:37:10 UTC
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. |