Jian Jiang created AVRO-1531:
--------------------------------

             Summary: Assignment missing in AvroDatumConverterFactory
                 Key: AVRO-1531
                 URL: https://issues.apache.org/jira/browse/AVRO-1531
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.7.6, 1.7.5
            Reporter: Jian Jiang


The following defect found in method: public <IN, OUT> AvroDatumConverter<IN, 
OUT> create(Class<IN> inputClass):

    if (AvroValue.class.isAssignableFrom(inputClass)) {
      Schema schema = null;
      if (isMapOnly) {
        AvroJob.getMapOutputValueSchema(getConf());<---!!!Missing assignment to 
schema variable--->
        if (null == schema) {
          schema = AvroJob.getOutputValueSchema(getConf());
        }
      }
      else {
        schema = AvroJob.getOutputValueSchema(getConf());
      }
      if (null == schema) {
        throw new IllegalStateException(
            "Writer schema for output value was not set. Use 
AvroJob.setOutputValueSchema().");
      }
      return (AvroDatumConverter<IN, OUT>) new AvroWrapperConverter(schema);
    }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to