mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
Even if we flush temp variables after every method call, they are kept in DfaValueFactory, so if we create an equal descriptor later, the old variable will be reused, even if it had a different type. This caused wrong contract evaluation for the second call. Fixes IDEA-280534 Constant conditions & exceptions. False positive "Result of 'getComment().equals(tag.getComment())' is always 'false'" GitOrigin-RevId: 918eca6110e5b416b78430b1e3f30d40fe28d9a7
34 lines
610 B
Java
34 lines
610 B
Java
import org.jetbrains.annotations.NotNull;
|
|
|
|
// IDEA-280534
|
|
class TagImpl {
|
|
boolean test(TagImpl o) {
|
|
if (!getKey().equals(o.getKey())) return false;
|
|
return getComment().equals(o.getComment());
|
|
}
|
|
|
|
private final TagKey tagKey;
|
|
private final String comment;
|
|
|
|
public TagImpl(Number owner, String comment) {
|
|
this.tagKey = new TagKey(owner);
|
|
this.comment = comment;
|
|
}
|
|
|
|
@NotNull
|
|
public TagKey getKey() {
|
|
return tagKey;
|
|
}
|
|
|
|
public String getComment() {
|
|
return comment;
|
|
}
|
|
}
|
|
|
|
class TagKey {
|
|
private final Number owner;
|
|
|
|
TagKey(Number owner) {
|
|
this.owner = owner;
|
|
}
|
|
} |