Author: hibou
Date: Sat Sep 12 18:11:43 2009
New Revision: 814219
URL: http://svn.apache.org/viewvc?rev=814219&view=rev
Log:
The gui wizard crash when adding a IvyDE Managed Dependencies library to a
.launch file's classpath (IVYDE-200)
Modified:
ant/ivy/ivyde/trunk/CHANGES.txt
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=814219&r1=814218&r2=814219&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Sat Sep 12 18:11:43 2009
@@ -11,6 +11,7 @@
- FIX: "Ivy Settings Path" Browse button results in an incorrectly formatted
URL (IVYDE-191) (thanks to Jon Schneider)
- FIX: Workspace Resolver Prevents Source Download (IVYDE-188) (thanks to
Phillip Webb)
- FIX: Resolve in Workspace fails to find projects under certain conditions
(IVYDE-186) (thanks to Adam Karl)
+- FIX: The gui wizard crash when adding a IvyDE Managed Dependencies library
to a .launch file's classpath (IVYDE-200)
version 2.0.0 final
==========================
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java?rev=814219&r1=814218&r2=814219&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
Sat Sep 12 18:11:43 2009
@@ -115,47 +115,60 @@
String error = null;
if (ivyFilePathText.getIvyFilePath().length() == 0) {
error = "Choose an ivy file";
- } else {
- String ivyFilePath = ivyFilePathText.getIvyFilePath();
- List selectedConfigurations =
confTableViewer.getSelectedConfigurations();
+ } else if (project != null) {
+ error = checkConf();
+ }
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
- // check that the chosen configuration doesn't already exist
- // the uniqueness is for xmlivyPath + conf
- List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
- .getIvyClasspathContainers(project);
- if (containers != null) {
- Iterator/* <IvyClasspathContainer> */itContainers =
containers.iterator();
- while (error == null && itContainers.hasNext()) {
- IvyClasspathContainer ivycp = (IvyClasspathContainer)
itContainers.next();
- IvyClasspathContainerConfiguration cpc = ivycp.getConf();
-
- // first check that this is not the one we are editing
- if (oldIvyFile != null &&
cpc.ivyXmlPath.equals(oldIvyFile) && oldConfs != null
- && oldConfs.size() == cpc.confs.size()
- && oldConfs.containsAll(cpc.confs)) {
- continue;
- }
+ /**
+ * Check that the chosen configuration doesn't already exist within the
current project
+ * <p>
+ * The uniqueness is for xmlivyPath + conf
+ *
+ * @return
+ */
+ private String checkConf() {
+ String error = null;
+
+ String ivyFilePath = ivyFilePathText.getIvyFilePath();
+ List selectedConfigurations =
confTableViewer.getSelectedConfigurations();
- if (cpc.ivyXmlPath.equals(ivyFilePath)) {
- if (selectedConfigurations.isEmpty()
- || selectedConfigurations.contains("*") ||
cpc.confs.isEmpty()
- || cpc.confs.contains("*")) {
- error = "A container already exists for the
selected conf of "
- + "the module descriptor";
- } else {
- ArrayList list = new ArrayList(cpc.confs);
- list.retainAll(selectedConfigurations);
- if (!list.isEmpty()) {
- error = "A container already exists for the
selected conf of "
- + "the module descriptor";
- }
- }
+ List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
+ .getIvyClasspathContainers(project);
+ if (containers == null) {
+ return null;
+ }
+
+ Iterator/* <IvyClasspathContainer> */itContainers =
containers.iterator();
+ while (error == null && itContainers.hasNext()) {
+ IvyClasspathContainer ivycp = (IvyClasspathContainer)
itContainers.next();
+ IvyClasspathContainerConfiguration cpc = ivycp.getConf();
+
+ // first check that this is not the one we are editing
+ if (oldIvyFile != null && cpc.ivyXmlPath.equals(oldIvyFile) &&
oldConfs != null
+ && oldConfs.size() == cpc.confs.size() &&
oldConfs.containsAll(cpc.confs)) {
+ continue;
+ }
+
+ if (cpc.ivyXmlPath.equals(ivyFilePath)) {
+ if (selectedConfigurations.isEmpty() ||
selectedConfigurations.contains("*")
+ || cpc.confs.isEmpty() || cpc.confs.contains("*")) {
+ error = "A container already exists for the selected conf
of "
+ + "the module descriptor";
+ } else {
+ ArrayList list = new ArrayList(cpc.confs);
+ list.retainAll(selectedConfigurations);
+ if (!list.isEmpty()) {
+ error = "A container already exists for the selected
conf of "
+ + "the module descriptor";
}
}
}
}
- setErrorMessage(error);
- setPageComplete(error == null);
+
+ return error;
}
void checkIvyXmlPath() {