ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gin...@apache.org
Subject ant-ivyde git commit: Code cleanup (remove extraneous suppression etc)
Date Mon, 06 Nov 2017 08:16:35 GMT
Repository: ant-ivyde
Updated Branches:
  refs/heads/master 6ab8e4c1b -> 086cd237f


Code cleanup (remove extraneous suppression etc)

Project: http://git-wip-us.apache.org/repos/asf/ant-ivyde/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivyde/commit/086cd237
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivyde/tree/086cd237
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivyde/diff/086cd237

Branch: refs/heads/master
Commit: 086cd237f1b87aef09e83d0a4b5e6869d8233427
Parents: 6ab8e4c
Author: Gintas Grigelionis <gintas@apache.org>
Authored: Mon Nov 6 09:16:01 2017 +0100
Committer: Gintas Grigelionis <gintas@apache.org>
Committed: Mon Nov 6 09:16:01 2017 +0100

----------------------------------------------------------------------
 .../common/ivysettings/IvySettingsModel.java    |  2 +-
 .../internal/eclipse/resolve/IvyResolver.java   | 20 +++++++++-----------
 .../internal/eclipse/resolve/ResolveResult.java |  4 ++++
 .../ui/console/IvyConsolePageParticipant.java   |  2 +-
 .../eclipse/ui/core/IvyFileEditorInput.java     |  2 +-
 .../workspaceresolver/WorkspaceResolver.java    | 14 ++++----------
 6 files changed, 20 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/common/ivysettings/IvySettingsModel.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/common/ivysettings/IvySettingsModel.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/common/ivysettings/IvySettingsModel.java
