Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

PostProcessOnAnnotation Class Reference

List of all members.

Public Methods

 PostProcessOnAnnotation (List ct, AnnotationManager cfs)
Set getModifiedPackages ()
Set getModifiedSootClasses ()
Set getModifiedSootMethods ()
Set getParameterModifiedMethods ()
Set getRemovableLocals (SootMethod sm)
Set getRemovablePackages ()
Set getRemovableSootClasses ()
Set getRemovableSootFields ()
Set getRemovableSootMethods ()
Set getUnreachableSootClasses ()
Set getUnreachableSootMethods ()
void resClassCons ()

Private Methods

void addCatchesToRemovedSet (Set removedSet, Vector catches, StmtList stmtList, Set linePropList, BitSet slcSet)
void addCatchesToSliceSet (BitSet slcSet, Vector catches, StmtList stmtList)
boolean buildNewInvokeExpr (InvokeExpr invokeExpr)
void callSiteInSlice (Map callSiteIndexMap, Map callSiteMap, Stmt stmt)
boolean emptyBody (Stmt[] bodyStmts, BitSet sliceSet, StmtList stmtList)
boolean emptyBody (Set bodyStmts, BitSet sliceSet, StmtList stmtList)
Set fieldRefToField (Set fieldRefSet)
void filterOutFields (Set variableSet)
Set getAllClassesFor (Package pckg)
Set getAllPackages ()
Set getAllVarsOf (MethodInfo mdInfo)
Set getCurrentResidualClasses ()
LinkedList getKeepedParaOriginalIndex (MethodInfo mdInfo)
Set getTrapHandlers (JimpleBody jimpBody)
Set getUnusedLocals (MethodInfo mdInfo)
void initializeMdInfoAndAnnotation ()
boolean isImplementingOneAbstractMd (SootClass superClass, SootMethod sm)
boolean isImplementingOneAbstractMd (SootMethod sm)
boolean isImplementingOneInterfaceMd (SootClass interfaceClass, SootMethod sm)
boolean isPublicAndStatic (int modifier)
void keepParasOfMainMd (MethodInfo mdInfo, Map relevantVars, StmtList stmtList, BitSet sliceSet)
void makeMethodEmpty (MethodInfo methodInfo, Annotation annForSm)
boolean modifyMethod (MethodInfo mdInfo)
void relevantExceptionClasses ()
void relevantFDClass ()
void relevantInterfaceAndSuperClasses ()
void removeEmptyBlock (MethodInfo mdInfo, Set rmedStmtByEmptBlck, Vector currentCFANNs, StmtList stmtList, JimpleBody jimpleBody)
void removeEmptyConditionalBlock (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList)
void removeEmptyLock (List lockPairList, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList)
void removeEmptyTry (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList, JimpleBody jimpleBody)
void removeEmptyTryFinally (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList, JimpleBody jimpleBody)
void removeFieldInClinit (SootClass sootClass, SootField sootField)
void removeIrrelevantFields (ClassInfo classInfo)
void residualParameters (MethodInfo mdInfo)
void rmIrrelevantFds ()
void rmIrrelevantParasForInvoke ()
void rmIrrelevantParasForMd ()
void rmMethodAndClass (Map removableMdMap)
void rmParasOfInvokeExpr (MethodInfo mdInfo)
void rmUnusedLocals ()

Private Attributes

Map modifiedSootMethodToRemovableLocals = new HashMap()
Set removableSootMethods = new ArraySet()
Set unreachableSootMethods = new ArraySet()
Set unreachableSootClasses = Slicer.unreachableClasses
Set removableSootFields = new ArraySet()
Set parameterModifiedSootMethods = new ArraySet()
List classList
Set removableSootClasses = new ArraySet()
List changeReturnTypeToVoidMds = new ArrayList()
Set relevantFields = new ArraySet()
Set relevantExceptionClassNames = new ArraySet()
AnnotationManager cfanns = null

Detailed Description

This class is for constructing residual program for each sliced class and method.

Definition at line 52 of file PostProcessOnAnnotation.java.


Constructor & Destructor Documentation

