sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1387951 - /incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java
Date Thu, 20 Sep 2012 10:37:18 GMT
Author: desruisseaux
Date: Thu Sep 20 10:37:18 2012
New Revision: 1387951

URL: http://svn.apache.org/viewvc?rev=1387951&view=rev
Log:
Enable the dependencies to the utility methods previously commited.

Modified:
    incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java

Modified: incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java?rev=1387951&r1=1387950&r2=1387951&view=diff
==============================================================================
--- incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java
(original)
+++ incubator/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/IndexedResourceBundle.java
Thu Sep 20 10:37:18 2012
@@ -35,8 +35,9 @@ import net.jcip.annotations.ThreadSafe;
 import org.opengis.util.InternationalString;
 
 import org.apache.sis.util.Debug;
-//import org.apache.sis.util.Classes;
-//import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.Classes;
+import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.logging.Logging;
 
 
 /**
@@ -123,9 +124,8 @@ public class IndexedResourceBundle exten
      * @return Resources in the given locale.
      * @throws MissingResourceException if resources can't be found.
      *
-     * @see Vocabulary#getResources
-     * @see Loggings#getResources
-     * @see Errors#getResources
+     * @see Vocabulary#getResources(Locale)
+     * @see Errors#getResources(Locale)
      */
     protected static <T extends IndexedResourceBundle> T getBundle(Class<T> base,
Locale locale)
             throws MissingResourceException
@@ -186,7 +186,7 @@ public class IndexedResourceBundle exten
             int indexCR = value.indexOf('\r'); if (indexCR < 0) indexCR = value.length();
             int indexLF = value.indexOf('\n'); if (indexLF < 0) indexLF = value.length();
             final String number = String.valueOf(i);
-// TODO     out.write(CharSequences.spaces(5 - number.length()));
+            out.write(CharSequences.spaces(5 - number.length()));
             out.write(number);
             out.write(":\t");
             out.write(value, 0, Math.min(indexCR,indexLF));
@@ -262,13 +262,13 @@ public class IndexedResourceBundle exten
                 }
                 record.setParameters(new String[] {language, getClass().getCanonicalName()});
             }
-// TODO     Logging.log(IndexedResourceBundle.class, methodName, record);
+            Logging.log(IndexedResourceBundle.class, methodName, record);
             return values;
         } catch (IOException exception) {
             record.setLevel  (Level.WARNING);
             record.setMessage(exception.getLocalizedMessage());
             record.setThrown (exception);
-// TODO     Logging.log(IndexedResourceBundle.class, methodName, record);
+            Logging.log(IndexedResourceBundle.class, methodName, record);
             final MissingResourceException error = new MissingResourceException(
                     exception.getLocalizedMessage(), getClass().getCanonicalName(), key);
             error.initCause(exception);
@@ -367,7 +367,7 @@ public class IndexedResourceBundle exten
      * @return A sentence not longer than {@code maxLength}.
      */
     private static String summarize(String text, int maxLength) {
-// TODO text = CharSequences.trim(text);
+        text = CharSequences.trim(text);
         final int length = text.length();
         if (length <= maxLength) {
             return text;
@@ -401,7 +401,7 @@ public class IndexedResourceBundle exten
                 break;
             }
         }
-        return /*CharSequences.trim TODO */(new StringBuilder(break1 + (length-break2) +
6)
+        return CharSequences.trim(new StringBuilder(break1 + (length-break2) + 6)
                 .append(text, 0, break1+1).append(" (…) ").append(text, break2, length).toString());
     }
 
@@ -442,11 +442,11 @@ public class IndexedResourceBundle exten
             } else if (element instanceof Throwable) {
                 String message = ((Throwable) element).getLocalizedMessage();
                 if (message == null) {
-                    message = element.getClass().getSimpleName(); // TODO Classes.getShortClassName(element);
+                    message = Classes.getShortClassName(element);
                 }
                 array[i] = message;
             } else if (element instanceof Class<?>) {
-                array[i] = ((Class<?>) element).getSimpleName(); // TODO Classes.getShortName((Class<?>)
element);
+                array[i] = Classes.getShortName((Class<?>) element);
             }
         }
         return array;
@@ -756,7 +756,7 @@ public class IndexedResourceBundle exten
      * Invoked when an unexpected exception occurred in the {@link #format} method.
      */
     private static void unexpectedException(final RuntimeException exception) {
-// TODO Logging.unexpectedException(IndexedResourceBundle.class, "format", exception);
+        Logging.unexpectedException(IndexedResourceBundle.class, "format", exception);
     }
 
     /**



Mime
View raw message