Skip to content

Commit

Permalink
allocate objects in visitClassContext, not at the class level
Browse files Browse the repository at this point in the history
  • Loading branch information
mebigfatguy committed Nov 18, 2024
1 parent cd480a5 commit 6748661
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ OPTIONAL_OR_ELSE_METHOD, new FQMethod("java/util/OptionalDouble", "orElse", "(D)
private OpcodeStack stack;
private JavaClass currentClass;
private Deque<ActiveStackOp> activeStackOps;
private Map<OpcodeStack.Item, SourceLineAnnotation> boxedItems = new HashMap<>();
private Map<OpcodeStack.Item, SourceLineAnnotation> boxedItems;
private Boolean methodIsConstrained;

static {
Expand Down Expand Up @@ -151,10 +151,13 @@ public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
activeStackOps = new ArrayDeque<>();
boxedItems = new HashMap<>();
super.visitClassContext(classContext);
} finally {
boxedItems = null;
activeStackOps = null;
stack = null;

}
}
currentClass = null;
Expand Down

0 comments on commit 6748661

Please sign in to comment.