Skip to content

Commit

Permalink
Removes unnecessary complication
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Dec 4, 2024
1 parent c296bb9 commit 642e904
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package nl.jqno.equalsverifier.internal.reflection.vintage.prefabvalues.factories;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.LinkedHashSet;
import nl.jqno.equalsverifier.internal.reflection.FieldIterable;
import nl.jqno.equalsverifier.internal.reflection.FieldProbe;
import nl.jqno.equalsverifier.internal.reflection.Tuple;
import nl.jqno.equalsverifier.internal.reflection.TypeTag;
import nl.jqno.equalsverifier.internal.reflection.instantiation.VintageValueProvider;
Expand Down Expand Up @@ -43,7 +40,6 @@ public Tuple<T> createValues(
return giveArrayInstances(tag, valueProvider, clone);
}

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

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

private void traverseFields(
TypeTag tag,
VintageValueProvider valueProvider,
LinkedHashSet<TypeTag> typeStack
) {
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), typeStack);
}
}
}

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

0 comments on commit 642e904

Please sign in to comment.