0

I have cloned a maven project on a new machine but I am having some problems with some of the dependencies as they don't seem to have been loaded. One such case, is fj.Effect of Functional java. I am not sure if I am (manually) adding the right library.

In the code, I have:

private Effect<EventDBEvent> downloadEvent = new Effect<EventDBEvent>() {
    @Override
    public void e(EventDBEvent eventDBEvent) {
        ...
    }
};

I have tried adding org.org.functionaljava:functionaljava-java8:4.32 and org.functionaljava:functionaljava:4.3 IntelliJ recognizes Effect but highlights the first line as error and says: I have a similar issue in another line:

final ... = new ...(new Effect<Option<Integer>>() {
    @Override
    public void e(Option<Integer> integerOption) {
    }
}, ...);

Type fj.Effect does not have type parameters.

Am I importing the wrong packages?

More generally, is there a way of knowing which packages I should use, based on an existing code?

Maths noob
  • 1,684
  • 20
  • 42
  • see https://github.com/functionaljava/functionaljava/blob/master/core/src/main/java/fj/Effect.java it seems the class did completly change (see also [this](http://grepcode.com/file/repo1.maven.org/maven2/org.functionaljava/functionaljava/3.1/fj/Effect.java) for history) –  Jun 22 '15 at 16:46
  • Thanks. Reverted back to an earlier version and it works now. So what is the general strategy for cases like this? manually going through the version history? – Maths noob Jun 22 '15 at 16:52
  • IMHO, reading changelogs, frequent upgrades to avoid "big changes" –  Jun 22 '15 at 18:07

1 Answers1

0

The Effect class changed so that the arity is in the class name, e.g. Effect0, Effect1, etc., where the arity indicates the number of parameters to the method. You want to use the Effect1 class.

Mark Perry
  • 1,656
  • 1
  • 9
  • 6