Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

java 1.8 needed and wrong package for FZNLayout #6

Closed
thierry-martinez opened this issue Sep 1, 2015 · 3 comments
Closed

java 1.8 needed and wrong package for FZNLayout #6

thierry-martinez opened this issue Sep 1, 2015 · 3 comments

Comments

@thierry-martinez
Copy link

In order to compile the project, I needed to change the version of the Java flavor in pom.xml from 1.7 to 1.8:

1.8 1.8

Indeed, in the file src/main/java/parser/flatzinc/Flatzinc.java, there is the following construction that requires Java 1.8:
ParserListener::afterParsingFile

I needed to change also in the file src/main/antlr4/parser/flatzinc/Flatzinc4Parser.g4:
import parser.flatzinc.FZNLayout;
into
import parser.flatzinc.layout.FZNLayout;

@cprudhom
Copy link
Member

cprudhom commented Sep 1, 2015

Hi,

I'm not sure I got your needs.
We do not plan to make the current code java 7 compliant, but you can fork the code and change it the way you like.

CP

@thierry-martinez
Copy link
Author

Hi!

CP:

I'm not sure I got your needs.

Well, I just need to be able to compile choco-parsers!

My remark is that the code as it is shared on GitHub does not compile.

Here is how to reproduce the problem:
$ git clone https://github.com/chocoteam/choco-parsers.git
$ cd choco-parsers
$ mvn clean compile
[...]
[INFO] BUILD FAILURE
[...]
[ERROR] [...]/src/main/java/parser/flatzinc/Flatzinc.java:[101,42] error: method references are not supported in -source 1.7

That is because the code uses Java 1.8 features (as I said in my initial report) but the pom.xml file that you distribute declares Java 1.7. You may want to change 1.7 to 1.8 for source and target in the pom.xml of the project, otherwise all of your users would have to make this change manually.

$ sed -i -e s/1.7/1.8/ pom.xml

Besides of that, even with the above correction, the code that is distributed does not compile as it is.

$ mvn clean compile
[...]
[INFO] BUILD FAILURE
[...]
[ERROR] [...]/src/main/java/parser/flatzinc/Flatzinc4Parser.java:[39,22] error: cannot find symbol

You may want to put the right package path for FZNLayout, otherwise all of your users would have to make this fix manually.
$ sed -i -e s/parser.flatzinc.FZNLayout/parser.flatzinc.layout.FZNLayout/ src/main/antlr4/parser/flatzinc/Flatzinc4Parser.g4

$ mvn clean compile
[...]
[INFO] BUILD SUCCESS

Best regards.

Thierry.

----- Original Message -----

From: "cprudhom" notifications@github.com
To: "chocoteam/choco-parsers" choco-parsers@noreply.github.com
Cc: "thierry-martinez" thierry.martinez@inria.fr
Sent: Tuesday, September 1, 2015 1:37:57 PM
Subject: Re: [choco-parsers] java 1.8 needed and wrong package for FZNLayout
(#6)

Hi,
I'm not sure I got your needs.
We do not plan to make the current code java 7 compliant, but you can fork
the code and change it the way you like.
CP

Reply to this email directly or view it on GitHub .

@cprudhom
Copy link
Member

cprudhom commented Sep 1, 2015

Ok, I didn't understand that you gave us a patch. Sorry for the misunderstanding and thank you for your help, I'll fix it right now.

CP

@cprudhom cprudhom closed this as completed Sep 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants