From 7d1cf169b8ba0b4b74ccb660af86f3bee9cec7de Mon Sep 17 00:00:00 2001 From: Stephen Carlin Date: Mon, 9 Dec 2019 17:09:03 -0600 Subject: [PATCH] Remove deprecated reflection code for modifers --- build.gradle | 4 ++++ gradle.properties | 4 ++-- .../pl/pojo/tester/internal/utils/FieldUtils.java | 12 +----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index c0d59eeb..331fe89c 100644 --- a/build.gradle +++ b/build.gradle @@ -224,6 +224,10 @@ javadoc { jar { manifest.attributes(createManifestAttributes()) + + from { + configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } + } } def createManifestAttributes() { diff --git a/gradle.properties b/gradle.properties index b1b401b4..983ab834 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ group=pl.pojo artifact=pojo-tester -version=0.8.0-SNAPSHOT -sourceCompatibility=1.8 +version=0.8.2 +sourceCompatibility=13 diff --git a/src/main/java/pl/pojo/tester/internal/utils/FieldUtils.java b/src/main/java/pl/pojo/tester/internal/utils/FieldUtils.java index f2b291ba..1bd6fb47 100644 --- a/src/main/java/pl/pojo/tester/internal/utils/FieldUtils.java +++ b/src/main/java/pl/pojo/tester/internal/utils/FieldUtils.java @@ -84,17 +84,7 @@ public static List getSpecifiedFields(final Class clazz, final List clazz = field.getClass(); - try { - field.setAccessible(true); - final Field modifierField = clazz.getDeclaredField(MODIFIERS_FIELD_NAME_IN_FIELD_CLASS); - modifierField.setAccessible(true); - - final int modifiers = field.getModifiers() & ~Modifier.FINAL; - modifierField.setInt(field, modifiers); - } catch (IllegalAccessException | NoSuchFieldException e) { - throw new GetOrSetValueException(MODIFIERS_FIELD_NAME_IN_FIELD_CLASS, clazz, e); - } + field.setAccessible(true); } private static boolean excludeEmptySet(final List fields) {