mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SpecialField#fromQualifier
GitOrigin-RevId: 2340a5a1b60d256e2c74d5bce3dcd786e281ce07
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8037a62022
commit
7ff6382c14
+1
-1
@@ -86,7 +86,7 @@ public class CommonDataflow {
|
||||
if (myFacts == DfaFactMap.EMPTY) return;
|
||||
DfaFactMap newMap = DataflowResult.getFactMap(memState, value);
|
||||
if (value instanceof DfaVariableValue) {
|
||||
SpecialField field = SpecialField.fromQualifierType(value.getType());
|
||||
SpecialField field = SpecialField.fromQualifier(value);
|
||||
if (field != null) {
|
||||
DfaValue specialField = field.createValue(value.getFactory(), value);
|
||||
if (specialField instanceof DfaVariableValue) {
|
||||
|
||||
+1
-1
@@ -1198,7 +1198,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
|
||||
private Couple<DfaValue> getSpecialEquivalencePair(DfaVariableValue left, DfaValue right) {
|
||||
if (right instanceof DfaVariableValue) return null;
|
||||
SpecialField field = SpecialField.fromQualifierType(left.getType());
|
||||
SpecialField field = SpecialField.fromQualifier(left);
|
||||
if (field == null) return null;
|
||||
DfaValue leftValue = field.createValue(myFactory, left);
|
||||
DfaValue rightValue = field.createValue(myFactory, right);
|
||||
|
||||
@@ -368,7 +368,29 @@ public enum SpecialField implements VariableDescriptor {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a special field which corresponds to given qualifier
|
||||
*
|
||||
* @param value a qualifier value
|
||||
* @return a special field; null if no special field is detected to be related to given qualifier
|
||||
*/
|
||||
@Nullable
|
||||
public static SpecialField fromQualifier(@NotNull DfaValue value) {
|
||||
if (value instanceof DfaFactMapValue) {
|
||||
DfaFactMap facts = ((DfaFactMapValue)value).getFacts();
|
||||
SpecialFieldValue sfValue = facts.get(DfaFactType.SPECIAL_FIELD_VALUE);
|
||||
if (sfValue != null) {
|
||||
return sfValue.getField();
|
||||
}
|
||||
TypeConstraint constraint = facts.get(DfaFactType.TYPE_CONSTRAINT);
|
||||
if (constraint != null) {
|
||||
return fromQualifierType(constraint.getPsiType());
|
||||
}
|
||||
}
|
||||
return fromQualifierType(value.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return myTitle;
|
||||
|
||||
+2
-2
@@ -828,8 +828,8 @@ public class TrackingRunner extends StandardDataFlowRunner {
|
||||
}
|
||||
}
|
||||
if (relationType == RelationType.NE) {
|
||||
SpecialField leftField = SpecialField.fromQualifierType(leftValue.getType());
|
||||
SpecialField rightField = SpecialField.fromQualifierType(leftValue.getType());
|
||||
SpecialField leftField = SpecialField.fromQualifier(leftValue);
|
||||
SpecialField rightField = SpecialField.fromQualifier(rightValue);
|
||||
if (leftField != null && leftField == rightField) {
|
||||
DfaValue leftSpecial = leftField.createValue(getFactory(), leftValue);
|
||||
DfaValue rightSpecial = rightField.createValue(getFactory(), rightValue);
|
||||
|
||||
Reference in New Issue
Block a user