Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-803 Java generated Avro classes make using Avro painful and surprising
  3. AVRO-909

change generated getter methods for string fields to return java.lang.String instead of Utf8

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • java
    • None

    Description

      A field X of type string might generate:

      public CharSequence x;                // for back compatibility
      public void setX(String s) {
        if (x instanceof Utf8)
          x.set(s);
        else
          x = new Utf8(s);
      }
      public String getX() { return x.toString(); }
      

      The accessor methods have not yet been released, so this would be a compatible change in 1.6. Applications that wished to use Utf8 directly for performance could still use the field directly. Utf8 could be improved to lazily convert between byte[] and String representations.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cutting Doug Cutting
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: