Skip to content

Commit 738000f

Browse files
authored
移除无用类与方法 (#3132)
* Remove useless classes. * Remove useless methods
1 parent 9b5445b commit 738000f

File tree

3 files changed

+0
-180
lines changed

3 files changed

+0
-180
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/countly/Countly.java

Lines changed: 0 additions & 86 deletions
This file was deleted.

HMCL/src/main/java/org/jackhuang/hmcl/countly/CrashReport.java

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,25 @@
55
import org.jackhuang.hmcl.util.platform.Architecture;
66
import org.jackhuang.hmcl.util.platform.OperatingSystem;
77

8-
import java.io.File;
98
import java.time.LocalDateTime;
109
import java.time.format.DateTimeFormatter;
11-
import java.util.Map;
12-
13-
import static org.jackhuang.hmcl.util.Lang.mapOf;
14-
import static org.jackhuang.hmcl.util.Pair.pair;
15-
import static org.jackhuang.hmcl.util.logging.Logger.LOG;
1610

1711
public class CrashReport {
1812

1913
private final Thread thread;
2014
private final Throwable throwable;
2115
private final String stackTrace;
2216

23-
private boolean nonFatal;
24-
2517
public CrashReport(Thread thread, Throwable throwable) {
2618
this.thread = thread;
2719
this.throwable = throwable;
2820
stackTrace = StringUtils.getStackTrace(throwable);
29-
nonFatal = false;
3021
}
3122

3223
public Throwable getThrowable() {
3324
return this.throwable;
3425
}
3526

36-
public CrashReport setNonFatal() {
37-
nonFatal = true;
38-
return this;
39-
}
40-
4127
public boolean shouldBeReport() {
4228
if (!stackTrace.contains("org.jackhuang"))
4329
return false;
@@ -48,23 +34,6 @@ public boolean shouldBeReport() {
4834
return true;
4935
}
5036

51-
public Map<String, Object> getMetrics(long runningTime) {
52-
return mapOf(
53-
pair("_run", runningTime),
54-
pair("_app_version", Metadata.VERSION),
55-
pair("_os", OperatingSystem.SYSTEM_NAME),
56-
pair("_os_version", OperatingSystem.SYSTEM_VERSION),
57-
pair("_disk_current", getDiskAvailable()),
58-
pair("_disk_total", getDiskTotal()),
59-
pair("_ram_current", getMemoryAvailable()),
60-
pair("_ram_total", Runtime.getRuntime().maxMemory() / BYTES_IN_MB),
61-
pair("_error", stackTrace),
62-
pair("_logs", LOG.getLogs()),
63-
pair("_name", throwable.getLocalizedMessage()),
64-
pair("_nonfatal", nonFatal)
65-
);
66-
}
67-
6837
public String getDisplayText() {
6938
return "---- Hello Minecraft! Crash Report ----\n" +
7039
" Version: " + Metadata.VERSION + "\n" +
@@ -82,29 +51,4 @@ public String getDisplayText() {
8251
" JVM Total Memory: " + Runtime.getRuntime().totalMemory() + "\n" +
8352
" JVM Free Memory: " + Runtime.getRuntime().freeMemory() + "\n";
8453
}
85-
86-
private static final Long BYTES_IN_MB = 1024L * 1024;
87-
88-
private static long getMemoryAvailable() {
89-
Long total = Runtime.getRuntime().totalMemory();
90-
Long availMem = Runtime.getRuntime().freeMemory();
91-
return (total - availMem) / BYTES_IN_MB;
92-
}
93-
94-
private static long getDiskAvailable() {
95-
long total = 0, free = 0;
96-
for (File f : File.listRoots()) {
97-
total += f.getTotalSpace();
98-
free += f.getUsableSpace();
99-
}
100-
return (total - free) / BYTES_IN_MB;
101-
}
102-
103-
private static long getDiskTotal() {
104-
long total = 0;
105-
for (File f : File.listRoots()) {
106-
total += f.getTotalSpace();
107-
}
108-
return total / BYTES_IN_MB;
109-
}
11054
}

HMCL/src/main/java/org/jackhuang/hmcl/game/LoadingState.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)