Bug 113722

Summary: Sort members is confused with syntax errors
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.2   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2005-10-25 21:54:07 EDT
Trying to sort this code completely scrambles it.

public interface I<T> {
	public I<T> foo(A<T> A);
	public <S> I<S> foo2(C<T,S> c);
	public <S> I<S> foo3(C<T,I<S>> c);
	public <K> J<T> bar(C<T,K> c);
	public <K> J<T> bar2(C<T,K> c);
	public <K> I<K<K,T> bar3(C<T,K> c);
	public <K,E> I<K<K,E> bar3(C<T,K> c, C<T,E> c2);
}

It ends up like this:
public interface I<T> {
	public <K> J<T> bar(C<T,K> c);
	public <K> J<T> bar2(C<T,K> c);
	K<K,T> bar3(C<T,K> c);
	K<K,E> bar3(C<T,K> c, C<T,E> c2);
	public I<T> foo(A<T> A);
	public <K> I<public <S> I<S> foo2(C<T,S> c);
	public <K,E> I<public <S> I<S> foo3(C<T,I<S>> c);
}

The problem comes from the syntax errors on the definition of the two bar3
methods (missing '>').
Comment 1 Olivier Thomann CLA 2005-10-26 11:18:42 EDT
*** Bug 113766 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Thomann CLA 2005-10-26 11:20:47 EDT
Fixed and released in HEAD.
If a level contains malformed nodes, this level is excluded from the sorting.
Added regression tests in
org.eclipse.jdt.core.tests.model.SortCompilationUnitElementsTests.test30/31/32
and updated test12.
Comment 3 Frederic Fusier CLA 2005-10-31 06:03:23 EST
Verified for 3.2 M3 using build I20051031-0010