/** * Returns all subclasses (for classes) and implementations (for interfaces) of this type */ public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(getSubclasses()); for (NdTypeInterface next : getImplementations()) { result.add(next.getImplementation()); } return result; }
public List<NdType> getSubclasses() { return SUBCLASSES.asList(getNd(), this.address); }
private char[][] getExceptionTypeNames(NdMethod ndMethod) { List<NdMethodException> exceptions = ndMethod.getExceptions(); // Although the JavaDoc for IBinaryMethod says that the exception list will be null if empty, // the implementation in MethodInfo returns an empty array rather than null. We copy the // same behavior here in case something is relying on it. Uncomment the following if the "null" // version is deemed correct. // if (exceptions.isEmpty()) { // return null; // } char[][] result = new char[exceptions.size()][]; for (int idx = 0; idx < exceptions.size(); idx++) { NdMethodException next = exceptions.get(idx); result[idx] = next.getExceptionType().getRawType().getBinaryName(); } return result; }
public abstract void getSignature(CharArrayBuffer result, boolean includeTrailingSemicolon);
public static IBinaryField createBinaryField(NdVariable ndVariable) { char[] name = ndVariable.getName().getChars(); Constant constant = null; NdConstant ndConstant = ndVariable.getConstant(); if (ndConstant != null) { constant = ndConstant.getConstant(); } if (constant == null) { constant = Constant.NotAConstant; } NdTypeSignature type = ndVariable.getType(); IBinaryTypeAnnotation[] typeAnnotationArray = createBinaryTypeAnnotations(ndVariable.getTypeAnnotations()); IBinaryAnnotation[] annotations = toAnnotationArray(ndVariable.getAnnotations()); CharArrayBuffer signature = new CharArrayBuffer(); if (ndVariable.hasVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT)) { type.getSignature(signature); } long tagBits = ndVariable.getTagBits(); return new IndexBinaryField(annotations, constant, signature.getContents(), ndVariable.getModifiers(), name, tagBits, typeAnnotationArray, type.getRawType().getFieldDescriptor().getChars()); }
@Override public String toString() { try { return getExceptionType().toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } } }
@Override public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(super.getSubTypes()); for (NdComplexTypeSignature next : getComplexTypes()) { result.addAll(next.getSubTypes()); } return result; }
public abstract void getSignature(CharArrayBuffer result, boolean includeTrailingSemicolon);
public static IBinaryField createBinaryField(NdVariable ndVariable) { char[] name = ndVariable.getName().getChars(); Constant constant = null; NdConstant ndConstant = ndVariable.getConstant(); if (ndConstant != null) { constant = ndConstant.getConstant(); } if (constant == null) { constant = Constant.NotAConstant; } NdTypeSignature type = ndVariable.getType(); IBinaryTypeAnnotation[] typeAnnotationArray = createBinaryTypeAnnotations(ndVariable.getTypeAnnotations()); IBinaryAnnotation[] annotations = toAnnotationArray(ndVariable.getAnnotations()); CharArrayBuffer signature = new CharArrayBuffer(); if (ndVariable.hasVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT)) { type.getSignature(signature); } long tagBits = ndVariable.getTagBits(); return new IndexBinaryField(annotations, constant, signature.getContents(), ndVariable.getModifiers(), name, tagBits, typeAnnotationArray, type.getRawType().getFieldDescriptor().getChars()); }
public String toString() { try { return getExceptionType().toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } } }
@Override public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(super.getSubTypes()); for (NdComplexTypeSignature next : getComplexTypes()) { result.addAll(next.getSubTypes()); } return result; }
public String toString() { try { CharArrayBuffer result = new CharArrayBuffer(); getSignature(result); return result.toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } } }
private char[][] getExceptionTypeNames(NdMethod ndMethod) { List<NdMethodException> exceptions = ndMethod.getExceptions(); // Although the JavaDoc for IBinaryMethod says that the exception list will be null if empty, // the implementation in MethodInfo returns an empty array rather than null. We copy the // same behavior here in case something is relying on it. Uncomment the following if the "null" // version is deemed correct. // if (exceptions.isEmpty()) { // return null; // } char[][] result = new char[exceptions.size()][]; for (int idx = 0; idx < exceptions.size(); idx++) { NdMethodException next = exceptions.get(idx); result[idx] = next.getExceptionType().getRawType().getBinaryName(); } return result; }
/** * Returns all subclasses (for classes) and implementations (for interfaces) of this type */ public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(getSubclasses()); for (NdTypeInterface next : getImplementations()) { result.add(next.getImplementation()); } return result; }
public List<NdTypeInterface> getImplementations() { return IMPLEMENTATIONS.asList(getNd(), this.address); }
@Override public String toString() { try { StringBuilder result = new StringBuilder(); NdTypeSignature localType = getType(); if (localType != null) { result.append(localType.toString()); result.append(" "); //$NON-NLS-1$ } IString name = getName(); if (name != null) { result.append(name.toString()); } NdConstant constant = getConstant(); if (constant != null) { result.append(" = "); //$NON-NLS-1$ result.append(constant.toString()); } return result.toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } }
@Override public String toString() { try { CharArrayBuffer result = new CharArrayBuffer(); getSignature(result); return result.toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } } }
@Override public char[][] getInterfaceNames() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { List<NdTypeInterface> interfaces = type.getInterfaces(); if (interfaces.isEmpty()) { return null; } char[][] result = new char[interfaces.size()][]; for (int idx = 0; idx < interfaces.size(); idx++) { NdTypeSignature nextInterface = interfaces.get(idx).getInterface(); result[idx] = nextInterface.getRawType().getBinaryName(); } return result; } else { return null; } } }
public List<NdTypeInterface> getImplementations() { return IMPLEMENTATIONS.asList(getNd(), this.address); }
public String toString() { try { StringBuilder result = new StringBuilder(); NdTypeSignature localType = getType(); if (localType != null) { result.append(localType.toString()); result.append(" "); //$NON-NLS-1$ } IString name = getName(); if (name != null) { result.append(name.toString()); } NdConstant constant = getConstant(); if (constant != null) { result.append(" = "); //$NON-NLS-1$ result.append(constant.toString()); } return result.toString(); } catch (RuntimeException e) { // This is called most often from the debugger, so we want to return something meaningful even // if the code is buggy, the database is corrupt, or we don't have a read lock. return super.toString(); } }