abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From calav...@apache.org
Subject svn commit: r680940 - in /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera: Abdera.java factory/ExtensionFactoryMap.java util/AbderaResult.java util/ServiceUtil.java
Date Wed, 30 Jul 2008 08:45:20 GMT
Author: calavera
Date: Wed Jul 30 01:45:18 2008
New Revision: 680940

URL: http://svn.apache.org/viewvc?rev=680940&view=rev
Log:
[ABDERA-189]: generics/type-variable clean up. Thanks to Nathan Beyer.

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java?rev=680940&r1=680939&r2=680940&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java Wed Jul 30
01:45:18 2008
@@ -131,7 +131,6 @@
    * 
    * @return The Abdera configuration
    */
-  @SuppressWarnings("unchecked") 
   public Configuration getConfiguration() {
     return config;
   }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java?rev=680940&r1=680939&r2=680940&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
Wed Jul 30 01:45:18 2008
@@ -30,7 +30,6 @@
  * It maintains the collection ExtensionFactory instances discovered on 
  * the classpath and a cache of Internal-Wrapper mappings.
  */
-@SuppressWarnings("unchecked") 
 public class ExtensionFactoryMap 
   implements ExtensionFactory {
 
@@ -84,7 +83,7 @@
   }
 
   public <T extends Base> String getMimeType(T base) {
-    Element element = base instanceof Element ? (Element)base : ((Document)base).getRoot();
+    Element element = base instanceof Element ? (Element)base : ((Document<?>)base).getRoot();
     String namespace = element.getQName().getNamespaceURI();
     synchronized(factories) {
       for (ExtensionFactory factory : factories) {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java?rev=680940&r1=680939&r2=680940&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
Wed Jul 30 01:45:18 2008
@@ -38,15 +38,14 @@
  * 
  * Only use this once per transform!!!
  */
-@SuppressWarnings("unchecked")
 public final class AbderaResult 
   extends StreamResult 
   implements Result {
 
   private final Abdera abdera;
-  private PipedOutputStream pipeout = null;
-  private PipedInputStream pipein = null;
-  private Document doc = null;
+  private PipedOutputStream pipeout;
+  private PipedInputStream pipein;
+  private Document<?> doc;
   
   public AbderaResult() {
     this(new Abdera());
@@ -62,7 +61,7 @@
       if (pipein == null) return null;
       doc = abdera.getParser().parse(pipein);
     } 
-    return doc;
+    return (Document<T>) doc;
   }
   
   @Override

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java?rev=680940&r1=680939&r2=680940&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
Wed Jul 30 01:45:18 2008
@@ -154,7 +154,6 @@
   /**
    * Locate a class instance for the given id
    */
-  @SuppressWarnings("unchecked")
   public static Object locate(String id, Abdera abdera) {
     Object service = checkAbderaConfiguration(id, abdera);
     return ((service != null) ? service : checkMetaInfServices(id, abdera));
@@ -268,7 +267,6 @@
     return null;
   }
   
-  @SuppressWarnings("unchecked")
   private static Object checkAbderaConfiguration(String id, Abdera abdera) {
     String s = abdera.getConfiguration().getConfigurationOption(id);
     return (s != null) ? locateInstance(id, abdera) : null;
@@ -358,7 +356,6 @@
     return impls;
   }
  
-  @SuppressWarnings("unchecked")
   protected static <T>List<T> _loadimpls(String sid) {
     return _loadimpls(sid,false);
   }
@@ -402,7 +399,7 @@
    */
   public static URL getResource(
     String resourceName, 
-    Class callingClass) {
+    Class<?> callingClass) {
       URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
       if (url == null && resourceName.startsWith("/")) {
         //certain classloaders need it without the leading /
@@ -434,7 +431,7 @@
 
   public static Enumeration<URL> getResources(
     String resourceName, 
-    Class callingClass) 
+    Class<?> callingClass) 
       throws IOException {
     Enumeration<URL> url = Thread.currentThread().getContextClassLoader().getResources(resourceName);
     if (url == null && resourceName.startsWith("/")) {
@@ -471,7 +468,7 @@
    */
   public static InputStream getResourceAsStream(
     String resourceName, 
-    Class callingClass) {
+    Class<?> callingClass) {
       URL url = getResource(resourceName, callingClass);
       try {
         return (url != null) ? url.openStream() : null;
@@ -494,9 +491,9 @@
    * @param callingClass The Class object of the calling object
    * @throws ClassNotFoundException If the class cannot be found anywhere.
    */
-  public static Class loadClass(
+  public static Class<?> loadClass(
     String className, 
-    Class callingClass) 
+    Class<?> callingClass) 
       throws ClassNotFoundException {
     try {
       ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -509,9 +506,9 @@
     }
   }
 
-  private static Class loadClass2(
+  private static Class<?> loadClass2(
     String className, 
-    Class callingClass) 
+    Class<?> callingClass) 
       throws ClassNotFoundException {
     try {
       return Class.forName(className);



Mime
View raw message