I have a class which contains:
- a public, static inner enum
- private constants referring to an int and to the enum
- a private inner class
Referring to the enum constant from inside the inner class generates a synthetic accessor warning, but referring to the int constant does not.
Why is this? How can I prevent this warning without making the enum constant package scope or disabling the warning? (e.g. perhaps by making an explicit accessor?)
Code reproducing the problem:
public class Outer {
    public static enum Bar {
        A, B, C;
    }
    private static final int FOO = 0;
    private static final Outer.Bar BAR = Outer.Bar.A;
    private class Inner {
        {
            int foo = Outer.FOO;        // just fine
            Outer.Bar bar = Outer.BAR;  // synthetic accessor method warning
        }
    }
}
 
    