PostProcessOnAnnotation::PostProcessOnAnnotation List   ct,
AnnotationManager   cfs
[inline]
 

Parameters:
ct   a list of ClassInfo.
cfs   annotation manager.

Definition at line 95 of file PostProcessOnAnnotation.java.


Member Function Documentation

void PostProcessOnAnnotation::addCatchesToRemovedSet Set   removedSet,
Vector   catches,
StmtList   stmtList,
Set   linePropList,
BitSet   slcSet
[inline, private]
 

Add all statements in catch block into a set removedSet except for those in the given slice set.

Parameters:
removedSet   a set of Stmt which is the result of this method.
catches   a vector of Annotation which is that of catch clause.
stmtList   statement list for indexing.
linePropList   a set of Stmt which is slice point.
slcSet   slice set indexed in a BitSet.

Definition at line 113 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyTry(), and removeEmptyTryFinally().

void PostProcessOnAnnotation::addCatchesToSliceSet BitSet   slcSet,
Vector   catches,
StmtList   stmtList
[inline, private]
 

Add all statements in catch blocks into the given slice set.

Parameters:
slcSet   slice set indexed in a BitSet.
catches   a vector of Annotation.
stmtList   statement list for indexing.

Definition at line 135 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyTry(), and removeEmptyTryFinally().

void PostProcessOnAnnotation::callSiteInSlice Map   callSiteIndexMap,
Map   callSiteMap,
Stmt   stmt
[inline, private]
 

Process parameters of a call site in slice. Change parameters of an invoke expression in terms of changes in called method.

Parameters:
callSiteIndexMap   a map from Stmt to CallSite.
callSiteMap   a map from CallSite to SootMethod.
stmt   a statement with an invoke expression.

See also:
{buildNewInvokeExpr(InvokeExpr)}

Definition at line 183 of file PostProcessOnAnnotation.java.

Referenced by modifyMethod().

boolean PostProcessOnAnnotation::emptyBody Set   bodyStmts,
BitSet   sliceSet,
StmtList   stmtList
[inline, private]
 

See if all statements in a set of statement are not in a slice set.

Returns:
true if all statements in the set are not in the slice set, false otherwise.
Parameters:
bodyStmts   a set of statement.
sliceSet   slice set.
stmtList   statement list for indexing.

Definition at line 232 of file PostProcessOnAnnotation.java.

boolean PostProcessOnAnnotation::emptyBody Stmt   bodyStmts[],
BitSet   sliceSet,
StmtList   stmtList
[inline, private]
 

See if all statements in an array of statement are not in a slice set.

Returns:
true if all statements in the array are not in the slice set, false otherwise.
Parameters:
bodyStmts   an array of statement.
sliceSet   slice set.
stmtList   statement list for indexing.

Definition at line 216 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyConditionalBlock(), removeEmptyLock(), removeEmptyTry(), and removeEmptyTryFinally().

Set PostProcessOnAnnotation::fieldRefToField Set   fieldRefSet [inline, private]
 

Collect soot fields from a set of field references.

Parameters:
fieldRefSet   a set of FieldRef.
Returns:
a set of SootField.

Definition at line 246 of file PostProcessOnAnnotation.java.

Referenced by removeIrrelevantFields().

void PostProcessOnAnnotation::filterOutFields Set   variableSet [inline, private]
 

Collect all FieldRef from a set of Value into the field relevantFields.

Parameters:
variableSet   a set of Value.

Definition at line 259 of file PostProcessOnAnnotation.java.

Referenced by modifyMethod(), and resClassCons().

Set PostProcessOnAnnotation::getAllClassesFor Package   pckg [inline, private]
 

Insert the method's description here. Creation date: (00-12-7 10:58:43)

Returns:
ca.mcgill.sable.util.Set
Parameters:
packageName   java.lang.String

Definition at line 272 of file PostProcessOnAnnotation.java.

Referenced by getModifiedPackages(), and getRemovablePackages().

Set PostProcessOnAnnotation::getAllPackages   [inline, private]
 

Insert the method's description here. Creation date: (00-12-7 10:42:45)

