Skip to content

Commit

Permalink
add missing final
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima committed Apr 18, 2024
1 parent a8c7f88 commit 1fdce39
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public SpecConfig build() {
return configBuilder.build();
}

public SpecConfig build(Consumer<SpecConfigBuilder> modifier) {
public SpecConfig build(final Consumer<SpecConfigBuilder> modifier) {
modifier.accept(configBuilder);
return build();
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public Map<String, String> readValues(final InputStream source) throws IOExcepti
}
}

private Stream<Method> streamConfigSetters(Class<?> builderClass) {
private Stream<Method> streamConfigSetters(final Class<?> builderClass) {
// Ignore any setters that aren't for individual config entries
final Set<String> ignoredSetters = Set.of("rawConfig");

Expand Down Expand Up @@ -325,7 +325,7 @@ private <T> Function<Object, T> fromString(final Function<String, T> function) {
}

private interface BuilderSupplier<TBuilder> {
static <T> BuilderSupplier<T> fromBuilder(T builder) {
static <T> BuilderSupplier<T> fromBuilder(final T builder) {
return (consumer) -> consumer.accept(builder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public VoteTracker(final Bytes32 currentRoot, final Bytes32 nextRoot, final UInt
}

public VoteTracker(
Bytes32 currentRoot,
Bytes32 nextRoot,
UInt64 nextEpoch,
boolean nextEquivocating,
boolean currentEquivocating) {
final Bytes32 currentRoot,
final Bytes32 nextRoot,
final UInt64 nextEpoch,
final boolean nextEquivocating,
final boolean currentEquivocating) {
this.currentRoot = currentRoot;
this.nextRoot = nextRoot;
this.nextEpoch = nextEpoch;
Expand Down Expand Up @@ -75,7 +75,7 @@ public VoteTracker createNextEquivocating() {
}

@Override
public boolean equals(Object o) {
public boolean equals(final Object o) {
if (this == o) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ public class ObjectAndMetaDataBuilder<T> {
private boolean canonical;
private boolean finalized;

public ObjectAndMetaDataBuilder<T> data(T data) {
public ObjectAndMetaDataBuilder<T> data(final T data) {
this.data = data;
return this;
}

public ObjectAndMetaDataBuilder<T> milestone(SpecMilestone milestone) {
public ObjectAndMetaDataBuilder<T> milestone(final SpecMilestone milestone) {
this.milestone = milestone;
return this;
}

public ObjectAndMetaDataBuilder<T> executionOptimistic(boolean executionOptimistic) {
public ObjectAndMetaDataBuilder<T> executionOptimistic(final boolean executionOptimistic) {
this.executionOptimistic = executionOptimistic;
return this;
}

public ObjectAndMetaDataBuilder<T> canonical(boolean canonical) {
public ObjectAndMetaDataBuilder<T> canonical(final boolean canonical) {
this.canonical = canonical;
return this;
}

public ObjectAndMetaDataBuilder<T> finalized(boolean finalized) {
public ObjectAndMetaDataBuilder<T> finalized(final boolean finalized) {
this.finalized = finalized;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BeaconPreparableProposer {
private final UInt64 validatorIndex;
private final Eth1Address feeRecipient;

public BeaconPreparableProposer(UInt64 validatorIndex, Eth1Address feeRecipient) {
public BeaconPreparableProposer(final UInt64 validatorIndex, final Eth1Address feeRecipient) {
this.validatorIndex = validatorIndex;
this.feeRecipient = feeRecipient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
class MutableBeaconStateAltairImpl extends AbstractMutableBeaconState<BeaconStateAltairImpl>
implements MutableBeaconStateAltair, BeaconStateCache, ValidatorStatsAltair {

MutableBeaconStateAltairImpl(BeaconStateAltairImpl backingImmutableView) {
MutableBeaconStateAltairImpl(final BeaconStateAltairImpl backingImmutableView) {
super(backingImmutableView);
}

MutableBeaconStateAltairImpl(BeaconStateAltairImpl backingImmutableView, boolean builder) {
MutableBeaconStateAltairImpl(
final BeaconStateAltairImpl backingImmutableView, final boolean builder) {
super(backingImmutableView, builder);
}

Expand All @@ -40,10 +41,10 @@ public BeaconStateSchemaAltair getBeaconStateSchema() {

@Override
protected BeaconStateAltairImpl createImmutableBeaconState(
TreeNode backingNode,
IntCache<SszData> viewCache,
TransitionCaches transitionCaches,
SlotCaches slotCaches) {
final TreeNode backingNode,
final IntCache<SszData> viewCache,
final TransitionCaches transitionCaches,
final SlotCaches slotCaches) {
return new BeaconStateAltairImpl(
getSchema(), backingNode, viewCache, transitionCaches, slotCaches);
}
Expand All @@ -54,7 +55,7 @@ public BeaconStateAltair commitChanges() {
}

@Override
protected void addCustomFields(ToStringHelper stringBuilder) {
protected void addCustomFields(final ToStringHelper stringBuilder) {
BeaconStateAltairImpl.describeCustomFields(stringBuilder, this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
class MutableBeaconStateBellatrixImpl extends AbstractMutableBeaconState<BeaconStateBellatrixImpl>
implements MutableBeaconStateBellatrix, BeaconStateCache, ValidatorStatsAltair {

MutableBeaconStateBellatrixImpl(BeaconStateBellatrixImpl backingImmutableView) {
MutableBeaconStateBellatrixImpl(final BeaconStateBellatrixImpl backingImmutableView) {
super(backingImmutableView);
}

MutableBeaconStateBellatrixImpl(BeaconStateBellatrixImpl backingImmutableView, boolean builder) {
MutableBeaconStateBellatrixImpl(
final BeaconStateBellatrixImpl backingImmutableView, final boolean builder) {
super(backingImmutableView, builder);
}

Expand All @@ -43,10 +44,10 @@ public BeaconStateSchemaBellatrix getBeaconStateSchema() {

@Override
protected BeaconStateBellatrixImpl createImmutableBeaconState(
TreeNode backingNode,
IntCache<SszData> viewCache,
TransitionCaches transitionCaches,
SlotCaches slotCaches) {
final TreeNode backingNode,
final IntCache<SszData> viewCache,
final TransitionCaches transitionCaches,
final SlotCaches slotCaches) {
return new BeaconStateBellatrixImpl(
getSchema(), backingNode, viewCache, transitionCaches, slotCaches);
}
Expand All @@ -58,12 +59,12 @@ public BeaconStateBellatrix commitChanges() {

@Override
public <E1 extends Exception, E2 extends Exception, E3 extends Exception> BeaconState updated(
Mutator<MutableBeaconState, E1, E2, E3> mutator) {
final Mutator<MutableBeaconState, E1, E2, E3> mutator) {
throw new UnsupportedOperationException();
}

@Override
protected void addCustomFields(ToStringHelper stringBuilder) {
protected void addCustomFields(final ToStringHelper stringBuilder) {
BeaconStateBellatrix.describeCustomBellatrixFields(stringBuilder, this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public class MutableBeaconStateCapellaImpl
extends AbstractMutableBeaconState<BeaconStateCapellaImpl>
implements MutableBeaconStateCapella, BeaconStateCache, ValidatorStatsAltair {

MutableBeaconStateCapellaImpl(BeaconStateCapellaImpl backingImmutableView) {
MutableBeaconStateCapellaImpl(final BeaconStateCapellaImpl backingImmutableView) {
super(backingImmutableView);
}

MutableBeaconStateCapellaImpl(BeaconStateCapellaImpl backingImmutableView, boolean builder) {
MutableBeaconStateCapellaImpl(
final BeaconStateCapellaImpl backingImmutableView, final boolean builder) {
super(backingImmutableView, builder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ private static class Job {
final Bytes message;
final BLSSignature signature;

public Job(int idx, List<BLSPublicKey> publicKeys, Bytes message, BLSSignature signature) {
public Job(
final int idx,
final List<BLSPublicKey> publicKeys,
final Bytes message,
final BLSSignature signature) {
this.idx = idx;
this.publicKeys = publicKeys;
this.message = message;
Expand All @@ -56,7 +60,7 @@ public Job(int idx, List<BLSPublicKey> publicKeys, Bytes message, BLSSignature s

@Override
public synchronized boolean verify(
List<BLSPublicKey> publicKeys, Bytes message, BLSSignature signature) {
final List<BLSPublicKey> publicKeys, final Bytes message, final BLSSignature signature) {
if (complete) {
throw new IllegalStateException("Reuse of disposable instance");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ boolean writeSigningRecord(
return true;
}

Optional<ValidatorSigningRecord> maySignBlock(Bytes32 genesisValidatorsRoot, UInt64 slot) {
Optional<ValidatorSigningRecord> maySignBlock(
final Bytes32 genesisValidatorsRoot, final UInt64 slot) {
return signingRecord.maySignBlock(genesisValidatorsRoot, slot);
}

Optional<ValidatorSigningRecord> maySignAttestation(
Bytes32 genesisValidatorsRoot, UInt64 sourceEpoch, UInt64 targetEpoch) {
final Bytes32 genesisValidatorsRoot, final UInt64 sourceEpoch, final UInt64 targetEpoch) {
return signingRecord.maySignAttestation(genesisValidatorsRoot, sourceEpoch, targetEpoch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SafeFuture<Boolean> maySignAttestation(
}

@Override
public Optional<ValidatorSigningRecord> getSigningRecord(BLSPublicKey validator) {
public Optional<ValidatorSigningRecord> getSigningRecord(final BLSPublicKey validator) {
return Optional.empty();
}
}

0 comments on commit 1fdce39

Please sign in to comment.