Package org.codehaus.janino

Examples of org.codehaus.janino.JaninoRuntimeException


        // Parse the attribute body.
        AttributeInfo res = this.readAttributeBody(attributeName, dis2);

        // Check for extraneous bytes.
        int av = bais.available();
        if (av > 0) throw new JaninoRuntimeException(av + " extraneous bytes in attribute \"" + attributeName + "\"");

        return res;
    }
View Full Code Here


                            LineNumberTableAttribute    lineNumberTableAttribute = null;
                            for (int i = 0; i < attributes.length; ++i) {
                                AttributeInfo a = attributes[i];
                                if (a instanceof LocalVariableTableAttribute) {
                                    if (localVariableTableAttribute != null) {
                                        throw new JaninoRuntimeException("Duplicate LocalVariableTable attribute");
                                    }
                                    localVariableTableAttribute = (LocalVariableTableAttribute) a;
                                }
                                if (a instanceof LineNumberTableAttribute) {
                                    if (lineNumberTableAttribute != null) {
                                        throw new JaninoRuntimeException("Duplicate LineNumberTable attribute");
                                    }
                                    lineNumberTableAttribute = (LineNumberTableAttribute) a;
                                }
                            }
                            try {
View Full Code Here

                                Disassembler                d
                            ) throws IOException {
                                int npads = 3 - (instructionOffset % 4);
                                for (int i = 0; i < npads; ++i) {
                                    if (dis.readByte() != (byte) 0) {
                                        throw new JaninoRuntimeException("Non-zero pad byte in \"tableswitch\"");
                                    }
                                }
                                d.print("default => " + (instructionOffset + dis.readInt()));
                                int low = dis.readInt();
                                int high = dis.readInt();
                                for (int i = low; i <= high; ++i) {
                                    int offset = dis.readInt();
                                    d.print(", " + i + " => " + (instructionOffset + offset));
                                }
                            }
                        };
                    } else
                    if (s.equals("lookupswitch")) {
                        operand = new Operand() {
                            public void disasm(
                                DataInputStream             dis,
                                int                         instructionOffset,
                                LocalVariableTableAttribute localVariableTableAttribute,
                                Disassembler                d
                            ) throws IOException {
                                int npads = 3 - (instructionOffset % 4);
                                for (int i = 0; i < npads; ++i) {
                                    byte b = dis.readByte();
                                    if (b != (byte) 0) d.print("Padding byte #" + i + " is " + (b & 0xff));
                                }
                                d.print("default => " + (instructionOffset + dis.readInt()));
                                int npairs = dis.readInt();
                                for (int i = 0; i < npairs; ++i) {
                                    int match  = dis.readInt();
                                    int offset = dis.readInt();
                                    d.print(", " + match + " => " + (instructionOffset + offset));
                                }
                            }
                        };
                    } else
                    if (s.equals("wide")) {
                        operand = new Operand() {
                            public void disasm(
                                DataInputStream             dis,
                                int                         instructionOffset,
                                LocalVariableTableAttribute localVariableTableAttribute,
                                Disassembler                d
                            ) throws IOException {
                                int subopcode = 0xff & dis.readByte();
                                Instruction wideInstruction = opcodeToWideInstruction[subopcode];
                                if (wideInstruction == null) {
                                    throw new JaninoRuntimeException(
                                        "Invalid opcode "
                                        + subopcode
                                        + " after opcode WIDE"
                                    );
                                }
                                d.disasmInstruction(
                                    wideInstruction,
                                    dis,
                                    instructionOffset,
                                    localVariableTableAttribute
                                );
                            }
                        };
                    } else
                    {
                        throw new JaninoRuntimeException("Unknown operand \"" + s + "\"");
                    }
                    l.add(operand);
                }
                operands = (Operand[]) l.toArray(new Operand[l.size()]);
            }
View Full Code Here

            class State {
                State(File dir) {
                    File[] entries = dir.listFiles();
                    if (entries == null) {
                        throw new JaninoRuntimeException("Directory \"" + dir + "\" could not be read");
                    }
                    List directoryList = new ArrayList();
                    List fileList      = new ArrayList();
                    for (int i = 0; i < entries.length; ++i) {
                        File entry = entries[i];
View Full Code Here

            class State {
                State(File dir) {
                    File[] entries = dir.listFiles();
                    if (entries == null) {
                        throw new JaninoRuntimeException("Directory \"" + dir + "\" could not be read");
                    }
                    List directoryList = new ArrayList();
                    List fileList      = new ArrayList();
                    for (int i = 0; i < entries.length; ++i) {
                        File entry = entries[i];
View Full Code Here

TOP

Related Classes of org.codehaus.janino.JaninoRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.