Please use the full fixed path without any properties ($MAVEN_REPOSITORY$), I tested on Windows with the following and it worked ( https://i.imgur.com/MjemFFU.png ):
It does not work, at least properly. Let me explain myself:
Left is eclipse, right intellij. When I use @Require and use a wrong name, notice "initialBalanceWrongVariable" Eclipse warns me that there is an error in contract while Intellij tells me nothing.
No error in contract for intellij when it actually works in eclipse
Hmm, you're right, it is actually working when it is run. Do you know how can I get the errors on the same line (like the ones in eclipse)? Thanks for the support.
I've reported a bug, see https://youtrack.jetbrains.com/v2/issue/IDEA-186050 for details.
If you replace io.konverge:cofoja:jar property with the full local path to the cofoja jar file and reimport the project, it should help.
Hi, thanks for the reply. Where do you exactly want me to change that? thanks.
Here: https://github.com/seglo/cofoja-example/blob/master/pom.xml#L84.
Thanks for the reply.
This are my settings now:
And the error I get
Please use the full fixed path without any properties ($MAVEN_REPOSITORY$), I tested on Windows with the following and it worked ( https://i.imgur.com/MjemFFU.png ):
(in depth value of com.google.java.contract.classpath)=> $MAVEN_REPOSITORY$/io/konverge/cofoja/2.0.0/cofoja-2.0.0.jar
oh, I see
By the way, do you know how could I add Cofoja without Maven?
For example, having this simple project
https://www.mediafire.com/file/ml3slbbjlk2bgjm/account+(1).zip
Is the setup going to be similar or different?
Thanks again for your help
Should be the same, you will have to add the options to the annotation processor manually.
Error:
Configuration:
Using ubuntu, as you could already realise
May I see yours? Maybe I am doing it in a wrong way
Tried this:
And gives the same error
I am trying to get it work in the file I attached to you:
Settings:
Error:
You need to use IntelliJ IDEA module output directory, not the target directory. target is specific to Maven.
You mean like this? :
I wonder if you could give me an example for the "Account" project, so I can realise what do you mean
src is not the output directory, check where classes are compiled.
where or how can i check that?
https://www.jetbrains.com/help/idea/paths-tab.html#d398167e13
Changed it
But contracts still not working
Your tests output path is different. Also not sure if cofoja.asm.jar is the same as cofoja-2.0.0.jar.
I am using the Account example I attached you before (this).
Tests are inside src as well.
Working project: http://www.mediafire.com/file/m9pjhlc6ueiwxhc/Account.zip.
It does not work, at least properly. Let me explain myself:
Left is eclipse, right intellij. When I use @Require and use a wrong name, notice "initialBalanceWrongVariable" Eclipse warns me that there is an error in contract while Intellij tells me nothing.
No error in contract for intellij when it actually works in eclipse
Works for me in the project I've shared above:
Hmm, you're right, it is actually working when it is run. Do you know how can I get the errors on the same line (like the ones in eclipse)? Thanks for the support.
It works not when you run it, but when the project is compiled.
You can enable automatic compilation to get such errors on the fly: https://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save/.
Unlike Eclipse, IntelliJ IDEA doesn't compile the project automatically by default.
Hi.
I have this project.
There is 4 classes, Natural, NaturalTest, NaturalList and NaturalListTest.
I wrote just a simple contract for the class Natural
and a test for it inside NaturalTest.
In that test I am expecting for a PreconditionError, which does not throw. I wonder if you could tell me why? It works on eclipse. Thanks
What is the result in Eclipse? Do you get a error when compiling or when running? What exactly is reported?
Natural class has this precondition before the constructor method.
However, if I create a main class and create a Natural object with value -1 it should throw a PreconditionError but it does not.
It prints -1 in the terminal.