Assume we have two packages `p1` and `p2` and classes `p1.M1` extended by `p2.M12` as follows:

```
package p1;

public class M1 {
    void method1() {
        System.out.println("Method 1 called");
    }
}

package p2;

import p1.M1;

public class M12 extends M1 {
    void method2() {
        System.out.println("Method 2 called");
    }
}

```

Let's extend `M12` with `p2.B`:

```
package p2;

public class B extends M12 {

    public void doSomething()  {
        method1();
        method2();
    }
} 

```

This gives a compilation error as `method1`, being package-protected within `p1` is not visible in `p2`. `method2` is visible without problems.

Now let's extend `p2.M12` with `p1.A`:

```
package p1;

import p2.M12;

public class A extends M12 {

    public void doSomething() {
        method1();
        method2();
    }
}

```

Here I'm getting a compilation error for both `method2()` (which is understandable) *and* `method1()`:
[![The method method1 from the type M1 is not visible](https://i.stack.imgur.com/4P1Jv.png)](https://i.stack.imgur.com/4P1Jv.png)

My question is: why is the `method1` which is package-protected in the package `p1` is not visible in the class `A` from the same package `p1`?