sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1737517 - in /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util: Classes.java resources/IndexedResourceBundle.java
Date Sat, 02 Apr 2016 16:40:07 GMT
Author: desruisseaux
Date: Sat Apr  2 16:40:07 2016
New Revision: 1737517

URL: http://svn.apache.org/viewvc?rev=1737517&view=rev
Log:
Revert to a simpler algorithm for finding a public class name, since it seems there is no
good one.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1737517&r1=1737516&r2=1737517&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
Sat Apr  2 16:40:07 2016
@@ -285,7 +285,7 @@ public final class Classes extends Stati
      *
      * @see Class#getInterfaces()
      */
-    @SuppressWarnings({"unchecked","rawtypes"}) // Generic array creation.
+    @SuppressWarnings({"unchecked","rawtypes"})                             // Generic array
creation.
     public static <T> Class<? super T>[] getAllInterfaces(final Class<T>
type) {
         final Set<Class<?>> interfaces = getInterfaceSet(type);
         return (interfaces != null) ? interfaces.toArray(new Class[interfaces.size()]) :
EMPTY_ARRAY;
@@ -561,9 +561,9 @@ cmp:    for (final Class<?> c : c1) {
                     continue cmp;
                 }
             }
-            return false; // Interface not found in 'c2'.
+            return false;                       // Interface not found in 'c2'.
         }
-        return n == 0; // If n>0, at least one interface was not found in 'c1'.
+        return n == 0;                          // If n>0, at least one interface was
not found in 'c1'.
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1737517&r1=1737516&r2=1737517&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
[UTF-8] Sat Apr  2 16:40:07 2016
@@ -432,25 +432,17 @@ public class IndexedResourceBundle exten
      * If the given class is not public, returns the first public interface or the first
public super-class.
      * This is for avoiding confusing the user with private class in message like "Value
can not be instance
      * of XYZ".
-     *
-     * <p>An exception to above rule happen if the first public class is abstract.
-     * In such case, we return the nearest non-abstract child even if non-public.</p>
      */
     private static Class<?> getPublicType(Class<?> c) {
-        Class<?> fallback = c;
-        int modifiers;
-        while (!Modifier.isPublic(modifiers = c.getModifiers())) {
+        while (!Modifier.isPublic(c.getModifiers())) {
             for (final Class<?> type : c.getInterfaces()) {
                 if (Modifier.isPublic(type.getModifiers()) && !type.getName().startsWith("java"))
{
                     return type;
                 }
             }
-            if (!Modifier.isAbstract(modifiers)) {
-                fallback = c;
-            }
             c = c.getSuperclass();
         }
-        return Modifier.isAbstract(modifiers) ? fallback : c;
+        return c;
     }
 
     /**



Mime
View raw message