Skip to content

Remove duplicate TypesWithUndefinedEquality#SPARSE_ARRAY entry#3110

Closed
rickie wants to merge 3 commits intogoogle:masterfrom
PicnicSupermarket:rossendrijver/object_undefined_equality
Closed

Remove duplicate TypesWithUndefinedEquality#SPARSE_ARRAY entry#3110
rickie wants to merge 3 commits intogoogle:masterfrom
PicnicSupermarket:rossendrijver/object_undefined_equality

Conversation

@rickie
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants