I just encountered this "bug", but I'm not sure if this is intended: Code:
public static Object someMethod(){
assert SwingUtilities.isEventDispatchThread();
return new Object();
}
public static void main(String[] args){
SwingUtilities.invokeLater(() -> someMethod().toString());//First Example
SwingUtilities.invokeLater(someMethod()::toString);//Second Example
}
In the first example someMethod
is being executed on the swing Thread, but in the second example it is not, although it should be in my opinion.
Is this a bug or is this intended?