Skip to content

Commit

Permalink
Add missing method implementations to BufferedFieldBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfaff committed Aug 11, 2024
1 parent bffd6d4 commit 9e34ff4
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*/
package jdk.internal.classfile.impl;

import jdk.internal.vm.annotation.Stable;

import java.lang.constant.ClassDesc;
import java.lang.reflect.AccessFlag;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -42,6 +45,8 @@ public final class BufferedFieldBuilder
private final Utf8Entry desc;
private final List<FieldElement> elements = new ArrayList<>();
private AccessFlags flags;
@Stable
private ClassDesc fDesc;

public BufferedFieldBuilder(SplitConstantPool constantPool,
ClassFileImpl context,
Expand All @@ -54,6 +59,24 @@ public BufferedFieldBuilder(SplitConstantPool constantPool,
this.flags = new AccessFlagsImpl(AccessFlag.Location.FIELD);
}

@Override
public Utf8Entry fieldName() {
return name;
}

@Override
public Utf8Entry fieldType() {
return desc;
}

@Override
public ClassDesc fieldTypeSymbol() {
if (fDesc == null) {
fDesc = ClassDesc.ofDescriptor(desc.stringValue());
}
return fDesc;
}

@Override
public ConstantPoolBuilder constantPool() {
return constantPool;
Expand Down

0 comments on commit 9e34ff4

Please sign in to comment.