Returns:
ca.mcgill.sable.util.Set

Definition at line 287 of file PostProcessOnAnnotation.java.

Referenced by getModifiedPackages(), and getRemovablePackages().

Set PostProcessOnAnnotation::getAllVarsOf MethodInfo   mdInfo [inline, private]
 

Get all Value used/defined in a method body.

Parameters:
mdInfo   query method.
Returns:
a set Value

Definition at line 308 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

Set PostProcessOnAnnotation::getCurrentResidualClasses   [inline, private]
 

Insert the method's description here. Creation date: (00-12-6 15:23:43)

Returns:
ca.mcgill.sable.util.Set

Definition at line 322 of file PostProcessOnAnnotation.java.

Referenced by relevantInterfaceAndSuperClasses().

LinkedList PostProcessOnAnnotation::getKeepedParaOriginalIndex MethodInfo   mdInfo [inline, private]
 

Get residual parameters for a method.

Parameters:
mdInfo   query method.
Returns:
a LinkedList of Integer which is the index of parameter.

Definition at line 338 of file PostProcessOnAnnotation.java.

Referenced by callSiteInSlice().

Set PostProcessOnAnnotation::getModifiedPackages   [inline]
 

Insert the method's description here. Creation date: (00-12-7 10:13:23)

Returns:
ca.mcgill.sable.util.Set

Definition at line 356 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getModifiedSootClasses   [inline]
 

Insert the method's description here. Creation date: (00-12-7 10:12:44)

Returns:
ca.mcgill.sable.util.Set

Definition at line 379 of file PostProcessOnAnnotation.java.

Referenced by getModifiedPackages(), and CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getModifiedSootMethods   [inline]
 

Insert the method's description here. Creation date: (00-12-6 16:55:43)

Returns:
ca.mcgill.sable.util.Set

Definition at line 399 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getParameterModifiedMethods   [inline]
 

Insert the method's description here. Creation date: (00-12-18 11:54:07)

Returns:
ca.mcgill.sable.util.Set

Definition at line 407 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getRemovableLocals SootMethod   sm [inline]
 

Insert the method's description here. Creation date: (00-12-6 15:38:21)

Returns:
ca.mcgill.sable.util.Set
Parameters:
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 416 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::getLocalDecState().

Set PostProcessOnAnnotation::getRemovablePackages   [inline]
 

Insert the method's description here. Creation date: (00-12-7 10:13:55)

Returns:
ca.mcgill.sable.util.Set

Definition at line 424 of file PostProcessOnAnnotation.java.

Referenced by getModifiedPackages(), and CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getRemovableSootClasses   [inline]
 

Insert the method's description here. Creation date: (00-12-6 17:10:18)

Returns:
ca.mcgill.sable.util.Set

Definition at line 446 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getRemovableSootFields   [inline]
 

Insert the method's description here. Creation date: (00-12-6 15:33:00)

Returns:
ca.mcgill.sable.util.Set

Definition at line 454 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getRemovableSootMethods   [inline]
 

Insert the method's description here. Creation date: (00-12-6 15:27:28)

Returns:
ca.mcgill.sable.util.Set

Definition at line 462 of file PostProcessOnAnnotation.java.

Referenced by CodeBrowserPane::setPostProcessValues().

Set PostProcessOnAnnotation::getTrapHandlers JimpleBody   jimpBody [inline, private]
 

Get all trap hanlders from jimple body.

Parameters:
jimpBody   jimple body
Returns:
a set of Stmt which is trap handler.

Definition at line 471 of file PostProcessOnAnnotation.java.

Referenced by modifyMethod().

Set PostProcessOnAnnotation::getUnreachableSootClasses   [inline]
 

Insert the method's description here. Creation date: (00-12-6 15:32:10)

Returns:
ca.mcgill.sable.util.Set

Definition at line 486 of file PostProcessOnAnnotation.java.

Set PostProcessOnAnnotation::getUnreachableSootMethods   [inline]
 

Insert the method's description here. Creation date: (00-12-6 15:31:31)

