Exemple #1
0
 void setVariableState(DfaVariableValue dfaVar, DfaVariableState state) {
   assert !myUnknownVariables.contains(dfaVar);
   if (state.equals(myDefaultVariableStates.get(dfaVar))) {
     myVariableStates.remove(dfaVar);
   } else {
     myVariableStates.put(dfaVar, state);
   }
   myCachedHash = null;
 }
Exemple #2
0
  DfaVariableState getVariableState(DfaVariableValue dfaVar) {
    DfaVariableState state = myVariableStates.get(dfaVar);

    if (state == null) {
      state = myDefaultVariableStates.get(dfaVar);
      if (state == null) {
        state = createVariableState(dfaVar);
        DfaTypeValue initialType = dfaVar.getTypeValue();
        if (initialType != null) {
          state = state.withInstanceofValue(initialType);
          assert state != null;
        }
        myDefaultVariableStates.put(dfaVar, state);
      }

      if (isUnknownState(dfaVar)) {
        return state.withNullable(false);
      }
    }

    return state;
  }