Just a follow up based on some discoveries while trying to rebase my branch on 
master this morning.   

Eclipse JDT outputs methods/fields into class files in a different order than 
Oracle compiler.   That’s perfectly acceptable from a “binary compatibility” 
standpoint, but it has a side effect of causing potential problems with 
AutoValue.   If the AutoValue class tries to get it’s values from an interface, 
the methods on the interface will come in a different order than with Oracle 
and the resulting constructor/fields/etc… will be different.   Based on some 
experiments and back and forth with Dan H., I believe the best fix is to 
explicitly define the properties on the AutoValue class as if it didn’t pull 
those via the interface.   Thus, the APT processing gets the attributes in the 
order intended and generates the right code.     The alternative would be to 
use the Builder pattern instead of the constructor, but that requires more code 
to be written than just defining the attributes in the right order.   However, 
if you are already defining a Builder, that might be the best option.

Anyway, something to be aware of when using the AutoValue things.   Once we get 
the branch merged, travis should automatically pick this up.


> On Oct 14, 2016, at 11:37 AM, Daniel Kulp <dk...@apache.org> wrote:
>> On Oct 14, 2016, at 10:06 AM, Jesse Anderson <je...@smokinghand.com> wrote:
>> Last week I imported Beam with IntelliJ and everything worked.
>> That said, I tried to import the Eclipse project and that doesn't compile
>> anymore. I didn't have time to figure out what happened though.
> I have a pull request https://github.com/apache/incubator-beam/pull/1094 that 
> fixes the compile issues.  It has two LGTM’s, just needs someone to merge it. 
> With eclipse, you need to have all the needed m2e connectors.   Some of them 
> (find bugs, check style) can be auto-detected and installed when beam is 
> first imported.   The apt one doesn’t.   You need to go to the eclipse 
> marketplace, install it, then configure it in the Eclipse properties to turn 
> on the “experimental” m2e-apt processing.   Once you do that, a refresh of 
> the maven projects should result in it building/compiling.
> Running tests is another matter.   Since eclipse compiles everything in a 
> module in one pass (instead of two like maven), one of the apt processors 
> doesn’t know where to output files and always dumps the files in /classes 
> instead of /test-classes.   Thus, any test that relies on a runner will 
> likely fail as it results in the “test” versions of various services from 
> core being picked up.  A simple:
> rm sdks/java/core/target/classes/META-INF/services/*
> From the command line will fix that.   That should also be documented on the 
> IDE page until someone can figure out how to work around it.
> Dan
>> On Fri, Oct 14, 2016 at 1:21 AM Jean-Baptiste Onofré <j...@nanthrax.net>
>> wrote:
>>> Hi Christian,
>>> IntelliJ doesn't need any special config (maybe the code style can be
>>> documented or imported).
>>> Anyway, agree to add such on website in the contribute directory. I
>>> think it could be part of the contribution-guide as it's first setup step.
>>> Regards
>>> JB
>>> On 10/14/2016 10:17 AM, Christian Schneider wrote:
>>>> Hello all,
>>>> I am new to the beam community and currently start making myself
>>>> familiar with the code.  I quickly found the contribution guide and was
>>>> able to clone the code and build beam using maven.
>>>> The first obstacle I faced was getting the code build in eclipse. I
>>>> naively imported as existing maven projects but got lots of compile
>>>> errors. After talking to Dan Kulp we found that this is due to the apt
>>>> annotation processing for auto value types. Dan explained me how I need
>>>> to setup eclipse to make it work.
>>>> I still got 5 compile errors (Some bound mismatch at Read.bounded, and
>>>> one ambiguous method empty). These errors seem to be present for
>>>> everyone using eclipse and Dan works on it. So I think this is not a
>>>> permanent problem.
>>>> To make it easier for new people I would like to write a documentation
>>>> about the IDE setup. I can cover the eclipse part but I think intellij
>>>> should also be described.
>>>> I already started with it and placed it in /contribute/ide-setup. Does
>>>> that make sense?
>>>> I currently did not link to it from anywhere. I think it should be
>>>> linked in the contribute/index and in the Contribute menu.
>>>> Christian
>>> --
>>> Jean-Baptiste Onofré
>>> jbono...@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
> -- 
> Daniel Kulp
> dk...@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to