Skip to content

Commit

Permalink
Merge pull request #323 from vincent4vx/chore-update-dependencies
Browse files Browse the repository at this point in the history
chore: Update dependencies for v0.11
  • Loading branch information
vincent4vx authored Jan 3, 2024
2 parents 0d07e80 + ced01be commit 50f56a2
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 43 deletions.
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@

<module name="JavadocContentLocationCheck" />
<module name="JavadocMethod">
<property name="scope" value="public" />
<property name="accessModifiers" value="public" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
</module>
Expand Down
56 changes: 29 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@

<groupId>fr.quatrevieux.araknemu</groupId>
<artifactId>araknemu</artifactId>
<version>0.10-SNAPSHOT</version>
<version>0.11-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.70.Final</version>
<version>4.1.104.Final</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.14.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>args4j</groupId>
Expand All @@ -59,7 +59,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.22.1</version>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
Expand All @@ -69,12 +69,13 @@
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.1.4</version>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.41.2.2</version>
<!-- TODO See: https://github.com/xerial/sqlite-jdbc/pull/1035 -->
<version>3.42.0.1</version>
</dependency>
<dependency>
<groupId>fr.arakne</groupId>
Expand All @@ -89,22 +90,22 @@
<dependency>
<groupId>com.github.seancfoley</groupId>
<artifactId>ipaddress</artifactId>
<version>5.3.3</version>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.8</version>
<version>4.0.17</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.34.0</version> <!-- TODO property -->
<version>3.42.0</version> <!-- TODO property -->
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-util</artifactId>
<version>3.34.0</version>
<version>3.42.0</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
Expand All @@ -115,19 +116,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.1.0</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -143,12 +144,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.3</version>
<!-- <configuration>-->
<!-- <parallel>classes</parallel>-->
<!-- <forkCount>4</forkCount>-->
<!-- </configuration>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
Expand All @@ -162,7 +167,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<version>3.6.0</version>
<configuration>
<archive>
<manifest>
Expand All @@ -189,7 +194,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.11</version>

<executions>
<execution>
Expand All @@ -211,7 +216,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<version>3.3.1</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
Expand Down Expand Up @@ -266,18 +271,14 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.12.1</version>
<configuration>
<fork>true</fork> <!-- Must fork or else JVM arguments are ignored. -->
<compilerArguments>
<Xmaxerrs>10000</Xmaxerrs>
<Xmaxwarns>10000</Xmaxwarns>
</compilerArguments>
<annotationProcessorPaths>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>3.21.2</version>
<version>3.42.0</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
Expand All @@ -297,7 +298,7 @@
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>3.21.2</version>
<version>3.42.0</version>
</dependency>
</dependencies>
</profile>
Expand All @@ -323,6 +324,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<fork>true</fork>
<compilerArgs combine.children="append">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void detach() {

@Override
@EnsuresNonNullIf(expression = "session", result = true)
@SuppressWarnings("contracts.conditional.postcondition")
public boolean isLogged() {
return session != null && session.isAlive();
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/fr/quatrevieux/araknemu/core/di/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package fr.quatrevieux.araknemu.core.di;

import org.checkerframework.checker.nullness.qual.NonNull;

/**
* Dependency injection container
*/
Expand Down Expand Up @@ -78,7 +80,7 @@ public interface Container {
* @return The scoped container
* @see ScopedContainer
*/
public default <T> Container with(T value, Class<? super T>... interfaces) {
public default <T> Container with(@NonNull T value, Class<? super T>... interfaces) {
return withAll(new ScopedContainer.Mapping<>(value, interfaces));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package fr.quatrevieux.araknemu.core.di;

import org.checkerframework.checker.nullness.qual.NonNull;

import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -88,11 +90,11 @@ public static ScopedContainer fromMapping(Container container, Mapping[] mapping
*
* @param <T> The base type
*/
public static final class Mapping<T> {
private final T value;
public static final class Mapping<@NonNull T> {
private final @NonNull T value;
private final Class[] interfaces;

public Mapping(T value, Class<? super T>... interfaces) {
public Mapping(@NonNull T value, Class<? super T>... interfaces) {
this.value = value;
this.interfaces = interfaces;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ public boolean checkAnswer(String input) {
* @param message Message to show
*/
public void kick(ServerMessage message) {
if (isLogged()) {
final GameSession session = this.session;

if (session != null && isLogged()) {
session.send(message);
session.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private String formatDuration(Duration duration) {
return formatted.toString();
}

@SuppressWarnings("array.access.unsafe.high.range") // Ignore out of range for units (I don't think that TB of RAM will be reached)
@SuppressWarnings({"array.access.unsafe.high.range", "array.access.unsafe.high"}) // Ignore out of range for units (I don't think that TB of RAM will be reached)
private static String formatBytes(long bytes) {
final long absB = bytes == Long.MIN_VALUE ? Long.MAX_VALUE : Math.abs(bytes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ public boolean authorized(GamePlayer from) {

@Override
public void send(GamePlayer from, Message message) throws ChatException {
if (message.target() == null || !service.isOnline(message.target())) {
final String target = message.target();

if (target == null || !service.isOnline(target)) {
throw new ChatException(ChatException.Error.USER_NOT_CONNECTED);
}

final GamePlayer to = service.get(message.target());
final GamePlayer to = service.get(target);
final ConcealedMessage event = new ConcealedMessage(
from,
to,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ public void changeCell(@IndexFor("this.map()") int cell) {
* Leave the current map
*/
public void leave() {
if (map != null) {
if (map.remove(this)) {
dispatch(new MapLeaved(map));
final ExplorationMap currentMap = map;

if (currentMap != null) {
if (currentMap.remove(this)) {
dispatch(new MapLeaved(currentMap));
}

map = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ public void push(Action action) {
* @param actionId The action to end
*/
public void end(int actionId) {
final BlockingAction current = this.current;

if (current == null || current.id() != actionId) {
throw new NoSuchElementException("The action ID do not corresponds");
}

current.end();
current = null;
this.current = null;

runNextAction();
}
Expand All @@ -95,14 +97,16 @@ public void end(int actionId) {
* @param argument The cancel argument
*/
public void cancel(int actionId, String argument) {
final BlockingAction current = this.current;

if (current == null || current.id() != actionId) {
throw new NoSuchElementException("The action ID do not corresponds");
}

try {
current.cancel(argument);
} finally {
current = null;
this.current = null;
actions.clear();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public void simulate(CastSimulation simulation, AI ai, CastScope.EffectScope<? e
// Poison is already handled by the DamageSimulator
simulator.simulate(simulation, ai, effect);

final double totalDamage = (-simulation.alliesLife() - simulation.enemiesLife()) - lastDamage;
final int totalDamage = (int) ((-simulation.alliesLife() - simulation.enemiesLife()) - lastDamage);

if (totalDamage > 0) {
simulation.addHeal(Interval.of((int) totalDamage / 2), simulation.caster());
simulation.addHeal(Interval.of(totalDamage / 2), simulation.caster());
}
}

Expand Down

0 comments on commit 50f56a2

Please sign in to comment.