-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Config migration sonarlint issues (#1910)
- Loading branch information
Showing
20 changed files
with
232 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
ors-engine/src/main/java/org/heigit/ors/config/utils/NonEmptyMapFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package org.heigit.ors.config.utils; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
public class NonEmptyMapFilter { | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other == null) return true; | ||
try { | ||
Method isEmptyMethod = other.getClass().getDeclaredMethod("isEmpty"); | ||
if (isEmptyMethod.invoke(other).equals(true)) { | ||
return true; | ||
} | ||
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { | ||
// Ignore | ||
if (other instanceof Map) { | ||
return ((Map<?, ?>) other).isEmpty(); | ||
} | ||
return false; | ||
} | ||
|
||
public int hashCode() { | ||
return Objects.hash(this.getClass()); | ||
} | ||
} |
Oops, something went wrong.