diff options
author | Cedric Beust <cedric@beust.com> | 2015-07-10 07:57:13 -0700 |
---|---|---|
committer | Cedric Beust <cedric@beust.com> | 2015-07-10 07:57:13 -0700 |
commit | f644d1ed53f10a35f6d87ef22540a487a422d4be (patch) | |
tree | 5a6145b04e4e89f555cbbd5832543d223f803fac /src/main/java/org/testng/internal | |
parent | a1996e3eeaecf60fbb3195ffb0d025a93eb0bec7 (diff) | |
download | testng-f644d1ed53f10a35f6d87ef22540a487a422d4be.tar.gz |
Use ConcurrentHashMap.
Diffstat (limited to 'src/main/java/org/testng/internal')
-rwxr-xr-x | src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java b/src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java index 5b3fc309..fc8cd02f 100755 --- a/src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java +++ b/src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java @@ -3,8 +3,8 @@ package org.testng.internal.annotations; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.util.Collections; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.testng.IAnnotationTransformer; import org.testng.IAnnotationTransformer2; @@ -37,7 +37,6 @@ import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import org.testng.annotations.TestInstance; -import org.testng.collections.Maps; import org.testng.internal.collections.Pair; /** @@ -49,8 +48,9 @@ import org.testng.internal.collections.Pair; public class JDK15AnnotationFinder implements IAnnotationFinder { private JDK15TagFactory m_tagFactory = new JDK15TagFactory(); private Map<Class<? extends IAnnotation>, Class<? extends Annotation>> m_annotationMap = - Collections.synchronizedMap(Maps.<Class<? extends IAnnotation>, - Class<? extends Annotation>>newHashMap()); + new ConcurrentHashMap<>(); + private Map<Pair<Annotation, ?>, IAnnotation> m_annotations = new ConcurrentHashMap<>(); + private IAnnotationTransformer m_transformer = null; @SuppressWarnings({"deprecation"}) @@ -191,8 +191,6 @@ public class JDK15AnnotationFinder implements IAnnotationFinder { new Pair<>(annotation, cons)); } - private Map<Pair<Annotation, ?>, IAnnotation> m_annotations = Maps.newHashMap(); - private <A extends IAnnotation> A findAnnotation(Class cls, Annotation a, Class<A> annotationClass, Class<?> testClass, Constructor<?> testConstructor, Method testMethod, Pair<Annotation, ?> p) { |