Merge pull request #2573 from Multiverse/java-11

Fix compiling with Java 11+
This commit is contained in:
Ben Woo 2021-03-02 09:01:38 +08:00 committed by GitHub
commit 15cacba7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

16
pom.xml
View File

@ -215,7 +215,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version> <version>3.2.4</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -264,13 +264,19 @@
<plugin> <plugin>
<groupId>se.eris</groupId> <groupId>se.eris</groupId>
<artifactId>notnull-instrumenter-maven-plugin</artifactId> <artifactId>notnull-instrumenter-maven-plugin</artifactId>
<version>0.6.8</version> <version>1.0.0</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
<goal>instrument</goal> <goal>instrument</goal>
<goal>tests-instrument</goal> <goal>tests-instrument</goal>
</goals> </goals>
<configuration>
<notNull>
<param>org.jetbrains.annotations.NotNull</param>
<param>javax.validation.constraints.NotNull</param>
</notNull>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
@ -353,21 +359,21 @@
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId> <artifactId>powermock-module-junit4</artifactId>
<version>2.0.0</version> <version>2.0.9</version>
<type>jar</type> <type>jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId> <artifactId>powermock-api-easymock</artifactId>
<version>2.0.0</version> <version>2.0.9</version>
<type>jar</type> <type>jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId> <artifactId>powermock-api-mockito2</artifactId>
<version>2.0.0</version> <version>2.0.9</version>
<type>jar</type> <type>jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -214,11 +214,18 @@ public class TestInstanceCreator {
serverfield.set(core, mockServer); serverfield.set(core, mockServer);
// Set buscript // Set buscript
Buscript buscript = PowerMockito.spy(new Buscript(core)); Buscript buscript;
Field buscriptfield = MultiverseCore.class.getDeclaredField("buscript"); Field buscriptfield = MultiverseCore.class.getDeclaredField("buscript");
buscriptfield.setAccessible(true); buscriptfield.setAccessible(true);
try {
buscript = PowerMockito.spy(new Buscript(core));
when(buscript.getPlugin()).thenReturn(core);
} catch (NullPointerException e) {
buscript = null;
}
buscriptfield.set(core, buscript); buscriptfield.set(core, buscript);
when(buscript.getPlugin()).thenReturn(core);
// Set worldManager // Set worldManager
WorldManager wm = PowerMockito.spy(new WorldManager(core)); WorldManager wm = PowerMockito.spy(new WorldManager(core));