[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-dev
Subject:    Fwd: Re: Ivy trunk doesn't compile
From:       "Markus M. May" <mmay () gmx ! net>
Date:       2007-12-28 21:34:50
Message-ID: 20071228223450.g50di7z54osowwc4 () zeus ! private
[Download RAW message or body]

Hello,
I just created a small diff to fix this problem.

R,

Markus

Index: src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
===================================================================
---
src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java	(Revision
607324)
+++ src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java	(Arbeitskopie)
@@ -353,8 +353,28 @@
            return new Comparator() {
                // younger conflict resolving policy
                public int compare(Object o1, Object o2) {
-                Artifact a1 = (Artifact) o1;
-                Artifact a2 = (Artifact) o2;
+                Artifact a1 = null;
+                Artifact a2 = null;
+
+                try {
+                    a1 = (Artifact) o1;
+                    a2 = (Artifact) o2;
+                } catch (ClassCastException ccex) {
+                    Message.error("ClassCastException in
org.apache.ivy.core.retrieve.RetrieveEngine" + ccex.getMessage());
+                }
+
+		if ((a1 == null) && (a2 == null)) {
+                    return 0;
+                }
+
+		if ((a1 != null) && (a2 == null)) {
+                    return 1;
+                }
+
+		if ((a1 == null) && (a2 != null)) {
+		    return -1;
+                }
+
                    if
(a1.getPublicationDate().after(a2.getPublicationDate())) {
                        // a1 is after a2 <=> a1 is younger than a2 <=>
a1 wins the conflict battle
                        return +1;



----- Ende der weitergeleiteten Nachricht -----


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic