changeset 46215:d5e1d3d5e004

8179930: jdk.test.lib.artifacts.ArtifactResolver::resolve should return Map instead of HashMap Reviewed-by: mseledtsov, gtriantafill, vlivanov
author iignatyev
date Thu, 11 May 2017 16:35:01 -0700
parents b6b866fd21b2
children 191008ef907f
files test/lib/jdk/test/lib/artifacts/ArtifactResolver.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java	Fri May 05 17:48:43 2017 +0200
+++ b/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java	Thu May 11 16:35:01 2017 -0700
@@ -26,9 +26,10 @@
 import java.io.FileNotFoundException;
 import java.nio.file.Path;
 import java.util.HashMap;
+import java.util.Map;
 
 public class ArtifactResolver {
-    public static HashMap<String, Path> resolve(Class klass) throws FileNotFoundException {
+    public static Map<String, Path> resolve(Class<?> klass) throws FileNotFoundException {
         ArtifactManager manager = new DefaultArtifactManager();
         try {
             String managerName = System.getProperty("jdk.test.lib.artifacts.artifactmanager");
@@ -41,12 +42,12 @@
             // If we end up here, we'll use the DefaultArtifactManager
         }
 
-        ArtifactContainer artifactContainer = (ArtifactContainer) klass.getAnnotation(ArtifactContainer.class);
+        ArtifactContainer artifactContainer = klass.getAnnotation(ArtifactContainer.class);
         HashMap<String, Path> locations = new HashMap<>();
         Artifact[] artifacts;
 
         if (artifactContainer == null) {
-            artifacts = new Artifact[]{(Artifact) klass.getAnnotation(Artifact.class)};
+            artifacts = new Artifact[]{klass.getAnnotation(Artifact.class)};
         } else {
             artifacts = artifactContainer.value();
         }