Skip to content

@Order should get detected in case of proxyTargetClass=false as well [SPR-12636] #17237

Closed
@spring-projects-issues

Description

@spring-projects-issues

Yanming Zhou opened SPR-12636 and commented

public interface UserService 
	public boolean exists(String username);
}
@Component
@Order(1)
public class UserService1 implements UserService {
	@Transactional
	public boolean exists(String username) {
		return false;
	}
}
@Component
@Order(2)
public class UserService2 implements UserService {
	public boolean exists(String username) {
		return false;
	}
}
@Autowired
private List<UserService> userServices;

userServices will be [userService1,userService2] when proxyTargetClass=true ,
[userService2,userService1] when proxyTargetClass=false.
If JDK proxy cannot obtain @Order, I suggest spring use proxyTargetClass=true as default.


Issue Links:

Referenced from: commits 1aec6a6

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions