Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 167950

Summary: [quick fix] "create method" for type-parameterized classes
Product: [Eclipse Project] JDT Reporter: Luke Hutchison <luke.hutch>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Luke Hutchison CLA 2006-12-13 15:25:42 EST
I have a class STM<K,V> and a class DeadlockTester<K,V> that contains a field "private STM<K, V> stm".  Inside DeadlockTester I write:

  K key;
  stm.newMethod(key);

I get the following error on "newMethod" : "The method newMethod(K) is undefined for the type STM<K,V>".

Quick fix gives me only the following option:

  Add cast to 'stm' : "((Object) stm).newMethod(key);"

I would expect an option "Create method 'void newMethod(K key)' in class STM<K,V>".
Comment 1 Luke Hutchison CLA 2018-09-14 06:12:55 EDT
Fixed in 4.8, but a new bug is introduced (the wrong type variable is used, see bug #539067).