Returns:
ca.mcgill.sable.util.Set

Definition at line 494 of file PostProcessOnAnnotation.java.

Set PostProcessOnAnnotation::getUnusedLocals MethodInfo   mdInfo [inline, private]
 

Insert the method's description here. Creation date: (00-12-6 14:54:27)

Returns:
ca.mcgill.sable.util.Set
Parameters:
jimpleBody   ca.mcgill.sable.soot.jimple.JimpleBody

Definition at line 503 of file PostProcessOnAnnotation.java.

Referenced by rmUnusedLocals().

void PostProcessOnAnnotation::initializeMdInfoAndAnnotation   [inline, private]
 

Insert the method's description here. Creation date: (00-12-7 18:06:38)

Definition at line 545 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

boolean PostProcessOnAnnotation::isImplementingOneAbstractMd SootMethod   sm [inline, private]
 

Insert the method's description here. Creation date: (00-11-14 10:59:21)

Returns:
boolean
Parameters:
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 593 of file PostProcessOnAnnotation.java.

boolean PostProcessOnAnnotation::isImplementingOneAbstractMd SootClass   superClass,
SootMethod   sm
[inline, private]
 

Insert the method's description here. Creation date: (00-11-14 11:18:28)

Returns:
boolean
Parameters:
superClass   ca.mcgill.sable.soot.SootClass
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 572 of file PostProcessOnAnnotation.java.

Referenced by isImplementingOneAbstractMd(), and resClassCons().

boolean PostProcessOnAnnotation::isImplementingOneInterfaceMd SootClass   interfaceClass,
SootMethod   sm
[inline, private]
 

Insert the method's description here. Creation date: (00-11-14 11:29:00)

Returns:
boolean
Parameters:
interfaceClas   ca.mcgill.sable.soot.SootClass
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 624 of file PostProcessOnAnnotation.java.

Referenced by isImplementingOneAbstractMd().

boolean PostProcessOnAnnotation::isPublicAndStatic int   modifier [inline, private]
 

See if a given modifier is public and static.

Parameters:
modifier   modifier.
Returns:
boolean.

Definition at line 641 of file PostProcessOnAnnotation.java.

Referenced by keepParasOfMainMd().

void PostProcessOnAnnotation::keepParasOfMainMd MethodInfo   mdInfo,
Map   relevantVars,
StmtList   stmtList,
BitSet   sliceSet
[inline, private]
 

Keep all parameters for main method, even those parameters are irrelevant.

Parameters:
mdInfo   query method.
relevantVars   relevant variables map.
stmtList   statement list
sliceSet   slice set.

Definition at line 656 of file PostProcessOnAnnotation.java.

Referenced by modifyMethod().

void PostProcessOnAnnotation::makeMethodEmpty MethodInfo   methodInfo,
Annotation   annForSm
[inline, private]
 

Insert the method's description here. Creation date: (00-11-14 13:21:07)

Parameters:
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 675 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

boolean PostProcessOnAnnotation::modifyMethod MethodInfo   mdInfo [inline, private]
 

Construct residual method.

Parameters:
mdInfo   method to be constructed.

Definition at line 760 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::relevantExceptionClasses   [inline, private]
 

Insert the method's description here. Creation date: (00-11-10 9:18:31)

Definition at line 928 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::relevantFDClass   [inline, private]
 

Filter out the classes such that there is no method left in the class, but there are some fields are relevant, i.e., accessible by other relvant classes. So those classes are not removable.

Definition at line 949 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::relevantInterfaceAndSuperClasses   [inline, private]
 

Insert the method's description here. Creation date: (00-12-6 15:16:27)

Definition at line 968 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::removeEmptyBlock MethodInfo   mdInfo,
Set   rmedStmtByEmptBlck,
Vector   currentCFANNs,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove all empty block in one method. It's including: removeEmptyLock, removeEmeptyTry, removeEmptyTryFinally, removeEmptyConditionalBlock.

Parameters:
mdInfo   query method.
rmedStmtByEmptBlck   a set of statement removed.
currentCFANNS   a vector of annotations need to be analysed.
stmtList   statement list.

