avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1634542 - in /avro/trunk: CHANGES.txt lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java
Date Mon, 27 Oct 2014 14:11:07 GMT
Author: tomwhite
Date: Mon Oct 27 14:11:06 2014
New Revision: 1634542

URL: http://svn.apache.org/r1634542
Log:
AVRO-1489. Java: Avro fails to build with OpenJDK 8. Contributed by Ricardo Arguello.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1634542&r1=1634541&r2=1634542&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Mon Oct 27 14:11:06 2014
@@ -52,6 +52,9 @@ Trunk (not yet released)
     AVRO-1591. Java: Fix specific RPC so that proxies implement hashCode(),
     equals() and toString(). (Mark Spadoni via cutting)
 
+    AVRO-1489. Java: Avro fails to build with OpenJDK 8. (Ricardo Arguello via
+    tomwhite)
+
 Avro 1.7.7 (23 July 2014)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java?rev=1634542&r1=1634541&r2=1634542&view=diff
==============================================================================
--- avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java (original)
+++ avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java Mon Oct
27 14:11:06 2014
@@ -98,12 +98,14 @@ public class ThriftData extends GenericD
     new ConcurrentHashMap<Schema,TFieldIdEnum[]>();
 
   @Override
+  @SuppressWarnings("unchecked")
   protected Object getRecordState(Object r, Schema s) {
     TFieldIdEnum[] fields = fieldCache.get(s);
     if (fields == null) {                           // cache miss
       fields = new TFieldIdEnum[s.getFields().size()];
       Class c = r.getClass();
-      for (TFieldIdEnum f : FieldMetaData.getStructMetaDataMap(c).keySet())
+      for (TFieldIdEnum f :
+          FieldMetaData.getStructMetaDataMap((Class<? extends TBase>) c).keySet())
         fields[s.getField(f.getFieldName()).pos()] = f;
       fieldCache.put(s, fields);                  // update cache
     }
@@ -166,6 +168,7 @@ public class ThriftData extends GenericD
     = new ConcurrentHashMap<Class,Schema>();
 
   /** Return a record schema given a thrift generated class. */
+  @SuppressWarnings("unchecked")
   public Schema getSchema(Class c) {
     Schema schema = schemaCache.get(c);
 
@@ -181,7 +184,7 @@ public class ThriftData extends GenericD
                                        Throwable.class.isAssignableFrom(c));
           List<Field> fields = new ArrayList<Field>();
           for (FieldMetaData f :
-                 FieldMetaData.getStructMetaDataMap(c).values()) {
+                 FieldMetaData.getStructMetaDataMap((Class<? extends TBase>) c).values())
{
             Schema s = getSchema(f.valueMetaData);
             if (f.requirementType == TFieldRequirementType.OPTIONAL
                 && (s.getType() != Schema.Type.UNION))



Mime
View raw message