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 226892 - NullPointerException at com.sun.tools.javac.code.Scope.enter
Summary: NullPointerException at com.sun.tools.javac.code.Scope.enter
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 14:21 UTC by Jiri Prox
Modified: 2013-08-29 12:48 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 197183


Attachments
stacktrace (5.84 KB, text/plain)
2013-03-01 14:21 UTC, Jiri Prox
Details
stacktrace (2.18 KB, text/plain)
2013-03-01 14:45 UTC, Jiri Prox
Details
stacktrace (3.15 KB, text/plain)
2013-03-27 11:54 UTC, Ralph Ruijs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2013-03-01 14:21:24 UTC
Build: NetBeans IDE Dev (Build 201302282300)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b19, Java(TM) SE Runtime Environment, 1.8.0-ea-b78
OS: Windows 7

User Comments:
GUEST: coding

jiriprox: NPE when typing in editor.

Last action was using cc to finish 's.concat'

package test;

import java.util.ArrayList;
import java.util.ListIterator;

/**
 * Demonstrate list never added to
 */
public class Test {

    public void m(String s) {
	int x = 3;
	switch (x) {
	    case 1:
		break;
	    case 2:
		String ss = s.concat(str)
		int z =
		break;
	}
    }
}




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.code.Scope.enter(Scope.java:214)
   at com.sun.tools.javac.code.Scope.enter(Scope.java:202)
   at com.sun.tools.javac.code.Scope.enter(Scope.java:198)
   at com.sun.tools.javac.comp.Attr.addVars(Attr.java:1313)
   at com.sun.tools.javac.comp.Attr.visitSwitch(Attr.java:1297)
   at com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1069)
Comment 1 Jiri Prox 2013-03-01 14:21:26 UTC
Created attachment 132068 [details]
stacktrace
Comment 2 Jiri Prox 2013-03-01 14:45:07 UTC
Created attachment 132069 [details]
stacktrace

NPE when intriducing local variable

package test;

import java.util.ArrayList;
import java.util.ListIterator;

/**
 * Demonstrate list never added to
 */
public class Test {

    public void m(String s) {
	int x = 3;
	switch (x) {
	    case 1:
		break;
	    case 2:
		String ss = s.concat("");
	final String substring = ss.substring(1, 2);
		String z = substring;
		System.out.println(z);
		break;
	}
    }
}
Comment 3 Exceptions Reporter 2013-03-01 14:45:13 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=197183
Comment 4 Ralph Ruijs 2013-03-27 11:54:43 UTC
Created attachment 133128 [details]
stacktrace

pasted some java code
Comment 6 Quality Engineering 2013-04-18 02:18:34 UTC
Integrated into 'main-golden', will be available in build *201304172301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f588b452dccc
User: Dusan Balek <dbalek@netbeans.org>
Log: Issues #225450, #226892, and #226509 fixed.
Comment 7 Jiri Prox 2013-08-29 12:48:50 UTC
v.