Author: scabanovich
Date: 2012-05-04 15:20:35 -0400 (Fri, 04 May 2012)
New Revision: 40807
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
Log:
JBIDE-11301
https://issues.jboss.org/browse/JBIDE-11301
Method ParametedType.findParameter is made thread safe.
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2012-05-04
18:57:24 UTC (rev 40806)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2012-05-04
19:20:35 UTC (rev 40807)
@@ -278,8 +278,8 @@
void buildParameters() {
if(signaturesByName == null && type != null) {
- signaturesByName = new HashMap<String, String>();
- parametersBySignature = new HashMap<String, ParametedType>();
+ Map<String, String> sbn = new HashMap<String, String>();
+ Map<String, ParametedType> pbs = new HashMap<String, ParametedType>();
ITypeParameter[] ps = null;
try {
ps = type.getTypeParameters();
@@ -290,10 +290,12 @@
String paramName = ps[i].getElementName();
if(parameterTypes.size() > i) {
ParametedType p = parameterTypes.get(i);
- signaturesByName.put(paramName, p.getSignature());
- parametersBySignature.put(p.getSignature(), p);
+ sbn.put(paramName, p.getSignature());
+ pbs.put(p.getSignature(), p);
}
}
+ signaturesByName = sbn;
+ parametersBySignature = pbs;
}
}