Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-60997] Work around BEANUTILS-509 #110

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class TagScript implements Script {
/** The Log to which logging calls will be made. */
private static final Log log = LogFactory.getLog(TagScript.class);

/** Used to serialize access to {@link org.apache.commons.beanutils.WrapDynaClass#CLASSLOADER_CACHE}, which is not thread-safe */
private static final Object lock = new Object();

/** The attribute expressions that are created */
protected Map<String,ExpressionAttribute> attributes = new HashMap<String,ExpressionAttribute>();
Expand Down Expand Up @@ -239,7 +241,11 @@ public void run(JellyContext context, XMLOutput output) throws JellyTagException
}
else {
// treat the tag as a bean
DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
DynaBean dynaBean;
// Work around BEANUTILS-509
synchronized (lock) {
dynaBean = new ConvertingWrapDynaBean(tag);
}
for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = (Map.Entry) iter.next();
String name = (String) entry.getKey();
Expand Down