OSDN Git Service

NEW: add suffix to version
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 10 Mar 2022 03:43:02 +0000 (12:43 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 10 Mar 2022 03:43:02 +0000 (12:43 +0900)
Crash-Report/2022-03-10-12-33-54.txt [new file with mode: 0644]
src/com/ranfa/lib/CheckVersion.java
src/com/ranfa/lib/Suffix.java [new file with mode: 0644]
src/com/ranfa/lib/Version.java
src/com/ranfa/main/DelesteRandomSelector.java

diff --git a/Crash-Report/2022-03-10-12-33-54.txt b/Crash-Report/2022-03-10-12-33-54.txt
new file mode 100644 (file)
index 0000000..81bae79
--- /dev/null
@@ -0,0 +1,52 @@
+---- DelesteRandomSelector Crash Report ----
+// Shimamura Uzuki, I'll do my best!
+
+
+Time: 22/03/10 12:33
+Description: Unexpected Error
+
+
+These are simplified stack trace. (shown up to 5 lines. Full Stack trace is below.)
+java.lang.IllegalStateException: java.util.concurrent.CompletionException: java.lang.NullPointerException
+       at com.ranfa.main.DelesteRandomSelector.lambda$37(DelesteRandomSelector.java:629)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+
+
+A detailed walkthrough of the error, its code path and all known details is as follows:
+---------------------------------------------------------------------------------------
+
+
+Stacktrace:
+       at com.ranfa.main.DelesteRandomSelector.lambda$37(DelesteRandomSelector.java:629)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.util.concurrent.CompletionException: java.lang.NullPointerException
+       at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
+       at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.lang.NullPointerException
+       at com.ranfa.main.DelesteRandomSelector.lambda$36(DelesteRandomSelector.java:600)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+
+
+-- System Details --
+Details:
+       DelesteRandomSelector Version: v3.1.0
+       Operating System: Windows 10 (amd64) version 10.0
+       Java Version: 11, Eclipse Adoptium
+       Java VM Version: OpenJDK 64-Bit Server VM, version 11.0.13+8
+       Memory: 58056088 bytes / 268435456 bytes up to 4273995776 bytes
+       JVM Flags: 1 total: [-Dfile.encoding=UTF-8]
index ae6c176..24af4e7 100644 (file)
@@ -48,7 +48,8 @@ public class CheckVersion {
                String value = "v"
                                + getMajorVersion() + "."
                                + getMinorVersion() + "."
-                               + getPatchVersion();
+                               + getPatchVersion() + "-"
+                               + getSuffix().toString();
                return value;
        }
 
@@ -66,5 +67,10 @@ public class CheckVersion {
                Version version = DelesteRandomSelector.class.getAnnotation(Version.class);
                return version.patch();
        }
+       
+       public static Suffix getSuffix() {
+               Version version = DelesteRandomSelector.class.getAnnotation(Version.class);
+               return version.suffix();
+       }
 
 }
diff --git a/src/com/ranfa/lib/Suffix.java b/src/com/ranfa/lib/Suffix.java
new file mode 100644 (file)
index 0000000..67f74cf
--- /dev/null
@@ -0,0 +1,24 @@
+package com.ranfa.lib;
+
+public enum Suffix {
+       
+       /** Alpha channel*/
+       ALPHA("Alpha"),
+       
+       /** Beta channel*/
+       BETA("Beta"),
+       
+       /** Stable channel*/
+       STABLE("Stable");
+       
+       private String suf;
+       
+       Suffix(String str) {
+               this.suf = str;
+       }
+       
+       @Override
+       public String toString() {
+               return suf;
+       }
+}
index 0d8ca81..0fa6027 100644 (file)
@@ -11,4 +11,5 @@ public @interface Version {
        int major();
        int minor();
        int patch();
+       Suffix suffix();
 }
index 4421955..3b6c16c 100644 (file)
@@ -49,6 +49,7 @@ import com.ranfa.lib.Easter;
 import com.ranfa.lib.ManualUpdateThreadImpl;
 import com.ranfa.lib.SettingJSONProperty;
 import com.ranfa.lib.Settings;
+import com.ranfa.lib.Suffix;
 import com.ranfa.lib.TwitterIntegration;
 import com.ranfa.lib.Version;
 import com.ranfa.lib.concurrent.CountedThreadFactory;
@@ -58,7 +59,7 @@ import com.ranfa.lib.database.Song;
 import com.ranfa.lib.handler.CrashHandler;
 import com.ranfa.lib.songinfo.FetchFromAPI;
 
-@Version(major = 3, minor = 1, patch = 0)
+@Version(major = 3, minor = 1, patch = 0, suffix = Suffix.STABLE)
 public class DelesteRandomSelector extends JFrame {
 
     private static ArrayList<Song> selectedSongsList = new ArrayList<>();