Skip to content

Commit e8647eb

Browse files
authored
Merge pull request #54 from DevFactory/release/general-code-quality-fix-2
Multiple code quality fix-2
2 parents acbae18 + be9e38e commit e8647eb

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void addListAtNode(final Resource subject,
179179

180180
final Resource aHead = valueFactory.createBNode();
181181

182-
if (nextValues.size() > 0) {
182+
if (!nextValues.isEmpty()) {
183183
graphToAddTo.add(subject, predicate, aHead, contexts);
184184
}
185185

@@ -459,7 +459,7 @@ private List<List<Value>> getValuesForPointerTrails(
459459
}
460460
}
461461

462-
if (nextResult.size() > 0) {
462+
if (!nextResult.isEmpty()) {
463463
results.add(nextResult);
464464
}
465465
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public SailWriter(final Sail sail, final Action action) {
3030
this.action = action;
3131
}
3232

33-
public void finalize() throws Throwable {
33+
protected void finalize() throws Throwable {
3434
super.finalize();
3535

3636
if (null != sailConnection) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void initialize() throws SailException {
9191
*/
9292
public boolean isWritable() throws SailException {
9393
return getBaseSail().isWritable()
94-
&& (writableSet.getNamedGraphs().size() > 0); // TODO: OR the default analysis is writable
94+
&& (!writableSet.getNamedGraphs().isEmpty()); // TODO: OR the default analysis is writable
9595
}
9696

9797
public void shutDown() throws SailException {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public void removeStatements(final Resource subj, final IRI pred, final Value ob
302302
}
303303
}
304304

305-
if (0 < toRemove.size()) {
305+
if (!toRemove.isEmpty()) {
306306
Resource[] ctxArray = new Resource[toRemove.size()];
307307
toRemove.toArray(ctxArray);
308308
super.removeStatements(subj, pred, obj, ctxArray);

rdf-transaction-sail/src/main/java/net/fortytwo/sesametools/rdftransaction/RDFTransactionSailConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void commit() throws SailException {
5959
}
6060

6161
private void commitAll() throws SailException {
62-
if (0 < buffer.size()) {
62+
if (!buffer.isEmpty()) {
6363
sail.handleTransaction(buffer);
6464
}
6565

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static void doTranslation(Repository repository, final String inputUriPre
157157

158158
// add a single empty with clause if they didn't include any IRI resources as contexts
159159
// to make the rest of the code simpler
160-
if (withClauses.size() == 0) {
160+
if (withClauses.isEmpty()) {
161161
withClauses.add("");
162162
}
163163

0 commit comments

Comments
 (0)