Hi David,

Sorry that it took you some time to make it work, we try to make it easy,
but as things are constantly

Sounds like a limitation of Eclipse, I just tried with Eclipse 4.7.x and
saw the same error with latest trunk, it seems not many people working on
POI are using Eclipse nowadays.

I then tried with latest Eclipse 2019.03, there most of the compilation
errors are gone, 4 are remaining for casts that seem to be too complex for
Eclipse but are working with Oracle/OpenJDK/IBMJDK, we should probably work
around those so we support at least the current version of Eclipse, even if
it has limitations in its implementation of Java compilation.

I performed a few smaller changes that should make it work on Eclipse
2019.03 again, so if you can switch Eclipse and update to latest trunk, you
should be able to compile.

Thanks... Dominik.


On Thu, Apr 25, 2019 at 3:04 AM Gauntt, David <[email protected]> wrote:

> I am getting close to my first successful build of the POI project, and
> have run into a couple of compiler errors that seem to be blocking me.  The
> first of these is
>
>
> Cannot reference a field before it is defined
>
>
> This is caused 100 times in RecordTypes. java.  How is it that other
> people are getting this project to compile properly but not me?  I am
> building in Eclipse ver 2018-09 under Windows 10, using Java SE 1.8.  The
> project is a copy of tag REL_4_1_0 from the Git mirror of POI.
>
>
> The following code illustrates this error.  Ironically, while the error
> message says that I am trying to reference a field, the error seems to be
> caused by a method reference (UnknownRecordPlaceholder::new).
>
>
> public final class SSCCE {
>
>     static class UnknownRecordPlaceholder {
>     }
>
>     enum RecordTypes {
> // Error caused by next line
>         UnknownRecordPlaceholder(UnknownRecordPlaceholder::new);
>
>         @FunctionalInterface
>         public interface RecordConstructor {
>             void test();
>         }
>
>         public final RecordConstructor recordConstructor;
>
>         RecordTypes(RecordConstructor recordConstructor) {
>             this.recordConstructor = recordConstructor;
>         }
>     }
>
> }
>
>
>

Reply via email to