ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r632733 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java
Date Sun, 02 Mar 2008 10:15:01 GMT
Author: xavier
Date: Sun Mar  2 02:14:40 2008
New Revision: 632733

URL: http://svn.apache.org/viewvc?rev=632733&view=rev
Log:
fix style: extract methods to reduce method length

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java?rev=632733&r1=632732&r2=632733&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java Sun Mar
 2 02:14:40 2008
@@ -171,6 +171,29 @@
                         + lurl + "/>");
             }
         }
+        outputMetadataArtifact(out, dep);
+        outputEvictionInformation(report, out, dep);
+        outputCallers(report, out, dep);
+        outputArtifacts(report, out, dep);
+        out.println("\t\t\t</revision>");
+    }
+
+    private void outputEvictionInformation(ConfigurationResolveReport report, PrintWriter
out,
+            IvyNode dep) {
+        if (dep.isEvicted(report.getConfiguration())) {
+            EvictionData ed = dep.getEvictedData(report.getConfiguration());
+            Collection selected = ed.getSelected();
+            if (selected != null) {
+                for (Iterator it3 = selected.iterator(); it3.hasNext();) {
+                    IvyNode sel = (IvyNode) it3.next();
+                    out.println("\t\t\t\t<evicted-by rev=\""
+                            + XMLHelper.escape(sel.getResolvedId().getRevision()) + "\"/>");
+                }
+            }
+        }
+    }
+
+    private void outputMetadataArtifact(PrintWriter out, IvyNode dep) {
         if (dep.getModuleRevision() != null) {
             MetadataArtifactDownloadReport madr = dep.getModuleRevision().getReport();
             out.print("\t\t\t\t<metadata-artifact");
@@ -198,17 +221,9 @@
             out.println("/>");
             
         }
-        if (dep.isEvicted(report.getConfiguration())) {
-            EvictionData ed = dep.getEvictedData(report.getConfiguration());
-            Collection selected = ed.getSelected();
-            if (selected != null) {
-                for (Iterator it3 = selected.iterator(); it3.hasNext();) {
-                    IvyNode sel = (IvyNode) it3.next();
-                    out.println("\t\t\t\t<evicted-by rev=\""
-                            + XMLHelper.escape(sel.getResolvedId().getRevision()) + "\"/>");
-                }
-            }
-        }
+    }
+
+    private void outputCallers(ConfigurationResolveReport report, PrintWriter out, IvyNode
dep) {
         Caller[] callers = dep.getCallers(report.getConfiguration());
         for (int i = 0; i < callers.length; i++) {
             StringBuffer callerDetails = new StringBuffer();
@@ -247,6 +262,10 @@
                         callers[i].getModuleRevisionId().getRevision()) + "\""
                     + callerDetails + "/>");
         }
+    }
+
+    private void outputArtifacts(ConfigurationResolveReport report, PrintWriter out, IvyNode
dep) {
+        Map extraAttributes;
         ArtifactDownloadReport[] adr = report.getDownloadReports(dep.getResolvedId());
         out.println("\t\t\t\t<artifacts>");
         for (int i = 0; i < adr.length; i++) {
@@ -284,7 +303,6 @@
             }
         }
         out.println("\t\t\t\t</artifacts>");
-        out.println("\t\t\t</revision>");
     }
 
     private String toString(String[] strs) {



Mime
View raw message