public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
@Override public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
/** * Merges all types on the stack of this frame instance with that of the specified frame. * The local variable table is left untouched. * * @param frame the frame to merge the stack from * @return true if any changes where made */ public boolean mergeStack(Frame frame) { boolean changed = false; if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!"); for (int i = 0; i < top; i++) { if (stack[i] != null) { Type prev = stack[i]; Type merged = prev.merge(frame.stack[i]); if (merged == Type.BOGUS) throw new RuntimeException("Operand stacks could not be merged due to differing primitive types: pos = " + i); stack[i] = merged; // always replace the instance in case a multi-interface type changes to a normal Type if ((! merged.equals(prev)) || merged.popChanged()) { changed = true; } } } return changed; }
/** * Merges all types on the stack of this frame instance with that of the specified frame. * The local variable table is left untouched. * * @param frame the frame to merge the stack from * @return true if any changes where made */ public boolean mergeStack(Frame frame) { boolean changed = false; if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!"); for (int i = 0; i < top; i++) { if (stack[i] != null) { Type prev = stack[i]; Type merged = prev.merge(frame.stack[i]); if (merged == Type.BOGUS) throw new RuntimeException("Operand stacks could not be merged due to differing primitive types: pos = " + i); stack[i] = merged; // always replace the instance in case a multi-interface type changes to a normal Type if ((! merged.equals(prev)) || merged.popChanged()) { changed = true; } } } return changed; }
public boolean isAssignableTo(Type type) { if (resolved != null) return type.isAssignableFrom(resolved); if (Type.OBJECT.equals(type)) return true; if (potentialClass != null && !type.isAssignableFrom(potentialClass)) potentialClass = null; Map map = mergeMultiAndSingle(this, type); if (map.size() == 1 && potentialClass == null) { // Update previous merge paths to the same resolved type resolved = Type.get((CtClass)map.values().iterator().next()); propogateResolved(); return true; } // Keep all previous merge paths up to date if (map.size() >= 1) { interfaces = map; propogateState(); return true; } if (potentialClass != null) { resolved = potentialClass; propogateResolved(); return true; } return false; }
/** * Merges all types on the stack and local variable table of this frame with that of the specified * type. * * @param frame the frame to merge with * @return true if any changes to this frame where made by this merge */ public boolean merge(Frame frame) { boolean changed = false; // Local variable table for (int i = 0; i < locals.length; i++) { if (locals[i] != null) { Type prev = locals[i]; Type merged = prev.merge(frame.locals[i]); // always replace the instance in case a multi-interface type changes to a normal Type locals[i] = merged; if (! merged.equals(prev) || merged.popChanged()) { changed = true; } } else if (frame.locals[i] != null) { locals[i] = frame.locals[i]; changed = true; } } changed |= mergeStack(frame); return changed; }
public boolean isAssignableTo(Type type) { if (resolved != null) return type.isAssignableFrom(resolved); if (Type.OBJECT.equals(type)) return true; if (potentialClass != null && !type.isAssignableFrom(potentialClass)) potentialClass = null; Map<String,CtClass> map = mergeMultiAndSingle(this, type); if (map.size() == 1 && potentialClass == null) { // Update previous merge paths to the same resolved type resolved = Type.get(map.values().iterator().next()); propogateResolved(); return true; } // Keep all previous merge paths up to date if (map.size() >= 1) { interfaces = map; propogateState(); return true; } if (potentialClass != null) { resolved = potentialClass; propogateResolved(); return true; } return false; }
/** * Merges all types on the stack and local variable table of this frame with that of the specified * type. * * @param frame the frame to merge with * @return true if any changes to this frame where made by this merge */ public boolean merge(Frame frame) { boolean changed = false; // Local variable table for (int i = 0; i < locals.length; i++) { if (locals[i] != null) { Type prev = locals[i]; Type merged = prev.merge(frame.locals[i]); // always replace the instance in case a multi-interface type changes to a normal Type locals[i] = merged; if (! merged.equals(prev) || merged.popChanged()) { changed = true; } } else if (frame.locals[i] != null) { locals[i] = frame.locals[i]; changed = true; } } changed |= mergeStack(frame); return changed; }
if (!newType.equals(oldType) || newType.popChanged()) changed = true;
if (!newType.equals(oldType) || newType.popChanged()) changed = true;
public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.keySet().equals(multi.interfaces.keySet()); }
/** * Merges all types on the stack of this frame instance with that of the specified frame. * The local variable table is left untouched. * * @param frame the frame to merge the stack from * @return true if any changes where made */ public boolean mergeStack(Frame frame) { boolean changed = false; if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!"); for (int i = 0; i < top; i++) { if (stack[i] != null) { Type prev = stack[i]; Type merged = prev.merge(frame.stack[i]); if (merged == Type.BOGUS) throw new RuntimeException("Operand stacks could not be merged due to differing primitive types: pos = " + i); stack[i] = merged; // always replace the instance in case a multi-interface type changes to a normal Type if ((! merged.equals(prev)) || merged.popChanged()) { changed = true; } } } return changed; }
/** * Merges all types on the stack of this frame instance with that of the specified frame. * The local variable table is left untouched. * * @param frame the frame to merge the stack from * @return true if any changes where made */ public boolean mergeStack(Frame frame) { boolean changed = false; if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!"); for (int i = 0; i < top; i++) { if (stack[i] != null) { Type prev = stack[i]; Type merged = prev.merge(frame.stack[i]); if (merged == Type.BOGUS) throw new RuntimeException("Operand stacks could not be merged due to differing primitive types: pos = " + i); stack[i] = merged; // always replace the instance in case a multi-interface type changes to a normal Type if ((! merged.equals(prev)) || merged.popChanged()) { changed = true; } } } return changed; }
/** * Merges all types on the stack of this frame instance with that of the specified frame. * The local variable table is left untouched. * * @param frame the frame to merge the stack from * @return true if any changes where made */ public boolean mergeStack(Frame frame) { boolean changed = false; if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!"); for (int i = 0; i < top; i++) { if (stack[i] != null) { Type prev = stack[i]; Type merged = prev.merge(frame.stack[i]); if (merged == Type.BOGUS) throw new RuntimeException("Operand stacks could not be merged due to differing primitive types: pos = " + i); stack[i] = merged; // always replace the instance in case a multi-interface type changes to a normal Type if ((! merged.equals(prev)) || merged.popChanged()) { changed = true; } } } return changed; }
public boolean isAssignableTo(Type type) { if (resolved != null) return type.isAssignableFrom(resolved); if (Type.OBJECT.equals(type)) return true; if (potentialClass != null && !type.isAssignableFrom(potentialClass)) potentialClass = null; Map map = mergeMultiAndSingle(this, type); if (map.size() == 1 && potentialClass == null) { // Update previous merge paths to the same resolved type resolved = Type.get((CtClass)map.values().iterator().next()); propogateResolved(); return true; } // Keep all previous merge paths up to date if (map.size() >= 1) { interfaces = map; propogateState(); return true; } if (potentialClass != null) { resolved = potentialClass; propogateResolved(); return true; } return false; }