Blob Blame History Raw
--- org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java
+++ org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java
@@ -239,9 +239,9 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
       }
 
       synchronized(getIndexLock(repository)) {
-        ArtifactInfo artifactInfo = getIndexer().identify(query, Collections.singleton(getIndexingContext(repository)));
-        if(artifactInfo != null) {
-          return getIndexedArtifactFile(artifactInfo);
+        Collection<ArtifactInfo> artifactInfo = getIndexer().identify(query, Collections.singleton(getIndexingContext(repository)));
+        if(!artifactInfo.isEmpty()) {
+	    return getIndexedArtifactFile((ArtifactInfo)artifactInfo.toArray()[0]);
         }
       }
     } catch(Exception ex) {
@@ -282,8 +282,8 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
 
   public IndexedArtifactFile identify(File file) throws CoreException {
     try {
-      ArtifactInfo artifactInfo = getIndexer().identify(file);
-      return artifactInfo == null ? null : getIndexedArtifactFile(artifactInfo);
+      Collection<ArtifactInfo> artifactInfo = getIndexer().identify(file);
+      return artifactInfo.isEmpty() ? null : getIndexedArtifactFile((ArtifactInfo)artifactInfo.toArray()[0]);
     } catch(IOException ex) {
       throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
           Messages.NexusIndexManager_error_search, ex));
@@ -1276,7 +1276,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
 
       Query q = getIndexer().constructQuery(MAVEN.SHA1, encode(digest), SearchType.EXACT);
 
-      return getIndexer().identify(q, contexts);
+      return getIndexer().identify(q, contexts).isEmpty() ? null : (ArtifactInfo)getIndexer().identify(q, contexts).toArray()[0];
 
     } catch(NoSuchAlgorithmException ex) {
       throw new IOException("Unable to calculate digest");