Bug 113766

Summary: [1.5] Invalid sorting for source member
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2005-10-26 05:01:32 EDT
Build 3.2M2

Likely due to bug 113765, when sorting members for following code with syntax
errors, it ends up corrupting the entire source.

//BEFORE
import java.util.*;
public interface X<T> {
	<K> List<Map<K,T> foo(Map<T,K> m);
	<K,E> List<Map<K,E> bar(Map<T,K> m, Map<T,E> e);
}

//AFTER
import java.util.*;
public interface X<T> {
	<K> List<Map<K,E> bar(Map<T,K> m, Map<T,E> e);
	<K,E> List<Map<K,T> foo(Map<T,K> m);
}

Due to bug 113765, some portions of a method signature are left in original code
(i.e. not considered as attached to anything), and thus got ignored when
sorting. But in general, in presence of diet parse errors, any attempt of
sorting elements is likely doomed in a similar fashion.

If so, then I would vote for having the sorting operation do nothing in such cases.
Comment 1 Olivier Thomann CLA 2005-10-26 08:45:22 EDT
The only way I see to fix this is to check if any body declaration is malformed.
If this is the case, then we should abort the sorting.
Comment 2 Olivier Thomann CLA 2005-10-26 11:18:03 EDT

*** This bug has been marked as a duplicate of 113722 ***