tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acob...@apache.org
Subject [incubator-tamaya] branch master updated: TAMAYA-277: Minor code clean-up from Sonar report
Date Thu, 02 May 2019 18:41:35 GMT
This is an automated email from the ASF dual-hosted git repository.

acoburn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tamaya.git


The following commit(s) were added to refs/heads/master by this push:
     new f36da43  TAMAYA-277: Minor code clean-up from Sonar report
f36da43 is described below

commit f36da4344f0626616ee1609d32957d9933f57845
Author: Aaron Coburn <acoburn@apache.org>
AuthorDate: Thu May 2 14:41:31 2019 -0400

    TAMAYA-277: Minor code clean-up from Sonar report
    
    This makes some minor changes, based on the Sonar report.
---
 .../java/org/apache/tamaya/spi/FilterContext.java  | 29 ++++++----------------
 .../main/java/org/apache/tamaya/spi/ListValue.java |  3 ++-
 .../java/org/apache/tamaya/spi/ObjectValue.java    | 19 ++++++--------
 .../java/org/apache/tamaya/spi/PropertyValue.java  | 14 ++++++-----
 .../java/org/apache/tamaya/ConfigurationTest.java  |  2 +-
 .../org/apache/tamaya/spi/PropertySourceTest.java  |  7 +++---
 .../org/apache/tamaya/spi/PropertyValueTest.java   |  7 +++---
 .../apache/tamaya/core/internal/BannerManager.java |  2 +-
 .../core/internal/CoreConfigurationBuilder.java    |  1 +
 .../core/internal/converters/BooleanConverter.java |  2 +-
 .../core/internal/converters/ByteConverter.java    |  2 +-
 .../core/internal/converters/ClassConverter.java   |  2 +-
 .../internal/converters/DurationConverter.java     |  2 +-
 .../core/internal/converters/FileConverter.java    |  2 +-
 .../core/internal/converters/InstantConverter.java |  2 +-
 .../internal/converters/LocalDateConverter.java    |  2 +-
 .../converters/LocalDateTimeConverter.java         |  2 +-
 .../internal/converters/LocalTimeConverter.java    |  2 +-
 .../converters/OffsetDateTimeConverter.java        |  2 +-
 .../internal/converters/OffsetTimeConverter.java   |  2 +-
 .../core/internal/converters/PathConverter.java    |  2 +-
 .../core/internal/converters/URIConverter.java     |  2 +-
 .../core/internal/converters/URLConverter.java     |  2 +-
 23 files changed, 50 insertions(+), 62 deletions(-)

