MCPcopy Create free account
hub / github.com/FabricMC/Matcher / update

Method update

src/main/java/matcher/gui/tab/SourcecodeTab.java:78–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 private void update() {
79 cancelWebViewTasks();
80
81 final int cDecompId = ++decompId;
82
83 if (pendingUpdateTask != null) {
84 pendingUpdateTask.cancel(true);
85 pendingUpdateTask = null;
86 }
87
88 if (selectedClass == null) {
89 displayText("no class selected");
90 return;
91 }
92
93 displayText("decompiling...");
94
95 NameType nameType = gui.getNameType().withUnmatchedTmp(unmatchedTmp);
96 Decompiler decompiler = gui.getDecompiler().get();
97
98 //Gui.runAsyncTask(() -> gui.getEnv().decompile(selectedClass, true))
99 pendingUpdateTask = Gui.runAsyncTask(() -> SrcDecorator.decorate(gui.getEnv().decompile(decompiler, selectedClass, nameType), selectedClass, nameType))
100 .whenComplete((res, exc) -> applyDecompilerResult(res, exc, cDecompId));
101 }
102
103 private void applyDecompilerResult(String res, Throwable exc, int cDecompId) {
104 if (cDecompId != decompId) {

Callers 5

SourcecodeTabMethod · 0.95
onSelectStateChangeMethod · 0.95
onClassSelectMethod · 0.95
onMatchChangeMethod · 0.95
onViewChangeMethod · 0.95

Calls 11

runAsyncTaskMethod · 0.95
decorateMethod · 0.95
applyDecompilerResultMethod · 0.95
cancelWebViewTasksMethod · 0.80
displayTextMethod · 0.80
withUnmatchedTmpMethod · 0.80
getNameTypeMethod · 0.80
getDecompilerMethod · 0.80
decompileMethod · 0.65
getEnvMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected