Skip to content

Commit

Permalink
Added some logging to JqwikReflectionSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Nov 8, 2023
1 parent d6b0df9 commit 1847fc1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import java.nio.file.*;
import java.util.*;
import java.util.function.*;
import java.util.logging.*;
import java.util.stream.*;

import org.junit.platform.commons.support.*;

import net.jqwik.api.*;
import net.jqwik.api.providers.*;
import net.jqwik.api.support.*;
import net.jqwik.engine.properties.shrinking.*;
import net.jqwik.engine.support.types.*;

import static java.util.stream.Collectors.*;
Expand All @@ -21,6 +23,8 @@

public class JqwikReflectionSupport {

private static final Logger LOG = Logger.getLogger(JqwikReflectionSupport.class.getName());

public static Stream<Object> streamInstancesFromInside(Object inner) {
return addInstances(inner, new ArrayList<>()).stream();
}
Expand Down Expand Up @@ -50,6 +54,9 @@ private static Optional<Object> getOuterInstance(Object inner) {
try {
return makeAccessible(field).get(inner);
} catch (SecurityException | IllegalArgumentException | IllegalAccessException ex) {
String message = String.format("Could not access outer instance of %s." +
"%nReason: %s", inner, ex);
LOG.warning(message);
return Optional.empty();
}
});
Expand Down

0 comments on commit 1847fc1

Please sign in to comment.