I'm seeing an interesting behavior in some of the code I inherited where there's a project with a dependency jar in which there exists a class with the same name and in the same package as a class in the project:

Eclipse project:

**src/com.abc.d.E**

depends on **XYZ.jar** in which there exists a **com.abc.d.E.class**

Just curious if this setup is legal in Java. According to Eclipse, which doesn't mark it as an error and allows to create a new class that shadows an existing class in a dependency jar, except when one tries to rename such an existing class in the workspace - then it produces the following warning: 

> 
> "Binary references to a refactored element have been found. They will
>  not be updated, which may lead to problems if you proceed."
> 
> 
> 

And then this forward refactoring is allowed. However, if one would like to refactor backwards to a conflicting name, the following message appears in Eclipse:

> 
> "Type named 'E' already exists in package 'com.abc.d'
> 
> 
> 

So is it 

* a correct Java
* an allowed inconsistency in Eclipse's behavior or
* .an Eclipse bug?

Thank you.