Re-adding getDeclaringClass method, but throwing a security exception when it is called NbHtml4J
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 06 Jan 2014 13:45:57 +0100
branchNbHtml4J
changeset 1419876ad06147f3
parent 1418 b8ff900a542d
child 1420 246ee398b411
Re-adding getDeclaringClass method, but throwing a security exception when it is called
rt/emul/mini/src/main/java/java/lang/Class.java
     1.1 --- a/rt/emul/mini/src/main/java/java/lang/Class.java	Mon Jan 06 13:31:04 2014 +0100
     1.2 +++ b/rt/emul/mini/src/main/java/java/lang/Class.java	Mon Jan 06 13:45:57 2014 +0100
     1.3 @@ -632,6 +632,20 @@
     1.4          return getAccess();
     1.5      }
     1.6  
     1.7 +    /**
     1.8 +     * If the class or interface represented by this {@code Class} object
     1.9 +     * is a member of another class, returns the {@code Class} object
    1.10 +     * representing the class in which it was declared.  This method returns
    1.11 +     * null if this class or interface is not a member of any other class.  If
    1.12 +     * this {@code Class} object represents an array class, a primitive
    1.13 +     * type, or void,then this method returns null.
    1.14 +     *
    1.15 +     * @return the declaring class for this class
    1.16 +     * @since JDK1.1
    1.17 +     */
    1.18 +    public Class<?> getDeclaringClass() {
    1.19 +        throw new SecurityException();
    1.20 +    }
    1.21  
    1.22      /**
    1.23       * Returns the simple name of the underlying class as given in the