Proposed solution to #487 (International keywords build problems) #499

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants
Owner

aslakhellesoy commented Apr 7, 2013

This proposed fix for #487 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:

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

Using this scheme, source file names 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:

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.

Owner

aslakhellesoy commented Apr 7, 2013

/cc @avokin @klikh - please let me know if this affects IDEA.

Doh! I didn't rebuild after adding that line :-) Thanks for fixing it.

Contributor

avokin commented Apr 10, 2013

I'll take a look, thank you for info

Member

dkowis commented Jun 9, 2013

Been two months without comment. I don't think having to manually update the stuff in IDEA is a big deal.

I'm fine with merging this as it is. @avokin, @klikh dissenting opinions?

@ghost ghost assigned aslakhellesoy Jun 10, 2013

Owner

aslakhellesoy commented Jun 10, 2013

I'm not sure this actually fixes anything. I prefer to do some more testing on a mac before this is merged. I've assigned this issue to myself.

@mpkorstanje mpkorstanje deleted the issue-487-multibyte-class-names branch Jul 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment