This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1df3b4c  ISIS-1841 improve code readability and comment
1df3b4c is described below

commit 1df3b4c4c4442a1cf955c5e679c67d6520201b11
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Feb 23 11:44:14 2018 +0100

    ISIS-1841 improve code readability and comment
---
 .../systemusinginstallers/PersistenceCapableTypeFinder.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/PersistenceCapableTypeFinder.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/PersistenceCapableTypeFinder.java
index 1fbf533..a736018 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/PersistenceCapableTypeFinder.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/PersistenceCapableTypeFinder.java
@@ -25,6 +25,7 @@ import java.util.Set;
 
 import javax.jdo.annotations.PersistenceCapable;
 
+import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.reflection._Reflect.Discovery;
 
 /**
@@ -34,7 +35,6 @@ import 
org.apache.isis.applib.internal.reflection._Reflect.Discovery;
  */
 class PersistenceCapableTypeFinder {
 
-       @SuppressWarnings("unchecked")
        static Set<Class<?>> find(Discovery discovery) {
 
                final Set<Class<?>> types = new LinkedHashSet<>();
@@ -43,12 +43,14 @@ class PersistenceCapableTypeFinder {
                .forEach(type->{
 
                        if(type.isAnnotation()) {
-
-                               // We have an annotation, that is annotated 
with @PersistenceCapable,
+                               
+                               final Class<? extends Annotation> 
annotatedAnnotation = _Casts.uncheckedCast(type);
+                               
+                               // We have an annotation (annotatedAnnotation), 
that is annotated with @PersistenceCapable,
                                // this requires special treatment: 
-                               // Search for any classes annotated with this 
(meta-)annotation.
+                               // Search for any classes annotated with 
annotatedAnnotation.
                                
-                               discovery.getTypesAnnotatedWith((Class<? 
extends Annotation>) type).stream()
+                               
discovery.getTypesAnnotatedWith(annotatedAnnotation).stream()
                                .filter(x->!x.isAnnotation())
                                .forEach(types::add);
 

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to