Skip to content

Commit be8b30b

Browse files
authored
Merge pull request #47 from DevFactory/release/conflicting-field-names-with-method-names-fix-1
Code quality fix - Methods and field names should not be the same or differ only by capitalization.
2 parents 4519055 + 6cae9a9 commit be8b30b

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

common/src/main/java/net/fortytwo/sesametools/ContextInsensitiveStatementComparator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
*/
1313
public class ContextInsensitiveStatementComparator implements Comparator<Statement> {
1414
public final static int BEFORE = -1;
15-
public final static int EQUALS = 0;
15+
public final static int EQUAL = 0;
1616
public final static int AFTER = 1;
1717

1818
@Override
1919
public int compare(Statement first, Statement second) {
2020
if (first == second) {
21-
return EQUALS;
21+
return EQUAL;
2222
}
2323

2424
if (first.getSubject().equals(second.getSubject())) {
2525
if (first.getPredicate().equals(second.getPredicate())) {
2626
if (first.getObject().equals(second.getObject())) {
27-
return EQUALS;
27+
return EQUAL;
2828
} else {
2929
return ValueComparator.getInstance().compare(first.getObject(), second.getObject());
3030
}

common/src/main/java/net/fortytwo/sesametools/StatementComparator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public static StatementComparator getInstance() {
2424
}
2525

2626
public final static int BEFORE = -1;
27-
public final static int EQUALS = 0;
27+
public final static int EQUAL = 0;
2828
public final static int AFTER = 1;
2929

3030
@Override
3131
public int compare(Statement first, Statement second) {
3232
// Cannot use Statement.equals as it does not take Context into account,
3333
// but can check for reference equality (==)
3434
if (first == second) {
35-
return EQUALS;
35+
return EQUAL;
3636
}
3737

3838
if (first.getSubject().equals(second.getSubject())) {
@@ -41,7 +41,7 @@ public int compare(Statement first, Statement second) {
4141
// Context is the only part of a statement that should legitimately be null
4242
if (first.getContext() == null) {
4343
if (second.getContext() == null) {
44-
return EQUALS;
44+
return EQUAL;
4545
} else {
4646
return BEFORE;
4747
}

common/src/main/java/net/fortytwo/sesametools/ValueComparator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static ValueComparator getInstance() {
3636
}
3737

3838
public final static int BEFORE = -1;
39-
public final static int EQUALS = 0;
39+
public final static int EQUAL = 0;
4040
public final static int AFTER = 1;
4141

4242
/**
@@ -57,7 +57,7 @@ public static ValueComparator getInstance() {
5757
public int compare(Value first, Value second) {
5858
if (first == null) {
5959
if (second == null) {
60-
return EQUALS;
60+
return EQUAL;
6161
} else {
6262
return BEFORE;
6363
}
@@ -68,7 +68,7 @@ public int compare(Value first, Value second) {
6868
}
6969

7070
if (first == second || first.equals(second)) {
71-
return EQUALS;
71+
return EQUAL;
7272
}
7373

7474
if (first instanceof BNode) {
@@ -100,7 +100,7 @@ public int compare(Value first, Value second) {
100100
Literal secondLiteral = (Literal) second;
101101
int cmp = firstLiteral.getLabel().compareTo(secondLiteral.getLabel());
102102

103-
if (EQUALS == cmp) {
103+
if (EQUAL == cmp) {
104104
Optional<String> firstLang = firstLiteral.getLanguage();
105105
Optional<String> secondLang = secondLiteral.getLanguage();
106106
if (firstLang.isPresent()) {
@@ -117,7 +117,7 @@ public int compare(Value first, Value second) {
117117
IRI secondType = secondLiteral.getDatatype();
118118
if (null == firstType) {
119119
if (null == secondType) {
120-
return EQUALS;
120+
return EQUAL;
121121
} else {
122122
return BEFORE;
123123
}

common/src/test/java/net/fortytwo/sesametools/StatementComparatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void tearDown() throws Exception {
173173
*/
174174
@Test
175175
public void testStatementComparatorConstants() {
176-
assertEquals(0, StatementComparator.EQUALS);
176+
assertEquals(0, StatementComparator.EQUAL);
177177
assertTrue(StatementComparator.BEFORE < 0);
178178
assertTrue(StatementComparator.AFTER > 0);
179179
}

0 commit comments

Comments
 (0)