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 256911 - NullPointerException at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process
Summary: NullPointerException at com.sun.tools.javac.comp.Analyzer$DiamondInitializer....
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.2
Hardware: All All
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 06:11 UTC by abien
Modified: 2016-05-27 08:49 UTC (History)
12 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 221457


Attachments
stacktrace (2.72 KB, text/plain)
2015-12-02 06:11 UTC, abien
Details
stacktrace (4.01 KB, text/plain)
2015-12-03 17:59 UTC, stefan79
Details
stacktrace (2.72 KB, text/plain)
2016-01-18 21:45 UTC, Maksim Khramov
Details
stacktrace (3.48 KB, text/plain)
2016-01-27 14:18 UTC, Exceptions Reporter
Details
stacktrace (2.72 KB, text/plain)
2016-02-03 10:30 UTC, terje7601
Details
stacktrace (2.72 KB, text/plain)
2016-02-08 13:34 UTC, Alexander Simon
Details
stacktrace (5.45 KB, text/plain)
2016-02-09 10:13 UTC, Alexander Simon
Details
stacktrace (5.53 KB, text/plain)
2016-02-12 15:28 UTC, Alexander Simon
Details
stacktrace (3.93 KB, text/plain)
2016-03-01 15:14 UTC, stefan79
Details
stacktrace (2.72 KB, text/plain)
2016-03-03 09:38 UTC, abien
Details
stacktrace (6.96 KB, text/plain)
2016-05-17 13:57 UTC, Vladimir Voskresensky
Details
stacktrace (5.90 KB, text/plain)
2016-05-26 08:21 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abien 2015-12-02 06:11:55 UTC
This bug was originally marked as duplicate of bug 253182, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201512011444)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b17, Java(TM) SE Runtime Environment, 1.8.0_66-b17
OS: Mac OS X

User Comments:
abien: Happened during browsing




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:245)
   at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:211)
   at com.sun.tools.javac.comp.Analyzer.lambda$analyze$72(Analyzer.java:383)
   at java.util.HashMap$EntrySet.forEach(HashMap.java:1035)
   at com.sun.tools.javac.comp.Analyzer.analyze(Analyzer.java:381)
   at com.sun.tools.javac.comp.Analyzer.analyzeIfNeeded(Analyzer.java:353)
Comment 1 abien 2015-12-02 06:11:58 UTC
Created attachment 157603 [details]
stacktrace
Comment 2 stefan79 2015-12-03 17:59:41 UTC
Created attachment 157650 [details]
stacktrace

Scrolled (mousewheel) in a currently opened Java-File.
Comment 3 Maksim Khramov 2016-01-18 21:45:39 UTC
Created attachment 158171 [details]
stacktrace

Editing next java class:

package javaapplication5;

import java.util.HashMap;

public class JavaApplication5 {

    private HashMap<String, Object> metadataMap;
    
    public JavaApplication5() {
        metadataMap = new HashMap<String, Object>();
    }
}

Invoke Find Usages for matadataMap field and click on found reference in Fin? Usages Window
Comment 4 Exceptions Reporter 2016-01-18 21:45:44 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=221457
Comment 5 Exceptions Reporter 2016-01-27 14:18:43 UTC
Created attachment 158251 [details]
stacktrace

Copy and Paste some code:
SpinnerValueFactory<javafx.util.Duration>
Comment 6 terje7601 2016-02-03 10:30:43 UTC
Created attachment 158361 [details]
stacktrace

To reproduce: create a class "NewClass.java" as below. Then double-click on "String" in "<String>(32);"



import java.util.ArrayList;

public class NewClass {
	
	public static void main(String[] args) {
		ArrayList<String> current_devices = new ArrayList<String>(32);
	}
	
}
Comment 7 terje7601 2016-02-03 10:31:59 UTC
To reproduce:
- create the class below
- double-click on "String" in "<String>(32);"



import java.util.ArrayList;

public class NewClass {

public static void main(String[] args) {
ArrayList<String> current_devices = new ArrayList<String>(32);
}

} 


Product Version: NetBeans IDE Dev (Build 201601130002)
Updates: Updates available
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 8 Alexander Simon 2016-02-08 13:34:48 UTC
Created attachment 158413 [details]
stacktrace

add local variable with <>
Comment 9 Alexander Simon 2016-02-09 10:13:48 UTC
Created attachment 158434 [details]
stacktrace

navigate in debugging view
Comment 10 Alexander Simon 2016-02-12 15:28:49 UTC
Created attachment 158479 [details]
stacktrace

click in test results
Comment 11 Exceptions Reporter 2016-02-12 15:28:53 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=221457
Comment 12 stefan79 2016-03-01 15:14:21 UTC
Created attachment 158696 [details]
stacktrace

Opened a Java-File.
Comment 13 abien 2016-03-03 09:38:21 UTC
Created attachment 158723 [details]
stacktrace

