Skip to content

Commit

Permalink
Move #323 back under failing since it's still unsolvable, unlike othe…
Browse files Browse the repository at this point in the history
…r bogus conflicts
  • Loading branch information
cowtowncoder committed Apr 15, 2014
1 parent 6809c86 commit 7541cba
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ protected void _addCreatorParam(AnnotatedParameter param)
// shouldn't need to worry about @JsonIgnore, since creators only added
// if so annotated

/* 14-Apr-2014, tatu: Not ideal, since we should not start with explicit name, ever;
* but with current set up we also can not just use empty name.
* This will cause failure for [#323] until we figure out a better way to handle
* the problem; possibly by creating a placeholder container for "anonymous"
* creator parameters.
*/
POJOPropertyBuilder prop = expl ? _property(pn) : _property(impl);
prop.addCtor(param, pn, expl, true, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ protected static class Getters1B
public int getValue() { return value+1; }
}

// [Issue#323]
static class Bean323 {
private int a;

public Bean323 (@JsonProperty("a") final int a ) {
this.a = a;
}

@JsonProperty("b")
private int getA () {
return a;
}
}

/*
/**********************************************************
/* Test methods
Expand Down Expand Up @@ -83,11 +69,4 @@ public void testRegularAndIsGetter() throws Exception
assertEquals(1, mapper.readValue("{\"value\":1}", Getters1A.class).value);
assertEquals(2, mapper.readValue("{\"value\":2}", Getters1B.class).value);
}

// [Issue#323]
public void testCreatorPropRename() throws Exception
{
Bean323 input = new Bean323(7);
assertEquals("{\"b\":7}", objectWriter().writeValueAsString(input));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.fasterxml.jackson.failing;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.*;

/**
* Unit tests verifying handling of potential and actual
* conflicts, regarding property handling.
*/
public class TestPropertyConflict323 extends BaseMapTest
{
// [Issue#323]
static class Bean323 {
private int a;

public Bean323 (@JsonProperty("a") final int a ) {
this.a = a;
}

@JsonProperty("b")
private int getA () {
return a;
}
}

/*
/**********************************************************
/* Test methods
/**********************************************************
*/

// [Issue#323]
public void testCreatorPropRename() throws Exception
{
Bean323 input = new Bean323(7);
assertEquals("{\"b\":7}", objectWriter().writeValueAsString(input));
}
}

0 comments on commit 7541cba

Please sign in to comment.