Skip to content

Commit

Permalink
Fix cucumber-attic#309 - raises when I18n.get an invalid iso_code - J…
Browse files Browse the repository at this point in the history
…ava implementation
  • Loading branch information
abinoam committed Jun 16, 2014
1 parent 884d2ed commit e38fff3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions java/src/main/java/gherkin/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public I18n(String isoCode) {
this.keywords = new HashMap<String, List<String>>();

Map<String, String> keywordMap = I18N.get(isoCode);

if (keywordMap == null) {
throw new RuntimeException("Language not supported: \"" + isoCode + "\"");
}

for (Map.Entry<String, String> entry : keywordMap.entrySet()) {
List<String> keywordList = Arrays.asList(entry.getValue().split("\\|"));
if (STEP_KEYWORD_KEYS.contains(entry.getKey())) {
Expand Down

0 comments on commit e38fff3

Please sign in to comment.