Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed May 16, 2024
1 parent d3a8376 commit f4a0dd2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions eo-runtime/src/main/java/org/eolang/PhTraced.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public final class PhTraced implements Phi {
/**
* Locator of encaged object.
*/
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
private final Integer locator;
private final Integer locatr;

/**
* Max depth of cage recursion.
Expand Down Expand Up @@ -91,13 +90,13 @@ public PhTraced(final Phi object, final Integer locator) {
*/
public PhTraced(final Phi object, final Integer locator, final int depth) {
this.object = object;
this.locator = locator;
this.locatr = locator;
this.depth = depth;
}

@Override
public Phi copy() {
return new PhTraced(this.object.copy(), this.locator);
return new PhTraced(this.object.copy(), this.locatr);
}

@Override
Expand Down Expand Up @@ -191,13 +190,13 @@ public T get() {
*/
private Integer incrementCageCounter() {
return PhTraced.DATAIZING_CAGES.get().compute(
PhTraced.this.locator, (key, counter) -> {
PhTraced.this.locatr, (key, counter) -> {
final int ret = this.incremented(counter);
if (ret > PhTraced.this.depth) {
throw new ExFailure(
"The cage %s with locator %d has reached the maximum nesting depth = %d",
PhTraced.this.object,
PhTraced.this.locator,
PhTraced.this.locatr,
PhTraced.this.depth
);
}
Expand Down Expand Up @@ -232,11 +231,11 @@ private void decrementCageCounter(final int incremented) {
final int decremented = incremented - 1;
if (decremented == 0) {
PhTraced.DATAIZING_CAGES.get().remove(
PhTraced.this.locator
PhTraced.this.locatr
);
} else {
PhTraced.DATAIZING_CAGES.get().put(
PhTraced.this.locator, decremented
PhTraced.this.locatr, decremented
);
}
}
Expand Down

0 comments on commit f4a0dd2

Please sign in to comment.