Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#355 AbstractTypeAwareCheck doesn't work with types from typeparm

release_4.0
closed
5
2012-10-10
2005-08-01
Oleg Sukhodolsky
No

AbstractTypeAwareCheck doesn't work with types from
type parameters.

public class TestGenerics <E extends="" Exception,="" RE="" extends="" RuntimeException="">
{
/*
* @throws E in some cases

/
public void method1() throws E
{
}

/**
 * @throws RE in some cases
 */
public void method2() throws RE
{
}

/**
 * @throws E in some cases
 * @throws RE in other cases
 */
public void method3() throws E, RE
{
}

/**
 * @throws RE in some cases
 * @throws NPE in some other cases
 */
public <NPE extends NullPointerException> void

method4() throws NPE, RE
{
}

public class InnerClass <RuntimeException extends

ClassCastException>
{
/*
* @throws E in some case
* @throws RE in some other cases

/
public void method1() throws RuntimeException, RE
{
}
}
}

Discussion

  • Logged In: YES
    user_id=746148

    Here is what I have committed to cvs for 4.0 (beta 5) (diffs
    attached):
    Some pretty big refactoring for typeaware checks performed.
    Also added handling for type params. Current handling algorithm
    has some preconditions and restriction, but it works for
    most cases
    (not sure I've covered all situation when type param will
    have name
    of real exception, but I do not think it is critical for now :)

    Also, I've added column number for JavadocTag (mainly to be
    able use
    ClassInfo for it). So, JavadocTypeCheck also affected.

     
  • changes I committed to cvs

     
    Attachments
  • Oliver Burn
    Oliver Burn
    2005-08-05

    Logged In: YES
    user_id=218824

    nice work