ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r992561 - /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
Date Sat, 04 Sep 2010 08:36:20 GMT
Author: hibou
Date: Sat Sep  4 08:36:20 2010
New Revision: 992561

URL: http://svn.apache.org/viewvc?rev=992561&view=rev
Log:
Eclipse 3.3 hack not needed anymore as we want at least Eclipse 3.4

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.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=992561&r1=992560&r2=992561&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
Sat Sep  4 08:36:20 2010
@@ -30,22 +30,13 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.ElementChangedEvent;
 import org.eclipse.jdt.core.IClasspathAttribute;
 import org.eclipse.jdt.core.IClasspathContainer;
 import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElementDelta;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.DeltaProcessingState;
-import org.eclipse.jdt.internal.core.JavaElementDelta;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider;
 import org.eclipse.swt.widgets.Display;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
 
 /**
  * Eclipse classpath container that will contain the ivy resolved entries.
@@ -62,8 +53,6 @@ public class IvyClasspathContainer imple
 
     private final IvyClasspathContainerState state;
 
-    private String jdtVersion;
-
     /**
      * Create an Ivy class path container from some predefined classpath entries. The provided
class
      * path entries should come from the default "persisted" classpath container. Note that
no
@@ -169,54 +158,12 @@ public class IvyClasspathContainer imple
             JavaCore.setClasspathContainer(path, new IJavaProject[] {conf.getJavaProject()},
                 new IClasspathContainer[] {new IvyClasspathContainer(IvyClasspathContainer.this)},
                 null);
-
-            // the following code was imported from:
-            // http://svn.codehaus.org/m2eclipse/trunk/org.maven.ide.eclipse/src/org/maven/ide
-            // /eclipse/embedder/BuildPathManager.java
-            // revision: 370; function setClasspathContainer; line 215
-
-            // XXX In Eclipse 3.3, changes to resolved classpath are not announced by JDT
Core
-            // and PackageExplorer does not properly refresh when we update Ivy
-            // classpath container.
-            // As a temporary workaround, send F_CLASSPATH_CHANGED notifications
-            // to all PackageExplorerContentProvider instances listening to
-            // java ElementChangedEvent.
-            // Note that even with this hack, build clean is sometimes necessary to
-            // reconcile PackageExplorer with actual classpath
-            // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=154071
-            if (getJDTVersion().startsWith("3.3")) {
-                DeltaProcessingState s = JavaModelManager.getJavaModelManager().deltaState;
-                synchronized (s) {
-                    IElementChangedListener[] listeners = s.elementChangedListeners;
-                    for (int i = 0; i < listeners.length; i++) {
-                        if (listeners[i] instanceof PackageExplorerContentProvider) {
-                            JavaElementDelta delta = new JavaElementDelta(conf.getJavaProject());
-                            delta.changed(IJavaElementDelta.F_CLASSPATH_CHANGED);
-                            listeners[i].elementChanged(new ElementChangedEvent(delta,
-                                    ElementChangedEvent.POST_CHANGE));
-                        }
-                    }
-                }
-            }
         } catch (JavaModelException e) {
             // unless there are some issues with the JDT, this should never happen
             IvyPlugin.log(e);
         }
     }
 
-    private synchronized String getJDTVersion() {
-        if (jdtVersion == null) {
-            Bundle[] bundles = IvyPlugin.getDefault().getBundleContext().getBundles();
-            for (int i = 0; i < bundles.length; i++) {
-                if (JavaCore.PLUGIN_ID.equals(bundles[i].getSymbolicName())) {
-                    jdtVersion = (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION);
-                    break;
-                }
-            }
-        }
-        return jdtVersion;
-    }
-
     public URL getReportUrl() {
         Ivy ivy = state.getCachedIvy();
         if (ivy == null) {



Mime
View raw message