Java Code Examples for com.sun.tools.classfile.ConstantPool#CONSTANT_Integer_info

The following examples show how to use com.sun.tools.classfile.ConstantPool#CONSTANT_Integer_info . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnnotationDefaultVerifier.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void testElementValue(
        TestResult testCase,
        ClassFile classFile,
        Annotation.element_value element_value,
        String[] values) throws ConstantPool.InvalidIndex {
    Annotation.Primitive_element_value ev =
            (Annotation.Primitive_element_value) element_value;
    ConstantPool.CONSTANT_Integer_info info =
            (ConstantPool.CONSTANT_Integer_info)
                    classFile.constant_pool.get(ev.const_value_index);
    testCase.checkEquals(info.value, Integer.parseInt(values[0]), "const_value_index");
}
 
Example 2
Source File: TestAnnotationInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void testElementValue(TestResult testResult,
                             ClassFile classFile,
                             Annotation.element_value element_value)
        throws ConstantPoolException {
    testTag(testResult, element_value.tag);
    Annotation.Primitive_element_value ev =
            (Annotation.Primitive_element_value) element_value;
    ConstantPool.CONSTANT_Integer_info info =
            (ConstantPool.CONSTANT_Integer_info) classFile.constant_pool.get(ev.const_value_index);
    testResult.checkEquals(info.value, value, "const_value_index : " + value);
}
 
Example 3
Source File: TestAnnotationInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void testElementValue(TestResult testResult,
                             ClassFile classFile,
                             Annotation.element_value element_value)
        throws ConstantPoolException {
    testTag(testResult, element_value.tag);
    Annotation.Primitive_element_value ev =
            (Annotation.Primitive_element_value) element_value;
    ConstantPool.CONSTANT_Integer_info info =
            (ConstantPool.CONSTANT_Integer_info) classFile.constant_pool.get(ev.const_value_index);
    testResult.checkEquals(info.value, value ? 1 : 0, "const_value_index : " + value);
}
 
Example 4
Source File: TestAnnotationInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void testElementValue(TestResult testResult,
                             ClassFile classFile,
                             Annotation.element_value element_value)
        throws ConstantPoolException {
    testTag(testResult, element_value.tag);
    Annotation.Primitive_element_value ev =
            (Annotation.Primitive_element_value) element_value;
    ConstantPool.CONSTANT_Integer_info info =
            (ConstantPool.CONSTANT_Integer_info)
                    classFile.constant_pool.get(ev.const_value_index);
    testResult.checkEquals(info.value, (int) value, "const_value_index : " + value);
}
 
Example 5
Source File: CPSelector.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitInteger(ConstantPool.CONSTANT_Integer_info info, CPEntries p) {
    return null;
}