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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 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:

      {"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.net.URI"
      		  }
      		],
      		"default": null
      	}
       ]
      }

      and class

      @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
      }{

      If you want to use the customDecode method, there will be an error.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: