diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java index 43b1c04c21..bc4463aad0 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java @@ -32,9 +32,13 @@ private ImmutableListMultimapTemplates() {} /** * Prefer {@link ImmutableListMultimap#builder()} over the associated constructor on constructions * that produce a less-specific type. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? static final class ImmutableListMultimapBuilder { @BeforeTemplate ImmutableMultimap.Builder before() { @@ -46,7 +50,7 @@ ImmutableMultimap.Builder before() { @AfterTemplate ImmutableListMultimap.Builder after() { - return ImmutableListMultimap.builder(); + return ImmutableListMultimap.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java index c6f6c3bbc1..c8193a18d7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListTemplates.java @@ -26,9 +26,15 @@ final class ImmutableListTemplates { private ImmutableListTemplates() {} - /** Prefer {@link ImmutableList#builder()} over the associated constructor. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? + /** + * Prefer {@link ImmutableList#builder()} over the associated constructor. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. + */ static final class ImmutableListBuilder { @BeforeTemplate ImmutableList.Builder before() { @@ -37,7 +43,7 @@ ImmutableList.Builder before() { @AfterTemplate ImmutableList.Builder after() { - return ImmutableList.builder(); + return ImmutableList.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java index 03f0690988..0cda4d44d7 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMapTemplates.java @@ -25,9 +25,15 @@ final class ImmutableMapTemplates { private ImmutableMapTemplates() {} - /** Prefer {@link ImmutableMap#builder()} over the associated constructor. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? + /** + * Prefer {@link ImmutableMap#builder()} over the associated constructor. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. + */ static final class ImmutableMapBuilder { @BeforeTemplate ImmutableMap.Builder before() { @@ -36,7 +42,7 @@ ImmutableMap.Builder before() { @AfterTemplate ImmutableMap.Builder after() { - return ImmutableMap.builder(); + return ImmutableMap.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java index 4f7aa4aa92..3231e37bbf 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableMultisetTemplates.java @@ -20,9 +20,15 @@ final class ImmutableMultisetTemplates { private ImmutableMultisetTemplates() {} - /** Prefer {@link ImmutableMultiset#builder()} over the associated constructor. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? + /** + * Prefer {@link ImmutableMultiset#builder()} over the associated constructor. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. + */ static final class ImmutableMultisetBuilder { @BeforeTemplate ImmutableMultiset.Builder before() { @@ -31,7 +37,7 @@ ImmutableMultiset.Builder before() { @AfterTemplate ImmutableMultiset.Builder after() { - return ImmutableMultiset.builder(); + return ImmutableMultiset.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java index d851cbaeb8..e13b2b4271 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java @@ -26,9 +26,15 @@ final class ImmutableSetMultimapTemplates { private ImmutableSetMultimapTemplates() {} - /** Prefer {@link ImmutableSetMultimap#builder()} over the associated constructor. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? + /** + * Prefer {@link ImmutableSetMultimap#builder()} over the associated constructor. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. + */ static final class ImmutableSetMultimapBuilder { @BeforeTemplate ImmutableSetMultimap.Builder before() { @@ -37,7 +43,7 @@ ImmutableSetMultimap.Builder before() { @AfterTemplate ImmutableSetMultimap.Builder after() { - return ImmutableSetMultimap.builder(); + return ImmutableSetMultimap.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java index 077bddf428..9da3f24172 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetTemplates.java @@ -24,9 +24,15 @@ final class ImmutableSetTemplates { private ImmutableSetTemplates() {} - /** Prefer {@link ImmutableSet#builder()} over the associated constructor. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? + /** + * Prefer {@link ImmutableSet#builder()} over the associated constructor. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. + */ static final class ImmutableSetBuilder { @BeforeTemplate ImmutableSet.Builder before() { @@ -35,7 +41,7 @@ ImmutableSet.Builder before() { @AfterTemplate ImmutableSet.Builder after() { - return ImmutableSet.builder(); + return ImmutableSet.builder(); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java index f112dcb551..1d42311e3d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSortedMapTemplates.java @@ -34,9 +34,13 @@ ImmutableSortedMap.Builder after(Comparator cmp) { /** * Prefer {@link ImmutableSortedMap#naturalOrder()} over the alternative that requires explicitly * providing the {@link Comparator}. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? static final class ImmutableSortedMapNaturalOrderBuilder, V> { @BeforeTemplate ImmutableSortedMap.Builder before() { @@ -45,16 +49,20 @@ ImmutableSortedMap.Builder before() { @AfterTemplate ImmutableSortedMap.Builder after() { - return ImmutableSortedMap.naturalOrder(); + return ImmutableSortedMap.naturalOrder(); } } /** * Prefer {@link ImmutableSortedMap#reverseOrder()} over the alternative that requires explicitly * providing the {@link Comparator}. + * + *

Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. + * Without using the fork, the expression in the `@AfterTemplate` can result in non-compilable + * code. + * + *

See: https://github.com/google/error-prone/pull/2706. */ - // XXX: This drops generic type information, sometimes leading to non-compilable code. Anything - // we can do about that? static final class ImmutableSortedMapReverseOrderBuilder, V> { @BeforeTemplate ImmutableSortedMap.Builder before() { @@ -63,7 +71,7 @@ ImmutableSortedMap.Builder before() { @AfterTemplate ImmutableSortedMap.Builder after() { - return ImmutableSortedMap.reverseOrder(); + return ImmutableSortedMap.reverseOrder(); } }