Java Code Examples for proguard.classfile.ClassConstants#INTERNAL_CLASS_VERSION_1_6

The following examples show how to use proguard.classfile.ClassConstants#INTERNAL_CLASS_VERSION_1_6 . 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: Preverifier.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Performs preverification of the given program class pool.
 */
public void execute(ClassPool programClassPool)
{
    // Clean up any old visitor info.
    programClassPool.classesAccept(new ClassCleaner());

    // Preverify all methods.
    ClassVisitor preverifier =
        new AllMethodVisitor(
        new AllAttributeVisitor(
        new CodePreverifier(configuration.microEdition)));

    // In Java Standard Edition, only class files from Java 6 or higher
    // should be preverified.
    if (!configuration.microEdition)
    {
        preverifier =
            new ClassVersionFilter(ClassConstants.INTERNAL_CLASS_VERSION_1_6,
                                   Integer.MAX_VALUE,
                                   preverifier);
    }

    programClassPool.classesAccept(preverifier);
}
 
Example 2
Source File: SubroutineInliner.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Performs subroutine inlining of the given program class pool.
 */
public void execute(ClassPool programClassPool)
{
    // Clean up any old visitor info.
    programClassPool.classesAccept(new ClassCleaner());

    // Inline all subroutines.
    ClassVisitor inliner =
        new AllMethodVisitor(
        new AllAttributeVisitor(
        new CodeSubroutineInliner()));

    // In Java Standard Edition, only class files from Java 6 or higher
    // should be preverified.
    if (!configuration.microEdition)
    {
        inliner =
            new ClassVersionFilter(ClassConstants.INTERNAL_CLASS_VERSION_1_6,
                                   Integer.MAX_VALUE,
                                   inliner);
    }

    programClassPool.classesAccept(inliner);
}
 
Example 3
Source File: ClassUtil.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the internal class version number.
 * @param classVersion the external class version number.
 * @return the internal class version number.
 */
public static int internalClassVersion(String classVersion)
{
    return
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_0) ||
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_1) ? ClassConstants.INTERNAL_CLASS_VERSION_1_0 :
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_2) ? ClassConstants.INTERNAL_CLASS_VERSION_1_2 :
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_3) ? ClassConstants.INTERNAL_CLASS_VERSION_1_3 :
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_4) ? ClassConstants.INTERNAL_CLASS_VERSION_1_4 :
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_5_ALIAS) ||
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_5) ? ClassConstants.INTERNAL_CLASS_VERSION_1_5 :
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_6_ALIAS) ||
        classVersion.equals(ClassConstants.EXTERNAL_CLASS_VERSION_1_6) ? ClassConstants.INTERNAL_CLASS_VERSION_1_6 :
                                                                         0;
}
 
Example 4
Source File: ClassUtil.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the minor part of the given class version number.
 * @param classVersion the combined class version number.
 * @return the minor part of the class version number.
 */
public static String externalClassVersion(int classVersion)
{
    switch (classVersion)
    {
        case ClassConstants.INTERNAL_CLASS_VERSION_1_0: return ClassConstants.EXTERNAL_CLASS_VERSION_1_0;
        case ClassConstants.INTERNAL_CLASS_VERSION_1_2: return ClassConstants.EXTERNAL_CLASS_VERSION_1_2;
        case ClassConstants.INTERNAL_CLASS_VERSION_1_3: return ClassConstants.EXTERNAL_CLASS_VERSION_1_3;
        case ClassConstants.INTERNAL_CLASS_VERSION_1_4: return ClassConstants.EXTERNAL_CLASS_VERSION_1_4;
        case ClassConstants.INTERNAL_CLASS_VERSION_1_5: return ClassConstants.EXTERNAL_CLASS_VERSION_1_5;
        case ClassConstants.INTERNAL_CLASS_VERSION_1_6: return ClassConstants.EXTERNAL_CLASS_VERSION_1_6;
        default:                                        return null;
    }
}
 
Example 5
Source File: ClassUtil.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether the given class version number is supported.
 * @param classVersion the combined class version number.
 * @throws UnsupportedOperationException when the version is not supported.
 */
public static void checkVersionNumbers(int classVersion) throws UnsupportedOperationException
{
    if (classVersion < ClassConstants.INTERNAL_CLASS_VERSION_1_0 ||
        classVersion > ClassConstants.INTERNAL_CLASS_VERSION_1_6)
    {
        throw new UnsupportedOperationException("Unsupported version number ["+
                                                internalMajorClassVersion(classVersion)+"."+
                                                internalMinorClassVersion(classVersion)+"] for class format");
    }
}