Wednesday, April 8, 2015

VerificationException

com.sun.org.apache.bcel.internal.verifier.exc.VerificationException

VerificationException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when a class file to verify does not pass one of the verification passes 2 or 3. Note that the pass 3 used by 'JustIce' involves verification that is usually delayed to pass 4. The name of this class is justified by the Java Virtual Machine Specification, 2nd edition, page 164, 5.4.1 where verification as a part of the linking process is defined to be the verification happening in passes 2 and 3.
version: $Id: VerificationException.java,v 1.1.1.1 2001/10/29 20:00:34 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

  • VerificationException is not thrown within any available source code.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

  • VerificationException is not thrown within the available source code.

StructuralCodeConstraintException

com.sun.org.apache.bcel.internal.verifier.exc.StructuralCodeConstraintException

StructuralCodeConstraintException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when a class file to verify does not pass the verification pass 3 because of a violation of a structural constraint as described in the Java Virtual Machine Specification, 2nd edition, 4.8.2, pages 137-139. Note that the notion of a 'structural' constraint is somewhat misleading. Structural constraints are constraints on relationships between Java virtual machine instructions. These are the constraints where data-flow analysis is needed to verify if they hold. The data flow analysis of pass 3 is called pass 3b in JustIce.
version: $Id: StructuralCodeConstraintException.java,v 1.1.1.1 2001/10/29 20:00:34 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.structurals.LocalVariables.merge(LocalVariables, int)

/**
  * Merges a single local variable.
  *
  * @see #merge(LocalVariables)
  */
