eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
157 stars 124 forks source link

Compilation problem when a class has a @deprecated comment #2853

Open RoiSoleil opened 3 weeks ago

RoiSoleil commented 3 weeks ago

Lets assume this project :

image

Class AAA

package com;

import test.AAnnotation;

/**
 * @deprecated
 */
@AAnnotation
public abstract class AAA<T> {

}

Class BBB

package com;

public class BBB extends AAA<Integer> {

}

Class AAnnotation

package test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.ExtensionContext;

import test.AAnnotation.AExtension;

@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@ExtendWith(AExtension.class)
public @interface AAnnotation {

  public static final class AExtension implements BeforeAllCallback {

    @Override
    public void beforeAll(ExtensionContext arg0) throws Exception {
    }

  }
}

With this configuration, on a Project > Clean > Full build, i get a 'Type mismatch: cannot convert from Class to Class<? extends Extension>[]'

If i remove de @deprecated on class AAA, everything is good.

jukzi commented 3 weeks ago

please add the stacktrace from the error view

RoiSoleil commented 3 weeks ago

There is no error in "Error Log" view and in "Problems" view, i get this :

image