Skip to content

Commit 6a85eb9

Browse files
feat(#3840): fix all the code offences
1 parent 77cdf87 commit 6a85eb9

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

eo-parser/src/main/java/org/eolang/parser/TrStepped.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ final class TrStepped extends TrEnvelope {
5858
)
5959
);
6060

61+
/**
62+
* Ctor.
63+
*
64+
* @param train Original train
65+
*/
6166
TrStepped(final Train<Shift> train) {
6267
this(train, TrStepped.STEPPED);
6368
}
@@ -66,8 +71,9 @@ final class TrStepped extends TrEnvelope {
6671
* Ctor.
6772
*
6873
* @param train Original train
74+
* @param stepped XSL to apply
6975
*/
70-
TrStepped(final Train<Shift> train, Scalar<XSL> stepped) {
76+
TrStepped(final Train<Shift> train, final Scalar<XSL> stepped) {
7177
super(
7278
new TrLambda(
7379
train,
@@ -85,15 +91,39 @@ final class TrStepped extends TrEnvelope {
8591
);
8692
}
8793

88-
static class Once<T> implements Scalar<T> {
94+
/**
95+
* Scalar that loads the value only once.
96+
*
97+
* @param <T> Type of the value
98+
* @since 0.51
99+
*/
100+
static final class Once<T> implements Scalar<T> {
89101

102+
/**
103+
* Origin scalar.
104+
*/
90105
private final Scalar<T> origin;
106+
107+
/**
108+
* Latch to count down.
109+
*/
91110
private final CountDownLatch latch;
92111

112+
/**
113+
* Ctor.
114+
*
115+
* @param origin Origin scalar
116+
*/
93117
Once(final Scalar<T> origin) {
94118
this(origin, new CountDownLatch(1));
95119
}
96120

121+
/**
122+
* Ctor.
123+
*
124+
* @param origin Origin scalar
125+
* @param latch Latch to count down
126+
*/
97127
private Once(final Scalar<T> origin, final CountDownLatch latch) {
98128
this.origin = origin;
99129
this.latch = latch;

eo-parser/src/test/java/org/eolang/parser/TrSteppedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ void addsSheetNameConcurrently() {
8989
XhtmlMatchers.hasXPath("/program/sheets/sheet[text()='wrap-data']")
9090
);
9191
}
92-
}
92+
}

0 commit comments

Comments
 (0)