Java Code Examples for com.sun.tools.classfile.Deprecated_attribute

Following code examples demonstrate how to use com.sun.tools.classfile.Deprecated_attributefrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.sun.tools.classfile.Deprecated_attributeand various code implementation of this class.

    private void test(String package_info, String src) {
        addTestCase(src);
        printf("Testing test case: \n%s\n", src);
        try {
            ClassFile cf = readClassFile(compile(
                        new String[]{"package-info.java", package_info},
                        new String[]{"notDeprecated.java", src})
                    .getClasses().get(CLASS_NAME));
            Deprecated_attribute attr =
                    (Deprecated_attribute) cf.getAttribute(Attribute.Deprecated);
            checkNull(attr, "Class can not have deprecated attribute : " + CLASS_NAME);
        } catch (Exception e) {
            addFailure(e);
        }
    } 


Advertisement
Javadoc
See JVMS, section 4.8.15.

This is NOT part of any supported API. If you write code t

hat depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Read More
Advertisement