commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1515217 - in /commons/proper/jci/trunk: compilers/groovy/src/main/java/org/apache/commons/jci/compilers/ core/src/main/java/org/apache/commons/jci/compilers/ core/src/main/java/org/apache/commons/jci/readers/ core/src/main/java/org/apache/...
Date Sun, 18 Aug 2013 21:16:22 GMT
Author: sebb
Date: Sun Aug 18 21:16:22 2013
New Revision: 1515217

URL: http://svn.apache.org/r1515217
Log:
Unnecessary casts

Modified:
    commons/proper/jci/trunk/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.java
    commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
    commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java
    commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java
    commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java
    commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java
    commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
    commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java

Modified: commons/proper/jci/trunk/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.java
(original)
+++ commons/proper/jci/trunk/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.java
Sun Aug 18 21:16:22 2013
@@ -85,14 +85,14 @@ public final class GroovyJavaCompiler ex
             log.debug("compiling");
             unit.compile(Phases.CLASS_GENERATION);
             
-            final List<GroovyClass> classes = (List<GroovyClass>) unit.getClasses();
+            final List<GroovyClass> classes = unit.getClasses();
             for (GroovyClass clazz : classes) {
                 final byte[] bytes = clazz.getBytes();
                 pStore.write(ConversionUtils.convertClassToResourcePath(clazz.getName()),
bytes);
             }
         } catch (final MultipleCompilationErrorsException e) {
             final ErrorCollector col = e.getErrorCollector();
-            final Collection<WarningMessage> warnings = (Collection<WarningMessage>)
col.getWarnings();
+            final Collection<WarningMessage> warnings = col.getWarnings();
             if (warnings != null) {
                 for (WarningMessage warning : warnings) {
                     final CompilationProblem problem = new GroovyCompilationProblem(warning);

@@ -103,7 +103,7 @@ public final class GroovyJavaCompiler ex
                 }
             }
 
-            final Collection<Message> errors = (Collection<Message>) col.getErrors();
+            final Collection<Message> errors = col.getErrors();
             if (errors != null) {
                 for (Message message : errors) {
                     final CompilationProblem problem = new GroovyCompilationProblem(message);


Modified: commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
(original)
+++ commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
Sun Aug 18 21:16:22 2013
@@ -68,7 +68,7 @@ public final class JavaCompilerFactory {
             className = pHint;
         }
         
-        Class clazz = (Class) classCache.get(className);
+        Class clazz = classCache.get(className);
         
         if (clazz == null) {
             try {

Modified: commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java
(original)
+++ commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java
Sun Aug 18 21:16:22 2013
@@ -54,7 +54,7 @@ public final class FileResourceReader im
     public String[] list() {
         final List<String> files = new ArrayList<String>();
         list(root, files);
-        return (String[]) files.toArray(new String[files.size()]);
+        return files.toArray(new String[files.size()]);
     }
 
     /**

Modified: commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java
(original)
+++ commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java
Sun Aug 18 21:16:22 2013
@@ -63,6 +63,6 @@ public class MemoryResourceReader implem
         if (resources == null) {
             return new String[0];
         }
-        return (String[]) resources.keySet().toArray(new String[resources.size()]);
+        return resources.keySet().toArray(new String[resources.size()]);
     }
 }

Modified: commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java
(original)
+++ commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java
Sun Aug 18 21:16:22 2013
@@ -89,7 +89,7 @@ public final class FileResourceStore imp
     public String[] list() {
         final List<String> files = new ArrayList<String>();
         list(root, files);
-        return (String[]) files.toArray(new String[files.size()]);
+        return files.toArray(new String[files.size()]);
     }
 
     /**

Modified: commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java
(original)
+++ commons/proper/jci/trunk/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java
Sun Aug 18 21:16:22 2013
@@ -64,7 +64,7 @@ public final class MemoryResourceStore i
             names.add(name);
         }
 
-        return (String[]) names.toArray(new String[store.size()]);
+        return names.toArray(new String[store.size()]);
     }
     
     @Override

Modified: commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
(original)
+++ commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
Sun Aug 18 21:16:22 2013
@@ -74,7 +74,7 @@ public final class FilesystemAlterationM
         FilesystemAlterationObserver observer;
 
         synchronized (observersLock) {
-            observer = (FilesystemAlterationObserver)observers.get(pRoot);
+            observer = observers.get(pRoot);
 
             if (observer == null) {
                 final Map<File, FilesystemAlterationObserver> newObservers = new HashMap<File,
FilesystemAlterationObserver>(observers);
@@ -97,7 +97,7 @@ public final class FilesystemAlterationM
     }
 
     public FilesystemAlterationListener[] getListenersFor( final File pRoot  ) {
-        final FilesystemAlterationObserver observer = (FilesystemAlterationObserver)observers.get(pRoot);
+        final FilesystemAlterationObserver observer = observers.get(pRoot);
 
         if (observer == null) {
             return new FilesystemAlterationListener[0];

Modified: commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java?rev=1515217&r1=1515216&r2=1515217&view=diff
==============================================================================
--- commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java
(original)
+++ commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java
Sun Aug 18 21:16:22 2013
@@ -121,7 +121,7 @@ public class FilesystemAlterationObserve
             final Set<Entry> deleted = new HashSet<Entry>(childs.values());
             for (MonitorFile f : files) {
                 final String name = f.getName();
-                final Entry entry = (Entry)childs.get(name);
+                final Entry entry = childs.get(name);
                 if (entry != null) {
                     // already recognized as child
                     deleted.remove(entry);



Mime
View raw message