ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1088255 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse: cpcontainer/ handlers/ resolve/ ui/menu/ ui/views/
Date Sun, 03 Apr 2011 11:46:12 GMT
Author: hibou
Date: Sun Apr  3 11:46:12 2011
New Revision: 1088255

URL: http://svn.apache.org/viewvc?rev=1088255&view=rev
Log:
IVYDE-237
 - fix some NPE induced by the previous commit

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/handlers/AbstractIvyDEHandler.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ResolveRequest.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/IvyMenuContributionItem.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
Sun Apr  3 11:46:12 2011
@@ -44,8 +44,7 @@ import org.eclipse.swt.widgets.Display;
  */
 public class IvyClasspathContainer implements IClasspathContainer {
 
-    public static final String CONTAINER_ID
-        = "org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER";
+    public static final String CONTAINER_ID = "org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER";
 
     private IClasspathEntry[] classpathEntries;
 
@@ -156,6 +155,9 @@ public class IvyClasspathContainer imple
     }
 
     void notifyUpdateClasspathEntries() {
+        if (conf.getJavaProject() == null) {
+            return;
+        }
         try {
             JavaCore.setClasspathContainer(path, new IJavaProject[] {conf.getJavaProject()},
                 new IClasspathContainer[] {new IvyClasspathContainer(IvyClasspathContainer.this)},
@@ -175,7 +177,8 @@ public class IvyClasspathContainer imple
         if (md == null) {
             return null;
         }
-        String resolveId = IvyClasspathUtil.buildResolveId(conf.isInheritedUseExtendedResolveId(),
md);
+        String resolveId = IvyClasspathUtil.buildResolveId(conf.isInheritedUseExtendedResolveId(),
+            md);
         try {
             return ivy
                     .getResolutionCacheManager()

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
Sun Apr  3 11:46:12 2011
@@ -84,7 +84,8 @@ public class IvyClasspathContainerMapper
             if (artifact.getType().equals(WorkspaceResolver.ECLIPSE_PROJECT_TYPE)) {
                 // This is a java project in the workspace, add project path
                 // but only add it if it is not a self dependency
-                if (!artifact.getName().equals(conf.getJavaProject().getPath().toString()))
{
+                if (conf.getJavaProject() == null
+                        || !artifact.getName().equals(conf.getJavaProject().getPath().toString()))
{
                     paths.add(JavaCore.newProjectEntry(new Path(artifact.getName()), true));
                 }
             } else if (artifact.getLocalFile() != null && accept(artifact.getArtifact()))
{

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
Sun Apr  3 11:46:12 2011
@@ -49,7 +49,7 @@ public class IvyClasspathContainerState 
     }
 
     protected IProject getProject() {
-        return conf.getJavaProject().getProject();
+        return conf.getJavaProject() == null ? null : conf.getJavaProject().getProject();
     }
 
     protected Collection getPropertyFiles() throws IvyDEException {

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/handlers/AbstractIvyDEHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/handlers/AbstractIvyDEHandler.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/handlers/AbstractIvyDEHandler.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/handlers/AbstractIvyDEHandler.java
Sun Apr  3 11:46:12 2011
@@ -73,13 +73,15 @@ public abstract class AbstractIvyDEHandl
                 IvyClasspathContainer ivycp = IvyClasspathUtil
                         .jdt2IvyCPC(((ClassPathContainer) element));
                 IJavaProject javaProject = ivycp.getConf().getJavaProject();
-                Set/* <IvyClasspathContainer> */cplist = (Set) projects.get(javaProject
-                        .getProject());
-                if (cplist == null) {
-                    cplist = new HashSet();
-                    projects.put(javaProject.getProject(), cplist);
+                if (javaProject != null) {
+                    Set/* <IvyClasspathContainer> */cplist = (Set) projects.get(javaProject
+                            .getProject());
+                    if (cplist == null) {
+                        cplist = new HashSet();
+                        projects.put(javaProject.getProject(), cplist);
+                    }
+                    cplist.add(ivycp);
                 }
-                cplist.add(ivycp);
             } else {
                 addElement(projects, element);
             }
@@ -111,8 +113,8 @@ public abstract class AbstractIvyDEHandl
             Entry entry = (Entry) it.next();
             Iterator itContainers = ((Set) entry.getValue()).iterator();
             while (itContainers.hasNext()) {
-                handleContainer((IProject) entry.getKey(), (IvyClasspathContainer) itContainers
-                        .next());
+                handleContainer((IProject) entry.getKey(),
+                    (IvyClasspathContainer) itContainers.next());
             }
         }
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ResolveRequest.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ResolveRequest.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ResolveRequest.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ResolveRequest.java
Sun Apr  3 11:46:12 2011
@@ -27,11 +27,21 @@ public class ResolveRequest {
 
     private boolean inWorkspace = false;
 
+    private boolean forceFailOnError = false;
+
     public ResolveRequest(IvyResolver resolver, CachedIvy cachedIvy) {
         this.resolver = resolver;
         this.cachedIvy = cachedIvy;
     }
 
+    public void setForceFailOnError(boolean forceFailOnError) {
+        this.forceFailOnError = forceFailOnError;
+    }
+
+    public boolean isForceFailOnError() {
+        return forceFailOnError;
+    }
+
     public IvyResolver getResolver() {
         return resolver;
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/IvyMenuContributionItem.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/IvyMenuContributionItem.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/IvyMenuContributionItem.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/IvyMenuContributionItem.java
Sun Apr  3 11:46:12 2011
@@ -249,6 +249,9 @@ public class IvyMenuContributionItem ext
     private void doCollectContainer(Map/* <IProject, Set<IvyClasspathContainer>>
*/containers,
             IvyClasspathContainer ivycp) {
         IJavaProject javaProject = ivycp.getConf().getJavaProject();
+        if (javaProject == null) {
+            return;
+        }
         Set/* <IvyClasspathContainer> */cplist = (Set) containers.get(javaProject.getProject());
         if (cplist == null) {
             cplist = new HashSet();

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java?rev=1088255&r1=1088254&r2=1088255&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
Sun Apr  3 11:46:12 2011
@@ -27,6 +27,7 @@ import org.eclipse.core.resources.IProje
 import org.eclipse.core.runtime.jobs.IJobChangeEvent;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.ui.JavaUI;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IToolBarManager;
@@ -214,8 +215,7 @@ public class ReverseDependencyExplorerVi
                     MultiRevDependencyDescriptor multiRD = (MultiRevDependencyDescriptor)
item
                             .getData();
 
-                    if (multiRD.hasMultipleRevisons()
-                            && !multiRD.hasNewRevision()) {
+                    if (multiRD.hasMultipleRevisons() && !multiRD.hasNewRevision())
{
                         item.setForeground(display.getSystemColor(SWT.COLOR_RED));
                     } else if (multiRD.hasNewRevision()) {
                         item.setForeground(new Color(Display.getDefault(), LIGHT_GREEEN));
@@ -267,11 +267,12 @@ public class ReverseDependencyExplorerVi
                 CPDependencyDescriptor containerDescriptorComposite = (CPDependencyDescriptor)
obj;
                 switch (index) {
                     case 0:
+                        IJavaProject javaProject = containerDescriptorComposite
+                                .getIvyClasspathContainer().getConf().getJavaProject();
                         return containerDescriptorComposite.getIvyClasspathContainer()
                                 .getDescription()
-                                + " in \""
-                                + containerDescriptorComposite.getIvyClasspathContainer().getConf()
-                                        .getJavaProject().getProject().getName() + "\"";
+                                + (javaProject == null ? "" : (" in \""
+                                        + javaProject.getElementName() + "\""));
                     case 2:
                         return toRevisionList(containerDescriptorComposite.getRevisions());
                     default:
@@ -331,8 +332,7 @@ public class ReverseDependencyExplorerVi
 
                 Object[] wrappedProjects = new Object[containers.length];
                 for (int i = 0; i < containers.length; i++) {
-                    wrappedProjects[i] = new CPDependencyDescriptor(containers[i],
-                            mrdd);
+                    wrappedProjects[i] = new CPDependencyDescriptor(containers[i], mrdd);
                 }
 
                 return wrappedProjects;



Mime
View raw message