cucumber/cucumber-jvm — pull request #499 by aslakhellesoy (2013-04-07 07:42:53+00:00)
Title: Proposed solution to #487

This proposed fix for #387 changes generated java annotations from top level classes to inner classes. This is to work around difficulties with java source files with names containing multibyte characters on OS X.

Prior to this PR, the Swedish translation for `Then` would be a top level class defined in `Så.java`, under the package `cucumber.api.java.sv`.

This PR changes each translation to be defined in a single source file, in this case `sv.java` defined under the package `cucumber.api.java`. Each translation contains an inner class for each keyword.

This should remain source compatible with previous releases. The following import statement should work both before and after:

```java
import cucumber.api.java.sv.Så;
```

Using this scheme, source files will only ever contain ASCII characters, so the file name problems should go away.

One minor drawback is that typing `@Så` in IDEA and then using a hotkey to insert the desired import will write out this code:

```java
import cucumber.api.java.sv;

public class Stepdefs {
@sv.Så("test")
public void testEncoding() {

}
}
```

Although this compiles just fine it doesn't look too good, so you might want to change it to:

```
import cucumber.api.java.sv.*;

public class Stepdefs {
@Så("test")
public void testEncoding() {

}
}
```

Please try this out and let me know how it works for you.