Definition at line 989 of file PostProcessOnAnnotation.java.

Referenced by modifyMethod().

void PostProcessOnAnnotation::removeEmptyConditionalBlock Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList
[inline, private]
 

Remove empty conditional block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1012 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyBlock().

void PostProcessOnAnnotation::removeEmptyLock List   lockPairList,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList
[inline, private]
 

Remove empty lock.

Parameters:
lockPairList   a list of LockPair.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1094 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyBlock().

void PostProcessOnAnnotation::removeEmptyTry Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove empty try block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1136 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyBlock().

void PostProcessOnAnnotation::removeEmptyTryFinally Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove empty try finally block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1179 of file PostProcessOnAnnotation.java.

Referenced by removeEmptyBlock().

void PostProcessOnAnnotation::removeFieldInClinit SootClass   sootClass,
SootField   sootField
[inline, private]
 

Insert the method's description here. Creation date: (00-12-20 13:56:57)

Parameters:
sootClass   ca.mcgill.sable.soot.SootClass
sootField   ca.mcgill.sable.soot.SootField

Definition at line 1227 of file PostProcessOnAnnotation.java.

Referenced by removeIrrelevantFields().

void PostProcessOnAnnotation::removeIrrelevantFields ClassInfo   classInfo [inline, private]
 

Remove irrelevant fileds for a class.

Parameters:
classInfo   query class.

Definition at line 1263 of file PostProcessOnAnnotation.java.

Referenced by rmIrrelevantFds().

void PostProcessOnAnnotation::resClassCons   [inline]
 

Construct residual classes.

Definition at line 1279 of file PostProcessOnAnnotation.java.

Referenced by Slicer::postProcessingOnAnnotation().

void PostProcessOnAnnotation::residualParameters MethodInfo   mdInfo [inline, private]
 

Construct residual parameter for a given method.

Parameters:
mdInfo   query method.

Definition at line 1374 of file PostProcessOnAnnotation.java.

Referenced by rmIrrelevantParasForMd().

void PostProcessOnAnnotation::rmIrrelevantFds   [inline, private]
 

Remove irrelevant fields in every classes.

Definition at line 1425 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::rmIrrelevantParasForInvoke   [inline, private]
 

Remove irrelevant parameters for invoke expression.

Definition at line 1438 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::rmIrrelevantParasForMd   [inline, private]
 

Remove irrelevant parameters for method declaration.

Definition at line 1454 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::rmMethodAndClass Map   removableMdMap [inline, private]
 

Remove methods and classes in terms of given removable method map.

Parameters:
removableMdMap   a map from SootClass to a List of SootMethod.

Definition at line 1479 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().

void PostProcessOnAnnotation::rmParasOfInvokeExpr MethodInfo   mdInfo [inline, private]
 

Remove irrelevant parameters of invoke expressions in a given method.

Parameters:
mdInfo   query method.

Definition at line 1501 of file PostProcessOnAnnotation.java.

Referenced by rmIrrelevantParasForInvoke().

void PostProcessOnAnnotation::rmUnusedLocals   [inline, private]
 

Remove irrelevant parameters for invoke expression.

Definition at line 1558 of file PostProcessOnAnnotation.java.

Referenced by resClassCons().


Member Data Documentation

List PostProcessOnAnnotation::changeReturnTypeToVoidMds = new ArrayList() [private]
 

A list of SootMethod such that return value should be changed to return void due to the irrelevance of return value.

Definition at line 83 of file PostProcessOnAnnotation.java.

List PostProcessOnAnnotation::classList [private]
 

A list of ClassInfo for each class.

Definition at line 73 of file PostProcessOnAnnotation.java.

Set PostProcessOnAnnotation::relevantFields = new ArraySet() [private]
 

A set of Value which is relevant in the residual program.

Definition at line 88 of file PostProcessOnAnnotation.java.

Set PostProcessOnAnnotation::removableSootClasses = new ArraySet() [private]
 

A list of ClassInfo which is sliced away.

Definition at line 77 of file PostProcessOnAnnotation.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:20:42 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001