Package serp.bytecode

Examples of serp.bytecode.Code.checkcast()


                            "findGetter", Method.class, new Class[] {
                            Class.class, String.class, boolean.class });
                        code.invokestatic().setMethod
                            (getReflectionGetterMethod(type, Method.class));
                        if (!type.isPrimitive() && type != Object.class)
                            code.checkcast().setType(type);
                    }
                }
            }

            if (fieldManager)
View Full Code Here


        code.dup();
        if (_meta.isOpenJPAIdentity() || (obj && usesClsString == Boolean.TRUE))
            code.classconstant().setClass(getType(_meta));
        if (obj) {
            code.aload().setParam(0);
            code.checkcast().setType(String.class);
            if (usesClsString == Boolean.TRUE)
                args = new Class[]{ Class.class, String.class };
            else if (usesClsString == Boolean.FALSE)
                args = new Class[]{ String.class };
        } else if (_meta.isOpenJPAIdentity()) {
View Full Code Here

            // pcReplaceStateManager ((StateManager) in.readObject ());
            loadManagedInstance(code, false);
            code.aload().setParam(0);
            code.invokeinterface().setMethod(ObjectInput.class, "readObject",
                Object.class, null);
            code.checkcast().setType(StateManager.class);
            code.invokevirtual().setMethod(PRE + "ReplaceStateManager",
                void.class, new Class[]{ StateManager.class });
        }

        // read managed fields
View Full Code Here

        // clone will be on stack
        code.beforeFirst();
        if (code.searchForward(template)) {
            // ((<type>) clone).pcStateManager = null;
            code.dup();
            code.checkcast().setType(_pc);
            code.constant().setNull();
            code.putfield().setField(SM, SMTYPE);

            // if modified, increase stack
            code.calculateMaxStack();
View Full Code Here

        code.anew().setType(type);
        code.dup();
        if (params.length == 1) {
            code.aload().setParam(0);
            code.checkcast().setType(params[0]);
        }
        code.invokespecial().setMethod(type, "<init>", void.class, params);
        if (params.length == 0) {
            code.dup();
            code.aload().setParam(0);
View Full Code Here

        }
        code.invokespecial().setMethod(type, "<init>", void.class, params);
        if (params.length == 0) {
            code.dup();
            code.aload().setParam(0);
            code.checkcast().setType(Calendar.class);
            code.invokevirtual().setMethod(Calendar.class, "getTimeInMillis",
                long.class, null);
            code.invokevirtual().setMethod(type, "setTimeInMillis", void.class,
                new Class[] { long.class });
View Full Code Here

            code.invokevirtual().setMethod(type, "setTimeInMillis", void.class,
                new Class[] { long.class });

            code.dup();
            code.aload().setParam(0);
            code.checkcast().setType(Calendar.class);
            code.invokevirtual().setMethod(Calendar.class, "isLenient",
                boolean.class, null);
            code.invokevirtual().setMethod(type, "setLenient", void.class,
                new Class[] { boolean.class });
View Full Code Here

            code.invokevirtual().setMethod(type, "setLenient", void.class,
                new Class[] { boolean.class });

            code.dup();
            code.aload().setParam(0);
            code.checkcast().setType(Calendar.class);
            code.invokevirtual().setMethod(Calendar.class, "getFirstDayOfWeek",
                int.class, null);
            code.invokevirtual().setMethod(type, "setFirstDayOfWeek",
                void.class, new Class[] { int.class });
View Full Code Here

            code.invokevirtual().setMethod(type, "setFirstDayOfWeek",
                void.class, new Class[] { int.class });

            code.dup();
            code.aload().setParam(0);
            code.checkcast().setType(Calendar.class);
            code.invokevirtual().setMethod(Calendar.class,
                "getMinimalDaysInFirstWeek", int.class, null);
            code.invokevirtual().setMethod(type, "setMinimalDaysInFirstWeek",
                void.class, new Class[] { int.class });
View Full Code Here

            code.invokevirtual().setMethod(type, "setMinimalDaysInFirstWeek",
                void.class, new Class[] { int.class });

            code.dup();
            code.aload().setParam(0);
            code.checkcast().setType(Calendar.class);
            code.invokevirtual().setMethod(Calendar.class, "getTimeZone",
                TimeZone.class, null);
            code.invokevirtual().setMethod(type, "setTimeZone", void.class,
                new Class[] { TimeZone.class });
        }
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.