commit | c84e6affef24a0d390b5fb7415c3b3ebd246fac3 | [log] [tgz] |
---|---|---|
author | Éamonn McManus <emcmanus@google.com> | Tue May 25 15:41:13 2021 -0700 |
committer | Google Java Core Libraries <java-libraries-firehose+copybara@google.com> | Tue May 25 15:41:42 2021 -0700 |
tree | 7a6508aa2daff7ef44f98f0a9571cd68aa768ddb | |
parent | 123cc71251e1b1ed5a4e4f95c7e7224c8c7fb1b5 [diff] |
Add the [JSpecify](http://jspecify.org) `@Nullable` to `equals(Object)` if it is available. More exactly, we will generate `equals(@Nullable Object)` if we know a `@Nullable` annotation. We know a `@Nullable` annotation if one is mentioned in a method parameter or return type of the `@AutoValue` [etc] class; this was already true before this CL. What's new is that we also know a `@Nullable` annotation if one is available in the compilation environment and matches the one we expect. That in turn is `@org.jspecify.nullness.Nullable` by default, but can be overridden or suppressed with a new `-A` option. We also insert `@Nullable` for `@AutoAnnotation` implementations, though currently we don't have logic to find one that might be referenced from methods. RELNOTES=n/a PiperOrigin-RevId: 375811563
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.