コード例 #1
0
ファイル: ObjectRef.java プロジェクト: pombredanne/Harpoon-1
 /**
  * create a new objectref with default field values.
  *
  * @exception InterpretedThrowable if class initializer throws an exception.
  */
 ObjectRef(StaticState ss, HClass type) {
   super(ss, type);
   this.fields = null;
   this.closure = null;
   // Initialize our fields.
   for (HClass sc = type; sc != null; sc = sc.getSuperclass()) {
     HField[] fl = sc.getDeclaredFields();
     for (int i = 0; i < fl.length; i++) if (!fl[i].isStatic()) update(fl[i], defaultValue(fl[i]));
   }
   // yay, done.
 }
コード例 #2
0
ファイル: HClassInfo.java プロジェクト: pombredanne/Harpoon-1
  private void extend(HClass hc) {
    HField[] hFields = hc.getDeclaredFields();
    for (int i = 0; i < hFields.length; i++) {
      if (hFields[i].isStatic())
        m_currentStaticFieldOffset = m_memberMap.map(hFields[i], m_currentStaticFieldOffset);
      else m_currentFieldOffset = m_memberMap.map(hFields[i], m_currentFieldOffset);
    }

    HMethod[] hMethods = hc.getDeclaredMethods();
    for (int i = 0; i < hMethods.length; i++) {
      m_currentMethodOffset = m_memberMap.map(hMethods[i], m_currentMethodOffset);
    }
  }