Package com.googlecode.aviator.asm

Examples of com.googlecode.aviator.asm.Type


    }

    protected Value getElementValue(final Value objectArrayValue)
            throws AnalyzerException
    {
        Type arrayType = ((BasicValue) objectArrayValue).getType();
        if (arrayType != null) {
            if (arrayType.getSort() == Type.ARRAY) {
                return newValue(Type.getType(arrayType.getDescriptor()
                        .substring(1)));
            } else if (arrayType.getDescriptor().equals("Lnull;")) {
                return objectArrayValue;
            }
        }
        throw new Error("Internal error");
    }
View Full Code Here


        }
        throw new Error("Internal error");
    }

    protected boolean isSubTypeOf(final Value value, final Value expected) {
        Type expectedType = ((BasicValue) expected).getType();
        Type type = ((BasicValue) value).getType();
        switch (expectedType.getSort()) {
            case Type.INT:
            case Type.FLOAT:
            case Type.LONG:
            case Type.DOUBLE:
                return type == expectedType;
            case Type.ARRAY:
            case Type.OBJECT:
                if (type.getDescriptor().equals("Lnull;")) {
                    return true;
                } else if (type.getSort() == Type.OBJECT
                        || type.getSort() == Type.ARRAY)
                {
                    return isAssignableFrom(expectedType, type);
                } else {
                    return false;
                }
View Full Code Here

        }
    }

    public Value merge(final Value v, final Value w) {
        if (!v.equals(w)) {
            Type t = ((BasicValue) v).getType();
            Type u = ((BasicValue) w).getType();
            if (t != null
                    && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY))
            {
                if (u != null
                        && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY))
                {
                    if (t.getDescriptor().equals("Lnull;")) {
                        return w;
                    }
                    if (u.getDescriptor().equals("Lnull;")) {
                        return v;
                    }
                    if (isAssignableFrom(t, u)) {
                        return v;
                    }
View Full Code Here

            if (isAssignableFrom(t, currentSuperClass)) {
                return true;
            }
            if (currentClassInterfaces != null) {
                for (int i = 0; i < currentClassInterfaces.size(); ++i) {
                    Type v = (Type) currentClassInterfaces.get(i);
                    if (isAssignableFrom(t, v)) {
                        return true;
                    }
                }
            }
View Full Code Here

            if (opcode != INVOKESTATIC) {
                String own = ((MethodInsnNode) insn).owner;
                if (own.charAt(0) != '[') { // can happen with JDK1.5 clone()
                    own = "L" + own + ";";
                }
                Type owner = Type.getType(own);
                if (!isSubTypeOf((Value) values.get(i++), newValue(owner))) {
                    throw new AnalyzerException("Method owner",
                            newValue(owner),
                            (Value) values.get(0));
                }
View Full Code Here

TOP

Related Classes of com.googlecode.aviator.asm.Type

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.