src/java.base/share/classes/java/lang/reflect/MalformedParametersException.java
author mchung
Thu, 04 Oct 2018 08:45:21 -0700
changeset 52015 821bfc24d750
parent 47216 71c04702a3d5
child 57956 e0b8b019d2f5
permissions -rw-r--r--
8181443: Replace usages of jdk.internal.misc.Unsafe with MethodHandles.Lookup.defineClass Reviewed-by: alanb, egahlin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20506
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     1
/*
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     4
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    10
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    15
 * accompanied this code).
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    16
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    20
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    23
 * questions.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    24
 */
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    25
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    26
package java.lang.reflect;
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    27
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    28
/**
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    29
 * Thrown when {@link java.lang.reflect.Executable#getParameters the
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    30
 * java.lang.reflect package} attempts to read method parameters from
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    31
 * a class file and determines that one or more parameters are
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    32
 * malformed.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    33
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    34
 * <p>The following is a list of conditions under which this exception
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    35
 * can be thrown:
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    36
 * <ul>
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    37
 * <li> The number of parameters (parameter_count) is wrong for the method
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    38
 * <li> A constant pool index is out of bounds.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    39
 * <li> A constant pool index does not refer to a UTF-8 entry
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    40
 * <li> A parameter's name is "", or contains an illegal character
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    41
 * <li> The flags field contains an illegal flag (something other than
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    42
 *     FINAL, SYNTHETIC, or MANDATED)
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    43
 * </ul>
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    44
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    45
 * See {@link java.lang.reflect.Executable#getParameters} for more
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    46
 * information.
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    47
 *
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    48
 * @see java.lang.reflect.Executable#getParameters
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    49
 * @since 1.8
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    50
 */
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    51
public class MalformedParametersException extends RuntimeException {
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    52
20770
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    53
    /**
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    54
     * Version for serialization.
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    55
     */
20506
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    56
    private static final long serialVersionUID = 20130919L;
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    57
20770
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    58
    /**
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    59
     * Create a {@code MalformedParametersException} with an empty
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    60
     * reason.
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    61
     */
20506
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    62
    public MalformedParametersException() {}
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    63
20770
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    64
    /**
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    65
     * Create a {@code MalformedParametersException}.
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    66
     *
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    67
     * @param reason The reason for the exception.
235451dd936a 8026011: java.lang.reflect.MalformedParametersException introduces doclint warnings
emc
parents: 20506
diff changeset
    68
     */
20506
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    69
    public MalformedParametersException(String reason) {
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    70
        super(reason);
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    71
    }
d826dd5f8e10 8020981: Update methods of java.lang.reflect.Parameter to throw correct exceptions
emc
parents:
diff changeset
    72
}