Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/optionalToIf/afterPreserveComments.java
Andrey.Cherkasov 0d10ba565e [java] Fix test data files after inspection description updating
GitOrigin-RevId: faa9f564b7a37e4c1165c24f904994b951adfccd
2021-03-18 10:49:54 +00:00

33 lines
784 B
Java

// "Fix all ''Optional' can be replaced with sequence of 'if' statements' problems in file" "true"
import java.util.*;
class Test {
private LicenseManager ourInstance = null;
LicenseManager setInstance(LicenseManager instance) {
LicenseManager old = this.ourInstance;
this.ourInstance = instance;
return old;
}
private static interface LicenseManager {
}
private static class IdeaLicenseManager implements LicenseManager {
}
public LicenseManager getInstance() {
final LicenseManager instance = ourInstance;
/*1*/
/*2*/
/*3*/
/*4*/
LicenseManager result = null;
if (instance != null) result = instance;
if (result == null) result = setInstance(new IdeaLicenseManager(/*3*/));
return result;
}
}