Examples of JaninoRuntimeException


Examples of org.codehaus.janino.JaninoRuntimeException

                }
                this.pw.print(" }");
            }
        } else
        {
            throw new JaninoRuntimeException(
                "Unexpected array initializer or rvalue class "
                + aiorv.getClass().getName()
            );
        }
    }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

            for (;;) {
                String line;
                try {
                    line = br.readLine();
                } catch (IOException e) {
                    throw new JaninoRuntimeException();
                }
                if (line == null) break;
                this.pw.println(line);
                this.pw.print(" *");
            }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

            } else
            if (o instanceof Object[]) {
                this.inner = Arrays.asList((Object[]) o).iterator();
            } else
            {
                throw new JaninoRuntimeException("Unexpected element type \"" + o.getClass().getName() + "\"");
            }
        }
    }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

        // Open the class file resource.
        InputStream is;
        try {
            is = classFileResource.open();
        } catch (IOException ex) {
            throw new JaninoRuntimeException(
                "Opening class file resource \""
                + classFileResource.getFileName()
                + "\": "
                + ex.getMessage()
            );
        }

        // Read bytecode from the resource into a byte array.
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            byte[] buffer = new byte[4096];
            for (;;) {
                int bytesRead = is.read(buffer);
                if (bytesRead == -1) break;
                baos.write(buffer, 0, bytesRead);
            }
        } catch (IOException ex) {
            throw new ClassNotFoundException("Reading class file from \"" + classFileResource + "\"", ex);
        } finally {
            try { is.close(); } catch (IOException ex) { }
        }
        byte[] ba = baos.toByteArray();

        // Disassemble the the class bytecode(for debugging).
        if (ResourceFinderClassLoader.DEBUG) {
            System.out.println("*** Disassembly of class \"" + className + "\":");
            try {
                new Disassembler().disasm(new ByteArrayInputStream(ba));
                System.out.flush();
            } catch (IOException ex) {
                throw new JaninoRuntimeException("SNO: IOException despite ByteArrayInputStream");
            }
        }

        // Define the class in this ClassLoader.
        Class clazz = super.defineClass(null, ba, 0, ba.length);
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

        } else
        if (Descriptor.isArrayReference(typeFD)) {
            s = typeFD;
        } else
        {
            throw new JaninoRuntimeException("\"" + Descriptor.toString(typeFD) + "\" is neither a class nor an array");
        }

        return this.addToConstantPool(new ConstantClassInfo(this.addConstantUtf8Info(s)));
    }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

        } else
        if (cv instanceof Double) {
            return this.addConstantDoubleInfo(((Double) cv).doubleValue());
        } else
        {
            throw new JaninoRuntimeException("Unexpected constant value type \"" + cv.getClass().getName() + "\"");
        }
    }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

        Short index = (Short) this.constantPoolMap.get(cpi);
        if (index != null) return index.shortValue();

        int res = this.constantPool.size();
        if (res > 0xFFFF) {
            throw new JaninoRuntimeException("Constant pool has grown past JVM limit of 0xFFFF");
        }
        this.constantPool.add(cpi);
        if (cpi.isWide()) this.constantPool.add(null);

        this.constantPoolMap.put(cpi, new Short((short) res));
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            this.store(baos);
        } catch (IOException ex) {
            // ByteArrayOutputStream should never throw IOExceptions.
            throw new JaninoRuntimeException(ex.toString());
        }
        return baos.toByteArray();
    }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

    }
    public static class ConstantUtf8Info extends ConstantPoolInfo {
        private final String s;

        public ConstantUtf8Info(String s) {
            if (s == null) throw new JaninoRuntimeException();
            this.s = s;
        }
View Full Code Here

Examples of org.codehaus.janino.JaninoRuntimeException

                };
            }
        case 1:
            return new ConstantUtf8Info(dis.readUTF());
        default:
            throw new JaninoRuntimeException("Invalid cp_info tag \"" + (int) tag + "\"");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.