Bug 55992 - AssertionFailed during preference import
Summary: AssertionFailed during preference import
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-24 14:29 EST by DJ Houghton CLA
Modified: 2004-05-18 12:09 EDT (History)
0 users

See Also:


Attachments
exported preferences (147.23 KB, text/plain)
2004-03-24 14:30 EST, DJ Houghton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2004-03-24 14:29:42 EST
build i0324:0800, winxp, sunjdk1.4.2

I did a preference import with this build and I got the following stack trace on
the console. I'm not sure when I exported the prefs file. Will attach prefs
file. Let me know...it could be something that I've done wrong in the prefs code.


osgi> !SESSION Mar 24, 2004 14:23:27.729 ---------------------------------------
------
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -showlocation -vmargs -cp C:\eclipse\dev\i0324-0800\ecli
pse\startup.jar org.eclipse.core.launcher.Main
!ENTRY org.eclipse.ui 4 4 Mar 24, 2004 14:23:27.729
!MESSAGE Unhandled event loop exception
Unhandled event loop exception
Reason:
!ENTRY org.eclipse.ui 4 0 Mar 24, 2004 14:23:27.739
!MESSAGE Assertion failed; Source attachment path for IClasspathEntry must be ab
solute
!STACK 0
org.eclipse.jdt.internal.core.Assert$AssertionFailedException: Assertion failed;
 Source attachment path for IClasspathEntry must be absolute
        at org.eclipse.jdt.internal.core.Assert.isTrue(Assert.java:89)
        at org.eclipse.jdt.core.JavaCore.newLibraryEntry(JavaCore.java:2708)
        at org.eclipse.jdt.core.JavaCore.getResolvedClasspathEntry(JavaCore.java
:2226)
        at org.eclipse.jdt.internal.core.ClasspathEntry.validateClasspathEntry(C
lasspathEntry.java:953)
        at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaPr
oject.java:1822)
        at org.eclipse.jdt.internal.core.SetClasspathOperation.updateProjectRefe
rencesIfNecessary(SetClasspathOperation.java:760)
        at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(
SetClasspathOperation.java:233)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperati
on.java:700)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1559
)
        at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaMod
elOperation.java:744)
        at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject
.java:2584)
        at org.eclipse.jdt.core.JavaCore$5.run(JavaCore.java:3339)
        at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOp
eration.java:34)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperati
on.java:700)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1559
)
        at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3196)
        at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:332
5)
        at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize
(JREContainerInitializer.java:51)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.rebind(L
aunchingPlugin.java:244)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.access$0
(LaunchingPlugin.java:208)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin$1.run(LaunchingPlu
gin.java:198)
        at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOp
eration.java:34)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperati
on.java:700)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1559
)
        at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3196)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.process(
LaunchingPlugin.java:201)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin.processVMPrefsChan
ged(LaunchingPlugin.java:585)
        at org.eclipse.jdt.internal.launching.LaunchingPlugin.propertyChange(Lau
nchingPlugin.java:492)
        at org.eclipse.core.internal.preferences.PreferenceForwarder.preferenceC
hange(PreferenceForwarder.java:102)
        at org.eclipse.core.internal.preferences.EclipsePreferences.preferenceCh
anged(EclipsePreferences.java:831)
        at org.eclipse.core.internal.preferences.EclipsePreferences.put(EclipseP
references.java:163)
        at org.eclipse.core.internal.preferences.PreferencesService$1.visit(Pref
erencesService.java:420)
        at org.eclipse.core.internal.preferences.EclipsePreferences.accept(Eclip
sePreferences.java:1028)
        at org.eclipse.core.internal.preferences.EclipsePreferences.accept(Eclip
sePreferences.java:1033)
        at org.eclipse.core.internal.preferences.EclipsePreferences.accept(Eclip
sePreferences.java:1033)
        at org.eclipse.core.internal.preferences.PreferencesService.applyPrefere
nces(PreferencesService.java:432)
        at org.eclipse.core.internal.preferences.PreferencesService.importPrefer
ences(PreferencesService.java:366)
        at org.eclipse.core.runtime.Preferences.importPreferences(Preferences.ja
va:377)
        at org.eclipse.ui.internal.dialogs.PreferenceImportExportWizard.performF
inish(PreferenceImportExportWizard.java:182)
        at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java
:606)
        at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java
:319)
        at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:413)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:
89)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2584)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2262)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:670)
        at org.eclipse.jface.window.Window.open(Window.java:650)
        at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.loadPressed
(WorkbenchPreferenceDialog.java:117)
        at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.buttonPress
ed(WorkbenchPreferenceDialog.java:67)
        at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:413)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:
89)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2584)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2262)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:670)
        at org.eclipse.jface.window.Window.open(Window.java:650)
        at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesActi
on.java:72)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:550)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContri
butionItem.java:502)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionC
ontributionItem.java:435)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2584)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2262)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1541)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1515)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
a:257)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90
)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct
ivator.java:288)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:232)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:315)
        at org.eclipse.core.launcher.Main.run(Main.java:740)
        at org.eclipse.core.launcher.Main.main(Main.java:724)
Assertion failed; Source attachment path for IClasspathEntry must be absolute
Comment 1 DJ Houghton CLA 2004-03-24 14:30:07 EST
Created attachment 8846 [details]
exported preferences
Comment 2 DJ Houghton CLA 2004-03-24 14:58:39 EST
I'm not sure how I got into this state...I can't reproduce this problem in a
runtime workbench with this build.
Comment 3 Philipe Mulet CLA 2004-03-25 05:25:34 EST
Some project seem to have a bogus classpath with a non absolute source 
attachment attribute. 

It corresponds to a case where a variable entry refers to an external class 
folder.

The illegal argument exception is legite, but it is questionable that it causes 
our validation check to abort in this way. We should protect the validation by 
either catching the exception or better use status to report the problem nicely.
Comment 4 Frederic Fusier CLA 2004-04-02 06:27:59 EST
Although I was not able to reproduce this exception using provided exported 
preferences file, I've modified code to catch this exception when it may happen
while verifying class path entry.

[jdt-core-internal]
Changes done in callers as ClasspathEntry.validateClasspathEntry, 
JavaProject.getResolvedClasspath and CopyPackageFragmentRootOperation.copy 
methods.
Note that change in CopyPackageFragmentRootOperation was purely theoretical as 
all senders already verified that path and source path were valid...

Test cases added in ClasspathTests for ClasspathEntry.validateClasspathEntry 
and JavaProject.getResolvedClasspath respectively in testBug55992a and 
testBug55992b
Comment 5 Olivier Thomann CLA 2004-05-18 12:09:58 EDT
Verified in 200405180816