PvPManager

PvPManager

3M Downloads

Unhandled exception in checkJavaVersion() for early access JDK builds

MrDevBot opened this issue ยท 1 comments

commented

Describe the bug
An unhandled exception is thrown when function "checkJavaVersion()" is provided with a string value, this occurs in early access and other non-default branch builds of java

To Reproduce
Steps to reproduce the behavior:
Start server with any XX-ea (early access) build or non-standard versioning system, for example OpenJDK 18-ea

Expected behavior
Function checkJavaVersion() expects a int data type, when provided with a string data type this function throws an unhandled exception

Plugin and Server version
Not applicable to this bug report, but sure
Paper Version git-Paper-324 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 8c9d98e)
PvPManager 3.9.4 (newest at time of report)
Java Version 18-ea

Stack Trace

[10:26:10 ERROR]: Error occurred while enabling PvPManager v3.9.4 (Is it up to date?)
java.lang.NumberFormatException: For input string: "18-ea"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[?:?]
        at java.lang.Integer.parseInt(Integer.java:668) ~[?:?]
        at java.lang.Integer.parseInt(Integer.java:784) ~[?:?]
        at me.NoChance.PvPManager.PvPManager.checkJavaVersion(PvPManager.java:126) ~[PvPManager.jar:?]
        at me.NoChance.PvPManager.PvPManager.onEnable(PvPManager.java:63) ~[PvPManager.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-324]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-324]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-324]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-324]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-324]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-324]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-324]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Additional context
Function checkJavaVersion() should account for a string or non-int input

commented

Thank you for the report, should be fixed in the latest dev build, let me know if not