Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2385

Uppercase fields do not generate proper getter/setters in Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.2
    • None
    • java
    • Using Maven plugin with Java 8

    Description

      Steps to reproduce:

      Create an Avro schema with an uppercase field:

      {
        "type": "record",
        "name": "example",
        "namespace": "issue",
        "fields": [
          {
            "name": "THERE_IS_NO_INDICATION_OF_WORDS",
            "type": "string"
          }
        ]
      }
      

      Use the avro-maven-plugin to generate Java code for this schema.

      <plugin>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro-maven-plugin</artifactId>
        <version>1.8.2</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>schema</goal>
            </goals>
            <configuration>
              <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      

      Expected result:

      The generate getters and setters use camel casing ThereIsNoIndicationOfWords.

      Actual result:

      The generated getters and setters are in all uppercase:

      /**
       * Gets the value of the 'THERE_IS_NO_INDICATION_OF_WORDS' field.
       * @return The value of the 'THERE_IS_NO_INDICATION_OF_WORDS' field.
       */
      public java.lang.CharSequence getTHEREISNOINDICATIONOFWORDS() {
        return THERE_IS_NO_INDICATION_OF_WORDS;
      }
      
      /**
       * Sets the value of the 'THERE_IS_NO_INDICATION_OF_WORDS' field.
       * @param value the value to set.
       */
      public void setTHEREISNOINDICATIONOFWORDS(java.lang.CharSequence value) {
        this.THERE_IS_NO_INDICATION_OF_WORDS = value;
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gdefender Andrew
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h