happened during lookup
Comment 14 Exceptions Reporter 2016-03-23 10:14:28 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=221457
Comment 16 Quality Engineering 2016-03-31 01:42:40 UTC
Integrated into 'main-silver', will be available in build *201603310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1d34b0f572e4
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #256911 - NullPointerException at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process - fixed.
Comment 17 Alexander Simon 2016-04-26 07:20:15 UTC
Still occurred
Comment 18 Mardonis 2016-05-04 15:04:37 UTC
I have come across this error while trying to copy and paste inside a diamond operator. It also does it when i decide instead to just delete inside the diamond and start to type. Thank you.
Example: List<Vector3f> vertices = new ArrayList<Vector3f>();

Error is as follows:
java.lang.NullPointerException
	at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:245)
	at com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:211)
	at com.sun.tools.javac.comp.Analyzer.lambda$analyze$74(Analyzer.java:383)
	at com.sun.tools.javac.comp.Analyzer$$Lambda$128/3916560.accept(Unknown Source)
	at java.util.HashMap$EntrySet.forEach(HashMap.java:1035)
	at com.sun.tools.javac.comp.Analyzer.analyze(Analyzer.java:381)
	at com.sun.tools.javac.comp.Analyzer.analyzeIfNeeded(Analyzer.java:353)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:706)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:723)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1205)
	at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:82)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:990)
	at com.sun.tools.javac.comp.Attr$ResultInfo.attr(Attr.java:494)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:635)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:704)
	at com.sun.tools.javac.comp.Attr.attribStatToTree(Attr.java:412)
	at com.sun.tools.javac.api.JavacTrees.attribStatToTree(JavacTrees.java:975)
	at com.sun.tools.javac.api.JavacTrees.getAttrContext(JavacTrees.java:935)
	at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:794)
	at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:156)
[catch] at org.netbeans.modules.javahints.TypoDetector.run(TypoDetector.java:158)
	at org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList.compute(CreatorBasedLazyFixList.java:148)
	at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:112)
	at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:58)
	at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:298)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 19 Mardonis 2016-05-04 15:07:22 UTC
(In reply to Mardonis from comment #18)
> I have come across this error while trying to copy and paste inside a
> diamond operator. It also does it when i decide instead to just delete
> inside the diamond and start to type. Thank you.
> Example: List<Vector3f> vertices = new ArrayList<Vector3f>();
> 
Product Version: NetBeans IDE Dev (Build nbms-and-javadoc-4208-on-20160314)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_45; Java HotSpot(TM) Client VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
User directory: C:\Users\Mardonis\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Mardonis\AppData\Local\NetBeans\Cache\8.0.2

> Error is as follows:
> java.lang.NullPointerException
> 	at
> com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:
> 245)
> 	at
> com.sun.tools.javac.comp.Analyzer$DiamondInitializer.process(Analyzer.java:
> 211)
> 	at com.sun.tools.javac.comp.Analyzer.lambda$analyze$74(Analyzer.java:383)
> 	at com.sun.tools.javac.comp.Analyzer$$Lambda$128/3916560.accept(Unknown
> Source)
> 	at java.util.HashMap$EntrySet.forEach(HashMap.java:1035)
> 	at com.sun.tools.javac.comp.Analyzer.analyze(Analyzer.java:381)
> 	at com.sun.tools.javac.comp.Analyzer.analyzeIfNeeded(Analyzer.java:353)
> 	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:706)
> 	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:723)
> 	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1205)
> 	at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:82)
> 	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:990)
> 	at com.sun.tools.javac.comp.Attr$ResultInfo.attr(Attr.java:494)
> 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:635)
> 	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:704)
> 	at com.sun.tools.javac.comp.Attr.attribStatToTree(Attr.java:412)
> 	at com.sun.tools.javac.api.JavacTrees.attribStatToTree(JavacTrees.java:975)
> 	at com.sun.tools.javac.api.JavacTrees.getAttrContext(JavacTrees.java:935)
> 	at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:794)
> 	at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:156)
> [catch] at
> org.netbeans.modules.javahints.TypoDetector.run(TypoDetector.java:158)
> 	at
> org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList.
> compute(CreatorBasedLazyFixList.java:148)
> 	at
> org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.
> run(LazyHintComputation.java:112)
> 	at
> org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.
> run(LazyHintComputation.java:58)
> 	at
> org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.
> run(JavaSourceAccessor.java:298)
> 	at
> org.netbeans.modules.parsing.impl.TaskProcessor.
> callParserResultTask(TaskProcessor.java:584)
> 	at
> org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.
> run(TaskProcessor.java:809)
> 	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
> 	at
> org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.
> execute(TaskProcessor.java:725)
> 	at
> org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.
> run(TaskProcessor.java:686)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
> 	at
> org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
> 	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
> 	at
> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 20 Vladimir Voskresensky 2016-05-17 13:57:32 UTC
Created attachment 159784 [details]
stacktrace

insert code into java file
Comment 21 markiewb 2016-05-26 08:21:48 UTC
Created attachment 159884 [details]
stacktrace

Background scanning
Comment 22 Vladimir Voskresensky 2016-05-27 00:16:52 UTC
50 dups