Skip to content

Commit

Permalink
fix PMD errors
Browse files Browse the repository at this point in the history
  • Loading branch information
asmirnov-backend committed Jan 18, 2025
1 parent 10943e2 commit 47058c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions eo-runtime/src/main/java/org/eolang/Expect.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @param <T> The type of result
* @since 0.41.0
*/
@SuppressWarnings({"PMD.ShortMethodName", "PMD.UnnecessaryFullyQualifiedName"})
@SuppressWarnings("PMD.ShortMethodName")
public class Expect<T> {

/**
Expand Down Expand Up @@ -248,7 +248,7 @@ public Double it() {
*
* @since 0.51
*/
public static final class Integer {
public static final class Int {

/**
* Expect.
Expand All @@ -259,7 +259,7 @@ public static final class Integer {
* Ctor.
* @param expect Expect
*/
public Integer(final Expect<Phi> expect) {
public Int(final Expect<Phi> expect) {
this.expect = expect;
}

Expand All @@ -268,7 +268,7 @@ public Integer(final Expect<Phi> expect) {
* @return The token
* @checkstyle MethodNameCheck (5 lines)
*/
public java.lang.Integer it() {
public Integer it() {
return this.expect
.that(phi -> new Dataized(phi).asNumber())
.otherwise("must be a number")
Expand All @@ -280,11 +280,12 @@ public java.lang.Integer it() {
}

/**
* Transform Expect to NonNegativeInteger.
* Transform Expect to Natural number.
* Natural number is integer greater or equal to zero.
*
* @since 0.51
*/
public static final class NonNegativeInteger {
public static final class Natural {

/**
* Expect.
Expand All @@ -295,7 +296,7 @@ public static final class NonNegativeInteger {
* Ctor.
* @param expect Expect
*/
public NonNegativeInteger(final Expect<Phi> expect) {
public Natural(final Expect<Phi> expect) {
this.expect = expect;
}

Expand All @@ -304,7 +305,7 @@ public NonNegativeInteger(final Expect<Phi> expect) {
* @return The token
* @checkstyle MethodNameCheck (5 lines)
*/
public java.lang.Integer it() {
public Integer it() {
return this.expect
.that(phi -> new Dataized(phi).asNumber())
.otherwise("must be a number")
Expand Down
10 changes: 5 additions & 5 deletions eo-runtime/src/test/java/org/eolang/ExpectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void failsInTransformingToIntegerForNotNumber() {
"inner class Integer throws error for not a number",
Assertions.assertThrows(
ExFailure.class,
() -> new Expect.Integer(
() -> new Expect.Int(
Expect.at(
new PhWith(
new PhDefault(),
Expand All @@ -214,7 +214,7 @@ void failsInTransformingToIntegerForNotInteger() {
"inner class Integer throws error for not an integer number",
Assertions.assertThrows(
ExFailure.class,
() -> new Expect.Integer(
() -> new Expect.Int(
Expect.at(
new PhWith(
new PhDefault(),
Expand All @@ -236,7 +236,7 @@ void failsInTransformingToNonNegativeIntegerForNotNumber() {
"inner class NonNegativeInteger throws error for not a number",
Assertions.assertThrows(
ExFailure.class,
() -> new Expect.NonNegativeInteger(
() -> new Expect.Natural(
Expect.at(
new PhWith(
new PhDefault(),
Expand All @@ -258,7 +258,7 @@ void failsInTransformingToNonNegativeIntegerForNotInteger() {
"inner class NonNegativeInteger throws error for not an integer number",
Assertions.assertThrows(
ExFailure.class,
() -> new Expect.NonNegativeInteger(
() -> new Expect.Natural(
Expect.at(
new PhWith(
new PhDefault(),
Expand All @@ -280,7 +280,7 @@ void failsInTransformingToNonNegativeIntegerForNegative() {
"inner class NonNegativeInteger throws error for a negative integer",
Assertions.assertThrows(
ExFailure.class,
() -> new Expect.NonNegativeInteger(
() -> new Expect.Natural(
Expect.at(
new PhWith(
new PhDefault(),
Expand Down

0 comments on commit 47058c5

Please sign in to comment.