Skip to content

Commit

Permalink
[prefixcommons#2] replace String.format with simple concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
jnguyenx committed Mar 8, 2017
1 parent a732e1b commit c58ea8d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/prefixcommons/CurieUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ public Optional<String> getCurie(String iri) {
return Optional.empty();
} else {
String curiePrefix = curieMap.inverse().get(prefix);
return Optional
.of(String.format("%s:%s", curiePrefix, iri.substring(prefix.length(), iri.length())));
return Optional.of(curiePrefix + ":" + iri.substring(prefix.length(), iri.length()));
}
}

Expand All @@ -104,8 +103,7 @@ public Optional<String> getIri(String curie) {
if (parts.length > 1) {
String prefix = parts[0];
if (curieMap.containsKey(prefix)) {
return Optional.of(
String.format("%s%s", curieMap.get(prefix), curie.substring(curie.indexOf(':') + 1)));
return Optional.of(curieMap.get(prefix) + curie.substring(curie.indexOf(':') + 1));
}
}
return Optional.empty();
Expand Down

0 comments on commit c58ea8d

Please sign in to comment.