Class DeInliningFinalFields

  • All Implemented Interfaces:
    Analysis

    public class DeInliningFinalFields
    extends DepthFirstAdapter
    Both static and non-static BUT FINAL fields if initialized with constants get inlined A final initialized with an object (even if its a string) is NOT inlined e.g. public static final String temp = "hello"; //use of temp will get inlined public static final String temp1 = new String("hello"); //use of temp will NOT get inlined If its a static field we can get the info from a tag in the case of a non static we cant decide since the field is initialized inside a constructor and depending on different constructors there coul dbe different values...conservative.... Need to be very clear when a SootField can be used It can be used in the following places: a, NOT used inside a Synchronized Block ........ HOWEVER ADD IT SINCE I DONT SEE WHY THIS RESTRICTION EXISTS!!! TICK b, CAN BE USED in a condition TICK c, CAN BE USED in the for init for update TICK d, CAN BE USED in a switch TICK e, CAN BE USED in a stmt TICK These are the exact places to look for constants...a constant is StringConstant DoubleConstant FloatConstant IntConstant (shortype, booltype, charType intType, byteType LongConstant