Repository: incubator-tamaya-extensions Updated Branches: refs/heads/master 25d326cca -> 913278893
TAMAYA-291: Try to fix CDI build errors / minor fixes Test failures seem to be related to Ubuntu, since Windows and Mac seem to work. Boolean injection fails on Ubuntu. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/commit/91327889 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/tree/91327889 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/diff/91327889 Branch: refs/heads/master Commit: 91327889374a25e19565d0bbf2e9b93246f5abb7 Parents: 25d326c Author: Phil Ottlinger <[email protected]> Authored: Fri Nov 10 00:22:18 2017 +0100 Committer: Phil Ottlinger <[email protected]> Committed: Fri Nov 10 00:22:18 2017 +0100 ---------------------------------------------------------------------- modules/injection/cdi/pom.xml | 8 ++-- .../apache/tamaya/cdi/CDIConfiguredType.java | 2 +- .../apache/tamaya/cdi/DefaultDynamicValue.java | 4 +- .../tamaya/cdi/ServiceLoaderServiceContext.java | 2 +- .../tamaya/cdi/ConfigurationProducerTest.java | 50 ++++++++++---------- .../apache/tamaya/inject/api/UpdatePolicy.java | 4 +- .../tamaya/inject/ConfigurationInjector.java | 2 +- .../inject/internal/ConfiguredFieldImpl.java | 8 ++-- .../inject/internal/ConfiguredSetterMethod.java | 5 +- .../inject/internal/ConfiguredTypeImpl.java | 2 +- .../internal/DefaultConfigurationInjector.java | 8 ++-- .../inject/internal/DefaultDynamicValue.java | 42 ++++++++-------- .../tamaya/inject/internal/InjectionHelper.java | 3 -- 13 files changed, 67 insertions(+), 73 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/cdi/pom.xml ---------------------------------------------------------------------- diff --git a/modules/injection/cdi/pom.xml b/modules/injection/cdi/pom.xml index 74062d1..de1e318 100644 --- a/modules/injection/cdi/pom.xml +++ b/modules/injection/cdi/pom.xml @@ -32,17 +32,17 @@ under the License. <properties> <deltaspike.version>1.1.0</deltaspike.version> - <openejb.version>4.7.1</openejb.version> + <openejb.version>4.7.5</openejb.version> <weld.version>3.0.1.Final</weld.version> <geronimo-jcdi-1.1-spec.version>1.0</geronimo-jcdi-1.1-spec.version> <geronimo-interceptor-1.2-spec.version>1.0</geronimo-interceptor-1.2-spec.version> <geronimo-atinject-1.0-spec.version>1.0</geronimo-atinject-1.0-spec.version> <arquillian.version>1.1.13.Final</arquillian.version> <arquillian-weld-embedded.version>2.0.0.Beta5</arquillian-weld-embedded.version> - <version.shrinkwrap.resolvers>2.2.6</version.shrinkwrap.resolvers> + <version.shrinkwrap.resolvers>3.0.0-beta-2</version.shrinkwrap.resolvers> <cdi-api.version>2.0</cdi-api.version> - <javaee-api.version>6.0-6</javaee-api.version> - <tomee.version>1.7.1</tomee.version> + <javaee-api.version>8.0</javaee-api.version> + <tomee.version>1.7.5</tomee.version> </properties> <dependencyManagement> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/CDIConfiguredType.java ---------------------------------------------------------------------- diff --git a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/CDIConfiguredType.java b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/CDIConfiguredType.java index 901b88f..0c7e34a 100644 --- a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/CDIConfiguredType.java +++ b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/CDIConfiguredType.java @@ -71,7 +71,7 @@ class CDIConfiguredType implements ConfiguredType{ /** * Used to build up during injection point processing. - * @param injectionPoint the CDI injection ppint, not null. + * @param injectionPoint the CDI injection point, not null. * @param keys the possible config keys, in order of precedence, not null. */ void addConfiguredMember(InjectionPoint injectionPoint, List<String> keys) { http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/DefaultDynamicValue.java ---------------------------------------------------------------------- diff --git a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/DefaultDynamicValue.java b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/DefaultDynamicValue.java index 5e4692f..5a3c807 100644 --- a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/DefaultDynamicValue.java +++ b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/DefaultDynamicValue.java @@ -45,8 +45,8 @@ import java.util.logging.Logger; /** * A accessor for a single configured value. This can be used to support values that may change during runtime, - * reconfigured or final. Hereby external code (could be Tamaya configuration listners or client code), can set a - * new value. Depending on the {@link UpdatePolicy} the new value is immedeately active or it requires an active commit + * reconfigured or final. Hereby external code (could be Tamaya configuration listeners or client code), can set a + * new value. Depending on the {@link UpdatePolicy} the new value is immediately active or it requires an active commit * by client code. Similarly an instance also can ignore all later changes to the value. * <h3>Implementation Details</h3> * This class is http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/ServiceLoaderServiceContext.java ---------------------------------------------------------------------- diff --git a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/ServiceLoaderServiceContext.java b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/ServiceLoaderServiceContext.java index 3c04415..f5a5f6c 100644 --- a/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/ServiceLoaderServiceContext.java +++ b/modules/injection/cdi/src/main/java/org/apache/tamaya/cdi/ServiceLoaderServiceContext.java @@ -73,7 +73,7 @@ final class ServiceLoaderServiceContext implements ServiceContext { try { return implType.newInstance(); } catch (Exception e) { - LOG.log(Level.SEVERE, "Failed to create instabce of " + implType.getName(), e); + LOG.log(Level.SEVERE, "Failed to create instance of " + implType.getName(), e); return null; } } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/cdi/src/test/java/org/apache/tamaya/cdi/ConfigurationProducerTest.java ---------------------------------------------------------------------- diff --git a/modules/injection/cdi/src/test/java/org/apache/tamaya/cdi/ConfigurationProducerTest.java b/modules/injection/cdi/src/test/java/org/apache/tamaya/cdi/ConfigurationProducerTest.java index 138a83d..b3459b7 100644 --- a/modules/injection/cdi/src/test/java/org/apache/tamaya/cdi/ConfigurationProducerTest.java +++ b/modules/injection/cdi/src/test/java/org/apache/tamaya/cdi/ConfigurationProducerTest.java @@ -16,6 +16,17 @@ */ package org.apache.tamaya.cdi; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.util.Optional; + +import javax.enterprise.inject.spi.Extension; +import javax.inject.Inject; +import javax.inject.Provider; + import org.apache.tamaya.inject.api.Config; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; @@ -25,27 +36,16 @@ import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; -import org.junit.runners.model.InitializationError; - -import javax.enterprise.inject.spi.Extension; -import javax.inject.Inject; -import javax.inject.Provider; -import java.io.File; -import java.util.Optional; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; @RunWith(Arquillian.class) public class ConfigurationProducerTest { @Deployment - public static Archive deployment() { + public static Archive<?> deployment() { return ShrinkWrap.create(WebArchive.class) .addClasses(ConfiguredClass.class, InjectedClass.class, TamayaCDIInjectionExtension.class, TamayaCDIAccessor.class, - ConfigurationProducer.class) + org.apache.tamaya.cdi.ConfigurationProducer.class) .addAsServiceProvider(Extension.class, TamayaCDIInjectionExtension.class) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsWebInfResource("META-INF/javaconfiguration.properties", "META-INF/javaconfiguration.properties"); @@ -227,18 +227,16 @@ public class ConfigurationProducerTest { } @Override - public String toString() { - return "AllTypes{" + - "string='" + string + '\'' + - ", defaultString='" + defaultString + '\'' + - ", file=" + file + - ", defaultFile=" + defaultFile + - ", aBoolean=" + aBoolean + - ", defaultBoolean=" + defaultBoolean + - ", integer=" + integer + - ", defaultInteger=" + defaultInteger + - '}'; - } + public String toString() { + return "AllTypes [stringAsMethodParam=" + stringAsMethodParam + ", integerAsMethodParam=" + + integerAsMethodParam + ", optionalStringAsMethodParam=" + optionalStringAsMethodParam + + ", optionalIntegerAsMethodParam=" + optionalIntegerAsMethodParam + + ", providerStringAsMethodParam=" + providerStringAsMethodParam + ", providerIntegerAsMethodParam=" + + providerIntegerAsMethodParam + ", string=" + string + ", optionalString=" + optionalString + + ", providerString=" + providerString + ", defaultString=" + defaultString + ", file=" + file + + ", defaultFile=" + defaultFile + ", aBoolean=" + aBoolean + ", defaultBoolean=" + defaultBoolean + + ", integer=" + integer + ", defaultInteger=" + defaultInteger + ", optionalInteger=" + + optionalInteger + ", providerInteger=" + providerInteger + "]"; + } } - } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/injection-api/src/main/java/org/apache/tamaya/inject/api/UpdatePolicy.java ---------------------------------------------------------------------- diff --git a/modules/injection/injection-api/src/main/java/org/apache/tamaya/inject/api/UpdatePolicy.java b/modules/injection/injection-api/src/main/java/org/apache/tamaya/inject/api/UpdatePolicy.java index 1664b67..ddee4e0 100644 --- a/modules/injection/injection-api/src/main/java/org/apache/tamaya/inject/api/UpdatePolicy.java +++ b/modules/injection/injection-api/src/main/java/org/apache/tamaya/inject/api/UpdatePolicy.java @@ -27,7 +27,7 @@ public enum UpdatePolicy { */ @Deprecated IMMEDEATE, - /** New values are applied immedately and registered listeners are informed about the change. */ + /** New values are applied immediately and registered listeners are informed about the change. */ IMMEDIATE, /** New values or not applied, but stored in the newValue property. Explicit call to DynamicValue#commit of DynamicValue#commitAndGet are required to accept the change and inform the listeners about the change. @@ -40,7 +40,7 @@ public enum UpdatePolicy { @Deprecated EXPLCIT, /** - * New values are always immedately discarded, listeners are not triggered. + * New values are always immediately discarded, listeners are not triggered. */ NEVER, /** http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java index b9e64e0..898e937 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java @@ -63,7 +63,7 @@ public interface ConfigurationInjector { <T> T createTemplate(Class<T> templateType); /** - * Creates a template implementting the annotated methods based on current configuration data. + * Creates a template implementing the annotated methods based on current configuration data. * * @param <T> the type of the template. * @param config the configuration to be used for backing the template. http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredFieldImpl.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredFieldImpl.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredFieldImpl.java index 7389f83..7ccaecc 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredFieldImpl.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredFieldImpl.java @@ -33,8 +33,8 @@ import java.util.Collection; import java.util.Objects; /** - * Small class that contains and manages all information anc access to a configured field and a concrete instance current - * it (referenced by a weak reference). It also implements all aspects current keys filtering, converting any applying the + * Small class that contains and manages all information and access to a configured field and a concrete instance current + * it (referenced by a weak reference). It also implements all aspects current keys filtering, converting and applying the * final keys by reflection. */ public class ConfiguredFieldImpl implements ConfiguredField{ @@ -55,7 +55,7 @@ public class ConfiguredFieldImpl implements ConfiguredField{ /** - * Evaluate the initial keys fromMap the configuration and applyChanges it to the field. + * Evaluate the initial keys from the configuration and apply changes to the field. * * @param target the target instance. * @throws ConfigException if evaluation or conversion failed. @@ -140,7 +140,7 @@ public class ConfiguredFieldImpl implements ConfiguredField{ } /** - * Access the applyable configuration keys for this field. + * Access the applicable configuration keys for this field. * @return the configuration keys, never null. */ @Override http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredSetterMethod.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredSetterMethod.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredSetterMethod.java index 1d66ca2..b10300e 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredSetterMethod.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredSetterMethod.java @@ -41,7 +41,6 @@ public class ConfiguredSetterMethod implements ConfiguredMethod { * The configured field instance. */ private Method setterMethod; - private Collection<String> configuredKeys; /** * Models a configured field and provides mechanisms for injection. @@ -87,7 +86,7 @@ public class ConfiguredSetterMethod implements ConfiguredMethod { /** - * Access the applyable configuration keys for this field. + * Access the applicable configuration keys for this field. * * @return the configuration keys, never null. */ @@ -126,7 +125,7 @@ public class ConfiguredSetterMethod implements ConfiguredMethod { private String printTypes(Class<?>[] parameterTypes) { StringBuilder b = new StringBuilder(); - for(Class cl:parameterTypes){ + for(@SuppressWarnings("rawtypes") Class cl:parameterTypes){ b.append(cl.getName()); b.append(','); } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredTypeImpl.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredTypeImpl.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredTypeImpl.java index c438348..85f1f4a 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredTypeImpl.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/ConfiguredTypeImpl.java @@ -150,7 +150,7 @@ public class ConfiguredTypeImpl implements ConfiguredType{ configuredSetterMethods.add(new ConfiguredSetterMethod(m)); return true; } catch (Exception e) { - throw new ConfigException("Failed to initialized configured setter method: " + + throw new ConfigException("Failed to initialize configured setter method: " + m.getDeclaringClass().getName() + '.' + m.getName(), e); } } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java index ef2f2ce..7b3fb61 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java @@ -110,7 +110,7 @@ public class DefaultConfigurationInjector implements ConfigurationInjector { } /** - * Configured the current instance and reigsterd necessary listener to forward config change events as + * Configured the current instance and registerd necessary listener to forward config change events as * defined by the current annotations in place. * * @param instance the instance to be configured @@ -121,7 +121,7 @@ public class DefaultConfigurationInjector implements ConfigurationInjector { } /** - * Configured the current instance and reigsterd necessary listener to forward config change events as + * Configured the current instance and registerd necessary listener to forward config change events as * defined by the current annotations in place. * * @param instance the instance to be configured @@ -140,7 +140,7 @@ public class DefaultConfigurationInjector implements ConfigurationInjector { } /** - * Create a template implementting the annotated methods based on current configuration data. + * Create a template implementing the annotated methods based on current configuration data. * * @param templateType the type of the template to be created. */ @@ -150,7 +150,7 @@ public class DefaultConfigurationInjector implements ConfigurationInjector { } /** - * Create a template implementting the annotated methods based on current configuration data. + * Create a template implementing the annotated methods based on current configuration data. * * @param templateType the type of the template to be created. * @param config the target configuration, not null. http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java index 4b091f6..a6b8c06 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java @@ -49,8 +49,8 @@ import java.util.logging.Logger; /** * A accessor for a single configured value. This can be used to support values that may change during runtime, - * reconfigured or final. Hereby external code (could be Tamaya configuration listners or client code), can set a - * new value. Depending on the {@link UpdatePolicy} the new value is immedeately active or it requires an active commit + * reconfigured or final. Hereby external code (could be Tamaya configuration listeners or client code), can set a + * new value. Depending on the {@link UpdatePolicy} the new value is immediately active or it requires an active commit * by client code. Similarly an instance also can ignore all later changes to the value. * <h3>Implementation Details</h3> * This class is @@ -74,7 +74,7 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { */ private final String[] keys; /** - * Back reference to the base configuration instance. This reference is used reevalaute the given property and + * Back reference to the base configuration instance. This reference is used reevaluate the given property and * compare the result with the previous value after a configuration change was triggered. */ private final Configuration configuration; @@ -134,19 +134,20 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { } } - public static DynamicValue of(Field annotatedField, Configuration configuration) { + public static DynamicValue<?> of(Field annotatedField, Configuration configuration) { return of(annotatedField, configuration, LoadPolicy.ALWAYS, UpdatePolicy.IMMEDIATE); } - public static DynamicValue of(Field annotatedField, Configuration configuration, LoadPolicy loadPolicy) { + public static DynamicValue<?> of(Field annotatedField, Configuration configuration, LoadPolicy loadPolicy) { return of(annotatedField, configuration, loadPolicy, UpdatePolicy.IMMEDIATE); } - public static DynamicValue of(Field annotatedField, Configuration configuration, UpdatePolicy updatePolicy) { + public static DynamicValue<?> of(Field annotatedField, Configuration configuration, UpdatePolicy updatePolicy) { return of(annotatedField, configuration, LoadPolicy.ALWAYS, updatePolicy); } - public static DynamicValue of(Field annotatedField, Configuration configuration, LoadPolicy loadPolicy, UpdatePolicy updatePolicy) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static DynamicValue<?> of(Field annotatedField, Configuration configuration, LoadPolicy loadPolicy, UpdatePolicy updatePolicy) { // Check for adapter/filter Type targetType = annotatedField.getGenericType(); if (targetType == null) { @@ -178,19 +179,20 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { TypeLiteral.of(targetType), propertyConverter, keys, loadPolicy, updatePolicy); } - public static DynamicValue of(Method method, Configuration configuration) { + public static DynamicValue<?> of(Method method, Configuration configuration) { return of(method, configuration, LoadPolicy.ALWAYS, UpdatePolicy.IMMEDIATE); } - public static DynamicValue of(Method method, Configuration configuration, UpdatePolicy updatePolicy) { + public static DynamicValue<?> of(Method method, Configuration configuration, UpdatePolicy updatePolicy) { return of(method, configuration, LoadPolicy.ALWAYS, updatePolicy); } - public static DynamicValue of(Method method, Configuration configuration, LoadPolicy loadPolicy) { + public static DynamicValue<?> of(Method method, Configuration configuration, LoadPolicy loadPolicy) { return of(method, configuration, loadPolicy, UpdatePolicy.IMMEDIATE); } - public static DynamicValue of(Method method, Configuration configuration, LoadPolicy loadPolicy, UpdatePolicy updatePolicy) { + @SuppressWarnings("unchecked") + public static DynamicValue<?> of(Method method, Configuration configuration, LoadPolicy loadPolicy, UpdatePolicy updatePolicy) { // Check for adapter/filter Type targetType = method.getGenericReturnType(); if (targetType == null) { @@ -227,7 +229,8 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { * Commits a new value that has not been committed yet, make it the new value of the instance. On change any * registered listeners will be triggered. */ - public void commit() { + @SuppressWarnings("unchecked") + public void commit() { T oldValue = value; value = newValue==null?null:(T)newValue[0]; newValue = null; @@ -253,7 +256,6 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { newValue = null; } - /** * Access the {@link UpdatePolicy} used for updating this value. * @@ -287,7 +289,7 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { /** * Removes a listener to be called, when this value has been changed. * - * @param l the listner to be removed, not null + * @param l the listener to be removed, not null */ public void removeListener(PropertyChangeListener l) { if (listeners != null) { @@ -402,11 +404,9 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { * @return the uncommitted new value, or null. */ public T getNewValue() { - T nv = newValue==null?null:(T)newValue[0]; - if (nv != null) { - return nv; - } - return null; + @SuppressWarnings("unchecked") + T nv = newValue==null?null:(T)newValue[0]; + return nv; } @@ -428,7 +428,8 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { * @throws IOException if deserialization fails. * @throws ClassNotFoundException */ - private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + @SuppressWarnings("unchecked") + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { this.updatePolicy = (UpdatePolicy) ois.readObject(); if (isPresent()) { this.value = (T) ois.readObject(); @@ -496,5 +497,4 @@ final class DefaultDynamicValue<T> extends BaseDynamicValue<T> { } } - } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/91327889/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/InjectionHelper.java ---------------------------------------------------------------------- diff --git a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/InjectionHelper.java b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/InjectionHelper.java index 07a0431..06f3556 100644 --- a/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/InjectionHelper.java +++ b/modules/injection/standalone/src/main/java/org/apache/tamaya/inject/internal/InjectionHelper.java @@ -141,7 +141,6 @@ final class InjectionHelper { return configValue; } - private static String evaluteConfigValue(List<String> keys, String[] retKey, Configuration config) { String configValue = null; for (String key : keys) { @@ -156,8 +155,6 @@ final class InjectionHelper { return configValue; } - - @SuppressWarnings("rawtypes") public static <T> T adaptValue(AnnotatedElement element, TypeLiteral<T> targetType, String key, String configValue) { // Check for adapter/filter T adaptedValue = null;
