TypeDfaState (int variableIndex, @NotNull DFAType type) { BitSet newSet; if (variableIndex == 0 || !myProhibitedCachingVars.get(variableIndex)) { newSet = myProhibitedCachingVars; } else { newSet = (BitSet)myProhibitedCachingVars.clone(); newSet.set(variableIndex, false); } Int2ObjectMap<DFAType> newTypes; if (myVarTypes.get(variableIndex) == type) { newTypes = myVarTypes; } else { newTypes = new Int2ObjectOpenHashMap<>(myVarTypes); newTypes.put(variableIndex, type); } if (newSet == myProhibitedCachingVars && newTypes == myVarTypes) { return this; } else { return new TypeDfaState(newTypes, newSet); } }