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

Remove duplicate TypesWithUndefinedEquality#SPARSE_ARRAY entry #3110

Conversation

rickie
Copy link
Contributor

@rickie rickie commented Apr 14, 2022

Type androidx.collection.SparseArrayCompat was listed twice.

While there, sort the enum elements and type names.

@@ -24,25 +24,21 @@

/** Enumerates types which have poorly-defined behaviour for equals. */
public enum TypesWithUndefinedEquality {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following (somewhat hacky, likely Linux-only) script verifies that this PR does not introduce additional changes:

#!/usr/bin/env bash

set -e -u -o pipefail

normalize() {
  local rev="${1}"

  git show "${rev}:core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java" \
    | grep -Pzo '(?<=LONG_SPARSE_ARRAY\()[^)]+' | grep -Pao '[\w.]+' | sort -u
  git show "${rev}:core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java" \
    | grep -Pzo '(?<=SPARSE_ARRAY\()[^)]+' | grep -Pao '[\w.]+' | sort -u
  git show "${rev}:core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java" \
    | grep -Po '[A-Z_]+\(' | sort -u
}

diff -u <(normalize master) <(normalize HEAD)

@@ -24,25 +24,21 @@

/** Enumerates types which have poorly-defined behaviour for equals. */
public enum TypesWithUndefinedEquality {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add java.lang.Object to the TypesWithUndefinedEquality enum?

@Stephan202 Stephan202 deleted the rossendrijver/object_undefined_equality branch April 24, 2022 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants