roaster icon indicating copy to clipboard operation
roaster copied to clipboard

org.jboss.forge.roaster.model.impl.JavaSourceImpl is not thread safe

Open DavideRossi opened this issue 2 years ago • 0 comments

This is the issue: private static List<WildcardImportResolver> resolvers; is used like a poor man's singleton so, when concurrent calls stat hitting getImportResolvers, sooner or later a concurrent modification exception is thrown. The simpler solutions is to wrap the body of getImportResolvers in synchronized (JavaSourceImpl.class) {} block but I'm sure there are also more elegant fixes.

DavideRossi avatar Sep 29 '22 22:09 DavideRossi