Skip to content

Commit

Permalink
Removes unnecessary complication
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Nov 22, 2024
1 parent b362d72 commit 3068d40
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.jqno.equalsverifier.internal.reflection.vintage.prefabvalues.factories;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
import nl.jqno.equalsverifier.internal.reflection.*;
import nl.jqno.equalsverifier.internal.reflection.Tuple;
import nl.jqno.equalsverifier.internal.reflection.TypeTag;
import nl.jqno.equalsverifier.internal.reflection.instantiation.ValueProvider.Attributes;
import nl.jqno.equalsverifier.internal.reflection.instantiation.VintageValueProvider;
import nl.jqno.equalsverifier.internal.reflection.vintage.ClassAccessor;
Expand Down Expand Up @@ -38,7 +38,6 @@ public Tuple<T> createValues(
return giveArrayInstances(tag, valueProvider, clone);
}

traverseFields(tag, valueProvider, clone);
return giveInstances(tag, valueProvider, clone);
}

Expand Down Expand Up @@ -77,21 +76,6 @@ private Tuple<T> giveArrayInstances(
return new Tuple<>(red, blue, redCopy);
}

private void traverseFields(
TypeTag tag,
VintageValueProvider valueProvider,
Attributes attributes
) {
Class<?> type = tag.getType();
for (Field field : FieldIterable.of(type)) {
FieldProbe probe = FieldProbe.of(field);
boolean isStaticAndFinal = probe.isStatic() && probe.isFinal();
if (!isStaticAndFinal) {
valueProvider.realizeCacheFor(TypeTag.of(field, tag), attributes);
}
}
}

private Tuple<T> giveInstances(
TypeTag tag,
VintageValueProvider valueProvider,
Expand Down

0 comments on commit 3068d40

Please sign in to comment.