#277 Error in TreeWalker (Java 5)

release_4.0
closed
ANT Task (45)
5
2012-10-10
2005-01-07
haertigm
No

The following simple class:


package de.nupis.test;

public class TestClass<E> {
private E value = null;
public TestClass(){
}
public TestClass(E value){
this.value = value;
}
public E getValue() {
return this.value;
}
public void setValue(E value) {
this.value = value;
}
}

produces the following output:

"<file name="D:\\SPARTACUS3\\de.nupis.test\\TestClass.java">
<error line="12" column="3" severity="error" message="Folgende Ausnahme ist aufgetreten - expecting EOF, found '}'" source="com.puppycrawl.tools.checkstyle.TreeWalker"/>
</file>"

Ist this a problem with generics in Java 1.5? I did'nt
found the bug elsewhere on this site, but found many
internet sites with checkstyle reports having the same
problem.

Discussion

  • Logged In: YES
    user_id=1022106

    Checkstyle 4 will fully support Java 5 syntax. Prior
    versions (including 3.5 that you've indicated in the bug
    report) have no Java 5 support.

    You may have more luck getting the latest source from CVS,
    building and using that version instead.

    Checkstyle from CVS MAIN branch can succesfully parse the
    supplied source.

     
  • Logged In: YES
    user_id=746148

    Perhaps we should close this bug.
    Thoughs?

     
  • Logged In: YES
    user_id=746148

    I'm closing the bug as "out of date" since the problem has
    be fixed already.