hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1343208 - in /incubator/hama/trunk/core/src/main/java/org/apache/hama/util: Bytes.java RunJar.java VersionInfo.java
Date Mon, 28 May 2012 11:47:06 GMT
Author: tommaso
Date: Mon May 28 11:47:05 2012
New Revision: 1343208

URL: http://svn.apache.org/viewvc?rev=1343208&view=rev
Log:
[HAMA-572] - minor tweaks in util package of core module

Modified:
    incubator/hama/trunk/core/src/main/java/org/apache/hama/util/Bytes.java
    incubator/hama/trunk/core/src/main/java/org/apache/hama/util/RunJar.java
    incubator/hama/trunk/core/src/main/java/org/apache/hama/util/VersionInfo.java

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/util/Bytes.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/util/Bytes.java?rev=1343208&r1=1343207&r2=1343208&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/util/Bytes.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/util/Bytes.java Mon May 28 11:47:05
2012
@@ -889,8 +889,7 @@ public class Bytes {
     if (left == null && right == null) {
       return true;
     }
-    return (left == null || right == null || (left.length != right.length) ? false
-        : compareTo(left, right) == 0);
+    return (!(left == null || right == null || (left.length != right.length)) &&
compareTo(left, right) == 0);
   }
 
   /**

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/util/RunJar.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/util/RunJar.java?rev=1343208&r1=1343207&r2=1343208&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/util/RunJar.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/util/RunJar.java Mon May 28 11:47:05
2012
@@ -48,7 +48,7 @@ public class RunJar {
     try {
       Enumeration<JarEntry> entries = jar.entries();
       while (entries.hasMoreElements()) {
-        JarEntry entry = (JarEntry) entries.nextElement();
+        JarEntry entry = entries.nextElement();
         if (!entry.isDirectory()) {
           InputStream in = jar.getInputStream(entry);
           try {
@@ -132,7 +132,7 @@ public class RunJar {
         classPath.add(lib.toURI().toURL());
       }
     }
-    ClassLoader loader = new URLClassLoader((URL[]) classPath
+    ClassLoader loader = new URLClassLoader(classPath
       .toArray(new URL[classPath.size()]));
 
     Thread.currentThread().setContextClassLoader(loader);
@@ -141,7 +141,7 @@ public class RunJar {
         String.class, 0).getClass() });
     List<String> var = Arrays.asList(args).subList(firstArg,
       args.length);
-    String[] newArgs = (String[]) var.toArray(new String[var.size()]);
+    String[] newArgs = var.toArray(new String[var.size()]);
     try {
       main.invoke(null, new Object[] { newArgs });
     } catch (InvocationTargetException e) {

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/util/VersionInfo.java?rev=1343208&r1=1343207&r2=1343208&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/util/VersionInfo.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/util/VersionInfo.java Mon May
28 11:47:05 2012
@@ -30,8 +30,8 @@ public class VersionInfo {
 
   private static final Log LOG = LogFactory.getLog(VersionInfo.class);
 
-  private static Package myPackage;
-  private static HamaVersionAnnotation version;
+  private static final Package myPackage;
+  private static final HamaVersionAnnotation version;
 
   static {
     myPackage = HamaVersionAnnotation.class.getPackage();



Mime
View raw message