Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.Type


    }

    @Override
    protected void mergeValues(TypeFrame otherFrame, TypeFrame resultFrame, int slot) throws DataflowAnalysisException {

        Type type2 = resultFrame.getValue(slot);
        Type type1 = otherFrame.getValue(slot);
        Type value = typeMerger.mergeTypes(type2, type1);
        resultFrame.setValue(slot, value);

        // Result type is exact IFF types are identical and both are exact

        boolean typesAreIdentical = type1.equals(type2);
View Full Code Here


                } else if (frame.getStackDepth() == 0) {
                    throw new IllegalStateException("empty stack " + " thrown by " + pei + " in "
                            + SignatureConverter.convertMethodSignature(methodGen));
                } else {

                    Type throwType = frame.getTopValue();
                    if (throwType instanceof ObjectType) {
                        exceptionTypeSet.addExplicit((ObjectType) throwType);
                    } else if (throwType instanceof ExceptionObjectType) {
                        exceptionTypeSet.addAll(((ExceptionObjectType) throwType).getExceptionSet());
                    } else {
View Full Code Here

        if (!typeFrame.isValid()) {
            return Collections.<XMethod> emptySet();
        }

        Type receiverType;
        boolean receiverTypeIsExact;

        if (opcode == Constants.INVOKESPECIAL) {
            // invokespecial instructions are dispatched to EXACTLY
            // the class specified by the instruction
View Full Code Here

     *            the exception set
     * @return a Type that is a supertype of all of the exceptions in the
     *         exception set
     */
    public static Type fromExceptionSet(ExceptionSet exceptionSet) throws ClassNotFoundException {
        Type commonSupertype = exceptionSet.getCommonSupertype();
        if (commonSupertype.getType() != T_OBJECT) {
            return commonSupertype;
        }

        ObjectType exceptionSupertype = (ObjectType) commonSupertype;

View Full Code Here

    public void purgeBoringEntries() {
        Collection<FieldDescriptor> keys = new ArrayList<FieldDescriptor>(getKeys());
        for (FieldDescriptor f : keys) {
            String s = f.getSignature();
            FieldStoreType type = getProperty(f);
            Type fieldType = Type.getType(f.getSignature());
            if (!(fieldType instanceof ReferenceType)) {
                removeProperty(f);
                continue;
            }
            ReferenceType storeType = type.getLoadType((ReferenceType) fieldType);
View Full Code Here

     *            the FieldInstruction
     * @param cpg
     *            the ConstantPoolGen for the method
     */
    protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) {
        Type type = fieldIns.getFieldType(cpg);
        int code = type.getType();
        return code == T_LONG || code == T_DOUBLE;
    }
View Full Code Here

    /**
     * Handle method invocations. Generally, we want to get rid of null
     * information following a call to a likely exception thrower or assertion.
     */
    private void handleInvoke(InvokeInstruction obj) {
        Type returnType = obj.getReturnType(getCPG());

        Location location = getLocation();

        if (trackValueNumbers) {
            try {
View Full Code Here

            TypeFrame frame = typeDataflow.getFactAtLocation(location);
            if (!frame.isValid()) {
                // This basic block is probably dead
                continue;
            }
            Type operandType = frame.getTopValue();

            if (operandType.equals(TopType.instance())) {
                // unreachable
                continue;
            }
            if (!(operandType instanceof ReferenceType)) {
                // Shouldn't happen - illegal bytecode
View Full Code Here

    public void mergeSummary(XField fieldOperand, OpcodeStack.Item mergeValue) {
        if (SystemProperties.ASSERTIONS_ENABLED) {
            String mSignature = mergeValue.getSignature();

            Type mergeType = Type.getType(mSignature);
            Type fieldType = Type.getType(fieldOperand.getSignature());
            IncompatibleTypes check = IncompatibleTypes.getPriorityForAssumingCompatible(mergeType, fieldType, false);
            if (check.getPriority() <= Priorities.NORMAL_PRIORITY) {
                AnalysisContext.logError(fieldOperand + " not compatible with " + mergeValue,
                        new IllegalArgumentException(check.toString()));
            }
View Full Code Here

            if (pair == null) {
                return;
            }

            Type receiver = pair.frame.getInstance(pair.location.getHandle().getInstruction(), getClassContext()
                    .getConstantPoolGen());

            if (!(receiver instanceof ReferenceType)) {
                return;
            }
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.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.