thread safe patch for classfile.Utility and generic.Type

"Alex" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <00e701c34dfc$29c99540$0201a8c0@maison>
Hi

I encountered problems in a multithreaded instrumentation layer I made over BCEL. As soon as I have to thread it generates bad method signatures. I read the following post  http://www.mail-archive.com/[email protected]/msg00201.html, which warns about this issue.

Indeed there is in classfile.Utility and generic.Type class only static methods, but several methods are getting/setting the same static field consumed_chars in several loops. When using BCEL in app server environment, you always have concurent classloading in different classloader (proxy, skel / stub, CMP impl ...).

Those 2 classes are really bad designed. Such an issue requires a minimal effort to provide a patch and ensure thread safety.
I have made a patch based on a ThreadLocal wrapping of consumed_chars. I would really appreciate if it could be incorporated in next release. Let me know if/where/how I have to provide a diff for it instead of packaging my own bcel-patch.jar with my app.

Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.