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 227190 - java.lang.NullPointerException from Java Text Copy Paste Module
Summary: java.lang.NullPointerException from Java Text Copy Paste Module
Status: NEW
Alias: None
Product: updatecenters
Classification: Unclassified
Component: Pluginportal (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: _ wadechandler
Depends on:
Reported: 2013-03-07 23:16 UTC by ent38
Modified: 2013-03-12 08:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description ent38 2013-03-07 23:16:36 UTC
NPE on some operations
Comment 1 ent38 2013-03-07 23:20:56 UTC
I get a NPE on some operations:

	at org.netbeans.modules.javatextcopypaste.CopyUtils.copyJavaText(
	at org.netbeans.modules.javatextcopypaste.CopyAsTextWithNewlinesAndNoJavaNewlines.performAction(
	at org.openide.util.actions.NodeAction$DelegateAction$
	at org.openide.util.actions.ActionInvoker$
	at org.openide.util.actions.ActionInvoker.doPerformAction(
	at org.openide.util.actions.ActionInvoker.invokeAction(
	at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.AbstractButton.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$400(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at org.netbeans.core.TimableEventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(
[catch] at

To reproduce this bug case :
- Open a Java file and select the entire content
- make a regular copy (Ctrl + C)
- put the cursor to the end of the file
- use the "Copy as text - keep all escaped newlines and no java newlines"
- an NPE is thrown

Verified with NB 7.3 on Windows 7 32-bit, with JDK6u43 and JDK7u17. Clean installation and profile.

Could you take a look at this ? Thx.
Comment 2 Jiri Kovalsky 2013-03-11 14:30:06 UTC
Thanks Jonathan for finding the issue and reporting it to Bugzilla. However, I must ask you to change your NoGo verdict to Go if you didn't find any violations of substantial plugin requirements described in the Plugin Portal Quality Criteria [1] document. Thanks for your understanding.

Comment 3 _ wadechandler 2013-03-11 14:54:00 UTC
Thank you very much for finding the bug. It is related to using the copy methods when no selection is made. For now, most users will not do that under normal conditions, but I will definitely fix this, and will republish as soon as I can. In the mean time, it is still very usable for those who have been using the plugin. This issue seems to have been hanging around for years now with nobody reporting it or finding it. You therefore are a very good and thorough tester :-). But yes, I will fix that issue as soon as I can, and if you could go ahead and give it a go for now, it will still be useful to those who use it, as it doesn't crash the IDE, mangle any data, but gives an error message when that happens. If the user selects data again, then it will work as normal during the cases it is meant to be used.
Comment 4 ent38 2013-03-11 17:32:17 UTC
Oops, sorry for the NoGo vote; it was a bit extreme :p
Corrected the vote.
Comment 5 Jiri Kovalsky 2013-03-12 08:49:38 UTC
No problem, changing description accordingly. Thank you guys.