Java Code Examples for sun.tools.java.MemberDefinition#getExceptions()

The following examples show how to use sun.tools.java.MemberDefinition#getExceptions() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RemoteClass.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 2
Source File: RemoteClass.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 3
Source File: RemoteClass.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 4
Source File: RemoteClass.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 5
Source File: RemoteClass.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 6
Source File: RemoteClass.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 7
Source File: RemoteClass.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 8
Source File: RemoteClass.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 9
Source File: RemoteClass.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 10
Source File: RemoteClass.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 11
Source File: RemoteClass.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 12
Source File: RemoteClass.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 13
Source File: RemoteClass.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Method object corresponding to the given
 * method definition.
 */
/*
 * Temporarily comment out the private modifier until
 * the VM allows outer class to access inner class's
 * private constructor
 */
/* private */ Method(MemberDefinition memberDef) {
    this.memberDef = memberDef;
    exceptions = memberDef.getExceptions(env);
    methodHash = computeMethodHash();
}
 
Example 14
Source File: CompoundType.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 15
Source File: CompoundType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 16
Source File: CompoundType.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 17
Source File: CompoundType.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 18
Source File: CompoundType.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 19
Source File: CompoundType.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}
 
Example 20
Source File: CompoundType.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected ValueType[] getMethodExceptions (MemberDefinition member,
                                           boolean quiet,
                                           ContextStack stack) throws Exception {

    boolean result = true;
    stack.setNewContextCode(ContextStack.METHOD_EXCEPTION);
    ClassDeclaration[] except = member.getExceptions(env);
    ValueType[] exceptions = new ValueType[except.length];

    try {
        for (int i = 0; i < except.length; i++) {
            ClassDefinition theClass = except[i].getClassDefinition(env);
            try {
                ValueType type = ValueType.forValue(theClass,stack,false);
                if (type != null) {
                        exceptions[i] = type;
                    } else {
                        result = false;
                    }
            } catch (ClassCastException e1) {
                failedConstraint(22,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
            } catch (NullPointerException e2) {
                failedConstraint(23,quiet,stack,getQualifiedName());
                throw new CompilerError("Method: caught null pointer exception");
            }
        }
    } catch (ClassNotFound e) {
        classNotFound(quiet,stack,e);
        result = false;
    }

    if (!result) {
        throw new Exception();
    }

    // Remove any duplicates (javac seems to allow them, but rmic will
    // generate bad ties)...

    int dupCount = 0;
    for (int i = 0; i < exceptions.length; i++) {
        for (int j = 0; j < exceptions.length; j++) {
            if (i != j && exceptions[i] != null && exceptions[i] == exceptions[j]) {
                exceptions[j] = null;
                dupCount++;
            }
        }
    }
    if (dupCount > 0) {
        int offset = 0;
        ValueType[] temp = new ValueType[exceptions.length - dupCount];
        for (int i = 0; i < exceptions.length; i++) {
            if (exceptions[i] != null) {
                temp[offset++] = exceptions[i];
            }
        }
        exceptions = temp;
    }

    return exceptions;
}