#399 using wildcard extends object array causes an error

SVN_Head
closed
Lars Kühne
5
2012-10-10
2005-12-30
No

The following class fails to parse:
public class GenericTest {
public static void foo(Set<? extends GenericTest[]>
set) {
set.put(new GenericTest[5]);
}
}

With this set of checks:

<module name="Checker">
<module name="TreeWalker">
<module name="RedundantImport"/>
</module>
</module>

This is the result:

checkstyle:
Running Checkstyle 4.1 on 1 files
areLtsAndGtsBalanced(currentLtLevel)
C:\temp\t\Long.java:4:5: Got an exception - expecting
EOF, found '}'

Discussion

  • java class that causes a problem

     
    Attachments
  • Logged In: YES
    user_id=10176

    Wanted to check out the code first, but figured I'd just
    file it since I haven't had the chance to do so.

     
  • checkstyles used

     
    Attachments
  • Lars Kühne
    Lars Kühne
    2007-03-25

    Logged In: YES
    user_id=401384
    Originator: NO

    Patch 1422247 has been applied, fixed.