Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 8 follow-up changes #2747

Merged
merged 4 commits into from
Sep 24, 2024

Commits on Sep 23, 2024

  1. Java 8 follow-up changes

    Marcono1234 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    8807db1 View commit details
    Browse the repository at this point in the history
  2. Fix Error Prone warnings

    Note that for the `final` variable warnings, it seems some of those variables
    were made `final` intentionally, without the compiler requiring it.
    But for consistency I removed the `final` from them as well.
    Marcono1234 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    15a5eb0 View commit details
    Browse the repository at this point in the history
  3. Disable UnnecessaryAnonymousClass Error Prone pattern

    Is disabled by default as well.
    
    It seems what this pattern does is suggest to replace anonymous classes
    stored in constants with a corresponding method (with the intention that
    the developer then uses a method reference to that method). But it even
    does this when the anonymous class implements a custom functional type,
    and not a generic type such as `Function`.
    
    For example it suggested to replace
    ```
    private static final FieldNamingStrategy CUSTOM_FIELD_NAMING_STRATEGY =
      new FieldNamingStrategy() {
        @OverRide
        public String translateName(Field f) {
          return "foo";
        }
      };
    ```
    
    with a method
    ```
    private static String customFieldNamingStrategy(Field f) {
      return "foo";
    }
    ```
    
    Which is probably not that helpful, and might not actually increase
    readability.
    Marcono1234 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    feb2ee1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9cad067 View commit details
    Browse the repository at this point in the history