Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336201 - [inline] refactoring produces different result depending on whether declaration is inlined or the invocation
Summary: [inline] refactoring produces different result depending on whether declarati...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 04:33 EST by Deepak Azad CLA
Modified: 2019-05-03 04:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-02-03 04:33:27 EST
3.7 M5

---------------------------------------------------
package argument_in;

public class TestArray {

	public int bar(int a[]) {   //2
		return a[0];
	}
	
	public void main() {
		int i= bar(new int[] {1});  //1
	}
}
---------------------------------------------------
1. Inline the method invocation 'bar'
=> int i= (new int[] {1})[0];  => Good.

2. Inline the method declaration 'bar'
=> int i= ((int[]) new int[] {1})[0]; => Bad
There is an unnecessary cast, plus the result is different in both cases.
Comment 1 Eclipse Genie CLA 2019-02-21 11:37:45 EST
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 2 Dani Megert CLA 2019-02-22 05:01:22 EST Comment hidden (obsolete)
Comment 3 Kenneth Styrberg CLA 2019-05-02 15:57:37 EDT
Tested with 2019-06_M1+ and could not reproduce
Comment 4 Dani Megert CLA 2019-05-03 04:54:38 EDT
(In reply to Kenneth Styrberg from comment #3)
> Tested with 2019-06_M1+ and could not reproduce
Indeed. Not sure what I did.