Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311649

Summary: restart needed to clean up target issues
Product: [Eclipse Project] PDE Reporter: Jeff McAffer <jeffmcaffer>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, darin.eclipse
Version: 3.6Flags: darin.eclipse: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Fix for AIOOBE none

Description Jeff McAffer CLA 2010-05-04 22:03:27 EDT
in M7

This is a bit of a crappy bug report as there is very little concrete detail. However, it seem lately that I have had to restart Eclipse to get my target platform definition to behave/work.  

- There have been a couple times where I was unable to export a product.  The error reported was related to not finding the launcher bundle and fragment.  They were clearly there in the target but the export failed.  Restarting Eclipse and retrying the export worked.

- It has also happened that on opening a target definition I got an exception (below). Restarting fixed the problem.  In this case it may be related to having tried to open the target while offline.  I did this, got an error, said "Doh, I'm off line", wondered why it should matter since all the metadata should have been cached, and carried on.  Then later, when online and without having restarted Eclipse since, I opened the same target file and got the exception below.

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveWithSlicer(IUBundleContainer.java:398)
	at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveBundles(IUBundleContainer.java:197)
	at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolve(AbstractBundleContainer.java:97)
	at org.eclipse.pde.internal.core.target.TargetDefinition.resolve(TargetDefinition.java:233)
	at org.eclipse.pde.internal.ui.editor.targetdefinition.TargetEditor$2.run(TargetEditor.java:410)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Curtis Windatt CLA 2010-05-05 10:12:29 EDT
I thought this might be a dupe of bug 309795, but the stack trace you posted is valid.  If there is a circumstance where the known repositories cannot be loaded, we'll throw the AIOOBE instead of returning the repo status containing the provisioning exception that occurred.
Comment 2 Curtis Windatt CLA 2010-05-05 10:44:19 EDT
(In reply to comment #0)
> - It has also happened that on opening a target definition I got an exception
> (below). Restarting fixed the problem.  In this case it may be related to
> having tried to open the target while offline.  I did this, got an error, said
> "Doh, I'm off line", wondered why it should matter since all the metadata
> should have been cached, and carried on.

The manager's loadRepository method says it may return the cached data, but whenever I ran it, it always pinged the remote site and failed if it was unavailable.
Comment 3 Curtis Windatt CLA 2010-05-05 10:46:12 EDT
Created attachment 167150 [details]
Fix for AIOOBE
Comment 4 Curtis Windatt CLA 2010-05-05 10:46:30 EDT
Darin, please review/apply the patch.
Comment 5 Darin Wright CLA 2010-05-05 12:12:58 EDT
+1. Applied/Fixed.
Comment 6 Darin Wright CLA 2010-05-05 12:15:01 EDT
Verified.