File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
java/src/main/java/io/cucumber/gherkin Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
public final class GherkinDialectProvider {
9
9
10
- private final String defaultDialectName ;
10
+ private final GherkinDialect defaultDialect ;
11
11
12
12
public GherkinDialectProvider (String defaultDialectName ) {
13
- this .defaultDialectName = requireNonNull (defaultDialectName );
13
+ this .defaultDialect = getDialect (defaultDialectName )
14
+ .orElseThrow (() -> new ParserException .NoSuchLanguageException (defaultDialectName , null ));
14
15
}
15
16
16
17
public GherkinDialectProvider () {
17
18
this ("en" );
18
19
}
19
20
20
21
public GherkinDialect getDefaultDialect () {
21
- return getDialect ( defaultDialectName ). orElseThrow (() -> new ParserException . NoSuchLanguageException ( defaultDialectName , null )) ;
22
+ return defaultDialect ;
22
23
}
23
24
24
25
public Optional <GherkinDialect > getDialect (String language ) {
You can’t perform that action at this time.
0 commit comments