jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r796996 - /incubator/jspwiki/trunk/tests/java/TranslationsCheck.java
Date Thu, 23 Jul 2009 09:57:26 GMT
Author: jalkanen
Date: Thu Jul 23 09:57:25 2009
New Revision: 796996

URL: http://svn.apache.org/viewvc?rev=796996&view=rev
Log:
Cleaning checkstyle warnings.

Modified:
    incubator/jspwiki/trunk/tests/java/TranslationsCheck.java

Modified: incubator/jspwiki/trunk/tests/java/TranslationsCheck.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/TranslationsCheck.java?rev=796996&r1=796995&r2=796996&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/TranslationsCheck.java (original)
+++ incubator/jspwiki/trunk/tests/java/TranslationsCheck.java Thu Jul 23 09:57:25 2009
@@ -98,7 +98,7 @@
         
             System.out.println("Duplicates overall (two or more occurences):");
             System.out.println("--------------------------------------------");
-            Iterator iter = duplProps.iterator();
+            Iterator<String> iter = duplProps.iterator();
             if (duplProps.size() == 0)
                 System.out.println("(none)");
             else
@@ -134,10 +134,10 @@
 
         System.out.println("Missing:");
         System.out.println("--------");
-        Iterator iter = sortedNames(p1).iterator();
+        Iterator<String> iter = sortedNames(p1).iterator();
         while (iter.hasNext())
         {
-            String name = (String) iter.next();
+            String name = iter.next();
             String value = p1.getProperty(name);
 
             if (p2.get(name) == null)
@@ -152,7 +152,7 @@
         iter = sortedNames(p2).iterator();
         while (iter.hasNext())
         {
-            String name = (String) iter.next();
+            String name = iter.next();
             String value = p2.getProperty(name);
 
             if (p1.get(name) == null)
@@ -163,29 +163,31 @@
         System.out.println();
     }
 
-    private static List sortedNames(Properties p)
+    @SuppressWarnings("unchecked")
+    private static List<String> sortedNames(Properties p)
     {
         List<String> list = new ArrayList<String>();
-        Enumeration iter = p.propertyNames();
+        Enumeration<String> iter = (Enumeration<String>) p.propertyNames();
         while (iter.hasMoreElements())
         {
-            list.add( (String)iter.nextElement() );
+            list.add( iter.nextElement() );
         }
 
         Collections.sort(list);
         return list;
     }
     
+    @SuppressWarnings("unchecked")
     private static void detectDuplicates(String source) throws IOException
     {
         Properties p = new Properties();
         p.load(new FileInputStream(new File(base + source)));
         
-        Enumeration iter = p.propertyNames();
+        Enumeration<String> iter = (Enumeration<String>) p.propertyNames();
         String currentStr;
         while (iter.hasMoreElements())
         {
-            currentStr = (String) iter.nextElement();
+            currentStr = iter.nextElement();
             if (!allProps.add(currentStr))
                 duplProps.add(currentStr);
         }



Mime
View raw message