mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
Added ErrorProne for potential bugs. Fixed potential bugs.
This commit is contained in:
53
app/pom.xml
53
app/pom.xml
@@ -42,6 +42,18 @@
|
|||||||
<artifactId>javafx-controls</artifactId>
|
<artifactId>javafx-controls</artifactId>
|
||||||
<version>25</version>
|
<version>25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_annotations</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -115,10 +127,51 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<fork>true</fork>
|
||||||
|
<executable>${java.home}/bin/javac</executable>
|
||||||
<source>25</source>
|
<source>25</source>
|
||||||
<target>25</target>
|
<target>25</target>
|
||||||
|
<release>25</release>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||||
|
<arg>
|
||||||
|
-Xplugin:ErrorProne \
|
||||||
|
-Xep:RestrictedApi:ERROR \
|
||||||
|
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
|
||||||
|
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
|
||||||
|
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
|
||||||
|
</arg>
|
||||||
|
<arg>-XDcompilePolicy=simple</arg>
|
||||||
|
<arg>--should-stop=ifError=FLOW</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import org.toop.framework.networking.NetworkingInitializationException;
|
|||||||
import org.toop.framework.resource.ResourceLoader;
|
import org.toop.framework.resource.ResourceLoader;
|
||||||
import org.toop.framework.resource.ResourceManager;
|
import org.toop.framework.resource.ResourceManager;
|
||||||
import org.toop.framework.resource.resources.MusicAsset;
|
import org.toop.framework.resource.resources.MusicAsset;
|
||||||
|
import org.toop.framework.resource.resources.SoundEffectAsset;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public final class Main {
|
public final class Main {
|
||||||
static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
|
|||||||
@@ -123,6 +123,16 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_annotations</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -132,11 +142,49 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.14.1</version>
|
<version>3.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<fork>true</fork>
|
||||||
|
<executable>${java.home}/bin/javac</executable>
|
||||||
<source>25</source>
|
<source>25</source>
|
||||||
<target>25</target>
|
<target>25</target>
|
||||||
<release>25</release>
|
<release>25</release>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||||
|
<arg>
|
||||||
|
-Xplugin:ErrorProne \
|
||||||
|
-Xep:RestrictedApi:ERROR \
|
||||||
|
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
|
||||||
|
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
|
||||||
|
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
|
||||||
|
</arg>
|
||||||
|
<arg>-XDcompilePolicy=simple</arg>
|
||||||
|
<arg>--should-stop=ifError=FLOW</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.diffplug.spotless</groupId>
|
<groupId>com.diffplug.spotless</groupId>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import org.apache.logging.log4j.core.LoggerContext;
|
|||||||
import org.apache.logging.log4j.core.config.Configuration;
|
import org.apache.logging.log4j.core.config.Configuration;
|
||||||
import org.apache.logging.log4j.core.config.LoggerConfig;
|
import org.apache.logging.log4j.core.config.LoggerConfig;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for configuring logging levels dynamically at runtime using Log4j 2.
|
* Utility class for configuring logging levels dynamically at runtime using Log4j 2.
|
||||||
*
|
*
|
||||||
@@ -144,7 +146,7 @@ public final class Logging {
|
|||||||
* @param levelToLog name of the logging level (e.g., "DEBUG", "INFO")
|
* @param levelToLog name of the logging level (e.g., "DEBUG", "INFO")
|
||||||
*/
|
*/
|
||||||
public static void enableLogsForClass(String className, String levelToLog) {
|
public static void enableLogsForClass(String className, String levelToLog) {
|
||||||
Level level = Level.valueOf(levelToLog.trim().toUpperCase());
|
Level level = Level.valueOf(levelToLog.trim().toUpperCase(Locale.ROOT));
|
||||||
if (level != null && verifyStringIsActualClass(className)) {
|
if (level != null && verifyStringIsActualClass(className)) {
|
||||||
enableLogsForClassInternal(className, level);
|
enableLogsForClassInternal(className, level);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package org.toop.framework.annotations;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
|
||||||
|
public @interface TestsOnly {}
|
||||||
@@ -2,6 +2,7 @@ package org.toop.framework.audio;
|
|||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.toop.framework.annotations.TestsOnly;
|
||||||
import org.toop.framework.audio.interfaces.Dispatcher;
|
import org.toop.framework.audio.interfaces.Dispatcher;
|
||||||
import org.toop.framework.resource.ResourceManager;
|
import org.toop.framework.resource.ResourceManager;
|
||||||
import org.toop.framework.resource.resources.BaseResource;
|
import org.toop.framework.resource.resources.BaseResource;
|
||||||
@@ -12,7 +13,7 @@ import java.util.*;
|
|||||||
public class MusicManager<T extends AudioResource> implements org.toop.framework.audio.interfaces.MusicManager<T> {
|
public class MusicManager<T extends AudioResource> implements org.toop.framework.audio.interfaces.MusicManager<T> {
|
||||||
private static final Logger logger = LogManager.getLogger(MusicManager.class);
|
private static final Logger logger = LogManager.getLogger(MusicManager.class);
|
||||||
|
|
||||||
private final List<T> backgroundMusic = new LinkedList<>();
|
private final List<T> backgroundMusic = new ArrayList<>();
|
||||||
private final Dispatcher dispatcher;
|
private final Dispatcher dispatcher;
|
||||||
private final List<T> resources;
|
private final List<T> resources;
|
||||||
private int playingIndex = 0;
|
private int playingIndex = 0;
|
||||||
@@ -27,8 +28,11 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
|
|||||||
createShuffled();
|
createShuffled();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used in unit testing
|
/**
|
||||||
MusicManager(List<T> resources, Dispatcher dispatcher) {
|
* {@code @TestsOnly} DO NOT USE
|
||||||
|
*/
|
||||||
|
@TestsOnly
|
||||||
|
public MusicManager(List<T> resources, Dispatcher dispatcher) {
|
||||||
this.dispatcher = dispatcher;
|
this.dispatcher = dispatcher;
|
||||||
this.resources = new ArrayList<>(resources);
|
this.resources = new ArrayList<>(resources);
|
||||||
backgroundMusic.addAll(resources);
|
backgroundMusic.addAll(resources);
|
||||||
@@ -49,6 +53,7 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
|
|||||||
backgroundMusic.addAll(resources);
|
backgroundMusic.addAll(resources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void play() {
|
public void play() {
|
||||||
if (playing) {
|
if (playing) {
|
||||||
logger.warn("MusicManager is already playing.");
|
logger.warn("MusicManager is already playing.");
|
||||||
@@ -114,6 +119,7 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (!playing) return;
|
if (!playing) return;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
import org.toop.framework.resource.ResourceManager;
|
import org.toop.framework.resource.ResourceManager;
|
||||||
import org.toop.framework.resource.ResourceMeta;
|
import org.toop.framework.resource.ResourceMeta;
|
||||||
import org.toop.framework.resource.resources.BaseResource;
|
import org.toop.framework.resource.resources.BaseResource;
|
||||||
|
import org.toop.framework.resource.resources.MusicAsset;
|
||||||
import org.toop.framework.resource.resources.SoundEffectAsset;
|
import org.toop.framework.resource.resources.SoundEffectAsset;
|
||||||
|
|
||||||
import javax.sound.sampled.Clip;
|
import javax.sound.sampled.Clip;
|
||||||
@@ -12,10 +13,7 @@ import javax.sound.sampled.LineEvent;
|
|||||||
import javax.sound.sampled.LineUnavailableException;
|
import javax.sound.sampled.LineUnavailableException;
|
||||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class SoundEffectManager implements org.toop.framework.audio.interfaces.SoundEffectManager<SoundEffectAsset> {
|
public class SoundEffectManager implements org.toop.framework.audio.interfaces.SoundEffectManager<SoundEffectAsset> {
|
||||||
@@ -23,6 +21,8 @@ public class SoundEffectManager implements org.toop.framework.audio.interfaces.S
|
|||||||
private final HashMap<String, SoundEffectAsset> soundEffectResources;
|
private final HashMap<String, SoundEffectAsset> soundEffectResources;
|
||||||
|
|
||||||
public SoundEffectManager(){
|
public SoundEffectManager(){
|
||||||
|
MusicAsset[] abcd = {};
|
||||||
|
new MusicManager<>(Arrays.stream(abcd).toList(), new JavaFXDispatcher());
|
||||||
// If there are duplicates, takes discards the first
|
// If there are duplicates, takes discards the first
|
||||||
soundEffectResources = ResourceManager.getAllOfType(SoundEffectAsset.class).stream()
|
soundEffectResources = ResourceManager.getAllOfType(SoundEffectAsset.class).stream()
|
||||||
.collect(Collectors.toMap(ResourceMeta::getName, ResourceMeta::getResource, (a, b) -> b, HashMap::new));
|
.collect(Collectors.toMap(ResourceMeta::getName, ResourceMeta::getResource, (a, b) -> b, HashMap::new));
|
||||||
|
|||||||
@@ -52,8 +52,11 @@ public enum VolumeControl {
|
|||||||
FX(),
|
FX(),
|
||||||
MUSIC();
|
MUSIC();
|
||||||
|
|
||||||
|
@SuppressWarnings("ImmutableEnumChecker")
|
||||||
private final List<AudioManager<? extends AudioResource>> managers = new CopyOnWriteArrayList<>();
|
private final List<AudioManager<? extends AudioResource>> managers = new CopyOnWriteArrayList<>();
|
||||||
|
@SuppressWarnings("ImmutableEnumChecker")
|
||||||
private double volume = 1.0;
|
private double volume = 1.0;
|
||||||
|
@SuppressWarnings("ImmutableEnumChecker")
|
||||||
private double masterVolume = 1.0;
|
private double masterVolume = 1.0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ public class EventsBase {
|
|||||||
/**
|
/**
|
||||||
* WIP, DO NOT USE!
|
* WIP, DO NOT USE!
|
||||||
*
|
*
|
||||||
* @param eventName
|
* @param eventName todo
|
||||||
* @param args
|
* @param args todo
|
||||||
* @return
|
* @return todo
|
||||||
* @throws Exception
|
* @throws Exception todo
|
||||||
*/
|
*/
|
||||||
public static Object get(String eventName, Object... args) throws Exception {
|
public static Object get(String eventName, Object... args) throws Exception {
|
||||||
Class<?> clazz = Class.forName("org.toop.framework.eventbus.events.Events$ServerEvents$" + eventName);
|
Class<?> clazz = Class.forName("org.toop.framework.eventbus.events.Events$ServerEvents$" + eventName);
|
||||||
@@ -24,11 +24,11 @@ public class EventsBase {
|
|||||||
/**
|
/**
|
||||||
* WIP, DO NOT USE!
|
* WIP, DO NOT USE!
|
||||||
*
|
*
|
||||||
* @param eventCategory
|
* @param eventCategory todo
|
||||||
* @param eventName
|
* @param eventName todo
|
||||||
* @param args
|
* @param args todo
|
||||||
* @return
|
* @return todo
|
||||||
* @throws Exception
|
* @throws Exception todo
|
||||||
*/
|
*/
|
||||||
public static Object get(String eventCategory, String eventName, Object... args)
|
public static Object get(String eventCategory, String eventName, Object... args)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
@@ -42,10 +42,10 @@ public class EventsBase {
|
|||||||
/**
|
/**
|
||||||
* WIP, DO NOT USE!
|
* WIP, DO NOT USE!
|
||||||
*
|
*
|
||||||
* @param eventName
|
* @param eventName todo
|
||||||
* @param args
|
* @param args todo
|
||||||
* @return
|
* @return todo
|
||||||
* @throws Exception
|
* @throws Exception todo
|
||||||
*/
|
*/
|
||||||
public static Object get2(String eventName, Object... args) throws Exception {
|
public static Object get2(String eventName, Object... args) throws Exception {
|
||||||
// Fully qualified class name
|
// Fully qualified class name
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void gameWinConditionHandler(String rec) {
|
private void gameWinConditionHandler(String rec) {
|
||||||
|
@SuppressWarnings("StreamToString")
|
||||||
String condition =
|
String condition =
|
||||||
Pattern.compile("\\b(win|draw|lose)\\b", Pattern.CASE_INSENSITIVE)
|
Pattern.compile("\\b(win|draw|lose)\\b", Pattern.CASE_INSENSITIVE)
|
||||||
.matcher(rec)
|
.matcher(rec)
|
||||||
@@ -180,6 +181,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void gameYourTurnHandler(String rec) {
|
private void gameYourTurnHandler(String rec) {
|
||||||
|
@SuppressWarnings("StreamToString")
|
||||||
String msg =
|
String msg =
|
||||||
Pattern.compile("TURNMESSAGE:\\s*\"([^\"]*)\"")
|
Pattern.compile("TURNMESSAGE:\\s*\"([^\"]*)\"")
|
||||||
.matcher(rec)
|
.matcher(rec)
|
||||||
|
|||||||
68
game/pom.xml
68
game/pom.xml
@@ -83,6 +83,18 @@
|
|||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>2.0.17</version>
|
<version>2.0.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_annotations</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -92,29 +104,49 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.14.1</version>
|
<version>3.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<fork>true</fork>
|
||||||
|
<executable>${java.home}/bin/javac</executable>
|
||||||
<source>25</source>
|
<source>25</source>
|
||||||
<target>25</target>
|
<target>25</target>
|
||||||
<release>25</release>
|
<release>25</release>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<!-- <compilerArgs>-->
|
<compilerArgs>
|
||||||
<!-- <arg>-XDcompilePolicy=simple</arg>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||||
<!-- <arg>--should-stop=ifError=FLOW</arg>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||||
<!-- <arg>-Xplugin:ErrorProne</arg>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||||
<!-- </compilerArgs>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||||
<!-- <annotationProcessorPaths>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||||
<!-- <path>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||||
<!-- <groupId>com.google.errorprone</groupId>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||||
<!-- <artifactId>error_prone_core</artifactId>-->
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||||
<!-- <version>2.42.0</version>-->
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||||
<!-- </path>-->
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||||
<!-- <!– Other annotation processors go here.-->
|
<arg>
|
||||||
|
-Xplugin:ErrorProne \
|
||||||
<!-- If 'annotationProcessorPaths' is set, processors will no longer be-->
|
-Xep:RestrictedApi:ERROR \
|
||||||
<!-- discovered on the regular -classpath; see also 'Using Error Prone-->
|
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
|
||||||
<!-- together with other annotation processors' below. –>-->
|
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
|
||||||
<!-- </annotationProcessorPaths>-->
|
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
|
||||||
<!-- <fork>true</fork>-->
|
</arg>
|
||||||
|
<arg>-XDcompilePolicy=simple</arg>
|
||||||
|
<arg>--should-stop=ifError=FLOW</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.diffplug.spotless</groupId>
|
<groupId>com.diffplug.spotless</groupId>
|
||||||
|
|||||||
61
pom.xml
61
pom.xml
@@ -107,18 +107,55 @@
|
|||||||
</java>
|
</java>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- <plugin>-->
|
<plugin>
|
||||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<!-- <version>3.14.1</version>-->
|
<version>3.14.1</version>
|
||||||
<!-- <configuration>-->
|
<configuration>
|
||||||
<!-- <outputDirectory>${project.build.directory}/custom</outputDirectory>-->
|
<showWarnings>true</showWarnings>
|
||||||
<!-- <source>25</source>-->
|
<fork>true</fork>
|
||||||
<!-- <target>25</target>-->
|
<executable>${java.home}/bin/javac</executable>
|
||||||
<!-- <release>25</release>-->
|
<source>25</source>
|
||||||
<!-- <encoding>UTF-8</encoding>-->
|
<target>25</target>
|
||||||
<!-- </configuration>-->
|
<release>25</release>
|
||||||
<!-- </plugin>-->
|
<encoding>UTF-8</encoding>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||||
|
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||||
|
<arg>
|
||||||
|
-Xplugin:ErrorProne \
|
||||||
|
-Xep:RestrictedApi:ERROR \
|
||||||
|
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
|
||||||
|
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
|
||||||
|
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
|
||||||
|
</arg>
|
||||||
|
<arg>-XDcompilePolicy=simple</arg>
|
||||||
|
<arg>--should-stop=ifError=FLOW</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.42.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user