Skip to content

Commit

Permalink
QNameUtil#getKey(Map, QName) renamed to getByQName (used only in repo)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 29, 2020
1 parent 02fdef9 commit 3dd3979
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -94,9 +94,15 @@ public static QName qualifyIfNeeded(QName name, String defaultNamespace) {
return hasNamespace(name)
? name
: new QName(defaultNamespace, name.getLocalPart());

}

public static <V> V getKey(@NotNull Map<QName, V> map, @NotNull QName key) {
/**
* Finds value in the map by QName key using {@link #match(QName, QName)}.
* Fails if multiple matches are found.
* Returns {@code null} if no match is found.
*/
public static <V> V getByQName(@NotNull Map<QName, V> map, @NotNull QName key) {
if (hasNamespace(key)) {
return map.get(key);
}
Expand Down
Expand Up @@ -155,7 +155,7 @@ public String debugDump(int indent) {
public JpaEntityDefinition findEntityDefinition(QName typeName) {
Validate.notNull(typeName, "Type name must not be null.");

JpaEntityDefinition def = QNameUtil.getKey(DEFINITIONS, typeName);
JpaEntityDefinition def = QNameUtil.getByQName(DEFINITIONS, typeName);
if (def == null) {
throw new IllegalStateException("Type " + typeName + " couldn't be found in type registry");
}
Expand Down

0 comments on commit 3dd3979

Please sign in to comment.