I work in Java and come across an incredibly weird bug. I have a very simple class:
public class ClassA{ private static Logger log = Logger.getLogger(ClassA.class.getName()); private boolean trace; public ClassA(){ trace = log.isTraceEnabled(); } public void doSomething(){
I can use this class in my current project. However, when I create, package, and install on my local repo (using Maven, without creating a remote artifact repository), other projects cannot use this class correctly because they cannot create it. When I try something like:
ClassA classA = new ClassA();
I get the following compilation error:
ClassA() has private access in [package].ClassA
I decompiled .jar in my local repo to make sure the constructor is present and is publicly available. I also used the -U flag to force the update, and compilation continues to fail. What can cause this error?
source share