commit | b48441776bb1eefe120dd4de5711e50209f46917 | [log] [tgz] |
---|---|---|
author | spishak <spishak@google.com> | Wed Jul 08 08:50:55 2020 -0700 |
committer | kevinb9n <kevinb@google.com> | Wed Jul 08 15:13:27 2020 -0700 |
tree | 608f05b3ad736d258c62603af3dbc136b24108f4 | |
parent | d9d66ad60b4a09f74b7a9822fb347a1dbedf28f4 [diff] |
Stop the LazyInit annotation from getting shaded by Maven, so that AutoValue can find it on the classpath. The @LazyInit annotation is added if it's found on the classpath (https://github.com/google/auto/blob/da84ef1fae38f2d72901c2b95674271e89600f28/value/src/main/java/com/google/auto/value/extension/memoized/processor/MemoizeExtension.java#L577) but shading rewrites the package at https://github.com/google/auto/blob/da84ef1fae38f2d72901c2b95674271e89600f28/value/src/main/java/com/google/auto/value/extension/memoized/processor/MemoizeExtension.java#L104 from "com.google.errorprone.annotations.concurrent" to "autovalue.shaded.com.google$.errorprone.annotations.$concurrent" (you can verify this by disassembling the bytecode for MemoizeExtension.class in the release JAR). This means that even with the Error Prone annotations on the classpath, it won't be able to find the LazyInit annotation. Splitting up the package with a call to String#concat means Maven will no longer rewrite it, so AutoValue will be able to find the LazyInit annotation on the classpath if it's there. Fixes https://github.com/google/auto/issues/427 RELNOTES=Stop the LazyInit annotation from getting shaded by Maven, so that AutoValue can find it on the classpath. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=320196133
A collection of source code generators for Java.
Java is full of code that is mechanical, repetitive, typically untested and sometimes the source of subtle bugs. Sounds like a job for robots!
The Auto subprojects are a collection of code generators that automate those types of tasks. They create the code you would have written, but without the bugs.
Save time. Save code. Save sanity.
AutoFactory - JSR-330-compatible factories
AutoService - Provider-configuration files for ServiceLoader
AutoValue - Immutable value-type code generation for Java 7+.
Common - Helper utilities for writing annotation processors.
Copyright 2013 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.