Package proguard.classfile.visitor

Examples of proguard.classfile.visitor.ClassPrinter


            System.err.println("  Method      = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]");
            System.err.println("  Exception   = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")");

            if (DEBUG)
            {
                method.accept(clazz, new ClassPrinter());
            }

            throw ex;
        }
    }
View Full Code Here


            System.err.println("  Method      = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]");
            System.err.println("  Exception   = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")");

            if (DEBUG)
            {
                method.accept(clazz, new ClassPrinter());
            }

            throw ex;
        }
    }
View Full Code Here

            System.err.println("  Exception   = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")");
            System.err.println("Not optimizing this method");

            if (DEBUG)
            {
                method.accept(clazz, new ClassPrinter());

                throw ex;
            }
        }
    }
View Full Code Here

                if (frameCount != originalFrameCount ||
                    !Arrays.equals(stackMapFrameList.toArray(), originalFrames))
                {
                    System.out.println("Original preverification ["+clazz.getName()+"]:");
                    new ClassPrinter().visitProgramMethod(programClass, programMethod);
                }
            }
            else if (frameCount != 0)
            {
                System.out.println("Original preverification empty ["+clazz.getName()+"."+method.getName(clazz)+"]");
            }
        }

        if (frameCount == 0)
        {
            // Remove any stack map (table) attribute from the code attribute.
            new AttributesEditor(programClass, programMethod, codeAttribute, true).deleteAttribute(stackMapAttributeName);
        }
        else
        {
            Attribute stackMapAttribute;

            // Create the appropriate attribute.
            if (microEdition)
            {
                // Copy the frames into an array.
                FullFrame[] stackMapFrames = new FullFrame[frameCount];
                stackMapFrameList.toArray(stackMapFrames);

                // Put the frames into a stack map attribute.
                stackMapAttribute = new StackMapAttribute(stackMapFrames);
            }
            else
            {
                // Copy the frames into an array.
                StackMapFrame[] stackMapFrames = new StackMapFrame[frameCount];
                stackMapFrameList.toArray(stackMapFrames);

                // Put the frames into a stack map table attribute.
                stackMapAttribute = new StackMapTableAttribute(stackMapFrames);
            }

            // Fill out the name of the stack map attribute.
            stackMapAttribute.u2attributeNameIndex =
                new ConstantPoolEditor(programClass).addUtf8Constant(stackMapAttributeName);

            // Add the new stack map (table) attribute to the code attribute.
            new AttributesEditor(programClass, programMethod, codeAttribute, true).addAttribute(stackMapAttribute);

            if (DEBUG)
            {
                System.out.println("Preverifier ["+programClass.getName()+"."+programMethod.getName(programClass)+"]:");
                stackMapAttribute.accept(programClass, programMethod, codeAttribute, new ClassPrinter());
            }
        }

        // Apply code modifications, deleting unreachable code.
        codeAttributeEditor.visitCodeAttribute(clazz, method, codeAttribute);
View Full Code Here

            System.err.println("  Method      = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]");
            System.err.println("  Exception   = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")");

            if (DEBUG)
            {
                method.accept(clazz, new ClassPrinter());
            }

            throw ex;
        }
    }
View Full Code Here

    public static void main(String[] args)
    {
        ProgramClass clazz = new ProgramClass();
        clazz.constantPool = CONSTANTS;

        ClassPrinter printer = new ClassPrinter();

        for (int index = 0; index < CONSTANTS.length; index++)
        {
            System.out.print("["+index+"] ");
            try
            {
                CONSTANTS[index].accept(clazz, printer);
            }
            catch (Exception e)
            {
                System.out.println("("+e.getClass().getName()+")");
            }
        }

        if (CONSTANTS.length != SENTINEL)
        {
            throw new IllegalStateException("Constants length ["+CONSTANTS.length+"] different from number of constant names ["+SENTINEL+"]");
        }

        Instruction[][][] sequences = STRING;

        for (int sequence = 0; sequence < sequences.length; sequence++)
        {
            System.out.println();
            Instruction[] instructions = sequences[sequence][0];
            for (int index = 0; index < instructions.length; index++)
            {
                Instruction instruction = instructions[index];
                try
                {
                    instruction.accept(clazz, null, null, index, new ClassPrinter());
                }
                catch (Exception e) {}
            }

            System.out.println("=>");
            instructions = sequences[sequence][1];
            for (int index = 0; index < instructions.length; index++)
            {
                Instruction instruction = instructions[index];
                try
                {
                    instruction.accept(clazz, null, null, index, new ClassPrinter());
                }
                catch (Exception e) {}
            }
        }
    }
View Full Code Here

        }

        PrintStream ps = createPrintStream(configuration.dump);
        try
        {
            programClassPool.classesAccept(new ClassPrinter(ps));
        }
        finally
        {
            closePrintStream(ps);
        }
View Full Code Here

            System.err.println("  Method      = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]");
            System.err.println("  Exception   = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")");

            if (DEBUG)
            {
                method.accept(clazz, new ClassPrinter());
            }

            throw ex;
        }
    }
View Full Code Here

TOP

Related Classes of proguard.classfile.visitor.ClassPrinter

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.