Skip to content

Commit

Permalink
Fix reflection usage for some Java version
Browse files Browse the repository at this point in the history
  • Loading branch information
NivixX committed Feb 7, 2023
1 parent 0b88bba commit 7ca2179
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ndatabase-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ndatabase</artifactId>
<groupId>com.nivixx</groupId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions ndatabase-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ndatabase</artifactId>
<groupId>com.nivixx</groupId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,12 @@
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-api</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>core-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import com.nivixx.ndatabase.core.promise.AsyncThreadPool;
import com.nivixx.ndatabase.platforms.coreplatform.executor.SyncExecutor;
import com.nivixx.ndatabase.platforms.coreplatform.logging.DBLogger;
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -65,7 +65,7 @@ public V createEntityInstance(Class<V> entityClass) throws DatabaseCreationExcep

@SuppressWarnings("unchecked")
public Class<K> resolveKeyFromEntity(V nEntity) {
ParameterizedTypeImpl genericSuperclass = (ParameterizedTypeImpl) nEntity.getClass().getGenericSuperclass();
ParameterizedType genericSuperclass = (ParameterizedType) nEntity.getClass().getGenericSuperclass();
Type actualTypeArgument = genericSuperclass.getActualTypeArguments()[0];
return (Class<K>) actualTypeArgument;
}
Expand Down
10 changes: 5 additions & 5 deletions ndatabase-packaging-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<artifactId>ndatabase-packaging-jar</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>


<build>
Expand Down Expand Up @@ -51,17 +51,17 @@
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-core</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>app-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>bukkit-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion ndatabase-packaging-jar/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: NDatabase
main: com.nivixx.ndatabase.platforms.bukkitplatform.NDatabasePlugin
version: 0.1.5
version: 0.1.6
description: A lightweight centralised Key-value style database
api-version: 1.13
authors: [NivixX]
Expand Down
8 changes: 4 additions & 4 deletions ndatabase-platforms/app-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-platforms</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>

<groupId>com.nivixx</groupId>
<artifactId>app-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-core</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-core</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
6 changes: 3 additions & 3 deletions ndatabase-platforms/bukkit-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-platforms</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>

<artifactId>bukkit-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>

<dependencies>
<dependency>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-core</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
6 changes: 3 additions & 3 deletions ndatabase-platforms/core-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-platforms</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>

<artifactId>core-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-api</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions ndatabase-platforms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<parent>
<artifactId>ndatabase</artifactId>
<groupId>com.nivixx</groupId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions ndatabase-platforms/sponge-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-platforms</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>

<artifactId>sponge-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>


<dependencies>
Expand All @@ -25,7 +25,7 @@
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase-core</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
6 changes: 3 additions & 3 deletions ndatabase-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<parent>
<groupId>com.nivixx</groupId>
<artifactId>ndatabase</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</parent>

<artifactId>ndatabase-tests</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>com.nivixx</groupId>
<artifactId>app-platform</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.nivixx</groupId>
<artifactId>ndatabase</artifactId>
<packaging>pom</packaging>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NDatabase is a lightweight and easy to use
[key-value store](https://en.wikipedia.org/wiki/Key%E2%80%93value_database) style database framework mainly aimed for minecraft servers and is multi-platform (currently supporting Bukkit / Spigot servers).
It can be used as a plugin so you can install it once and use it everywhere without having to configure a database and duplicate connection pool each time you develop a new plugin. The API provide a fluent way to handle Async data fetch and server
main thread callback with [async to sync](#async-to-sync) mechanism. NDatabase can support multiple databases (currently MySQL and In-memory implementation).
NDatabase can support java 8 from 18 and higher and all minecraft server version (tested from 1.8 to 1.19+).


## How does it work & API usage
Expand Down

0 comments on commit 7ca2179

Please sign in to comment.