Skip to content

Commit a96cf14

Browse files
committed
add support for java17
1 parent faae4f1 commit a96cf14

File tree

3 files changed

+41
-13
lines changed

3 files changed

+41
-13
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
java:
1616
- '8'
1717
- '11'
18-
#- '17'
18+
- '17'
19+
# - '21'
1920
name: Java ${{ matrix.Java }} sample
2021
steps:
2122
- uses: actions/checkout@v2

pom.xml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
<artifactId>maven-surefire-plugin</artifactId>
6262
<version>2.22.2</version>
6363
<configuration>
64-
<!-- <parallel>all</parallel> &lt;!&ndash; Run tests in parallel&ndash;&gt;-->
65-
<!-- <useUnlimitedThreads>true</useUnlimitedThreads>-->
6664
<rerunFailingTestsCount>10</rerunFailingTestsCount>
6765
<argLine>-Xms1g -Xmx1g</argLine>
6866
</configuration>
@@ -107,6 +105,43 @@
107105
</plugins>
108106
</reporting>
109107

108+
<profiles>
109+
<profile>
110+
<id>java-12-plus-reflection</id>
111+
<activation>
112+
<jdk>[12,)</jdk>
113+
</activation>
114+
<build>
115+
<plugins>
116+
<plugin>
117+
<groupId>org.apache.maven.plugins</groupId>
118+
<artifactId>maven-surefire-plugin</artifactId>
119+
<configuration>
120+
<argLine> --add-opens java.base/java.nio=ALL-UNNAMED </argLine>
121+
</configuration>
122+
</plugin>
123+
124+
<plugin>
125+
<groupId>org.codehaus.mojo</groupId>
126+
<artifactId>exec-maven-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<id>run-benchmarks</id>
130+
<configuration>
131+
<arguments>
132+
<argument>--add-opens=java.base/java.nio=ALL-UNNAMED</argument>
133+
<argument>-classpath</argument>
134+
<classpath/>
135+
<argument>org.openjdk.jmh.Main</argument>
136+
</arguments>
137+
</configuration>
138+
</execution>
139+
</executions>
140+
</plugin>
141+
</plugins>
142+
</build>
143+
</profile>
144+
</profiles>
110145
<dependencies>
111146
<dependency>
112147
<groupId>no.fiken.oss.junixsocket</groupId>
@@ -119,45 +154,39 @@
119154
<version>1.0.2</version>
120155
</dependency>
121156

122-
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
123157
<dependency>
124158
<groupId>net.java.dev.jna</groupId>
125159
<artifactId>jna</artifactId>
126160
<version>5.12.1</version>
127161
</dependency>
128162

129-
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna-platform -->
130163
<dependency>
131164
<groupId>net.java.dev.jna</groupId>
132165
<artifactId>jna-platform</artifactId>
133166
<version>5.12.1</version>
134167
</dependency>
135168

136-
<!-- https://mvnrepository.com/artifact/junit/junit -->
137169
<dependency>
138170
<groupId>junit</groupId>
139171
<artifactId>junit</artifactId>
140172
<version>4.13.2</version>
141173
<scope>test</scope>
142174
</dependency>
143175

144-
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
145176
<dependency>
146177
<groupId>org.mockito</groupId>
147178
<artifactId>mockito-core</artifactId>
148179
<version>3.12.4</version>
149180
<scope>test</scope>
150181
</dependency>
151182

152-
<!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
153183
<dependency>
154184
<groupId>org.assertj</groupId>
155185
<artifactId>assertj-core</artifactId>
156186
<version>3.23.1</version>
157187
<scope>test</scope>
158188
</dependency>
159189

160-
<!-- https://mvnrepository.com/artifact/org.openjdk.jmh -->
161190
<dependency>
162191
<groupId>org.openjdk.jmh</groupId>
163192
<artifactId>jmh-core</artifactId>
@@ -172,4 +201,4 @@
172201
<scope>test</scope>
173202
</dependency>
174203
</dependencies>
175-
</project>
204+
</project>

src/main/java/bwapi/UnsafeTools.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ private static Object getOrCrash(final Class<?> className, final Object object,
2121
return result;
2222

2323
} catch (final Exception e) { // or crash...
24-
e.printStackTrace();
25-
System.exit(-1);
26-
return null;
24+
throw new RuntimeException(e);
2725
}
2826
}
2927

0 commit comments

Comments
 (0)