Bug 113766 - [1.5] Invalid sorting for source member
Summary: [1.5] Invalid sorting for source member
Status: RESOLVED DUPLICATE of bug 113722
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-26 05:01 EDT by Philipe Mulet CLA
Modified: 2005-10-26 11:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***