Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.12.0
Description
Given this avdl (TestProtocol.avdl):
protocol TestProtocol { record Test { map<string> myMap = {}; } }
With Avro 1.12.0 'IdlReader' fails with a NullPointerException:
$ java -jar avro-tools-1.12.0.jar idl ./TestProtocol.avdl Exception in thread "main" org.apache.avro.SchemaParseException: java.lang.NullPointerException: Cannot invoke "org.antlr.v4.runtime.Token.getText()" because "stringToken" is null at org.apache.avro.idl.IdlReader.parse(IdlReader.java:224) at org.apache.avro.idl.IdlReader.parse(IdlReader.java:187) at org.apache.avro.idl.IdlReader.parse(IdlReader.java:172) at org.apache.avro.tool.IdlTool.run(IdlTool.java:70) at org.apache.avro.tool.Main.run(Main.java:67) at org.apache.avro.tool.Main.main(Main.java:56) Caused by: java.lang.NullPointerException: Cannot invoke "org.antlr.v4.runtime.Token.getText()" because "stringToken" is null at org.apache.avro.idl.IdlReader$IdlParserListener.getString(IdlReader.java:975) at org.apache.avro.idl.IdlReader$IdlParserListener.exitJsonPair(IdlReader.java:926) at org.apache.avro.idl.IdlParser$JsonPairContext.exitRule(IdlParser.java:2558) at org.antlr.v4.runtime.Parser.triggerExitRuleEvent(Parser.java:410) at org.antlr.v4.runtime.Parser.exitRule(Parser.java:642) at org.apache.avro.idl.IdlParser.idlFile(IdlParser.java:289) at org.apache.avro.idl.IdlReader.parse(IdlReader.java:220) ... 5 more
With Avro 1.11.3
$ java -jar avro-tools-1.11.3.jar idl ./TestProtocol.avdl { "protocol" : "TestProtocol", "types" : [ { "type" : "record", "name" : "Test", "fields" : [ { "name" : "myMap", "type" : { "type" : "map", "values" : "string" }, "default" : { } } ] } ], "messages" : { } }
Attachments
Issue Links
- is duplicated by
-
AVRO-4034 Execution schemas of goal org.apache.avro:avro-maven-plugin:1.12.0:idl-protocol failed: java.lang.NullPointerException
- Open
- links to