You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2020/05/21 15:10:06 UTC
[avro] 02/03: Generated java-class attribute URL has an
non-RuntimeException
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git
commit 192cd3b8d607ce77a268f99ab4e3450597d882db
Author: zeshuai007 <51...@qq.com>
AuthorDate: Thu Nov 7 15:33:42 2019 +0800
Generated java-class attribute URL has an non-RuntimeException
---
.../apache/avro/compiler/specific/templates/java/classic/record.vm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
index 563f94b..4158fdd 100755
--- a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
+++ b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
@@ -764,6 +764,12 @@ $II ${var} = new ${st}(in.readString());
$II } catch (java.net.URISyntaxException e) {
$II throw new java.io.IOException(e.getMessage());
$II }
+#elseif ($st.equals("java.net.URL"))
+$II try {
+$II ${var} = new ${st}(in.readString());
+$II } catch (java.net.MalformedURLException e) {
+$II throw new java.io.IOException(e.getMessage());
+$II }
#else
$II ${var} = new ${st}(in.readString());
#end