コード例 #1
0
 private boolean hardEquals(
     PsiModifierListOwner psiVar, PsiType varType, boolean negated, DfaVariableValue qualifier) {
   return psiVar == myVariable
       && Comparing.equal(
           TypeConversionUtil.erasure(varType), TypeConversionUtil.erasure(myVarType))
       && negated == myIsNegated
       && (myQualifier == null
           ? qualifier == null
           : myQualifier.hardEquals(
               qualifier.getPsiVariable(),
               qualifier.getVariableType(),
               qualifier.isNegated(),
               qualifier.getQualifier()));
 }
コード例 #2
0
    @NotNull
    public DfaVariableValue createVariableValue(
        @NotNull PsiModifierListOwner myVariable,
        @Nullable PsiType varType,
        boolean isNegated,
        @Nullable DfaVariableValue qualifier) {
      Trinity<Boolean, String, DfaVariableValue> key =
          Trinity.create(isNegated, ((PsiNamedElement) myVariable).getName(), qualifier);
      for (DfaVariableValue aVar : myExistingVars.get(key)) {
        if (aVar.hardEquals(myVariable, varType, isNegated, qualifier)) return aVar;
      }

      DfaVariableValue result =
          new DfaVariableValue(myVariable, varType, isNegated, myFactory, qualifier);
      myExistingVars.putValue(key, result);
      while (qualifier != null) {
        qualifier.myDependents.add(result);
        qualifier = qualifier.getQualifier();
      }
      return result;
    }