You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2007/07/12 19:13:30 UTC

svn commit: r555697 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/io/GenericWritable.java

Author: omalley
Date: Thu Jul 12 10:13:29 2007
New Revision: 555697

URL: http://svn.apache.org/viewvc?view=rev&rev=555697
Log:
HADOOP-1585. Declare the classes in GenericWritable to be subclasses of
Writable.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/io/GenericWritable.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=555697&r1=555696&r2=555697
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Jul 12 10:13:29 2007
@@ -331,6 +331,9 @@
 102. HADOOP-1535.  Fix the user-controlled grouping to the reduce function.
      (Vivek Ratan via omalley)
 
+103. HADOOP-1585.  Modify GenericWritable to declare the classes as subtypes
+     of Writable (Espen Amble Kolstad via omalley)
+
 Release 0.13.0 - 2007-06-08
 
  1. HADOOP-1047.  Fix TestReplication to succeed more reliably.

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/io/GenericWritable.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/io/GenericWritable.java?view=diff&rev=555697&r1=555696&r2=555697
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/io/GenericWritable.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/io/GenericWritable.java Thu Jul 12 10:13:29 2007
@@ -81,9 +81,9 @@
 
   public void readFields(DataInput in) throws IOException {
     type = in.readByte();
-    Class clazz = getTypes()[type & 0xff];
+    Class<? extends Writable> clazz = getTypes()[type & 0xff];
     try {
-      instance = (Writable) clazz.newInstance();
+      instance = clazz.newInstance();
     } catch (Exception e) {
       e.printStackTrace();
       throw new IOException("Cannot initialize the class: " + clazz);
@@ -103,6 +103,6 @@
    * Return all classes that may be wrapped.  Subclasses should implement this
    * to return a constant array of classes.
    */
-  abstract protected Class[] getTypes();
+  abstract protected Class<? extends Writable>[] getTypes();
 
 }