diff --git a/code/api/src/main/java/org/apache/tamaya/spi/FilterContext.java b/code/api/src/main/java/org/apache/tamaya/spi/FilterContext.java
index db4fd73..3833bfe 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/FilterContext.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/FilterContext.java
@@ -48,15 +48,11 @@ public class FilterContext {
      * @param configurationContext the current configurationContext, not {@code null}.
      */
     public FilterContext(PropertyValue value, Map<String,PropertyValue> configEntries,
ConfigurationContext configurationContext) {
-        Objects.requireNonNull(value, "Value must not be null.");
-        Objects.requireNonNull(configEntries, "Initial configuration entries must be not
null.");
-        Objects.requireNonNull(configurationContext, "Context must be not null.");
-
-        this.singlePropertyScoped = false;
-        this.values = Collections.singletonList(Objects.requireNonNull(value));
-        this.configurationContext = Objects.requireNonNull(configurationContext);
-        this.configEntries.putAll(configEntries);
+        this.values = Collections.singletonList(Objects.requireNonNull(value, "Value must
not be null."));
+        this.configurationContext = Objects.requireNonNull(configurationContext, "Context
must be non null");
+        this.configEntries.putAll(Objects.requireNonNull(configEntries, "Initial configuration
entries must be not null."));
         this.configEntries = Collections.unmodifiableMap(this.configEntries);
+        this.singlePropertyScoped = false;
     }
 
     /**
@@ -66,13 +62,7 @@ public class FilterContext {
      * @param configurationContext the current configurationContext, not {@code null}.
      */
     public FilterContext(PropertyValue value, ConfigurationContext configurationContext)
{
-        Objects.requireNonNull(value, "Value must not be null.");
-        Objects.requireNonNull(configurationContext, "Context must be not null.");
-
-        this.singlePropertyScoped = true;
-        this.configurationContext = Objects.requireNonNull(configurationContext);
-        this.values = Collections.singletonList(Objects.requireNonNull(value));
-        this.configEntries = Collections.unmodifiableMap(this.configEntries);
+        this(Collections.singletonList(Objects.requireNonNull(value)), configurationContext);
     }
 
     /**
@@ -82,13 +72,10 @@ public class FilterContext {
      * @param configurationContext the current configurationContext, not {@code null}.
      */
     public FilterContext(List<PropertyValue> values, ConfigurationContext configurationContext)
{
-        Objects.requireNonNull(values, "Value must not be null.");
-        Objects.requireNonNull(configurationContext, "Context must be not null.");
-
-        this.singlePropertyScoped = true;
-        this.configurationContext = Objects.requireNonNull(configurationContext);
-        this.values = Collections.unmodifiableList(new ArrayList<>(values));
+        this.configurationContext = Objects.requireNonNull(configurationContext, "Context
must not be null.");
+        this.values = Collections.unmodifiableList(new ArrayList<>(Objects.requireNonNull(values,
"Value must not be null.")));
         this.configEntries = Collections.unmodifiableMap(this.configEntries);
+        this.singlePropertyScoped = true;
     }
 
     /**
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/ListValue.java b/code/api/src/main/java/org/apache/tamaya/spi/ListValue.java
index c59a7b1..f0f9ceb 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/ListValue.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/ListValue.java
@@ -51,6 +51,7 @@ public final class ListValue extends PropertyValue{
      * Get the item's current createValue type.
      * @return the createValue type, never null.
      */
+    @Override
     public ValueType getValueType() {
         return ValueType.ARRAY;
     }
@@ -89,7 +90,7 @@ public final class ListValue extends PropertyValue{
     public <T extends PropertyValue> T add(T value) {
         checkImmutable();
         value.setParent(this);
-        if(!this.list.stream().filter(p -> p==value).findAny().isPresent()){
+        if(this.list.stream().noneMatch(p -> p == value)) {
             this.list.add(value);
         }
         return value;
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/ObjectValue.java b/code/api/src/main/java/org/apache/tamaya/spi/ObjectValue.java
index 286fbe5..a640a04 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/ObjectValue.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/ObjectValue.java
@@ -21,7 +21,6 @@ package org.apache.tamaya.spi;
 import java.util.*;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
 
 /**
@@ -38,8 +37,6 @@ public final class ObjectValue extends PropertyValue{
 
     private static final long serialVersionUID = 1L;
 
-    private static final Logger LOG = Logger.getLogger(ObjectValue.class.getName());
-
     /** List of child properties. */
     private Map<String, PropertyValue> fields = new HashMap<>();
 
@@ -57,6 +54,7 @@ public final class ObjectValue extends PropertyValue{
      * Get the item's current value type.
      * @return the value type, never null.
      */
+    @Override
     public ValueType getValueType() {
         return ValueType.MAP;
     }
@@ -138,7 +136,6 @@ public final class ObjectValue extends PropertyValue{
         array.setValue(getValue());
         array.setMeta(getMeta());
         array.setVersion(getVersion());
-        int index = 0;
         for(PropertyValue val:fields.values()){
             array.add(val.deepClone());
         }
@@ -260,14 +257,12 @@ public final class ObjectValue extends PropertyValue{
     public Map<String,String> toMap(){
         Map<String, String> map = new TreeMap<>();
         for (PropertyValue n : fields.values()) {
-            switch(n.getValueType()){
-                case VALUE:
-                    map.put(n.getQualifiedKey(), n.getValue());
-                    break;
-                default:
-                    for(PropertyValue val:n) {
-                        map.putAll(val.toMap());
-                    }
+            if (ValueType.VALUE.equals(n.getValueType())) {
+                map.put(n.getQualifiedKey(), n.getValue());
+            } else {
+                for(PropertyValue val:n) {
+                    map.putAll(val.toMap());
+                }
             }
         }
         return map;
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
index 5ea569c..22af7e1 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
@@ -35,6 +35,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 public class PropertyValue implements Serializable, Iterable<PropertyValue>{
 
     private static final long serialVersionUID = 2L;
+    private static final int EMPTY = 0;
+    private static final String SOURCE = "source";
     /** The requested key. */
     private String key;
     /** The createValue. */
@@ -133,7 +135,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
     public static PropertyValue of(String key, String value, String source) {
         Objects.requireNonNull(key);
         if(source!=null) {
-            return new PropertyValue(null, key, value).setMeta("source", source);
+            return new PropertyValue(null, key, value).setMeta(SOURCE, source);
         }
         return new PropertyValue(null, key, value);
     }
@@ -147,7 +149,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
     public static Map<String, PropertyValue> map(Map<String, String> config,
String source) {
         Map<String, PropertyValue> result = new HashMap<>(config.size());
         for(Map.Entry<String,String> en:config.entrySet()){
-            result.put(en.getKey(), createValue(en.getKey(), en.getValue()).setMeta("source",
source));
+            result.put(en.getKey(), createValue(en.getKey(), en.getValue()).setMeta(SOURCE,
source));
         }
         return result;
     }
@@ -171,7 +173,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
             PropertyValue pv = createValue(en.getKey(), en.getValue())
                     .setMeta(metaData);
             if(source!=null){
-                pv.setMeta("source", source);
+                pv.setMeta(SOURCE, source);
             }
             result.put(en.getKey(), pv);
         }
@@ -259,7 +261,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
      */
     @Deprecated
     public String getSource() {
-        return this.metaEntries.get("source");
+        return this.metaEntries.get(SOURCE);
     }
 
 
@@ -363,7 +365,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
      */
     @Deprecated
     public String getMetaEntry(String key) {
-        return (String)this.metaEntries.get(Objects.requireNonNull(key));
+        return this.metaEntries.get(Objects.requireNonNull(key));
     }
 
     /**
@@ -381,7 +383,7 @@ public class PropertyValue implements Serializable, Iterable<PropertyValue>{
      * @return the getNumChilds of this multi createValue.
      */
     public int getSize() {
-        return 0;
+        return EMPTY;
     }
 
     @Override
diff --git a/code/api/src/test/java/org/apache/tamaya/ConfigurationTest.java b/code/api/src/test/java/org/apache/tamaya/ConfigurationTest.java
index 1c4f071..f4e438c 100644
--- a/code/api/src/test/java/org/apache/tamaya/ConfigurationTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/ConfigurationTest.java
@@ -266,7 +266,7 @@ public class ConfigurationTest {
     public void testMap() throws Exception {
         UnaryOperator<Configuration> noop = (Configuration config) -> config;
         assertThat(Configuration.current().map(noop)).isNotNull();
-        assertThat(Configuration.current().map(noop)== Configuration.current());
+        assertThat(Configuration.current().map(noop)).isEqualTo(Configuration.current());
     }
 
     @Test
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/PropertySourceTest.java b/code/api/src/test/java/org/apache/tamaya/spi/PropertySourceTest.java
index 139e85b..ad34ce4 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/PropertySourceTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/PropertySourceTest.java
@@ -26,6 +26,7 @@ import java.util.function.BiConsumer;
 import org.junit.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.mockito.Mockito.mock;
 
 public class PropertySourceTest {
@@ -63,18 +64,18 @@ public class PropertySourceTest {
     @Test
     public void addChangeListener(){
         BiConsumer<Set<String>,PropertySource> l = mock(BiConsumer.class);
-        new PropertySourceImpl().addChangeListener(l);
+        assertThatCode(() -> new PropertySourceImpl().addChangeListener(l)).doesNotThrowAnyException();
     }
 
     @Test
     public void removeChangeListener(){
         BiConsumer<Set<String>,PropertySource> l = mock(BiConsumer.class);
-        new PropertySourceImpl().removeChangeListener(l);
+        assertThatCode(() -> new PropertySourceImpl().removeChangeListener(l)).doesNotThrowAnyException();
     }
 
     @Test
     public void removeAllChangeListeners(){
-        new PropertySourceImpl().removeAllChangeListeners();
+        assertThatCode(() -> new PropertySourceImpl().removeAllChangeListeners()).doesNotThrowAnyException();
     }
 
     @Test
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
index 2a5f946..a94a324 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
 
 @SuppressWarnings("unchecked")
 public class PropertyValueTest {
@@ -35,7 +36,7 @@ public class PropertyValueTest {
 
     @Test
     public void ofDoesAcceptNullAsSource() throws Exception {
-        PropertyValue.of("a", "b", null);
+        assertThatCode(() -> PropertyValue.of("a", "b", null)).doesNotThrowAnyException();
     }
 
     @Test
@@ -207,12 +208,12 @@ public class PropertyValueTest {
 
     @Test
     public void testInstantiateNoValue2() throws Exception {
-        PropertyValue.createValue("k", null);
+        assertThatCode(() -> PropertyValue.createValue("k", null)).doesNotThrowAnyException();
     }
 
     @Test
     public void testInstantiateNoSource2() throws Exception {
-        PropertyValue.createValue("k", "v");
+        assertThatCode(() -> PropertyValue.createValue("k", "v")).doesNotThrowAnyException();
     }
 
     @Test(expected = NullPointerException.class)
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/BannerManager.java b/code/core/src/main/java/org/apache/tamaya/core/internal/BannerManager.java
index 5ec3bfe..2481ecf 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/BannerManager.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/BannerManager.java
@@ -61,7 +61,7 @@ class BannerManager {
     /**
      * The resouce path to the file containing the banner of Tamaya.
      */
-    protected final static String BANNER_RESOURCE_PATH = "/tamaya-banner.txt";
+    protected static final String BANNER_RESOURCE_PATH = "/tamaya-banner.txt";
 
     /**
      * The target for the Tamaya banner output.
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
index 3aeac8c..ae76062 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
@@ -79,6 +79,7 @@ public final class CoreConfigurationBuilder extends DefaultConfigurationBuilder
     }
 
     @SuppressWarnings("unchecked")
+    @Override
     protected void addCorePropertyConverters() {
         addPropertyConverters(TypeLiteral.<BigDecimal>of(BigDecimal.class), new BigDecimalConverter());
         addPropertyConverters(TypeLiteral.<BigInteger>of(BigInteger.class), new BigIntegerConverter());
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
index 989e4da..77d954f 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
@@ -32,7 +32,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class BooleanConverter implements PropertyConverter<Boolean> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(BooleanConverter.class.getName());
 
     @Override
     public Boolean convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
index a07015f..8b43738 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
@@ -47,7 +47,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class ByteConverter implements PropertyConverter<Byte>{
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(ByteConverter.class.getName());
 
     @Override
     public Byte convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
index d3dc31f..4c3b4ee 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
@@ -36,7 +36,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class ClassConverter implements PropertyConverter<Class<?>>{
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(ClassConverter.class.getName());
 
     @Override
     public Class<?> convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
index c58e0af..f8239ce 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
@@ -34,7 +34,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class DurationConverter implements PropertyConverter<Duration> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(DurationConverter.class.getName());
 
     @Override
     public Duration convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
index b911e31..e9b21a9 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class FileConverter implements PropertyConverter<File> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(FileConverter.class.getName());
 
     @Override
     public File convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
index 4a0994f..5c3b6ec 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class InstantConverter implements PropertyConverter<Instant> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(InstantConverter.class.getName());
 
     @Override
     public Instant convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
index 5f09ec4..ced145e 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class LocalDateConverter implements PropertyConverter<LocalDate> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(LocalDateConverter.class.getName());
 
     @Override
     public LocalDate convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
index ea92f6c..92f2d75 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class LocalDateTimeConverter implements PropertyConverter<LocalDateTime> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(LocalDateTimeConverter.class.getName());
 
     @Override
     public LocalDateTime convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
index 5fbaa47..2507b37 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class LocalTimeConverter implements PropertyConverter<LocalTime> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(LocalTimeConverter.class.getName());
 
     @Override
     public LocalTime convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
index 3ef70db..f266ceb 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class OffsetDateTimeConverter implements PropertyConverter<OffsetDateTime> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(OffsetDateTimeConverter.class.getName());
 
     @Override
     public OffsetDateTime convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
index 9eb7b0a..a51b99a 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class OffsetTimeConverter implements PropertyConverter<OffsetTime> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(OffsetTimeConverter.class.getName());
 
     @Override
     public OffsetTime convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
index 57e739b..2a36d3b 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
@@ -34,7 +34,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class PathConverter implements PropertyConverter<Path> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(PathConverter.class.getName());
 
     @Override
     public Path convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
index 19aa341..41c5ca4 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class URIConverter implements PropertyConverter<URI> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(URIConverter.class.getName());
 
     @Override
     public URI convert(String value, ConversionContext ctx) {
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
index 2939e85..f7c90e6 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
 @Component(service = PropertyConverter.class)
 public class URLConverter implements PropertyConverter<URL> {
 
-    private final Logger LOG = Logger.getLogger(getClass().getName());
+    private static final Logger LOG = Logger.getLogger(URLConverter.class.getName());
 
     @Override
     public URL convert(String value, ConversionContext ctx) {


Mime
View raw message