Skip to content

Commit

Permalink
Remove security manager support. This should not be needed as this is…
Browse files Browse the repository at this point in the history
… a client side only utility.

Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Jul 3, 2024
1 parent 67da7f7 commit 5f69271
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -105,22 +103,20 @@ private static boolean isDockerAvailable() {
}

private static List<Field> getFieldsWithAnnotation(final Class<?> source) {
return AccessController.doPrivileged((PrivilegedAction<List<Field>>) () -> {
final List<Field> foundFields = new ArrayList<>();
Class<?> nextSource = source;
while (nextSource != Object.class) {
for (Field field : nextSource.getDeclaredFields()) {
if (field.isAnnotationPresent(Testcontainer.class)) {
if (!field.trySetAccessible()) {
throw new IllegalStateException(String.format("Could not make field %s accessible", field));
}
foundFields.add(field);
final List<Field> foundFields = new ArrayList<>();
Class<?> nextSource = source;
while (nextSource != Object.class) {
for (Field field : nextSource.getDeclaredFields()) {
if (field.isAnnotationPresent(Testcontainer.class)) {
if (!field.trySetAccessible()) {
throw new IllegalStateException(String.format("Could not make field %s accessible", field));
}
foundFields.add(field);
}
nextSource = nextSource.getSuperclass();
}
return List.copyOf(foundFields);
});
nextSource = nextSource.getSuperclass();
}
return List.copyOf(foundFields);
}

private static boolean isAnnotatedWith(final Class<?> clazz, final Class<? extends Annotation> annotation) {
Expand Down

0 comments on commit 5f69271

Please sign in to comment.