Bug 72643 - [1.5] parser doesn't recognize when generic methods aren't used
Summary: [1.5] parser doesn't recognize when generic methods aren't used
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-25 16:57 EDT by Marco Qualizza CLA
Modified: 2004-11-04 10:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Qualizza CLA 2004-08-25 16:57:53 EDT
In the following example, with I20040824, the private method #compare is marked
as "unused" (I have "unused private fields and methods" set to "warning" in the
compiler preferences):

package test;

import java.util.ArrayList;
import java.util.List;

public class GenericsMethodsTest {
   public void a() {
      List<String> list1 = new ArrayList<String>();
      List<String> list2 = new ArrayList<String>();
      
      compare(list1, list2);
   }
   
   public void b() {
      List<Integer> list1 = new ArrayList<Integer>();
      List<Integer> list2 = new ArrayList<Integer>();
      
      compare(list1, list2);
   }
   
   private <E> void compare(List<E> list1, List<E> list2) {
      // do some comparing logic...
   }
}
Comment 1 Frederic Fusier CLA 2004-10-28 12:21:02 EDT
Does no longer happen in build I200410260800.
I'll add this bug to JDT/Core buildnotes.
Comment 2 Frederic Fusier CLA 2004-10-29 13:15:16 EDT
Added regression test: GenericTypeTest#test362

Comment 3 Frederic Fusier CLA 2004-11-04 10:50:40 EST
Verified for 3.1 M3 with build I200411040800