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 200804020004) VM: Java HotSpot(TM) Client VM, 1.5.0_13-119, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-237 OS: Mac OS X, 10.5.2, i386 User Comments:
Created attachment 59547 [details] stacktrace
Created attachment 59569 [details] stacktrace
This issue has already 5 duplicates
Build: NetBeans IDE 6.1 RC1 (Build 200804100130) VM: Java HotSpot(TM) Client VM, 1.5.0_15-b04, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_15-b04 OS: Windows 2000, 5.0, x86 User Comments:
Created attachment 60308 [details] stacktrace
Reassigning to new module owner mslama.
Build: NetBeans IDE 6.1 (Build 200804211638) VM: Java HotSpot(TM) Client VM, 1.5.0_13-121, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-241 OS: Mac OS X, 10.4.11, i386 User Comments:
Created attachment 60910 [details] stacktrace
This issue has already -1 duplicates
This issue has already 50 duplicates
Created attachment 61523 [details] stacktrace
Created attachment 61754 [details] stacktrace
Created attachment 62089 [details] stacktrace
Created attachment 62512 [details] stacktrace
Created attachment 62513 [details] stacktrace
Created attachment 62571 [details] stacktrace
This issue has already 100 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=41469
JTextComponent.getCaret() returns null but there is no check for it in Swing BasicTextUI.TextDropTargetListener.restoreComponentStateForDrop. I am not able to reproduce this issue. It happens only on JDK 5. On JDK 6 code in BasicTextUI is completely changed - this inner class is not there anymore. Is there any way how to reproduce it? Our QuietEditorPane overwrites setCaret(Caret) method. Caret can be null only during reinstallation of UI. Caret is set to null for short time only when editor is being opened. It should not be null during editing/drag&drop. Call of TextDropTargetListener.restoreComponentStateForDrop is performed only when drop is performed. When this problem happens does it have any consequence in editor. Is text dropped? Is there any problem? If only this exception is shown but otherwise editor functionality is not broken we could catch this exception in QuietEditorPane and just log it to IDE log. I filed issue #6717829 against Swing/JDK.
Created attachment 63570 [details] stacktrace
Created attachment 63623 [details] stacktrace
Build: NetBeans IDE 6.1 (Build 200805300101) VM: Java HotSpot(TM) Client VM, 1.5.0_15-b04, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_15-b04 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2114) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:385) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 65658 [details] stacktrace
there is lot of duplicate (171) of this issue. Probably not all the duplicates are the same but anyway lot of duplicates. Are we able to fix or workaround? Or is it jdk bug?
Build: NetBeans IDE 6.1 (Build 200805300101) VM: Java HotSpot(TM) Client VM, 1.5.0_13-121, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-241 OS: Mac OS X, 10.4.11, i386 User Comments: Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2115) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:385) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 69685 [details] stacktrace
Build: NetBeans IDE Dev (Build 080929) VM: Java HotSpot(TM) Client VM, 1.5.0_13-121, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-241 OS: Mac OS X, 10.4.11, i386 User Comments: 1. Created web application with JSF framework. 2. DnD "Use Bean" component to the page, but pressed Esc button in appeared dialog. Result: NullPointerException arises. Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2115) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:419) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 70809 [details] stacktrace
Build: NetBeans IDE Dev (Build 200809300201) VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284 OS: Mac OS X, 10.5.5, i386 User Comments: Just d'n'd selected line of text in build.xml file (freeform project) Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2115) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:419) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 70915 [details] stacktrace
It looks like side effect of JDK issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511815. Closing as WONTFIX. Fixed in JDK 7(b09), 6u2(b02).
Second NPE does not happen when reproducing with web project so probably not the same issue. Reopening. I will check if we can do anything now when we have reproducible case.
*** Issue 148846 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE Dev (Build 081002) VM: Java HotSpot(TM) Client VM, 1.5.0_14-b03, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_14-b03 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2114) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:419) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 71133 [details] stacktrace
Build: NetBeans IDE Dev (Build 200810060201) VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284 OS: Mac OS X, 10.5.5, i386 User Comments: DnD line in java editor. Just simple class was opened, nothing special. Stacktrace: java.lang.NullPointerException at javax.swing.plaf.basic.BasicTextUI$TextDropTargetListener.restoreComponentStateForDrop(BasicTextUI.java:2115) at javax.swing.plaf.basic.BasicDropTargetListener.drop(BasicDropTargetListener.java:259) at javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:614) at org.openide.text.QuietEditorPane$DelegatingDropTarget.drop(QuietEditorPane.java:419) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
Created attachment 71176 [details] stacktrace
We have fix for this. Waiting for qa feedback. I will update JDK bug info. Shortly: We have inner class QuietEditorPane.DelegatingDropTarget extends java.awt.dnd.DropTarget we either process drop event here or delegate to standard DropTarget. Problem is that DropTargetListener is registered 2 times once in Swing when UI is installed and second time when our addDropTargetListener is called by Swing when editor kit is set. There is no check in Swing that the same listener is added two times. Current drop event processor in BasicTextUI does not handle seocnd call well as first call clean context so component is null when second listener call is processed. It is changed completely in JDK 6. Workaround in our code is first call removeDropTargetListener and then addDropTargetListener to make sure listener is registered as least once and only once (provided it was not registered before or was registered juts once).
Fixed core-main #0b091f567548
Verified.
Integrated into 'main-golden', will be available in build *200810090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/0b091f567548 User: Marek Slama <mslama@netbeans.org> Log: #131830: Register DropTargetListener just once.
*** Issue 149316 has been marked as a duplicate of this issue. ***