Artifact () { AtomicReference<Artifact> artifact = myArtifact; if (artifact == null) { // benign race myArtifact = artifact = new AtomicReference<>(getInstance(myProject).findArtifact(myName)); } return artifact.get(); }