Skip to content

Commit 8dddf47

Browse files
committed
Rename Variables
1 parent a067afc commit 8dddf47

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

liquidjava-verifier/src/main/java/liquidjava/processor/context/Context.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Context {
1212
private final List<RefinedVariable> ctxGlobalVars;
1313

1414
private List<GhostFunction> ghosts;
15-
private Map<String, List<GhostState>> states;
15+
private Map<String, List<GhostState>> classStates;
1616
private List<AliasWrapper> aliases;
1717

1818
private int counter;
@@ -27,7 +27,7 @@ private Context() {
2727

2828
aliases = new ArrayList<>();
2929
ghosts = new ArrayList<>();
30-
states = new HashMap<>();
30+
classStates = new HashMap<>();
3131
counter = 0;
3232
}
3333

@@ -48,7 +48,7 @@ public void reinitializeAllContext() {
4848
ctxFunctions = new ArrayList<>();
4949
aliases = new ArrayList<>();
5050
ghosts = new ArrayList<>();
51-
states = new HashMap<>();
51+
classStates = new HashMap<>();
5252
counter = 0;
5353
}
5454

@@ -323,23 +323,23 @@ public List<GhostFunction> getGhosts() {
323323
}
324324

325325
public void addGhostClass(String klass) {
326-
if (!states.containsKey(klass))
327-
states.put(klass, new ArrayList<>());
326+
if (!classStates.containsKey(klass))
327+
classStates.put(klass, new ArrayList<>());
328328
}
329329

330330
public void addToGhostClass(String klass, GhostState gs) {
331-
List<GhostState> l = states.get(klass);
331+
List<GhostState> l = classStates.get(klass);
332332
if (!l.contains(gs))
333333
l.add(gs);
334334
}
335335

336336
public List<GhostState> getGhostState(String s) {
337-
return states.get(s);
337+
return classStates.get(s);
338338
}
339339

340340
public List<GhostState> getGhostStates() {
341341
List<GhostState> lgs = new ArrayList<>();
342-
for (List<GhostState> l : states.values())
342+
for (List<GhostState> l : classStates.values())
343343
lgs.addAll(l);
344344
return lgs;
345345
}

liquidjava-verifier/src/main/java/liquidjava/processor/context/ContextHistory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
public class ContextHistory {
1313
private static ContextHistory instance;
1414

15-
private Map<String, Map<String, Set<RefinedVariable>>> vars; // file -> (scope -> variables in scope)
15+
private Map<String, Map<String, Set<RefinedVariable>>> fileScopeVars; // file -> (scope -> variables in scope)
1616
private Set<RefinedVariable> instanceVars;
1717
private Set<RefinedVariable> globalVars;
1818
private Set<GhostState> ghosts;
1919
private Set<AliasWrapper> aliases;
2020

2121
private ContextHistory() {
22-
vars = new HashMap<>();
22+
fileScopeVars = new HashMap<>();
2323
instanceVars = new HashSet<>();
2424
globalVars = new HashSet<>();
2525
ghosts = new HashSet<>();
@@ -33,7 +33,7 @@ public static ContextHistory getInstance() {
3333
}
3434

3535
public void clearHistory() {
36-
vars.clear();
36+
fileScopeVars.clear();
3737
instanceVars.clear();
3838
globalVars.clear();
3939
ghosts.clear();
@@ -48,8 +48,8 @@ public void saveContext(CtElement element, Context context) {
4848
// add variables in scope for this position
4949
String file = pos.getFile().getAbsolutePath();
5050
String scope = getScopePosition(element);
51-
vars.putIfAbsent(file, new HashMap<>());
52-
vars.get(file).put(scope, new HashSet<>(context.getCtxVars()));
51+
fileScopeVars.putIfAbsent(file, new HashMap<>());
52+
fileScopeVars.get(file).put(scope, new HashSet<>(context.getCtxVars()));
5353

5454
// add other elements in context
5555
instanceVars.addAll(context.getCtxInstanceVars());
@@ -69,8 +69,8 @@ public String getScopePosition(CtElement element) {
6969
pos.getEndColumn());
7070
}
7171

72-
public Map<String, Map<String, Set<RefinedVariable>>> getVars() {
73-
return vars;
72+
public Map<String, Map<String, Set<RefinedVariable>>> getFileScopeVars() {
73+
return fileScopeVars;
7474
}
7575

7676
public Set<RefinedVariable> getInstanceVars() {

0 commit comments

Comments
 (0)