QDox

No support for wildcards in generics

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.6
  • Component/s: Parser
  • Labels:
    None
  • Number of attachments :
    0

Description

Qdox lacks the ability to parse Generics with wildcards. I added the following test to GenericsTest.java, and it fails.

public void testShouldUnderstandWildcard() {
String source = "" +
"public class Bar { private Class<? extends Date> klass; }";
builder.addSource(new StringReader(source));
assertEquals("Bar", builder.getClassByName("Bar").getName());
}

Activity

Hide
Marc Schneider added a comment -

more problems with generics:
I get ParseExceptions if I parse the following (legal) source snippets:

private Map<String, Object> m_env = new HashMap<String, Object>();

public <T extends Object> T retrieve(Class<T> klass, Object key) {
return x;
}

Show
Marc Schneider added a comment - more problems with generics: I get ParseExceptions if I parse the following (legal) source snippets: private Map<String, Object> m_env = new HashMap<String, Object>(); public <T extends Object> T retrieve(Class<T> klass, Object key) { return x; }
Hide
Mike Williams added a comment -

Marc: method type-parameters are separate to wildcard type-arguments ... I've split it into a new issue (QDOX-68).

Show
Mike Williams added a comment - Marc: method type-parameters are separate to wildcard type-arguments ... I've split it into a new issue (QDOX-68).
Hide
Mike Williams added a comment -

Wildcards are working, now.

Show
Mike Williams added a comment - Wildcards are working, now.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: