Java: static factory method and thread safe
<p>I want to get an object by a static factory method, such as</p>

<pre><code>Person p = Person.fromName("Jack");

class Person {
    public static Person fromName(String name){
        return new Person(name);
    }
}
</code></pre>

<p>but fromName() method is not thread safe, (fromName() is just an example, this kind of method will occur error when it's running in my program) however, it's inefficient if synchronized this method because multiple threads should call this method concurrently. Is there any suggestion to fix it?</p>
