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 - show "reference to xxx is ambiguous" where there is no ambiguous account to javac
Summary: show "reference to xxx is ambiguous" where there is no ambiguous account to j...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 198007 (view as bug list)
Depends on:
Blocks: 200024
  Show dependency tree
 
Reported: 2011-05-06 05:16 UTC by windli
Modified: 2012-03-29 15:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.