index 7ed1af4..659476b 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/common/ivysettings/IvySettingsModel.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/common/ivysettings/IvySettingsModel.java
@@ -258,7 +258,7 @@ public class IvySettingsModel extends IvyModel {
                                     && m.getParameterTypes().length == 0
                                     && isSupportedChildType(m.getReturnType())) {
                                 String name = StringUtils
-                                .uncapitalize(m.getName().substring("create".length()));
+                                    .uncapitalize(m.getName().substring("create".length()));
                                 if (name.length() == 0) {
                                     continue;
                                 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
index 531289b..7b22989 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
@@ -242,7 +242,6 @@ public class IvyResolver {
         return result;
     }
 
-    @SuppressWarnings("unchecked")
     private ResolveResult doResolve(Ivy ivy, ModuleDescriptor md) throws ParseException,
             IOException {
         IvyDEMessage.debug("Doing a full resolve...");
@@ -262,22 +261,21 @@ public class IvyResolver {
 
         ResolveResult result = new ResolveResult(report);
 
-        ArtifactDownloadReport[] artifactReports = report.getArtifactsReports(null, false);
-
         Map<Artifact, ArtifactDownloadReport> workspaceArtifacts = IvyContext.getContext()
                 .get(WorkspaceResolver.IVYDE_WORKSPACE_ARTIFACT_REPORTS);
         if (workspaceArtifacts != null) {
-            // some artifact were 'forced' by the dependency declaration, whereas they should
be
-            // switch by the eclipse project reference
-            for (int i = 0; i < artifactReports.length; i++) {
-                ArtifactDownloadReport eclipseArtifactReport = workspaceArtifacts.get(artifactReports[i].getArtifact());
-                if (eclipseArtifactReport != null) {
-                    // let's switch.
-                    artifactReports[i] = eclipseArtifactReport;
+            // some artifacts were 'forced' by the dependency declaration, whereas they should
be
+            // changed to the eclipse project reference
+            for (ArtifactDownloadReport artifactReport : report.getArtifactsReports(null,
false)) {
+                ArtifactDownloadReport eclipseArtifactReport = workspaceArtifacts.get(artifactReport.getArtifact());
+                if (eclipseArtifactReport == null) {
+                    result.addArtifactReport(artifactReport);
+                } else {
+                    // let's change
+                    result.addArtifactReport(eclipseArtifactReport);
                 }
             }
         }
-        result.addArtifactReports(artifactReports);
 
         collectArtifactsByDependency(report, result);
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/ResolveResult.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/ResolveResult.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/ResolveResult.java
index 3305c78..f8c7133 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/ResolveResult.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/ResolveResult.java
@@ -100,6 +100,10 @@ public class ResolveResult {
         artifactReports.addAll(Arrays.asList(reports));
     }
 
+    void addArtifactReport(ArtifactDownloadReport report) {
+        artifactReports.add(report);
+    }
+
     void putArtifactsForDep(ModuleRevisionId resolvedId, Artifact[] allArtifacts) {
         artifactsByDependency.put(resolvedId, allArtifacts);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/console/IvyConsolePageParticipant.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/console/IvyConsolePageParticipant.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/console/IvyConsolePageParticipant.java
index 1afeefa..72cf310 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/console/IvyConsolePageParticipant.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/console/IvyConsolePageParticipant.java
@@ -45,7 +45,7 @@ public class IvyConsolePageParticipant implements IConsolePageParticipant
{
         filterLogAction = null;
     }
 
-    @SuppressWarnings({"rawtypes", "unchecked"})
+    @SuppressWarnings("rawtypes")
     public Object getAdapter(Class adapter) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/core/IvyFileEditorInput.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/core/IvyFileEditorInput.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/core/IvyFileEditorInput.java
index d08aa3b..78a6fad 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/core/IvyFileEditorInput.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/core/IvyFileEditorInput.java
@@ -59,7 +59,7 @@ public class IvyFileEditorInput implements IPathEditorInput, IStorageEditorInput
         return getClass().getName() + "(" + ivyFile.getFullPath() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
     }
 
-    @SuppressWarnings({"rawtypes", "unchecked"})
+    @SuppressWarnings("rawtypes")
     public Object getAdapter(Class adapter) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/086cd237/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/workspaceresolver/WorkspaceResolver.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/workspaceresolver/WorkspaceResolver.java
b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/workspaceresolver/WorkspaceResolver.java
index 9ff8674..7d17fd4 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/workspaceresolver/WorkspaceResolver.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/workspaceresolver/WorkspaceResolver.java
@@ -137,9 +137,7 @@ public class WorkspaceResolver extends AbstractResolver {
 
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
         IvyContext context = IvyContext.getContext();
-        @SuppressWarnings("unchecked")
-        Map<Artifact, Artifact> workspaceArtifacts = context
-                .get(IVYDE_WORKSPACE_ARTIFACTS);
+        Map<Artifact, Artifact> workspaceArtifacts = context.get(IVYDE_WORKSPACE_ARTIFACTS);
         Map<Artifact, ArtifactDownloadReport> workspaceReports = null;
         if (workspaceArtifacts != null) {
             workspaceReports = new HashMap<>();
@@ -304,15 +302,11 @@ public class WorkspaceResolver extends AbstractResolver {
                         // project
 
                         // we need the context which is used when downloading data, which
is the
-                        // parent
-                        // of the current one
-                        // so let's hack: popContext (the child), getContext (the parent),
setVar,
-                        // pushContext (child)
+                        // parent of the current one so let's hack: popContext (the child),
+                        // getContext (the parent), setVar, pushContext (child)
                         IvyContext currentContext = IvyContext.popContext();
                         IvyContext parentContext = IvyContext.getContext();
-                        @SuppressWarnings("unchecked")
-                        Map<Artifact, Artifact> workspaceArtifacts = parentContext
-                                .get(IVYDE_WORKSPACE_ARTIFACTS);
+                        Map<Artifact, Artifact> workspaceArtifacts = parentContext.get(IVYDE_WORKSPACE_ARTIFACTS);
                         if (workspaceArtifacts == null) {
                             workspaceArtifacts = new HashMap<>();
                             parentContext.set(IVYDE_WORKSPACE_ARTIFACTS, workspaceArtifacts);


Mime
View raw message