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 231050 - [Introduce variable] NPE when extracting null variable
Summary: [Introduce variable] NPE when extracting null variable
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 230651 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-10 20:29 UTC by markiewb
Modified: 2013-06-13 12:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2013-06-10 20:29:43 UTC
[ BUILD # :  20130610000 ]
[ JDK VERSION : 1.7.0_17 ]

* use this code snippet
<code>
package javaapplication2;
public class JavaApplication2 {
    public static void main(String[] args) {
        foo(null);
    }
    private static void foo(Object object) {}
}
</code>
* introduce variable for 'null' -> NPE

java.lang.NullPointerException
	at
org.netbeans.modules.java.hints.introduce.IntroduceHint.resolveType(IntroduceHin
t.java:1557)
	at
org.netbeans.modules.java.hints.introduce.IntroduceHint.access$1000(IntroduceHin
t.java:160)
	at
org.netbeans.modules.java.hints.introduce.IntroduceHint$IntroduceFix$1.run(Intro
duceHint.java:1627)
	at
org.netbeans.modules.java.hints.introduce.IntroduceHint$IntroduceFix$1.run(Intro
duceHint.java:1617)
	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:644)
	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:634)
	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:488)
	at
org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:
586)
	at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.
java:155)
	at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.
java:139)
	at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:201)
	at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:198)
	at
org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(Fi
leChangedManager.java:176)
	at
org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedEx
tensions.java:360)
	at
org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
	at
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:1
98)
	at
org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
	at
org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:43
8)
	at
org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:409)
	at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:655)

	at
org.netbeans.modules.java.hints.introduce.IntroduceHint$IntroduceFix.implement(I
ntroduceHint.java:1617)
[catch] at org.netbeans.modules.editor.hints.HintsUI$1.run(HintsUI.java:800)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
Comment 1 Jan Lahoda 2013-06-11 12:50:29 UTC
*** Bug 230651 has been marked as a duplicate of this bug. ***
Comment 2 Quality Engineering 2013-06-13 01:18:47 UTC
Integrated into 'main-golden', will be available in build *201306122301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/38eb2cc4dbfb
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #231050: when resolving target type, also accept valid method invocations.
Comment 3 Jan Lahoda 2013-06-13 04:58:06 UTC
Fixed by the above changeset.
Comment 4 markiewb 2013-06-13 12:09:58 UTC
Verified 201306122301