Skip to content

Commit

Permalink
Fix #1194
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 12, 2016
1 parent d32563c commit cb67177
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.7-SNAPSHOT</version>
<version>2.6.6.1-SNAPSHOT</version>
<name>jackson-databind</name>
<packaging>bundle</packaging>
<description>General data-binding functionality for Jackson: works on core streaming API</description>
Expand Down
4 changes: 4 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Project: jackson-databind
=== Releases ===
------------------------------------------------------------------------

2.6.6.1 (not yet released)

#1194: Incorrect signature for generic type via `JavaType.getGenericSignature

2.6.6 (05-Apr-2016)

#1088: NPE possibility in SimpleMixinResolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public StringBuilder getGenericSignature(StringBuilder sb)
_classSignature(_class, sb, false);
sb.append('<');
sb = _referencedType.getGenericSignature(sb);
sb.append(';');
sb.append(">;");
return sb;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;

import com.fasterxml.jackson.databind.BaseMapTest;
import com.fasterxml.jackson.databind.JavaType;
Expand All @@ -20,14 +21,47 @@ static class SubType extends BaseType { }
static enum MyEnum { A, B; }
static enum MyEnum2 {
A(1), B(2);

private MyEnum2(int value) { }
}

// [databind#728]
static class Issue728 {
public <C extends CharSequence> C method(C input) { return null; }
}

public interface Generic1195 {
public AtomicReference<String> getGeneric();
public List<String> getList();
public Map<String,String> getMap();
}

public void testGenericSignature1195() throws Exception
{
TypeFactory tf = TypeFactory.defaultInstance();
Method m;
JavaType t;

m = Generic1195.class.getMethod("getList");
t = tf.constructType(m.getGenericReturnType());
assertEquals("Ljava/util/List<Ljava/lang/String;>;", t.getGenericSignature());

m = Generic1195.class.getMethod("getMap");
t = tf.constructType(m.getGenericReturnType());
assertEquals("Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;",
t.getGenericSignature());

m = Generic1195.class.getMethod("getGeneric");
t = tf.constructType(m.getGenericReturnType());
assertEquals("Ljava/util/concurrent/atomic/AtomicReference<Ljava/lang/String;>;", t.getGenericSignature());
}

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

public void testLocalType728() throws Exception
{
TypeFactory tf = TypeFactory.defaultInstance();
Expand All @@ -49,12 +83,6 @@ public void testLocalType728() throws Exception
assertEquals(CharSequence.class, t.getRawClass());
}

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

public void testSimpleClass()
{
TypeFactory tf = TypeFactory.defaultInstance();
Expand Down

0 comments on commit cb67177

Please sign in to comment.