Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concurrent access to a utility static method

We have a scenario in which several threads call a static method like the following one:

public static boolean isEmpty(final String s) {
    return s == null || s.length() < 1;
}

Could it cause a problem of inconsistence if 100 threads call it?

like image 362
GAS Avatar asked Jul 06 '11 08:07

GAS


1 Answers

The method does not access any shared state. Thus, no -- it will not cause any problems.

like image 176
01es Avatar answered Oct 24 '22 07:10

01es