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 267411

Summary: IDE shows error annotations on lines that compiles fine
Product: java Reporter: _ gtzabari <gtzabari>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description _ gtzabari 2016-08-02 22:28:25 UTC
Product Version: NetBeans IDE Dev (Build 201607270002)
Java: 1.8.0_102; Java HotSpot(TM) 64-Bit Server VM 25.102-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_102-b14
System: Windows 10 version 10.0 running on amd64; UTF-8; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Repro steps:
1. hg clone https://bitbucket.org/cowwoc/guava-jdk8/
2. hg update b40ffdf
3. Open this Maven project in Netbeans
4. Open GuavaCollectors.java line 483.
5. Netbeans annotates this line with a compiler error:

incompatible types: Collector<E,LinkedHashMap<CAP#1,CAP#2>,ImmutableMap<CAP#1,CAP#2>> cannot be converted to Collector<E,?,ImmutableMap<K,V>>
  where E,K,V are type-variables:
    E extends Object declared in method <E,K,V>toImmutableMap(Function<? super E,? extends K>,Function<? super E,? extends V>)
    K extends Object declared in method <E,K,V>toImmutableMap(Function<? super E,? extends K>,Function<? super E,? extends V>)
    V extends Object declared in method <E,K,V>toImmutableMap(Function<? super E,? extends K>,Function<? super E,? extends V>)
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends K from capture of ? extends K
    CAP#2 extends V from capture of ? extends V

6. However, if you actually try building the project (F11) or compiling externally using "javac" you won't get a compiler error.

Netbeans flags many other lines/files in this project with compiler errors, but you will find that they are all false-positives.

Expected behavior: Error annotations should not occur.