コード例 #1
0
 public void fieldsAccept(MemberVisitor memberVisitor) {
   for (int index = 0; index < fields.length; index++) {
     Field field = fields[index];
     if (field != null) {
       field.accept(this, memberVisitor);
     }
   }
 }
コード例 #2
0
  public FieldOptimizationInfo(Clazz clazz, Field field) {
    int accessFlags = field.getAccessFlags();

    isWritten = isRead = (accessFlags & ClassConstants.INTERNAL_ACC_VOLATILE) != 0;

    if ((accessFlags & ClassConstants.INTERNAL_ACC_STATIC) != 0) {
      // See if we can initialize the static field with a constant value.
      field.accept(clazz, new AllAttributeVisitor(this));
    }

    if ((accessFlags & ClassConstants.INTERNAL_ACC_FINAL) == 0 && value == null) {
      // Otherwise initialize the non-final field with the default value.
      value = initialValue(field.getDescriptor(clazz));
    }
  }
コード例 #3
0
 public void fieldAccept(String name, String descriptor, MemberVisitor memberVisitor) {
   Field field = findField(name, descriptor);
   if (field != null) {
     field.accept(this, memberVisitor);
   }
 }