@@ -0,0 +1,2853 @@
+package com.fasterxml.jackson.failing;%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Aimport com.fasterxml.jackson.annotation.*;%0Aimport com.fasterxml.jackson.databind.*;%0A%0A@SuppressWarnings(%22serial%22)%0Apublic class TestTypeWithJsonValue466 extends BaseMapTest%0A%7B%0A    // The following is required for the testDecimalMetadata test case. That case fails.%0A    @JsonTypeName(value = %22decimalValue%22)%0A    public static class DecimalValue %7B%0A        private java.math.BigDecimal value;%0A        public DecimalValue()%7B this.value = java.math.BigDecimal.valueOf( 1234.4321 ); %7D%0A     %0A        @JsonValue%0A        public java.math.BigDecimal getValue()%7B return value; %7D%0A    %7D%0A%0A    @JsonPropertyOrder(%7B%22key%22,%22value%22%7D)%0A    public static class DecimalEntry %7B%0A    public DecimalEntry()%7B%7D%0A        public String getKey()%7B return %22num%22; %7D%0A         %0A        @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.EXTERNAL_PROPERTY)%0A        public DecimalValue getValue()%7B%0A            return new DecimalValue();%0A        %7D%0A    %7D%0A%0A    public static class DecimalMetadata %7B%0A        @JsonProperty(%22metadata%22)%0A        public List%3CDecimalEntry%3E getMetadata() %7B%0A            return new ArrayList%3CDecimalEntry%3E() %7B %7Badd(new DecimalEntry());%7D %7D;%0A        %7D%0A    %7D%0A%0A    // The following succeeds. It's included for comparison%0A    @JsonTypeName(value = %22doubleValue%22)%0A    public static class DoubleValue %7B%0A        private Double value;%0A        public DoubleValue()%7B this.value = 1234.4321; %7D%0A         %0A        @JsonValue%0A        public Double getValue()%7B return value; %7D%0A    %7D%0A%0A    @JsonPropertyOrder(%7B%22key%22,%22value%22%7D)%0A    public static class DoubleEntry %7B%0A        public DoubleEntry()%7B%7D%0A        public String getKey()%7B return %22num%22; %7D%0A     %0A        @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.EXTERNAL_PROPERTY)%0A        public DoubleValue getValue()%7B return new DoubleValue(); %7D%0A    %7D%0A%0A    public static class DoubleMetadata %7B%0A        @JsonProperty(%22metadata%22)%0A        public List%3CDoubleEntry%3E getMetadata() %7B%0A            return new ArrayList%3CDoubleEntry%3E() %7B %7Badd(new DoubleEntry());%7D %7D;%0A        %7D%0A    %7D%0A%0A    final ObjectMapper MAPPER = new ObjectMapper();%0A    %0A    public void testDoubleMetadata() throws IOException %7B%0A        DoubleMetadata doub = new DoubleMetadata();%0A        String expected = %22%7B%5C%22metadata%5C%22:%5B%7B%5C%22key%5C%22:%5C%22num%5C%22,%5C%22value%5C%22:1234.4321,%5C%22@type%5C%22:%5C%22doubleValue%5C%22%7D%5D%7D%22;%0A        String json = MAPPER.writeValueAsString(doub);%0A        assertEquals(%22Serialized json not equivalent%22, expected, json);%0A    %7D%0A%0A    public void testDecimalMetadata() throws IOException%7B%0A        DecimalMetadata dec = new DecimalMetadata();%0A        String expected = %22%7B%5C%22metadata%5C%22:%5B%7B%5C%22key%5C%22:%5C%22num%5C%22,%5C%22value%5C%22:1234.4321,%5C%22@type%5C%22:%5C%22decimalValue%5C%22%7D%5D%7D%22;%0A        String json = MAPPER.writeValueAsString(dec);%0A        assertEquals(%22Serialized json not equivalent%22, expected, json);%0A    %7D%0A%7D%0A

Add a unit test to reproduce #466