-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Use Locale.ROOT when transforming case of identifiers
Several plugins use lowercased string representations of enum values. Doing this without an explicit locale results in the default locale being used. This may lead to surprising errors. Fixes: cucumber/cucumber-java-skeleton#33
- Loading branch information
1 parent
e99e102
commit 9346da2
Showing
5 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package cucumber.api; | ||
|
||
import static java.util.Locale.ROOT; | ||
|
||
public enum HookType { | ||
Before, After, BeforeStep, AfterStep; | ||
|
||
@Override | ||
public String toString() { | ||
return super.toString().toLowerCase(); | ||
return super.toString().toLowerCase(ROOT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
junit/src/main/java/cucumber/runtime/junit/NotificationLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package cucumber.runtime.junit; | ||
|
||
import static java.util.Locale.ROOT; | ||
|
||
public enum NotificationLevel { | ||
SCENARIO, | ||
STEP; | ||
|
||
String lowerCaseName() { | ||
return name().toLowerCase(); | ||
return name().toLowerCase(ROOT); | ||
} | ||
} |