Making sure various classes are defined only at one place jdk8
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 10 Aug 2014 06:21:50 +0200
branchjdk8
changeset 16528fb89a569621
parent 1651 5c990ed353e9
child 1653 bd151459ee4f
Making sure various classes are defined only at one place
rt/emul/compact/src/main/java/java/lang/Cloneable.java
rt/emul/compact/src/main/java/java/lang/IncompatibleClassChangeError.java
rt/emul/compact/src/main/java/java/lang/NoSuchMethodError.java
rt/emul/compact/src/main/java/java/lang/NoSuchMethodException.java
rt/emul/mini/src/main/java/java/lang/Cloneable.java
rt/emul/mini/src/main/java/java/lang/IncompatibleClassChangeError.java
rt/emul/mini/src/main/java/java/lang/NoSuchMethodError.java
rt/emul/mini/src/main/java/java/lang/NoSuchMethodException.java
rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java
     1.1 --- a/rt/emul/compact/src/main/java/java/lang/Cloneable.java	Sun Aug 10 06:13:36 2014 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,54 +0,0 @@
     1.4 -/*
     1.5 - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
     1.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 - *
     1.8 - * This code is free software; you can redistribute it and/or modify it
     1.9 - * under the terms of the GNU General Public License version 2 only, as
    1.10 - * published by the Free Software Foundation.  Oracle designates this
    1.11 - * particular file as subject to the "Classpath" exception as provided
    1.12 - * by Oracle in the LICENSE file that accompanied this code.
    1.13 - *
    1.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 - * version 2 for more details (a copy is included in the LICENSE file that
    1.18 - * accompanied this code).
    1.19 - *
    1.20 - * You should have received a copy of the GNU General Public License version
    1.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 - *
    1.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 - * or visit www.oracle.com if you need additional information or have any
    1.26 - * questions.
    1.27 - */
    1.28 -
    1.29 -package java.lang;
    1.30 -
    1.31 -/**
    1.32 - * A class implements the <code>Cloneable</code> interface to
    1.33 - * indicate to the {@link java.lang.Object#clone()} method that it
    1.34 - * is legal for that method to make a
    1.35 - * field-for-field copy of instances of that class.
    1.36 - * <p>
    1.37 - * Invoking Object's clone method on an instance that does not implement the
    1.38 - * <code>Cloneable</code> interface results in the exception
    1.39 - * <code>CloneNotSupportedException</code> being thrown.
    1.40 - * <p>
    1.41 - * By convention, classes that implement this interface should override
    1.42 - * <tt>Object.clone</tt> (which is protected) with a public method.
    1.43 - * See {@link java.lang.Object#clone()} for details on overriding this
    1.44 - * method.
    1.45 - * <p>
    1.46 - * Note that this interface does <i>not</i> contain the <tt>clone</tt> method.
    1.47 - * Therefore, it is not possible to clone an object merely by virtue of the
    1.48 - * fact that it implements this interface.  Even if the clone method is invoked
    1.49 - * reflectively, there is no guarantee that it will succeed.
    1.50 - *
    1.51 - * @author  unascribed
    1.52 - * @see     java.lang.CloneNotSupportedException
    1.53 - * @see     java.lang.Object#clone()
    1.54 - * @since   JDK1.0
    1.55 - */
    1.56 -public interface Cloneable {
    1.57 -}
     2.1 --- a/rt/emul/compact/src/main/java/java/lang/IncompatibleClassChangeError.java	Sun Aug 10 06:13:36 2014 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,57 +0,0 @@
     2.4 -/*
     2.5 - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
     2.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.7 - *
     2.8 - * This code is free software; you can redistribute it and/or modify it
     2.9 - * under the terms of the GNU General Public License version 2 only, as
    2.10 - * published by the Free Software Foundation.  Oracle designates this
    2.11 - * particular file as subject to the "Classpath" exception as provided
    2.12 - * by Oracle in the LICENSE file that accompanied this code.
    2.13 - *
    2.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    2.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.17 - * version 2 for more details (a copy is included in the LICENSE file that
    2.18 - * accompanied this code).
    2.19 - *
    2.20 - * You should have received a copy of the GNU General Public License version
    2.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    2.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.23 - *
    2.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.25 - * or visit www.oracle.com if you need additional information or have any
    2.26 - * questions.
    2.27 - */
    2.28 -
    2.29 -package java.lang;
    2.30 -
    2.31 -/**
    2.32 - * Thrown when an incompatible class change has occurred to some class
    2.33 - * definition. The definition of some class, on which the currently
    2.34 - * executing method depends, has since changed.
    2.35 - *
    2.36 - * @author  unascribed
    2.37 - * @since   JDK1.0
    2.38 - */
    2.39 -public
    2.40 -class IncompatibleClassChangeError extends LinkageError {
    2.41 -    private static final long serialVersionUID = -4914975503642802119L;
    2.42 -
    2.43 -    /**
    2.44 -     * Constructs an <code>IncompatibleClassChangeError</code> with no
    2.45 -     * detail message.
    2.46 -     */
    2.47 -    public IncompatibleClassChangeError () {
    2.48 -        super();
    2.49 -    }
    2.50 -
    2.51 -    /**
    2.52 -     * Constructs an <code>IncompatibleClassChangeError</code> with the
    2.53 -     * specified detail message.
    2.54 -     *
    2.55 -     * @param   s   the detail message.
    2.56 -     */
    2.57 -    public IncompatibleClassChangeError(String s) {
    2.58 -        super(s);
    2.59 -    }
    2.60 -}
     3.1 --- a/rt/emul/compact/src/main/java/java/lang/NoSuchMethodError.java	Sun Aug 10 06:13:36 2014 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,60 +0,0 @@
     3.4 -/*
     3.5 - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
     3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 - *
     3.8 - * This code is free software; you can redistribute it and/or modify it
     3.9 - * under the terms of the GNU General Public License version 2 only, as
    3.10 - * published by the Free Software Foundation.  Oracle designates this
    3.11 - * particular file as subject to the "Classpath" exception as provided
    3.12 - * by Oracle in the LICENSE file that accompanied this code.
    3.13 - *
    3.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    3.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.17 - * version 2 for more details (a copy is included in the LICENSE file that
    3.18 - * accompanied this code).
    3.19 - *
    3.20 - * You should have received a copy of the GNU General Public License version
    3.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    3.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.23 - *
    3.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.25 - * or visit www.oracle.com if you need additional information or have any
    3.26 - * questions.
    3.27 - */
    3.28 -
    3.29 -package java.lang;
    3.30 -
    3.31 -/**
    3.32 - * Thrown if an application tries to call a specified method of a
    3.33 - * class (either static or instance), and that class no longer has a
    3.34 - * definition of that method.
    3.35 - * <p>
    3.36 - * Normally, this error is caught by the compiler; this error can
    3.37 - * only occur at run time if the definition of a class has
    3.38 - * incompatibly changed.
    3.39 - *
    3.40 - * @author  unascribed
    3.41 - * @since   JDK1.0
    3.42 - */
    3.43 -public
    3.44 -class NoSuchMethodError extends IncompatibleClassChangeError {
    3.45 -    private static final long serialVersionUID = -3765521442372831335L;
    3.46 -
    3.47 -    /**
    3.48 -     * Constructs a <code>NoSuchMethodError</code> with no detail message.
    3.49 -     */
    3.50 -    public NoSuchMethodError() {
    3.51 -        super();
    3.52 -    }
    3.53 -
    3.54 -    /**
    3.55 -     * Constructs a <code>NoSuchMethodError</code> with the
    3.56 -     * specified detail message.
    3.57 -     *
    3.58 -     * @param   s   the detail message.
    3.59 -     */
    3.60 -    public NoSuchMethodError(String s) {
    3.61 -        super(s);
    3.62 -    }
    3.63 -}
     4.1 --- a/rt/emul/compact/src/main/java/java/lang/NoSuchMethodException.java	Sun Aug 10 06:13:36 2014 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,53 +0,0 @@
     4.4 -/*
     4.5 - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
     4.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 - *
     4.8 - * This code is free software; you can redistribute it and/or modify it
     4.9 - * under the terms of the GNU General Public License version 2 only, as
    4.10 - * published by the Free Software Foundation.  Oracle designates this
    4.11 - * particular file as subject to the "Classpath" exception as provided
    4.12 - * by Oracle in the LICENSE file that accompanied this code.
    4.13 - *
    4.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    4.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.17 - * version 2 for more details (a copy is included in the LICENSE file that
    4.18 - * accompanied this code).
    4.19 - *
    4.20 - * You should have received a copy of the GNU General Public License version
    4.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    4.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.23 - *
    4.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.25 - * or visit www.oracle.com if you need additional information or have any
    4.26 - * questions.
    4.27 - */
    4.28 -
    4.29 -package java.lang;
    4.30 -
    4.31 -/**
    4.32 - * Thrown when a particular method cannot be found.
    4.33 - *
    4.34 - * @author     unascribed
    4.35 - * @since      JDK1.0
    4.36 - */
    4.37 -public
    4.38 -class NoSuchMethodException extends ReflectiveOperationException {
    4.39 -    private static final long serialVersionUID = 5034388446362600923L;
    4.40 -
    4.41 -    /**
    4.42 -     * Constructs a <code>NoSuchMethodException</code> without a detail message.
    4.43 -     */
    4.44 -    public NoSuchMethodException() {
    4.45 -        super();
    4.46 -    }
    4.47 -
    4.48 -    /**
    4.49 -     * Constructs a <code>NoSuchMethodException</code> with a detail message.
    4.50 -     *
    4.51 -     * @param      s   the detail message.
    4.52 -     */
    4.53 -    public NoSuchMethodException(String s) {
    4.54 -        super(s);
    4.55 -    }
    4.56 -}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/rt/emul/mini/src/main/java/java/lang/NoSuchMethodError.java	Sun Aug 10 06:21:50 2014 +0200
     5.3 @@ -0,0 +1,60 @@
     5.4 +/*
     5.5 + * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
     5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 + *
     5.8 + * This code is free software; you can redistribute it and/or modify it
     5.9 + * under the terms of the GNU General Public License version 2 only, as
    5.10 + * published by the Free Software Foundation.  Oracle designates this
    5.11 + * particular file as subject to the "Classpath" exception as provided
    5.12 + * by Oracle in the LICENSE file that accompanied this code.
    5.13 + *
    5.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    5.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.17 + * version 2 for more details (a copy is included in the LICENSE file that
    5.18 + * accompanied this code).
    5.19 + *
    5.20 + * You should have received a copy of the GNU General Public License version
    5.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    5.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.23 + *
    5.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    5.25 + * or visit www.oracle.com if you need additional information or have any
    5.26 + * questions.
    5.27 + */
    5.28 +
    5.29 +package java.lang;
    5.30 +
    5.31 +/**
    5.32 + * Thrown if an application tries to call a specified method of a
    5.33 + * class (either static or instance), and that class no longer has a
    5.34 + * definition of that method.
    5.35 + * <p>
    5.36 + * Normally, this error is caught by the compiler; this error can
    5.37 + * only occur at run time if the definition of a class has
    5.38 + * incompatibly changed.
    5.39 + *
    5.40 + * @author  unascribed
    5.41 + * @since   JDK1.0
    5.42 + */
    5.43 +public
    5.44 +class NoSuchMethodError extends IncompatibleClassChangeError {
    5.45 +    private static final long serialVersionUID = -3765521442372831335L;
    5.46 +
    5.47 +    /**
    5.48 +     * Constructs a <code>NoSuchMethodError</code> with no detail message.
    5.49 +     */
    5.50 +    public NoSuchMethodError() {
    5.51 +        super();
    5.52 +    }
    5.53 +
    5.54 +    /**
    5.55 +     * Constructs a <code>NoSuchMethodError</code> with the
    5.56 +     * specified detail message.
    5.57 +     *
    5.58 +     * @param   s   the detail message.
    5.59 +     */
    5.60 +    public NoSuchMethodError(String s) {
    5.61 +        super(s);
    5.62 +    }
    5.63 +}
     6.1 --- a/rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java	Sun Aug 10 06:13:36 2014 +0200
     6.2 +++ b/rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java	Sun Aug 10 06:21:50 2014 +0200
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -33,8 +33,9 @@
    6.11   * @author  Frank Yellin
    6.12   * @since   JDK1.0
    6.13   */
    6.14 -abstract public
    6.15 -class VirtualMachineError extends Error {
    6.16 +abstract public class VirtualMachineError extends Error {
    6.17 +    private static final long serialVersionUID = 4161983926571568670L;
    6.18 +
    6.19      /**
    6.20       * Constructs a <code>VirtualMachineError</code> with no detail message.
    6.21       */
    6.22 @@ -46,9 +47,43 @@
    6.23       * Constructs a <code>VirtualMachineError</code> with the specified
    6.24       * detail message.
    6.25       *
    6.26 -     * @param   s   the detail message.
    6.27 +     * @param   message   the detail message.
    6.28       */
    6.29 -    public VirtualMachineError(String s) {
    6.30 -        super(s);
    6.31 +    public VirtualMachineError(String message) {
    6.32 +        super(message);
    6.33 +    }
    6.34 +
    6.35 +    /**
    6.36 +     * Constructs a {@code VirtualMachineError} with the specified
    6.37 +     * detail message and cause.  <p>Note that the detail message
    6.38 +     * associated with {@code cause} is <i>not</i> automatically
    6.39 +     * incorporated in this error's detail message.
    6.40 +     *
    6.41 +     * @param  message the detail message (which is saved for later retrieval
    6.42 +     *         by the {@link #getMessage()} method).
    6.43 +     * @param  cause the cause (which is saved for later retrieval by the
    6.44 +     *         {@link #getCause()} method).  (A {@code null} value is
    6.45 +     *         permitted, and indicates that the cause is nonexistent or
    6.46 +     *         unknown.)
    6.47 +     * @since  1.8
    6.48 +     */
    6.49 +    public VirtualMachineError(String message, Throwable cause) {
    6.50 +        super(message, cause);
    6.51 +    }
    6.52 +
    6.53 +    /**
    6.54 +     * Constructs an a {@code VirtualMachineError} with the specified
    6.55 +     * cause and a detail message of {@code (cause==null ? null :
    6.56 +     * cause.toString())} (which typically contains the class and
    6.57 +     * detail message of {@code cause}).
    6.58 +     *
    6.59 +     * @param  cause the cause (which is saved for later retrieval by the
    6.60 +     *         {@link #getCause()} method).  (A {@code null} value is
    6.61 +     *         permitted, and indicates that the cause is nonexistent or
    6.62 +     *         unknown.)
    6.63 +     * @since  1.8
    6.64 +     */
    6.65 +    public VirtualMachineError(Throwable cause) {
    6.66 +        super(cause);
    6.67      }
    6.68  }