Skip to content

Commit

Permalink
objectionary#3160 rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed May 27, 2024
1 parent 56c2ee1 commit 72ce8c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions eo-runtime/src/main/java/org/eolang/PhTraced.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ public final class PhTraced implements Phi {
/**
* Name of property that responsible for keeping max depth.
*/
@SuppressWarnings("PMD.LongVariable")
public static final String
MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME = "EO_MAX_CAGE_RECURSION_DEPTH";
public static final String RECURSION_THRESHOLD = "EO_MAX_CAGE_RECURSION_DEPTH";

/**
* Cages that are currently being dataized. If one cage is being datazed, and
Expand Down Expand Up @@ -77,7 +75,7 @@ public PhTraced(final Phi object, final Integer locator) {
object,
locator,
Integer.parseInt(
System.getProperty(PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME, "100")
System.getProperty(PhTraced.RECURSION_THRESHOLD, "100")
)
);
}
Expand Down
18 changes: 9 additions & 9 deletions eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ class RecursionTests {
@BeforeEach
void setDepth() {
System.setProperty(
PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME, String.valueOf(MAX_DEPTH)
PhTraced.RECURSION_THRESHOLD, String.valueOf(MAX_DEPTH)
);
}

@AfterEach
void clearDepth() {
System.clearProperty(PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME);
System.clearProperty(PhTraced.RECURSION_THRESHOLD);
}

@Test
Expand Down Expand Up @@ -257,7 +257,7 @@ void doesNotThrowIfDataizesConcurrently() {
@Test
void rewritesItselfToItselfViaDummy() {
System.setProperty(
PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME, "2"
PhTraced.RECURSION_THRESHOLD, "2"
);
final Phi cage = EOcageTest.encaged(
new PhWith(new EOcageTest.Dummy(), 0, new Data.ToPhi(1L))
Expand Down Expand Up @@ -295,8 +295,8 @@ void doesNotThrowExceptionIfSmallDepth() {
() -> new Dataized(cage).take(),
String.format(
"We expect that dataizing of nested cage which recursion depth is less than property %s = %s does not throw %s",
PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME,
System.getProperty(PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME),
PhTraced.RECURSION_THRESHOLD,
System.getProperty(PhTraced.RECURSION_THRESHOLD),
ExAbstract.class
)
);
Expand All @@ -316,8 +316,8 @@ void doesNotThrowExceptionIfMaxDepth() {
() -> new Dataized(cage).take(),
String.format(
"We expect that dataizing of nested cage which recursion depth is equal to property %s = %s does not throw %s",
PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME,
System.getProperty(PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME),
PhTraced.RECURSION_THRESHOLD,
System.getProperty(PhTraced.RECURSION_THRESHOLD),
ExAbstract.class
)
);
Expand All @@ -335,8 +335,8 @@ void throwsExceptionIfBigDepth() {
() -> new Dataized(cage).take(),
String.format(
"We expect that dataizing of nested cage which recursion depth is more than property %s = %s does not throw %s",
PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME,
System.getProperty(PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME),
PhTraced.RECURSION_THRESHOLD,
System.getProperty(PhTraced.RECURSION_THRESHOLD),
ExAbstract.class
)
);
Expand Down

0 comments on commit 72ce8c8

Please sign in to comment.