diff options
Diffstat (limited to 'service/processor/src/test/resources')
12 files changed, 111 insertions, 9 deletions
diff --git a/service/processor/src/test/resources/META-INF/services/test.AnotherServiceMulti b/service/processor/src/test/resources/META-INF/services/test.AnotherServiceMulti deleted file mode 100644 index f6ef36ac..00000000 --- a/service/processor/src/test/resources/META-INF/services/test.AnotherServiceMulti +++ /dev/null @@ -1 +0,0 @@ -test.MultiServiceProvider diff --git a/service/processor/src/test/resources/META-INF/services/test.SomeServiceMulti b/service/processor/src/test/resources/META-INF/services/test.SomeServiceMulti deleted file mode 100644 index f6ef36ac..00000000 --- a/service/processor/src/test/resources/META-INF/services/test.SomeServiceMulti +++ /dev/null @@ -1 +0,0 @@ -test.MultiServiceProvider diff --git a/service/processor/src/test/resources/test/AnotherService.java b/service/processor/src/test/resources/test/AnotherService.java index c096c223..de80f06d 100644 --- a/service/processor/src/test/resources/test/AnotherService.java +++ b/service/processor/src/test/resources/test/AnotherService.java @@ -15,4 +15,4 @@ */ package test; -interface AnotherService { }
\ No newline at end of file +interface AnotherService {} diff --git a/service/processor/src/test/resources/test/AnotherServiceProvider.java b/service/processor/src/test/resources/test/AnotherServiceProvider.java index c5e5c117..2a023e43 100644 --- a/service/processor/src/test/resources/test/AnotherServiceProvider.java +++ b/service/processor/src/test/resources/test/AnotherServiceProvider.java @@ -18,4 +18,4 @@ package test; import com.google.auto.service.AutoService; @AutoService(AnotherService.class) -public class AnotherServiceProvider implements AnotherService { }
\ No newline at end of file +public class AnotherServiceProvider implements AnotherService {} diff --git a/service/processor/src/test/resources/test/Enclosing.java b/service/processor/src/test/resources/test/Enclosing.java index 26dd5852..24202a59 100644 --- a/service/processor/src/test/resources/test/Enclosing.java +++ b/service/processor/src/test/resources/test/Enclosing.java @@ -19,5 +19,5 @@ import com.google.auto.service.AutoService; public class Enclosing { @AutoService(SomeService.class) - public static class NestedSomeServiceProvider implements SomeService { } -}
\ No newline at end of file + public static class NestedSomeServiceProvider implements SomeService {} +} diff --git a/service/processor/src/test/resources/test/EnclosingGeneric.java b/service/processor/src/test/resources/test/EnclosingGeneric.java new file mode 100644 index 00000000..cddddacb --- /dev/null +++ b/service/processor/src/test/resources/test/EnclosingGeneric.java @@ -0,0 +1,31 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package test; + +import com.google.auto.service.AutoService; + +/** Test for suppressing warnings about raw types on nested {@code @AutoService} classes. */ +@SuppressWarnings("rawtypes") +public final class EnclosingGeneric { + /** + * This is technically a raw class reference, but should be suppressed by the + * {@code @SuppressWarnings} on the enclosing class. + */ + @AutoService(GenericService.class) + public class GenericServiceProvider<T> implements GenericService<T> {} + + private EnclosingGeneric() {} +} diff --git a/service/processor/src/test/resources/test/GenericService.java b/service/processor/src/test/resources/test/GenericService.java new file mode 100644 index 00000000..5ed13ffc --- /dev/null +++ b/service/processor/src/test/resources/test/GenericService.java @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package test; + +/** + * An interface with a type parameter, which by default will produce a warning with + * {@code @AutoService} if you compile with {@code -Averify=true}. + */ +public interface GenericService<T> {} diff --git a/service/processor/src/test/resources/test/GenericServiceProvider.java b/service/processor/src/test/resources/test/GenericServiceProvider.java new file mode 100644 index 00000000..84c5cba0 --- /dev/null +++ b/service/processor/src/test/resources/test/GenericServiceProvider.java @@ -0,0 +1,25 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package test; + +import com.google.auto.service.AutoService; + +/** + * An implementation of a service with a type parameter, which by default will produce a warning + * if you compile with {@code -Averify=true}. + */ +@AutoService(GenericService.class) +public class GenericServiceProvider<T> implements GenericService<T> {} diff --git a/service/processor/src/test/resources/test/GenericServiceProviderSuppressWarnings.java b/service/processor/src/test/resources/test/GenericServiceProviderSuppressWarnings.java new file mode 100644 index 00000000..eb285dad --- /dev/null +++ b/service/processor/src/test/resources/test/GenericServiceProviderSuppressWarnings.java @@ -0,0 +1,26 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package test; + +import com.google.auto.service.AutoService; + +/** + * An implementation of a service with a type parameter, which will not produce a warning even if + * compiled with {@code -Averify=true}, because of the {@code @SuppressWarnings}. + */ +@AutoService(GenericService.class) +@SuppressWarnings("rawtypes") +public class GenericServiceProviderSuppressWarnings<T> implements GenericService<T> {} diff --git a/service/processor/src/test/resources/test/SomeService.java b/service/processor/src/test/resources/test/SomeService.java index d29c4097..d81cac40 100644 --- a/service/processor/src/test/resources/test/SomeService.java +++ b/service/processor/src/test/resources/test/SomeService.java @@ -15,4 +15,4 @@ */ package test; -interface SomeService { }
\ No newline at end of file +interface SomeService {} diff --git a/service/processor/src/test/resources/test/SomeServiceProvider1.java b/service/processor/src/test/resources/test/SomeServiceProvider1.java index 008136be..fc2c843c 100644 --- a/service/processor/src/test/resources/test/SomeServiceProvider1.java +++ b/service/processor/src/test/resources/test/SomeServiceProvider1.java @@ -18,4 +18,4 @@ package test; import com.google.auto.service.AutoService; @AutoService(SomeService.class) -public class SomeServiceProvider1 implements SomeService { }
\ No newline at end of file +public class SomeServiceProvider1 implements SomeService {} diff --git a/service/processor/src/test/resources/test/SomeServiceProvider2.java b/service/processor/src/test/resources/test/SomeServiceProvider2.java index 5444996b..b7097d41 100644 --- a/service/processor/src/test/resources/test/SomeServiceProvider2.java +++ b/service/processor/src/test/resources/test/SomeServiceProvider2.java @@ -18,4 +18,4 @@ package test; import com.google.auto.service.AutoService; @AutoService(SomeService.class) -public class SomeServiceProvider2 implements SomeService { }
\ No newline at end of file +public class SomeServiceProvider2 implements SomeService {} |