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 198366

Summary: show "reference to xxx is ambiguous" where there is no ambiguous account to javac
Product: java Reporter: windli <windli>
Component: CompilerAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal CC: darbie, MarkFlacy
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 200024    

Description windli 2011-05-06 05:16:15 UTC
Test code
public class ErrorTest {
    public static void main(String[] args) {
        try{
            
        }catch(Exception ex)
        {
            error ("error",ex); 
        }
    }

    public static void error(Object object, Object... params) {
    }

    public static void error(Object object, Throwable t, Object... params) {
    }
}

error ("error",ex);  will refer to error(Object object, Throwable t, Object... params),compile well but show a  "reference to error is ambiguous" hint. Not find a way to turn off this hint.
The exactly error functions signature are used by oralce, comes from:
http://docs.jboss.org/seam/2.2.2.Final/api/org/jboss/seam/log/Log.html

These false hints make it not easier for seam users to figure out the real issues.
Comment 1 Jan Lahoda 2011-05-09 08:05:54 UTC
Sadly, this is a regression in JDK7's javac, which we pulled to NetBeans:
http://hg.openjdk.java.net/jdk7/tl/langtools/rev/b1c98bfd4709

We will need to resolve this somehow.
Comment 2 Jan Lahoda 2011-05-17 17:04:45 UTC
*** Bug 198007 has been marked as a duplicate of this bug. ***
Comment 3 Jan Lahoda 2011-05-23 09:13:26 UTC
Has been fixed in javac as:
http://hg.openjdk.java.net/jdk7/tl/langtools/rev/a2d422d480cb

Merged in NetBeans trunk:
http://hg.netbeans.org/jet-main/rev/53ba77cc23c4

Transplated into NetBeans 7.0.1:
http://hg.netbeans.org/releases/rev/7dcf36a223b2
Comment 4 psilvaggio 2011-06-06 20:30:05 UTC
Downloaded nightly 2011-06-04 (1000).

Using Oracle JDK 1.6.0_25.

Still having issue:

reference to executeUpdate is ambiguous, both method executeUpdate(javax.persistence.EntityManager,java.lang.String,java.lang.Object...) in com.expretio.commons.persistence.jpa.hibernate.NativeQueryHelper and method executeUpdate(javax.persistence.EntityManager,java.lang.String,boolean,java.lang.Object...) in com.expretio.commons.persistence.jpa.hibernate.NativeQueryHelper match
Comment 5 initialzero 2012-03-29 15:34:12 UTC
This is happening with 7.1.1 using jdk5 for the project and jdk1.7.0_03 for netbeans on Windows 7. The editor says they are ambiguous however jdk5 compiles it just fine. 

logWrite(Level level, Object... params)

and

logWrite(Level level, int stack, Object... params)
Comment 6 Jan Lahoda 2012-03-29 15:40:56 UTC
The variant of the scenario that includes primitive types is covered by bug #200024. Sorry, but the behavior is considered to adhere to the language specification. Please see that bug for more details. Thanks and sorry.