Skip to content

Commit

Permalink
Refactor StorageUnitNodeMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 27, 2023
1 parent 0c38b28 commit 2fdab36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public final class StorageUnitNodeMapper {

private final StorageNode storageNode;

private final String catalog;

private final String url;

private final String catalog;

public StorageUnitNodeMapper(final String name, final StorageNode storageNode, final String url) {
this(name, storageNode, null, url);
this(name, storageNode, url, null);
}

@Override
Expand All @@ -51,7 +51,7 @@ public boolean equals(final Object obj) {
}

private boolean isSameCatalog(final StorageUnitNodeMapper mapper) {
return null != catalog && catalog.equalsIgnoreCase(mapper.getCatalog());
return null == catalog && null == mapper.getCatalog() || null != catalog && catalog.equalsIgnoreCase(mapper.getCatalog());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static String generateStorageNodeName(final String hostname, final int p

private static StorageUnitNodeMapper createStorageUnitNodeMapper(final StorageNode storageNode, final String storageUnitName, final String url, final boolean isInstanceConnectionAvailable) {
return isInstanceConnectionAvailable
? new StorageUnitNodeMapper(storageUnitName, storageNode, new StandardJdbcUrlParser().parse(url).getDatabase(), url)
? new StorageUnitNodeMapper(storageUnitName, storageNode, url, new StandardJdbcUrlParser().parse(url).getDatabase())
: new StorageUnitNodeMapper(storageUnitName, storageNode, url);
}

Expand Down

0 comments on commit 2fdab36

Please sign in to comment.