[ 
https://issues.apache.org/jira/browse/AVRO-2157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Max Englander updated AVRO-2157:
--------------------------------
    Description: 
The following IDL will not compile:

 
{code:java}
@namespace("org.avro.example.protocol")
protocol TwoByteSender {
  import schema "../schema/twobytes.avsc";

  record TwoByteReq {
    org.avro.example.schema.TwoBytes twobyte; 
  }

  void send(org.avro.example.schema.TwoBytes twobyte);
  void sendReq(TwoByteReq req);
}{code}
(The code below, *twobytes.avsc*, compiles without issue, and is included for 
completeness.)

 
{code:java}
{
  "name": "TwoBytes",
  "namespace": "org.avro.example.schema",
  "size": "2",
  "type": "fixed"
}{code}
The error thrown by the compiler is:
{noformat}
org.apache.avro.compiler.idl.ParseException: Encountered " "schema" "schema "" 
at line 34, column 14.
Was expecting one of:
"array" ...
"boolean" ...
"double" ...
"enum" ...
"error" ...
{noformat}
 

  was:
The following IDL will not compile:

 
{code:java}
@namespace("org.avro.example.protocol")
protocol TwoByteSender {
  import schema "twobytes.avsc";

  record TwoByteReq {
    org.avro.example.schema.TwoByte twobyte; 
  }

  void send(org.avro.example.schema.TwoByte twobyte);
  void sendReq(TwoByteReq req);
}{code}
(The code below, *twobytes.avsc*, compiles without issue, and is included for 
completeness.)

 
{code:java}
{
  "name": "TwoBytes",
  "namespace": "org.avro.example.schema",
  "size": "2",
  "type": "fixed"
}{code}
The error thrown by the compiler is:
{noformat}
org.apache.avro.compiler.idl.ParseException: Encountered " "schema" "schema "" 
at line 34, column 14.
Was expecting one of:
"array" ...
"boolean" ...
"double" ...
"enum" ...
"error" ...
{noformat}
 


> IDL compiler won't accept the word "schema" in namespace-qualified type 
> references
> ----------------------------------------------------------------------------------
>
>                 Key: AVRO-2157
>                 URL: https://issues.apache.org/jira/browse/AVRO-2157
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.1, 1.8.2
>         Environment: I have produced the error in Ubuntu 16.04, with Java 
> 1.8.0_151, using both the avro-maven-plugin, as well as by modifying the test 
> files in the apache/avro/lang/compiler test suite.
>  
>            Reporter: Max Englander
>            Priority: Trivial
>
> The following IDL will not compile:
>  
> {code:java}
> @namespace("org.avro.example.protocol")
> protocol TwoByteSender {
>   import schema "../schema/twobytes.avsc";
>   record TwoByteReq {
>     org.avro.example.schema.TwoBytes twobyte; 
>   }
>   void send(org.avro.example.schema.TwoBytes twobyte);
>   void sendReq(TwoByteReq req);
> }{code}
> (The code below, *twobytes.avsc*, compiles without issue, and is included for 
> completeness.)
>  
> {code:java}
> {
>   "name": "TwoBytes",
>   "namespace": "org.avro.example.schema",
>   "size": "2",
>   "type": "fixed"
> }{code}
> The error thrown by the compiler is:
> {noformat}
> org.apache.avro.compiler.idl.ParseException: Encountered " "schema" "schema 
> "" at line 34, column 14.
> Was expecting one of:
> "array" ...
> "boolean" ...
> "double" ...
> "enum" ...
> "error" ...
> {noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to