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

refactor: Common static analysis issues #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public OrganizationRepository(String path, String origin, String branch) {
this.origin = origin;
this.path = path;
this.branch = branch;
if (origin.equals("*") && path.equals("*") && branch.equals("*")) {
if ("*".equals(origin) && "*".equals(path) && "*".equals(branch)) {
throw new IllegalArgumentException("Cannot have a repository with origin=* and branch=* and path=* as this would match all repositories");
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/moderne/organizations/types/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Dashboard that = (Dashboard) o;
return java.util.Objects.equals(upgradesAndMigrations, that.upgradesAndMigrations) &&
java.util.Objects.equals(visualizations, that.visualizations) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DashboardRecipe that = (DashboardRecipe) o;
return java.util.Objects.equals(id, that.id) &&
java.util.Objects.equals(options, that.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DashboardVisualization that = (DashboardVisualization) o;
return java.util.Objects.equals(recipe, that.recipe) &&
java.util.Objects.equals(id, that.id) &&
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/moderne/organizations/types/DevCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DevCenter that = (DevCenter) o;
return java.util.Objects.equals(upgradesAndMigrations, that.upgradesAndMigrations) &&
java.util.Objects.equals(visualizations, that.visualizations) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DevCenterRecipe that = (DevCenterRecipe) o;
return java.util.Objects.equals(recipeId, that.recipeId) &&
java.util.Objects.equals(options, that.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DevCenterRecipeCard that = (DevCenterRecipeCard) o;
return java.util.Objects.equals(title, that.title) &&
java.util.Objects.equals(measures, that.measures) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DevCenterVisualizationCard that = (DevCenterVisualizationCard) o;
return java.util.Objects.equals(visualizationId, that.visualizationId) &&
java.util.Objects.equals(visualizationOptions, that.visualizationOptions);
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/moderne/organizations/types/Measure.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Measure that = (Measure) o;
return java.util.Objects.equals(name, that.name) &&
java.util.Objects.equals(recipe, that.recipe);
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/moderne/organizations/types/Option.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public String toString() {

@Override
public boolean equals(java.lang.Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Option that = (Option) o;
return java.util.Objects.equals(name, that.name) &&
java.util.Objects.equals(value, that.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Organization that = (Organization) o;
return java.util.Objects.equals(id, that.id) &&
java.util.Objects.equals(name, that.name) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RepositoryInput that = (RepositoryInput) o;
return java.util.Objects.equals(path, that.path) &&
java.util.Objects.equals(origin, that.origin) &&
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/moderne/organizations/types/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
User that = (User) o;
return java.util.Objects.equals(email, that.email);
}
Expand Down
Loading