diff options
Diffstat (limited to 'src/proguard/evaluation/value/IdentifiedReferenceValue.java')
-rw-r--r-- | src/proguard/evaluation/value/IdentifiedReferenceValue.java | 81 |
1 files changed, 69 insertions, 12 deletions
diff --git a/src/proguard/evaluation/value/IdentifiedReferenceValue.java b/src/proguard/evaluation/value/IdentifiedReferenceValue.java index 5cfbd60..7f0196b 100644 --- a/src/proguard/evaluation/value/IdentifiedReferenceValue.java +++ b/src/proguard/evaluation/value/IdentifiedReferenceValue.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -23,18 +23,19 @@ package proguard.evaluation.value; import proguard.classfile.Clazz; /** - * This LongValue represents a reference value that is identified by a unique ID. + * This TypedReferenceValue represents a reference value that is identified by a + * unique ID. * * @author Eric Lafortune */ -final class IdentifiedReferenceValue extends ReferenceValue +class IdentifiedReferenceValue extends TypedReferenceValue { private final ValueFactory valuefactory; private final int id; /** - * Creates a new long value with the given ID. + * Creates a new reference value with the given ID. */ public IdentifiedReferenceValue(String type, Clazz referencedClass, @@ -49,25 +50,81 @@ final class IdentifiedReferenceValue extends ReferenceValue } - // Implementations for ReferenceValue. + // Implementations of binary methods of ReferenceValue. + + public ReferenceValue generalize(ReferenceValue other) + { + return other.generalize(this); + } + public int equal(ReferenceValue other) { - return this.equals(other) ? ALWAYS : MAYBE; + return other.equal(this); } - // Implementations of binary methods of ReferenceValue. + // Implementations of binary ReferenceValue methods with + // IdentifiedReferenceValue arguments. - public ReferenceValue generalize(ReferenceValue other) +// public ReferenceValue generalize(IdentifiedReferenceValue other) +// { +// return generalize((TypedReferenceValue)other); +// } + + + public int equal(IdentifiedReferenceValue other) { - // Remove the ID if both values don't share the same ID. - return this.equals(other) ? - this : - new ReferenceValue(type, referencedClass, mayBeNull).generalize(other); + return this.equals(other) ? ALWAYS : + this.equal((TypedReferenceValue)other); } +// // Implementations of binary ReferenceValue methods with +// // ArrayReferenceValue arguments. +// +// public ReferenceValue generalize(ArrayReferenceValue other) +// { +// return generalize((TypedReferenceValue)other); +// } +// +// +// public int equal(ArrayReferenceValue other) +// { +// return equal((TypedReferenceValue)other); +// } +// +// +// // Implementations of binary ReferenceValue methods with +// // IdentifiedArrayReferenceValue arguments. +// +// public ReferenceValue generalize(IdentifiedArrayReferenceValue other) +// { +// return generalize((ArrayReferenceValue)other); +// } +// +// +// public int equal(IdentifiedArrayReferenceValue other) +// { +// return equal((ArrayReferenceValue)other); +// } +// +// +// // Implementations of binary ReferenceValue methods with +// // DetailedArrayReferenceValue arguments. +// +// public ReferenceValue generalize(DetailedArrayReferenceValue other) +// { +// return generalize((IdentifiedArrayReferenceValue)other); +// } +// +// +// public int equal(DetailedArrayReferenceValue other) +// { +// return equal((IdentifiedArrayReferenceValue)other); +// } + + // Implementations for Value. public boolean isSpecific() |