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

Bug 311329

Summary: [inline] Inline method drops implicitly used method type argument (Foo.<This>bar())
Product: [Eclipse Project] JDT Reporter: Chris West (Faux) <eclipse>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P4 CC: daniel_megert, markus.kell.r
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Chris West (Faux) CLA 2010-05-02 22:20:54 EDT
Build Identifier: I20100413-1521

With a class such as the following, where "first" only implicitly references the static generic parameter, inlining will lose references to the parameter entirely.

class Scratch {
  static <U> List<U> second() {
    return new ArrayList<U>();
  }

  static <T> List<T> first() {
    return second();
  }

  void client() {
    use(Scratch.<String>first());
  }

  static void use(List<String> emptyList) {}
}

Inlining "first" results in "client" attempting to call "use(Scratch.second());", which is a compile error.

"use(Scratch.<String>second());" is expected / required.


Reproducible: Always

Steps to Reproduce:
1. Open the above class in a Java editor; fix the imports.
2. Place the cursor inside the "first" declaration.
3. Inline (alt+shift+i / alt+shift+t,&Inline..)
4. Observe compile error.
Comment 1 Dani Megert CLA 2010-05-03 00:16:10 EDT
There since at least 3.2. Nothing in the .log.
Comment 2 Eclipse Genie CLA 2020-03-08 17:04:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.