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

Bug 474524

Summary: HierarchyProcessor.getDeclaringType() assumes that there is at least one element in HierarchyProcessor.fMembersToMove
Product: [Eclipse Project] JDT Reporter: Raffi Khatchadourian <raffi.khatchadourian>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.5   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug

Description Raffi Khatchadourian CLA 2015-08-07 15:56:46 EDT
org.eclipse.jdt.internal.corext.refactoring.structure.HierarchyProcessor.getDeclaringType() assumes that there is at least one element in org.eclipse.jdt.internal.corext.refactoring.structure.HierarchyProcessor.fMembersToMove, which results in an ArrayIndexOutOfBoundsException in the case that the field has no elements. It should return null in this cae instead, I believe.

I artificially produced this error via a JUnit test case.

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.jdt.internal.corext.refactoring.structure.HierarchyProcessor.getDeclaringType(HierarchyProcessor.java:659)
	at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.createWorkingCopyLayer(PullUpRefactoringProcessor.java:1386)
	...


-- Configuration Details --
Product: Eclipse 4.5.0.20150621-1200 (org.eclipse.epp.package.rcp.product)
Installed Features:
 org.eclipse.jdt 3.11.0.v20150603-2000
Comment 1 Eclipse Genie CLA 2019-11-24 04:45:21 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.