Skip to content

Commit

Permalink
Fix Qulice errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kniazkov committed Jun 28, 2024
1 parent dea05af commit 516a92a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/cqfn/astranaut/core/base/Position.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ public interface Position extends Comparable<Position> {
*/
int getColumn();

/**
* Compares this position with the specified position for order.
* @param other The position to be compared
* @return A negative integer, zero, or a positive integer as this position is less than,
* equal to, or greater than the specified position.
* @throws IllegalArgumentException If positions are from different sources and cannot
* be compared
*/
@Override
default int compareTo(final Position other) {
if (!this.getSource().equals(other.getSource())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @since 1.1.0
*/
class DifferenceNodeTest {
class DiffNodeTest {
/**
* The folder with test resources.
*/
Expand Down Expand Up @@ -82,12 +82,12 @@ class DifferenceNodeTest {
*/
@Test
void testInsertGetBefore() {
final Node root = this.loadTree(DifferenceNodeTest.TREE_WITH_INSERT);
final Node root = this.loadTree(DiffNodeTest.TREE_WITH_INSERT);
Assertions.assertTrue(root instanceof DiffNode);
final DiffNode diff = (DiffNode) root;
final Node actual = diff.getBefore();
Assertions.assertNotEquals(EmptyTree.INSTANCE, actual);
final Node expected = this.loadTree(DifferenceNodeTest.TREE_AFTER_DELETE);
final Node expected = this.loadTree(DiffNodeTest.TREE_AFTER_DELETE);
Assertions.assertTrue(expected.deepCompare(actual));
}

Expand All @@ -96,12 +96,12 @@ void testInsertGetBefore() {
*/
@Test
void testInsertGetAfter() {
final Node root = this.loadTree(DifferenceNodeTest.TREE_WITH_INSERT);
final Node root = this.loadTree(DiffNodeTest.TREE_WITH_INSERT);
Assertions.assertTrue(root instanceof DiffNode);
final DiffNode diff = (DiffNode) root;
final Node actual = diff.getAfter();
Assertions.assertNotEquals(EmptyTree.INSTANCE, actual);
final Node expected = this.loadTree(DifferenceNodeTest.TREE_BEFO_DELETE);
final Node expected = this.loadTree(DiffNodeTest.TREE_BEFO_DELETE);
Assertions.assertTrue(expected.deepCompare(actual));
}

Expand All @@ -110,18 +110,18 @@ void testInsertGetAfter() {
*/
@Test
void testReplace() {
final Node root = this.loadTree(DifferenceNodeTest.TREE_WITH_REPLACE);
final Node root = this.loadTree(DiffNodeTest.TREE_WITH_REPLACE);
Assertions.assertTrue(root instanceof DiffNode);
final DiffNode diff = (DiffNode) root;
final Node before = diff.getBefore();
Assertions.assertNotEquals(EmptyTree.INSTANCE, before);
Assertions.assertTrue(
before.deepCompare(this.loadTree(DifferenceNodeTest.TREE_BEFORE_REPL))
before.deepCompare(this.loadTree(DiffNodeTest.TREE_BEFORE_REPL))
);
final Node after = diff.getAfter();
Assertions.assertNotEquals(EmptyTree.INSTANCE, after);
Assertions.assertTrue(
after.deepCompare(this.loadTree(DifferenceNodeTest.TREE_AFTER_REPL))
after.deepCompare(this.loadTree(DiffNodeTest.TREE_AFTER_REPL))
);
}

Expand All @@ -130,12 +130,12 @@ void testReplace() {
*/
@Test
void testDeleteGetBefore() {
final Node root = this.loadTree(DifferenceNodeTest.TREE_WITH_DELETE);
final Node root = this.loadTree(DiffNodeTest.TREE_WITH_DELETE);
Assertions.assertTrue(root instanceof DiffNode);
final DiffNode diff = (DiffNode) root;
final Node actual = diff.getBefore();
Assertions.assertNotEquals(EmptyTree.INSTANCE, actual);
final Node expected = this.loadTree(DifferenceNodeTest.TREE_BEFO_DELETE);
final Node expected = this.loadTree(DiffNodeTest.TREE_BEFO_DELETE);
Assertions.assertTrue(expected.deepCompare(actual));
}

Expand All @@ -144,12 +144,12 @@ void testDeleteGetBefore() {
*/
@Test
void testDeleteGetAfter() {
final Node root = this.loadTree(DifferenceNodeTest.TREE_WITH_DELETE);
final Node root = this.loadTree(DiffNodeTest.TREE_WITH_DELETE);
Assertions.assertTrue(root instanceof DiffNode);
final DiffNode diff = (DiffNode) root;
final Node actual = diff.getAfter();
Assertions.assertNotEquals(EmptyTree.INSTANCE, actual);
final Node expected = this.loadTree(DifferenceNodeTest.TREE_AFTER_DELETE);
final Node expected = this.loadTree(DiffNodeTest.TREE_AFTER_DELETE);
Assertions.assertTrue(expected.deepCompare(actual));
}

Expand Down Expand Up @@ -218,7 +218,7 @@ void testDiffNodeAsString() {
* @return The file content
*/
private String getFileContent(final String name) {
final String file = DifferenceNodeTest.TESTS_PATH.concat(name);
final String file = DiffNodeTest.TESTS_PATH.concat(name);
boolean oops = false;
String source = "";
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public Position getEnd() {
* Source implementation for test purposes.
* @since 1.1.5
*/
private static class TestSource implements Source {
private static final class TestSource implements Source {
@Override
public String getFragmentAsString(Position start, Position end) {
public String getFragmentAsString(final Position start, final Position end) {
return "";
}
}
Expand All @@ -72,7 +72,7 @@ public String getFragmentAsString(Position start, Position end) {
* Position implementation for test purposes.
* @since 1.1.5
*/
private static class TestPosition implements Position {
private static final class TestPosition implements Position {
/**
* Source.
*/
Expand All @@ -88,7 +88,7 @@ private static class TestPosition implements Position {
* @param source Source
* @param column Column number
*/
private TestPosition(final Source source, int column) {
private TestPosition(final Source source, final int column) {
this.source = source;
this.column = column;
}
Expand Down

0 comments on commit 516a92a

Please sign in to comment.