Package proguard.classfile.constant

Examples of proguard.classfile.constant.Constant


        // Initialize an array whose elements can be compared.
        int sortLength = 0;
        for (int oldIndex = 1; oldIndex < constantPoolCount; oldIndex++)
        {
            Constant constant = programClass.constantPool[oldIndex];
            if (constant != null)
            {
                comparableConstantPool[sortLength++] =
                    new ComparableConstant(programClass, oldIndex, constant);
            }
        }

        // Sort the array.
        Arrays.sort(comparableConstantPool, 0, sortLength);

        // Save the sorted elements.
        int newLength = 1;
        int newIndex  = 1;
        ComparableConstant previousComparableConstant = null;
        for (int sortIndex = 0; sortIndex < sortLength; sortIndex++)
        {
            ComparableConstant comparableConstant = comparableConstantPool[sortIndex];

            // Isn't this a duplicate of the previous constant?
            if (!comparableConstant.equals(previousComparableConstant))
            {
                // Remember the index of the new entry.
                newIndex = newLength;

                // Copy the sorted constant pool entry over to the constant pool.
                Constant constant = comparableConstant.getConstant();

                newConstantPool[newLength++] = constant;

                // Long entries take up two slots, the second of which is null.
                int tag = constant.getTag();
                if (tag == ClassConstants.CONSTANT_Long ||
                    tag == ClassConstants.CONSTANT_Double)
                {
                    newConstantPool[newLength++] = null;
                }
View Full Code Here


        // Shift the used constant pool entries together.
        for (int index = 1; index < length; index++)
        {
            constantIndexMap[index] = counter;

            Constant constant = constantPool[index];

            // Don't update the flag if this is the second half of a long entry.
            if (constant != null)
            {
                isUsed = constant.getTag() != ClassConstants.CONSTANT_NameAndType ||
                         NameAndTypeUsageMarker.isUsed(constant);
            }

            if (isUsed)
            {
View Full Code Here

        // Shift the used constant pool entries together.
        for (int index = 1; index < length; index++)
        {
            constantIndexMap[index] = counter;

            Constant constant = constantPool[index];

            // Don't update the flag if this is the second half of a long entry.
            if (constant != null)
            {
                isUsed = constant.getTag() != ClassConstants.CONSTANT_Utf8 ||
                         Utf8UsageMarker.isUsed(constant);
            }

            if (isUsed)
            {
View Full Code Here

        // Initialize an array whose elements can be compared.
        int sortLength = 0;
        for (int oldIndex = 1; oldIndex < constantPoolCount; oldIndex++)
        {
            Constant constant = programClass.constantPool[oldIndex];
            if (constant != null)
            {
                comparableConstantPool[sortLength++] =
                    new ComparableConstant(programClass, oldIndex, constant);
            }
        }

        // Sort the array.
        Arrays.sort(comparableConstantPool, 0, sortLength);

        // Save the sorted elements.
        int newLength = 1;
        int newIndex  = 1;
        ComparableConstant previousComparableConstant = null;
        for (int sortIndex = 0; sortIndex < sortLength; sortIndex++)
        {
            ComparableConstant comparableConstant = comparableConstantPool[sortIndex];

            // Isn't this a duplicate of the previous constant?
            if (!comparableConstant.equals(previousComparableConstant))
            {
                // Remember the index of the new entry.
                newIndex = newLength;

                // Copy the sorted constant pool entry over to the constant pool.
                Constant constant = comparableConstant.getConstant();

                newConstantPool[newLength++] = constant;

                // Long entries take up two slots, the second of which is null.
                int tag = constant.getTag();
                if (tag == ClassConstants.CONSTANT_Long ||
                    tag == ClassConstants.CONSTANT_Double)
                {
                    newConstantPool[newLength++] = null;
                }
View Full Code Here

        // Initialize an array whose elements can be compared.
        int sortLength = 0;
        for (int oldIndex = 1; oldIndex < constantPoolCount; oldIndex++)
        {
            Constant constant = programClass.constantPool[oldIndex];
            if (constant != null)
            {
                comparableConstantPool[sortLength++] =
                    new ComparableConstant(programClass, oldIndex, constant);
            }
        }

        // Sort the array.
        Arrays.sort(comparableConstantPool, 0, sortLength);

        // Save the sorted elements.
        int newLength = 1;
        int newIndex  = 1;
        ComparableConstant previousComparableConstant = null;
        for (int sortIndex = 0; sortIndex < sortLength; sortIndex++)
        {
            ComparableConstant comparableConstant = comparableConstantPool[sortIndex];

            // Isn't this a duplicate of the previous constant?
            if (!comparableConstant.equals(previousComparableConstant))
            {
                // Remember the index of the new entry.
                newIndex = newLength;

                // Copy the sorted constant pool entry over to the constant pool.
                Constant constant = comparableConstant.getConstant();

                newConstantPool[newLength++] = constant;

                // Long entries take up two slots, the second of which is null.
                int tag = constant.getTag();
                if (tag == ClassConstants.CONSTANT_Long ||
                    tag == ClassConstants.CONSTANT_Double)
                {
                    newConstantPool[newLength++] = null;
                }
View Full Code Here

        // Initialize an array whose elements can be compared.
        int sortLength = 0;
        for (int oldIndex = 1; oldIndex < constantPoolCount; oldIndex++)
        {
            Constant constant = programClass.constantPool[oldIndex];
            if (constant != null)
            {
                comparableConstantPool[sortLength++] =
                    new ComparableConstant(programClass, oldIndex, constant);
            }
        }

        // Sort the array.
        Arrays.sort(comparableConstantPool, 0, sortLength);

        // Save the sorted elements.
        int newLength = 1;
        int newIndex  = 1;
        ComparableConstant previousComparableConstant = null;
        for (int sortIndex = 0; sortIndex < sortLength; sortIndex++)
        {
            ComparableConstant comparableConstant = comparableConstantPool[sortIndex];

            // Isn't this a duplicate of the previous constant?
            if (!comparableConstant.equals(previousComparableConstant))
            {
                // Remember the index of the new entry.
                newIndex = newLength;

                // Copy the sorted constant pool entry over to the constant pool.
                Constant constant = comparableConstant.getConstant();

                newConstantPool[newLength++] = constant;

                // Long entries take up two slots, the second of which is null.
                int tag = constant.getTag();
                if (tag == ClassConstants.CONSTANT_Long ||
                    tag == ClassConstants.CONSTANT_Double)
                {
                    newConstantPool[newLength++] = null;
                }
View Full Code Here

TOP

Related Classes of proguard.classfile.constant.Constant

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.