The constructor of com.sun.tools.javac.code.Flags.Flag uses toLowerCase without specifying locale, which may lead to problems when Flag.PUBLIC is converted to lower case on (e.g.) Turkish locale and then used.
This leads to the following problem. Consider this source code:
---
public class LocaleTest { }
---
Run javac as:
---
$ javac -J-Duser.region=TR -J-Duser.language=tr -printsource -d target LocaleTest.java
---
The outcome will be:
---
publ\u0131c class LocaleTest {
publ\u0131c LocaleTest() {
super();
}
}
---
Which is unexpected, expected is:
---
public class LocaleTest {
public LocaleTest() {
super();
}
}
---