Is there a bug in @Inject in the spring 3.2.2 framework reference documentation?

The documentation contains the following paragraph.

"As with @Autowired, you can use @Inject at the level level, the level at the method level level, and the constructor-level level of the class."

If I don't have an error, I know that the @Inject annotation can be used at the field level, method level and constructor level, cannot be used at the class level.

Source code of input annotation:

@Target({ METHOD, CONSTRUCTOR, FIELD })
@Retention(RUNTIME)
@Documented
public @interface Inject {}

It's true?

+5
source share
1 answer

For me, they are almost equivalent, @Injectis part of the CDI , introduced since Java EE 6 and @Autowiredpart of Spring.

@Autowired , @Inject:

@Target(value={CONSTRUCTOR,FIELD,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface Autowired

, Spring documentation 5.11.1, @Autowired .

.

+2