/** * Returns whether this ReferenceValue is equal to the given other * IdentifiedReferenceValue. * @return <code>NEVER</code>, <code>MAYBE</code>, or <code>ALWAYS</code>. */ public int equal(IdentifiedReferenceValue other) { return equal((TypedReferenceValue)other); }
/** * Returns the generalization of this ReferenceValue and the given other * IdentifiedReferenceValue. */ public ReferenceValue generalize(IdentifiedReferenceValue other) { return generalize((TypedReferenceValue)other); }
stack.push(valueFactory.createArrayReferenceValue(arrayType.internalType(), arrayType.getReferencedClass(), stack.ipop())); break; stack.push(stack.apop().cast(type.getType(), type.getReferencedClass(), valueFactory, alwaysCast)); ReferenceValue type = constantValueFactory.constantValue(clazz, constantIndex).referenceValue(); int instanceOf = type.mayBeExtension() ? Value.MAYBE : value.instanceOf(type.getType(), type.getReferencedClass());
stack.push(valueFactory.createArrayReferenceValue(referenceValue.internalType(), referenceValue.getReferencedClass(), stack.ipop())); break; castValue.isNull() == Value.ALWAYS ? castValue : castValue.isNull() == Value.NEVER ? cpValue(clazz, constantIndex).referenceValue() : cpValue(clazz, constantIndex).referenceValue().generalize(valueFactory.createReferenceValueNull()); stack.push(castResultValue); break; int instanceOf = stack.apop().instanceOf(referenceValue.getType(), referenceValue.getReferencedClass());
/** * Finds or creates a class constant for the given reference value, and * returns its index in the constant pool. */ private int createClassConstant(ProgramClass programClass, ReferenceValue referenceValue) { return new ConstantPoolEditor(programClass).addClassConstant(referenceValue.getType(), referenceValue.getReferencedClass()); }
/** * Returns whether this ReferenceValue is not <code>null</code>. * @return <code>NEVER</code>, <code>MAYBE</code>, or <code>ALWAYS</code>. */ public final int isNotNull() { return -isNull(); }
public int instanceOf(String otherType, Clazz otherReferencedClass) { return referenceValue.instanceOf(otherType, otherReferencedClass); }
if (this.equals(other)) return other.generalizeMayBeNull(true); return this.generalizeMayBeNull(true); return this.generalizeMayBeNull(mayBeNull); return other.generalizeMayBeNull(mayBeNull); return this.generalizeMayBeNull(mayBeNull); int superClassCount = superClassCount(commonSuperClass, thisSuperClasses); if (maximumSuperClassCount < superClassCount || (maximumSuperClassCount == superClassCount && return new ReferenceValue(commonDimensionCount == 0 ? commonClazz.getName() : ClassUtil.internalArrayTypeFromClassName(commonClazz.getName(), return other.generalizeMayBeNull(mayBeNull); return this.generalizeMayBeNull(mayBeNull); ValueFactory.REFERENCE_VALUE_JAVA_LANG_OBJECT_MAYBE_NULL : ValueFactory.REFERENCE_VALUE_JAVA_LANG_OBJECT_NOT_NULL : new ReferenceValue(ClassUtil.internalArrayTypeFromClassName(ClassConstants.INTERNAL_NAME_JAVA_LANG_OBJECT, commonDimensionCount), null,
/** * Marks the enum class of the specified value as complex. */ private void markComplexEnumType(ReferenceValue referenceValue) { Clazz clazz = referenceValue.getReferencedClass(); if (clazz != null) { clazz.accept(complexEnumMarker); } } }
public int hashCode() { return super.hashCode() ^ valuefactory.hashCode() ^ id; }
public String internalType() { return referenceValue.internalType(); }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Is the method an initializer? if (ClassUtil.isInitializer(programMethod.getName(programClass))) { // Does it have exactly one parameter? if (ClassUtil.internalMethodParameterCount(programMethod.getDescriptor(programClass)) == 1) { // Is the parameter a non-null reference? Value value = StoringInvocationUnit.getMethodParameterValue(programMethod, 1); if (value != null && value.computationalType() == Value.TYPE_REFERENCE && value.referenceValue().isNotNull() == Value.ALWAYS) { // Does the method initialize the field? programMethod.attributesAccept(programClass, this); } else { wrapCounter = Integer.MIN_VALUE; } } else { wrapCounter = Integer.MIN_VALUE; } } }
public String getType() { return referenceValue.getType(); }
stack.push(valueFactory.createArrayReferenceValue(arrayType.internalType(), arrayType.getReferencedClass(), stack.ipop())); break; stack.push(stack.apop().cast(type.getType(), type.getReferencedClass(), valueFactory, alwaysCast)); ReferenceValue type = constantValueFactory.constantValue(clazz, constantIndex).referenceValue(); int instanceOf = type.mayBeExtension() ? Value.MAYBE : value.instanceOf(type.getType(), type.getReferencedClass());
/** * Finds or creates a class constant for the given reference value, and * returns its index in the constant pool. */ private int createClassConstant(ProgramClass programClass, ReferenceValue referenceValue) { return new ConstantPoolEditor(programClass).addClassConstant(referenceValue.getType(), referenceValue.getReferencedClass()); }
/** * Returns whether this ReferenceValue is not <code>null</code>. * @return <code>NEVER</code>, <code>MAYBE</code>, or <code>ALWAYS</code>. */ public final int isNotNull() { return -isNull(); }
public int instanceOf(String otherType, Clazz otherReferencedClass) { return referenceValue.instanceOf(otherType, otherReferencedClass); }