xref: /aosp_15_r20/external/javassist/src/main/javassist/bytecode/BadBytecode.java (revision f1fbf3c2ab775ce834e0af96b7a85bdc7a0eac65)
1*f1fbf3c2SXin Li /*
2*f1fbf3c2SXin Li  * Javassist, a Java-bytecode translator toolkit.
3*f1fbf3c2SXin Li  * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
4*f1fbf3c2SXin Li  *
5*f1fbf3c2SXin Li  * The contents of this file are subject to the Mozilla Public License Version
6*f1fbf3c2SXin Li  * 1.1 (the "License"); you may not use this file except in compliance with
7*f1fbf3c2SXin Li  * the License.  Alternatively, the contents of this file may be used under
8*f1fbf3c2SXin Li  * the terms of the GNU Lesser General Public License Version 2.1 or later,
9*f1fbf3c2SXin Li  * or the Apache License Version 2.0.
10*f1fbf3c2SXin Li  *
11*f1fbf3c2SXin Li  * Software distributed under the License is distributed on an "AS IS" basis,
12*f1fbf3c2SXin Li  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13*f1fbf3c2SXin Li  * for the specific language governing rights and limitations under the
14*f1fbf3c2SXin Li  * License.
15*f1fbf3c2SXin Li  */
16*f1fbf3c2SXin Li 
17*f1fbf3c2SXin Li package javassist.bytecode;
18*f1fbf3c2SXin Li 
19*f1fbf3c2SXin Li /**
20*f1fbf3c2SXin Li  * Signals that a bad bytecode sequence has been found.
21*f1fbf3c2SXin Li  */
22*f1fbf3c2SXin Li public class BadBytecode extends Exception {
23*f1fbf3c2SXin Li     /** default serialVersionUID */
24*f1fbf3c2SXin Li     private static final long serialVersionUID = 1L;
25*f1fbf3c2SXin Li 
BadBytecode(int opcode)26*f1fbf3c2SXin Li     public BadBytecode(int opcode) {
27*f1fbf3c2SXin Li         super("bytecode " + opcode);
28*f1fbf3c2SXin Li     }
29*f1fbf3c2SXin Li 
BadBytecode(String msg)30*f1fbf3c2SXin Li     public BadBytecode(String msg) {
31*f1fbf3c2SXin Li         super(msg);
32*f1fbf3c2SXin Li     }
33*f1fbf3c2SXin Li 
BadBytecode(String msg, Throwable cause)34*f1fbf3c2SXin Li     public BadBytecode(String msg, Throwable cause) {
35*f1fbf3c2SXin Li         super(msg, cause);
36*f1fbf3c2SXin Li     }
37*f1fbf3c2SXin Li 
BadBytecode(MethodInfo minfo, Throwable cause)38*f1fbf3c2SXin Li     public BadBytecode(MethodInfo minfo, Throwable cause) {
39*f1fbf3c2SXin Li         super(minfo.toString() + " in "
40*f1fbf3c2SXin Li               + minfo.getConstPool().getClassName()
41*f1fbf3c2SXin Li               + ": " + cause.getMessage(), cause);
42*f1fbf3c2SXin Li     }
43*f1fbf3c2SXin Li }
44