PreverificationResults.java

Index Score
eclipseme.preverifier.results
EclipseME

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
/** * Copyright (c) 2003-2004 Craig Setera * All Rights Reserved. * Licensed under the Eclipse Public License - v 1.0 * For more information see http://www.eclipse.org/legal/epl-v10.html */ package eclipseme.preverifier.results; import java.io.PrintWriter; import java.io.StringWriter; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.util.TraceClassVisitor; /** * Results of the preverification. * <p /> * Copyright (c) 2003-2004 Craig Setera<br> * All Rights Reserved.<br> * Licensed under the Eclipse Public License - v 1.0<p/> * <br> * $Revision: 1.1 $ * <br> * $Date: 2005/09/25 23:53:31 $ * <br> * @author Craig Setera */ public class PreverificationResults { private ClassNode preverifiedClassNode; private byte[] preverifiedClassBytes; private PreverificationError[] errors; /** * Construct a new preverication result. * * @param preverifiedClassBytes * @param errors */ public PreverificationResults( ClassNode preverifiedClassNode, byte[] preverifiedClassBytes, PreverificationError[] errors) { this.preverifiedClassNode = preverifiedClassNode; this.preverifiedClassBytes = preverifiedClassBytes; this.errors = errors; } /** * @return Returns the errors. */ public PreverificationError[] getErrors() { return errors; } /** * @return Returns the preverifiedClassBytes. */ public byte[] getPreverifiedClassBytes() { return preverifiedClassBytes; } /** * @return Returns the preverifiedClassNode. */ public ClassNode getPreverifiedClassNode() { return preverifiedClassNode; } /** * Return the disassembled class output or <code>null</code> if there * were errors while doing the preverification. * * @return */ public String getDisassembledOutput() { String traceOutput = null; if (errors.length == 0) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); TraceClassVisitor traceVisitor = new TraceClassVisitor(printWriter); preverifiedClassNode.accept(traceVisitor); printWriter.close(); traceOutput = stringWriter.toString(); } return traceOutput; } /** * Return a boolean indicating whether the result was an error result. * * @return */ public boolean isErrorResult() { return errors.length > 0; } }

The table below shows all metrics for PreverificationResults.java.

MetricValueDescription