1d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller/* 2d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 3d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 5d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * This code is free software; you can redistribute it and/or modify it 6d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * under the terms of the GNU General Public License version 2 only, as 7d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * published by the Free Software Foundation. Oracle designates this 8d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * particular file as subject to the "Classpath" exception as provided 9d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * by Oracle in the LICENSE file that accompanied this code. 10d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 11d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * This code is distributed in the hope that it will be useful, but WITHOUT 12d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * version 2 for more details (a copy is included in the LICENSE file that 15d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * accompanied this code). 16d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 17d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * You should have received a copy of the GNU General Public License version 18d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 2 along with this work; if not, write to the Free Software Foundation, 19d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 21d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * or visit www.oracle.com if you need additional information or have any 23d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * questions. 24d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller */ 25d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller 26d077e674086aa3d123a737af4176f6e3781c86bfNeil Fullerpackage java.lang.reflect; 27d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller 28d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller/** 29d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Thrown when {@link java.lang.reflect.Executable#getParameters the 30d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * java.lang.reflect package} attempts to read method parameters from 31d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * a class file and determines that one or more parameters are 32d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * malformed. 33d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 34d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <p>The following is a list of conditions under which this exception 35d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * can be thrown: 36d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <ul> 37d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <li> The number of parameters (parameter_count) is wrong for the method 38d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <li> A constant pool index is out of bounds. 39d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <li> A constant pool index does not refer to a UTF-8 entry 40d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <li> A parameter's name is "", or contains an illegal character 41d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * <li> The flags field contains an illegal flag (something other than 42d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * FINAL, SYNTHETIC, or MANDATED) 43d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * </ul> 44d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 45d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * See {@link java.lang.reflect.Executable#getParameters} for more 46d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * information. 47d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 48d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * @see java.lang.reflect.Executable#getParameters 49d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * @since 1.8 50d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * @hide Hidden pending tests 51d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller */ 52d077e674086aa3d123a737af4176f6e3781c86bfNeil Fullerpublic class MalformedParametersException extends RuntimeException { 53d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller 54d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller /** 55d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Version for serialization. 56d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller */ 57d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller private static final long serialVersionUID = 20130919L; 58d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller 59d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller /** 60d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Create a {@code MalformedParametersException} with an empty 61d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * reason. 62d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller */ 63d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller public MalformedParametersException() {} 64d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller 65d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller /** 66d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * Create a {@code MalformedParametersException}. 67d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * 68d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller * @param reason The reason for the exception. 69d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller */ 70d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller public MalformedParametersException(String reason) { 71d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller super(reason); 72d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller } 73d077e674086aa3d123a737af4176f6e3781c86bfNeil Fuller} 74