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 252230 - NullPointerException at com.sun.tools.javac.model.JavacTypes.asMemberOf
Summary: NullPointerException at com.sun.tools.javac.model.JavacTypes.asMemberOf
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 14:00 UTC by lhochet
Modified: 2015-09-05 03:03 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 217105


Attachments
stacktrace (1.53 KB, text/plain)
2015-05-04 14:00 UTC, lhochet
Details
stacktrace (1.53 KB, text/plain)
2015-05-05 09:09 UTC, Jiri Skrivanek
Details
stacktrace (1.53 KB, text/plain)
2015-05-11 22:34 UTC, _ tboudreau
Details
stacktrace (1.53 KB, text/plain)
2015-05-27 20:58 UTC, _ tboudreau
Details
stacktrace (1.53 KB, text/plain)
2015-06-03 13:47 UTC, Vladimir Riha
Details
stacktrace (1.53 KB, text/plain)
2015-06-25 09:20 UTC, Vladimir Riha
Details
stacktrace (1.53 KB, text/plain)
2015-07-15 11:32 UTC, Jiri Skrivanek
Details
stacktrace (1.53 KB, text/plain)
2015-09-02 22:33 UTC, atehrani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lhochet 2015-05-04 14:00:46 UTC
Build: NetBeans IDE Dev (Build 201505040001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b12, Java(TM) SE Runtime Environment, 1.8.0_60-ea-b13
OS: Windows 7

User Comments:
lhochet: In the progress of adjusting some code, sample after is a reduction of the actual code that produces the exception for any attempt to modify it, it seems it is important that it is a DirectoryStream as replacing with Closeable does no longer produce the NPE (generics removed in the process of reducing the sample):

import java.nio.file.DirectoryStream;
public class NewClass
{
  private static void test()
  {
    try (DirectoryStream stream = null)
    {
      {
    }
    catch (IOException ex) {}
  }
}




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.model.JavacTypes.asMemberOf(JavacTypes.java:281)
   at org.netbeans.modules.java.hints.errors.UncaughtException.run(UncaughtException.java:244)
   at org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList.compute(CreatorBasedLazyFixList.java:147)
   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)
Comment 1 lhochet 2015-05-04 14:00:48 UTC
Created attachment 153514 [details]
stacktrace
Comment 2 Jiri Skrivanek 2015-05-05 09:09:40 UTC
Created attachment 153523 [details]
stacktrace

I removed catch block and method became uncompilable.
Comment 3 _ tboudreau 2015-05-11 22:34:33 UTC
Created attachment 153605 [details]
stacktrace

Typing in editor
Comment 4 Exceptions Reporter 2015-05-25 20:13:18 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=217105
Comment 5 _ tboudreau 2015-05-27 20:58:27 UTC
Created attachment 153910 [details]
stacktrace

Pasting
Comment 6 Vladimir Riha 2015-06-03 13:47:17 UTC
Created attachment 154036 [details]
stacktrace

pasted code from one class to another and used code completion
Comment 7 Vladimir Riha 2015-06-25 09:20:42 UTC
Created attachment 154388 [details]
stacktrace

copy pasted java code from one method to another
Comment 8 Jiri Skrivanek 2015-07-15 11:32:32 UTC
Created attachment 154649 [details]
stacktrace

I pasted block of code to a method.
Comment 9 atehrani 2015-09-02 22:33:26 UTC
Created attachment 155842 [details]
stacktrace

Copy/paste
Comment 10 Exceptions Reporter 2015-09-04 09:39:38 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=217105
Comment 11 Dusan Balek 2015-09-04 12:17:39 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/f72eaf5d318e
Comment 12 Quality Engineering 2015-09-05 03:03:01 UTC
Integrated into 'main-silver', will be available in build *201509050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f72eaf5d318e
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #252230 - NullPointerException at com.sun.tools.javac.model.JavacTypes.asMemberOf - fixed.