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 198007 - error annotation shows up for a line that compiles without error
Summary: error annotation shows up for a line that compiles without error
Status: RESOLVED DUPLICATE of bug 198366
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.0
Hardware: PC Other
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 14:52 UTC by darbie
Modified: 2011-05-17 17:04 UTC (History)
0 users

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 darbie 2011-04-22 14:52:44 UTC
I just upgraded to Netbeans 7.0.  I have a couple of files where Netbeans highlights lines as having errors that the compiler can compile without issure.

The editor gives this message:

"reference to invokeMethod is ambiguous, both method <T>invokeMethod(java.lang.Object, java.lang.Object...) in org.powermock.reflect.Whitebox and method <T>invokeMethod(java.lang.String, java.lang.Object...) in org.powermock.reflect.Whitebox match"

Note that this code did not give me this message in Netbeans 6.9.1 and the code compiles fine in both Netbeans 6.9.1 and Netbeans 7.0. I am using jdk 6.0 for both versions of Netbeans.

The line of code that this is happening on looks something like this:

Subnet modifySubnet = WhiteBox.<Subnet>invokeMethod(aggregatingRMFSpy, method, subnet);

aggregatingRMFSpy is a Mockito spy object of a class
method is a String
subnet is an class

The PowerMock and Mockito imports in the file are:
import static org.mockito.AdditionalMatchers.not;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.never;

import static org.mockito.Mockito.verify;

import static org.powermock.api.mockito.PowerMockito.doNothing;
import static org.powermock.api.mockito.PowerMockito.doReturn;
import static org.powermock.api.mockito.PowerMockito.doThrow;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.spy;
import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
import static org.powermock.api.mockito.PowerMockito.when;
import static org.powermock.api.mockito.PowerMockito.whenNew;
Comment 1 Jan Lahoda 2011-05-17 17:04:45 UTC
This was a regression in JDK7's javac (which is used internally by the IDE). It was fixed recently there and we will pull the change for NetBeans 7.0.1.

*** This bug has been marked as a duplicate of bug 198366 ***