Bug 72643

Summary: [1.5] parser doesn't recognize when generic methods aren't used
Product: [Eclipse Project] JDT Reporter: Marco Qualizza <mlq.eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: All   
Whiteboard:

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