Skip to content

Commit

Permalink
Fix warnings of AndroidSdk.groovy
Browse files Browse the repository at this point in the history
1. Add necessary override for equals and hasCode implementations.
2. Make some methods static as they return the same content very
   invoking.

Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Oct 7, 2023
1 parent b0cd16f commit 29439ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions buildSrc/src/main/groovy/AndroidSdk.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class AndroidSdk implements Comparable<AndroidSdk> {
this.frameworkSdkBuildVersion = frameworkSdkBuildVersion
}

String getGroupId() {
static String getGroupId() {
return "org.robolectric"
}

String getArtifactId() {
static String getArtifactId() {
return "android-all"
}

String getPreinstrumentedArtifactId() {
static String getPreinstrumentedArtifactId() {
return "android-all-instrumented"
}

Expand Down Expand Up @@ -76,6 +76,7 @@ class AndroidSdk implements Comparable<AndroidSdk> {
return apiLevel - other.apiLevel
}

@Override
boolean equals(o) {
if (this.is(o)) return true
if (getClass() != o.class) return false
Expand All @@ -87,6 +88,7 @@ class AndroidSdk implements Comparable<AndroidSdk> {
return true
}

@Override
int hashCode() {
return apiLevel
}
Expand Down

0 comments on commit 29439ed

Please sign in to comment.