From c90af451db722db007001f59d832dc3dc4eb425c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Avard=20Ottestad?= Date: Wed, 20 Dec 2023 12:08:49 +0100 Subject: [PATCH] GH-4819 code cleanup and documentation --- assembly-descriptors/pom.xml | 2 +- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- .../sparql/SPARQLServiceEvaluationTest.java | 2 +- ...sibleStoreSPARQL11QueryComplianceTest.java | 6 +-- ...ibleStoreSPARQL11UpdateComplianceTest.java | 8 ++- ...bleStoreConnectionOrderedImplForTests.java | 5 +- .../ExtensibleStoreOrderedImplForTests.java | 5 +- .../impl/OrderedDataStructure.java | 5 +- core/client/pom.xml | 2 +- core/collection-factory/api/pom.xml | 2 +- core/collection-factory/mapdb/pom.xml | 2 +- core/collection-factory/mapdb3/pom.xml | 2 +- core/collection-factory/pom.xml | 2 +- core/common/annotation/pom.xml | 2 +- core/common/exception/pom.xml | 2 +- core/common/io/pom.xml | 2 +- .../eclipse/rdf4j/common/net/ParsedIRI.java | 14 ++--- core/common/iterator/pom.xml | 2 +- .../common/iteration/DualUnionIteration.java | 14 ++--- .../iteration/IndexReportingIterator.java | 2 +- core/common/order/pom.xml | 2 +- .../common/order/AvailableStatementOrder.java | 13 +++++ .../rdf4j/common/order/StatementOrder.java | 11 ++-- core/common/pom.xml | 2 +- core/common/text/pom.xml | 2 +- core/common/transaction/pom.xml | 2 +- core/common/xml/pom.xml | 2 +- core/http/client/pom.xml | 2 +- .../http/client/RDF4JProtocolSession.java | 2 +- .../http/client/SPARQLProtocolSession.java | 4 +- .../http/client/query/AbstractHTTPQuery.java | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model-api/pom.xml | 2 +- core/model-vocabulary/pom.xml | 2 +- core/model/pom.xml | 2 +- .../model/datatypes/XMLDatatypeUtil.java | 2 +- .../model/impl/ValidatingValueFactory.java | 2 +- .../eclipse/rdf4j/model/util/Literals.java | 2 +- .../org/eclipse/rdf4j/model/util/URIUtil.java | 4 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- .../rdf4j/query/impl/EmptyBindingSet.java | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- .../impl/QueryEvaluationContext.java | 52 +++++++++---------- ...ndingSetAssignmentQueryEvaluationStep.java | 2 +- .../evaluation/iterator/PeekMarkIterator.java | 12 +++-- .../optimizer/BindingAssignerOptimizer.java | 2 +- .../evaluation/util/QueryEvaluationUtil.java | 2 +- .../util/QueryEvaluationUtility.java | 2 +- .../iterator/GroupIteratorTest.java | 2 +- .../evaluation/iterator/JoinIteratorTest.java | 2 +- .../evaluation/util/OrderComparatorTest.java | 10 ++-- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- .../org/eclipse/rdf4j/query/algebra/Join.java | 5 ++ .../rdf4j/query/algebra/MultiProjection.java | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- .../query/impl/AbstractParserUpdate.java | 4 +- .../parser/impl/AbstractParserUpdate.java | 4 +- core/queryparser/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- .../query/parser/sparql/SPARQLParser.java | 4 +- .../query/parser/sparql/TupleExprBuilder.java | 4 +- .../parser/sparql/ast/TokenMgrError.java | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- .../binary/BinaryQueryResultWriter.java | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- .../sparqlxml/SPARQLXMLParserCustomTest.java | 2 +- core/queryresultio/text/pom.xml | 2 +- .../text/tsv/SPARQLResultsTSVWriter.java | 2 +- core/repository/api/pom.xml | 2 +- .../repository/config/ConfigTemplate.java | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- .../http/HTTPRepositoryConnection.java | 2 +- core/repository/manager/pom.xml | 2 +- .../repository/manager/RepositoryManager.java | 4 +- .../manager/RepositoryProvider.java | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- .../sail/helpers/SailUpdateExecutor.java | 2 +- core/repository/sparql/pom.xml | 2 +- .../sparql/query/QueryStringUtil.java | 4 +- .../sparql/query/SPARQLOperation.java | 6 +-- core/rio/api/pom.xml | 2 +- .../rdf4j/rio/helpers/AbstractRDFParser.java | 4 +- .../rdf4j/rio/helpers/NTriplesUtil.java | 4 +- .../org/eclipse/rdf4j/rio/RDFWriterTest.java | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- .../jsonld/JSONLDWriterBackgroundTest.java | 2 +- .../rdf4j/rio/jsonld/JSONLDWriterTest.java | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- .../eclipse/rdf4j/rio/rdfxml/SAXFilter.java | 4 +- .../rio/rdfxml/util/RDFXMLPrettyWriter.java | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- .../rdf4j/rio/turtle/TurtleParser.java | 2 +- .../eclipse/rdf4j/rio/turtle/TurtleUtil.java | 4 +- .../rdf4j/rio/turtle/TurtleWriter.java | 4 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- .../eclipse/rdf4j/sail/base/SailDataset.java | 4 ++ core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- .../sail/extensiblestore/SortedIteration.java | 4 +- ...bleStoreConnectionOrderedImplForTests.java | 5 +- .../ExtensibleStoreOrderedImplForTests.java | 5 +- .../ordered/OrderedDataStructure.java | 5 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lmdb/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- .../rdf4j/sail/lucene/impl/LuceneIndex.java | 2 +- core/sail/memory/pom.xml | 2 +- .../rdf4j/sail/memory/MemorySailStore.java | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- .../sail/shacl/ast/StatementMatcher.java | 2 +- .../shacl/ast/planNodes/PatternFilter.java | 2 +- .../sail/shacl/ast/targets/TargetClass.java | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- examples/pom.xml | 2 +- pom.xml | 2 +- spring-components/pom.xml | 2 +- spring-components/rdf4j-spring-demo/pom.xml | 2 +- spring-components/rdf4j-spring/pom.xml | 2 +- .../dao/support/UpdateWithModelBuilder.java | 2 +- .../operation/TupleQueryResultConverter.java | 2 +- .../spring-boot-sparql-web/pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- .../sail/SailIsolationLevelTest.java | 2 +- testsuites/sparql/pom.xml | 2 +- .../SPARQL11UpdateComplianceTest.java | 2 +- tools/config/pom.xml | 2 +- .../common/platform/PlatformFactory.java | 2 +- tools/console/pom.xml | 2 +- .../org/eclipse/rdf4j/console/Console.java | 2 +- .../rdf4j/console/command/Connect.java | 2 +- .../eclipse/rdf4j/console/command/Create.java | 2 +- .../rdf4j/console/command/SparqlTest.java | 4 +- tools/federation/pom.xml | 2 +- .../org/eclipse/rdf4j/federated/FedX.java | 2 +- .../rdf4j/federated/FedXConnection.java | 2 +- .../eclipse/rdf4j/federated/QueryManager.java | 4 +- .../evaluation/SailTripleSource.java | 2 +- .../evaluation/TripleSourceBase.java | 4 +- .../iterator/PrintingIteration.java | 2 +- .../optimizer/DefaultFedXCostModel.java | 2 +- .../optimizer/GenericInfoOptimizer.java | 2 +- .../federated/optimizer/SourceSelection.java | 11 ++-- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- .../navigation/AbstractNavigationNode.java | 6 +-- .../common/webapp/util/HeaderElement.java | 2 +- .../common/webapp/util/HttpServerUtil.java | 2 +- .../server/repository/QueryResultView.java | 2 +- .../namespaces/NamespaceController.java | 4 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- .../base/AbstractRepositoryServlet.java | 2 +- .../workbench/commands/NamespacesServlet.java | 2 +- .../workbench/proxy/WorkbenchServlet.java | 2 +- 206 files changed, 321 insertions(+), 289 deletions(-) diff --git a/assembly-descriptors/pom.xml b/assembly-descriptors/pom.xml index adb16157dc8..b67c7891f49 100644 --- a/assembly-descriptors/pom.xml +++ b/assembly-descriptors/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-assembly-descriptors RDF4J: Assembly Descriptors diff --git a/assembly/pom.xml b/assembly/pom.xml index a88d567f0e5..40c68a1484a 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index f9a2a634d30..eb75ce9afa0 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index 794dacb7bd7..e95dad466a9 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J: Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 41e8785595b..ce9d14ce321 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J: GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index dcf84054c6d..4e143a7eafa 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-lucene-compliance RDF4J: Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 3d3ac105fa9..ffc741bf75a 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index 7a3f7a3e7ff..103007f58ae 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index 069ade53eec..d98fcc9ee25 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index 850062bf2f4..5cbeeca7d75 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-compliance RDF4J: Rio compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 454f5295ca6..2abe270f6ea 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-solr-compliance RDF4J: Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index 3340661c18d..1de0e1073c2 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java index 503a79b27e7..4d75aae8723 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java @@ -268,7 +268,7 @@ public void testVariableNameHandling() throws Exception { assertTrue(tqr.hasNext()); List result = QueryResults.asList(tqr); - assertTrue(result.size() > 0); + assertTrue(!result.isEmpty()); for (BindingSet bs : result) { assertTrue(bs.hasBinding("val")); assertTrue(bs.hasBinding("s")); diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11QueryComplianceTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11QueryComplianceTest.java index 4ff896d0525..279246d81af 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11QueryComplianceTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11QueryComplianceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,10 +7,10 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore; -import org.eclipse.rdf4j.query.Dataset; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.dataset.DatasetRepository; import org.eclipse.rdf4j.repository.sail.SailRepository; diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11UpdateComplianceTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11UpdateComplianceTest.java index 86d260d848d..09b525a6fd8 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11UpdateComplianceTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStoreSPARQL11UpdateComplianceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,12 +7,10 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.extensiblestore; + ******************************************************************************/ -import java.util.Map; +package org.eclipse.rdf4j.sail.extensiblestore; -import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.sail.extensiblestore.impl.ExtensibleStoreOrderedImplForTests; diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreConnectionOrderedImplForTests.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreConnectionOrderedImplForTests.java index 1157c3b2697..5a6c9987e0e 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreConnectionOrderedImplForTests.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreConnectionOrderedImplForTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.impl; import org.eclipse.rdf4j.sail.extensiblestore.ExtensibleStoreConnection; diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreOrderedImplForTests.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreOrderedImplForTests.java index 684e93f3c7c..19087cd00fa 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreOrderedImplForTests.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/ExtensibleStoreOrderedImplForTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.impl; import org.eclipse.rdf4j.common.annotation.InternalUseOnly; diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/OrderedDataStructure.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/OrderedDataStructure.java index 24036425376..75847023972 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/OrderedDataStructure.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/impl/OrderedDataStructure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.impl; import java.util.Collections; diff --git a/core/client/pom.xml b/core/client/pom.xml index 845360a26cc..dcc6771feb5 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/collection-factory/api/pom.xml b/core/collection-factory/api/pom.xml index 5ba6df646b7..e39337fb961 100644 --- a/core/collection-factory/api/pom.xml +++ b/core/collection-factory/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-collection-factory - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-collection-factory-api RDF4J: Collection Factory - API diff --git a/core/collection-factory/mapdb/pom.xml b/core/collection-factory/mapdb/pom.xml index c8e843b984e..3fb7f2728de 100644 --- a/core/collection-factory/mapdb/pom.xml +++ b/core/collection-factory/mapdb/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-collection-factory - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-collection-factory-mapdb RDF4J: Collection Factory - Map DB backed diff --git a/core/collection-factory/mapdb3/pom.xml b/core/collection-factory/mapdb3/pom.xml index e109b32fb68..de753e98014 100644 --- a/core/collection-factory/mapdb3/pom.xml +++ b/core/collection-factory/mapdb3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-collection-factory - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-collection-factory-mapdb3 RDF4J: Collection Factory - Map DB v3 backed diff --git a/core/collection-factory/pom.xml b/core/collection-factory/pom.xml index bb1df7bb226..2309b0ce29b 100644 --- a/core/collection-factory/pom.xml +++ b/core/collection-factory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-collection-factory pom diff --git a/core/common/annotation/pom.xml b/core/common/annotation/pom.xml index f5f53a65e21..b3c8df98930 100644 --- a/core/common/annotation/pom.xml +++ b/core/common/annotation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-annotation RDF4J: common annotation diff --git a/core/common/exception/pom.xml b/core/common/exception/pom.xml index bbd533f1adf..9b6dd2b2976 100644 --- a/core/common/exception/pom.xml +++ b/core/common/exception/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-exception RDF4J: common exception diff --git a/core/common/io/pom.xml b/core/common/io/pom.xml index f99f7f2af4e..4bbf5246908 100644 --- a/core/common/io/pom.xml +++ b/core/common/io/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-io RDF4J: common IO diff --git a/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedIRI.java b/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedIRI.java index 90218819ba2..192f1eab4eb 100644 --- a/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedIRI.java +++ b/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedIRI.java @@ -355,7 +355,7 @@ public String toASCIIString() { appendAscii(sb, userInfo); sb.append('@'); } - if (host.length() > 0) { + if (!host.isEmpty()) { sb.append(IDN.toASCII(host, IDN.ALLOW_UNASSIGNED)); } if (port >= 0) { @@ -516,7 +516,7 @@ public ParsedIRI normalize() { boolean localhost = isScheme("file") && userInfo == null && -1 == port && ("".equals(host) || "localhost".equals(host)); String _host = localhost ? null - : host == null || host.length() == 0 ? host + : host == null || host.isEmpty() ? host : IDN.toUnicode(pctEncodingNormalization(toLowerCase(host)), IDN.USE_STD3_ASCII_RULES | IDN.ALLOW_UNASSIGNED); String _path = _scheme != null && path == null ? "" : normalizePath(path); @@ -581,14 +581,14 @@ public ParsedIRI resolve(ParsedIRI relative) { // relURI._scheme == null // RFC, step 2: - if (relative.getHost() == null && relative.getQuery() == null && relative.getPath().length() == 0) { + if (relative.getHost() == null && relative.getQuery() == null && relative.getPath().isEmpty()) { // Inherit any fragment identifier from relURI String fragment = relative.getFragment(); return new ParsedIRI(this.getScheme(), this.getUserInfo(), this.getHost(), this.getPort(), this.getPath(), this.getQuery(), fragment); - } else if (relative.getHost() == null && relative.getPath().length() == 0) { + } else if (relative.getHost() == null && relative.getPath().isEmpty()) { // Inherit any query or fragment from relURI String query = relative.getQuery(); @@ -636,7 +636,7 @@ public ParsedIRI resolve(ParsedIRI relative) { path = path.substring(0, lastSlashIdx + 1); } - if (path.length() == 0) { + if (path.isEmpty()) { // No path means: start at root. path = "/"; } @@ -782,7 +782,7 @@ private void parse() throws URISyntaxException { if (':' == peek()) { advance(1); String p = parseMember(DIGIT, '/'); - if (p.length() > 0) { + if (!p.isEmpty()) { port = Integer.parseInt(p); } else { port = -1; @@ -1101,7 +1101,7 @@ && isMember(ALPHA, path.codePointAt(1))) { } private String pctEncodingNormalization(String path) { - if (path == null || path.length() == 0 || path.indexOf('%') < 0) { + if (path == null || path.isEmpty() || path.indexOf('%') < 0) { return path; // no pct encodings } String[] encodings = listPctEncodings(path); diff --git a/core/common/iterator/pom.xml b/core/common/iterator/pom.xml index c8b62012574..6ca8cd53723 100644 --- a/core/common/iterator/pom.xml +++ b/core/common/iterator/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-iterator RDF4J: common iterators diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java index 249044f146b..40a95ec76bd 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java @@ -63,13 +63,13 @@ public static CloseableIteration getWildcardInstance( public static CloseableIteration getWildcardInstance(Comparator cmp, CloseableIteration leftIteration, CloseableIteration rightIteration) { -// if (rightIteration instanceof EmptyIteration) { -// return leftIteration; -// } else if (leftIteration instanceof EmptyIteration) { -// return rightIteration; -// } else { - return new DualUnionIteration<>(cmp, leftIteration, rightIteration); -// } + if (rightIteration instanceof EmptyIteration) { + return leftIteration; + } else if (leftIteration instanceof EmptyIteration) { + return rightIteration; + } else { + return new DualUnionIteration<>(cmp, leftIteration, rightIteration); + } } public static CloseableIteration getInstance(CloseableIteration leftIteration, diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IndexReportingIterator.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IndexReportingIterator.java index d141d297dbf..8c6e4e7de66 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IndexReportingIterator.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IndexReportingIterator.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.common.annotation.Experimental; /** - * The index name of the underlying data structure, e.g. SPOC, POSC, etc. + * A way to signal which index is in use for a specific iterator (e.g. SPOC, POSC, etc.). Used in the query explanation. */ @Experimental public interface IndexReportingIterator { diff --git a/core/common/order/pom.xml b/core/common/order/pom.xml index 5228081fc0e..2dbdf43fe3e 100644 --- a/core/common/order/pom.xml +++ b/core/common/order/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-order RDF4J: common order diff --git a/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/AvailableStatementOrder.java b/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/AvailableStatementOrder.java index 246be1f91e9..be00cc4032b 100644 --- a/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/AvailableStatementOrder.java +++ b/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/AvailableStatementOrder.java @@ -18,9 +18,22 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; +/** + * An interface for {@link StatementOrder} implementations that can report which orders they support for a given + * subject, predicate, object and contexts. + */ @Experimental public interface AvailableStatementOrder { + /** + * Returns the supported orders for the given subject, predicate, object and contexts. + * + * @param subj + * @param pred + * @param obj + * @param contexts + * @return the supported orders for the given subject, predicate, object and contexts. + */ @Experimental Set getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts); } diff --git a/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/StatementOrder.java b/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/StatementOrder.java index cee4702aad7..eeaa26d10d1 100644 --- a/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/StatementOrder.java +++ b/core/common/order/src/main/java/org/eclipse/rdf4j/common/order/StatementOrder.java @@ -17,13 +17,16 @@ import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; +/** + * An enum for the different orders in which statements can be ordered. + */ @Experimental public enum StatementOrder { - S, - P, - O, - C; + S, // Subject + P, // Predicate + O, // Object + C; // Context @Experimental public Comparator getComparator(Comparator comparator) { diff --git a/core/common/pom.xml b/core/common/pom.xml index fc821867500..777dc9af104 100644 --- a/core/common/pom.xml +++ b/core/common/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common pom diff --git a/core/common/text/pom.xml b/core/common/text/pom.xml index f26391a3d11..3a1f7c034c1 100644 --- a/core/common/text/pom.xml +++ b/core/common/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-text RDF4J: common text diff --git a/core/common/transaction/pom.xml b/core/common/transaction/pom.xml index 2a327eba54c..14c85825dca 100644 --- a/core/common/transaction/pom.xml +++ b/core/common/transaction/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-transaction RDF4J: common transaction diff --git a/core/common/xml/pom.xml b/core/common/xml/pom.xml index 76184d6e127..46160b4db67 100644 --- a/core/common/xml/pom.xml +++ b/core/common/xml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-common - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-common-xml RDF4J: common XML diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index 8e26e6c8d3f..fb4d826a565 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java index 158216ba4c2..9b32d23f023 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java @@ -1069,7 +1069,7 @@ protected void upload(HttpEntity reqEntity, String baseURI, boolean overwrite, b for (String encodedContext : Protocol.encodeContexts(contexts)) { url.addParameter(Protocol.CONTEXT_PARAM_NAME, encodedContext); } - if (baseURI != null && baseURI.trim().length() != 0) { + if (baseURI != null && !baseURI.trim().isEmpty()) { String encodedBaseURI = Protocol.encodeValue(SimpleValueFactory.getInstance().createIRI(baseURI)); url.setParameter(Protocol.BASEURI_PARAM_NAME, encodedBaseURI); } diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java index 29d621999f5..c4cc52e1ab5 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java @@ -606,7 +606,7 @@ protected List getUpdateMethodParameters(QueryLanguage ql, String } if (dataset != null) { - if (dataset.getDefaultRemoveGraphs().size() > 0) { + if (!dataset.getDefaultRemoveGraphs().isEmpty()) { if (!(dataset.getDefaultRemoveGraphs().equals(dataset.getDefaultGraphs()))) { logger.warn( "ambiguous dataset spec for SPARQL endpoint: default graphs and default remove graphs both defined but not equal"); @@ -1091,7 +1091,7 @@ protected HttpResponse execute(HttpUriRequest method) throws IOException, RDF4JE throw new RepositoryException(new RemoteShaclValidationException( new StringReader(errInfo.toString()), "", format)); - } else if (errInfo.toString().length() > 0) { + } else if (!errInfo.toString().isEmpty()) { throw new RepositoryException(errInfo.toString()); } else { throw new RepositoryException(response.getStatusLine().getReasonPhrase()); diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/query/AbstractHTTPQuery.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/query/AbstractHTTPQuery.java index a9bb5dfaf77..ed35c287c32 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/query/AbstractHTTPQuery.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/query/AbstractHTTPQuery.java @@ -44,7 +44,7 @@ protected AbstractHTTPQuery(SPARQLProtocolSession httpClient, QueryLanguage quer // for legacy reasons we should support the empty string for baseURI // this is used in the SPARQL repository in several places, e.g. in // getStatements - this.baseURI = baseURI != null && baseURI.length() > 0 ? baseURI : null; + this.baseURI = baseURI != null && !baseURI.isEmpty() ? baseURI : null; } /** diff --git a/core/http/pom.xml b/core/http/pom.xml index ee3e0261ad0..1da8c205c90 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index a5d66a693e0..e7bce8e2473 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model-api/pom.xml b/core/model-api/pom.xml index cf07e38798c..75f807bf88b 100644 --- a/core/model-api/pom.xml +++ b/core/model-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-model-api RDF4J: Model API diff --git a/core/model-vocabulary/pom.xml b/core/model-vocabulary/pom.xml index bd27791c1d8..cd1a34790ac 100644 --- a/core/model-vocabulary/pom.xml +++ b/core/model-vocabulary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-model-vocabulary RDF4J: RDF Vocabularies diff --git a/core/model/pom.xml b/core/model/pom.xml index 17a4deb868b..4323289da0f 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java b/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java index 2fd377f3d0a..5a84f284d9f 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java @@ -2100,7 +2100,7 @@ public static Duration parseDuration(String s) { * plus signs cannot be parsed by methods such as {@link Integer#parseInt(String)}. */ private static String trimPlusSign(String s) { - if (s.length() > 0 && s.charAt(0) == '+') { + if (!s.isEmpty() && s.charAt(0) == '+') { return s.substring(1); } else { return s; diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/ValidatingValueFactory.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/ValidatingValueFactory.java index 437c97221a0..1bf08faeb77 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/ValidatingValueFactory.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/ValidatingValueFactory.java @@ -94,7 +94,7 @@ public IRI createIRI(String namespace, String localName) { @Override public BNode createBNode(String nodeID) { - if (nodeID.length() < 1) { + if (nodeID.isEmpty()) { throw new IllegalArgumentException("Blank node ID cannot be empty"); } if (!isMember(PN_CHARS_U, nodeID.codePointAt(0))) { diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java index 2896e5a4d2e..cfd77d59ebe 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java @@ -545,7 +545,7 @@ public static boolean isValidLanguageTag(String languageTag) { public static boolean langMatches(String langTag, String langRange) { boolean result = false; if (langRange.equals("*")) { - result = langTag.length() > 0; + result = !langTag.isEmpty(); } else if (langTag.length() == langRange.length()) { result = langTag.equalsIgnoreCase(langRange); } else if (langTag.length() > langRange.length()) { diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/URIUtil.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/URIUtil.java index 48f0b912ab6..e3495f23d43 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/URIUtil.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/URIUtil.java @@ -97,7 +97,7 @@ public static boolean isCorrectURISplit(String namespace, String localName) { assert namespace != null : "namespace must not be null"; assert localName != null : "localName must not be null"; - if (namespace.length() == 0) { + if (namespace.isEmpty()) { return false; } @@ -213,7 +213,7 @@ private static boolean isUnreserved(char c) { */ public static boolean isValidLocalName(String name) { // Empty names are legal - if (name.length() == 0) { + if (name.isEmpty()) { return true; } diff --git a/core/pom.xml b/core/pom.xml index ed94faedcde..dfdb2f84966 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index 6600bd51a4e..8b1f374544e 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/EmptyBindingSet.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/EmptyBindingSet.java index 8ee7737b90b..1b416b3cf3c 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/EmptyBindingSet.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/EmptyBindingSet.java @@ -69,7 +69,7 @@ public int size() { @Override public boolean equals(Object o) { if (o instanceof BindingSet) { - return ((BindingSet) o).size() == 0; + return ((BindingSet) o).isEmpty(); } return false; diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index a29c5f1ab29..558421515d8 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryEvaluationContext.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryEvaluationContext.java index 113d87a31a6..062863a1237 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryEvaluationContext.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryEvaluationContext.java @@ -18,6 +18,7 @@ import java.util.function.Function; import java.util.function.Predicate; +import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; @@ -36,7 +37,10 @@ */ public interface QueryEvaluationContext { - Comparator getComparator(); + @Experimental + default Comparator getComparator() { + return null; + } class Minimal implements QueryEvaluationContext { @@ -57,20 +61,21 @@ class Minimal implements QueryEvaluationContext { // this field is volatile, as a precaution in case we call it directly. private volatile Literal now; private final Dataset dataset; - private final ValueFactory vf; + private final ValueFactory valueFactory; private final Comparator comparator; /** * Set the shared now value to a preexisting object * - * @param now that is shared. - * @param dataset that a query should use to evaluate + * @param now that is shared. + * @param dataset that a query should use to evaluate + * @param comparator to use for ordering */ public Minimal(Literal now, Dataset dataset, Comparator comparator) { super(); this.now = now; this.dataset = dataset; - this.vf = SimpleValueFactory.getInstance(); + this.valueFactory = SimpleValueFactory.getInstance(); this.comparator = comparator; } @@ -81,47 +86,42 @@ public Minimal(Literal now, Dataset dataset, Comparator comparator) { * @param dataset that a query should use to evaluate */ public Minimal(Literal now, Dataset dataset) { - super(); - this.now = now; - this.dataset = dataset; - this.vf = SimpleValueFactory.getInstance(); - this.comparator = null; + this(now, dataset, null); } /** * @param dataset that a query should use to evaluate */ public Minimal(Dataset dataset) { - this.dataset = dataset; - this.vf = SimpleValueFactory.getInstance(); - this.comparator = null; + this(null, dataset); } /** - * @param dataset that a query should use to evaluate + * @param dataset that a query should use to evaluate + * @param comparator to use for ordering */ public Minimal(Dataset dataset, Comparator comparator) { - this.dataset = dataset; - this.vf = SimpleValueFactory.getInstance(); - this.comparator = comparator; + this(null, dataset, comparator); } /** - * @param dataset that a query should use to the evaluate + * @param dataset that a query should use to the evaluate + * @param valueFactory that a query should use to the evaluate + * @param comparator to use for ordering + * */ - public Minimal(Dataset dataset, ValueFactory vf, Comparator comparator) { + public Minimal(Dataset dataset, ValueFactory valueFactory, Comparator comparator) { this.dataset = dataset; - this.vf = vf; + this.valueFactory = valueFactory; this.comparator = comparator; } /** - * @param dataset that a query should use to the evaluate + * @param dataset that a query should use to the evaluate + * @param valueFactory that a query should use to the evaluate */ - public Minimal(Dataset dataset, ValueFactory vf) { - this.dataset = dataset; - this.vf = vf; - this.comparator = null; + public Minimal(Dataset dataset, ValueFactory valueFactory) { + this(dataset, valueFactory, null); } @Override @@ -136,7 +136,7 @@ public Literal getNow() { // creating a new date is expensive because it uses the XMLGregorianCalendar implementation which is very // complex. if (now == null) { - now = vf.createLiteral(new Date()); + now = valueFactory.createLiteral(new Date()); boolean success = NOW.compareAndSet(this, null, now); if (!success) { now = (Literal) NOW.getAcquire(this); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java index 096339d3d3b..aed74fe87f5 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java @@ -36,7 +36,7 @@ public BindingSetAssignmentQueryEvaluationStep(BindingSetAssignment node, QueryE @Override public CloseableIteration evaluate(BindingSet bindings) { final Iterator assignments = node.getBindingSets().iterator(); - if (bindings.size() == 0) { + if (bindings.isEmpty()) { // we can just return the assignments directly without checking existing bindings return new CloseableIteratorIteration<>(assignments); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PeekMarkIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PeekMarkIterator.java index acf331272b4..dc46b2eaccb 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PeekMarkIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PeekMarkIterator.java @@ -21,8 +21,7 @@ /** * An iterator that allows to peek at the next element without consuming it. It also allows to mark the current position - * and reset to that position. Reset can be called multiple times, as long as the underlying iterator has not been - * advanced beyond peek. + * and reset to that position. * * @author HÃ¥vard M. Ottestad */ @@ -96,7 +95,7 @@ public E next() { /** * - * @return the next element without consuming it, or null if there are no more elements. + * @return the next element without consuming it, or null if there are no more elements */ public E peek() { if (closed) { @@ -108,7 +107,7 @@ public E peek() { /** * Mark the current position so that the iterator can be reset to the current state. This will cause elements to be - * stored in memory until one of {@link #reset()}, {@link #unmark()} or {@link #mark()} is called + * stored in memory until one of {@link #reset()}, {@link #unmark()} or {@link #mark()} is called. */ public void mark() { if (closed) { @@ -125,7 +124,10 @@ public void mark() { /** * Reset the iterator to the marked position. Resetting an iterator multiple times will always reset to the same - * position. If the iterator was not marked, this will throw an exception. + * position. Resetting an iterator turns off marking. If the iterator was reset previously and the iterator has + * advanced beyond the point where reset was initially called, then the iterator can no longer be reset because + * there will be elements that were not stored while the iterator was marked and resetting will cause these elements + * to be lost. */ public void reset() { if (closed) { diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/optimizer/BindingAssignerOptimizer.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/optimizer/BindingAssignerOptimizer.java index f444892c1f2..9782bd6b176 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/optimizer/BindingAssignerOptimizer.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/optimizer/BindingAssignerOptimizer.java @@ -28,7 +28,7 @@ public class BindingAssignerOptimizer implements QueryOptimizer { @Override public void optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings) { - if (bindings.size() > 0) { + if (!bindings.isEmpty()) { tupleExpr.visit(new VarVisitor(bindings)); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java index 7f2d6acf1a7..b5a3853a287 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java @@ -68,7 +68,7 @@ public static boolean getEffectiveBooleanValue(Value value) throws ValueExprEval CoreDatatype.XSD datatype = literal.getCoreDatatype().asXSDDatatypeOrNull(); if (datatype == CoreDatatype.XSD.STRING) { - return label.length() > 0; + return !label.isEmpty(); } else if (datatype == CoreDatatype.XSD.BOOLEAN) { // also false for illegal values return "true".equals(label) || "1".equals(label); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtility.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtility.java index ea04b96990d..812e9293afb 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtility.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtility.java @@ -59,7 +59,7 @@ public static Result getEffectiveBooleanValue(Value value) { CoreDatatype.XSD datatype = literal.getCoreDatatype().asXSDDatatypeOrNull(); if (datatype == CoreDatatype.XSD.STRING) { - return Result.fromBoolean(label.length() > 0); + return Result.fromBoolean(!label.isEmpty()); } else if (datatype == CoreDatatype.XSD.BOOLEAN) { // also false for illegal values return Result.fromBoolean("true".equals(label) || "1".equals(label)); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java index affe4bf209a..23fa0211849 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java @@ -64,7 +64,7 @@ public class GroupIteratorTest { private final static ValueFactory vf = SimpleValueFactory.getInstance(); private static final EvaluationStrategy evaluator = new StrictEvaluationStrategy(null, null); private static final QueryEvaluationContext context = new QueryEvaluationContext.Minimal( - vf.createLiteral(Date.from(Instant.now())), null); + vf.createLiteral(Date.from(Instant.now())), null, null); private static BindingSetAssignment EMPTY_ASSIGNMENT; private static BindingSetAssignment NONEMPTY_ASSIGNMENT; private static AggregateFunctionFactory aggregateFunctionFactory; diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java index 1e8342ab49c..e40d5973203 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java @@ -59,7 +59,7 @@ public CloseableIteration getStatements(Resource subj, IRI } }, null); private final QueryEvaluationContext context = new QueryEvaluationContext.Minimal( - vf.createLiteral(Date.from(Instant.now())), null); + vf.createLiteral(Date.from(Instant.now())), null, null); /** * Tests joins between two different BindingSetAssignments with the same BindingSets but ordered differently. diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/OrderComparatorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/OrderComparatorTest.java index 0fc34e640f5..5469ebf76d9 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/OrderComparatorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/OrderComparatorTest.java @@ -47,9 +47,9 @@ public class OrderComparatorTest { private static final ValueFactory vf = SimpleValueFactory.getInstance(); private final QueryEvaluationContext context = new QueryEvaluationContext.Minimal( - vf.createLiteral(Date.from(Instant.now())), null); + vf.createLiteral(Date.from(Instant.now())), null, null); - class EvaluationStrategyStub implements EvaluationStrategy { + static class EvaluationStrategyStub implements EvaluationStrategy { @Override public CloseableIteration evaluate(TupleExpr expr, BindingSet bindings) @@ -69,19 +69,19 @@ public QueryEvaluationStep precompile(TupleExpr expr, QueryEvaluationContext con @Override public Value evaluate(ValueExpr expr, BindingSet bindings) - throws ValueExprEvaluationException, QueryEvaluationException { + throws QueryEvaluationException { return null; } @Override public boolean isTrue(ValueExpr expr, BindingSet bindings) - throws ValueExprEvaluationException, QueryEvaluationException { + throws QueryEvaluationException { throw new UnsupportedOperationException(); } @Override public boolean isTrue(QueryValueEvaluationStep expr, BindingSet bindings) - throws ValueExprEvaluationException, QueryEvaluationException { + throws QueryEvaluationException { throw new UnsupportedOperationException(); } diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index 10fcbc837ce..464d27ce157 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index c561441a066..ce8d3ac617f 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java index 9b8a261635d..514a3f31cda 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java @@ -13,6 +13,8 @@ import java.util.LinkedHashSet; import java.util.Set; +import org.eclipse.rdf4j.common.annotation.Experimental; + /** * A natural join between two tuple expressions. */ @@ -72,14 +74,17 @@ public Join clone() { return (Join) super.clone(); } + @Experimental public boolean isMergeJoin() { return mergeJoin; } + @Experimental public void setMergeJoin(boolean mergeJoin) { this.mergeJoin = mergeJoin; } + @Experimental public void setCacheable(boolean cacheable) { this.cacheable = cacheable; } diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java index d86dd59aa64..ec6684f7666 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java @@ -86,7 +86,7 @@ public Set getBindingNames() { public Set getAssuredBindingNames() { Set bindingNames = new HashSet<>(); - if (projections.size() >= 1) { + if (!projections.isEmpty()) { Set assuredSourceNames = getArg().getAssuredBindingNames(); bindingNames.addAll(projections.get(0).getProjectedNamesFor(assuredSourceNames)); diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index fb04d8339cd..0f7bead1a49 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index 6450c375f42..4b9a1cbacb9 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java index bb86911185f..4c2a18a5d93 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java @@ -88,11 +88,11 @@ protected Dataset getMergedDataset(Dataset sparqlDefinedDataset) { // if there are default graphs in the SPARQL update but it's not a WITH // clause, it's a USING clause - final boolean hasUsingClause = !hasWithClause && sparqlDefaultGraphs != null ? sparqlDefaultGraphs.size() > 0 + final boolean hasUsingClause = !hasWithClause && sparqlDefaultGraphs != null ? !sparqlDefaultGraphs.isEmpty() : false; final Set sparqlNamedGraphs = sparqlDefinedDataset.getNamedGraphs(); - final boolean hasUsingNamedClause = sparqlNamedGraphs != null ? sparqlNamedGraphs.size() > 0 : false; + final boolean hasUsingNamedClause = sparqlNamedGraphs != null ? !sparqlNamedGraphs.isEmpty() : false; if (hasUsingClause) { // one or more USING-clauses in the update itself, we need to diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java index 687339c8923..7603fc60582 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java @@ -90,11 +90,11 @@ protected Dataset getMergedDataset(Dataset sparqlDefinedDataset) { // if there are default graphs in the SPARQL update but it's not a WITH // clause, it's a USING clause - final boolean hasUsingClause = !hasWithClause && sparqlDefaultGraphs != null ? sparqlDefaultGraphs.size() > 0 + final boolean hasUsingClause = !hasWithClause && sparqlDefaultGraphs != null ? !sparqlDefaultGraphs.isEmpty() : false; final Set sparqlNamedGraphs = sparqlDefinedDataset.getNamedGraphs(); - final boolean hasUsingNamedClause = sparqlNamedGraphs != null ? sparqlNamedGraphs.size() > 0 : false; + final boolean hasUsingNamedClause = sparqlNamedGraphs != null ? !sparqlNamedGraphs.isEmpty() : false; if (hasUsingClause) { // one or more USING-clauses in the update itself, we need to diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index 0dfcb8573d3..57934177bd0 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index d21ecf2b1b2..7faa7333166 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java index 1bd0c08d6e6..76e86503bbf 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java @@ -259,7 +259,7 @@ public static void main(String[] args) throws java.io.IOException { int emptyLineCount = 0; while ((line = in.readLine()) != null) { - if (line.length() > 0) { + if (!line.isEmpty()) { emptyLineCount = 0; buf.append(' ').append(line).append('\n'); } else { @@ -269,7 +269,7 @@ public static void main(String[] args) throws java.io.IOException { if (emptyLineCount == 2) { emptyLineCount = 0; String queryStr = buf.toString().trim(); - if (queryStr.length() > 0) { + if (!queryStr.isEmpty()) { try { long start = System.currentTimeMillis(); ParsedOperation parsedQuery = QueryParserUtil.parseOperation(QueryLanguage.SPARQL, queryStr, diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TupleExprBuilder.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TupleExprBuilder.java index 35adb2164b0..2fa952ee627 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TupleExprBuilder.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TupleExprBuilder.java @@ -561,7 +561,7 @@ public TupleExpr visit(ASTSelect node, Object data) throws VisitorException { AggregateCollector collector = new AggregateCollector(); valueExpr.visit(collector); - if (collector.getOperators().size() > 0) { + if (!collector.getOperators().isEmpty()) { elem.setAggregateOperatorInExpression(true); for (AggregateOperator operator : collector.getOperators()) { // Apply implicit grouping if necessary @@ -1150,7 +1150,7 @@ public String visit(ASTGroupCondition node, Object data) throws VisitorException extension.addElement(elem); } - if (extension.getElements().size() > 0 && !(arg instanceof Extension)) { + if (!extension.getElements().isEmpty() && !(arg instanceof Extension)) { extension.setArg(arg); group.setArg(extension); } diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/TokenMgrError.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/TokenMgrError.java index 0f2f246d32f..5e6b36bd4ac 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/TokenMgrError.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/TokenMgrError.java @@ -107,7 +107,7 @@ protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, errorLine + ", column " + // errorColumn + ". Encountered: " + // (EOFSeen ? "" : ("'" + addEscapes(String.valueOf(curChar)) + "' (" + (int) curChar + "),")) + // - (errorAfter == null || errorAfter.length() == 0 ? "" + (errorAfter == null || errorAfter.isEmpty() ? "" : " after prefix \"" + addEscapes(errorAfter) + "\"")) + // (lexState == 0 ? "" : " (in lexical state " + lexState + ")"); diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index 8db12169a80..ce5bc768435 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index 273fe3b9801..523f4037078 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index 34df6c0b64f..0c8de380987 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/binary/src/main/java/org/eclipse/rdf4j/query/resultio/binary/BinaryQueryResultWriter.java b/core/queryresultio/binary/src/main/java/org/eclipse/rdf4j/query/resultio/binary/BinaryQueryResultWriter.java index 4a422864a2e..7aa3d170ed5 100644 --- a/core/queryresultio/binary/src/main/java/org/eclipse/rdf4j/query/resultio/binary/BinaryQueryResultWriter.java +++ b/core/queryresultio/binary/src/main/java/org/eclipse/rdf4j/query/resultio/binary/BinaryQueryResultWriter.java @@ -174,7 +174,7 @@ protected void handleSolutionImpl(BindingSet bindingSet) throws TupleQueryResult } try { - if (bindingSet.size() == 0) { + if (bindingSet.isEmpty()) { writeEmptyRow(); } else { for (String bindingName : bindingNames) { diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index c1ba95a8c53..10f949b5493 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index c5f589b6457..1fe82dc1aaa 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index 8d7bee2745b..19aeb0ef536 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/sparqlxml/src/test/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserCustomTest.java b/core/queryresultio/sparqlxml/src/test/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserCustomTest.java index 8bd9997a60d..7c541d72e04 100644 --- a/core/queryresultio/sparqlxml/src/test/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserCustomTest.java +++ b/core/queryresultio/sparqlxml/src/test/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserCustomTest.java @@ -182,6 +182,6 @@ public void testEntityExpansionNoSecureProcessing() throws Exception { @Test public void testSupportedSettings() { - assertTrue(QueryResultIO.createTupleParser(TupleQueryResultFormat.SPARQL).getSupportedSettings().size() > 0); + assertTrue(!QueryResultIO.createTupleParser(TupleQueryResultFormat.SPARQL).getSupportedSettings().isEmpty()); } } diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index e5f67e0b32e..f464cddf491 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java index 0f780f8f822..3bcbfc74a1a 100644 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java +++ b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java @@ -201,7 +201,7 @@ private void writeLiteral(Literal lit) throws IOException { // Append the literal's datatype writer.write("^^"); writeURI(datatype); - } else if (label.length() > 0 && encoded.equals(label) && label.charAt(0) != '<' && label.charAt(0) != '_' + } else if (!label.isEmpty() && encoded.equals(label) && label.charAt(0) != '<' && label.charAt(0) != '_' && !label.matches("^[\\+\\-]?[\\d\\.].*")) { // no need to include double quotes writer.write(encoded); diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 48fdeecfad7..6f5e94a505f 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/ConfigTemplate.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/ConfigTemplate.java index 527ae592047..71a1a1272a3 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/ConfigTemplate.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/ConfigTemplate.java @@ -72,7 +72,7 @@ private void parseTemplate() { String[] tokensArray = group.substring(2, group.length() - 2).split("\\|"); List tokens = Arrays.asList(tokensArray); String var = tokens.get(0).trim(); - if (var.length() == 0) { + if (var.isEmpty()) { throw new IllegalArgumentException("Illegal template token: " + matcher.group()); } if (!variableMap.containsKey(var)) { diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index 39bcbf0668c..dee3dbfeea9 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index c843dccda42..d5bf8ba4979 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index 3a3109cf967..ec719dad3f5 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index 4fc07dc06e9..526becc1b17 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java b/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java index ed46772d38d..ceccfdeaaeb 100644 --- a/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java +++ b/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java @@ -310,7 +310,7 @@ public void commit() throws RepositoryException { if (this.getRepository().useCompatibleMode()) { synchronized (txn) { - if (txn.size() > 0) { + if (!txn.isEmpty()) { try { client.sendTransaction(txn); txn.clear(); diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index bad53d7101e..4f81638f7a3 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryManager.java b/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryManager.java index 21fcbee8843..9109ebd64fc 100644 --- a/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryManager.java +++ b/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryManager.java @@ -192,12 +192,12 @@ public String getNewRepositoryID(String baseName) throws RepositoryException, Re } // First try if we can use the base name without an appended index - if (baseName != null && baseName.length() > 0 && !hasRepositoryConfig(baseName)) { + if (baseName != null && !baseName.isEmpty() && !hasRepositoryConfig(baseName)) { return baseName; } // When the base name is null or empty, generate one - if (baseName == null || baseName.length() == 0) { + if (baseName == null || baseName.isEmpty()) { baseName = "repository-"; } else if (!baseName.endsWith("-")) { baseName += "-"; diff --git a/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryProvider.java b/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryProvider.java index c292a3d099c..eb312830f99 100644 --- a/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryProvider.java +++ b/core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager/RepositoryProvider.java @@ -142,7 +142,7 @@ public static RepositoryManager getRepositoryManagerOfRepository(String url) } int idx = url.lastIndexOf(REPOSITORIES); String server = url.substring(0, idx); - if (server.length() == 0) { + if (server.isEmpty()) { server = "."; } return getRepositoryManager(server); diff --git a/core/repository/pom.xml b/core/repository/pom.xml index 873757a9580..fa011b16913 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index fb8fc483b2b..a5137e09479 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/helpers/SailUpdateExecutor.java b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/helpers/SailUpdateExecutor.java index 608c6e0cd7b..06fcf840f25 100644 --- a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/helpers/SailUpdateExecutor.java +++ b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/helpers/SailUpdateExecutor.java @@ -510,7 +510,7 @@ protected BindingSet convert(BindingSet sourceBinding) throws QueryEvaluationExc // If so, merge. Set uniqueBindings = new HashSet<>(uc.getBindingSet().getBindingNames()); uniqueBindings.removeAll(sourceBinding.getBindingNames()); - if (uniqueBindings.size() > 0) { + if (!uniqueBindings.isEmpty()) { MapBindingSet mergedSet = new MapBindingSet(); for (String bindingName : sourceBinding.getBindingNames()) { final Binding binding = sourceBinding.getBinding(bindingName); diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index 66d5ee263ce..47b218d83c2 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java index 857a38365b5..94835c00747 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java @@ -55,7 +55,7 @@ public static String getQueryString(String queryString, BindingSet bindings) { * @return the modified queryString */ public static String getTupleQueryString(String queryString, BindingSet bindings) { - if (bindings.size() == 0) { + if (bindings.isEmpty()) { return queryString; } @@ -108,7 +108,7 @@ public static String getBooleanQueryString(String queryString, BindingSet bindin * @return the modified queryString */ public static String getGraphQueryString(String queryString, BindingSet bindings) { - if (bindings.size() == 0) { + if (bindings.isEmpty()) { return queryString; } diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/SPARQLOperation.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/SPARQLOperation.java index abf0347aa90..f1e9b8ba114 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/SPARQLOperation.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/SPARQLOperation.java @@ -51,7 +51,7 @@ protected SPARQLOperation(HttpClient client, String url, String base, String ope this.url = url; this.operation = operation; this.client = client; - boolean abs = base != null && base.length() > 0 && ParsedIRI.create(base).isAbsolute(); + boolean abs = base != null && !base.isEmpty() && ParsedIRI.create(base).isAbsolute(); if (abs && !operation.toUpperCase().contains("BASE")) { this.operation = "BASE <" + base + "> " + operation; } @@ -109,7 +109,7 @@ protected void execute(Runnable command) { } protected Set getBindingNames() { - if (bindings.size() == 0) { + if (bindings.isEmpty()) { return Collections.EMPTY_SET; } Set names = new HashSet<>(); @@ -129,7 +129,7 @@ protected Set getBindingNames() { } protected String getQueryString() { - if (bindings.size() == 0) { + if (bindings.isEmpty()) { return operation; } String qry = operation; diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 427b134f5d9..27149ff4de7 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/AbstractRDFParser.java b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/AbstractRDFParser.java index a1b064b7a19..e1aeb14ca83 100644 --- a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/AbstractRDFParser.java +++ b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/AbstractRDFParser.java @@ -329,7 +329,7 @@ protected IRI resolveURI(String uriSpec) throws RDFParseException { } if (getParserConfig().get(BasicParserSettings.VERIFY_RELATIVE_URIS)) { - if (uriSpec.length() > 0 && !uriSpec.startsWith("#") && baseURI.isOpaque()) { + if (!uriSpec.isEmpty() && !uriSpec.startsWith("#") && baseURI.isOpaque()) { reportError("Relative URI '" + uriSpec + "' cannot be resolved using the opaque base URI '" + baseURI + "'", BasicParserSettings.VERIFY_RELATIVE_URIS); } @@ -746,7 +746,7 @@ private String createUniqueBNodePrefix() { private ParsedIRI getCachedSkolemOrigin() { String origin = getParserConfig().get(BasicParserSettings.SKOLEMIZE_ORIGIN); - if (origin == null || origin.length() == 0) { + if (origin == null || origin.isEmpty()) { if (skolemOrigin != null) { skolemOrigin = null; parsedSkolemOrigin = null; diff --git a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java index 4704e7560da..ad2195abaf0 100644 --- a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java +++ b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java @@ -219,7 +219,7 @@ private static TripleMatch parseTripleInternal(String nTriplesTriple, ValueFacto String triple = nTriplesTriple.substring(2); int offset = 2; - while (triple.length() > 0 && Character.isWhitespace(triple.charAt(0))) { + while (!triple.isEmpty() && Character.isWhitespace(triple.charAt(0))) { triple = triple.substring(1); ++offset; } @@ -277,7 +277,7 @@ private static TripleMatch parseTripleInternal(String nTriplesTriple, ValueFacto } object = v; } - while (triple.length() > 0 && Character.isWhitespace(triple.charAt(0))) { + while (!triple.isEmpty() && Character.isWhitespace(triple.charAt(0))) { triple = triple.substring(1); ++offset; } diff --git a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/RDFWriterTest.java b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/RDFWriterTest.java index 375f91c2da7..ff5ac8eb2dd 100644 --- a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/RDFWriterTest.java +++ b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/RDFWriterTest.java @@ -467,7 +467,7 @@ private void testRoundTripInternal(boolean preserveBNodeIds) } if (rdfParser.getRDFFormat().supportsNamespaces()) { - assertTrue(model.getNamespaces().size() >= 1, + assertTrue(!model.getNamespaces().isEmpty(), "Expected at least one namespace, found" + model.getNamespaces().size()); assertEquals(exNs, model.getNamespace("ex").get().getName()); } diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index 4ff5469eddf..4f0a0a2e72c 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index b9d9dcadcfb..edaeab114c5 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index 199996d6908..0195cb2d197 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index 11b81b99b94..3a711781bda 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java index 21127788d88..355187d66f7 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java @@ -110,7 +110,7 @@ public void testRoundTripNamespaces() throws Exception { assertTrue(model.contains(st1), "missing namespaced statement"); if (rdfParser.getRDFFormat().supportsNamespaces()) { - assertTrue(model.getNamespaces().size() >= 1, + assertTrue(!model.getNamespaces().isEmpty(), "Expected at least one namespace, found " + model.getNamespaces().size()); assertEquals(exNs, model.getNamespace("ex").get().getName()); } diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java index 90cb83b5182..8b61f1dcdac 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java @@ -121,7 +121,7 @@ public void testRoundTripNamespaces() throws Exception { assertTrue(model.contains(st1), "missing namespaced statement"); if (rdfParser.getRDFFormat().supportsNamespaces()) { - assertTrue(model.getNamespaces().size() >= 1, + assertTrue(!model.getNamespaces().isEmpty(), "Expected at least one namespace, found " + model.getNamespaces().size()); assertEquals(exNs, model.getNamespace("ex").get().getName()); } diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index b35931702bb..5d9fbbc82cf 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index 54ae5fe573c..086faa4a881 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index 044216524fb..3f1c815ea1f 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index 37553504ed5..bdfa2c5c34d 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index cf01d30a66f..0bfa05175e8 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 55a3e3ad374..b3c99b526c0 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index 08a1e0f6eb3..4ee3855e9eb 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/SAXFilter.java b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/SAXFilter.java index effdfb2af2e..c8ff5101340 100644 --- a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/SAXFilter.java +++ b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/SAXFilter.java @@ -377,7 +377,7 @@ public void endElement(String namespaceURI, String localName, String qName) thro String s = charBuf.toString(); // ignore whitespace-only nodes - if (s.trim().length() > 0) { + if (!s.trim().isEmpty()) { rdfParser.text(s); } } @@ -422,7 +422,7 @@ public void characters(char[] ch, int start, int length) throws SAXException { // if the element is not empty we need to process it as such. Otherwise, // we keep the start element deferred for now. - if (deferredElement != null && charBuf.toString().trim().length() > 0) { + if (deferredElement != null && !charBuf.toString().trim().isEmpty()) { reportDeferredStartElement(); } } diff --git a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java index 5e6f6fcb54a..9c529ddef97 100644 --- a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java +++ b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java @@ -320,7 +320,7 @@ private void popStacks(Resource newSubject) throws IOException, RDFHandlerExcept writeNodeEndTag(nextElement); - if (predicateStack.size() > 0) { + if (!predicateStack.isEmpty()) { IRI nextPredicate = predicateStack.pop(); writeIndents(predicateStack.size() + nodeStack.size()); diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index 2736b12a916..fb896d2a4c7 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index a8b99df7634..bfe2cecbb9e 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index 087f4221601..cbca8b7e028 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java index 71b7cd89f45..93c86c300a8 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java @@ -246,7 +246,7 @@ protected void parseDirective(String directive) throws IOException, RDFParseExce unread(directive.substring(5)); } parseBase(); - } else if (directive.length() == 0) { + } else if (directive.isEmpty()) { reportFatalError("Directive name is missing, expected @prefix or @base"); } else { reportFatalError("Unknown directive \"" + directive + "\""); diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java index 1ea2aa266e5..cf0599e2cd7 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java @@ -270,7 +270,7 @@ public static boolean isLanguageChar(int codePoint) { */ public static boolean isPN_PREFIX(String prefix) { // Empty prefixes are not legal, they should always have a colon - if (prefix.length() == 0) { + if (prefix.isEmpty()) { logger.debug("PN_PREFIX was not valid (empty)"); return false; } @@ -367,7 +367,7 @@ public static boolean isPN_LOCAL_ESC(String name) { public static boolean isPN_LOCAL(String name) { // Empty names are legal - if (name.length() == 0) { + if (name.isEmpty()) { return true; } diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java index 6645b7e72d2..8b02cb6c81a 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java @@ -226,14 +226,14 @@ public void handleNamespace(String prefix, String name) throws RDFHandlerExcepti // Namespace not yet mapped to a prefix, try to give it the // specified prefix - boolean isLegalPrefix = prefix.length() == 0 || TurtleUtil.isPN_PREFIX(prefix); + boolean isLegalPrefix = prefix.isEmpty() || TurtleUtil.isPN_PREFIX(prefix); if (!isLegalPrefix || namespaceTable.containsValue(prefix)) { // Specified prefix is not legal or the prefix is already in // use, // generate a legal unique prefix - if (prefix.length() == 0 || !isLegalPrefix) { + if (prefix.isEmpty() || !isLegalPrefix) { prefix = "ns"; } diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index 94ba13deba0..d8f587ff031 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index 37f440d24a5..6a5ce26a073 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDataset.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDataset.java index 45e343814a9..b47b9410ae9 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDataset.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDataset.java @@ -13,6 +13,7 @@ import java.util.Comparator; import java.util.Set; +import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.common.order.StatementOrder; import org.eclipse.rdf4j.common.transaction.IsolationLevels; @@ -97,6 +98,7 @@ CloseableIteration getStatements(Resource subj, IRI pred, V * @return An iterator over the relevant statements. * @throws SailException If the triple source failed to get the statements. */ + @Experimental default CloseableIteration getStatements(StatementOrder statementOrder, Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { @@ -118,10 +120,12 @@ default CloseableIteration getTriples(Resource subj, IRI pred, throw new SailException("RDF-star triple retrieval not supported by this store"); } + @Experimental default Set getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) { return Set.of(); } + @Experimental default Comparator getComparator() { return null; } diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index d9676ce414f..7e53e7e36b7 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J: Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 022319c4697..b8c924bcf9f 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J: Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index 13abf78ab50..d071f1fec74 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J: Extensible Store diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/SortedIteration.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/SortedIteration.java index b77e8f538a2..cbb81e02bf2 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/SortedIteration.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/SortedIteration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,7 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ package org.eclipse.rdf4j.sail.extensiblestore; diff --git a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreConnectionOrderedImplForTests.java b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreConnectionOrderedImplForTests.java index 2bacad0c94a..b2d93715151 100644 --- a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreConnectionOrderedImplForTests.java +++ b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreConnectionOrderedImplForTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.ordered; import org.eclipse.rdf4j.sail.extensiblestore.ExtensibleStoreConnection; diff --git a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreOrderedImplForTests.java b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreOrderedImplForTests.java index 2a9b0773e8a..4b8bed8b471 100644 --- a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreOrderedImplForTests.java +++ b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/ExtensibleStoreOrderedImplForTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.ordered; import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics; diff --git a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/OrderedDataStructure.java b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/OrderedDataStructure.java index 2db0c723413..50b8ce0fc4b 100644 --- a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/OrderedDataStructure.java +++ b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/ordered/OrderedDataStructure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Eclipse RDF4J contributors. + * Copyright (c) 2023 Eclipse RDF4J contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 @@ -7,7 +7,8 @@ * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ + ******************************************************************************/ + package org.eclipse.rdf4j.sail.extensiblestore.ordered; import java.util.Collections; diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index 45babf4a3e2..65e703e294b 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lmdb/pom.xml b/core/sail/lmdb/pom.xml index 7db34c8d5fc..833cef8bedb 100644 --- a/core/sail/lmdb/pom.xml +++ b/core/sail/lmdb/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-lmdb RDF4J: LmdbStore diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index a52d440fc00..6ad91c3466b 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J: Lucene Sail API diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index 530c6ac3c5d..cca97cf1670 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-lucene RDF4J: Lucene Sail Index diff --git a/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/impl/LuceneIndex.java b/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/impl/LuceneIndex.java index 3173ee34b13..42174324308 100644 --- a/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/impl/LuceneIndex.java +++ b/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/impl/LuceneIndex.java @@ -368,7 +368,7 @@ public void shutDown() throws IOException { List exceptions = new ArrayList<>(); try { synchronized (oldmonitors) { - if (oldmonitors.size() > 0) { + if (!oldmonitors.isEmpty()) { logger.warn( "LuceneSail: On shutdown {} IndexReaders were not closed. This is due to non-closed Query Iterators, which must be closed!", oldmonitors.size()); diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index ae81a8c5531..40795682b14 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java index b58c093128d..8dfcaeb4f0d 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java @@ -1069,7 +1069,7 @@ private boolean isContextResource(MemResource memResource, int snapshot) MemStatementList contextStatements = memResource.getContextStatementList(); // Filter resources that are not used as context identifier - if (contextStatements.size() == 0) { + if (contextStatements.isEmpty()) { return false; } diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index 531c473d10a..1b6705b9a54 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index e8da0fb9eab..36b15963277 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index cbce9f38bc7..aaaab64c8df 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index 6aaba0dabc4..d26ee58e5bf 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/StatementMatcher.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/StatementMatcher.java index 140c0b115d6..3eb86c014a6 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/StatementMatcher.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/StatementMatcher.java @@ -171,7 +171,7 @@ private void addSubset(StatementMatcher s) { public static List swap(List statementMatchers, Variable existingVariable, Variable newVariable) { - if (statementMatchers.size() == 0) { + if (statementMatchers.isEmpty()) { return List.of(); } if (statementMatchers.size() == 1) { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/PatternFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/PatternFilter.java index bab6fa1713d..e6d0f0bc9fe 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/PatternFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/PatternFilter.java @@ -25,7 +25,7 @@ public class PatternFilter extends FilterPlanNode { public PatternFilter(PlanNode parent, String pattern, String flags) { super(parent); - if (flags != null && flags.length() > 0) { + if (flags != null && !flags.isEmpty()) { int flag = 0b0; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/TargetClass.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/TargetClass.java index 7fcd57d9be2..4a78b90385e 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/TargetClass.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/TargetClass.java @@ -87,7 +87,7 @@ String getQueryFragment(String subjectVariable, String objectVariable, .collect(Collectors.toSet()); } - assert targets.size() >= 1; + assert !targets.isEmpty(); return targets.stream() .map(r -> "<" + r + ">") diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 831a688cf4a..388516095cc 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-solr RDF4J: Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index 2e589196e67..236fbed5692 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index b80e9d40e04..b2bdb3eacd2 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index 6775e4bf837..b054e9cd3d9 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/examples/pom.xml b/examples/pom.xml index 5610e589454..5dea31006fc 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -7,7 +7,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 550e9dc6c9d..a8de117eafd 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/spring-components/pom.xml b/spring-components/pom.xml index 571eebb5bce..31041304a02 100644 --- a/spring-components/pom.xml +++ b/spring-components/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT pom diff --git a/spring-components/rdf4j-spring-demo/pom.xml b/spring-components/rdf4j-spring-demo/pom.xml index e3376a0dd51..b20cb1a8a6f 100644 --- a/spring-components/rdf4j-spring-demo/pom.xml +++ b/spring-components/rdf4j-spring-demo/pom.xml @@ -7,7 +7,7 @@ org.eclipse.rdf4j rdf4j-spring-components - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/spring-components/rdf4j-spring/pom.xml b/spring-components/rdf4j-spring/pom.xml index b3616e04951..e31751c4000 100644 --- a/spring-components/rdf4j-spring/pom.xml +++ b/spring-components/rdf4j-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-spring-components - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-spring RDF4J: Spring diff --git a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/UpdateWithModelBuilder.java b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/UpdateWithModelBuilder.java index e13a9d3aac0..3549400ecc9 100644 --- a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/UpdateWithModelBuilder.java +++ b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/UpdateWithModelBuilder.java @@ -159,7 +159,7 @@ public BNode createBNode() { public UpdateWithModelBuilder withSink(Consumer> consumer) { List sink = new ArrayList<>(); consumer.accept(sink); - if (sink.size() > 0) { + if (!sink.isEmpty()) { sink.stream() .forEach( s -> modelBuilder.add(s.getSubject(), s.getPredicate(), s.getObject())); diff --git a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java index a27a8981994..a65be43693d 100644 --- a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java +++ b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java @@ -305,7 +305,7 @@ public Stream getBindingStream(TupleQueryResult result) { return Stream.empty(); } BindingSet first = result.next(); - if (!result.hasNext() && first.size() == 0) { + if (!result.hasNext() && first.isEmpty()) { return Stream.empty(); } return Stream.concat(Stream.of(first), result.stream()); diff --git a/spring-components/spring-boot-sparql-web/pom.xml b/spring-components/spring-boot-sparql-web/pom.xml index 222e9020799..9dc6077ce9b 100644 --- a/spring-components/spring-boot-sparql-web/pom.xml +++ b/spring-components/spring-boot-sparql-web/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-spring-components - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-spring-boot-sparql-web RDF4J: Spring boot component for a HTTP sparql server diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index d2d51f0daa4..dde06f998ef 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 3ebb0735c3e..0de310cbff7 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J: GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index cf0c02226d8..54ca053cb42 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J: Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index cc4dc7ab767..10c80a03c58 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 42088f21a4d..ceb1534de51 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index feaf586b953..586d2ffe869 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index 37dcb03788f..f4636dffed6 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index 8bab2f967d5..5f9b33a5dbe 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-rio-testsuite RDF4J: Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index 4b9b7d6c2d1..a906f013566 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/sail/src/main/java/org/eclipse/rdf4j/testsuite/sail/SailIsolationLevelTest.java b/testsuites/sail/src/main/java/org/eclipse/rdf4j/testsuite/sail/SailIsolationLevelTest.java index 47b4f201b3f..4b4ce28bafa 100644 --- a/testsuites/sail/src/main/java/org/eclipse/rdf4j/testsuite/sail/SailIsolationLevelTest.java +++ b/testsuites/sail/src/main/java/org/eclipse/rdf4j/testsuite/sail/SailIsolationLevelTest.java @@ -233,7 +233,7 @@ public void testLargeTransaction(IsolationLevel isolationLevel, int count) throw List statements = Iterations .asList(connection.getStatements(null, null, null, false)); connection.commit(); - if (statements.size() != 0) { + if (!statements.isEmpty()) { if (statements.size() != count) { logger.error("Size was {}. Expected 0 or {}", statements.size(), count); logger.error("\n[\n\t{}\n]", diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index 6d81c721943..2eadfeb06d7 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J: SPARQL compliance test suite diff --git a/testsuites/sparql/src/main/java/org/eclipse/rdf4j/testsuite/query/parser/sparql/manifest/SPARQL11UpdateComplianceTest.java b/testsuites/sparql/src/main/java/org/eclipse/rdf4j/testsuite/query/parser/sparql/manifest/SPARQL11UpdateComplianceTest.java index 8f62db4c39a..dfdb2c20523 100644 --- a/testsuites/sparql/src/main/java/org/eclipse/rdf4j/testsuite/query/parser/sparql/manifest/SPARQL11UpdateComplianceTest.java +++ b/testsuites/sparql/src/main/java/org/eclipse/rdf4j/testsuite/query/parser/sparql/manifest/SPARQL11UpdateComplianceTest.java @@ -115,7 +115,7 @@ public DynamicSPARQL11UpdateComplianceTest(String displayName, String testURI, S ds.addDefaultRemoveGraph(null); ds.setDefaultInsertGraph(null); - if (this.inputNamedGraphs.size() > 0) { + if (!this.inputNamedGraphs.isEmpty()) { for (String ng : inputNamedGraphs.keySet()) { IRI namedGraph = SimpleValueFactory.getInstance().createIRI(ng); ds.addNamedGraph(namedGraph); diff --git a/tools/config/pom.xml b/tools/config/pom.xml index c6e819ebcc0..61ef3408b09 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/config/src/main/java/org/eclipse/rdf4j/common/platform/PlatformFactory.java b/tools/config/src/main/java/org/eclipse/rdf4j/common/platform/PlatformFactory.java index ce52ce641e7..c1891c0a404 100644 --- a/tools/config/src/main/java/org/eclipse/rdf4j/common/platform/PlatformFactory.java +++ b/tools/config/src/main/java/org/eclipse/rdf4j/common/platform/PlatformFactory.java @@ -132,7 +132,7 @@ private boolean isGnome() { // check gnome desktop id String gnomeDesktopSessionId = getSystemEnv("GNOME_DESKTOP_SESSION_ID"); - if (gnomeDesktopSessionId != null && gnomeDesktopSessionId.trim().length() > 0) { + if (gnomeDesktopSessionId != null && !gnomeDesktopSessionId.trim().isEmpty()) { return true; } diff --git a/tools/console/pom.xml b/tools/console/pom.xml index a342f03ad96..1d05b2bc660 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/Console.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/Console.java index 7d799847e7f..5a0db7b6eaa 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/Console.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/Console.java @@ -365,7 +365,7 @@ private boolean executeCommand(String command) { boolean exit = false; // only try to parse the command if non-empty. - if (0 < command.length()) { + if (!command.isEmpty()) { final String[] tokens = parse(command); final String operation = tokens[0].toLowerCase(Locale.ENGLISH); diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Connect.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Connect.java index f3ad9f3ccb1..196991d9d7d 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Connect.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Connect.java @@ -128,7 +128,7 @@ private boolean connectRemote(final String url, final String user, final String manager.setUsernameAndPassword(user, pass); result = installNewManager(manager, url); } catch (UnauthorizedException e) { - if (user != null && pass.length() > 0) { + if (user != null && !pass.isEmpty()) { writeError("Authentication for user '" + user + "' failed"); } else { // Ask user for credentials diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Create.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Create.java index e711915a964..b4069a3a3f0 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Create.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Create.java @@ -276,7 +276,7 @@ private boolean inputParameters(final Map valueMap, final Map 0, "Empty model"); + assertTrue(!m.isEmpty(), "Empty model"); } @Test @@ -120,7 +120,7 @@ public final void testOutputFileConstructWorkdir() throws IOException { m = Rio.parse(reader, "", RDFFormat.TURTLE); } assertNotNull(m); - assertTrue(m.size() > 0, "Empty model"); + assertTrue(!m.isEmpty(), "Empty model"); } @Test diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index 7a8daf55286..d31678113c1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedX.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedX.java index e3c21255f24..4d3ec554b66 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedX.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedX.java @@ -227,7 +227,7 @@ protected void shutDownInternal() throws SailException { } } - if (errors.size() > 0) { + if (!errors.isEmpty()) { throw new SailException("Federation could not be shut down. See logs for details."); } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java index 1622d2bbd76..476770b8aef 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java @@ -375,7 +375,7 @@ protected long sizeInternal(Resource... contexts) throws SailException { errorEndpoints.add(e.getId()); } } - if (errorEndpoints.size() > 0) { + if (!errorEndpoints.isEmpty()) { throw new SailException("Could not determine size for members " + errorEndpoints + "(Supported for NativeStore and RemoteRepository only). Computed size: " + size); } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/QueryManager.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/QueryManager.java index e15e1e34542..35de8faf4f0 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/QueryManager.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/QueryManager.java @@ -254,7 +254,7 @@ public BooleanQuery prepareBooleanQuery(String queryString) throws MalformedQuer */ public Query prepareQuery(String queryString) throws MalformedQueryException { - if (prefixDeclarations.size() > 0) { + if (!prefixDeclarations.isEmpty()) { /* * we have to check for prefixes in the query to not add duplicate entries. In case duplicates are present @@ -289,7 +289,7 @@ public Query prepareQuery(String queryString) throws MalformedQueryException { */ public String getQueryPlan(String queryString) throws MalformedQueryException, FedXException { - if (prefixDeclarations.size() > 0) { + if (!prefixDeclarations.isEmpty()) { /* * we have to check for prefixes in the query to not add duplicate entries. In case duplicates are present diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SailTripleSource.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SailTripleSource.java index 4baeaa37c09..4cebd331089 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SailTripleSource.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SailTripleSource.java @@ -211,7 +211,7 @@ public CloseableIteration getStatements( null, EmptyBindingSet.getInstance(), queryInfo.getIncludeInferred()); } - if (bindings.size() > 0) { + if (!bindings.isEmpty()) { res = new InsertBindingsIteration(res, bindings); } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/TripleSourceBase.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/TripleSourceBase.java index 380cbbe8abc..5d6a03d7fa1 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/TripleSourceBase.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/TripleSourceBase.java @@ -163,7 +163,7 @@ public CloseableIteration getStatements( // apply filter and/or insert original bindings if (filterExpr != null) { - if (bindings.size() > 0) { + if (!bindings.isEmpty()) { res = new FilteringInsertBindingsIteration(filterExpr, bindings, res, queryInfo.getStrategy()); } else { @@ -175,7 +175,7 @@ public CloseableIteration getStatements( resultHolder.set(new EmptyIteration<>()); return; } - } else if (bindings.size() > 0) { + } else if (!bindings.isEmpty()) { res = new InsertBindingsIteration(res, bindings); } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/PrintingIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/PrintingIteration.java index 16927aa7e74..d7b4d899e0b 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/PrintingIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/PrintingIteration.java @@ -52,7 +52,7 @@ public void print() throws QueryEvaluationException { @Override public boolean hasNext() throws QueryEvaluationException { - return !done || copyQueue.size() > 0; + return !done || !copyQueue.isEmpty(); } @Override diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/DefaultFedXCostModel.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/DefaultFedXCostModel.java index d51a08fce71..2373030a2f2 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/DefaultFedXCostModel.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/DefaultFedXCostModel.java @@ -85,7 +85,7 @@ private double estimateCost(ExclusiveGroup group, Set joinVars) { // special heuristic: if not ordered at first place (i.e. there is a join var) // use the same counting technique as for others - if (joinVars.size() > 0) { + if (!joinVars.isEmpty()) { int count = 0; for (String var : group.getFreeVars()) { if (!joinVars.contains(var)) { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java index 227a7e39c10..88d97f5cf2a 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java @@ -173,7 +173,7 @@ public void meet(DescribeOperator node) throws OptimizationException { } public boolean hasService() { - return services != null && services.size() > 0; + return services != null && !services.isEmpty(); } public List getServices() { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/SourceSelection.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/SourceSelection.java index 5d07a6c5433..166f03b58b6 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/SourceSelection.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/SourceSelection.java @@ -113,7 +113,7 @@ public void doSourceSelection(List stmts) { // if remote checks are necessary, execute them using the concurrency // infrastructure and block until everything is resolved - if (remoteCheckTasks.size() > 0) { + if (!remoteCheckTasks.isEmpty()) { SourceSelectionExecutorWithLatch.run(this, remoteCheckTasks, cache); } @@ -230,13 +230,14 @@ private void executeRemoteSourceSelection(List tasks, SourceSelec finished = true; // check for errors: - if (errors.size() > 0) { + if (!errors.isEmpty()) { StringBuilder sb = new StringBuilder(); - sb.append( - errors.size() + " errors were reported while optimizing query " + getQueryInfo().getQueryID()); + sb.append(errors.size()) + .append(" errors were reported while optimizing query ") + .append(getQueryInfo().getQueryID()); for (Exception e : errors) { - sb.append("\n" + ExceptionUtil.getExceptionString("Error occured", e)); + sb.append("\n").append(ExceptionUtil.getExceptionString("Error occured", e)); } log.debug(sb.toString()); diff --git a/tools/pom.xml b/tools/pom.xml index 08778066c03..e5b8cae42e0 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-tools pom diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index 642959844af..8c5e906fae2 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index ccb07aa2992..6900e951f03 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index a3cba434f29..d2ee6ff0d1c 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/AbstractNavigationNode.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/AbstractNavigationNode.java index 3897d37d321..d0478a48575 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/AbstractNavigationNode.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/AbstractNavigationNode.java @@ -99,7 +99,7 @@ public String getPathPrefix() { if (getParent().getPathPrefix() != null) { result.append(getParent().getPathPrefix()); } - if (getParent().getId().length() > 0) { + if (!getParent().getId().isEmpty()) { result.append(getParent().getId()); result.append(getPathSeparator()); } @@ -139,7 +139,7 @@ public String getIconPrefix() { if (getParent().getIconPrefix() != null) { result.append(getParent().getIconPrefix()); } - if (getParent().getId().length() > 0) { + if (!getParent().getId().isEmpty()) { result.append(getParent().getId()); result.append(getIconSeparator()); } @@ -190,7 +190,7 @@ public String getI18nPrefix() { if (getParent().getI18nPrefix() != null) { result.append(getParent().getI18nPrefix()); } - if (getParent().getId().length() > 0) { + if (!getParent().getId().isEmpty()) { result.append(getParent().getId()); result.append(getI18nSeparator()); } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HeaderElement.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HeaderElement.java index 05589a7b083..9666e48a504 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HeaderElement.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HeaderElement.java @@ -51,7 +51,7 @@ public static HeaderElement parse(String encodedValue) { token = StringUtil.trimDoubleQuotes(token.trim()); // Ignore empty parameters - if (token.length() > 0) { + if (!token.isEmpty()) { result.addParameter(token); } } else { diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HttpServerUtil.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HttpServerUtil.java index 6df09a62666..a9df5baa019 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HttpServerUtil.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/util/HttpServerUtil.java @@ -162,7 +162,7 @@ public static List getHeaderElements(HttpServletRequest request, for (String subValue : subValues) { // Ignore any empty header elements subValue = subValue.trim(); - if (subValue.length() > 0) { + if (!subValue.isEmpty()) { elemList.add(HeaderElement.parse(subValue)); } } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/QueryResultView.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/QueryResultView.java index c81580d89da..7a09198fb11 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/QueryResultView.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/QueryResultView.java @@ -91,7 +91,7 @@ protected void setContentDisposition(Map model, HttpServletResponse response, Fi // Report as attachment to make use in browser more convenient String filename = (String) model.get(FILENAME_HINT_KEY); - if (filename == null || filename.length() == 0) { + if (filename == null || filename.isEmpty()) { filename = "result"; } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/namespaces/NamespaceController.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/namespaces/NamespaceController.java index 13b3d698ab2..070dfd5b55d 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/namespaces/NamespaceController.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/namespaces/NamespaceController.java @@ -126,7 +126,7 @@ private ModelAndView getRemoveNamespaceResult(HttpServletRequest request, String } private void validateUpdateNamespaceData(String prefix, String namespace) throws ClientHTTPException { - if (namespace.length() == 0) { + if (namespace.isEmpty()) { throw new ClientHTTPException(SC_BAD_REQUEST, "No namespace name found in request body"); } @@ -148,7 +148,7 @@ private void validateUpdateNamespaceData(String prefix, String namespace) throws private static Pattern PREFIX_PATTERN = Pattern.compile(PN_PREFIX); private static boolean isValidPrefix(String value) { - if (value.length() == 0) + if (value.isEmpty()) return true; Matcher matcher = PREFIX_PATTERN.matcher(value); return (matcher.find() && matcher.start() == 0 && matcher.end() == value.length()); diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 5e6fc517570..9d21d2969d2 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index cabca3a9a48..4276baac5b7 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 5.1.0-SNAPSHOT + 5.0.0-SNAPSHOT rdf4j-http-workbench war diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/AbstractRepositoryServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/AbstractRepositoryServlet.java index 400cf217028..9921f8cc4f6 100644 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/AbstractRepositoryServlet.java +++ b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/AbstractRepositoryServlet.java @@ -94,7 +94,7 @@ public void init(ServletConfig config) throws ServletException { info.setWritable(repository.isWritable()); } String location = config.getInitParameter("location"); - if (location != null && location.trim().length() > 0) { + if (location != null && !location.trim().isEmpty()) { info.setLocation(new URL(location)); } } catch (MalformedURLException | RepositoryException e) { diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/NamespacesServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/NamespacesServlet.java index 7c382995945..33a7a2b03f1 100644 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/NamespacesServlet.java +++ b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/NamespacesServlet.java @@ -30,7 +30,7 @@ protected void doPost(WorkbenchRequest req, HttpServletResponse resp, String xsl try (RepositoryConnection con = repository.getConnection()) { String prefix = req.getParameter("prefix"); String namespace = req.getParameter("namespace"); - if (namespace.length() > 0) { + if (!namespace.isEmpty()) { con.setNamespace(prefix, namespace); } else { con.removeNamespace(prefix); diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/proxy/WorkbenchServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/proxy/WorkbenchServlet.java index 4f899de502c..151c91c3852 100644 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/proxy/WorkbenchServlet.java +++ b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/proxy/WorkbenchServlet.java @@ -209,7 +209,7 @@ private void service(final String repoID, final HttpServletRequest req, final Ht final int idx = path.indexOf(repoID) + repoID.length(); http.setServletPath(http.getServletPath() + path.substring(0, idx)); final String pathInfo = path.substring(idx); - http.setPathInfo(pathInfo.length() == 0 ? null : pathInfo); + http.setPathInfo(pathInfo.isEmpty() ? null : pathInfo); if (repositories.containsKey(repoID)) { repositories.get(repoID).service(http, resp); } else {