mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-20 11:26:13 +00:00
mark levels recursion as warning, not severe
This commit is contained in:
@@ -46,6 +46,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -424,7 +426,7 @@ public class Graph {
|
||||
System.out.println(el);
|
||||
}
|
||||
System.out.println("</loops>");*/
|
||||
getPrecontinues(localData, null, heads.get(0), allParts, loops, null);
|
||||
getPrecontinues(path,localData, null, heads.get(0), allParts, loops, null);
|
||||
/*System.err.println("<loopspre>");
|
||||
for (Loop el : loops) {
|
||||
System.err.println(el);
|
||||
@@ -689,8 +691,8 @@ public class Graph {
|
||||
return loopItem;
|
||||
}
|
||||
|
||||
private void getPrecontinues(BaseLocalData localData, GraphPart parent, GraphPart part, List<GraphPart> allParts, List<Loop> loops, List<GraphPart> stopPart) throws InterruptedException {
|
||||
markLevels(localData, part, allParts, loops);
|
||||
private void getPrecontinues(String path,BaseLocalData localData, GraphPart parent, GraphPart part, List<GraphPart> allParts, List<Loop> loops, List<GraphPart> stopPart) throws InterruptedException {
|
||||
markLevels(path,localData, part, allParts, loops);
|
||||
//Note: this also marks part as precontinue when there is if
|
||||
/*
|
||||
while(k<10){
|
||||
@@ -741,19 +743,20 @@ public class Graph {
|
||||
clearLoops(loops);*/
|
||||
}
|
||||
|
||||
private void markLevels(BaseLocalData localData, GraphPart part, List<GraphPart> allParts, List<Loop> loops) throws InterruptedException {
|
||||
private void markLevels(String path, BaseLocalData localData, GraphPart part, List<GraphPart> allParts, List<Loop> loops) throws InterruptedException {
|
||||
clearLoops(loops);
|
||||
markLevels(localData, part, allParts, loops, new ArrayList<GraphPart>(), 1, new ArrayList<GraphPart>(), 0);
|
||||
markLevels(path,localData, part, allParts, loops, new ArrayList<GraphPart>(), 1, new ArrayList<GraphPart>(), 0);
|
||||
clearLoops(loops);
|
||||
}
|
||||
|
||||
private void markLevels(BaseLocalData localData, GraphPart part, List<GraphPart> allParts, List<Loop> loops, List<GraphPart> stopPart, int level, List<GraphPart> visited, int recursionLevel) throws InterruptedException {
|
||||
private void markLevels(String path,BaseLocalData localData, GraphPart part, List<GraphPart> allParts, List<Loop> loops, List<GraphPart> stopPart, int level, List<GraphPart> visited, int recursionLevel) throws InterruptedException {
|
||||
boolean debugMode = false;
|
||||
if (stopPart == null) {
|
||||
stopPart = new ArrayList<>();
|
||||
}
|
||||
if (recursionLevel > allParts.size() + 1) {
|
||||
throw new TranslateException("markLevels max recursion level reached.");
|
||||
Logger.getLogger(Graph.class.getName()).log(Level.WARNING, "{0} : markLevels max recursion level reached", path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (debugMode) {
|
||||
@@ -815,13 +818,13 @@ public class Graph {
|
||||
stopParts2.add(stopPart.get(stopPart.size() - 1));
|
||||
}
|
||||
if (next != nextParts.get(0)) {
|
||||
markLevels(localData, nextParts.get(0), allParts, loops, next == null ? stopPart : stopParts2, level + 1, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, nextParts.get(0), allParts, loops, next == null ? stopPart : stopParts2, level + 1, visited, recursionLevel + 1);
|
||||
}
|
||||
if (next != nextParts.get(1)) {
|
||||
markLevels(localData, nextParts.get(1), allParts, loops, next == null ? stopPart : stopParts2, level + 1, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, nextParts.get(1), allParts, loops, next == null ? stopPart : stopParts2, level + 1, visited, recursionLevel + 1);
|
||||
}
|
||||
if (next != null) {
|
||||
markLevels(localData, next, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, next, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -847,17 +850,17 @@ public class Graph {
|
||||
}
|
||||
}
|
||||
if (next != p) {
|
||||
markLevels(localData, p, allParts, loops, stopPart2, level + 1, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, p, allParts, loops, stopPart2, level + 1, visited, recursionLevel + 1);
|
||||
vis.add(p);
|
||||
}
|
||||
}
|
||||
if (next != null) {
|
||||
markLevels(localData, next, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, next, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextParts.size() == 1) {
|
||||
markLevels(localData, nextParts.get(0), allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, nextParts.get(0), allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
}
|
||||
|
||||
for (GraphPart t : part.throwParts) {
|
||||
@@ -873,14 +876,14 @@ public class Graph {
|
||||
stopPart2 = stopPart;
|
||||
}
|
||||
|
||||
markLevels(localData, t, allParts, loops, stopPart2, level, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, t, allParts, loops, stopPart2, level, visited, recursionLevel + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (isLoop) {
|
||||
if (currentLoop.loopBreak != null) {
|
||||
currentLoop.phase = 2;
|
||||
markLevels(localData, currentLoop.loopBreak, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
markLevels(path,localData, currentLoop.loopBreak, allParts, loops, stopPart, level, visited, recursionLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user