methoddecl.java

来自「JDK1.4编译器前端」· Java 代码 · 共 1,272 行 · 第 1/4 页

JAVA
1,272
字号
        return isSynchronized_value;    }    private boolean isSynchronized_compute() {  return getModifiers().isSynchronized();  }    protected int isNative_visited = -1;    // Declared in Modifiers.jrag at line 230 @SuppressWarnings({"unchecked", "cast"})     public boolean isNative() {        if(isNative_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isNative in class: ");        isNative_visited = boundariesCrossed;        boolean isNative_value = isNative_compute();        isNative_visited = -1;        return isNative_value;    }    private boolean isNative_compute() {  return getModifiers().isNative();  }    protected int isStrictfp_visited = -1;    // Declared in Modifiers.jrag at line 231 @SuppressWarnings({"unchecked", "cast"})     public boolean isStrictfp() {        if(isStrictfp_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isStrictfp in class: ");        isStrictfp_visited = boundariesCrossed;        boolean isStrictfp_value = isStrictfp_compute();        isStrictfp_visited = -1;        return isStrictfp_value;    }    private boolean isStrictfp_compute() {  return getModifiers().isStrictfp();  }    protected int dumpString_visited = -1;    // Declared in PrettyPrint.jadd at line 793 @SuppressWarnings({"unchecked", "cast"})     public String dumpString() {        if(dumpString_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: dumpString in class: ");        dumpString_visited = boundariesCrossed;        String dumpString_value = dumpString_compute();        dumpString_visited = -1;        return dumpString_value;    }    private String dumpString_compute() {  return getClass().getName() + " [" + getID() + "]";  }    protected int type_visited = -1;    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;        if(type_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: type in class: ");        type_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        type_value = type_compute();        if(isFinal && num == boundariesCrossed)            type_computed = true;        type_visited = -1;        return type_value;    }    private TypeDecl type_compute() {  return getTypeAccess().type();  }    protected int isVoid_visited = -1;    // Declared in TypeAnalysis.jrag at line 273 @SuppressWarnings({"unchecked", "cast"})     public boolean isVoid() {        if(isVoid_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isVoid in class: ");        isVoid_visited = boundariesCrossed;        boolean isVoid_value = isVoid_compute();        isVoid_visited = -1;        return isVoid_value;    }    private boolean isVoid_compute() {  return type().isVoid();  }    protected java.util.Map mayOverrideReturn_MethodDecl_visited;    // Declared in TypeHierarchyCheck.jrag at line 237 @SuppressWarnings({"unchecked", "cast"})     public boolean mayOverrideReturn(MethodDecl m) {        Object _parameters = m;if(mayOverrideReturn_MethodDecl_visited == null) mayOverrideReturn_MethodDecl_visited = new java.util.HashMap(4);        if(new Integer(boundariesCrossed).equals(mayOverrideReturn_MethodDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: mayOverrideReturn in class: ");        mayOverrideReturn_MethodDecl_visited.put(_parameters, new Integer(boundariesCrossed));        boolean mayOverrideReturn_MethodDecl_value = mayOverrideReturn_compute(m);        mayOverrideReturn_MethodDecl_visited.remove(_parameters);        return mayOverrideReturn_MethodDecl_value;    }    private boolean mayOverrideReturn_compute(MethodDecl m) {  return type() == m.type();  }    protected java.util.Map handlesException_TypeDecl_visited;    protected java.util.Map handlesException_TypeDecl_values;    // Declared in ExceptionHandling.jrag at line 37 @SuppressWarnings({"unchecked", "cast"})     public boolean handlesException(TypeDecl exceptionType) {        Object _parameters = exceptionType;if(handlesException_TypeDecl_visited == null) handlesException_TypeDecl_visited = new java.util.HashMap(4);if(handlesException_TypeDecl_values == null) handlesException_TypeDecl_values = new java.util.HashMap(4);        if(handlesException_TypeDecl_values.containsKey(_parameters))            return ((Boolean)handlesException_TypeDecl_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(handlesException_TypeDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: handlesException in class: ");        handlesException_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);        if(isFinal && num == boundariesCrossed)            handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value));        handlesException_TypeDecl_visited.remove(_parameters);        return handlesException_TypeDecl_value;    }    protected int unknownMethod_visited = -1;    // Declared in LookupMethod.jrag at line 14 @SuppressWarnings({"unchecked", "cast"})     public MethodDecl unknownMethod() {        if(unknownMethod_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: unknownMethod in class: ");        unknownMethod_visited = boundariesCrossed;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        MethodDecl unknownMethod_value = getParent().Define_MethodDecl_unknownMethod(this, null);        unknownMethod_visited = -1;        return unknownMethod_value;    }    // Declared in VariableDeclaration.jrag at line 81    public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return false;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isConstructorParameter(this, caller);    }    // Declared in Modifiers.jrag at line 271    public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBePrivate(this, caller);    }    // Declared in LookupVariable.jrag at line 46    public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return parameterDeclaration(name);        }        if(caller == getBlockOptNoTransform()){    SimpleSet set = parameterDeclaration(name);    // A declaration of a method parameter name shadows any other variable declarations    if(!set.isEmpty()) return set;    // Delegate to other declarations in scope    return lookupVariable(name);  }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_SimpleSet_lookupVariable(this, caller, name);    }    // Declared in ExceptionHandling.jrag at line 120    public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {        if(caller == getBlockOptNoTransform()) {            return throwsException(exceptionType) || handlesException(exceptionType);        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_handlesException(this, caller, exceptionType);    }    // Declared in Modifiers.jrag at line 272    public boolean Define_boolean_mayBeAbstract(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeAbstract(this, caller);    }    // Declared in Modifiers.jrag at line 277    public boolean Define_boolean_mayBeStrictfp(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeStrictfp(this, caller);    }    // Declared in UnreachableStatements.jrag at line 33    public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {        if(caller == getBlockOptNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_reachable(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 438    public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getBlockOptNoTransform()) {            return v.isFinal() && (v.isClassVariable() || v.isInstanceVariable()) ? true : isDAbefore(v);        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isDAbefore(this, caller, v);    }    // Declared in Modifiers.jrag at line 274    public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeFinal(this, caller);    }    // Declared in VariableDeclaration.jrag at line 80    public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isMethodParameter(this, caller);    }    // Declared in Modifiers.jrag at line 269    public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBePublic(this, caller);    }    // Declared in TypeCheck.jrag at line 405    public TypeDecl Define_TypeDecl_returnType(ASTNode caller, ASTNode child) {        if(caller == getBlockOptNoTransform()) {            return type();        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_TypeDecl_returnType(this, caller);    }    // Declared in Modifiers.jrag at line 270    public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeProtected(this, caller);    }    // Declared in NameCheck.jrag at line 241    public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) {        if(caller == getBlockOptNoTransform()) {            return this;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_ASTNode_enclosingBlock(this, caller);    }    // Declared in Modifiers.jrag at line 275    public boolean Define_boolean_mayBeSynchronized(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeSynchronized(this, caller);    }    // Declared in VariableDeclaration.jrag at line 82    public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return false;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isExceptionHandlerParameter(this, caller);    }    // Declared in Modifiers.jrag at line 276    public boolean Define_boolean_mayBeNative(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeNative(this, caller);    }    // Declared in SyntacticClassification.jrag at line 82    public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {        if(caller == getExceptionListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return NameType.TYPE_NAME;        }        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return NameType.TYPE_NAME;        }        if(caller == getTypeAccessNoTransform()) {            return NameType.TYPE_NAME;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_NameType_nameType(this, caller);    }    // Declared in TypeHierarchyCheck.jrag at line 142    public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {        if(caller == getBlockOptNoTransform()) {            return isStatic();        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_inStaticContext(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 872    public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getBlockOptNoTransform()) {            return v.isFinal() && (v.isClassVariable() || v.isInstanceVariable()) ? false : true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isDUbefore(this, caller, v);    }    // Declared in Modifiers.jrag at line 273    public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeStatic(this, caller);    }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?