private void merge(LocalVariables lv, int i) {
    if ((!(locals[i] instanceof UninitializedObjectType)) && (lv.locals[i] instanceof UninitializedObjectType)) {
        throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object in the local variables detected.');
    }
    if ((!(locals[i].equals(lv.locals[i]))) && (locals[i] instanceof UninitializedObjectType) && (lv.locals[i] instanceof UninitializedObjectType)) {
        throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object in the local variables detected.');
    }
    if (locals[i] instanceof UninitializedObjectType) {
        if (!(lv.locals[i] instanceof UninitializedObjectType)) {
            locals[i] = ((UninitializedObjectType) locals[i]).getInitialized();
        }
    }
    if ((locals[i] instanceof ReferenceType) && (lv.locals[i] instanceof ReferenceType)) {
        if (!locals[i].equals(lv.locals[i])) {
            Type sup = ((ReferenceType) locals[i]).firstCommonSuperclass((ReferenceType) (lv.locals[i]));
            if (sup != null) {
                locals[i] = sup;
            } else {
                throw new AssertionViolatedException('Could not load all the super classes of '' + locals[i] + '' and '' + lv.locals[i] + ''.');
            }
        }
    } else {
        if (!(locals[i].equals(lv.locals[i]))) {
            locals[i] = Type.UNKNOWN;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.OperandStack.merge(OperandStack)

/**
  * Merges another stack state into this instance's stack state.
  * See the Java Virtual Machine Specification, Second Edition, page 146: 4.9.2
  * for details.
  */
public void merge(OperandStack s) {
    if ((slotsUsed() != s.slotsUsed()) || (size() != s.size())) throw new StructuralCodeConstraintException('Cannot merge stacks of different size:\nOperandStack A:\n' + this + '\nOperandStack B:\n' + s);
    for (int i = 0; i < size(); i++) {
        if ((!(stack.get(i) instanceof UninitializedObjectType)) && (s.stack.get(i) instanceof UninitializedObjectType)) {
            throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object on the stack detected.');
        }
        if ((!(stack.get(i).equals(s.stack.get(i)))) && (stack.get(i) instanceof UninitializedObjectType) && (!(s.stack.get(i) instanceof UninitializedObjectType))) {
            throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object on the stack detected.');
        }
        if (stack.get(i) instanceof UninitializedObjectType) {
            if (!(s.stack.get(i) instanceof UninitializedObjectType)) {
                stack.set(i, ((UninitializedObjectType) (stack.get(i))).getInitialized());
            }
        }
        if (!stack.get(i).equals(s.stack.get(i))) {
            if ((stack.get(i) instanceof ReferenceType) && (s.stack.get(i) instanceof ReferenceType)) {
                stack.set(i, ((ReferenceType) stack.get(i)).firstCommonSuperclass((ReferenceType) (s.stack.get(i))));
            } else {
                throw new StructuralCodeConstraintException('Cannot merge stacks of different types:\nStack A:\n' + this + '\nStack B:\n' + s);
            }
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.constraintViolated(Instruction, String)

/**
   * This method is called by the visitXXX() to notify the acceptor of this InstConstraintVisitor
   * that a constraint violation has occured. This is done by throwing an instance of a
   * StructuralCodeConstraintException.
   * @throws com.sun.org.apache.bcel.internal.verifier.exc.StructuralCodeConstraintException always.
   */
private void constraintViolated(Instruction violator, String description) {
    String fq_classname = violator.getClass().getName();
    throw new StructuralCodeConstraintException('Instruction ' + fq_classname.substring(fq_classname.lastIndexOf('.') + 1) + ' constraint violated: ' + description);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

StaticCodeInstructionOperandConstraintException

com.sun.org.apache.bcel.internal.verifier.exc.StaticCodeInstructionOperandConstraintException

StaticCodeInstructionOperandConstraintException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when a class file to verify does not pass the verification pass 3 because of a violation of a static constraint as described in the Java Virtual Machine Specification, Second edition, 4.8.1, pages 133-137. The static constraints checking part of pass 3 is called pass 3a in JustIce. Static constraints on the operands of instructions in the code array are checked late in pass 3a and are described on page 134-137 in the Java Virtual Machine Specification, Second Edition.
version: $Id: StaticCodeInstructionOperandConstraintException.java,v 1.1.1.1 2001/10/29 20:00:33 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.statics.Pass3aVerifier.pass3StaticInstructionOperandsChecks()

/**
  * These are the checks for the satisfaction of constraints which are described in the
  * Java Virtual Machine Specification, Second Edition as Static Constraints on
  * the operands of instructions of Java Virtual Machine Code (chapter 4.8.1).
  * BCEL parses the code array to create an InstructionList and therefore has to check
  * some of these constraints. Additional checks are also implemented here.
  *
  * @throws StaticCodeConstraintException if the verification fails.
  */
private void pass3StaticInstructionOperandsChecks() {
    ConstantPoolGen cpg = new ConstantPoolGen(Repository.lookupClass(myOwner.getClassName()).getConstantPool());
    InstOperandConstraintVisitor v = new InstOperandConstraintVisitor(cpg);
    InstructionHandle ih = instructionList.getStart();
    while (ih != null) {
        Instruction i = ih.getInstruction();
        if (i instanceof JsrInstruction) {
            InstructionHandle target = ((JsrInstruction) i).getTarget();
            if (target == instructionList.getStart()) {
                throw new StaticCodeInstructionOperandConstraintException('Due to JustIce's clear definition of subroutines, no JSR or JSR_W may have a top-level instruction (such as the very first instruction, which is targeted by instruction '' + ih + '' as its target.');
            }
            if (!(target.getInstruction() instanceof ASTORE)) {
                throw new StaticCodeInstructionOperandConstraintException('Due to JustIce's clear definition of subroutines, no JSR or JSR_W may target anything else than an ASTORE instruction. Instruction '' + ih + '' targets '' + target + ''.');
            }
        }
        ih.accept(v);
        ih = ih.getNext();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

StaticCodeInstructionConstraintException

com.sun.org.apache.bcel.internal.verifier.exc.StaticCodeInstructionConstraintException

StaticCodeInstructionConstraintException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when a class file to verify does not pass the verification pass 3 because of a violation of a static constraint as described in the Java Virtual Machine Specification, Second edition, 4.8.1, pages 133-137. The static constraints checking part of pass 3 is called pass 3a in JustIce. Static constraints on the instructions in the code array are checked early in pass 3a and are described on page 134 in the Java Virtual Machine Specification, Second Edition.
version: $Id: StaticCodeInstructionConstraintException.java,v 1.1.1.1 2001/10/29 20:00:33 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.statics.Pass3aVerifier.pass3StaticInstructionChecks()

/**
  * These are the checks if constraints are satisfied which are described in the
  * Java Virtual Machine Specification, Second Edition as Static Constraints on
  * the instructions of Java Virtual Machine Code (chapter 4.8.1).
  *
  * @throws StaticCodeConstraintException if the verification fails.
  */
private void pass3StaticInstructionChecks() {
    if (!(code.getCode().length < 65536)) {
        throw new StaticCodeInstructionConstraintException('Code array in code attribute '' + code + '' too big: must be smaller than 65536 bytes.');
    }
    InstructionHandle ih = instructionList.getStart();
    while (ih != null) {
        Instruction i = ih.getInstruction();
        if (i instanceof IMPDEP1) {
            throw new StaticCodeInstructionConstraintException('IMPDEP1 must not be in the code, it is an illegal instruction for _internal_ JVM use!');
        }
        if (i instanceof IMPDEP2) {
            throw new StaticCodeInstructionConstraintException('IMPDEP2 must not be in the code, it is an illegal instruction for _internal_ JVM use!');
        }
        if (i instanceof BREAKPOINT) {
            throw new StaticCodeInstructionConstraintException('BREAKPOINT must not be in the code, it is an illegal instruction for _internal_ JVM use!');
        }
        ih = ih.getNext();
    }
    Instruction last = instructionList.getEnd().getInstruction();
    if (!((last instanceof ReturnInstruction) || (last instanceof RET) || (last instanceof GotoInstruction) || (last instanceof ATHROW))) throw new StaticCodeInstructionConstraintException('Execution must not fall off the bottom of the code array. This constraint is enforced statically as some existing verifiers do - so it may be a false alarm if the last instruction is not reachable.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

StaticCodeConstraintException

com.sun.org.apache.bcel.internal.verifier.exc.StaticCodeConstraintException

StaticCodeConstraintException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when a class file to verify does not pass the verification pass 3 because of a violation of a static constraint as described in the Java Virtual Machine Specification, 2nd edition, 4.8.1, pages 133-137. The static constraints checking part of pass 3 is called pass 3a in JustIce.
version: $Id: StaticCodeConstraintException.java,v 1.1.1.1 2001/10/29 20:00:33 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

  • StaticCodeConstraintException is not thrown within any available source code.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

  • StaticCodeConstraintException is not thrown within the available source code.

Saturday, April 4, 2015

SnmpTooBigException

com.sun.jmx.snmp.SnmpTooBigException

SnmpTooBigException is described in the javadoc comments as:

Is used internally to signal that the size of a PDU exceeds the packet size limitation.

You will not usually need to use this class, except if you decide to implement your own {link: com.sun.jmx.snmp.SnmpPduFactory SnmPduFactory} object.

The varBindCount property contains the number of SnmpVarBind successfully encoded before the exception was thrown. Its value is 0 when this number is unknown.

This API is a Sun Microsystems internal API and is subject to change without notice.


version: 1.1 07/23/98 author: Sun Microsystems, Inc

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.jmx.snmp.SnmpMessage.encodeMessage(byte[])

/**
     * Encodes this message and puts the result in the specified byte array.
     * For internal use only.
     * @param outputBytes An array to receive the resulting encoding.
     * @exception ArrayIndexOutOfBoundsException If the result does not fit
     *                                           into the specified array.
     */
public int encodeMessage(byte[] outputBytes) throws SnmpTooBigException {
    int encodingLength = 0;
    if (data == null) throw new IllegalArgumentException('Data field is null');
    try {
        BerEncoder benc = new BerEncoder(outputBytes);
        benc.openSequence();
        benc.putAny(data, dataLength);
        benc.putOctetString((community != null) ? community : new byte[0]);
        benc.putInteger(version);
        benc.closeSequence();
        encodingLength = benc.trim();
    } catch (ArrayIndexOutOfBoundsException x) {
        throw new SnmpTooBigException();
    }
    return encodingLength;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.SnmpMessage.encodeSnmpPdu(SnmpPdu, int)

/**
     * Initializes this message with the specified <CODE>pdu</CODE>.
     * <P>
     * This method initializes the data field with an array of 
     * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>. 
     * The resulting encoding is stored in the data field
     * and the length of the encoding is stored in <CODE>dataLength</CODE>.
     * If the encoding length exceeds <CODE>maxDataLength</CODE>, 
     * the method throws an exception.
     * @param pdu The PDU to be encoded.
     * @param maxDataLength The maximum length permitted for the data field.
     * @exception SnmpStatusException If the specified <CODE>pdu</CODE> is not valid.
     * @exception SnmpTooBigException If the resulting encoding does not fit
     * into <CODE>maxDataLength</CODE> bytes.
     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds <CODE>maxDataLength</CODE>.
     * @since 1.5
     */
public void encodeSnmpPdu(SnmpPdu pdu, int maxDataLength) throws SnmpStatusException, SnmpTooBigException {
    SnmpPduPacket pdupacket = (SnmpPduPacket) pdu;
    version = pdupacket.version;
    community = pdupacket.community;
    address = pdupacket.address;
    port = pdupacket.port;
    data = new byte[maxDataLength];
    try {
        BerEncoder benc = new BerEncoder(data);
        benc.openSequence();
        encodeVarBindList(benc, pdupacket.varBindList);
        switch(pdupacket.type) {
            case pduGetRequestPdu:
            case pduGetNextRequestPdu:
            case pduInformRequestPdu:
            case pduGetResponsePdu:
            case pduSetRequestPdu:
            case pduV2TrapPdu:
            case pduReportPdu:
                SnmpPduRequest reqPdu = (SnmpPduRequest) pdupacket;
                benc.putInteger(reqPdu.errorIndex);
                benc.putInteger(reqPdu.errorStatus);
                benc.putInteger(reqPdu.requestId);
                break;
            case pduGetBulkRequestPdu:
                SnmpPduBulk bulkPdu = (SnmpPduBulk) pdupacket;
                benc.putInteger(bulkPdu.maxRepetitions);
                benc.putInteger(bulkPdu.nonRepeaters);
                benc.putInteger(bulkPdu.requestId);
                break;
            case pduV1TrapPdu:
                SnmpPduTrap trapPdu = (SnmpPduTrap) pdupacket;
                benc.putInteger(trapPdu.timeStamp, SnmpValue.TimeticksTag);
                benc.putInteger(trapPdu.specificTrap);
                benc.putInteger(trapPdu.genericTrap);
                if (trapPdu.agentAddr != null) benc.putOctetString(trapPdu.agentAddr.byteValue(), SnmpValue.IpAddressTag); else benc.putOctetString(new byte[0], SnmpValue.IpAddressTag);
                benc.putOid(trapPdu.enterprise.longValue());
                break;
            default:
                throw new SnmpStatusException('Invalid pdu type ' + String.valueOf(pdupacket.type));
        }
        benc.closeSequence(pdupacket.type);
        dataLength = benc.trim();
    } catch (ArrayIndexOutOfBoundsException x) {
        throw new SnmpTooBigException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.SnmpV3Message.encodeSnmpPdu(SnmpPdu, int)

/**
     * Initializes this message with the specified <CODE>pdu</CODE>.
     * <P>
     * This method initializes the data field with an array of 
     * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>. 
     * The resulting encoding is stored in the data field
     * and the length of the encoding is stored in <CODE>dataLength</CODE>.
     * If the encoding length exceeds <CODE>maxDataLength</CODE>, 
     * the method throws an exception.
     * @param p The PDU to be encoded.
     * @param maxDataLength The maximum length permitted for the data field.
     * @exception SnmpStatusException If the specified <CODE>pdu</CODE> 
     *   is not valid.
     * @exception SnmpTooBigException If the resulting encoding does not fit
     * into <CODE>maxDataLength</CODE> bytes.
     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds 
     *    <CODE>maxDataLength</CODE>.
     */
public void encodeSnmpPdu(SnmpPdu p, int maxDataLength) throws SnmpStatusException, SnmpTooBigException {
    SnmpScopedPduPacket pdu = (SnmpScopedPduPacket) p;
    if (isTraceOn()) {
        trace('encodeSnmpPdu', 'Pdu to marshall: \n' + 'security parameters : ' + pdu.securityParameters + '\n' + 'type :' + pdu.type + '\n' + 'version :' + pdu.version + '\n' + 'requestId :' + pdu.requestId + '\n' + 'msgId :' + pdu.msgId + '\n' + 'msgMaxSize :' + pdu.msgMaxSize + '\n' + 'msgFlags :' + pdu.msgFlags + '\n' + 'msgSecurityModel :' + pdu.msgSecurityModel + '\n' + 'contextEngineId :' + pdu.contextEngineId + '\n' + 'contextName :' + pdu.contextName + '\n');
    }
    version = pdu.version;
    address = pdu.address;
    port = pdu.port;
    msgId = pdu.msgId;
    msgMaxSize = pdu.msgMaxSize;
    msgFlags = pdu.msgFlags;
    msgSecurityModel = pdu.msgSecurityModel;
    contextEngineId = pdu.contextEngineId;
    contextName = pdu.contextName;
    securityParameters = pdu.securityParameters;
    data = new byte[maxDataLength];
    try {
        BerEncoder benc = new BerEncoder(data);
        benc.openSequence();
        encodeVarBindList(benc, pdu.varBindList);
        switch(pdu.type) {
            case pduGetRequestPdu:
            case pduGetNextRequestPdu:
            case pduInformRequestPdu:
            case pduGetResponsePdu:
            case pduSetRequestPdu:
            case pduV2TrapPdu:
            case pduReportPdu:
                SnmpPduRequestType reqPdu = (SnmpPduRequestType) pdu;
                benc.putInteger(reqPdu.getErrorIndex());
                benc.putInteger(reqPdu.getErrorStatus());
                benc.putInteger(pdu.requestId);
                break;
            case pduGetBulkRequestPdu:
                SnmpPduBulkType bulkPdu = (SnmpPduBulkType) pdu;
                benc.putInteger(bulkPdu.getMaxRepetitions());
                benc.putInteger(bulkPdu.getNonRepeaters());
                benc.putInteger(pdu.requestId);
                break;
            default:
                throw new SnmpStatusException('Invalid pdu type ' + String.valueOf(pdu.type));
        }
        benc.closeSequence(pdu.type);
        dataLength = benc.trim();
    } catch (ArrayIndexOutOfBoundsException x) {
        throw new SnmpTooBigException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.SnmpMsg.encodeVarBindList(BerEncoder, SnmpVarBind[])

/**
     * For SNMP Runtime private use only.
     */
public void encodeVarBindList(BerEncoder benc, SnmpVarBind[] varBindList) throws SnmpStatusException, SnmpTooBigException {
    int encodedVarBindCount = 0;
    try {
        benc.openSequence();
        if (varBindList != null) {
            for (int i = varBindList.length - 1; i >= 0; i--) {
                SnmpVarBind bind = varBindList[i];
                if (bind != null) {
                    benc.openSequence();
                    encodeVarBindValue(benc, bind.value);
                    benc.putOid(bind.oid.longValue());
                    benc.closeSequence();
                    encodedVarBindCount++;
                }
            }
        }
        benc.closeSequence();
    } catch (ArrayIndexOutOfBoundsException x) {
        throw new SnmpTooBigException(encodedVarBindCount);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.daemon.SnmpRequestHandler.reduceResponsePdu(SnmpPduPacket, SnmpPduPacket, int)

private SnmpPduPacket reduceResponsePdu(SnmpPduPacket req, SnmpPduPacket resp, int acceptedVbCount) throws SnmpTooBigException {
    if (req.type != req.pduGetBulkRequestPdu) {
        if (isDebugOn()) {
            debug('reduceResponsePdu', 'cannot remove anything');
        }
        throw new SnmpTooBigException(acceptedVbCount);
    }
    int vbCount = resp.varBindList.length;
    if (acceptedVbCount >= 3) vbCount = Math.min(acceptedVbCount - 1, resp.varBindList.length); else if (acceptedVbCount == 1) vbCount = 1; else vbCount = resp.varBindList.length / 2;
    if (vbCount < 1) {
        if (isDebugOn()) {
            debug('reduceResponsePdu', 'cannot remove anything');
        }
        throw new SnmpTooBigException(acceptedVbCount);
    } else {
        SnmpVarBind[] newVbList = new SnmpVarBind[vbCount];
        for (int i = 0; i < vbCount; i++) {
            newVbList[i] = resp.varBindList[i];
        }
        if (isDebugOn()) {
            debug('reduceResponsePdu', (resp.varBindList.length - newVbList.length) + ' items have been removed');
        }
        resp.varBindList = newVbList;
    }
    return resp;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

SnmpBadSecurityLevelException

com.sun.jmx.snmp.SnmpBadSecurityLevelException

SnmpBadSecurityLevelException is described in the javadoc comments as:

This exception is thrown when an incorrect security level is handled.

This API is a Sun Microsystems internal API and is subject to change without notice.


since: 1.5

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.jmx.snmp.internal.SnmpEngineImpl.checkSecurityLevel(byte)

/**
     * Checks the passed msg flags according to the rules specified in RFC 2572.
     * @param msgFlags The msg flags.
     */
public static void checkSecurityLevel(byte msgFlags) throws SnmpBadSecurityLevelException {
    int secLevel = msgFlags & SnmpDefinitions.authPriv;
    if ((secLevel & SnmpDefinitions.privMask) != 0) if ((secLevel & SnmpDefinitions.authMask) == 0) {
        throw new SnmpBadSecurityLevelException('Security level:' + ' noAuthPriv!!!');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Friday, April 3, 2015

SnmpSecurityException

com.sun.jmx.snmp.SnmpSecurityException

SnmpSecurityException is described in the javadoc comments as:

This exception is thrown when an error occurs in an SnmpSecurityModel .

This API is a Sun Microsystems internal API and is subject to change without notice.


since: 1.5

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

  • SnmpSecurityException is not thrown within any available source code.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

  • SnmpSecurityException is not thrown within the available source code.

Thursday, April 2, 2015

LocalVariableInfoInconsistentException

com.sun.org.apache.bcel.internal.verifier.exc.LocalVariableInfoInconsistentException

LocalVariableInfoInconsistentException is described in the javadoc comments as:

A LocalVariableInfoInconsistentException instance is thrown by the LocalVariableInfo class when it detects that the information it holds is inconsistent; this is normally due to inconsistent LocalVariableTable entries in the Code attribute of a certain Method object.
version: $Id: LocalVariableInfoInconsistentException.java,v 1.1.1.1 2001/10/29 20:00:33 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.statics.LocalVariableInfo.add(int, String, Type)

/**
  * Adds information about name and type for a given offset.
  * @throws LocalVariableInfoInconsistentException if the new information conflicts
  *         with already gathered information.
  */
private void add(int offset, String name, Type t) throws LocalVariableInfoInconsistentException {
    if (getName(offset) != null) {
        if (!getName(offset).equals(name)) {
            throw new LocalVariableInfoInconsistentException('At bytecode offset '' + offset + '' a local variable has two different names: '' + getName(offset) + '' and '' + name + ''.');
        }
    }
    if (getType(offset) != null) {
        if (!getType(offset).equals(t)) {
            throw new LocalVariableInfoInconsistentException('At bytecode offset '' + offset + '' a local variable has two different types: '' + getType(offset) + '' and '' + t + ''.');
        }
    }
    setName(offset, name);
    setType(offset, t);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

InvalidMethodException

com.sun.org.apache.bcel.internal.verifier.exc.InvalidMethodException

InvalidMethodException is described in the javadoc comments as:

Instances of this class are thrown by BCEL's class file verifier 'JustIce' when the verification of a method is requested that does not exist.
version: $Id: InvalidMethodException.java,v 1.1.1.1 2001/10/29 20:00:33 jvanzyl Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.statics.Pass3aVerifier.do_verify()

/**
  * Pass 3a is the verification of static constraints of
  * JVM code (such as legal targets of branch instructions).
  * This is the part of pass 3 where you do not need data
  * flow analysis.
  * JustIce also delays the checks for a correct exception
  * table of a Code attribute and correct line number entries
  * in a LineNumberTable attribute of a Code attribute (which
  * conceptually belong to pass 2) to this pass. Also, most
  * of the check for valid local variable entries in a
  * LocalVariableTable attribute of a Code attribute is
  * delayed until this pass.
  * All these checks need access to the code array of the
  * Code attribute.
  *
  * @throws InvalidMethodException if the method to verify does not exist.
  */
public VerificationResult do_verify() {
    if (myOwner.doPass2().equals(VerificationResult.VR_OK)) {
        JavaClass jc = Repository.lookupClass(myOwner.getClassName());
        Method[] methods = jc.getMethods();
        if (method_no >= methods.length) {
            throw new InvalidMethodException('METHOD DOES NOT EXIST!');
        }
        Method method = methods[method_no];
        code = method.getCode();
        if (method.isAbstract() || method.isNative()) {
            return VerificationResult.VR_OK;
        }
        try {
            instructionList = new InstructionList(method.getCode().getCode());
        } catch (RuntimeException re) {
            return new VerificationResult(VerificationResult.VERIFIED_REJECTED, 'Bad bytecode in the code array of the Code attribute of method '' + method + ''.');
        }
        instructionList.setPositions(true);
        VerificationResult vr = VerificationResult.VR_OK;
        try {
            delayedPass2Checks();
        } catch (ClassConstraintException cce) {
            vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, cce.getMessage());
            return vr;
        }
        try {
            pass3StaticInstructionChecks();
            pass3StaticInstructionOperandsChecks();
        } catch (StaticCodeConstraintException scce) {
            vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, scce.getMessage());
        }
        return vr;
    } else {
        return VerificationResult.VR_NOTYET;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

AssertionViolatedException

com.sun.org.apache.bcel.internal.verifier.exc.AssertionViolatedException

AssertionViolatedException is described in the javadoc comments as:

Instances of this class should never be thrown. When such an instance is thrown, this is due to an INTERNAL ERROR of BCEL's class file verifier "JustIce".
version: $Id: AssertionViolatedException.java,v 1.2 2003/10/07 07:38:12 rameshm Exp $ author: Enver Haase

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.org.apache.bcel.internal.verifier.structurals.OperandStack.push(Type)

/**
  * Pushes a Type object onto the stack.
  */
public void push(Type type) {
    if (type == null) throw new AssertionViolatedException('Cannot push NULL onto OperandStack.');
    if (type == Type.BOOLEAN || type == Type.CHAR || type == Type.BYTE || type == Type.SHORT) {
        throw new AssertionViolatedException('The OperandStack does not know about '' + type + ''; use Type.INT instead.');
    }
    if (slotsUsed() >= maxStack) {
        throw new AssertionViolatedException('OperandStack too small, should have thrown proper Exception elsewhere. Stack: ' + this);
    }
    stack.add(type);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.LocalVariables.merge(LocalVariables, int)

/**
  * Merges a single local variable.
  *
  * @see #merge(LocalVariables)
  */
private void merge(LocalVariables lv, int i) {
    if ((!(locals[i] instanceof UninitializedObjectType)) && (lv.locals[i] instanceof UninitializedObjectType)) {
        throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object in the local variables detected.');
    }
    if ((!(locals[i].equals(lv.locals[i]))) && (locals[i] instanceof UninitializedObjectType) && (lv.locals[i] instanceof UninitializedObjectType)) {
        throw new StructuralCodeConstraintException('Backwards branch with an uninitialized object in the local variables detected.');
    }
    if (locals[i] instanceof UninitializedObjectType) {
        if (!(lv.locals[i] instanceof UninitializedObjectType)) {
            locals[i] = ((UninitializedObjectType) locals[i]).getInitialized();
        }
    }
    if ((locals[i] instanceof ReferenceType) && (lv.locals[i] instanceof ReferenceType)) {
        if (!locals[i].equals(lv.locals[i])) {
            Type sup = ((ReferenceType) locals[i]).firstCommonSuperclass((ReferenceType) (lv.locals[i]));
            if (sup != null) {
                locals[i] = sup;
            } else {
                throw new AssertionViolatedException('Could not load all the super classes of '' + locals[i] + '' and '' + lv.locals[i] + ''.');
            }
        }
    } else {
        if (!(locals[i].equals(lv.locals[i]))) {
            locals[i] = Type.UNKNOWN;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitGETFIELD(GETFIELD)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitGETFIELD(GETFIELD o) {
    Type objectref = stack().peek();
    if (!((objectref instanceof ObjectType) || (objectref == Type.NULL))) {
        constraintViolated(o, 'Stack top should be an object reference that's not an array reference, but is '' + objectref + ''.');
    }
    String field_name = o.getFieldName(cpg);
    JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
    Field[] fields = jc.getFields();
    Field f = null;
    for (int i = 0; i < fields.length; i++) {
        if (fields[i].getName().equals(field_name)) {
            f = fields[i];
            break;
        }
    }
    if (f == null) {
        throw new AssertionViolatedException('Field not found?!?');
    }
    if (f.isProtected()) {
        ObjectType classtype = o.getClassType(cpg);
        ObjectType curr = new ObjectType(mg.getClassName());
        if (classtype.equals(curr) || curr.subclassOf(classtype)) {
            Type t = stack().peek();
            if (t == Type.NULL) {
                return;
            }
            if (!(t instanceof ObjectType)) {
                constraintViolated(o, 'The 'objectref' must refer to an object that's not an array. Found instead: '' + t + ''.');
            }
            ObjectType objreftype = (ObjectType) t;
            if (!(objreftype.equals(curr) || objreftype.subclassOf(curr))) {
            }
        }
    }
    if (f.isStatic()) {
        constraintViolated(o, 'Referenced field '' + f + '' is static which it shouldn't be.');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitPUTFIELD(PUTFIELD)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitPUTFIELD(PUTFIELD o) {
    Type objectref = stack().peek(1);
    if (!((objectref instanceof ObjectType) || (objectref == Type.NULL))) {
        constraintViolated(o, 'Stack next-to-top should be an object reference that's not an array reference, but is '' + objectref + ''.');
    }
    String field_name = o.getFieldName(cpg);
    JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
    Field[] fields = jc.getFields();
    Field f = null;
    for (int i = 0; i < fields.length; i++) {
        if (fields[i].getName().equals(field_name)) {
            f = fields[i];
            break;
        }
    }
    if (f == null) {
        throw new AssertionViolatedException('Field not found?!?');
    }
    Type value = stack().peek();
    Type t = Type.getType(f.getSignature());
    Type shouldbe = t;
    if (shouldbe == Type.BOOLEAN || shouldbe == Type.BYTE || shouldbe == Type.CHAR || shouldbe == Type.SHORT) {
        shouldbe = Type.INT;
    }
    if (t instanceof ReferenceType) {
        ReferenceType rvalue = null;
        if (value instanceof ReferenceType) {
            rvalue = (ReferenceType) value;
            referenceTypeIsInitialized(o, rvalue);
        } else {
            constraintViolated(o, 'The stack top type '' + value + '' is not of a reference type as expected.');
        }
    } else {
        if (shouldbe != value) {
            constraintViolated(o, 'The stack top type '' + value + '' is not of type '' + shouldbe + '' as expected.');
        }
    }
    if (f.isProtected()) {
        ObjectType classtype = o.getClassType(cpg);
        ObjectType curr = new ObjectType(mg.getClassName());
        if (classtype.equals(curr) || curr.subclassOf(classtype)) {
            Type tp = stack().peek(1);
            if (tp == Type.NULL) {
                return;
            }
            if (!(tp instanceof ObjectType)) {
                constraintViolated(o, 'The 'objectref' must refer to an object that's not an array. Found instead: '' + tp + ''.');
            }
            ObjectType objreftype = (ObjectType) tp;
            if (!(objreftype.equals(curr) || objreftype.subclassOf(curr))) {
                constraintViolated(o, 'The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '' + stack().peek() + '' is not the current class or a subclass of the current class.');
            }
        }
    }
    if (f.isStatic()) {
        constraintViolated(o, 'Referenced field '' + f + '' is static which it shouldn't be.');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitPUTSTATIC(PUTSTATIC)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitPUTSTATIC(PUTSTATIC o) {
    String field_name = o.getFieldName(cpg);
    JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName());
    Field[] fields = jc.getFields();
    Field f = null;
    for (int i = 0; i < fields.length; i++) {
        if (fields[i].getName().equals(field_name)) {
            f = fields[i];
            break;
        }
    }
    if (f == null) {
        throw new AssertionViolatedException('Field not found?!?');
    }
    Type value = stack().peek();
    Type t = Type.getType(f.getSignature());
    Type shouldbe = t;
    if (shouldbe == Type.BOOLEAN || shouldbe == Type.BYTE || shouldbe == Type.CHAR || shouldbe == Type.SHORT) {
        shouldbe = Type.INT;
    }
    if (t instanceof ReferenceType) {
        ReferenceType rvalue = null;
        if (value instanceof ReferenceType) {
            rvalue = (ReferenceType) value;
            referenceTypeIsInitialized(o, rvalue);
        } else {
            constraintViolated(o, 'The stack top type '' + value + '' is not of a reference type as expected.');
        }
        if (!(rvalue.isAssignmentCompatibleWith(shouldbe))) {
            constraintViolated(o, 'The stack top type '' + value + '' is not assignment compatible with '' + shouldbe + ''.');
        }
    } else {
        if (shouldbe != value) {
            constraintViolated(o, 'The stack top type '' + value + '' is not of type '' + shouldbe + '' as expected.');
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitCPInstruction(CPInstruction)

/**
  * Ensures the general preconditions of a CPInstruction instance.
  */
public void visitCPInstruction(CPInstruction o) {
    int idx = o.getIndex();
    if ((idx < 0) || (idx >= cpg.getSize())) {
        throw new AssertionViolatedException('Huh?! Constant pool index of instruction '' + o + '' illegal? Pass 3a should have checked this!');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitBREAKPOINT(BREAKPOINT)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitBREAKPOINT(BREAKPOINT o) {
    throw new AssertionViolatedException('In this JustIce verification pass there should not occur an illegal instruction such as BREAKPOINT.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitIMPDEP1(IMPDEP1)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitIMPDEP1(IMPDEP1 o) {
    throw new AssertionViolatedException('In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP1.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitIMPDEP2(IMPDEP2)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitIMPDEP2(IMPDEP2 o) {
    throw new AssertionViolatedException('In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP2.');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.ControlFlowGraph.contextOf(InstructionHandle)

/**
  * Returns the InstructionContext of a given instruction.
  */
public InstructionContext contextOf(InstructionHandle inst) {
    InstructionContext ic = (InstructionContext) instructionContexts.get(inst);
    if (ic == null) {
        throw new AssertionViolatedException('InstructionContext requested for an InstructionHandle that's not known!');
    }
    return ic;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.LocalVariables.set(int, Type)

/**
  * Sets a new Type for the given local variable slot.
  */
public void set(int i, Type type) {
    if (type == Type.BYTE || type == Type.SHORT || type == Type.BOOLEAN || type == Type.CHAR) {
        throw new AssertionViolatedException('LocalVariables do not know about '' + type + ''. Use Type.INT instead.');
    }
    locals[i] = type;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.LocalVariables.merge(LocalVariables)

/**
  * Merges two local variables sets as described in the Java Virtual Machine Specification,
  * Second Edition, section 4.9.2, page 146.
  */
public void merge(LocalVariables lv) {
    if (this.locals.length != lv.locals.length) {
        throw new AssertionViolatedException('Merging LocalVariables of different size?!? From different methods or what?!?');
    }
    for (int i = 0; i < locals.length; i++) {
        merge(lv, i);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.statics.Pass2Verifier.getLocalVariablesInfo(int)

/**
  * Returns a LocalVariablesInfo object containing information
  * about the usage of the local variables in the Code attribute
  * of the said method or <B>null</B> if the class file this
  * Pass2Verifier operates on could not be pass-2-verified correctly.
  * The method number method_nr is the method you get using
  * <B>Repository.lookupClass(myOwner.getClassname()).getMethods()[method_nr];</B>.
  * You should not add own information. Leave that to JustIce.
  */
public LocalVariablesInfo getLocalVariablesInfo(int method_nr) {
    if (this.verify() != VerificationResult.VR_OK) return null;
    if (method_nr < 0 || method_nr >= localVariablesInfos.length) {
        throw new AssertionViolatedException('Method number out of range.');
    }
    return localVariablesInfos[method_nr];
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.Pass3bVerifier.circulationPump(ControlFlowGraph, InstructionContext, Frame, InstConstraintVisitor, ExecutionVisitor)

/**
  * Whenever the outgoing frame
  * situation of an InstructionContext changes, all its successors are
  * put [back] into the queue [as if they were unvisited].
   * The proof of termination is about the existence of a
   * fix point of frame merging.
  */
private void circulationPump(ControlFlowGraph cfg, InstructionContext start, Frame vanillaFrame, InstConstraintVisitor icv, ExecutionVisitor ev) {
    final Random random = new Random();
    InstructionContextQueue icq = new InstructionContextQueue();
    start.execute(vanillaFrame, new ArrayList(), icv, ev);
    icq.add(start, new ArrayList());
    while (!icq.isEmpty()) {
        InstructionContext u;
        ArrayList ec;
        if (!DEBUG) {
            int r = random.nextInt(icq.size());
            u = icq.getIC(r);
            ec = icq.getEC(r);
            icq.remove(r);
        } else {
            u = icq.getIC(0);
            ec = icq.getEC(0);
            icq.remove(0);
        }
        ArrayList oldchain = (ArrayList) (ec.clone());
        ArrayList newchain = (ArrayList) (ec.clone());
        newchain.add(u);
        if ((u.getInstruction().getInstruction()) instanceof RET) {
            RET ret = (RET) (u.getInstruction().getInstruction());
            ReturnaddressType t = (ReturnaddressType) u.getOutFrame(oldchain).getLocals().get(ret.getIndex());
            InstructionContext theSuccessor = cfg.contextOf(t.getTarget());
            InstructionContext lastJSR = null;
            int skip_jsr = 0;
            for (int ss = oldchain.size() - 1; ss >= 0; ss--) {
                if (skip_jsr < 0) {
                    throw new AssertionViolatedException('More RET than JSR in execution chain?!');
                }
                if (((InstructionContext) oldchain.get(ss)).getInstruction().getInstruction() instanceof JsrInstruction) {
                    if (skip_jsr == 0) {
                        lastJSR = (InstructionContext) oldchain.get(ss);
                        break;
                    } else {
                        skip_jsr--;
                    }
                }
                if (((InstructionContext) oldchain.get(ss)).getInstruction().getInstruction() instanceof RET) {
                    skip_jsr++;
                }
            }
            if (lastJSR == null) {
                throw new AssertionViolatedException('RET without a JSR before in ExecutionChain?! EC: '' + oldchain + ''.');
            }
            JsrInstruction jsr = (JsrInstruction) (lastJSR.getInstruction().getInstruction());
            if (theSuccessor != (cfg.contextOf(jsr.physicalSuccessor()))) {
                throw new AssertionViolatedException('RET '' + u.getInstruction() + '' info inconsistent: jump back to '' + theSuccessor + '' or '' + cfg.contextOf(jsr.physicalSuccessor()) + ''?');
            }
            if (theSuccessor.execute(u.getOutFrame(oldchain), newchain, icv, ev)) {
                icq.add(theSuccessor, (ArrayList) newchain.clone());
            }
        } else {
            InstructionContext[] succs = u.getSuccessors();
            for (int s = 0; s < succs.length; s++) {
                InstructionContext v = succs[s];
                if (v.execute(u.getOutFrame(oldchain), newchain, icv, ev)) {
                    icq.add(v, (ArrayList) newchain.clone());
                }
            }
        }
        ExceptionHandler[] exc_hds = u.getExceptionHandlers();
        for (int s = 0; s < exc_hds.length; s++) {
            InstructionContext v = cfg.contextOf(exc_hds[s].getHandlerStart());
            if (v.execute(new Frame(u.getOutFrame(oldchain).getLocals(), new OperandStack(u.getOutFrame(oldchain).getStack().maxStack(), (exc_hds[s].getExceptionType() == null ? Type.THROWABLE : exc_hds[s].getExceptionType()))), new ArrayList(), icv, ev)) {
                icq.add(v, new ArrayList());
            }
        }
    }
    InstructionHandle ih = start.getInstruction();
    do {
        if ((ih.getInstruction() instanceof ReturnInstruction) && (!(cfg.isDead(ih)))) {
            InstructionContext ic = cfg.contextOf(ih);
            Frame f = ic.getOutFrame(new ArrayList());
            LocalVariables lvs = f.getLocals();
            for (int i = 0; i < lvs.maxLocals(); i++) {
                if (lvs.get(i) instanceof UninitializedObjectType) {
                    this.addMessage('Warning: ReturnInstruction '' + ic + '' may leave method with an uninitialized object in the local variables array '' + lvs + ''.');
                }
            }
            OperandStack os = f.getStack();
            for (int i = 0; i < os.size(); i++) {
                if (os.peek(i) instanceof UninitializedObjectType) {
                    this.addMessage('Warning: ReturnInstruction '' + ic + '' may leave method with an uninitialized object on the operand stack '' + os + ''.');
                }
            }
        }
    } while ((ih = ih.getNext()) != null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitNEW(NEW)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitNEW(NEW o) {
    Type t = o.getType(cpg);
    if (!(t instanceof ReferenceType)) {
        throw new AssertionViolatedException('NEW.getType() returning a non-reference type?!');
    }
    if (!(t instanceof ObjectType)) {
        constraintViolated(o, 'Expecting a class type (ObjectType) to work on. Found: '' + t + ''.');
    }
    ObjectType obj = (ObjectType) t;
    if (!obj.referencesClass()) {
        constraintViolated(o, 'Expecting a class type (ObjectType) to work on. Found: '' + obj + ''.');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.InstConstraintVisitor.visitRET(RET)

/**
  * Ensures the specific preconditions of the said instruction.
  */
public void visitRET(RET o) {
    if (!(locals().get(o.getIndex()) instanceof ReturnaddressType)) {
        constraintViolated(o, 'Expecting a ReturnaddressType in local variable ' + o.getIndex() + '.');
    }
    if (locals().get(o.getIndex()) == ReturnaddressType.NO_TARGET) {
        throw new AssertionViolatedException('Oops: RET expecting a target!');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.statics.LocalVariablesInfo.add(int, String, int, int, Type)

/**
  * Adds information about the local variable in slot 'slot'. Automatically 
  * adds information for slot+1 if 't' is Type.LONG or Type.DOUBLE.
  * @throws LocalVariableInfoInconsistentException if the new information conflicts
  *         with already gathered information.
  */
public void add(int slot, String name, int startpc, int length, Type t) throws LocalVariableInfoInconsistentException {
    if (slot < 0 || slot >= localVariableInfos.length) {
        throw new AssertionViolatedException('Slot number for local variable information out of range.');
    }
    localVariableInfos[slot].add(name, startpc, length, t);
    if (t == Type.LONG) localVariableInfos[slot + 1].add(name, startpc, length, LONG_Upper.theInstance());
    if (t == Type.DOUBLE) localVariableInfos[slot + 1].add(name, startpc, length, DOUBLE_Upper.theInstance());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.statics.LocalVariablesInfo.getLocalVariableInfo(int)

/** Returns the LocalVariableInfo for the given slot. */
public LocalVariableInfo getLocalVariableInfo(int slot) {
    if (slot < 0 || slot >= localVariableInfos.length) {
        throw new AssertionViolatedException('Slot number for local variable information out of range.');
    }
    return localVariableInfos[slot];
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.Pass3bVerifier.do_verify()

/**
  * Pass 3b implements the data flow analysis as described in the Java Virtual
  * Machine Specification, Second Edition.
   * Later versions will use LocalVariablesInfo objects to verify if the
   * verifier-inferred types and the class file's debug information (LocalVariables
   * attributes) match [TODO].
   *
   * @see com.sun.org.apache.bcel.internal.verifier.statics.LocalVariablesInfo
   * @see com.sun.org.apache.bcel.internal.verifier.statics.Pass2Verifier#getLocalVariablesInfo(int)
   */
public VerificationResult do_verify() {
    if (!myOwner.doPass3a(method_no).equals(VerificationResult.VR_OK)) {
        return VerificationResult.VR_NOTYET;
    }
    JavaClass jc = Repository.lookupClass(myOwner.getClassName());
    ConstantPoolGen constantPoolGen = new ConstantPoolGen(jc.getConstantPool());
    InstConstraintVisitor icv = new InstConstraintVisitor();
    icv.setConstantPoolGen(constantPoolGen);
    ExecutionVisitor ev = new ExecutionVisitor();
    ev.setConstantPoolGen(constantPoolGen);
    Method[] methods = jc.getMethods();
    try {
        MethodGen mg = new MethodGen(methods[method_no], myOwner.getClassName(), constantPoolGen);
        icv.setMethodGen(mg);
        if (!(mg.isAbstract() || mg.isNative())) {
            ControlFlowGraph cfg = new ControlFlowGraph(mg);
            Frame f = new Frame(mg.getMaxLocals(), mg.getMaxStack());
            if (!mg.isStatic()) {
                if (mg.getName().equals(Constants.CONSTRUCTOR_NAME)) {
                    f._this = new UninitializedObjectType(new ObjectType(jc.getClassName()));
                    f.getLocals().set(0, f._this);
                } else {
                    f._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++) {
                if (argtypes[j] == Type.SHORT || argtypes[j] == Type.BYTE || argtypes[j] == Type.CHAR || argtypes[j] == Type.BOOLEAN) {
                    argtypes[j] = Type.INT;
                }
                f.getLocals().set(twoslotoffset + j + (mg.isStatic() ? 0 : 1), argtypes[j]);
                if (argtypes[j].getSize() == 2) {
                    twoslotoffset++;
                    f.getLocals().set(twoslotoffset + j + (mg.isStatic() ? 0 : 1), Type.UNKNOWN);
                }
            }
            circulationPump(cfg, cfg.contextOf(mg.getInstructionList().getStart()), f, icv, ev);
        }
    } catch (VerifierConstraintViolatedException ce) {
        ce.extendMessage('Constraint violated in method '' + methods[method_no] + '':\n', '');
        return new VerificationResult(VerificationResult.VERIFIED_REJECTED, ce.getMessage());
    } catch (RuntimeException re) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        re.printStackTrace(pw);
        throw new AssertionViolatedException('Some RuntimeException occured while verify()ing class '' + jc.getClassName() + '', method '' + methods[method_no] + ''. Original RuntimeException's stack trace:\n---\n' + sw + '---\n');
    }
    return VerificationResult.VR_OK;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.bcel.internal.verifier.structurals.Subroutines.getSubroutine(InstructionHandle)

/**
  * Returns the Subroutine object associated with the given
  * leader (that is, the first instruction of the subroutine).
  * You must not use this to get the top-level instructions
  * modeled as a Subroutine object.
  *
  * @see #getTopLevel()
  */
public Subroutine getSubroutine(InstructionHandle leader) {
    Subroutine ret = (Subroutine) subroutines.get(leader);
    if (ret == null) {
        throw new AssertionViolatedException('Subroutine requested for an InstructionHandle that is not a leader of a subroutine.');
    }
    if (ret == TOPLEVEL) {
        throw new AssertionViolatedException('TOPLEVEL special subroutine requested; use getTopLevel().');
    }
    return ret;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Wednesday, April 1, 2015

SnmpUnknownAccContrModelException

com.sun.jmx.snmp.SnmpUnknownAccContrModelException

SnmpUnknownAccContrModelException is described in the javadoc comments as:

This exception is thrown when an SnmpAccessControlSubSystem doesn't know the passed ID.

This API is a Sun Microsystems internal API and is subject to change without notice.


since: 1.5

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

  • SnmpUnknownAccContrModelException is not thrown within any available source code.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

  • SnmpUnknownAccContrModelException is not thrown within the available source code.