Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 481742

Summary: Static Import Method reported as ambiguous even though more explicit import exists
Product: [Eclipse Project] JDT Reporter: Daniel Harp <Daniel.Harp>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Daniel Harp CLA 2015-11-09 11:34:01 EST

    
Comment 1 Daniel Harp CLA 2015-11-09 11:36:44 EST
Sorry, misclick submitted before I had all the details in.

Using Mockito 1.10.19 and Hamcrest 1.3, both CoreMatchers and Mockito have a startsWith(String) method.  Statically importing both, with an explicit reference for that method to use the CoreMatchers compiles with Oracle JDK 1.8, but eclipse complains that the startsWith() reference is ambiguous.

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.mockito.Mockito.*;
public class ExampleBug {
	public void bug() {
		startsWith("");
	}
}
Comment 2 Eclipse Genie CLA 2020-02-02 10:24:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.