Skip to content

Commit

Permalink
Fix #36
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Dec 29, 2015
1 parent ccb1d82 commit 9b16ddc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void add(String prefix, String uri) {
}
}
} else {
namespaces.put(prefix, uri);
if (uri != null) {
namespaces.put(prefix, uri);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,16 @@ public void addDuplicatePrefixNullUri() {

assertNull(impl.getNamespaceURI(prefix));
}

@Test
public void addDuplicatePrefixNullUriFirst() {
String prefix = "p2";
String uri = "aadsad2";

impl.add(prefix, null);
assertNull(impl.getNamespaceURI(prefix));

impl.add(prefix, uri);
assertEquals(uri, impl.getNamespaceURI(prefix));
}
}

0 comments on commit 9b16ddc

Please sign in to comment.