Skip to content

Commit c97b81c

Browse files
committed
Java 13 support
1 parent 58c2dab commit c97b81c

File tree

8 files changed

+95
-106
lines changed

8 files changed

+95
-106
lines changed

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
ext {
2323
JUNIT_JUPITER_VERSION = "5.0.2"
2424
JUNIT_PLATFORM_VERSION = "1.0.2"
25-
MOCKITO_VERSION = "2.12.0"
25+
MOCKITO_VERSION = "3.2.4"
2626
POWER_MOCK_UTILS_VERSION = "1.6.6"
2727
ASSERTJ_CORE_VERSION = "3.8.0"
2828
JACOCO_VERSION = "0.7.9"
@@ -83,12 +83,12 @@ junitPlatform {
8383

8484
dependencies {
8585
compile("org.slf4j:slf4j-api:1.7.25")
86-
compile("org.apache.commons:commons-lang3:3.7")
86+
compile("org.apache.commons:commons-lang3:3.9")
8787
compile("org.apache.commons:commons-collections4:4.1")
8888
compile("com.googlecode.combinatoricslib:combinatoricslib:2.1")
89-
compile("org.javassist:javassist:3.22.0-GA")
89+
compile("org.javassist:javassist:3.26.0-GA")
9090

91-
testCompile("org.projectlombok:lombok:1.16.18")
91+
testCompile("org.projectlombok:lombok:1.18.10")
9292
testCompile("org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}") { changing = true }
9393
testRuntime("org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}") { changing = true }
9494
testCompile("org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_VERSION}") { changing = true }

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
group=pl.pojo
22
artifact=pojo-tester
33
version=0.8.0-SNAPSHOT
4-
sourceCompatibility=1.8
4+
sourceCompatibility=13

gradle/wrapper/gradle-wrapper.jar

205 Bytes
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Dec 17 10:43:20 CET 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

gradlew

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}

gradlew.bat

+84-84
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
@if "%DEBUG%" == "" @echo off
2-
@rem ##########################################################################
3-
@rem
4-
@rem Gradle startup script for Windows
5-
@rem
6-
@rem ##########################################################################
7-
8-
@rem Set local scope for the variables with windows NT shell
9-
if "%OS%"=="Windows_NT" setlocal
10-
11-
set DIRNAME=%~dp0
12-
if "%DIRNAME%" == "" set DIRNAME=.
13-
set APP_BASE_NAME=%~n0
14-
set APP_HOME=%DIRNAME%
15-
16-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
18-
19-
@rem Find java.exe
20-
if defined JAVA_HOME goto findJavaFromJavaHome
21-
22-
set JAVA_EXE=java.exe
23-
%JAVA_EXE% -version >NUL 2>&1
24-
if "%ERRORLEVEL%" == "0" goto init
25-
26-
echo.
27-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28-
echo.
29-
echo Please set the JAVA_HOME variable in your environment to match the
30-
echo location of your Java installation.
31-
32-
goto fail
33-
34-
:findJavaFromJavaHome
35-
set JAVA_HOME=%JAVA_HOME:"=%
36-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37-
38-
if exist "%JAVA_EXE%" goto init
39-
40-
echo.
41-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42-
echo.
43-
echo Please set the JAVA_HOME variable in your environment to match the
44-
echo location of your Java installation.
45-
46-
goto fail
47-
48-
:init
49-
@rem Get command-line arguments, handling Windows variants
50-
51-
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
53-
:win9xME_args
54-
@rem Slurp the command line arguments.
55-
set CMD_LINE_ARGS=
56-
set _SKIP=2
57-
58-
:win9xME_args_slurp
59-
if "x%~1" == "x" goto execute
60-
61-
set CMD_LINE_ARGS=%*
62-
63-
:execute
64-
@rem Setup the command line
65-
66-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67-
68-
@rem Execute Gradle
69-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70-
71-
:end
72-
@rem End local scope for the variables with windows NT shell
73-
if "%ERRORLEVEL%"=="0" goto mainEnd
74-
75-
:fail
76-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77-
rem the _cmd.exe /c_ return code!
78-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79-
exit /b 1
80-
81-
:mainEnd
82-
if "%OS%"=="Windows_NT" endlocal
83-
84-
:omega
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
53+
:win9xME_args
54+
@rem Slurp the command line arguments.
55+
set CMD_LINE_ARGS=
56+
set _SKIP=2
57+
58+
:win9xME_args_slurp
59+
if "x%~1" == "x" goto execute
60+
61+
set CMD_LINE_ARGS=%*
62+
63+
:execute
64+
@rem Setup the command line
65+
66+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67+
68+
@rem Execute Gradle
69+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70+
71+
:end
72+
@rem End local scope for the variables with windows NT shell
73+
if "%ERRORLEVEL%"=="0" goto mainEnd
74+
75+
:fail
76+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77+
rem the _cmd.exe /c_ return code!
78+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79+
exit /b 1
80+
81+
:mainEnd
82+
if "%OS%"=="Windows_NT" endlocal
83+
84+
:omega

src/main/java/pl/pojo/tester/internal/utils/FieldUtils.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,7 @@ public static List<Field> getSpecifiedFields(final Class<?> clazz, final List<St
8484
}
8585

8686
private static void makeModifiable(final Field field) {
87-
final Class<? extends Field> clazz = field.getClass();
88-
try {
89-
field.setAccessible(true);
90-
final Field modifierField = clazz.getDeclaredField(MODIFIERS_FIELD_NAME_IN_FIELD_CLASS);
91-
modifierField.setAccessible(true);
92-
93-
final int modifiers = field.getModifiers() & ~Modifier.FINAL;
94-
modifierField.setInt(field, modifiers);
95-
} catch (IllegalAccessException | NoSuchFieldException e) {
96-
throw new GetOrSetValueException(MODIFIERS_FIELD_NAME_IN_FIELD_CLASS, clazz, e);
97-
}
87+
field.setAccessible(true);
9888
}
9989

10090
private static boolean excludeEmptySet(final List<Field> fields) {

src/test/java/pl/pojo/tester/internal/field/primitive/AbstractPrimitiveValueChangerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AbstractPrimitiveValueChangerTest {
1313
@Test
1414
void Should_Return_False_When_Field_Is_Not_Primitive() throws Exception {
1515
// given
16-
final Field field = Thread.class.getDeclaredField("threadQ");
16+
final Field field = Thread.class.getDeclaredField("name");
1717
final AbstractPrimitiveValueChanger<Object> changerMock = new ImplementationForTest();
1818

1919
// when

0 commit comments

Comments
 (0)