Skip to content

BCStyle default lookup table is wrong #1797

Description

@marsom

BCStyle contains

DefaultLookUp.put("jurisdictionCountry", JURISDICTION_C);
DefaultLookUp.put("jurisdictionState", JURISDICTION_ST);
DefaultLookUp.put("jurisdictionLocality", JURISDICTION_L);

but this is wrong, the keys has to be lowercase jurisdictioncountry instead of jurisdictionCountry,...

I tested a simple fix in my application with

    public static class MyStyle extends BCStyle {

        public MyStyle() {
            super();
            this.defaultLookUp.put("jurisdictioncountry", JURISDICTION_C);
            this.defaultLookUp.put("jurisdictionstate", JURISDICTION_ST);
            this.defaultLookUp.put("jurisdictionlocality", JURISDICTION_L);
        }

    }

whcih works perfectly. all ohter default lookups are lowercase only the 3 jurisitcations are not.

the probm is the IETFUtils decodeAttrName whcih seams to not work wrok if the lookup contains upcates chars

public class ScratchTest {

    @Test
    void myStyle() { // this works
        var name1 = new MyStyle().attrNameToOID("jurisdictionstate");
        Assertions.assertNotNull(name1);
        var name2 = new MyStyle().attrNameToOID("jurisdictionState");
        Assertions.assertNotNull(name2);
    }

    @Test // this fails 
    void bcStyle() {
        var name = BCStyle.INSTANCE.attrNameToOID("jurisdictionstate");

        Assertions.assertNotNull(name);
    }

    public static class MyStyle extends BCStyle {

        public MyStyle() {
            super();
            this.defaultLookUp.put("jurisdictioncountry", JURISDICTION_C);
            this.defaultLookUp.put("jurisdictionstate", JURISDICTION_ST);
            this.defaultLookUp.put("jurisdictionlocality", JURISDICTION_L);
        }

    }
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions