mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-04 02:34:22 +00:00
GraphTargetItem.src is readonly (field is private, getter added)
This commit is contained in:
@@ -52,8 +52,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -572,7 +570,7 @@ public class Graph {
|
||||
if (!forFirstCommands.isEmpty() || !forFinalCommands.isEmpty()) {
|
||||
GraphTargetItem lastExpr = whi.expression.remove(whi.expression.size() - 1);
|
||||
forFirstCommands.addAll(whi.expression);
|
||||
list.set(i, new ForItem(whi.src, whi.loop, forFirstCommands, lastExpr, forFinalCommands, whi.commands));
|
||||
list.set(i, new ForItem(whi.getSrc(), whi.loop, forFirstCommands, lastExpr, forFinalCommands, whi.commands));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1846,9 +1844,9 @@ public class Graph {
|
||||
checkContinueAtTheEnd(finalComm, currentLoop);
|
||||
}
|
||||
if (!finalComm.isEmpty()) {
|
||||
ret.add(index, li = new ForItem(expr.src, currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands));
|
||||
ret.add(index, li = new ForItem(expr.getSrc(), currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands));
|
||||
} else {
|
||||
ret.add(index, li = new WhileItem(expr.src, currentLoop, exprList, commands));
|
||||
ret.add(index, li = new WhileItem(expr.getSrc(), currentLoop, exprList, commands));
|
||||
}
|
||||
|
||||
loopTypeFound = true;
|
||||
|
||||
@@ -70,7 +70,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
|
||||
public static final int NOPRECEDENCE = 16;
|
||||
|
||||
public GraphSourceItem src;
|
||||
private GraphSourceItem src;
|
||||
|
||||
public int pos = -1;
|
||||
|
||||
@@ -118,6 +118,18 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public GraphSourceItem getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
protected HighlightData getSrcData() {
|
||||
if (srcData == null) {
|
||||
srcData = new HighlightData();
|
||||
}
|
||||
|
||||
return srcData;
|
||||
}
|
||||
|
||||
public List<GraphSourceItemPos> getNeededSources() {
|
||||
List<GraphSourceItemPos> ret = new ArrayList<>();
|
||||
ret.add(new GraphSourceItemPos(src, pos));
|
||||
@@ -313,12 +325,4 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
public GraphTargetItem invert(GraphSourceItem src) {
|
||||
return new NotItem(src, this);
|
||||
}
|
||||
|
||||
protected HighlightData getSrcData() {
|
||||
if (srcData == null) {
|
||||
srcData = new HighlightData();
|
||||
}
|
||||
|
||||
return srcData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
public class PushItem extends GraphTargetItem {
|
||||
|
||||
public PushItem(GraphTargetItem val) {
|
||||
super(val.src, val.getPrecedence());
|
||||
super(val.getSrc(), val.getPrecedence());
|
||||
this.value = val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user