Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #21 from dcoraboeuf/jenkins-32331-bottleneck
JENKINS-32331 Removed bottleneck synchronisation
  • Loading branch information
slide committed Apr 11, 2016
2 parents c28636e + 8033996 commit 68e4779
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -24,7 +24,6 @@
package org.jenkinsci.plugins.tokenmacro;

import com.google.common.collect.ListMultimap;
import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.TaskListener;
import org.apache.commons.beanutils.ConvertUtils;
Expand All @@ -37,9 +36,9 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
Expand Down Expand Up @@ -93,15 +92,15 @@ private interface Setter {
private synchronized void buildMap() {
if (setters!=null) return;

setters = new HashMap<String, Setter>();
setters = new ConcurrentHashMap<String, Setter>();
for (final Field f : getClass().getFields()) {
final Parameter p = f.getAnnotation(Parameter.class);
if (p !=null) {
String name = f.getName();
if (StringUtils.isNotEmpty(p.alias())) {
name = p.alias();
}

setters.put(name,new Setter() {
public Class<?> getType() {
return f.getType();
Expand Down Expand Up @@ -133,7 +132,7 @@ public boolean required() {
if (name.startsWith("set")) {
name = Introspector.decapitalize(name.substring(3));
}

if (StringUtils.isNotEmpty(p.alias())) {
name = p.alias();
}
Expand Down Expand Up @@ -162,7 +161,7 @@ public boolean required() {
}

@Override
public synchronized String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName, Map<String, String> arguments, ListMultimap<String, String> argumentMultimap) throws MacroEvaluationException, IOException, InterruptedException {
public String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName, Map<String, String> arguments, ListMultimap<String, String> argumentMultimap) throws MacroEvaluationException, IOException, InterruptedException {
try {
DataBoundTokenMacro copy = getClass().newInstance();

Expand Down

0 comments on commit 68e4779

Please sign in to comment.