Replace google guava with lighter library for a specific map implementation.
This commit is contained in:
parent
3e6cf96040
commit
4be37945cb
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
/.idea
|
||||
/*/target
|
||||
dependency-reduced-pom.xml
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
*.iml
|
@ -25,9 +25,9 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.1.2-jre</version> <!-- Match the version imported by Paper API/BungeeCord API if possible -->
|
||||
<groupId>org.plumelib</groupId>
|
||||
<artifactId>hashmap-util</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>io.github.classgraph:classgraph</include>
|
||||
<include>org.plumelib:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
@ -60,6 +61,26 @@
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>org.plumelib:hashmap-util</artifact>
|
||||
<excludes>
|
||||
<exclude>module-info.class</exclude>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>org.plumelib:reflection-util</artifact>
|
||||
<excludes>
|
||||
<exclude>module-info.class</exclude>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<relocations>
|
||||
<relocation>
|
||||
@ -70,6 +91,10 @@
|
||||
<pattern>nonapi.io.github.classgraph</pattern>
|
||||
<shadedPattern>fr.pandacube.lib.reflect.shaded.classgraph.nonapi</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.plumelib</pattern>
|
||||
<shadedPattern>fr.pandacube.lib.reflect.shaded.plumelib</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -1,8 +1,7 @@
|
||||
package fr.pandacube.lib.reflect.wrapper;
|
||||
|
||||
import com.google.common.collect.MapMaker;
|
||||
|
||||
import fr.pandacube.lib.reflect.ReflectConstructor;
|
||||
import org.plumelib.util.WeakIdentityHashMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -17,7 +16,10 @@ import static fr.pandacube.lib.util.ThrowableUtil.wrapEx;
|
||||
public abstract class ReflectWrapper implements ReflectWrapperI {
|
||||
|
||||
|
||||
private static final Map<Object, ReflectWrapperI> objectWrapperCache = new MapMaker().weakKeys().makeMap();
|
||||
private static final Map<Object, ReflectWrapperI> objectWrapperCache = new WeakIdentityHashMap<>();
|
||||
/*
|
||||
* WeakHashMap is not suitable because we want the keys to be compared by reference (==) and not by the .equals() method.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unwraps the object from the provided reflect wrapper.
|
||||
|
Loading…
Reference in New Issue
Block a user