diff --git a/content-core/src/main/java/org/xbib/content/XContentBuilder.java b/content-core/src/main/java/org/xbib/content/XContentBuilder.java index 6124b97..81fa03c 100644 --- a/content-core/src/main/java/org/xbib/content/XContentBuilder.java +++ b/content-core/src/main/java/org/xbib/content/XContentBuilder.java @@ -20,16 +20,12 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public final class XContentBuilder implements ToXContent, Flushable, Closeable { - private static final Logger logger = Logger.getLogger(XContentBuilder.class.getName()); - private final OutputStream outputStream; private final XContentGenerator generator; @@ -802,12 +798,8 @@ public final class XContentBuilder implements ToXContent, Flushable, Closeable { generator.close(); } - public BytesReference bytes() { - try { - generator.close(); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + public BytesReference bytes() throws IOException { + generator.close(); return ((BytesStreamOutput) outputStream).bytes(); } @@ -815,8 +807,9 @@ public final class XContentBuilder implements ToXContent, Flushable, Closeable { * Returns a string representation of the builder (only applicable for text based xcontent). * Only applicable when the builder is constructed with {@link BytesStreamOutput}. * @return string + * @throws IOException if string can not be converted to UTF-8 */ - public String string() { + public String string() throws IOException { return bytes().toUtf8(); } diff --git a/content-core/src/main/java/org/xbib/content/XContentHelper.java b/content-core/src/main/java/org/xbib/content/XContentHelper.java index 3cf564f..bb60d48 100644 --- a/content-core/src/main/java/org/xbib/content/XContentHelper.java +++ b/content-core/src/main/java/org/xbib/content/XContentHelper.java @@ -7,16 +7,12 @@ import java.io.IOException; import java.io.Reader; import java.nio.charset.StandardCharsets; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class XContentHelper { - private static final Logger logger = Logger.getLogger(XContentHelper.class.getName()); - private static final String UNKNOWN_FORMAT = "unknown format"; private XContentHelper() { @@ -169,7 +165,6 @@ public class XContentHelper { try { generator.writeBinary(parseBase16(parser.text())); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); generator.writeString(parser.text()); } } else { diff --git a/content-core/src/main/java/org/xbib/content/XContentService.java b/content-core/src/main/java/org/xbib/content/XContentService.java index 2339523..699143c 100644 --- a/content-core/src/main/java/org/xbib/content/XContentService.java +++ b/content-core/src/main/java/org/xbib/content/XContentService.java @@ -8,37 +8,23 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.ServiceLoader; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class XContentService { - private static final Logger logger = Logger.getLogger(XContentService.class.getName()); - private static final Map xcontents = new HashMap<>(); - private static final XContentService instance = new XContentService(); - - private XContentService() { - try { - ServiceLoader loader = ServiceLoader.load(XContent.class); - for (XContent xContent : loader) { - if (!xcontents.containsKey(xContent.name())) { - xcontents.put(xContent.name(), xContent); - } + static { + ServiceLoader loader = ServiceLoader.load(XContent.class); + for (XContent xContent : loader) { + if (!xcontents.containsKey(xContent.name())) { + xcontents.put(xContent.name(), xContent); } - } catch (Exception e) { - logger.log(Level.SEVERE, e.getMessage(), e); } } - public static XContentService getInstance() { - return instance; - } - public static XContentBuilder builder(String name) throws IOException { return xcontents.containsKey(name) ? XContentBuilder.builder(xcontents.get(name)) : null; } @@ -59,5 +45,4 @@ public class XContentService { } return null; } - } diff --git a/content-core/src/main/java/org/xbib/content/settings/Settings.java b/content-core/src/main/java/org/xbib/content/settings/Settings.java index 7939459..3c42dd6 100644 --- a/content-core/src/main/java/org/xbib/content/settings/Settings.java +++ b/content-core/src/main/java/org/xbib/content/settings/Settings.java @@ -30,21 +30,17 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class Settings implements AutoCloseable { - private static final Logger logger = Logger.getLogger(Settings.class.getName()); - public static final Settings EMPTY_SETTINGS = new Builder().build(); public static final String[] EMPTY_ARRAY = new String[0]; - public static final int BUFFER_SIZE = 1024 * 8; + public static final int BUFFER_SIZE = 1024 * 4; private DefaultSettingsRefresher refresher; @@ -621,7 +617,8 @@ public class Settings implements AutoCloseable { * @return builder */ public Builder loadFromString(String source) { - SettingsLoader settingsLoader = SettingsLoaderService.loaderFromString(source); + SettingsLoaderService settingsLoaderService = new SettingsLoaderService(); + SettingsLoader settingsLoader = settingsLoaderService.loaderFromString(source); try { Map loadedSettings = settingsLoader.load(source); put(loadedSettings); @@ -666,7 +663,8 @@ public class Settings implements AutoCloseable { * @return builder */ public Builder loadFromStream(String resourceName, InputStream inputStream) throws SettingsException { - SettingsLoader settingsLoader = SettingsLoaderService.loaderFromResource(resourceName); + SettingsLoaderService settingsLoaderService = new SettingsLoaderService(); + SettingsLoader settingsLoader = settingsLoaderService.loaderFromResource(resourceName); try { Map loadedSettings = settingsLoader .load(copyToString(new InputStreamReader(inputStream, StandardCharsets.UTF_8))); @@ -725,7 +723,6 @@ public class Settings implements AutoCloseable { try { return DateTimeFormatter.ofPattern(placeholderName).format(LocalDate.now()); } catch (IllegalArgumentException | DateTimeException e) { - logger.log(Level.FINER, e.getMessage(), e); return map.get(placeholderName); } } @@ -759,11 +756,14 @@ public class Settings implements AutoCloseable { private final AtomicBoolean closed; + private final SettingsLoaderService settingsLoaderService; + DefaultSettingsRefresher(Path path, long initialDelay, long period, TimeUnit timeUnit) { this.path = path; this.executorService = Executors.newSingleThreadScheduledExecutor(); executorService.scheduleAtFixedRate(this, initialDelay, period, timeUnit); this.closed = new AtomicBoolean(); + this.settingsLoaderService = new SettingsLoaderService(); } @Override @@ -771,7 +771,7 @@ public class Settings implements AutoCloseable { try { if (!closed.get()) { String settingsSource = Files.readString(path); - SettingsLoader settingsLoader = SettingsLoaderService.loaderFromResource(path.toString()); + SettingsLoader settingsLoader = settingsLoaderService.loaderFromResource(path.toString()); map = settingsLoader.load(settingsSource); } } catch (IOException e) { diff --git a/content-core/src/main/java/org/xbib/content/settings/SettingsLoaderService.java b/content-core/src/main/java/org/xbib/content/settings/SettingsLoaderService.java index 60c4208..67e5fa9 100644 --- a/content-core/src/main/java/org/xbib/content/settings/SettingsLoaderService.java +++ b/content-core/src/main/java/org/xbib/content/settings/SettingsLoaderService.java @@ -6,41 +6,30 @@ import java.util.HashMap; import java.util.Map; import java.util.ServiceLoader; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; /** * A settings loader service for loading {@link SettingsLoader} implementations. */ public final class SettingsLoaderService { - private static final Logger logger = Logger.getLogger(SettingsLoaderService.class.getName()); + private final Map, SettingsLoader> settingsLoaderMap; - private static final Map, SettingsLoader> settingsLoaderMap; - - static { - settingsLoaderMap = new HashMap<>(); - try { - ServiceLoader serviceLoader = ServiceLoader.load(SettingsLoader.class); - for (SettingsLoader settingsLoader : serviceLoader) { - if (!settingsLoaderMap.containsKey(settingsLoader.suffixes())) { - settingsLoaderMap.put(settingsLoader.suffixes(), settingsLoader); - } + public SettingsLoaderService() { + this.settingsLoaderMap = new HashMap<>(); + ServiceLoader serviceLoader = ServiceLoader.load(SettingsLoader.class); + for (SettingsLoader settingsLoader : serviceLoader) { + if (!settingsLoaderMap.containsKey(settingsLoader.suffixes())) { + settingsLoaderMap.put(settingsLoader.suffixes(), settingsLoader); } - } catch (Exception e) { - logger.log(Level.SEVERE, e.getMessage(), e); } } - private SettingsLoaderService() { - } - /** * Returns a {@link SettingsLoader} based on the resource name. * @param resourceName the resource * @return the settings loader */ - public static SettingsLoader loaderFromResource(String resourceName) { + public SettingsLoader loaderFromResource(String resourceName) { for (Map.Entry, SettingsLoader> entry : settingsLoaderMap.entrySet()) { Set suffixes = entry.getKey(); for (String suffix : suffixes) { @@ -57,7 +46,7 @@ public final class SettingsLoaderService { * @param source the source * @return the settings loader */ - public static SettingsLoader loaderFromString(String source) { + public SettingsLoader loaderFromString(String source) { for (SettingsLoader loader : settingsLoaderMap.values()) { if (loader.canLoad(source)) { return loader; diff --git a/content-core/src/test/java/org/xbib/content/settings/SettingsTest.java b/content-core/src/test/java/org/xbib/content/settings/SettingsTest.java index 95789bd..c087b4c 100644 --- a/content-core/src/test/java/org/xbib/content/settings/SettingsTest.java +++ b/content-core/src/test/java/org/xbib/content/settings/SettingsTest.java @@ -20,15 +20,12 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import java.util.logging.Logger; /** * */ public class SettingsTest extends Assert { - private static final Logger logger = Logger.getLogger(SettingsTest.class.getName()); - @Test public void testEmpty() { Settings settings = Settings.EMPTY_SETTINGS; @@ -60,7 +57,6 @@ public class SettingsTest extends Assert { for (Map.Entry entry : map.entrySet()) { list.add((Map) entry.getValue()); } - logger.info(list.toString()); assertEquals("[{name=Name 0, code=Code 0}, {name=Name 1, code=Code 1}]", list.toString()); } diff --git a/content-json/src/main/java/org/xbib/content/json/jackson/JacksonUtils.java b/content-json/src/main/java/org/xbib/content/json/jackson/JacksonUtils.java index bbe468d..56b4a88 100644 --- a/content-json/src/main/java/org/xbib/content/json/jackson/JacksonUtils.java +++ b/content-json/src/main/java/org/xbib/content/json/jackson/JacksonUtils.java @@ -14,8 +14,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Utility class for Jackson. @@ -27,8 +25,6 @@ import java.util.logging.Logger; */ public final class JacksonUtils { - private static final Logger logger = Logger.getLogger(JacksonUtils.class.getName()); - private static final JsonNodeFactory FACTORY = JsonNodeFactory.instance; private static final ObjectReader READER; @@ -91,17 +87,11 @@ public final class JacksonUtils { * * @param node the JSON value to print * @return the pretty printed value as a string - * @see #newMapper() + * @throws IOException if writing as UTF-8 fails */ - public static String prettyPrint(final JsonNode node) { + public static String prettyPrint(final JsonNode node) throws IOException { final StringWriter writer = new StringWriter(); - - try { - WRITER.writeValue(writer, node); - writer.flush(); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + WRITER.writeValue(writer, node); return writer.toString(); } 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 8aaf94e..8b74577 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 @@ -11,8 +11,6 @@ import com.fasterxml.jackson.databind.ObjectReader; import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Class dedicated to reading JSON values from {@link java.io.InputStream}s and {@link @@ -33,8 +31,6 @@ import java.util.logging.Logger; */ public final class JsonNodeReader { - private static final Logger logger = Logger.getLogger(JsonNodeReader.class.getName()); - private final ObjectReader reader; public JsonNodeReader(final ObjectMapper mapper) { @@ -59,7 +55,6 @@ public final class JsonNodeReader { throw builder.build(); } } catch (JsonParseException e) { - logger.log(Level.FINE, e.getMessage(), e); throw builder.setLocation(e.getLocation()).build(); } return ret; diff --git a/content-language/src/main/java/org/xbib/content/language/Lang.java b/content-language/src/main/java/org/xbib/content/language/Lang.java index 9b21f05..2084f66 100644 --- a/content-language/src/main/java/org/xbib/content/language/Lang.java +++ b/content-language/src/main/java/org/xbib/content/language/Lang.java @@ -6,8 +6,6 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -16,8 +14,6 @@ import java.util.regex.Pattern; */ public final class Lang extends SubtagSet { - private static final Logger logger = Logger.getLogger(Lang.class.getName()); - private static final String LANGUAGE = "((?:[a-zA-Z]{2,3}(?:[-_][a-zA-Z]{3}){0,3})|[a-zA-Z]{4}|[a-zA-Z]{5,8})"; private static final String SCRIPT = "((?:[-_][a-zA-Z]{4})?)"; private static final String REGION = "((?:[-_](?:(?:[a-zA-Z]{2})|(?:[0-9]{3})))?)"; @@ -69,7 +65,6 @@ public final class Lang extends SubtagSet { try { return parse(locale.toString()).primary; } catch (Exception e) { - logger.log(Level.FINE, e.getMessage(), e); Subtag c = null; Subtag primary = new Subtag(Type.PRIMARY, locale.getLanguage()); String country = locale.getCountry(); diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java index 6ff86f9..43d2cbe 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java @@ -116,14 +116,14 @@ public class RdfXContentGenerator

implements RdfCon return this; } - public String string() { + public String string() throws IOException { if (builder != null) { return builder.string(); } return null; } - public String get() { + public String get() throws IOException { return string(); } diff --git a/content-resource/src/main/java/org/xbib/content/resource/IRI.java b/content-resource/src/main/java/org/xbib/content/resource/IRI.java index 14eefa9..00d4333 100644 --- a/content-resource/src/main/java/org/xbib/content/resource/IRI.java +++ b/content-resource/src/main/java/org/xbib/content/resource/IRI.java @@ -14,8 +14,6 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -24,8 +22,6 @@ import java.util.regex.Pattern; */ public class IRI implements Comparable, Node { - private static final Logger logger = Logger.getLogger(IRI.class.getName()); - private static final SchemeRegistry registry = SchemeRegistry.getInstance(); private static final Pattern IRIPATTERN = Pattern.compile("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?"); @@ -202,7 +198,7 @@ public class IRI implements Comparable, Node { try { buf.append(PercentEncoders.getMatrixEncoder(StandardCharsets.UTF_8).encode(percentDecoder.decode(segment))); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); } } } @@ -431,7 +427,7 @@ public class IRI implements Comparable, Node { try { asciiFragment = PercentEncoders.getFragmentEncoder(StandardCharsets.UTF_8).encode(fragment); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); } } return asciiFragment; @@ -442,7 +438,7 @@ public class IRI implements Comparable, Node { try { asciiPath = PercentEncoders.getPathEncoder(StandardCharsets.UTF_8).encode(path); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); } } return asciiPath; @@ -453,7 +449,7 @@ public class IRI implements Comparable, Node { try { asciiQuery = PercentEncoders.getQueryEncoder(StandardCharsets.UTF_8).encode(query); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); } } return asciiQuery; @@ -464,7 +460,7 @@ public class IRI implements Comparable, Node { try { asciiUserinfo = PercentEncoders.getUnreservedEncoder(StandardCharsets.UTF_8).encode(userinfo); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); } } return asciiUserinfo; @@ -527,7 +523,7 @@ public class IRI implements Comparable, Node { try { return PercentEncoders.getUnreservedEncoder(StandardCharsets.UTF_8).encode(toString()); } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); + //logger.log(Level.FINE, e.getMessage(), e); return null; } } diff --git a/content-resource/src/main/java/org/xbib/content/resource/IRINamespaceContext.java b/content-resource/src/main/java/org/xbib/content/resource/IRINamespaceContext.java index b0a67e5..a32d13d 100644 --- a/content-resource/src/main/java/org/xbib/content/resource/IRINamespaceContext.java +++ b/content-resource/src/main/java/org/xbib/content/resource/IRINamespaceContext.java @@ -6,16 +6,12 @@ import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public final class IRINamespaceContext extends XmlNamespaceContext { - private static final Logger logger = Logger.getLogger(IRINamespaceContext.class.getName()); - /** * Share namespace.properties with {@link XmlNamespaceContext}. */ @@ -49,7 +45,6 @@ public final class IRINamespaceContext extends XmlNamespaceContext { try { instance = new IRINamespaceContext(ResourceBundle.getBundle(bundleName, locale, classLoader)); } catch (MissingResourceException e) { - logger.log(Level.FINE, e.getMessage(), e); instance = new IRINamespaceContext(); } } diff --git a/content-resource/src/main/java/org/xbib/content/resource/XmlNamespaceContext.java b/content-resource/src/main/java/org/xbib/content/resource/XmlNamespaceContext.java index 3ef27f8..24394ec 100644 --- a/content-resource/src/main/java/org/xbib/content/resource/XmlNamespaceContext.java +++ b/content-resource/src/main/java/org/xbib/content/resource/XmlNamespaceContext.java @@ -9,8 +9,6 @@ import java.util.ResourceBundle; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.xml.namespace.NamespaceContext; @@ -19,8 +17,6 @@ import javax.xml.namespace.NamespaceContext; */ public class XmlNamespaceContext implements NamespaceContext { - private static final Logger logger = Logger.getLogger(XmlNamespaceContext.class.getName()); - private static final String DEFAULT_RESOURCE = XmlNamespaceContext.class.getPackage().getName().replace('.', '/') + '/' + "namespace"; @@ -79,7 +75,6 @@ public class XmlNamespaceContext implements NamespaceContext { try { return new XmlNamespaceContext(ResourceBundle.getBundle(bundleName, locale, classLoader)); } catch (MissingResourceException e) { - logger.log(Level.WARNING, e.getMessage(), e); return new XmlNamespaceContext(); } } 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 a376eaf..019e3e2 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 @@ -2,15 +2,12 @@ package org.xbib.content.resource.text; import java.util.Iterator; import java.util.NoSuchElementException; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Provides an iterator over Unicode Codepoints. */ public abstract class CodepointIterator implements Iterator { - private static final Logger logger = Logger.getLogger(CodepointIterator.class.getName()); protected int position = -1; protected int limit = -1; @@ -346,7 +343,6 @@ public abstract class CodepointIterator implements Iterator { return false; } } catch (InvalidCharacterException e) { - logger.log(Level.FINE, e.getMessage(), e); return false; } } diff --git a/content-xml/src/test/java/org/xbib/content/xml/XContentXmlBuilderTest.java b/content-xml/src/test/java/org/xbib/content/xml/XContentXmlBuilderTest.java index 30b8799..a052a55 100644 --- a/content-xml/src/test/java/org/xbib/content/xml/XContentXmlBuilderTest.java +++ b/content-xml/src/test/java/org/xbib/content/xml/XContentXmlBuilderTest.java @@ -5,13 +5,11 @@ import org.junit.Test; import org.xbib.content.XContentBuilder; import org.xbib.content.XContentHelper; import org.xbib.content.resource.XmlNamespaceContext; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Map; - import javax.xml.namespace.QName; /** diff --git a/content-xml/src/test/java/org/xbib/content/xml/XmlNamespaceContextTest.java b/content-xml/src/test/java/org/xbib/content/xml/XmlNamespaceContextTest.java index 84b3213..c96966f 100644 --- a/content-xml/src/test/java/org/xbib/content/xml/XmlNamespaceContextTest.java +++ b/content-xml/src/test/java/org/xbib/content/xml/XmlNamespaceContextTest.java @@ -2,11 +2,9 @@ package org.xbib.content.xml; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; - import org.junit.Test; import org.xbib.content.XContentBuilder; import org.xbib.content.resource.XmlNamespaceContext; - import javax.xml.namespace.QName; /** diff --git a/content-xml/src/test/java/org/xbib/content/xml/json/Json2XmlTest.java b/content-xml/src/test/java/org/xbib/content/xml/json/Json2XmlTest.java index 926110a..50d99be 100644 --- a/content-xml/src/test/java/org/xbib/content/xml/json/Json2XmlTest.java +++ b/content-xml/src/test/java/org/xbib/content/xml/json/Json2XmlTest.java @@ -3,7 +3,6 @@ package org.xbib.content.xml.json; import org.junit.Test; import org.xbib.content.resource.XmlNamespaceContext; import org.xml.sax.InputSource; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -13,7 +12,6 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import java.nio.charset.StandardCharsets; - import javax.xml.namespace.QName; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; diff --git a/content-xml/src/test/java/org/xbib/content/xml/json/StylesheetTransformerTest.java b/content-xml/src/test/java/org/xbib/content/xml/json/StylesheetTransformerTest.java index e64a22f..ac47637 100644 --- a/content-xml/src/test/java/org/xbib/content/xml/json/StylesheetTransformerTest.java +++ b/content-xml/src/test/java/org/xbib/content/xml/json/StylesheetTransformerTest.java @@ -4,12 +4,10 @@ import org.junit.Test; import org.xbib.content.resource.XmlNamespaceContext; import org.xbib.content.xml.transform.StylesheetTransformer; import org.xml.sax.InputSource; - import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; - import javax.xml.namespace.QName; import javax.xml.transform.sax.SAXSource; @@ -20,7 +18,7 @@ public class StylesheetTransformerTest { private final QName root = new QName("http://example.org", "result", "ex"); - private XmlNamespaceContext context = XmlNamespaceContext.newDefaultInstance(); + private final XmlNamespaceContext context = XmlNamespaceContext.newDefaultInstance(); @Test public void testJsonAsXML() throws Exception { diff --git a/content-xml/src/test/java/org/xbib/content/xml/util/SaxEventConsumerTest.java b/content-xml/src/test/java/org/xbib/content/xml/util/SaxEventConsumerTest.java index 7e6ffc3..69eaf1c 100644 --- a/content-xml/src/test/java/org/xbib/content/xml/util/SaxEventConsumerTest.java +++ b/content-xml/src/test/java/org/xbib/content/xml/util/SaxEventConsumerTest.java @@ -3,10 +3,8 @@ package org.xbib.content.xml.util; import org.junit.Test; import org.xbib.content.xml.stream.SaxEventConsumer; import org.xml.sax.helpers.DefaultHandler; - import java.util.LinkedList; import java.util.List; - import javax.xml.namespace.QName; import javax.xml.stream.XMLEventFactory; import javax.xml.stream.events.Attribute; diff --git a/content-yaml/src/main/java/org/xbib/content/yaml/YamlSettingsLoader.java b/content-yaml/src/main/java/org/xbib/content/yaml/YamlSettingsLoader.java index 179d985..afb3d77 100644 --- a/content-yaml/src/main/java/org/xbib/content/yaml/YamlSettingsLoader.java +++ b/content-yaml/src/main/java/org/xbib/content/yaml/YamlSettingsLoader.java @@ -2,7 +2,6 @@ package org.xbib.content.yaml; import org.xbib.content.XContent; import org.xbib.content.settings.AbstractSettingsLoader; - import java.io.IOException; import java.util.Arrays; import java.util.HashSet; 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 9ec8a77..73751e7 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 @@ -7,7 +7,6 @@ import org.xbib.content.XContentBuilder; import org.xbib.content.XContentGenerator; import org.xbib.content.XContentParser; import org.xbib.content.io.BytesReference; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContentGenerator.java b/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContentGenerator.java index 86ad08a..fcf639f 100644 --- a/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContentGenerator.java +++ b/content-yaml/src/main/java/org/xbib/content/yaml/YamlXContentGenerator.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLParser; import org.xbib.content.XContent; import org.xbib.content.io.BytesReference; import org.xbib.content.json.JsonXContentGenerator; - import java.io.IOException; import java.io.OutputStream; diff --git a/gradle.properties b/gradle.properties index 1ee8ca2..a06606b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = content -version = 2.0.6 +version = 2.1.0 xbib-net.version = 2.0.3 jackson.version = 2.9.10 @@ -8,9 +8,9 @@ jackson-databind.version = 2.9.10.1 woodstox.version = 6.0.2 # test -junit.version = 5.5.2 -junit4.version = 4.12 -hamcrest.version = 2.1 +junit.version = 5.6.2 +junit4.version = 4.13 +hamcrest.version = 2.2 mockito.version = 3.1.0 # doc