deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: git commit: DELTASPIKE-102 workaround for old jdk versions
Date Sun, 13 May 2012 11:29:56 GMT
hi jason,

if we can fix it easily, we should do it (imo).
in this case the helper which caused the issue isn't needed at all (because
it does the same in the end + it's just a bit more complicated to use).

regards,
gerhard



2012/5/11 Jason Porter <lightguard.jp@gmail.com>

> We should probably make a decision about a minimum version of the JDK we
> support.
>
> On Thu, May 10, 2012 at 5:16 PM, <gpetracek@apache.org> wrote:
>
> > Updated Branches:
> >  refs/heads/master 0aef2609c -> 447b50f17
> >
> >
> > DELTASPIKE-102 workaround for old jdk versions
> >
> >
> > Project:
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
> > Commit:
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/447b50f1
> > Tree:
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/447b50f1
> > Diff:
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/447b50f1
> >
> > Branch: refs/heads/master
> > Commit: 447b50f17c5b1aff29b746f9110194977707067c
> > Parents: 0aef260
> > Author: gpetracek <gpetracek@apache.org>
> > Authored: Fri May 11 01:14:26 2012 +0200
> > Committer: gpetracek <gpetracek@apache.org>
> > Committed: Fri May 11 01:14:26 2012 +0200
> >
> > ----------------------------------------------------------------------
> >  .../deltaspike/core/util/ReflectionUtils.java      |   22
> ---------------
> >  .../util/metadata/builder/AnnotationBuilder.java   |    4 +--
> >  .../core/impl/message/ImmutableBeanWrapper.java    |    4 +--
> >  3 files changed, 2 insertions(+), 28 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/447b50f1/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/ReflectionUtils.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/ReflectionUtils.java
> >
> b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/ReflectionUtils.java
> > index 31b87fb..755f81b 100644
> > ---
> >
> a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/ReflectionUtils.java
> > +++
> >
> b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/ReflectionUtils.java
> > @@ -49,28 +49,6 @@ public abstract class ReflectionUtils
> >     }
> >
> >     /**
> > -     * <p>
> > -     * Perform a runtime cast. Similar to {@link Class#cast(Object)},
> but
> > useful
> > -     * when you do not have a {@link Class} object for type you wish to
> > cast to.
> > -     * </p>
> > -     * <p/>
> > -     * <p>
> > -     * {@link Class#cast(Object)} should be used if possible
> > -     * </p>
> > -     *
> > -     * @param <T> the type to cast to
> > -     * @param obj the object to perform the cast on
> > -     * @return the casted object
> > -     * @throws ClassCastException if the type T is not a subtype of the
> > object
> > -     * @see Class#cast(Object)
> > -     */
> > -    @SuppressWarnings("unchecked")
> > -    public static <T> T cast(Object obj)
> > -    {
> > -        return (T) obj;
> > -    }
> > -
> > -    /**
> >      * Get all the declared fields on the class hierarchy. This
> <b>will</b>
> >      * return overridden fields.
> >      *
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/447b50f1/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/metadata/builder/AnnotationBuilder.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/metadata/builder/AnnotationBuilder.java
> >
> b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/metadata/builder/AnnotationBuilder.java
> > index 19a50a3..b71d9e4 100644
> > ---
> >
> a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/metadata/builder/AnnotationBuilder.java
> > +++
> >
> b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/metadata/builder/AnnotationBuilder.java
> > @@ -19,8 +19,6 @@
> >
> >  package org.apache.deltaspike.core.util.metadata.builder;
> >
> > -import org.apache.deltaspike.core.util.ReflectionUtils;
> > -
> >  import java.lang.annotation.Annotation;
> >  import java.lang.reflect.AnnotatedElement;
> >  import java.util.Collection;
> > @@ -152,7 +150,7 @@ class AnnotationBuilder
> >      */
> >     public <T extends Annotation> T getAnnotation(Class<T> anType)
> >     {
> > -        return ReflectionUtils.<T>cast(annotationMap.get(anType));
> > +        return (T)annotationMap.get(anType);
> >     }
> >
> >     /**
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/447b50f1/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
> >
> b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
> > index 12b9b46..a91bd06 100644
> > ---
> >
> a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
> > +++
> >
> b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
> > @@ -25,8 +25,6 @@ import java.util.Set;
> >  import javax.enterprise.context.spi.CreationalContext;
> >  import javax.enterprise.inject.spi.Bean;
> >
> > -import org.apache.deltaspike.core.util.ReflectionUtils;
> > -
> >  /**
> >  * <p>
> >  * This bean-wrapper allows you to build a general purpose bean (likely a
> > @@ -115,7 +113,7 @@ class ImmutableBeanWrapper<T> extends
> > AbstractImmutableBean<T>
> >     @Override
> >     public T create(CreationalContext<T> creationalContext)
> >     {
> > -        return ReflectionUtils.cast(wrapped.create(creationalContext));
> > +        return wrapped.create(creationalContext);
> >     }
> >
> >     @Override
> >
> >
>
>
> --
> Jason Porter
> http://lightguard-jp.blogspot.com
> http://twitter.com/lightguardjp
>
> Software Engineer
> Open Source Advocate
> Author of Seam Catch - Next Generation Java Exception Handling
>
> PGP key id: 926CCFF5
> PGP key available at: keyserver.net, pgp.mit.edu
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message