title: Can someone explain this Java scoping mystery?
body: <p>A peer at work has extended LinkedHashMap, and overridden <code>removeEldestEntry</code> similar to:</p>
  
  <pre><code>import java.util.LinkedHashMap;
  import java.util.Map.Entry;
  
  public class CompileTest {
      static class MyMap&lt;K, V&gt; extends LinkedHashMap&lt;K, V&gt; {
          protected boolean removeEldestEntry(Entry&lt;K, V&gt; eldest) {
              return true;
          }
      }
  }
  </code></pre>
  
  <p>Notice the parameter class is <code>Entry</code>, not <code>Map.Entry</code>.<br>
  Eclipse generated the method signature. IntelliJ shows an error complains that <code>Entry</code> has private access in <code>java.util.LinkedHashMap</code>, and prefers <code>Map.Entry</code>. But it still compiles either way. </p>
  
  <p>I wrote a smaller example to experiment:</p>
  
  <pre><code>public class CompileTest {
  
      static class A{
          public class Inner {
          }
  
          public void doStuff(Inner a){}
      }
  
      static class B extends A{
          private class Inner {
          }
      }
  
      static class C extends B {
          public void doStuff(Inner a) { }
      }
  }
  </code></pre>
  
  <p>Now IntelliJ does not show an error, but the class fails to compile. Here are 2 situations that seem the same, where both the IDE and the compiler seem to alternate behaviors and also never agree with each other.</p>
  
  <p>Can someone explain this?</p>