diff options
author | kkomissarchik | 2006-06-08 19:58:02 +0000 |
---|---|---|
committer | kkomissarchik | 2006-06-08 19:58:02 +0000 |
commit | dd0a46e375105b91fe3c87afa7bcdbff993f32b1 (patch) | |
tree | 0a5904596eeb4c1a9879f5e8c595c2e49ebe06e6 /plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal | |
parent | 3690e18ce0c55846371d9ee737c817560f540ca4 (diff) | |
download | webtools.javaee-dd0a46e375105b91fe3c87afa7bcdbff993f32b1.tar.gz webtools.javaee-dd0a46e375105b91fe3c87afa7bcdbff993f32b1.tar.xz webtools.javaee-dd0a46e375105b91fe3c87afa7bcdbff993f32b1.zip |
[145062] Error attaching source
Diffstat (limited to 'plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal')
-rw-r--r-- | plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java index f3849aa78..ef6fa3b74 100644 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java +++ b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/classpath/FlexibleProjectContainerInitializer.java @@ -11,6 +11,8 @@ package org.eclipse.jst.common.jdt.internal.classpath; +import java.lang.reflect.Field; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.core.ClasspathContainerInitializer; @@ -76,7 +78,41 @@ public abstract class FlexibleProjectContainerInitializer final IClasspathContainer container = JavaCore.getClasspathContainer( containerPath, project ); - ( (FlexibleProjectContainer) container ).refresh(); + // ( (FlexibleProjectContainer) container ).refresh(); + + refresh( container ); } - + + // Workaround for bug 145784. + + private static void refresh( final IClasspathContainer container ) + { + if( container instanceof FlexibleProjectContainer ) + { + ( (FlexibleProjectContainer) container ).refresh(); + } + else + { + try + { + final Field field + = container.getClass().getDeclaredField( "fOriginal" ); //$NON-NLS-1$ + + field.setAccessible( true ); + + refresh( (IClasspathContainer) field.get( container ) ); + } + catch( NoSuchFieldException e ) + { + // Should not happen. + throw new RuntimeException( e ); + } + catch( IllegalAccessException e ) + { + // Should not happen. + throw new RuntimeException( e ); + } + } + } + } |