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

The generated java-class attribute URI has an unhandled exception type of URISyntaxException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • None
    • 1.10.0
    • java
    • None

    Description

      When creating a java.net.URI Object,there is no handling of a URISyntaxException.

      Given a specific record generated from the following avsc:
      (code:java)
      {"namespace": "example.avro",
      "type": "record",
      "name": "User",
      "fields": [

      {"name": "name", "type": "string"}

      ,

      {"name": "favorite_number", "type": ["int", "null"]}

      ,

      {"name": "favorite_color", "type": ["string", "null"]}

      ,
      {
      "name": "ownerAddress",
      "type": [
      "null",

      { "type": "string", "java-class": "java.lang.URI" }

      ],
      "default": null
      }
      ]
      }(code)
      (code:java)
      @org.apache.avro.specific.AvroGenerated
      public class User extends org.apache.avro.specific......
      {
      ......
      private java.net.URI ownerAddress;
      ......
      this.ownerAddress = new java.net.URI(in.readString());
      //There is Unhandled exception type URISyntaxException
      }
      }(code)
      If you want to use the customDecode method, there will be an error

      Attachments

        Activity

          People

            zeshuai007 Zezeng Wang
            zeshuai007 Zezeng Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: