Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-issuemaster opened this issue Jan 17, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jan 17, 2015

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:

  • #17301 No way to retrieve the actual target type using beanName ("depends on")
  • #20761 Document common use cases for @Order vs @Priority vs @DependsOn

Referenced from: commits 1aec6a6

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 19, 2015

Stéphane Nicoll commented

This is fixed and will be available in the next 4.2.0.BUILD-SNAPSHOT. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.