j8unit-team / j8unit

Enhancement for JUnit4 to take advantage of Java 8
4 stars 2 forks source link

Remove unecessary "@SuppressWarnings("rawtypes")" in "*ClassTests" and "*ClassTest" types #15

Closed ghostcity closed 7 years ago

ghostcity commented 7 years ago

Even if a type is of RAW nature, its according *ClassTests and *ClassTest do not require a @SuppressWarnings("rawtypes") annotation.

Remove those existing unecessary annotations and adopt the according generator code.

Examples of an immediate RAW type are:

@SuppressWarnings("rawtypes")
@FunctionalInterface
@Category(J8UnitRepository.class)
public abstract interface BeanContextClassTests<SUT extends BeanContext>
extends BeanContextChildClassTests<SUT>, CollectionClassTests<SUT>, DesignModeClassTests<SUT>, VisibilityClassTests<SUT> {
  [...]

and

@SuppressWarnings("rawtypes")
@RunWith(J8Unit4.class)
public class BeanContextClassTest
implements BeanContextClassTests<BeanContext> {@SuppressWarnings("rawtypes")
@FunctionalInterface
@Category(J8UnitRepository.class)
public abstract interface BeanContextSupportClassTests<SUT extends BeanContextSupport>
extends BeanContextClassTests<SUT>, PropertyChangeListenerClassTests<SUT>, VetoableChangeListenerClassTests<SUT>, BeanContextChildSupportClassTests<SUT> {

  [...]

whereas the immediate RAW type is:

@SuppressWarnings("rawtypes")
public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility
  [...]

Similar, indirect RAW types (see #8) do not require a @SuppressWarnings("rawtypes") annotation:

@SuppressWarnings("rawtypes")
@FunctionalInterface
@Category(J8UnitRepository.class)
public abstract interface BeanContextSupportClassTests<SUT extends BeanContextSupport>
extends BeanContextClassTests<SUT>, PropertyChangeListenerClassTests<SUT>, VetoableChangeListenerClassTests<SUT>, BeanContextChildSupportClassTests<SUT> {
  [...]

and

@SuppressWarnings("rawtypes")
@RunWith(J8Unit4.class)
public class BeanContextSupportClassTest
implements BeanContextSupportClassTests<BeanContextSupport> {
  [...]
ghostcity commented 7 years ago

Enveloped @SuppressWarnings values are not repeated anymore. Further, *CassTest(s) of ModusOperandi#RAW_CLASS types do not declare "rawtypes" anymore (because the feel like ModusOperandi#NON_GENERIC_CLASS).