commit | 1bfc3b537042a240b9aedfdc0337cac1664fbc43 | [log] [tgz] |
---|---|---|
author | Éamonn McManus <emcmanus@google.com> | Mon Jan 11 10:50:09 2021 -0800 |
committer | Google Java Core Libraries <java-core-libraries-team+copybara@google.com> | Mon Jan 11 10:50:44 2021 -0800 |
tree | 4df95e56ca5f4b212dc15beba63d0ca7b0c37611 | |
parent | f26d2df1d57fcb85d6cf63b2060fd9244ff44fa4 [diff] |
If a getter is `getOAuth()`, allow the setter to be `oAuth(T)`. Normally we follow the JavaBeans specification, which has special rules for properties that begin with more than one capital, like the `OAuth` implied by `getOAuth()` here. That means that the unprefixed setter should be spelled `OAuth(T)`. That's obviously obscure and unsettling, so we add logic to allow the setter to be either `OAuth(T)` or `oAuth(T)` in this case. We already have logic for the opposite case, where the getter is `oAuth()` and the setter is `setOAuth(T)`. Fixes https://github.com/google/auto/issues/565. RELNOTES=Avoid surprising behaviour when getters are prefixed and setters are not, and a property name begins with two capital letters. PiperOrigin-RevId: 351188819
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.