svn commit: r965841 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: BooleanConverters.java CollectionConverters.java MiscConverters.java test/DateTimeTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r965841 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: BooleanConverters.java CollectionConverters.java MiscConverters.java test/DateTimeTests.java

adrianc
Author: adrianc
Date: Tue Jul 20 13:36:13 2010
New Revision: 965841

URL: http://svn.apache.org/viewvc?rev=965841&view=rev
Log:
Import cleanups and compiler warning fixes - no functional change.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/test/DateTimeTests.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java?rev=965841&r1=965840&r2=965841&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java Tue Jul 20 13:36:13 2010
@@ -18,11 +18,6 @@
  *******************************************************************************/
 package org.ofbiz.base.conversion;
 
-import java.util.List;
-import java.util.Set;
-
-import javolution.util.FastList;
-import javolution.util.FastSet;
 
 /** Boolean Converter classes. */
 public class BooleanConverters implements ConverterLoader {

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java?rev=965841&r1=965840&r2=965841&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java Tue Jul 20 13:36:13 2010
@@ -29,7 +29,6 @@ import javolution.util.FastSet;
 
 import org.ofbiz.base.util.StringUtil;
 import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilValidate;
 
 /** Collection Converter classes. */
 public class CollectionConverters implements ConverterLoader {

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java?rev=965841&r1=965840&r2=965841&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java Tue Jul 20 13:36:13 2010
@@ -137,7 +137,7 @@ public class MiscConverters implements C
         }
     }
 
-    public static class EnumToString extends AbstractConverter<Enum, String> {
+    public static class EnumToString extends AbstractConverter<Enum<?>, String> {
         public EnumToString() {
             super(Enum.class, String.class);
         }
@@ -146,35 +146,31 @@ public class MiscConverters implements C
             return Enum.class.isAssignableFrom(sourceClass) && String.class.isAssignableFrom(targetClass);
         }
 
-        public String convert(Enum obj) throws ConversionException {
+        public String convert(Enum<?> obj) throws ConversionException {
             return obj.name();
         }
 
-        public String convert(Class<? extends String> targetClass, Enum obj) throws ConversionException {
+        public String convert(Class<? extends String> targetClass, Enum<?> obj) throws ConversionException {
             return convert(obj);
         }
 
-        public Class<? super Enum> getSourceClass() {
+        public Class<? super Enum<?>> getSourceClass() {
             return null;
         }
     }
 
-    public static class StringToEnumConverterCreator implements ConverterCreator, ConverterLoader {
+    public static class StringToEnumConverterCreator<E extends Enum<E>> implements ConverterCreator, ConverterLoader {
         public void loadConverters() {
             Converters.registerCreator(this);
         }
 
         public <S, T> Converter<S, T> createConverter(Class<S> sourceClass, Class<T> targetClass) {
             if (String.class == sourceClass && Enum.class.isAssignableFrom(targetClass)) {
-                return UtilGenerics.cast(new StringToEnum());
+                return UtilGenerics.cast(new StringToEnum<E>());
             } else {
                 return null;
             }
         }
-
-        private <E extends Enum<E>> StringToEnum<E> createConverter(Class<Enum<E>> targetClass) {
-            return new StringToEnum<E>();
-        }
     }
 
     private static class StringToEnum<E extends Enum<E>> extends AbstractConverter<String, E> {
@@ -194,7 +190,7 @@ public class MiscConverters implements C
             return Enum.valueOf(UtilGenerics.<Class<E>>cast(targetClass), obj);
         }
 
-        public Class<? super Enum> getTargetClass() {
+        public Class<? super Enum<?>> getTargetClass() {
             return null;
         }
     }

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/test/DateTimeTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/test/DateTimeTests.java?rev=965841&r1=965840&r2=965841&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/test/DateTimeTests.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/test/DateTimeTests.java Tue Jul 20 13:36:13 2010
@@ -22,7 +22,6 @@ import org.ofbiz.base.conversion.Convert
 import org.ofbiz.base.conversion.DateTimeConverters;
 import org.ofbiz.base.lang.SourceMonitored;
 import org.ofbiz.base.test.GenericTestCaseBase;
-import org.ofbiz.base.util.UtilGenerics;
 
 @SourceMonitored
 public class DateTimeTests extends GenericTestCaseBase {