Bug 113722 - Sort members is confused with syntax errors
Summary: Sort members is confused with syntax errors
Status: VERIFIED FIXED
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: 3.2 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 113766 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-25 21:54 EDT by Olivier Thomann CLA
Modified: 2005-10-31 06:03 EST (History)
1 user (show)

See Also:


Attachments

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