Skip to content

Commit d7f2854

Browse files
author
Faisal Hameed
committed
Fixing squid:LowerCaseLongSuffixCheck, squid:S2131, squid:UselessParenthesesCheck
1 parent 11a910e commit d7f2854

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void close() throws SailException {
198198
}
199199

200200
public boolean hasNext() throws SailException {
201-
return (null != nextContext);
201+
return null != nextContext;
202202
}
203203

204204
public Resource next() throws SailException {

constrained-sail/src/main/java/net/fortytwo/sesametools/constrained/ConstrainedSailConnection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ public CloseableIteration<? extends Resource, SailException> getContextIDs()
228228

229229
@Override
230230
public String getNamespace(String prefix) throws SailException {
231-
return (namespacesAreReadable)
231+
return namespacesAreReadable
232232
? super.getNamespace(prefix)
233233
: null;
234234
}
235235

236236
@Override
237237
public CloseableIteration<? extends Namespace, SailException> getNamespaces()
238238
throws SailException {
239-
return (namespacesAreReadable)
239+
return namespacesAreReadable
240240
? super.getNamespaces()
241241
: new EmptyCloseableIteration<Namespace, SailException>();
242242
}
@@ -338,7 +338,7 @@ public void setNamespace(final String prefix, final String name) throws SailExce
338338
@Override
339339
public long size(final Resource... contexts) throws SailException {
340340
if (0 == contexts.length) {
341-
return (ALLOW_WILDCARD_SIZE)
341+
return ALLOW_WILDCARD_SIZE
342342
? super.size()
343343
: 0;
344344
} else {

replay-sail/src/main/java/net/fortytwo/sesametools/replay/RecorderSailConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* @author Joshua Shinavier (http://fortytwo.net).
4040
*/
4141
public class RecorderSailConnection extends AbstractSailConnection {
42-
private final String id = "" + new Random().nextInt(0xFFFF);
42+
private final String id = Integer.toString(new Random().nextInt(0xFFFF));
4343
private final Handler<SailConnectionCall, SailException> queryHandler;
4444
private final SailConnection baseSailConnection;
4545
private final ReplayConfiguration config;

sesamize/src/main/java/net/fortytwo/sesametools/sesamize/Sesamize.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private static void doRandom(final SesamizeArgs args) throws Exception {
205205

206206
RDFWriter writer = Rio.createWriter(outputFormat, os);
207207
writer.startRDF();
208-
for (long l = 0l; l < totalTriples; l++) {
208+
for (long l = 0L; l < totalTriples; l++) {
209209
Statement st = rvf.randomStatement();
210210
writer.handleStatement(st);
211211
}

uri-translator/src/main/java/net/fortytwo/sesametools/URITranslator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static void doTranslation(Repository repository, final String inputUriPre
182182
objectTemplateWhereBuilder.append("bind(iri(concat(\"");
183183
objectTemplateWhereBuilder.append(outputUriPrefix);
184184
objectTemplateWhereBuilder.append("\", encode_for_uri(substr(str(?objectUri), ");
185-
objectTemplateWhereBuilder.append((inputUriPrefix.length() + 1));
185+
objectTemplateWhereBuilder.append(inputUriPrefix.length() + 1);
186186
objectTemplateWhereBuilder.append(")))) AS ?normalisedObjectUri) ");
187187
} else {
188188
// the following should be more efficient on large queries for exact matching,
@@ -242,7 +242,7 @@ public static void doTranslation(Repository repository, final String inputUriPre
242242
subjectTemplateWhereBuilder.append("bind(iri(concat(\"");
243243
subjectTemplateWhereBuilder.append(outputUriPrefix);
244244
subjectTemplateWhereBuilder.append("\", encode_for_uri(substr(str(?subjectUri), ");
245-
subjectTemplateWhereBuilder.append((inputUriPrefix.length() + 1));
245+
subjectTemplateWhereBuilder.append(inputUriPrefix.length() + 1);
246246
subjectTemplateWhereBuilder.append(")))) AS ?normalisedSubjectUri) ");
247247
} else {
248248
// the following should be more efficient on large queries for exact matching,
@@ -300,7 +300,7 @@ public static void doTranslation(Repository repository, final String inputUriPre
300300
predicateTemplateWhereBuilder.append("bind(iri(concat(\"");
301301
predicateTemplateWhereBuilder.append(outputUriPrefix);
302302
predicateTemplateWhereBuilder.append("\", encode_for_uri(substr(str(?predicateUri), ");
303-
predicateTemplateWhereBuilder.append((inputUriPrefix.length() + 1));
303+
predicateTemplateWhereBuilder.append(inputUriPrefix.length() + 1);
304304
predicateTemplateWhereBuilder.append(")))) AS ?normalisedPredicateUri) ");
305305
} else {
306306
// the following should be more efficient on large queries for exact matching,

0 commit comments

Comments
 (0)