avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fo...@apache.org
Subject [avro] branch branch-1.9 updated: AVRO-2491: Deprecate Schema#createRecord from list of fields method (#598)
Date Wed, 31 Jul 2019 08:38:34 GMT
This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/branch-1.9 by this push:
     new 19d188d  AVRO-2491: Deprecate Schema#createRecord from list of fields method (#598)
19d188d is described below

commit 19d188d876e617f10e760e9e2460aec41598456e
Author: Ismaël Mejía <iemejia@gmail.com>
AuthorDate: Wed Jul 31 10:37:20 2019 +0200

    AVRO-2491: Deprecate Schema#createRecord from list of fields method (#598)
    
    This method should be removed in the future because it allows to create
    invalid schemas (without name) that are not Parseable by Avro.
    
    (cherry picked from commit 1c5d3ff4ff78551edd4bab9824642d6918d3565d)
---
 .gitignore                                               |  2 ++
 lang/java/avro/src/main/java/org/apache/avro/Schema.java | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index edb7931..4bb7412 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,5 @@ test-output
 /lang/java/compiler/nb-configuration.xml
 /lang/java/compiler/nbproject/
 **/.vscode/**/*
+.factorypath
+
diff --git a/lang/java/avro/src/main/java/org/apache/avro/Schema.java b/lang/java/avro/src/main/java/org/apache/avro/Schema.java
index 6180649..7579036 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/Schema.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/Schema.java
@@ -191,7 +191,16 @@ public abstract class Schema extends JsonProperties implements Serializable
{
     this.logicalType = logicalType;
   }
 
-  /** Create an anonymous record schema. */
+  /**
+   * Create an anonymous record schema.
+   *
+   * @deprecated This method allows to create Schema objects that cannot be parsed
+   *             by {@link Schema.Parser#parse(String)}. It will be removed in a
+   *             future version of Avro. Better use
+   *             i{@link #createRecord(String, String, String, boolean, List)} to
+   *             produce a fully qualified Schema.
+   */
+  @Deprecated
   public static Schema createRecord(List<Field> fields) {
     Schema result = createRecord(null, null, null, false);
     result.setFields(fields);


Mime
View raw message