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 !!!