@@ -0,0 +1,2623 @@
+package com.fasterxml.jackson.failing;%0A%0Aimport java.io.*;%0A%0Aimport com.fasterxml.jackson.annotation.*;%0A%0Aimport com.fasterxml.jackson.databind.*;%0Aimport com.fasterxml.jackson.databind.annotation.*;%0Aimport com.fasterxml.jackson.databind.jsontype.TypeIdResolver;%0Aimport com.fasterxml.jackson.databind.type.SimpleType;%0A%0Apublic class TestMartinsExternalId extends BaseMapTest%0A%7B%0A    public void testExternal() throws IOException%0A    %7B%0A        ObjectMapper mapper = new ObjectMapper();%0A        Parent parent = mapper.readValue(%22%7B%5C%22type%5C%22:%5C%22a%5C%22,%5C%22child%5C%22:%7B%5C%22value%5C%22:%5C%22foo%5C%22%7D%7D%22, Parent.class);%0A        assertNotNull(parent);%0A    %7D%0A     %0A    @JsonTypeIdResolver(Resolver.class)%0A    public static class Parent%0A    %7B%0A        @JsonProperty%0A        public String type;%0A%0A        @JsonTypeIdResolver(Resolver.class)%0A        @JsonProperty%0A        @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include= JsonTypeInfo.As.EXTERNAL_PROPERTY, property=%22type%22%0A            , visible = true%0A        )%0A        public Child child;%0A    %7D%0A%0A    public static interface Child %7B %7D%0A%0A    @JsonTypeIdResolver(Resolver.class)%0A    public static class Child1 implements Child%0A    %7B%0A        @JsonProperty%0A        public String value;%0A        %7D%0A         %0A        public static class Child2%0A        implements Child%0A        %7B%0A        @JsonProperty%0A        public String value;%0A    %7D%0A     %0A     %0A    public static class Resolver implements TypeIdResolver%0A    %7B%0A        public Resolver() %7B %7D%0A        %0A        @Override%0A        public void init(JavaType baseType) %7B %7D%0A     %0A        @Override%0A        public String idFromValue(Object value)%0A        %7B%0A        if (value instanceof Child1) %7B%0A        return %22a%22;%0A        %7D%0A        else if (value instanceof Child2) %7B%0A        return %22b%22;%0A        %7D%0A         %0A        throw new IllegalArgumentException();%0A        %7D%0A     %0A        @Override%0A        public String idFromValueAndType(Object value, Class%3C?%3E suggestedType)%0A        %7B%0A            return idFromValue(value);%0A        %7D%0A         %0A        @Override%0A        public String idFromBaseType()%0A        %7B%0A            throw new UnsupportedOperationException();%0A        %7D%0A             %0A        @Override%0A        public JavaType typeFromId(String id)%0A        %7B%0A            if (id.equals(%22a%22)) %7B%0A                return SimpleType.construct(Child1.class);%0A            %7D%0A            else if (id.equals(%22b%22)) %7B%0A                return SimpleType.construct(Child2.class);%0A            %7D%0A            throw new IllegalArgumentException();%0A        %7D%0A     %0A        @Override%0A        public JsonTypeInfo.Id getMechanism()%0A        %7B%0A            return JsonTypeInfo.Id.CUSTOM;%0A        %7D%0A    %7D%0A%7D%0A

add an extra (now failing) unit test for external type id, visible=true