constructordecl.java

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

JAVA
1,419
字号
      return false;    else if(isPublic())      return true;    else if(isProtected()) {      return true;    }    else if(isPrivate()) {      return hostType().topLevelType() == type.topLevelType();    }    else      return hostPackage().equals(type.hostPackage());  }    // Declared in DefiniteAssignment.jrag at line 297 @SuppressWarnings({"unchecked", "cast"})     public boolean isDAafter(Variable v) {        Object _parameters = v;if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);        if(isDAafter_Variable_values.containsKey(_parameters))            return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean isDAafter_Variable_value = isDAafter_compute(v);        if(isFinal && num == boundariesCrossed)            isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));        return isDAafter_Variable_value;    }    private boolean isDAafter_compute(Variable v) {  return getBlock().isDAafter(v) && getBlock().checkReturnDA(v);  }    // Declared in DefiniteAssignment.jrag at line 753 @SuppressWarnings({"unchecked", "cast"})     public boolean isDUafter(Variable v) {        Object _parameters = v;if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);        if(isDUafter_Variable_values.containsKey(_parameters))            return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean isDUafter_Variable_value = isDUafter_compute(v);        if(isFinal && num == boundariesCrossed)            isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));        return isDUafter_Variable_value;    }    private boolean isDUafter_compute(Variable v) {  return getBlock().isDUafter(v) && getBlock().checkReturnDU(v);  }    protected java.util.Map throwsException_TypeDecl_values;    // Declared in ExceptionHandling.jrag at line 136 @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;  }    protected boolean name_computed = false;    protected String name_value;    // Declared in LookupConstructor.jrag at line 129 @SuppressWarnings({"unchecked", "cast"})     public String name() {        if(name_computed)            return name_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        name_value = name_compute();        if(isFinal && num == boundariesCrossed)            name_computed = true;        return name_value;    }    private String name_compute() {  return getID();  }    protected boolean signature_computed = false;    protected String signature_value;    // Declared in LookupConstructor.jrag at line 131 @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++) {      s.append(getParameter(i));      if(i != getNumParameter() - 1)        s.append(", ");    }    s.append(")");    return s.toString();  }    protected java.util.Map sameSignature_ConstructorDecl_values;    // Declared in LookupConstructor.jrag at line 144 @SuppressWarnings({"unchecked", "cast"})     public boolean sameSignature(ConstructorDecl c) {        Object _parameters = c;if(sameSignature_ConstructorDecl_values == null) sameSignature_ConstructorDecl_values = new java.util.HashMap(4);        if(sameSignature_ConstructorDecl_values.containsKey(_parameters))            return ((Boolean)sameSignature_ConstructorDecl_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean sameSignature_ConstructorDecl_value = sameSignature_compute(c);        if(isFinal && num == boundariesCrossed)            sameSignature_ConstructorDecl_values.put(_parameters, Boolean.valueOf(sameSignature_ConstructorDecl_value));        return sameSignature_ConstructorDecl_value;    }    private boolean sameSignature_compute(ConstructorDecl c) {    if(!name().equals(c.name()))      return false;    if(c.getNumParameter() != getNumParameter())      return false;    for(int i = 0; i < getNumParameter(); i++)      if(!c.getParameter(i).type().equals(getParameter(i).type()))        return false;    return true;  }    protected java.util.Map moreSpecificThan_ConstructorDecl_values;    // Declared in LookupConstructor.jrag at line 155 @SuppressWarnings({"unchecked", "cast"})     public boolean moreSpecificThan(ConstructorDecl m) {        Object _parameters = m;if(moreSpecificThan_ConstructorDecl_values == null) moreSpecificThan_ConstructorDecl_values = new java.util.HashMap(4);        if(moreSpecificThan_ConstructorDecl_values.containsKey(_parameters))            return ((Boolean)moreSpecificThan_ConstructorDecl_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean moreSpecificThan_ConstructorDecl_value = moreSpecificThan_compute(m);        if(isFinal && num == boundariesCrossed)            moreSpecificThan_ConstructorDecl_values.put(_parameters, Boolean.valueOf(moreSpecificThan_ConstructorDecl_value));        return moreSpecificThan_ConstructorDecl_value;    }    private boolean moreSpecificThan_compute(ConstructorDecl m) {    for(int i = 0; i < getNumParameter(); i++) {      if(!getParameter(i).type().instanceOf(m.getParameter(i).type()))        return false;    }    return true;  }    protected java.util.Map parameterDeclaration_String_values;    // Declared in LookupVariable.jrag at line 105 @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 215 @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 233 @SuppressWarnings({"unchecked", "cast"})     public boolean isPublic() {        boolean isPublic_value = isPublic_compute();        return isPublic_value;    }    private boolean isPublic_compute() {  return getModifiers().isPublic();  }    // Declared in Modifiers.jrag at line 234 @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 235 @SuppressWarnings({"unchecked", "cast"})     public boolean isProtected() {        boolean isProtected_value = isProtected_compute();        return isProtected_value;    }    private boolean isProtected_compute() {  return getModifiers().isProtected();  }    protected java.util.Map circularThisInvocation_ConstructorDecl_values;    // Declared in NameCheck.jrag at line 83 @SuppressWarnings({"unchecked", "cast"})     public boolean circularThisInvocation(ConstructorDecl decl) {        Object _parameters = decl;if(circularThisInvocation_ConstructorDecl_values == null) circularThisInvocation_ConstructorDecl_values = new java.util.HashMap(4);        if(circularThisInvocation_ConstructorDecl_values.containsKey(_parameters))            return ((Boolean)circularThisInvocation_ConstructorDecl_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean circularThisInvocation_ConstructorDecl_value = circularThisInvocation_compute(decl);        if(isFinal && num == boundariesCrossed)            circularThisInvocation_ConstructorDecl_values.put(_parameters, Boolean.valueOf(circularThisInvocation_ConstructorDecl_value));        return circularThisInvocation_ConstructorDecl_value;    }    private boolean circularThisInvocation_compute(ConstructorDecl decl) {    if(hasConstructorInvocation()) {      Expr e = ((ExprStmt)getConstructorInvocation()).getExpr();      if(e instanceof ConstructorAccess) {        ConstructorDecl constructorDecl = ((ConstructorAccess)e).decl();        if(constructorDecl == decl)          return true;        return constructorDecl.circularThisInvocation(decl);      }    }    return false;  }    // Declared in TypeAnalysis.jrag at line 269 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl type() {        TypeDecl type_value = type_compute();        return type_value;    }    private TypeDecl type_compute() {  return unknownType();  }    // Declared in TypeAnalysis.jrag at line 275 @SuppressWarnings({"unchecked", "cast"})     public boolean isVoid() {        boolean isVoid_value = isVoid_compute();        return isVoid_value;    }    private boolean isVoid_compute() {  return true;  }    // Declared in Attributes.jrag at line 198 @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 CodeAttribute(bytecodes(hostType().constantPool()), null));    l.add(new ExceptionsAttribute(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 48 @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("(");    // this$0    if(needsEnclosing())      b.append(enclosing().typeDescriptor());    if(needsSuperEnclosing())      b.append(superEnclosing().typeDescriptor());    // args    for (int i=0; i<getNumParameter(); i++)      b.append(getParameter(i).type().typeDescriptor());    b.append(")V");    return b.toString();  }    protected java.util.Map bytecodes_ConstantPool_values;    // Declared in CreateBCode.jrag at line 89 @SuppressWarnings({"unchecked", "cast"})     public CodeGeneration bytecodes(ConstantPool constantPool) {        Object _parameters = constantPool;if(bytecodes_ConstantPool_values == null) bytecodes_ConstantPool_values = new java.util.HashMap(4);        if(bytecodes_ConstantPool_values.containsKey(_parameters))            return (CodeGeneration)bytecodes_ConstantPool_values.get(_parameters);        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        CodeGeneration bytecodes_ConstantPool_value = bytecodes_compute(constantPool);        if(isFinal && num == boundariesCrossed)            bytecodes_ConstantPool_values.put(_parameters, bytecodes_ConstantPool_value);        return bytecodes_ConstantPool_value;    }    private CodeGeneration bytecodes_compute(ConstantPool constantPool) {    CodeGeneration gen = new CodeGeneration(constantPool);    generateBytecodes(gen);    if(!gen.numberFormatError())      return gen;    gen = new CodeGeneration(constantPool, true);    generateBytecodes(gen);    if(!gen.numberFormatError())      return gen;    throw new Error("Could not generate code for " + signature() + " in " + hostType().typeName());  }    protected boolean flags_computed = false;    protected int flags_value;    // Declared in Flags.jrag at line 54 @SuppressWarnings({"unchecked", "cast"})     public int flags() {        if(flags_computed)            return flags_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        flags_value = flags_compute();        if(isFinal && num == boundariesCrossed)            flags_computed = true;        return flags_value;    }    private int flags_compute() {    int res = 0;    if(isPublic()) res |= Modifiers.ACC_PUBLIC;    if(isPrivate()) res |= Modifiers.ACC_PRIVATE;    if(isProtected()) res |= Modifiers.ACC_PROTECTED;    //if(isSynchronized()) res |= Modifiers.ACC_SYNCHRONIZED;    //if(isStrictfp()) res |= Modifiers.ACC_STRICT;    return res;

⌨️ 快捷键说明

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