avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Fletcher (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1036) IDL processing fails with multi-level nested imports
Date Thu, 23 Feb 2012 17:54:48 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214888#comment-13214888
] 

George Fletcher commented on AVRO-1036:
---------------------------------------

So the bug is that findFile() returns and InputStream and the Idl class constructor that takes
an InputStream is created by the javacc processing of the Idl.jj file. This Idl constructor
does not set the inputDir field of the Idl class and hence the Idl object created from the
stream returned by findFile() has lost the sourceDirectory. This causes an import statement
processed by this Idl object to fail, because the file can not be found as the "sourceDirectory
is "lost".

I'm not very happy with my current solution as it seems a little "hacky". Suggestions appreciated.

Current solution...

1. Add a setSrcDir() method to the Idl class (added to Idl.jj)
2. Modify the ImportIdl() method to first create the Idl instance from the InputStream returned
by findFile() and then call the setSrcDir() setter chaining the current inputDir into the
created Idl instance.
                
> IDL processing fails with multi-level nested imports
> ----------------------------------------------------
>
>                 Key: AVRO-1036
>                 URL: https://issues.apache.org/jira/browse/AVRO-1036
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2
>            Reporter: George Fletcher
>             Fix For: 1.6.3
>
>
> The change to support finding IDL related files on the classpath in addition to the maven-plugin
defined directory caused the context of the "sourceDirectory" to be lost when the InputStream
return by findFile() is used to create a new Idl instance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message