Skip to content

Commit 50289b9

Browse files
author
Faisal Hameed
committed
Fixing squid:S1854, squid:S1066
1 parent 11a910e commit 50289b9

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private void followPointerTrails(Resource nextHead,
485485

486486
Resource nextPointer = nextHead;
487487

488-
boolean allDone = true;
488+
boolean allDone;
489489

490490
do {
491491
// start off thinking all are done, and then set to false as

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,8 @@ public void removeStatements(final Resource subj, final IRI pred, final Value ob
308308
super.removeStatements(subj, pred, obj, ctxArray);
309309
}
310310
} else {
311-
if (null != defaultWriteContext) {
312-
if (deletePermitted(defaultWriteContext)) {
313-
super.removeStatements(subj, pred, obj, defaultWriteContext);
314-
}
311+
if (null != defaultWriteContext && deletePermitted(defaultWriteContext)) {
312+
super.removeStatements(subj, pred, obj, defaultWriteContext);
315313
}
316314
}
317315

linked-data-server/src/main/java/net/fortytwo/sesametools/ldserver/WebResource.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ private void addSeeAlsoStatements(final org.openrdf.model.Resource subject,
189189
Statement st = iter.next();
190190
org.openrdf.model.Resource context = st.getContext();
191191

192-
if (null != context) {
193-
if (context instanceof IRI && context.toString().startsWith(hostIdentifier)) {
194-
contexts.add((IRI) context);
195-
}
192+
if (null != context && context instanceof IRI && context.toString().startsWith(hostIdentifier)) {
193+
contexts.add((IRI) context);
196194
}
197195
}
198196
} finally {
@@ -205,10 +203,8 @@ private void addSeeAlsoStatements(final org.openrdf.model.Resource subject,
205203
Statement st = iter.next();
206204
org.openrdf.model.Resource context = st.getContext();
207205

208-
if (null != context) {
209-
if (context instanceof IRI && context.toString().startsWith(hostIdentifier)) {
210-
contexts.add((IRI) context);
211-
}
206+
if (null != context && context instanceof IRI && context.toString().startsWith(hostIdentifier)) {
207+
contexts.add((IRI) context);
212208
}
213209
}
214210
} finally {

0 commit comments

Comments
 (0)