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
  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);
      }
    }
  }