Example #1
0
 @Override
 public void merge(TypeData t) {
   try {
     if (!t.isNullType()) {
       element.merge(ArrayElement.make(t));
     }
   } catch (org.hotswap.agent.javassist.bytecode.BadBytecode e) {
     // never happens
     throw new RuntimeException("fatal: " + e);
   }
 }
Example #2
0
 protected ReferenceVariable arrayElementOfImpl(ReferenceVariable base) {
   VarNode l;
   if (base instanceof VarNode) {
     l = (VarNode) base;
   } else {
     FieldRefNode b = (FieldRefNode) base;
     l = pag.makeGlobalVarNode(b, b.getType());
     pag.addEdge(b, l);
   }
   return pag.makeFieldRefNode(l, ArrayElement.v());
 }
Example #3
0
  public static void aastore(
      TypeData array, TypeData value, org.hotswap.agent.javassist.ClassPool cp)
      throws org.hotswap.agent.javassist.bytecode.BadBytecode {
    if (array instanceof AbsTypeVar) {
      if (!value.isNullType()) {
        ((AbsTypeVar) array).merge(ArrayType.make(value));
      }
    }

    if (value instanceof AbsTypeVar) {
      if (array instanceof AbsTypeVar) {
        ArrayElement.make(array); // should call value.setType() later.
      } else if (array instanceof ClassName) {
        if (!array.isNullType()) {
          String type = ArrayElement.typeName(array.getName());
          value.setType(type, cp);
        }
      } else {
        throw new org.hotswap.agent.javassist.bytecode.BadBytecode("bad AASTORE: " + array);
      }
    }
  }
Example #4
0
 @Override
 public void setType(String s, org.hotswap.agent.javassist.ClassPool cp)
     throws org.hotswap.agent.javassist.bytecode.BadBytecode {
   element.setType(ArrayElement.typeName(s), cp);
 }