Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ObjectType


            return result;
        }

        BasicBlock handlerBlock = edge.getTarget();
        CodeExceptionGen handler = handlerBlock.getExceptionGen();
        ObjectType catchType = handler.getCatchType();

        if (Hierarchy.isUniversalExceptionHandler(catchType)) {
            result.addAll(thrownExceptionSet);
            thrownExceptionSet.clear();
        } else {
            // Go through the set of thrown exceptions.
            // Any that will DEFINITELY be caught be this handler, remove.
            // Any that MIGHT be caught, but won't definitely be caught,
            // remain.

            for (ExceptionSet.ThrownExceptionIterator i = thrownExceptionSet.iterator(); i.hasNext();) {
                // ThrownException thrownException = i.next();
                ObjectType thrownType = i.next();
                boolean explicit = i.isExplicit();

                if (DEBUG) {
                    System.out.println("\texception type " + thrownType + ", catch type " + catchType);
                }
View Full Code Here


        Type commonSupertype = exceptionSet.getCommonSupertype();
        if (commonSupertype.getType() != T_OBJECT) {
            return commonSupertype;
        }

        ObjectType exceptionSupertype = (ObjectType) commonSupertype;

        String className = exceptionSupertype.getClassName();
        if (className.equals("java.lang.Throwable")) {
            return exceptionSupertype;
        }
        return new ExceptionObjectType(className, exceptionSet);
    }
View Full Code Here

     */
    public boolean isSingleton(String exceptionName) {
        if (size != 1) {
            return false;
        }
        ObjectType e = iterator().next();
        return e.toString().equals(exceptionName);

    }
View Full Code Here

    /**
     * Return whether or not the set contains any checked exceptions.
     */
    public boolean containsCheckedExceptions() throws ClassNotFoundException {
        for (ThrownExceptionIterator i = iterator(); i.hasNext();) {
            ObjectType type = i.next();
            if (!Hierarchy.isUncheckedException(type)) {
                return true;
            }
        }
        return false;
View Full Code Here

    public String toString() {
        StringBuilder buf = new StringBuilder();
        buf.append('{');
        boolean first = true;
        for (ThrownExceptionIterator i = iterator(); i.hasNext();) {
            ObjectType type = i.next();
            if (first) {
                first = false;
            } else {
                buf.append(',');
            }
            boolean implicit = !i.isExplicit();
            if (implicit) {
                buf.append('[');
            }
            buf.append(type.toString());
            if (implicit) {
                buf.append(']');
            }
        }
        buf.append('}');
View Full Code Here

        @Override
        public ObjectType next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            ObjectType result = factory.getType(next);
            last = next;
            return result;
        }
View Full Code Here

                // Downgrade NULL and NSP to DNR if the handler is for
                // CloneNotSupportedException or InterruptedException
                if (true) {
                    CodeExceptionGen handler = destBlock.getExceptionGen();
                    ObjectType catchType = handler.getCatchType();
                    if (catchType != null) {
                        String catchClass = catchType.getClassName();
                        if (catchClass.equals("java.lang.CloneNotSupportedException")
                                || catchClass.equals("java.lang.InterruptedException")) {
                            for (int i = 0; i < tmpFact.getNumSlots(); ++i) {
                                IsNullValue value = tmpFact.getValue(i);
                                if (value.isDefinitelyNull() || value.isNullOnSomePath()) {
View Full Code Here

                        if (tosType instanceof ObjectType) {
                            ObligationFactory factory = database.getFactory();
                            Obligation obligation = factory.getObligationByType((ObjectType) tosType);
                            if (obligation != null) {
                                if (obligation.getClassName().equals("java.sql.ResultSet")) {
                                    ObjectType sType = ObjectTypeFactory.getInstance(java.sql.Statement.class);
                                    Obligation sObligation = factory.getObligationByType(sType);
                                    actionList = Arrays.asList(
                                            new ObligationPolicyDatabaseAction(ObligationPolicyDatabaseActionType.DEL, obligation),
                                            new ObligationPolicyDatabaseAction(ObligationPolicyDatabaseActionType.DEL, sObligation));
                                } else {
View Full Code Here

        // Build the initial frame situation for this method.
        Frame f = new Frame(mg.getMaxLocals(),mg.getMaxStack());
        if ( !mg.isStatic() ){
          if (mg.getName().equals(Constants.CONSTRUCTOR_NAME)){
            Frame._this = new UninitializedObjectType(new ObjectType(jc.getClassName()));
            f.getLocals().set(0, Frame._this);
          }
          else{
            Frame._this = null;
            f.getLocals().set(0, new ObjectType(jc.getClassName()));
          }
        }
        Type[] argtypes = mg.getArgumentTypes();
        int twoslotoffset = 0;
        for (int j=0; j<argtypes.length; j++){
View Full Code Here

        result.copyFrom(start);

        if (start.isValid()) {
            if (basicBlock.isExceptionHandler()) {
                CodeExceptionGen exceptionGen = basicBlock.getExceptionGen();
                ObjectType catchType = exceptionGen.getCatchType();
                if (catchType == null) {
                    // Probably a finally block, or a synchronized block
                    // exception-compensation catch block.
                    result.pushFinally();
                } else {
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.ObjectType

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.