org.softevo.jdynpur.eval
Class MethodExecutionDisplayer

java.lang.Object
  extended by org.softevo.jdynpur.eval.PurityTraceAnalyser
      extended by org.softevo.jdynpur.eval.MethodExecutionDisplayer

public class MethodExecutionDisplayer
extends PurityTraceAnalyser

This is a utility class used to analyze execution of specific methods. It expects a classname and one or more trace files as input and displays recorded events only when the specified method is executed.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.softevo.jdynpur.eval.PurityTraceAnalyser
PurityTraceAnalyser.ParameterMutabilityInformation
 
Field Summary
protected  org.softevo.util.asm.MethodIdentifier identifier
          The method identifier of the method to be displayed.
protected  int numberOfRunningMethods
          The number of times the method is currently active.
protected  int soughtMethodId
          The integer identifying the sought method.
 
Fields inherited from class org.softevo.jdynpur.eval.PurityTraceAnalyser
excludeAPIMethodsFromResults, executedMethodIdentifiers, executedMethodIds, fieldIdentifierMap, fileName, identifierMap, ignoreEffectsOfStaticInitializers, impureMethodIdentifiers, impureMethodIds, methodsModifyingThisObject, mutabilityChangeEntries, parameterMutabilityInformation, printResults, pureMethodIdentifiers, pureMethodIds, purityChangeEntries, results, resultsFileName, saveResults, thisModifyingMethodIdentifiers, threadIdToCreatedObjectSetStackMap, threadIdToMethodCallStackMap, threadIdToModifiedObjectSetStackMap, threadIdToParameterSetStackMap, threadIdToThisStackMap, threadIdToThisTypeMap, verbose
 
Constructor Summary
MethodExecutionDisplayer(java.lang.String fileName, org.softevo.util.asm.MethodIdentifier identifier)
          Creates a new method execution displayer.
 
Method Summary
protected  void handleArrayCreation(int objectId, int threadId)
          If the sought method is active, this method outputs an array creation message on System.out.
protected  void handleArrayModification(int objectId, int threadId)
          If the sought method is active, this method outputs an array modification message on System.out.
protected  void handleFieldWrite(int objectId, int threadId)
          If the sought method is active, this method outputs a field modification message on System.out.
protected  void handleMethodEnd(int methodId, int threadId, java.lang.String className)
          If a method has ended, this method checks if it's execution had side-effects and outputs a message on System.out.
protected  void handleMethodStart(int methodId, int threadId, java.lang.String className)
          If the sought method is active, this method outputs a method start message on System.out and increases the active method count.
protected  void handleObjectCreation(int objectId, int threadId)
          If the sought method is active, this method outputs an object creation message on System.out.
protected  void handleStaticFieldWrite(int threadId)
          If the sought method is active, this method outputs a field modification message on System.out.
protected  boolean isMethodRunning()
          Checks if the sought method is currently executed in the trace.
protected  boolean isSoughtMethod(int methodId)
          Checks if the identifier is for the sought method.
static void main(java.lang.String[] args)
          This method evaluates command line arguments and replays execution for every trace file.
 
Methods inherited from class org.softevo.jdynpur.eval.PurityTraceAnalyser
addToHashMap, analyse, convertMap, getCreatedObjectSetStack, getExecutedMethodIdentifiers, getImpureMethodIdentifiers, getMethodCallStack, getModifiedObjectSetStack, getParameterMutabilityInformation, getParameterSetStack, getPureMethodIdentifiers, getResults, getThisModifyingMethodIdentifiers, getThisObjectStack, getThisTypeStack, getTransitiveStateForObject, handleDynamicMethodEnd, handleDynamicMethodStart, handleObjectArrayModification, handleObjectFieldWrite, handleParameter, handleStaticMethodEnd, handleStaticMethodStart, handleTraceEnd, isAPIMethod, processParameterModification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

protected org.softevo.util.asm.MethodIdentifier identifier
The method identifier of the method to be displayed.


soughtMethodId

protected int soughtMethodId
The integer identifying the sought method.


numberOfRunningMethods

protected int numberOfRunningMethods
The number of times the method is currently active. This is needed for recursive calls.

Constructor Detail

MethodExecutionDisplayer

public MethodExecutionDisplayer(java.lang.String fileName,
                                org.softevo.util.asm.MethodIdentifier identifier)
Creates a new method execution displayer.

Parameters:
fileName - the name of the trace file to replay
identifierMap - the identifier map for this trace
identifier - the identifier of the sought method
Method Detail

handleArrayCreation

protected void handleArrayCreation(int objectId,
                                   int threadId)
If the sought method is active, this method outputs an array creation message on System.out.

Overrides:
handleArrayCreation in class PurityTraceAnalyser
Parameters:
objectId - the identifier for the new array
threadId - the thread id

handleArrayModification

protected void handleArrayModification(int objectId,
                                       int threadId)
If the sought method is active, this method outputs an array modification message on System.out.

Overrides:
handleArrayModification in class PurityTraceAnalyser
Parameters:
objectId - the identifier for the modified array
threadId - the thread id

handleStaticFieldWrite

protected void handleStaticFieldWrite(int threadId)
If the sought method is active, this method outputs a field modification message on System.out.

Overrides:
handleStaticFieldWrite in class PurityTraceAnalyser
Parameters:
objectId - the identifier for the modified field
threadId - the thread id

handleFieldWrite

protected void handleFieldWrite(int objectId,
                                int threadId)
If the sought method is active, this method outputs a field modification message on System.out.

Overrides:
handleFieldWrite in class PurityTraceAnalyser
Parameters:
objectId - the identifier for the modified field
threadId - the thread id

handleObjectCreation

protected void handleObjectCreation(int objectId,
                                    int threadId)
If the sought method is active, this method outputs an object creation message on System.out.

Overrides:
handleObjectCreation in class PurityTraceAnalyser
Parameters:
objectId - the identifier for the new object
threadId - the thread id

handleMethodStart

protected void handleMethodStart(int methodId,
                                 int threadId,
                                 java.lang.String className)
If the sought method is active, this method outputs a method start message on System.out and increases the active method count.

Overrides:
handleMethodStart in class PurityTraceAnalyser
Parameters:
methodId - the identifier for the method
threadId - the thread id

handleMethodEnd

protected void handleMethodEnd(int methodId,
                               int threadId,
                               java.lang.String className)
If a method has ended, this method checks if it's execution had side-effects and outputs a message on System.out.

Overrides:
handleMethodEnd in class PurityTraceAnalyser
Parameters:
methodId - the identifier for the method
threadId - the thread id

isMethodRunning

protected boolean isMethodRunning()
Checks if the sought method is currently executed in the trace.


isSoughtMethod

protected boolean isSoughtMethod(int methodId)
Checks if the identifier is for the sought method.

Parameters:
methodId - the id of the method

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
This method evaluates command line arguments and replays execution for every trace file.

Parameters:
args - command line arguments
Throws:
java.io.IOException


Copyright © 2007-2008 Software Engineering Group at Saarland University. All Rights Reserved.