mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
merge DfaNotNullValue into DfaTypeValue
This commit is contained in:
+8
-14
@@ -277,16 +277,14 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
}
|
||||
|
||||
getVariableState(var).setValue(value);
|
||||
if (value instanceof DfaNotNullValue) {
|
||||
DfaTypeValue dfaType = myFactory.getTypeFactory().createTypeValue(((DfaNotNullValue)value).getType());
|
||||
DfaRelationValue dfaInstanceof = myFactory.getRelationFactory().createRelation(var, dfaType, JavaTokenType.INSTANCEOF_KEYWORD, false);
|
||||
applyCondition(dfaInstanceof);
|
||||
applyCondition(compareToNull(var, true));
|
||||
}
|
||||
else if (value instanceof DfaTypeValue) {
|
||||
if (value instanceof DfaTypeValue) {
|
||||
getVariableState(var).setNullable(((DfaTypeValue)value).isNullable());
|
||||
DfaRelationValue dfaInstanceof = myFactory.getRelationFactory().createRelation(var, value, JavaTokenType.INSTANCEOF_KEYWORD, false);
|
||||
applyInstanceofOrNull(dfaInstanceof);
|
||||
if (((DfaTypeValue)value).isNotNull()) {
|
||||
applyCondition(dfaInstanceof);
|
||||
} else {
|
||||
applyInstanceofOrNull(dfaInstanceof);
|
||||
}
|
||||
}
|
||||
else {
|
||||
DfaRelationValue dfaEqual = myFactory.getRelationFactory().createRelation(var, value, JavaTokenType.EQEQ, false);
|
||||
@@ -511,7 +509,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
|
||||
@Override
|
||||
public boolean isNull(DfaValue dfaValue) {
|
||||
if (dfaValue instanceof DfaNotNullValue) return false;
|
||||
if (dfaValue instanceof DfaTypeValue && ((DfaTypeValue)dfaValue).isNotNull()) return false;
|
||||
|
||||
if (dfaValue instanceof DfaVariableValue || dfaValue instanceof DfaConstValue) {
|
||||
DfaConstValue dfaNull = myFactory.getConstFactory().getNull();
|
||||
@@ -613,7 +611,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
if (dfaLeft instanceof DfaUnknownValue || dfaRight instanceof DfaUnknownValue) return true;
|
||||
|
||||
boolean isNegated = dfaRelation.isNegated();
|
||||
if (dfaLeft instanceof DfaNotNullValue && dfaRight == myFactory.getConstFactory().getNull()) {
|
||||
if (dfaLeft instanceof DfaTypeValue && ((DfaTypeValue)dfaLeft).isNotNull() && dfaRight == myFactory.getConstFactory().getNull()) {
|
||||
return isNegated;
|
||||
}
|
||||
|
||||
@@ -629,10 +627,6 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dfaRight instanceof DfaNotNullValue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isNull(dfaRight) && compareVariableWithNull(dfaLeft) || isNull(dfaLeft) && compareVariableWithNull(dfaRight)) {
|
||||
return isNegated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user