📄 methoddecl.java
字号:
int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type); if(isFinal && num == boundariesCrossed) accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value)); return accessibleFrom_TypeDecl_value; } private boolean accessibleFrom_compute(TypeDecl type) { if(isPublic()) { return true; } else if(isProtected()) { if(hostPackage().equals(type.hostPackage())) return true; if(type.withinBodyThatSubclasses(hostType()) != null) return true; return false; } else if(isPrivate()) return hostType().topLevelType() == type.topLevelType(); else return hostPackage().equals(type.hostPackage()); } // Declared in DataStructures.jrag at line 132 @SuppressWarnings({"unchecked", "cast"}) public int size() { int size_value = size_compute(); return size_value; } private int size_compute() { return 1; } // Declared in DataStructures.jrag at line 133 @SuppressWarnings({"unchecked", "cast"}) public boolean isEmpty() { boolean isEmpty_value = isEmpty_compute(); return isEmpty_value; } private boolean isEmpty_compute() { return false; } // Declared in DataStructures.jrag at line 137 @SuppressWarnings({"unchecked", "cast"}) public boolean contains(Object o) { boolean contains_Object_value = contains_compute(o); return contains_Object_value; } private boolean contains_compute(Object o) { return this == o; } // Declared in ErrorCheck.jrag at line 31 @SuppressWarnings({"unchecked", "cast"}) public int lineNumber() { int lineNumber_value = lineNumber_compute(); return lineNumber_value; } private int lineNumber_compute() { return getLine(IDstart); } protected java.util.Map throwsException_TypeDecl_values; // Declared in ExceptionHandling.jrag at line 123 @SuppressWarnings({"unchecked", "cast"}) public boolean throwsException(TypeDecl exceptionType) { Object _parameters = exceptionType;if(throwsException_TypeDecl_values == null) throwsException_TypeDecl_values = new java.util.HashMap(4); if(throwsException_TypeDecl_values.containsKey(_parameters)) return ((Boolean)throwsException_TypeDecl_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean throwsException_TypeDecl_value = throwsException_compute(exceptionType); if(isFinal && num == boundariesCrossed) throwsException_TypeDecl_values.put(_parameters, Boolean.valueOf(throwsException_TypeDecl_value)); return throwsException_TypeDecl_value; } private boolean throwsException_compute(TypeDecl exceptionType) { for(int i = 0; i < getNumException(); i++) if(exceptionType.instanceOf(getException(i).type())) return true; return false; } // Declared in LookupMethod.jrag at line 125 @SuppressWarnings({"unchecked", "cast"}) public String name() { String name_value = name_compute(); return name_value; } private String name_compute() { return getID(); } protected boolean signature_computed = false; protected String signature_value; // Declared in LookupMethod.jrag at line 128 @SuppressWarnings({"unchecked", "cast"}) public String signature() { if(signature_computed) return signature_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); signature_value = signature_compute(); if(isFinal && num == boundariesCrossed) signature_computed = true; return signature_value; } private String signature_compute() { StringBuffer s = new StringBuffer(); s.append(name() + "("); for(int i = 0; i < getNumParameter(); i++) { if(i != 0) s.append(", "); s.append(getParameter(i).type().typeName()); } s.append(")"); return s.toString(); } // Declared in LookupMethod.jrag at line 140 @SuppressWarnings({"unchecked", "cast"}) public boolean sameSignature(MethodDecl m) { boolean sameSignature_MethodDecl_value = sameSignature_compute(m); return sameSignature_MethodDecl_value; } private boolean sameSignature_compute(MethodDecl m) { return signature().equals(m.signature()); } protected java.util.Map moreSpecificThan_MethodDecl_values; // Declared in LookupMethod.jrag at line 142 @SuppressWarnings({"unchecked", "cast"}) public boolean moreSpecificThan(MethodDecl m) { Object _parameters = m;if(moreSpecificThan_MethodDecl_values == null) moreSpecificThan_MethodDecl_values = new java.util.HashMap(4); if(moreSpecificThan_MethodDecl_values.containsKey(_parameters)) return ((Boolean)moreSpecificThan_MethodDecl_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean moreSpecificThan_MethodDecl_value = moreSpecificThan_compute(m); if(isFinal && num == boundariesCrossed) moreSpecificThan_MethodDecl_values.put(_parameters, Boolean.valueOf(moreSpecificThan_MethodDecl_value)); return moreSpecificThan_MethodDecl_value; } private boolean moreSpecificThan_compute(MethodDecl m) { if(getNumParameter() == 0) return false; for(int i = 0; i < getNumParameter(); i++) { if(!getParameter(i).type().instanceOf(m.getParameter(i).type())) return false; } return true; } protected java.util.Map overrides_MethodDecl_values; // Declared in LookupMethod.jrag at line 183 @SuppressWarnings({"unchecked", "cast"}) public boolean overrides(MethodDecl m) { Object _parameters = m;if(overrides_MethodDecl_values == null) overrides_MethodDecl_values = new java.util.HashMap(4); if(overrides_MethodDecl_values.containsKey(_parameters)) return ((Boolean)overrides_MethodDecl_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean overrides_MethodDecl_value = overrides_compute(m); if(isFinal && num == boundariesCrossed) overrides_MethodDecl_values.put(_parameters, Boolean.valueOf(overrides_MethodDecl_value)); return overrides_MethodDecl_value; } private boolean overrides_compute(MethodDecl m) { return !isStatic() && !m.isPrivate() && m.accessibleFrom(hostType()) && hostType().instanceOf(m.hostType()) && m.signature().equals(signature()); } protected java.util.Map hides_MethodDecl_values; // Declared in LookupMethod.jrag at line 187 @SuppressWarnings({"unchecked", "cast"}) public boolean hides(MethodDecl m) { Object _parameters = m;if(hides_MethodDecl_values == null) hides_MethodDecl_values = new java.util.HashMap(4); if(hides_MethodDecl_values.containsKey(_parameters)) return ((Boolean)hides_MethodDecl_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean hides_MethodDecl_value = hides_compute(m); if(isFinal && num == boundariesCrossed) hides_MethodDecl_values.put(_parameters, Boolean.valueOf(hides_MethodDecl_value)); return hides_MethodDecl_value; } private boolean hides_compute(MethodDecl m) { return isStatic() && !m.isPrivate() && m.accessibleFrom(hostType()) && hostType().instanceOf(m.hostType()) && m.signature().equals(signature()); } protected java.util.Map parameterDeclaration_String_values; // Declared in LookupVariable.jrag at line 99 @SuppressWarnings({"unchecked", "cast"}) public SimpleSet parameterDeclaration(String name) { Object _parameters = name;if(parameterDeclaration_String_values == null) parameterDeclaration_String_values = new java.util.HashMap(4); if(parameterDeclaration_String_values.containsKey(_parameters)) return (SimpleSet)parameterDeclaration_String_values.get(_parameters); int num = boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet parameterDeclaration_String_value = parameterDeclaration_compute(name); if(isFinal && num == boundariesCrossed) parameterDeclaration_String_values.put(_parameters, parameterDeclaration_String_value); return parameterDeclaration_String_value; } private SimpleSet parameterDeclaration_compute(String name) { for(int i = 0; i < getNumParameter(); i++) if(getParameter(i).name().equals(name)) return (ParameterDeclaration)getParameter(i); return SimpleSet.emptySet; } // Declared in Modifiers.jrag at line 213 @SuppressWarnings({"unchecked", "cast"}) public boolean isSynthetic() { boolean isSynthetic_value = isSynthetic_compute(); return isSynthetic_value; } private boolean isSynthetic_compute() { return getModifiers().isSynthetic(); } // Declared in Modifiers.jrag at line 222 @SuppressWarnings({"unchecked", "cast"}) public boolean isPublic() { boolean isPublic_value = isPublic_compute(); return isPublic_value; } private boolean isPublic_compute() { return getModifiers().isPublic() || hostType().isInterfaceDecl(); } // Declared in Modifiers.jrag at line 223 @SuppressWarnings({"unchecked", "cast"}) public boolean isPrivate() { boolean isPrivate_value = isPrivate_compute(); return isPrivate_value; } private boolean isPrivate_compute() { return getModifiers().isPrivate(); } // Declared in Modifiers.jrag at line 224 @SuppressWarnings({"unchecked", "cast"}) public boolean isProtected() { boolean isProtected_value = isProtected_compute(); return isProtected_value; } private boolean isProtected_compute() { return getModifiers().isProtected(); } // Declared in Modifiers.jrag at line 225 @SuppressWarnings({"unchecked", "cast"}) public boolean isAbstract() { boolean isAbstract_value = isAbstract_compute(); return isAbstract_value; } private boolean isAbstract_compute() { return getModifiers().isAbstract() || hostType().isInterfaceDecl(); } // Declared in Modifiers.jrag at line 226 @SuppressWarnings({"unchecked", "cast"}) public boolean isStatic() { boolean isStatic_value = isStatic_compute(); return isStatic_value; } private boolean isStatic_compute() { return getModifiers().isStatic(); } // Declared in Modifiers.jrag at line 228 @SuppressWarnings({"unchecked", "cast"}) public boolean isFinal() { boolean isFinal_value = isFinal_compute(); return isFinal_value; } private boolean isFinal_compute() { return getModifiers().isFinal() || hostType().isFinal() || isPrivate(); } // Declared in Modifiers.jrag at line 229 @SuppressWarnings({"unchecked", "cast"}) public boolean isSynchronized() { boolean isSynchronized_value = isSynchronized_compute(); return isSynchronized_value; } private boolean isSynchronized_compute() { return getModifiers().isSynchronized(); } // Declared in Modifiers.jrag at line 230 @SuppressWarnings({"unchecked", "cast"}) public boolean isNative() { boolean isNative_value = isNative_compute(); return isNative_value; } private boolean isNative_compute() { return getModifiers().isNative(); } // Declared in Modifiers.jrag at line 231 @SuppressWarnings({"unchecked", "cast"}) public boolean isStrictfp() { boolean isStrictfp_value = isStrictfp_compute(); return isStrictfp_value; } private boolean isStrictfp_compute() { return getModifiers().isStrictfp(); } // Declared in PrettyPrint.jadd at line 793 @SuppressWarnings({"unchecked", "cast"}) public String dumpString() { String dumpString_value = dumpString_compute(); return dumpString_value; } private String dumpString_compute() { return getClass().getName() + " [" + getID() + "]"; } protected boolean type_computed = false; protected TypeDecl type_value; // Declared in TypeAnalysis.jrag at line 270 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) return type_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == boundariesCrossed) type_computed = true; return type_value; } private TypeDecl type_compute() { return getTypeAccess().type(); } // Declared in TypeAnalysis.jrag at line 273 @SuppressWarnings({"unchecked", "cast"}) public boolean isVoid() { boolean isVoid_value = isVoid_compute(); return isVoid_value; } private boolean isVoid_compute() { return type().isVoid(); } // Declared in TypeHierarchyCheck.jrag at line 237 @SuppressWarnings({"unchecked", "cast"}) public boolean mayOverrideReturn(MethodDecl m) { boolean mayOverrideReturn_MethodDecl_value = mayOverrideReturn_compute(m); return mayOverrideReturn_MethodDecl_value; } private boolean mayOverrideReturn_compute(MethodDecl m) { return type() == m.type(); } // Declared in Attributes.jrag at line 189 @SuppressWarnings({"unchecked", "cast"}) public Collection attributes() { if(attributes_computed) return attributes_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); attributes_value = attributes_compute(); if(isFinal && num == boundariesCrossed) attributes_computed = true; return attributes_value; } private Collection attributes_compute() { ArrayList l = new ArrayList(); l.add(new ExceptionsAttribute(bytecodes(hostType().constantPool()), this)); if(isAbstract() || isNative()) return l; l.add(new CodeAttribute(bytecodes(hostType().constantPool()), this)); if(getModifiers().isSynthetic()) l.add(new SyntheticAttribute(hostType().constantPool())); return l; } protected boolean descName_computed = false; protected String descName_value; // Declared in ConstantPoolNames.jrag at line 34 @SuppressWarnings({"unchecked", "cast"}) public String descName() { if(descName_computed) return descName_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); descName_value = descName_compute(); if(isFinal && num == boundariesCrossed) descName_computed = true; return descName_value; } private String descName_compute() { StringBuffer b = new StringBuffer(); b.append("("); for (int i=0; i<getNumParameter(); i++) b.append(getParameter(i).type().typeDescriptor()); b.append(")"); if(type().elementType().isUnknown()) { System.out.println(getTypeAccess().dumpTree()); throw new Error("Error generating descName for " + signature() + ", did not expect unknown return type"); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -