I am extending a library to do some work for me. Here is the code:
public static synchronized String decompile(String source, int flags,UintMap properties,Map<String,String> namesMap)
{
Decompiler.namesMap=namesMap;
String decompiled=decompile(source,flags,properties);
Decompiler.namesMap=null;
return decompiled;
}
The problem is that namesMap
is static variable. Is that thread safe or not? Because if this code runs concurently namesMap variable may change. What can I do for this?