cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anathan...@apache.org
Subject svn commit: r1180682 - in /cocoon/cocoon3/trunk: cocoon-sax/src/main/java/org/apache/cocoon/sax/ cocoon-sax/src/main/java/org/apache/cocoon/sax/component/ cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/ cocoon-sitemap/src/main/java/org/apa...
Date Sun, 09 Oct 2011 18:35:58 GMT
Author: anathaniel
Date: Sun Oct  9 18:35:57 2011
New Revision: 1180682

URL: http://svn.apache.org/viewvc?rev=1180682&view=rev
Log:
Remove unnecessary casts

Modified:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/AbstractSAXTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/SitemapNodeFactory.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypeActionFactory.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineComponentFactory.java
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineFactory.java
    cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/SimpleNamespaceContext.java
    cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/XMLEventToContentHandler.java

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/AbstractSAXTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/AbstractSAXTransformer.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/AbstractSAXTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/AbstractSAXTransformer.java
Sun Oct  9 18:35:57 2011
@@ -89,7 +89,7 @@ public abstract class AbstractSAXTransfo
     protected String findPrefixMapping(String uri) {
         final int l = this.namespaces.size();
         for (int i = 0; i < l; i++) {
-            String[] prefixAndUri = (String[]) this.namespaces.get(i);
+            String[] prefixAndUri = this.namespaces.get(i);
             if (prefixAndUri[1].equals(uri)) {
                 return prefixAndUri[0];
             }

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
Sun Oct  9 18:35:57 2011
@@ -1723,7 +1723,7 @@ public class I18nTransformer extends Abs
         boolean appendDec = false;
 
         // type
-        final String type = (String) params.get(ATTR_TYPE);
+        final String type = params.get(ATTR_TYPE);
         if (type == null || type.equals(ELEM_NUMBER)) {
             dstFmt = (DecimalFormat) NumberFormat.getInstance(dstLocale);
             dstFmt.setMaximumFractionDigits(309);

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/SitemapNodeFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/SitemapNodeFactory.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/SitemapNodeFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/SitemapNodeFactory.java
Sun Oct  9 18:35:57 2011
@@ -31,7 +31,7 @@ public class SitemapNodeFactory implemen
     public SitemapNode createNode(String type, Map<String, String> parameters) {
         try {
             String beanName = SitemapNode.class.getName() + "/" + type;
-            SitemapNode sitemapNode = (SitemapNode) this.applicationContext.getBean(beanName,
SitemapNode.class);
+            SitemapNode sitemapNode = applicationContext.getBean(beanName, SitemapNode.class);
             sitemapNode.setParameters(parameters);
             return sitemapNode;
         } catch (Exception e) {

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypeActionFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypeActionFactory.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypeActionFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypeActionFactory.java
Sun Oct  9 18:35:57 2011
@@ -33,7 +33,7 @@ public class PrototypeActionFactory impl
      * @see org.apache.cocoon.sitemap.spring.ActionFactory#createAction(java.lang.String)
      */
     public Action createAction(String type) {
-        return (Action) this.applicationContext.getBean(type, Action.class);
+        return applicationContext.getBean(type, Action.class);
     }
 
     /**

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineComponentFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineComponentFactory.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineComponentFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineComponentFactory.java
Sun Oct  9 18:35:57 2011
@@ -33,7 +33,7 @@ public class PrototypePipelineComponentF
      * @see org.apache.cocoon.sitemap.spring.PipelineComponentFactory#createComponent(java.lang.String)
      */
     public PipelineComponent createComponent(String type) {
-        return (PipelineComponent) this.applicationContext.getBean(type, PipelineComponent.class);
+        return applicationContext.getBean(type, PipelineComponent.class);
     }
 
     /**

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineFactory.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineFactory.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineFactory.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/spring/PrototypePipelineFactory.java
Sun Oct  9 18:35:57 2011
@@ -33,9 +33,8 @@ public class PrototypePipelineFactory im
      * 
      * @see org.apache.cocoon.sitemap.spring.PipelineFactory#createPipeline(java.lang.String)
      */
-    @SuppressWarnings("unchecked")
     public Pipeline<PipelineComponent> createPipeline(String type) {
-        return (Pipeline<PipelineComponent>) this.applicationContext.getBean(type,
Pipeline.class);
+        return applicationContext.getBean(type, Pipeline.class);
     }
 
     /**

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/SimpleNamespaceContext.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/SimpleNamespaceContext.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/SimpleNamespaceContext.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/SimpleNamespaceContext.java
Sun Oct  9 18:35:57 2011
@@ -172,7 +172,7 @@ public class SimpleNamespaceContext impl
             // undefining a prefix as specified in the Namespaces spec, we store
             // undefined prefixes as the empty string.
 
-            String uri = (String) this.namespaces.get(prefix);
+            String uri = this.namespaces.get(prefix);
             if (uri.length() == 0) {
 
                 return null;
@@ -286,7 +286,7 @@ public class SimpleNamespaceContext impl
             ExtendedNamespaceContext superCtx = (ExtendedNamespaceContext) this.parent;
             for (Iterator<String> i = superCtx.getPrefixes(); i.hasNext();) {
 
-                String prefix = (String) i.next();
+                String prefix = i.next();
                 prefixes.add(prefix);
 
             }
@@ -315,7 +315,7 @@ public class SimpleNamespaceContext impl
 
         Set<String> prefixes = null;
         for (Map.Entry<String,String> entry : this.namespaces.entrySet()) {
-            String uri = (String) entry.getValue();
+            String uri = entry.getValue();
             if (uri.equals(nsURI)) {
 
                 if (prefixes == null) {
@@ -331,8 +331,7 @@ public class SimpleNamespaceContext impl
 
         if (this.parent != null) {
 
-        	@SuppressWarnings("unchecked")
-            Iterator<String> i = (Iterator<String>) this.parent.getPrefixes(nsURI);
+            Iterator<String> i = this.parent.getPrefixes(nsURI);
             while (i.hasNext()) {
                 String prefix = i.next();
 
@@ -384,12 +383,12 @@ public class SimpleNamespaceContext impl
 
             }
 
-            return (String) this.namespaces.put(XMLConstants.DEFAULT_NS_PREFIX, nsURI);
+            return this.namespaces.put(XMLConstants.DEFAULT_NS_PREFIX, nsURI);
 
         } else {
 
             // put the empty string to record an undefined prefix
-            return (String) this.namespaces.put(XMLConstants.DEFAULT_NS_PREFIX, "");
+            return this.namespaces.put(XMLConstants.DEFAULT_NS_PREFIX, "");
 
         }
 
@@ -433,14 +432,14 @@ public class SimpleNamespaceContext impl
 
             } else {
 
-                return (String) this.namespaces.put(prefix, nsURI);
+                return this.namespaces.put(prefix, nsURI);
 
             }
 
         } else {
 
             // put the empty string to record an undefined prefix
-            return (String) this.namespaces.put(prefix, "");
+            return this.namespaces.put(prefix, "");
 
         }
 

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/XMLEventToContentHandler.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/XMLEventToContentHandler.java?rev=1180682&r1=1180681&r2=1180682&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/XMLEventToContentHandler.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/converter/util/XMLEventToContentHandler.java
Sun Oct  9 18:35:57 2011
@@ -211,8 +211,7 @@ public class XMLEventToContentHandler {
             this.filter.endElement(qName.getNamespaceURI(), qName.getLocalPart(), rawname);
 
             // end namespace bindings
-            @SuppressWarnings("unchecked")
-            Iterator<Namespace> i = (Iterator<Namespace>) event.getNamespaces();
+            Iterator<Namespace> i = event.getNamespaces();
             while (i.hasNext()) {
                 String nsprefix = i.next().getPrefix();
                 if (nsprefix == null) { // true for default namespace
@@ -228,8 +227,7 @@ public class XMLEventToContentHandler {
     private void handleStartElement(StartElement event) throws XMLStreamException {
         try {
             // start namespace bindings
-            @SuppressWarnings("unchecked")
-            Iterator<Namespace> i = (Iterator<Namespace>) event.getNamespaces();
+            Iterator<Namespace> i = event.getNamespaces();
             while (i.hasNext()) {
                 String prefix = i.next().getPrefix();
                 if (prefix == null) { // true for default namespace
@@ -268,8 +266,7 @@ public class XMLEventToContentHandler {
 
         // Add namspace declarations if required
         if (this.filter.getNamespacePrefixes()) {
-            @SuppressWarnings("unchecked")
-            Iterator<Namespace> i = (Iterator<Namespace>) event.getNamespaces();
+            Iterator<Namespace> i = event.getNamespaces();
             while (i.hasNext()) {
                 Namespace staxNamespace = i.next();
                 String uri = staxNamespace.getNamespaceURI();
@@ -293,8 +290,7 @@ public class XMLEventToContentHandler {
         }
 
         // gather non-namespace attrs
-        @SuppressWarnings("unchecked")
-        Iterator<Attribute> i = (Iterator<Attribute>) event.getAttributes();
+        Iterator<Attribute> i = event.getAttributes();
         while (i.hasNext()) {
             Attribute staxAttr = i.next();
 



Mime
View raw message