/** * Create a constant key for a string. * @param cha the class hierarchy * @param str the string * @return the constant key */ protected static ConstantKey<String> makeConstantKey(IClassHierarchy cha,String str) { IClass cls = cha.lookupClass(TypeReference.JavaLangString); ConstantKey<String> ck = new ConstantKey<>(str,cls); return ck; }
/** * Create a constant key for a string. * @param cha the class hierarchy * @param str the string * @return the constant key */ protected static ConstantKey<String> makeConstantKey(IClassHierarchy cha,String str) { IClass cls = cha.lookupClass(TypeReference.JavaLangString); ConstantKey<String> ck = new ConstantKey<>(str,cls); return ck; }
@Override public InstanceKey getInstanceKeyForMetadataObject(Object obj, TypeReference objType) { IClass cls = cha.lookupClass(objType); assert cls != null : objType; if (obj instanceof TypeReference) { IClass klass = cha.lookupClass((TypeReference)obj); if (klass == null) { return new ConcreteTypeKey(cls); } else { // return the IClass itself, wrapped as a constant! return new ConstantKey<>(klass, cls); } } else if (obj instanceof MethodReference) { IMethod m = cha.resolveMethod((MethodReference)obj); if (m == null) { return new ConcreteTypeKey(cls); } else { return new ConstantKey<>(m, cls); } } else if (obj instanceof Descriptor) { return new ConstantKey<>((Descriptor)obj, cls); } else { // other cases throw new Error(); } }
@Override public InstanceKey getInstanceKeyForMetadataObject(Object obj, TypeReference objType) { IClass cls = cha.lookupClass(objType); assert cls != null : objType; if (obj instanceof TypeReference) { IClass klass = cha.lookupClass((TypeReference)obj); if (klass == null) { return new ConcreteTypeKey(cls); } else { // return the IClass itself, wrapped as a constant! return new ConstantKey<>(klass, cls); } } else if (obj instanceof MethodReference) { IMethod m = cha.resolveMethod((MethodReference)obj); if (m == null) { return new ConcreteTypeKey(cls); } else { return new ConstantKey<>(m, cls); } } else if (obj instanceof Descriptor) { return new ConstantKey<>((Descriptor)obj, cls); } else { // other cases throw new Error(); } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (type == null) { throw new IllegalArgumentException("null type"); } if (disambiguateConstants() || isReflectiveType(type)) { return new ConstantKey<>(S, getClassHierarchy().lookupClass(type)); } else { return classBased.getInstanceKeyForConstant(type, S); } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (type == null) { throw new IllegalArgumentException("null type"); } if (disambiguateConstants() || isReflectiveType(type)) { return new ConstantKey<>(S, getClassHierarchy().lookupClass(type)); } else { return classBased.getInstanceKeyForConstant(type, S); } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (options.getUseConstantSpecificKeys()) return new ConstantKey<>(S, cha.lookupClass(type)); else return new ConcreteTypeKey(cha.lookupClass(type)); }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (options.getUseConstantSpecificKeys()) return new ConstantKey<>(S, cha.lookupClass(type)); else return new ConcreteTypeKey(cha.lookupClass(type)); }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (options.getUseConstantSpecificKeys()) { return new ConstantKey<>(S, cha.lookupClass(type)); } else { return new ConcreteTypeKey(cha.lookupClass(type)); } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (options.getUseConstantSpecificKeys()) { return new ConstantKey<>(S, cha.lookupClass(type)); } else { return new ConcreteTypeKey(cha.lookupClass(type)); } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (type == null || cha.lookupClass(type) == null) { return null; } else { if (options.getUseConstantSpecificKeys()) { return new ConstantKey<>(S, cha.lookupClass(type)); } else { return new ConcreteTypeKey(cha.lookupClass(type)); } } }
@Override public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { if (type == null || cha.lookupClass(type) == null) { return null; } else { if (options.getUseConstantSpecificKeys()) { return new ConstantKey<>(S, cha.lookupClass(type)); } else { return new ConcreteTypeKey(cha.lookupClass(type)); } } }