hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r694482 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/io/WritableUtils.java
Date Thu, 11 Sep 2008 21:03:58 GMT
Author: omalley
Date: Thu Sep 11 14:03:57 2008
New Revision: 694482

URL: http://svn.apache.org/viewvc?rev=694482&view=rev
Log:
HADOOP-4154. Fix type warnings in WritableUtils. (szetszwo via omalley)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/io/WritableUtils.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=694482&r1=694481&r2=694482&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Sep 11 14:03:57 2008
@@ -523,6 +523,8 @@
     underReplicated block to the neededReplication queue using method 
     "add" not "update". (hairong)
 
+    HADOOP-4154. Fix type warnings in WritableUtils. (szetszwo via omalley)
+
 Release 0.18.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/io/WritableUtils.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/io/WritableUtils.java?rev=694482&r1=694481&r2=694482&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/io/WritableUtils.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/io/WritableUtils.java Thu Sep 11 14:03:57
2008
@@ -213,8 +213,9 @@
   /**
    * Allocate a buffer for each thread that tries to clone objects.
    */
-  private static ThreadLocal cloneBuffers = new ThreadLocal() {
-      protected synchronized Object initialValue() {
+  private static ThreadLocal<CopyInCopyOutBuffer> cloneBuffers
+      = new ThreadLocal<CopyInCopyOutBuffer>() {
+      protected synchronized CopyInCopyOutBuffer initialValue() {
         return new CopyInCopyOutBuffer();
       }
     };
@@ -242,7 +243,7 @@
    * @throws IOException
    */
   public static void cloneInto(Writable dst, Writable src) throws IOException {
-    CopyInCopyOutBuffer buffer = (CopyInCopyOutBuffer)cloneBuffers.get();
+    CopyInCopyOutBuffer buffer = cloneBuffers.get();
     buffer.outBuffer.reset();
     src.write(buffer.outBuffer);
     buffer.moveData();
@@ -404,7 +405,7 @@
    * @param enumVal enum value
    * @throws IOException
    */
-  public static void writeEnum(DataOutput out,  Enum enumVal) 
+  public static void writeEnum(DataOutput out,  Enum<?> enumVal) 
     throws IOException{
     Text.writeString(out, enumVal.name()); 
   }



Mime
View raw message