aboutsummaryrefslogtreecommitdiff
path: root/value/src/test/java/com/google
diff options
context:
space:
mode:
authoremcmanus <emcmanus@google.com>2019-12-30 12:16:53 -0800
committerNick Glorioso <nick@nickglorioso.com>2020-01-02 11:08:42 -0500
commite97d1f085274ee22b2744e278fec79a8ec570061 (patch)
tree6c4dbd17dd38ce66bc09828b7a0982d3709f65b6 /value/src/test/java/com/google
parent2e91aaf51930cd6c3b999edaac55462707cdac7f (diff)
downloadauto-e97d1f085274ee22b2744e278fec79a8ec570061.tar.gz
When checking builder setter parameters, use the final type. The final type is the type after type-variable substitution. Report this type in error messages, since it may not be obvious.
(See AutoValueNotEclipseTest for an example of the problem this is fixing.) Fix CompileWithEclipseTest so that it actually does exclude AutoValueNotEclipseTest.java from the compilation, as intended. Move the existing test within that file into AutoValueTest.java, since apparently the Eclipse bug it was provoking has been fixed. Add the test for the bug being fixed here into AutoValueNotEclipseTest.java, because it hits another Eclipse bug. Fixes https://github.com/google/auto/issues/802. RELNOTES=Fixed an issue with type checking of setter parameters in the presence of inheritance and generics. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=287580372
Diffstat (limited to 'value/src/test/java/com/google')
-rw-r--r--value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java b/value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java
index 724ea6b9..77390765 100644
--- a/value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java
+++ b/value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java
@@ -1599,7 +1599,7 @@ public class AutoValueCompilationTest {
.compile(javaFileObject);
assertThat(compilation)
.hadErrorContaining(
- "Parameter type of setter method should be "
+ "Parameter type java.lang.String of setter method should be "
+ "com.google.common.collect.ImmutableList<java.lang.String> to match getter "
+ "foo.bar.Baz.blam, or it should be a type that can be passed to "
+ "ImmutableList.copyOf")
@@ -1636,7 +1636,7 @@ public class AutoValueCompilationTest {
.compile(javaFileObject);
assertThat(compilation)
.hadErrorContaining(
- "Parameter type of setter method should be "
+ "Parameter type java.util.Collection<java.lang.Integer> of setter method should be "
+ "com.google.common.collect.ImmutableList<java.lang.String> to match getter "
+ "foo.bar.Baz.blam, or it should be a type that can be passed to "
+ "ImmutableList.copyOf to produce "