# HG changeset patch # User Jaroslav Tulach # Date 1407644510 -7200 # Node ID 8fb89a569621e37ea53504b74b2b29ed25e3dca0 # Parent 5c990ed353e98152a8d1cebb8d086a56ba29f21b Making sure various classes are defined only at one place diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/compact/src/main/java/java/lang/Cloneable.java --- a/rt/emul/compact/src/main/java/java/lang/Cloneable.java Sun Aug 10 06:13:36 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.lang; - -/** - * A class implements the Cloneable interface to - * indicate to the {@link java.lang.Object#clone()} method that it - * is legal for that method to make a - * field-for-field copy of instances of that class. - *

- * Invoking Object's clone method on an instance that does not implement the - * Cloneable interface results in the exception - * CloneNotSupportedException being thrown. - *

- * By convention, classes that implement this interface should override - * Object.clone (which is protected) with a public method. - * See {@link java.lang.Object#clone()} for details on overriding this - * method. - *

- * Note that this interface does not contain the clone method. - * Therefore, it is not possible to clone an object merely by virtue of the - * fact that it implements this interface. Even if the clone method is invoked - * reflectively, there is no guarantee that it will succeed. - * - * @author unascribed - * @see java.lang.CloneNotSupportedException - * @see java.lang.Object#clone() - * @since JDK1.0 - */ -public interface Cloneable { -} diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/compact/src/main/java/java/lang/IncompatibleClassChangeError.java --- a/rt/emul/compact/src/main/java/java/lang/IncompatibleClassChangeError.java Sun Aug 10 06:13:36 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.lang; - -/** - * Thrown when an incompatible class change has occurred to some class - * definition. The definition of some class, on which the currently - * executing method depends, has since changed. - * - * @author unascribed - * @since JDK1.0 - */ -public -class IncompatibleClassChangeError extends LinkageError { - private static final long serialVersionUID = -4914975503642802119L; - - /** - * Constructs an IncompatibleClassChangeError with no - * detail message. - */ - public IncompatibleClassChangeError () { - super(); - } - - /** - * Constructs an IncompatibleClassChangeError with the - * specified detail message. - * - * @param s the detail message. - */ - public IncompatibleClassChangeError(String s) { - super(s); - } -} diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/compact/src/main/java/java/lang/NoSuchMethodError.java --- a/rt/emul/compact/src/main/java/java/lang/NoSuchMethodError.java Sun Aug 10 06:13:36 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.lang; - -/** - * Thrown if an application tries to call a specified method of a - * class (either static or instance), and that class no longer has a - * definition of that method. - *

- * Normally, this error is caught by the compiler; this error can - * only occur at run time if the definition of a class has - * incompatibly changed. - * - * @author unascribed - * @since JDK1.0 - */ -public -class NoSuchMethodError extends IncompatibleClassChangeError { - private static final long serialVersionUID = -3765521442372831335L; - - /** - * Constructs a NoSuchMethodError with no detail message. - */ - public NoSuchMethodError() { - super(); - } - - /** - * Constructs a NoSuchMethodError with the - * specified detail message. - * - * @param s the detail message. - */ - public NoSuchMethodError(String s) { - super(s); - } -} diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/compact/src/main/java/java/lang/NoSuchMethodException.java --- a/rt/emul/compact/src/main/java/java/lang/NoSuchMethodException.java Sun Aug 10 06:13:36 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.lang; - -/** - * Thrown when a particular method cannot be found. - * - * @author unascribed - * @since JDK1.0 - */ -public -class NoSuchMethodException extends ReflectiveOperationException { - private static final long serialVersionUID = 5034388446362600923L; - - /** - * Constructs a NoSuchMethodException without a detail message. - */ - public NoSuchMethodException() { - super(); - } - - /** - * Constructs a NoSuchMethodException with a detail message. - * - * @param s the detail message. - */ - public NoSuchMethodException(String s) { - super(s); - } -} diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/mini/src/main/java/java/lang/NoSuchMethodError.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/emul/mini/src/main/java/java/lang/NoSuchMethodError.java Sun Aug 10 06:21:50 2014 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang; + +/** + * Thrown if an application tries to call a specified method of a + * class (either static or instance), and that class no longer has a + * definition of that method. + *

+ * Normally, this error is caught by the compiler; this error can + * only occur at run time if the definition of a class has + * incompatibly changed. + * + * @author unascribed + * @since JDK1.0 + */ +public +class NoSuchMethodError extends IncompatibleClassChangeError { + private static final long serialVersionUID = -3765521442372831335L; + + /** + * Constructs a NoSuchMethodError with no detail message. + */ + public NoSuchMethodError() { + super(); + } + + /** + * Constructs a NoSuchMethodError with the + * specified detail message. + * + * @param s the detail message. + */ + public NoSuchMethodError(String s) { + super(s); + } +} diff -r 5c990ed353e9 -r 8fb89a569621 rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java --- a/rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java Sun Aug 10 06:13:36 2014 +0200 +++ b/rt/emul/mini/src/main/java/java/lang/VirtualMachineError.java Sun Aug 10 06:21:50 2014 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,9 @@ * @author Frank Yellin * @since JDK1.0 */ -abstract public -class VirtualMachineError extends Error { +abstract public class VirtualMachineError extends Error { + private static final long serialVersionUID = 4161983926571568670L; + /** * Constructs a VirtualMachineError with no detail message. */ @@ -46,9 +47,43 @@ * Constructs a VirtualMachineError with the specified * detail message. * - * @param s the detail message. + * @param message the detail message. */ - public VirtualMachineError(String s) { - super(s); + public VirtualMachineError(String message) { + super(message); + } + + /** + * Constructs a {@code VirtualMachineError} with the specified + * detail message and cause.

Note that the detail message + * associated with {@code cause} is not automatically + * incorporated in this error's detail message. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.8 + */ + public VirtualMachineError(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructs an a {@code VirtualMachineError} with the specified + * cause and a detail message of {@code (cause==null ? null : + * cause.toString())} (which typically contains the class and + * detail message of {@code cause}). + * + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.8 + */ + public VirtualMachineError(Throwable cause) { + super(cause); } }