I have a time-consuming operation,so I use Java1.8 asynchronous. Like this :
function getSomeThing(){
CompletableFuture<List<String>> list = CompletableFuture.supplyAsync(() ->{
getList(); //task some seconds;
});
}
function getList(){
ApplicationUser loggedUser = JiraAuthenticationContext.getLoggedInUser();
}
My question is that the above loggerUser will be null, but I can get it if I don't user CompletableFuture, I don't know why ??
If someone can help , thank you so much !!!
Hello @caiyunCheng ,
Please notice that this might not be the best place to get help on development related questions. So, in case of no reply, I'd advise to refer to the resources listed in https://developer.atlassian.com/resources.
Specifically:
Cheers,
Dario
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.