Files
openide/java/java-tests/testData/inspection/patternVariableCanBeUsed/afterInnerGeneric.java
Tagir Valeev 25842d7354 [java-inspections] JavaReferenceAdjuster: avoid removing generic outer class qualifier in pattern instanceof
Fixes IDEA-296310 "Replace 'that' with pattern variable" generates uncompilable code for nested class

GitOrigin-RevId: 0ac45ba97fdfe08e0d4a74b433b9770a82969406
2022-07-04 18:34:30 +00:00

19 lines
437 B
Java

// "Replace 'that' with pattern variable" "true"
class PatternInner<T> {
class Basis {
String key;
private PatternInner<T> outer() {
return PatternInner.this;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof @SuppressWarnings("rawtypes")PatternInner.Basis that)) {
return false;
}
return this.outer() == that.outer() && this.key.equals(that.key);
}
}
}