SandMark version 3.0


sandmark.watermark.ct.embed
Class AddParameters

java.lang.Object
  |
  +--sandmark.watermark.ct.embed.AddParameters

public class AddParameters
extends java.lang.Object

Adds extra formal arguments to selected method signatures and calls.


Field Summary
(package private)  ClassFileCollection cfc
           
(package private)  java.util.HashSet changeSet
          Compute the set of methods that will need to change.
(package private)  MethodID[] methods
           
(package private)  java.util.HashSet methodSet
           
(package private)  java.util.Properties props
           
(package private)  java.lang.String[][] storageCreators
           
(package private)  java.lang.String watermarkClassName
           
 
Constructor Summary
AddParameters(ClassFileCollection cfc, java.util.Properties props, java.lang.String[][] storageCreators, MethodID[] methods)
           
 
Method Summary
(package private)  void add()
          This is the main entry point to this class.
(package private)  boolean addStorageActuals(EditedClass ec, de.fub.bytecode.generic.MethodGen mg)
           
(package private)  boolean addStorageFormal(EditedClass ec, de.fub.bytecode.generic.MethodGen mg, java.lang.String name, java.lang.String type)
          Add formal 'name' of type 'type' to method eg in class ec.
(package private)  boolean addStorageFormals(EditedClass ec, de.fub.bytecode.generic.MethodGen mg)
           
(package private)  boolean callShouldChange(EditedClass ec, de.fub.bytecode.generic.InvokeInstruction call)
          Return true if the call instruction in the class ec will need to be modified.
(package private)  void computeMethodsToChange()
           
(package private)  boolean editCall(EditedClass ec, de.fub.bytecode.generic.MethodGen mg, de.fub.bytecode.generic.InstructionList il, de.fub.bytecode.generic.InstructionHandle ih, de.fub.bytecode.generic.InvokeInstruction call)
           
(package private)  de.fub.bytecode.generic.InvokeInstruction fixMethodSignature(EditedClass ec, de.fub.bytecode.generic.InvokeInstruction call, java.lang.String type)
           
static void main(java.lang.String[] args)
           
(package private)  boolean signatureShouldChange(EditedClass ec, de.fub.bytecode.generic.MethodGen mg)
          Return true if the signature of the method mg in the class ec will need to be modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

java.util.Properties props

cfc

ClassFileCollection cfc

storageCreators

java.lang.String[][] storageCreators

methods

MethodID[] methods

methodSet

java.util.HashSet methodSet

watermarkClassName

java.lang.String watermarkClassName

changeSet

java.util.HashSet changeSet
Compute the set of methods that will need to change.

Constructor Detail

AddParameters

public AddParameters(ClassFileCollection cfc,
                     java.util.Properties props,
                     java.lang.String[][] storageCreators,
                     MethodID[] methods)
Method Detail

computeMethodsToChange

void computeMethodsToChange()

callShouldChange

boolean callShouldChange(EditedClass ec,
                         de.fub.bytecode.generic.InvokeInstruction call)
Return true if the call instruction in the class ec will need to be modified.

Parameters:
ec - a class that is being edited
call - a call instruction

signatureShouldChange

boolean signatureShouldChange(EditedClass ec,
                              de.fub.bytecode.generic.MethodGen mg)
Return true if the signature of the method mg in the class ec will need to be modified.

Parameters:
ec - a class that is being edited
mg - a method

add

void add()
   throws java.io.IOException
This is the main entry point to this class. For every class do
  1. add extra formal parameters to the methods in 'methods'.
  2. add extra actual arguments to any calls to methods in methods.

java.io.IOException

addStorageFormals

boolean addStorageFormals(EditedClass ec,
                          de.fub.bytecode.generic.MethodGen mg)
                    throws java.io.IOException
java.io.IOException

addStorageFormal

boolean addStorageFormal(EditedClass ec,
                         de.fub.bytecode.generic.MethodGen mg,
                         java.lang.String name,
                         java.lang.String type)
Add formal 'name' of type 'type' to method eg in class ec.

Parameters:
ec - a class that is being edited
mg - a method being modified
name - name of the formal to add
type - type of the formal to add

addStorageActuals

boolean addStorageActuals(EditedClass ec,
                          de.fub.bytecode.generic.MethodGen mg)

editCall

boolean editCall(EditedClass ec,
                 de.fub.bytecode.generic.MethodGen mg,
                 de.fub.bytecode.generic.InstructionList il,
                 de.fub.bytecode.generic.InstructionHandle ih,
                 de.fub.bytecode.generic.InvokeInstruction call)

fixMethodSignature

de.fub.bytecode.generic.InvokeInstruction fixMethodSignature(EditedClass ec,
                                                             de.fub.bytecode.generic.InvokeInstruction call,
                                                             java.lang.String type)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
java.io.IOException

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003