diff --git a/build.gradle b/build.gradle index 702ed44..b098a33 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } wrapper { - gradleVersion = "${rootProject.property('gradle.wrapper.version')}" + gradleVersion = libs.versions.gradle.get() distributionType = Wrapper.DistributionType.ALL } diff --git a/config/src/main/java/org/xbib/config/ConfigParams.java b/config/src/main/java/org/xbib/config/ConfigParams.java index 17a1944..2caa363 100644 --- a/config/src/main/java/org/xbib/config/ConfigParams.java +++ b/config/src/main/java/org/xbib/config/ConfigParams.java @@ -179,12 +179,12 @@ public class ConfigParams implements Comparable { fileLocations; } - public static class SuffixedReader { + static class SuffixedReader { Reader reader; String suffix; } - public static class JdbcLookup { + static class JdbcLookup { Connection connection; String statement; String[] params; diff --git a/config/src/main/java/org/xbib/config/NullConfigLogger.java b/config/src/main/java/org/xbib/config/NullConfigLogger.java index e6279dc..fb5458c 100644 --- a/config/src/main/java/org/xbib/config/NullConfigLogger.java +++ b/config/src/main/java/org/xbib/config/NullConfigLogger.java @@ -2,6 +2,9 @@ package org.xbib.config; public class NullConfigLogger implements ConfigLogger { + public NullConfigLogger() { + } + @Override public void info(String string) { } diff --git a/config/src/main/java/org/xbib/config/SystemConfigLogger.java b/config/src/main/java/org/xbib/config/SystemConfigLogger.java index fd6db17..b85ec46 100644 --- a/config/src/main/java/org/xbib/config/SystemConfigLogger.java +++ b/config/src/main/java/org/xbib/config/SystemConfigLogger.java @@ -2,6 +2,9 @@ package org.xbib.config; public class SystemConfigLogger implements ConfigLogger { + public SystemConfigLogger() { + } + @Override public void info(String string) { System.err.println("info: " + string); diff --git a/content-core/build.gradle b/content-core/build.gradle index ca4258e..a5b0688 100644 --- a/content-core/build.gradle +++ b/content-core/build.gradle @@ -1,4 +1,4 @@ dependencies { api project(':content-api') - api "com.fasterxml.jackson.core:jackson-core:${project.property('jackson.version')}" + api libs.jackson.core } diff --git a/content-core/src/main/java/org/xbib/content/core/AbstractXContentGenerator.java b/content-core/src/main/java/org/xbib/content/core/AbstractXContentGenerator.java index 22ec355..a4933b2 100644 --- a/content-core/src/main/java/org/xbib/content/core/AbstractXContentGenerator.java +++ b/content-core/src/main/java/org/xbib/content/core/AbstractXContentGenerator.java @@ -12,6 +12,9 @@ public abstract class AbstractXContentGenerator implements XContentGenerator { protected XContentGenerator generator; + public AbstractXContentGenerator() { + } + public AbstractXContentGenerator setGenerator(XContentGenerator generator) { this.generator = generator; return this; diff --git a/content-core/src/main/java/org/xbib/content/core/AbstractXContentParser.java b/content-core/src/main/java/org/xbib/content/core/AbstractXContentParser.java index 1efe8ca..adc0668 100644 --- a/content-core/src/main/java/org/xbib/content/core/AbstractXContentParser.java +++ b/content-core/src/main/java/org/xbib/content/core/AbstractXContentParser.java @@ -6,19 +6,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -/** - * - */ public abstract class AbstractXContentParser implements XContentParser { - //private static final MapFactory SIMPLE_MAP_FACTORY = HashMap::new; - - //private static final MapFactory TINY_MAP_FACTORY = TinyMap::builder; - private boolean losslessDecimals; private boolean base16Checks; + public AbstractXContentParser() { + } + protected abstract MapFactory getMapFactory(); protected abstract MapFactory getOrderedMapFactory(); diff --git a/content-core/src/main/java/org/xbib/content/core/XContentService.java b/content-core/src/main/java/org/xbib/content/core/XContentService.java index 69bb2f8..141079b 100644 --- a/content-core/src/main/java/org/xbib/content/core/XContentService.java +++ b/content-core/src/main/java/org/xbib/content/core/XContentService.java @@ -22,6 +22,9 @@ public class XContentService { } } + private XContentService() { + } + public static XContentBuilder builder(String name) throws IOException { return xcontents.containsKey(name) ? DefaultXContentBuilder.builder(xcontents.get(name)) : null; } diff --git a/content-json/build.gradle b/content-json/build.gradle index 1f48e0d..a855a9b 100644 --- a/content-json/build.gradle +++ b/content-json/build.gradle @@ -1,7 +1,5 @@ dependencies { api project(':content-core') - api "com.fasterxml.jackson.core:jackson-databind:${project.property('jackson.version')}" - testImplementation("org.mockito:mockito-core:${project.property('mockito.version')}") { - exclude group: 'org.hamcrest' - } + api libs.jackson.databind + testImplementation libs.mockito.inline } diff --git a/content-json/src/main/java/module-info.java b/content-json/src/main/java/module-info.java index faff327..8b438e2 100644 --- a/content-json/src/main/java/module-info.java +++ b/content-json/src/main/java/module-info.java @@ -7,7 +7,7 @@ module org.xbib.content.json { exports org.xbib.content.json.mergepatch; exports org.xbib.content.json.patch; exports org.xbib.content.json.pointer; - requires org.xbib.content.core; - requires com.fasterxml.jackson.databind; + requires transitive org.xbib.content.core; + requires transitive com.fasterxml.jackson.databind; provides XContent with org.xbib.content.json.JsonXContent; } diff --git a/content-json/src/main/java/org/xbib/content/json/JsonXContent.java b/content-json/src/main/java/org/xbib/content/json/JsonXContent.java index ebbb797..3f098c8 100644 --- a/content-json/src/main/java/org/xbib/content/json/JsonXContent.java +++ b/content-json/src/main/java/org/xbib/content/json/JsonXContent.java @@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets; public class JsonXContent implements XContent { private static final JsonXContent jsonXContent; + private static final JsonFactory jsonFactory; static { diff --git a/content-json/src/main/java/org/xbib/content/json/jackson/JsonNodeReader.java b/content-json/src/main/java/org/xbib/content/json/jackson/JsonNodeReader.java index 8b74577..ccbba12 100644 --- a/content-json/src/main/java/org/xbib/content/json/jackson/JsonNodeReader.java +++ b/content-json/src/main/java/org/xbib/content/json/jackson/JsonNodeReader.java @@ -3,6 +3,7 @@ package org.xbib.content.json.jackson; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.io.ContentReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.MappingIterator; import com.fasterxml.jackson.databind.ObjectMapper; @@ -69,20 +70,8 @@ public final class JsonNodeReader { * from the stream */ public JsonNode fromInputStream(final InputStream in) throws IOException { - JsonParser parser = null; - MappingIterator iterator = null; - - try { - parser = reader.getFactory().createParser(in); - iterator = reader.readValues(parser); + try (JsonParser parser = reader.getFactory().createParser(in); MappingIterator iterator = reader.readValues(parser)) { return readNode(iterator); - } finally { - if (parser != null) { - parser.close(); - } - if (iterator != null) { - iterator.close(); - } } } @@ -94,35 +83,21 @@ public final class JsonNodeReader { * @throws java.io.IOException malformed input, or problem encountered when reading * from the reader */ - public JsonNode fromReader(final Reader r) - throws IOException { - JsonParser parser = null; - MappingIterator iterator = null; - - try { - parser = reader.getFactory().createParser(r); - iterator = reader.readValues(parser); + public JsonNode fromReader(final Reader r) throws IOException { + try (JsonParser parser = reader.getFactory().createParser(r); MappingIterator iterator = reader.readValues(parser)) { return readNode(iterator); - } finally { - if (parser != null) { - parser.close(); - } - if (iterator != null) { - iterator.close(); - } } } - /** - * - */ private static final class JsonParseExceptionBuilder { - private JsonParser jsonParser; + + private final JsonParser jsonParser; + private JsonLocation location; private JsonParseExceptionBuilder(final JsonParser jsonParser, final Object source) { this.jsonParser = jsonParser; - location = new JsonLocation(source, 0L, 1, 1); + location = new JsonLocation(ContentReference.construct(false, source), 0L, 1, 1); } private JsonParseExceptionBuilder setLocation(final JsonLocation location) { diff --git a/content-json/src/main/java/org/xbib/content/json/mergepatch/JsonMergePatchDeserializer.java b/content-json/src/main/java/org/xbib/content/json/mergepatch/JsonMergePatchDeserializer.java index 12cd019..2be44ea 100644 --- a/content-json/src/main/java/org/xbib/content/json/mergepatch/JsonMergePatchDeserializer.java +++ b/content-json/src/main/java/org/xbib/content/json/mergepatch/JsonMergePatchDeserializer.java @@ -17,6 +17,9 @@ import java.io.IOException; * write our own here. */ public final class JsonMergePatchDeserializer extends JsonDeserializer { + + public JsonMergePatchDeserializer() {} + @Override public JsonMergePatch deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { diff --git a/content-json/src/test/java/org/xbib/content/json/jackson/JsonNodeReaderTest.java b/content-json/src/test/java/org/xbib/content/json/jackson/JsonNodeReaderTest.java index 6a0a4c7..75aa96e 100644 --- a/content-json/src/test/java/org/xbib/content/json/jackson/JsonNodeReaderTest.java +++ b/content-json/src/test/java/org/xbib/content/json/jackson/JsonNodeReaderTest.java @@ -15,27 +15,24 @@ import java.io.Reader; import java.io.StringReader; import java.nio.charset.StandardCharsets; -/** - * - */ public final class JsonNodeReaderTest { @Test - public void streamIsClosedOnRead() - throws IOException { - final InputStream in = spy(new ByteArrayInputStream("[]".getBytes(StandardCharsets.UTF_8))); + public void streamIsClosedOnRead() throws IOException { + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("[]".getBytes(StandardCharsets.UTF_8)); + final InputStream in = spy(byteArrayInputStream); final JsonNode node = new JsonNodeReader().fromInputStream(in); verify(in).close(); - assertEquals(node, new ObjectMapper().readTree(new ByteArrayInputStream("[]".getBytes("UTF-8")))); + assertEquals(node, new ObjectMapper().readTree(new ByteArrayInputStream("[]".getBytes(StandardCharsets.UTF_8)))); } @Test - public void readerIsClosedOnRead() - throws IOException { - final Reader reader = spy(new StringReader("[]")); + public void readerIsClosedOnRead() throws IOException { + StringReader stringReader = new StringReader("[]"); + final Reader reader = spy(stringReader); final JsonNode node = new JsonNodeReader().fromReader(reader); - assertEquals(node, new ObjectMapper().readTree(new StringReader("[]"))); verify(reader).close(); + assertEquals(node, new ObjectMapper().readTree(new StringReader("[]"))); } @Test diff --git a/content-rdf/src/main/java/module-info.java b/content-rdf/src/main/java/module-info.java index 49d4efc..65ea72c 100644 --- a/content-rdf/src/main/java/module-info.java +++ b/content-rdf/src/main/java/module-info.java @@ -10,7 +10,7 @@ module org.xbib.content.rdf { exports org.xbib.content.rdf.io.turtle; exports org.xbib.content.rdf.io.xml; exports org.xbib.content.rdf.util; - requires org.xbib.content.resource; - requires org.xbib.content.xml; - requires org.xbib.content.json; + requires transitive org.xbib.content.resource; + requires transitive org.xbib.content.xml; + requires transitive org.xbib.content.json; } diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/internal/DefaultRdfGraph.java b/content-rdf/src/main/java/org/xbib/content/rdf/internal/DefaultRdfGraph.java index a4e64fd..5448b88 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/internal/DefaultRdfGraph.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/internal/DefaultRdfGraph.java @@ -23,6 +23,9 @@ public class DefaultRdfGraph implements RdfGraph { private final Map resources = new LinkedHashMap<>(); + public DefaultRdfGraph() { + } + @Override public Iterator getResources() { return resources.values().stream().iterator(); diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/io/source/BaseStreamProcessor.java b/content-rdf/src/main/java/org/xbib/content/rdf/io/source/BaseStreamProcessor.java index b0f2609..009909b 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/io/source/BaseStreamProcessor.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/io/source/BaseStreamProcessor.java @@ -10,6 +10,9 @@ import java.net.URLConnection; */ public abstract class BaseStreamProcessor { + public BaseStreamProcessor() { + } + protected abstract void startStream() throws IOException; protected abstract void endStream() throws IOException; diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/util/TreeMultiMap.java b/content-rdf/src/main/java/org/xbib/content/rdf/util/TreeMultiMap.java deleted file mode 100644 index 545dedc..0000000 --- a/content-rdf/src/main/java/org/xbib/content/rdf/util/TreeMultiMap.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.xbib.content.rdf.util; - -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -/** - * A {@link TreeMap} based multi map. The keys ore ordered. - * @param te key type - * @param the value type - */ -public class TreeMultiMap implements MultiMap { - - private final Map> map = new TreeMap<>(); - - @Override - public int size() { - return map.size(); - } - - @Override - public void clear() { - map.clear(); - } - - @Override - public boolean isEmpty() { - return map.isEmpty(); - } - - @Override - public boolean containsKey(K key) { - return map.containsKey(key); - } - - @Override - public Set keySet() { - return map.keySet(); - } - - @Override - public boolean put(K key, V value) { - Set set = map.get(key); - if (set == null) { - set = new LinkedHashSet<>(); - set.add(value); - map.put(key, set); - return true; - } else { - set.add(value); - return false; - } - } - - @Override - public void putAll(K key, Collection values) { - Set set = map.get(key); - if (set == null) { - set = new LinkedHashSet<>(); - map.put(key, set); - } - set.addAll(values); - } - - @Override - public Collection get(K key) { - return map.get(key); - } - - @Override - public Set remove(K key) { - return map.remove(key); - } - - @Override - public boolean remove(K key, V value) { - Set set = map.get(key); - return set != null && set.remove(value); - } - - @Override - public boolean equals(Object obj) { - return obj != null && obj instanceof TreeMultiMap && map.equals(((TreeMultiMap) obj).map); - } - - @Override - public int hashCode() { - return map.hashCode(); - } - - @Override - public String toString() { - return map.toString(); - } -} diff --git a/content-rdf/src/test/java/org/xbib/content/rdf/util/MultiMapTest.java b/content-rdf/src/test/java/org/xbib/content/rdf/util/MultiMapTest.java index fd04e66..ece8abf 100644 --- a/content-rdf/src/test/java/org/xbib/content/rdf/util/MultiMapTest.java +++ b/content-rdf/src/test/java/org/xbib/content/rdf/util/MultiMapTest.java @@ -5,9 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import java.util.Arrays; -/** - * - */ public class MultiMapTest { @Test @@ -23,19 +20,4 @@ public class MultiMapTest { map.putAll("a", Arrays.asList("d", "e")); assertEquals("[b, c, d, e]", map.get("a").toString()); } - - @Test - public void testTreeMultiMap() { - TreeMultiMap map = new TreeMultiMap<>(); - map.put("a", "b"); - map.put("b", "c"); - map.put("a", "c"); - assertTrue(map.containsKey("a")); - assertTrue(map.containsKey("b")); - assertEquals("[a, b]", map.keySet().toString()); - assertEquals("[b, c]", map.get("a").toString()); - assertEquals("[c]", map.get("b").toString()); - map.putAll("a", Arrays.asList("d", "e")); - assertEquals("[b, c, d, e]", map.get("a").toString()); - } } diff --git a/content-resource/build.gradle b/content-resource/build.gradle index a9255cd..857d9f7 100644 --- a/content-resource/build.gradle +++ b/content-resource/build.gradle @@ -1,4 +1,4 @@ dependencies { - api "org.xbib:net-url:${project.property('xbib.net.version')}" - testImplementation "com.fasterxml.jackson.core:jackson-databind:${project.property('jackson.version')}" -} \ No newline at end of file + api libs.net + testImplementation libs.jackson.databind +} diff --git a/content-resource/src/main/java/module-info.java b/content-resource/src/main/java/module-info.java index 77b1593..2e54342 100644 --- a/content-resource/src/main/java/module-info.java +++ b/content-resource/src/main/java/module-info.java @@ -1,5 +1,5 @@ module org.xbib.content.resource { exports org.xbib.content.resource; exports org.xbib.content.resource.text; - requires org.xbib.net.url; -} \ No newline at end of file + requires transitive org.xbib.net.url; +} diff --git a/content-resource/src/main/java/org/xbib/content/resource/package-info.java b/content-resource/src/main/java/org/xbib/content/resource/package-info.java deleted file mode 100644 index 17b9a37..0000000 --- a/content-resource/src/main/java/org/xbib/content/resource/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes for content resources (resource identifiers, namespaces, schemes, uniform locations). - */ -package org.xbib.content.resource; diff --git a/content-resource/src/main/java/org/xbib/content/resource/text/CodepointIterator.java b/content-resource/src/main/java/org/xbib/content/resource/text/CodepointIterator.java index 019e3e2..848e004 100644 --- a/content-resource/src/main/java/org/xbib/content/resource/text/CodepointIterator.java +++ b/content-resource/src/main/java/org/xbib/content/resource/text/CodepointIterator.java @@ -9,8 +9,12 @@ import java.util.NoSuchElementException; public abstract class CodepointIterator implements Iterator { protected int position = -1; + protected int limit = -1; + public CodepointIterator() { + } + /** * Get a CodepointIterator for the specified char array. * @param array char array diff --git a/content-smile/build.gradle b/content-smile/build.gradle index 83a2cba..9b1ee1a 100644 --- a/content-smile/build.gradle +++ b/content-smile/build.gradle @@ -1,4 +1,4 @@ dependencies { api project(':content-core') - api "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${project.property('jackson.version')}" + api libs.jackson.dataformat.smile } diff --git a/content-xml/build.gradle b/content-xml/build.gradle index 5a39e7b..30e6a64 100644 --- a/content-xml/build.gradle +++ b/content-xml/build.gradle @@ -1,7 +1,7 @@ dependencies { api project(':content-core') api project(':content-resource') - api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${project.property('jackson.version')}" - runtimeOnly "com.fasterxml.woodstox:woodstox-core:${project.property('woodstox.version')}" + api libs.jackson.dataformat.xml + runtimeOnly libs.woodstox testImplementation project(':content-json') // for XContentHelper reading JSON } diff --git a/content-xml/src/main/java/module-info.java b/content-xml/src/main/java/module-info.java index 28c5b2a..df7bf89 100644 --- a/content-xml/src/main/java/module-info.java +++ b/content-xml/src/main/java/module-info.java @@ -10,6 +10,6 @@ module org.xbib.content.xml { requires transitive org.xbib.content.core; requires transitive org.xbib.content.resource; requires transitive com.fasterxml.jackson.dataformat.xml; - requires com.fasterxml.jackson.core; + requires transitive com.fasterxml.jackson.core; provides XContent with org.xbib.content.xml.XmlXContent; } diff --git a/content-xml/src/main/java/org/xbib/content/xml/json/JsonNamespaceContext.java b/content-xml/src/main/java/org/xbib/content/xml/json/JsonNamespaceContext.java index e392786..ff80412 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/json/JsonNamespaceContext.java +++ b/content-xml/src/main/java/org/xbib/content/xml/json/JsonNamespaceContext.java @@ -4,11 +4,11 @@ import java.util.Iterator; import javax.xml.namespace.NamespaceContext; -/** - * - */ public class JsonNamespaceContext implements NamespaceContext { + public JsonNamespaceContext() { + } + @Override public String getNamespaceURI(String prefix) { throw new UnsupportedOperationException(); diff --git a/content-xml/src/main/java/org/xbib/content/xml/json/JsonStylesheet.java b/content-xml/src/main/java/org/xbib/content/xml/json/JsonStylesheet.java index 3630d1f..3514de4 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/json/JsonStylesheet.java +++ b/content-xml/src/main/java/org/xbib/content/xml/json/JsonStylesheet.java @@ -23,7 +23,7 @@ import javax.xml.transform.sax.SAXSource; */ public class JsonStylesheet { - private QName root = new QName("root"); + private QName root; private XmlNamespaceContext context; @@ -31,6 +31,10 @@ public class JsonStylesheet { private String[] stylesheets; + public JsonStylesheet() { + this.root = new QName("root"); + } + public JsonStylesheet root(QName root) { this.root = root; return this; diff --git a/content-xml/src/main/java/org/xbib/content/xml/json/events/JsonReaderXmlEvent.java b/content-xml/src/main/java/org/xbib/content/xml/json/events/JsonReaderXmlEvent.java index c095304..93b8d3c 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/json/events/JsonReaderXmlEvent.java +++ b/content-xml/src/main/java/org/xbib/content/xml/json/events/JsonReaderXmlEvent.java @@ -8,9 +8,6 @@ import javax.xml.namespace.QName; import javax.xml.stream.Location; import javax.xml.stream.XMLStreamException; -/** - * - */ public abstract class JsonReaderXmlEvent { private Location location; @@ -21,6 +18,9 @@ public abstract class JsonReaderXmlEvent { private List attributes; + public JsonReaderXmlEvent() { + } + protected void setQName(QName name) { this.name = name; } diff --git a/content-xml/src/main/java/org/xbib/content/xml/stream/SimpleNamespaceContext.java b/content-xml/src/main/java/org/xbib/content/xml/stream/SimpleNamespaceContext.java index 1e60b8d..b77dd3f 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/stream/SimpleNamespaceContext.java +++ b/content-xml/src/main/java/org/xbib/content/xml/stream/SimpleNamespaceContext.java @@ -17,12 +17,15 @@ import javax.xml.namespace.NamespaceContext; */ public class SimpleNamespaceContext implements NamespaceContext { - private Map prefixToNamespaceUri = new HashMap<>(); + private final Map prefixToNamespaceUri = new HashMap<>(); - private Map> namespaceUriToPrefixes = new HashMap<>(); + private final Map> namespaceUriToPrefixes = new HashMap<>(); private String defaultNamespaceUri = ""; + public SimpleNamespaceContext() { + } + @Override public String getNamespaceURI(String prefix) { if (XMLConstants.XML_NS_PREFIX.equals(prefix)) { diff --git a/content-xml/src/main/java/org/xbib/content/xml/stream/XMLFilterImplEx.java b/content-xml/src/main/java/org/xbib/content/xml/stream/XMLFilterImplEx.java index 979336d..031bcc4 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/stream/XMLFilterImplEx.java +++ b/content-xml/src/main/java/org/xbib/content/xml/stream/XMLFilterImplEx.java @@ -13,6 +13,9 @@ public class XMLFilterImplEx extends XMLFilterImpl implements LexicalHandler { protected boolean namespacePrefixes; + public XMLFilterImplEx() { + } + public boolean getNamespacePrefixes() { return namespacePrefixes; } diff --git a/content-xml/src/main/java/org/xbib/content/xml/transform/DefaultStylesheetErrorListener.java b/content-xml/src/main/java/org/xbib/content/xml/transform/DefaultStylesheetErrorListener.java index 9cbe665..9025e49 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/transform/DefaultStylesheetErrorListener.java +++ b/content-xml/src/main/java/org/xbib/content/xml/transform/DefaultStylesheetErrorListener.java @@ -8,6 +8,9 @@ import javax.xml.transform.TransformerException; */ public class DefaultStylesheetErrorListener implements ErrorListener { + public DefaultStylesheetErrorListener() { + } + @Override public void warning(TransformerException e) throws TransformerException { //logger.log(Level.WARNING, "warning (recoverable): " + e.getMessage(), e); diff --git a/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetPool.java b/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetPool.java index 9b9d622..5ad269a 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetPool.java +++ b/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetPool.java @@ -1,6 +1,5 @@ package org.xbib.content.xml.transform; -import java.text.MessageFormat; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -21,6 +20,9 @@ public final class StylesheetPool { */ private final Map stylesheets = new ConcurrentHashMap<>(); + public StylesheetPool() { + } + /** * @param transformerFactory transformer factory * @return returns the identity transformer handler. diff --git a/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetTransformer.java b/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetTransformer.java index 4ae867e..43bac4c 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetTransformer.java +++ b/content-xml/src/main/java/org/xbib/content/xml/transform/StylesheetTransformer.java @@ -47,6 +47,9 @@ public class StylesheetTransformer implements Closeable { private Result result; + public StylesheetTransformer() { + } + public StylesheetTransformer setPath(String... path) { if (transformerFactory == null) { transformerFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); diff --git a/content-xml/src/main/java/org/xbib/content/xml/transform/TransformerErrorListener.java b/content-xml/src/main/java/org/xbib/content/xml/transform/TransformerErrorListener.java index d641d0a..fe3eec1 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/transform/TransformerErrorListener.java +++ b/content-xml/src/main/java/org/xbib/content/xml/transform/TransformerErrorListener.java @@ -9,6 +9,9 @@ import javax.xml.transform.TransformerException; */ public final class TransformerErrorListener implements ErrorListener { + public TransformerErrorListener() { + } + /** * We store the exception internally as a workaround to xalan, which reports * {@link javax.xml.transform.TransformerException} as {@link RuntimeException} (wrapped). diff --git a/content-xml/src/main/java/org/xbib/content/xml/util/XML11Char.java b/content-xml/src/main/java/org/xbib/content/xml/util/XML11Char.java index dc46ef0..81c5c91 100644 --- a/content-xml/src/main/java/org/xbib/content/xml/util/XML11Char.java +++ b/content-xml/src/main/java/org/xbib/content/xml/util/XML11Char.java @@ -36,7 +36,7 @@ public class XML11Char { /** * Character flags for XML 1.1. */ - private static final byte XML11CHARS[] = new byte[1 << 16]; + private static final byte[] XML11CHARS = new byte[1 << 16]; static { Arrays.fill(XML11CHARS, 1, 9, (byte) 17); // Fill 8 of value (byte) 17 @@ -97,6 +97,9 @@ public class XML11Char { Arrays.fill(XML11CHARS, 65008, 65534, (byte) -19); // Fill 526 of value (byte) -19 } + public XML11Char() { + } + /** * Returns true if the specified character is a valid name start * character as defined by production [4] in the XML 1.1 diff --git a/content-yaml/build.gradle b/content-yaml/build.gradle index 0b3f852..7612e11 100644 --- a/content-yaml/build.gradle +++ b/content-yaml/build.gradle @@ -1,5 +1,5 @@ dependencies { api project(':content-core') - api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${project.property('jackson.version')}" - implementation "org.yaml:snakeyaml:${project.property('snakeyaml.version')}" + api libs.jackson.dataformat.yaml + implementation libs.snakeyaml } diff --git a/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContent.java b/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContent.java index 00cd87a..a8d93a5 100644 --- a/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContent.java +++ b/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContent.java @@ -20,6 +20,7 @@ import java.nio.charset.StandardCharsets; public class YamlXContent implements XContent { private static final YamlXContent yamlXContent; + private static final YAMLFactory yamlFactory; static { @@ -27,6 +28,9 @@ public class YamlXContent implements XContent { yamlXContent = new YamlXContent(); } + public YamlXContent() { + } + public static YamlXContent yamlContent() { return yamlXContent; } diff --git a/gradle.properties b/gradle.properties index c75c138..fa97171 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,5 @@ group = org.xbib name = content -version = 4.0.0 +version = 5.0.0 org.gradle.warning.mode = ALL -gradle.wrapper.version = 7.3.2 -xbib.net.version = 2.1.1 -xbib-datastructures.version = 1.0.0 -jackson.version = 2.12.3 -woodstox.version = 6.2.6 -snakeyaml.version = 1.28 -mockito.version = 3.10.0 -asciidoclet.version = 1.5.6 diff --git a/gradle/quality/spotbugs.gradle b/gradle/quality/spotbugs.gradle index 2b9e2cf..81b2f63 100644 --- a/gradle/quality/spotbugs.gradle +++ b/gradle/quality/spotbugs.gradle @@ -1,6 +1,7 @@ apply plugin: "com.github.spotbugs" spotbugs { + toolVersion = '4.7.1' ignoreFailures = true } diff --git a/gradle/test/junit5.gradle b/gradle/test/junit5.gradle index d3305ec..ce3fc3f 100644 --- a/gradle/test/junit5.gradle +++ b/gradle/test/junit5.gradle @@ -1,12 +1,8 @@ - -def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.7.2' -def hamcrestVersion = project.hasProperty('hamcrest.version')?project.property('hamcrest.version'):'2.2' - dependencies { - testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}" - testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}" - testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" + testImplementation libs.junit.jupiter.api + testImplementation libs.junit.jupiter.params + testImplementation libs.hamcrest + testRuntimeOnly libs.junit.jupiter.engine } test { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c..249e583 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac0b842..2ec77e5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0..a69d9cb 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index ac1b06f..53a6b23 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings-api/build.gradle b/settings-api/build.gradle index aed7a6e..5c6af21 100644 --- a/settings-api/build.gradle +++ b/settings-api/build.gradle @@ -1,3 +1,3 @@ dependencies { - api "org.xbib:datastructures-api:${project.property('xbib-datastructures.version')}" -} \ No newline at end of file + api libs.datastructures.api +} diff --git a/settings-api/src/main/java/org/xbib/settings/Settings.java b/settings-api/src/main/java/org/xbib/settings/Settings.java index 24f2778..a9af55f 100644 --- a/settings-api/src/main/java/org/xbib/settings/Settings.java +++ b/settings-api/src/main/java/org/xbib/settings/Settings.java @@ -11,6 +11,9 @@ public interface Settings extends AutoCloseable { class Holder { + private Holder() { + } + private static SettingsBuilder createBuilder() { ServiceLoader serviceLoader = ServiceLoader.load(SettingsBuilder.class); Optional optionalSettingsBuilder = serviceLoader.findFirst(); diff --git a/settings-content-json/src/main/java/module-info.java b/settings-content-json/src/main/java/module-info.java index d70cab8..1d84675 100644 --- a/settings-content-json/src/main/java/module-info.java +++ b/settings-content-json/src/main/java/module-info.java @@ -4,8 +4,7 @@ import org.xbib.settings.content.json.JsonSettingsLoader; module org.xbib.settings.content.json { exports org.xbib.settings.content.json; requires transitive org.xbib.settings.content; - requires org.xbib.content.api; - requires org.xbib.content.json; + requires transitive org.xbib.content.json; requires org.xbib.settings.api; uses SettingsLoader; provides SettingsLoader with JsonSettingsLoader; diff --git a/settings-content-json/src/main/java/org/xbib/settings/content/json/JsonSettingsLoader.java b/settings-content-json/src/main/java/org/xbib/settings/content/json/JsonSettingsLoader.java index cfd4280..99542a4 100644 --- a/settings-content-json/src/main/java/org/xbib/settings/content/json/JsonSettingsLoader.java +++ b/settings-content-json/src/main/java/org/xbib/settings/content/json/JsonSettingsLoader.java @@ -11,6 +11,9 @@ import java.util.Set; */ public class JsonSettingsLoader extends AbstractSettingsLoader { + public JsonSettingsLoader() { + } + @Override public XContent content() { return JsonXContent.jsonContent(); diff --git a/settings-content-yaml/src/main/java/module-info.java b/settings-content-yaml/src/main/java/module-info.java index e0ba9df..088eed1 100644 --- a/settings-content-yaml/src/main/java/module-info.java +++ b/settings-content-yaml/src/main/java/module-info.java @@ -4,8 +4,7 @@ import org.xbib.settings.content.yaml.YamlSettingsLoader; module org.xbib.settings.content.yaml { exports org.xbib.settings.content.yaml; requires transitive org.xbib.settings.content; - requires org.xbib.content.api; - requires org.xbib.content.yaml; + requires transitive org.xbib.content.yaml; requires org.xbib.settings.api; uses SettingsLoader; provides SettingsLoader with YamlSettingsLoader; diff --git a/settings-content-yaml/src/main/java/org/xbib/settings/content/yaml/YamlSettingsLoader.java b/settings-content-yaml/src/main/java/org/xbib/settings/content/yaml/YamlSettingsLoader.java index 5e07789..4ca797f 100644 --- a/settings-content-yaml/src/main/java/org/xbib/settings/content/yaml/YamlSettingsLoader.java +++ b/settings-content-yaml/src/main/java/org/xbib/settings/content/yaml/YamlSettingsLoader.java @@ -15,6 +15,9 @@ public class YamlSettingsLoader extends AbstractSettingsLoader { private static final Set YAML_SUFFIXES = Set.of("yml", "yaml"); + public YamlSettingsLoader() { + } + @Override public XContent content() { return YamlXContent.yamlContent(); diff --git a/settings-content/build.gradle b/settings-content/build.gradle index 80c36e4..3c281a7 100644 --- a/settings-content/build.gradle +++ b/settings-content/build.gradle @@ -1,6 +1,6 @@ dependencies { api project(':settings-api') api project(':content-core') - api "org.xbib:datastructures-tiny:${project.property('xbib-datastructures.version')}" + api libs.datastructures.tiny testImplementation project(":settings-content-json") } diff --git a/settings-content/src/main/java/module-info.java b/settings-content/src/main/java/module-info.java index cef58ab..2d8013d 100644 --- a/settings-content/src/main/java/module-info.java +++ b/settings-content/src/main/java/module-info.java @@ -9,8 +9,7 @@ module org.xbib.settings.content { uses SettingsBuilder; provides SettingsBuilder with ContentSettingsBuilder; exports org.xbib.settings.content; - requires org.xbib.settings.api; - requires org.xbib.content.core; - requires org.xbib.datastructures.api; + requires transitive org.xbib.settings.api; + requires transitive org.xbib.content.core; requires transitive org.xbib.datastructures.tiny; } diff --git a/settings-content/src/main/java/org/xbib/settings/content/AbstractSettingsLoader.java b/settings-content/src/main/java/org/xbib/settings/content/AbstractSettingsLoader.java index 139d217..34f7a6c 100644 --- a/settings-content/src/main/java/org/xbib/settings/content/AbstractSettingsLoader.java +++ b/settings-content/src/main/java/org/xbib/settings/content/AbstractSettingsLoader.java @@ -20,6 +20,9 @@ import java.util.Map; */ public abstract class AbstractSettingsLoader implements SettingsLoader { + public AbstractSettingsLoader() { + } + public abstract XContent content(); @Override diff --git a/settings-content/src/main/java/org/xbib/settings/content/PropertiesSettingsLoader.java b/settings-content/src/main/java/org/xbib/settings/content/PropertiesSettingsLoader.java index f101291..a1889b2 100644 --- a/settings-content/src/main/java/org/xbib/settings/content/PropertiesSettingsLoader.java +++ b/settings-content/src/main/java/org/xbib/settings/content/PropertiesSettingsLoader.java @@ -21,6 +21,9 @@ public class PropertiesSettingsLoader implements SettingsLoader { private static final Set PROPERTIES_SUFFIXES = new HashSet<>(Collections.singletonList("properties")); + public PropertiesSettingsLoader() { + } + @Override public Set suffixes() { return PROPERTIES_SUFFIXES; diff --git a/settings-datastructures-json/build.gradle b/settings-datastructures-json/build.gradle index 6382f07..3337978 100644 --- a/settings-datastructures-json/build.gradle +++ b/settings-datastructures-json/build.gradle @@ -1,4 +1,4 @@ dependencies { api project(':settings-datastructures') - api "org.xbib:datastructures-json-tiny:${project.property('xbib-datastructures.version')}" + api libs.datastructures.json.tiny } diff --git a/settings-datastructures-json/src/main/java/org/xbib/settings/datastructures/json/JsonSettingsLoader.java b/settings-datastructures-json/src/main/java/org/xbib/settings/datastructures/json/JsonSettingsLoader.java index 987e33a..b023e99 100644 --- a/settings-datastructures-json/src/main/java/org/xbib/settings/datastructures/json/JsonSettingsLoader.java +++ b/settings-datastructures-json/src/main/java/org/xbib/settings/datastructures/json/JsonSettingsLoader.java @@ -7,6 +7,9 @@ import java.util.Set; public class JsonSettingsLoader extends AbstractSettingsLoader { + public JsonSettingsLoader() { + } + @Override public DataStructure dataStructure() { return new Json(); diff --git a/settings-datastructures-yaml/build.gradle b/settings-datastructures-yaml/build.gradle index 79a0278..d6f34d6 100644 --- a/settings-datastructures-yaml/build.gradle +++ b/settings-datastructures-yaml/build.gradle @@ -1,4 +1,4 @@ dependencies { api project(':settings-datastructures') - api "org.xbib:datastructures-yaml-tiny:${project.property('xbib-datastructures.version')}" + api libs.datastructures.yaml.tiny } diff --git a/settings-datastructures-yaml/src/main/java/org/xbib/settings/datastructures/yaml/YamlSettingsLoader.java b/settings-datastructures-yaml/src/main/java/org/xbib/settings/datastructures/yaml/YamlSettingsLoader.java index 3716cc3..11647a7 100644 --- a/settings-datastructures-yaml/src/main/java/org/xbib/settings/datastructures/yaml/YamlSettingsLoader.java +++ b/settings-datastructures-yaml/src/main/java/org/xbib/settings/datastructures/yaml/YamlSettingsLoader.java @@ -10,6 +10,9 @@ import java.util.Set; public class YamlSettingsLoader extends AbstractSettingsLoader { + public YamlSettingsLoader() { + } + @Override public DataStructure dataStructure() { return new Yaml(); diff --git a/settings-datastructures/build.gradle b/settings-datastructures/build.gradle index a5efeea..1007c01 100644 --- a/settings-datastructures/build.gradle +++ b/settings-datastructures/build.gradle @@ -1,4 +1,4 @@ dependencies { api project(':settings-api') - api "org.xbib:datastructures-tiny:${project.property('xbib-datastructures.version')}" + api libs.datastructures.tiny } diff --git a/settings-datastructures/src/main/java/org/xbib/settings/datastructures/AbstractSettingsLoader.java b/settings-datastructures/src/main/java/org/xbib/settings/datastructures/AbstractSettingsLoader.java index 0149290..96b182a 100644 --- a/settings-datastructures/src/main/java/org/xbib/settings/datastructures/AbstractSettingsLoader.java +++ b/settings-datastructures/src/main/java/org/xbib/settings/datastructures/AbstractSettingsLoader.java @@ -19,6 +19,9 @@ import java.util.Map; public abstract class AbstractSettingsLoader implements SettingsLoader { + public AbstractSettingsLoader() { + } + public abstract DataStructure dataStructure(); @Override diff --git a/settings-datastructures/src/main/java/org/xbib/settings/datastructures/PropertiesSettingsLoader.java b/settings-datastructures/src/main/java/org/xbib/settings/datastructures/PropertiesSettingsLoader.java index bed385e..7e21857 100644 --- a/settings-datastructures/src/main/java/org/xbib/settings/datastructures/PropertiesSettingsLoader.java +++ b/settings-datastructures/src/main/java/org/xbib/settings/datastructures/PropertiesSettingsLoader.java @@ -13,6 +13,9 @@ import java.util.Set; */ public class PropertiesSettingsLoader implements SettingsLoader { + public PropertiesSettingsLoader() { + } + @Override public Set suffixes() { return Set.of("properties"); diff --git a/settings.gradle b/settings.gradle index 457a20f..090e126 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,32 @@ +dependencyResolutionManagement { + versionCatalogs { + libs { + version('gradle', '7.5') + version('junit', '5.8.2') + version('jackson', '2.13.3') + version('datastructures', '1.0.0') + library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit') + library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit') + library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit') + library('junit4', 'junit', 'junit').version('4.13.2') + library('hamcrest', 'org.hamcrest:hamcrest-library:2.2') + library('jackson-core', 'com.fasterxml.jackson.core', 'jackson-core').versionRef('jackson') + library('jackson-databind', 'com.fasterxml.jackson.core', 'jackson-databind').versionRef('jackson') + library('jackson-dataformat-smile', 'com.fasterxml.jackson.dataformat', 'jackson-dataformat-smile').versionRef('jackson') + library('jackson-dataformat-xml', 'com.fasterxml.jackson.dataformat', 'jackson-dataformat-xml').versionRef('jackson') + library('jackson-dataformat-yaml', 'com.fasterxml.jackson.dataformat', 'jackson-dataformat-yaml').versionRef('jackson') + library('datastructures-api', 'org.xbib', 'datastructures-api').versionRef('datastructures') + library('datastructures-tiny', 'org.xbib', 'datastructures-tiny').versionRef('datastructures') + library('datastructures-json-tiny', 'org.xbib', 'datastructures-json-tiny').versionRef('datastructures') + library('datastructures-yaml-tiny', 'org.xbib', 'datastructures-yaml-tiny').versionRef('datastructures') + library('mockito-core', 'org.mockito', 'mockito-core').version('4.6.1') + library('mockito-inline', 'org.mockito', 'mockito-inline').version('4.6.1') + library('net', 'org.xbib', 'net-url').version('2.1.1') + library('woodstox', 'com.fasterxml.woodstox', 'woodstox-core').version('6.3.0') + library('snakeyaml', 'org.yaml', 'snakeyaml').version('1.30') + } + } +} include 'content-api' include 'content-core' include 'content-csv' @@ -16,3 +45,14 @@ include 'settings-datastructures' include 'settings-datastructures-json' include 'settings-datastructures-yaml' include 'config' + +/* +gradle.wrapper.version = 7.4.2 +xbib.net.version = 2.1.1 +xbib-datastructures.version = 1.0.0 +jackson.version = 2.12.3 +woodstox.version = 6.2.6 +snakeyaml.version = 1.28 +mockito.version = 3.10.0 +asciidoclet.version = 1.5.6 + */ \ No newline at end of file