Skip to content

Commit 8983925

Browse files
Sonarqube fixes; clean up TODOs
1 parent 0779dcd commit 8983925

File tree

7 files changed

+4
-20
lines changed

7 files changed

+4
-20
lines changed

jsonpath/src/main/java/io/github/xmljim/json/jsonpath/compiler/PathCompiler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ private void handleLeftParen() {
166166
}
167167

168168
private void handleRightParen() {
169-
//TODO: handle function logic
170169
if (lastEnclosure() == LEFT_PAREN) {
171170
popEnclosure();
172171
appendCurrentToToken();

jsonpath/src/main/java/io/github/xmljim/json/jsonpath/compiler/PredicateCompiler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class PredicateCompiler extends Compiler<Predicate<Context>> {
1717
private Expression right;
1818
private PredicateOperator operator;
1919
private boolean negate;
20-
private boolean nestedPredicate; //TODO: handle "nested" predicate for left/right expressions
20+
private boolean nestedPredicate;
2121
private PredicateJoin predicateJoin = PredicateJoin.NONE;
2222

2323
public PredicateCompiler(PathExpression expression, Global global) {
@@ -216,7 +216,6 @@ private void handleLeftParen() {
216216
}
217217

218218
private void handleRightParen() {
219-
//TODO: handle function logic
220219
if (lastEnclosure() == LEFT_PAREN) {
221220
popEnclosure();
222221
appendCurrentToToken();

jsonpath/src/main/java/io/github/xmljim/json/jsonpath/function/predicate/AbstractPredicateFunction.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import java.util.List;
1212
import java.util.function.Predicate;
13-
import java.util.stream.Stream;
1413

1514
abstract class AbstractPredicateFunction extends AbstractJsonPathFunction implements PredicateFunction {
1615
public AbstractPredicateFunction(String name, List<Argument<?, ?>> arguments, Global global) {
@@ -29,15 +28,4 @@ Predicate<Context> getPredicate(String name) {
2928
return getPredicateArgument(name).element();
3029
}
3130

32-
public Stream<Context> testPredicate(String name, Context input) {
33-
Predicate<Context> predicate = getPredicate(name);
34-
35-
if (input.type().isArray()) {
36-
return input.stream().filter(predicate);
37-
} else if (input.type().isObject()) {
38-
return predicate.test(input) ? Stream.of(input) : Stream.empty();
39-
}
40-
//TODO: revisit this
41-
return Stream.empty();
42-
}
4331
}

parser/src/main/java/io/github/xmljim/json/parser/util/ByteConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public class ByteConstants {
151151
public static final byte END_ARRAY = RIGHT_SQUARE_BRACKET;
152152

153153
private ByteConstants() {
154-
// TODO Auto-generated constructor stub
154+
//IGNORE
155155
}
156156

157157
}

parser/src/main/java/io/github/xmljim/json/parser/util/ByteSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class ByteSequence {
6060
* Private constructor. Use one of the static methods to instantiate the ByteSequence.
6161
*/
6262
private ByteSequence() {
63-
// TODO Auto-generated constructor stub
63+
//IGNORE
6464
}
6565

6666
/**

parser/src/main/java/io/github/xmljim/json/parser/util/CharConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class CharConstants {
2323

2424
private CharConstants() {
25-
// TODO Auto-generated constructor stub
25+
//PRIVATE CONSTRUCTOR
2626
}
2727

2828
public static final char TAB = '\t';

parser/src/main/java/io/github/xmljim/json/parser/util/ResizableByteBuffer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public static ResizableByteBuffer fromStream(InputStream inputStream) {
7878
throw new JsonParserException("No bytes read");
7979
}
8080
} catch (final IOException e) {
81-
// TODO Auto-generated catch block
8281
throw new JsonParserException(e);
8382
}
8483
buffer.add(bytes);
@@ -95,7 +94,6 @@ public static ResizableByteBuffer fromStream(InputStream inputStream, int alloca
9594
buffer.trim();
9695
}
9796
} catch (final IOException e) {
98-
// TODO Auto-generated catch block
9997
throw new JsonParserException(e);
10098
}
10199

0 commit comments

Comments
 (0)