Skip to content

Fix warnings #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ buildscript {
classpath "com.ofg:uptodate-gradle-plugin:$uptodateVersion"
classpath "me.tatarka:gradle-retrolambda:$retrolambdaPluginVersion"
}

wrapper {
gradleVersion = "4.10.2"
distributionType = Wrapper.DistributionType.ALL
}
}

if (JavaVersion.current().isJava8Compatible()) {
Expand Down Expand Up @@ -117,23 +122,10 @@ subprojects {
}
}

jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}

task coverage(dependsOn: ["test", "jacocoTestReport"]) << {}

}

task coverage(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.coverage
dependsOn = subprojects*.test
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// We only care about coverage of:
def projectForFoverage = ["core", "java8", "quickcheck", "java-core"]
Expand Down Expand Up @@ -192,14 +184,14 @@ configure(subprojects.findAll { it.name != "props-core" }) {
}

// Output MANIFEST.MF statically so eclipse can see it for plugin development
task eclipsePluginManifest(dependsOn: jar) << {
task eclipsePluginManifest(dependsOn: jar) doLast {
file("META-INF").mkdirs()
jar.manifest.writeTo(file("META-INF/MANIFEST.MF"))
}

eclipseProject.dependsOn eclipsePluginManifest
}

task env << {
task env doLast {
println System.getenv()
}
28 changes: 14 additions & 14 deletions core/src/main/java/fj/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -778,47 +778,47 @@ public static <A, B> F<B, A> join(final F<B, F<B, A>> f) {

/**
* Partial application of the second argument to the supplied function to get a function of type
* <tt>A -> C</tt>. Same as <tt>flip(f).f(b)</tt>.
* {@code A -> C}. Same as {@code flip(f).f(b)}.
*
* @param f The function to partially apply.
* @param b The value to apply to the function.
* @return A new function based on <tt>f</tt> with its second argument applied.
* @return A new function based on {@code f} with its second argument applied.
*/
public static <A, B, C> F<A, C> partialApply2(final F<A, F<B, C>> f, final B b) {
return a -> uncurryF2(f).f(a, b);
}

/**
* Partial application of the third argument to the supplied function to get a function of type
* <tt>A -> B -> D</tt>.
* {@code A -> B -> D}.
*
* @param f The function to partially apply.
* @param c The value to apply to the function.
* @return A new function based on <tt>f</tt> with its third argument applied.
* @return A new function based on {@code f} with its third argument applied.
*/
public static <A, B, C, D> F<A, F<B, D>> partialApply3(final F<A, F<B, F<C, D>>> f, final C c) {
return a -> b -> uncurryF3(f).f(a, b, c);
}

/**
* Partial application of the fourth argument to the supplied function to get a function of type
* <tt>A -> B -> C -> E</tt>.
* {@code A -> B -> C -> E}.
*
* @param f The function to partially apply.
* @param d The value to apply to the function.
* @return A new function based on <tt>f</tt> with its fourth argument applied.
* @return A new function based on {@code f} with its fourth argument applied.
*/
public static <A, B, C, D, E> F<A, F<B, F<C, E>>> partialApply4(final F<A, F<B, F<C, F<D, E>>>> f, final D d) {
return a -> b -> c -> uncurryF4(f).f(a, b, c, d);
}

/**
* Partial application of the fifth argument to the supplied function to get a function of type
* <tt>A -> B -> C -> D -> F$</tt>.
* {@code A -> B -> C -> D -> F$}.
*
* @param f The function to partially apply.
* @param e The value to apply to the function.
* @return A new function based on <tt>f</tt> with its fifth argument applied.
* @return A new function based on {@code f} with its fifth argument applied.
*/
public static <A, B, C, D, E, F$> F<A, F<B, F<C, F<D, F$>>>> partialApply5(final F<A, F<B, F<C, F<D, F<E, F$>>>>> f,
final E e) {
Expand All @@ -827,11 +827,11 @@ public static <A, B, C, D, E> F<A, F<B, F<C, E>>> partialApply4(final F<A, F<B,

/**
* Partial application of the sixth argument to the supplied function to get a function of type
* <tt>A -> B -> C -> D -> E -> G</tt>.
* {@code A -> B -> C -> D -> E -> G}.
*
* @param f The function to partially apply.
* @param f$ The value to apply to the function.
* @return A new function based on <tt>f</tt> with its sixth argument applied.
* @return A new function based on {@code f} with its sixth argument applied.
*/
public static <A, B, C, D, E, F$, G> F<A, F<B, F<C, F<D, F<E, G>>>>> partialApply6(
final F<A, F<B, F<C, F<D, F<E, F<F$, G>>>>>> f, final F$ f$) {
Expand All @@ -840,11 +840,11 @@ public static <A, B, C, D, E> F<A, F<B, F<C, E>>> partialApply4(final F<A, F<B,

/**
* Partial application of the seventh argument to the supplied function to get a function of type
* <tt>A -> B -> C -> D -> E -> F$ -> H</tt>.
* {@code A -> B -> C -> D -> E -> F$ -> H}.
*
* @param f The function to partially apply.
* @param g The value to apply to the function.
* @return A new function based on <tt>f</tt> with its seventh argument applied.
* @return A new function based on {@code f} with its seventh argument applied.
*/
public static <A, B, C, D, E, F$, G, H> F<A, F<B, F<C, F<D, F<E, F<F$, H>>>>>> partialApply7(
final F<A, F<B, F<C, F<D, F<E, F<F$, F<G, H>>>>>>> f, final G g) {
Expand All @@ -853,11 +853,11 @@ public static <A, B, C, D, E> F<A, F<B, F<C, E>>> partialApply4(final F<A, F<B,

/**
* Partial application of the eigth argument to the supplied function to get a function of type
* <tt>A -> B -> C -> D -> E -> F$ -> G -> I</tt>.
* {@code A -> B -> C -> D -> E -> F$ -> G -> I}.
*
* @param f The function to partially apply.
* @param h The value to apply to the function.
* @return A new function based on <tt>f</tt> with its eigth argument applied.
* @return A new function based on {@code f} with its eigth argument applied.
*/
public static <A, B, C, D, E, F$, G, H, I> F<A, F<B, F<C, F<D, F<E, F<F$, F<G, I>>>>>>> partialApply8(
final F<A, F<B, F<C, F<D, F<E, F<F$, F<G, F<H, I>>>>>>>> f, final H h) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/fj/Monoid.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public A zero() {
/**
* Returns a value summed <code>n</code> times (<code>a + a + ... + a</code>).
* The default definition uses peasant multiplication, exploiting
* associativity to only require `O(log n)` uses of
* associativity to only require {@code O(log n)} uses of
* {@link #sum(Object, Object)}.
*
* @param n multiplier
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/fj/P1.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ public static <A> F<P1<A>, A> __1() {
/**
* Promote any function to a transformation between P1s.
*
* @deprecated As of release 4.5, use {@link #map_}
* @deprecated As of release 4.5, use {@link #map_}
* @param f A function to promote to a transformation between P1s.
* @return A function promoted to operate on P1s.
*/
@Deprecated
public static <A, B> F<P1<A>, P1<B>> fmap(final F<A, B> f) {
return map_(f);
}
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/fj/Semigroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public F<A, F<A, A>> sum() {
/**
* Returns a value summed <code>n + 1</code> times (
* <code>a + a + ... + a</code>) The default definition uses peasant
* multiplication, exploiting associativity to only require `O(log n)` uses of
* multiplication, exploiting associativity to only require {@code O(log n)} uses of
* {@link #sum(Object, Object)}.
*
* @param n multiplier
Expand Down Expand Up @@ -527,8 +527,9 @@ public NonEmptyList<A> sum(NonEmptyList<A> nea, F0<Stream<NonEmptyList<A>>> neas
* A semigroup for optional values.
* @deprecated since 4.7. Use {@link #firstOptionSemigroup()}.
*
** @return A semigroup for optional values.
* @return A semigroup for optional values.
*/
@Deprecated
public static <A> Semigroup<Option<A>> optionSemigroup() {
return firstOptionSemigroup();
}
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/fj/control/Trampoline.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public <R> R fold(final F<Normal<A>, R> n,
return gs.f(this);
}

// The monadic bind constructs a new Codense whose subcomputation is still `sub`, and Kleisli-composes the
// The monadic bind constructs a new Codense whose subcomputation is still {@code sub}, and Kleisli-composes the
// continuations.
public <B> Trampoline<B> bind(final F<A, Trampoline<B>> f) {
return codense(sub, o -> suspend(() -> cont.f(o).bind(f)));
Expand Down Expand Up @@ -110,7 +110,7 @@ private static <A, B> Codense<B> codense(final Normal<A> a, final F<A, Trampolin
}

/**
* @return The first-class version of `pure`.
* @return The first-class version of {@code pure}.
*/
public static <A> F<A, Trampoline<A>> pure() {
return Trampoline::pure;
Expand Down Expand Up @@ -148,7 +148,7 @@ public static <A> Trampoline<A> suspend(final P1<Trampoline<A>> a) {


/**
* @return The first-class version of `suspend`.
* @return The first-class version of {@code suspend}.
*/
public static <A> F<P1<Trampoline<A>>, Trampoline<A>> suspend_() {
return Trampoline::suspend;
Expand All @@ -175,21 +175,21 @@ public final <B> Trampoline<B> map(final F<A, B> f) {
}

/**
* @return The first-class version of `bind`.
* @return The first-class version of {@code bind}.
*/
public static <A, B> F<F<A, Trampoline<B>>, F<Trampoline<A>, Trampoline<B>>> bind_() {
return f -> a -> a.bind(f);
}

/**
* @return The first-class version of `map`.
* @return The first-class version of {@code map}.
*/
public static <A, B> F<F<A, B>, F<Trampoline<A>, Trampoline<B>>> map_() {
return f -> a -> a.map(f);
}

/**
* @return The first-class version of `resume`.
* @return The first-class version of {@code resume}.
*/
public static <A> F<Trampoline<A>, Either<P1<Trampoline<A>>, A>> resume_() {
return Trampoline::resume;
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/fj/data/Enumerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

/**
* Abstracts over a type that may have a successor and/or predecessor value. This implies ordering for that type. A user
* may construct an enumerator with an optimised version for <code>plus</code>, otherwise a default is implemented using
* may construct an enumerator with an optimised version for {@code plus}, otherwise a default is implemented using
* the given successor/predecessor implementations.
* <p/>
* For any enumerator e, the following laws must satisfy:
* <ul>
* <li>forall a. e.successor(a).forall(\t -> e.predecessor(t).forall(\z -> z == a))</li>
* <li>forall a. e.predecessor(a).forall(\t -> e.successor(t).forall(\z -> z == a))</li>
* <li>e.max().forall(\t -> e.successor(t).isNone)</li>
* <li>e.min().forall(\t -> e.predecessor(t).isNone)</li>
* <li>forall a n. e.plus(a, 0) == Some(a)</li>
* <li>forall a n | n > 0. e.plus(a, n) == e.plus(a, n - 1)</li>
* <li>forall a n | n < 0. e.plus(a, n) == e.plus(a, n + 1)</li>
* <li>{@code forall a. e.successor(a).forall(\t -> e.predecessor(t).forall(\z -> z == a))}</li>
* <li>{@code forall a. e.predecessor(a).forall(\t -> e.successor(t).forall(\z -> z == a))}</li>
* <li>{@code e.max().forall(\t -> e.successor(t).isNone)}</li>
* <li>{@code e.min().forall(\t -> e.predecessor(t).isNone)}</li>
* <li>{@code forall a n. e.plus(a, 0) == Some(a)}</li>
* <li>{@code forall a n | n > 0. e.plus(a, n) == e.plus(a, n - 1)}</li>
* <li>{@code forall a n | n < 0. e.plus(a, n) == e.plus(a, n + 1)}</li>
* </ul>
*
* @version %build.number%
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/fj/data/Java.java
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ public static <A> F<ArrayList<A>, List<A>> ArrayList_List() {
*
* @return A function that converts Java lists to lists.
*/
@Deprecated
public static <A> F<java.util.List<A>, List<A>> JUList_List() {
return Java::JavaList_List;
}
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/fj/data/Tree.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ public Stream<A> f(final Tree<A> t, final P1<Stream<A>> xs) {
}

/**
* <pre>{@code
* flatten :: Tree a -> [a]
* flatten t = squish t []
* }</pre>
* where squish (Node x ts) xs = x:Prelude.foldr squish xs ts
* Puts the elements of the tree into a Stream, in pre-order.
*
Expand Down Expand Up @@ -346,4 +348,4 @@ public int length() {
return 1 + subForest._1().map(Tree::length).foldLeft((acc, i) -> acc + i, 0);
}

}
}
4 changes: 2 additions & 2 deletions core/src/main/java/fj/data/hlist/HPre.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static HFalse hFalse() {
}

/**
* Type-level boolean conjunction. A value of this type represents evidence that AB -> C
* Type-level boolean conjunction. A value of this type represents evidence that {@code AB -> C}
*
* @param <A> A boolean
* @param <B> A boolean
Expand Down Expand Up @@ -92,7 +92,7 @@ public static HAnd<HTrue, HTrue, HTrue> hAnd(final HTrue a, final HTrue b) {
}

/**
* Type-level boolean disjunction. A value of this type represents evidence that A+B -> C
* Type-level boolean disjunction. A value of this type represents evidence that {@code A+B -> C}
*
* @param <A> A boolean
* @param <B> A boolean
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/fj/data/optic/Iso.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public static <S, A> Iso<S, A> iso(final F<S, A> get, final F<A, S> reverseGet)
* create an {@link Iso} between any type and itself. id is the zero element of optics composition, for all optics o of type O
* (e.g. Lens, Iso, Prism, ...):
*
* <pre>
* <pre>{@code
* o composeIso Iso.id == o
* Iso.id composeO o == o
* </pre>
* }</pre>
*
* (replace composeO by composeLens, composeIso, composePrism, ...)
*/
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/fj/data/optic/PIso.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@
/**
* A {@link PIso} defines an isomorphism between types S, A and B, T:
*
* <pre>
* <pre>{@code
* get reverse.get
* --------------------> -------------------->
* S A T B
* <-------------------- <--------------------
* reverse.reverseGet reverseGet
* </pre>
* }</pre>
*
* In addition, if f and g forms an isomorphism between `A` and `B`, i.e. if `f . g = id` and `g . f = id`, then a {@link PIso}
* defines an isomorphism between `S` and `T`:
* In addition, if f and g forms an isomorphism between {@code A} and {@code B}, i.e. if {@code f . g = id} and {@code g . f = id}, then a {@link PIso}
* defines an isomorphism between {@code S} and {@code T}:
*
* <pre>
* <pre>{@code
* S T S T
* | | | |
* | | | |
* get | | reverseGet reverse.reverseGet | | reverse.get
* | | | |
* | f | | g |
* A --------> B A <-------- B
* </pre>
* }</pre>
*
* A {@link PIso} is also a valid {@link Getter}, {@link Fold}, {@link PLens}, {@link PPrism}, {@link POptional},
* {@link PTraversal} and {@link PSetter}
Expand Down Expand Up @@ -552,10 +552,10 @@ public PIso<S, T, A, B> reverse() {
* create a {@link PIso} between any type and itself. id is the zero element of optics composition, for all optics o of type O
* (e.g. Lens, Iso, Prism, ...):
*
* <pre>
* <pre>{@code
* o composeIso Iso.id == o
* Iso.id composeO o == o
* </pre>
* }</pre>
*
* (replace composeO by composeLens, composeIso, composePrism, ...)
*/
Expand Down
Loading