Exemple #1
0
  public Field getDeclaredField(String name) throws NoSuchFieldException, SecurityException {
    checkMemberAccess(Member.DECLARED);
    if (!type.isClassType() || name == null) throwNoSuchFieldException(name);

    Atom aName = Atom.findOrCreateUnicodeAtom(name);
    RVMField answer = type.asClass().findDeclaredField(aName);
    if (answer == null) {
      throwNoSuchFieldException(name);
    }
    return JikesRVMSupport.createField(answer);
  }
Exemple #2
0
  public Field getField(String name) throws NoSuchFieldException, SecurityException {
    checkMemberAccess(Member.PUBLIC);
    if (!type.isClassType()) throw new NoSuchFieldException();

    Atom aName = Atom.findUnicodeAtom(name);
    if (aName == null) throwNoSuchFieldException(name);

    RVMField answer = getFieldInternal(aName);

    if (answer == null) {
      throwNoSuchFieldException(name);
    }
    return JikesRVMSupport.createField(answer);
  }