Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 50607 - [extract method] Name ambiguous return value in error message
Summary: [extract method] Name ambiguous return value in error message
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.6 M1   Edit
Assignee: Benjamin Muskalla CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 89942 184558 196648 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-26 09:45 EST by Thorsten van Ellen CLA
Modified: 2009-08-04 06:40 EDT (History)
5 users (show)

See Also:


Attachments
patch (4.86 KB, patch)
2009-07-28 18:50 EDT, Benjamin Muskalla CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten van Ellen CLA 2004-01-26 09:45:43 EST
Sometimes a get an error message about ambigous return values,
when I want to extract a method.
This message is correct, but not very comforable.
It would be better to explicitly name all variables
that are ambigous to be able to decide which variables 
must be refactored first.

best regards

Thorsten van Ellen

P.S.: Of course, it would be much better, 
if the refactoring could refactor those variables, too.

One simplistic way could be, to use "PrimitiveVariable"-classes as
"value by reference", e.g. ObjectVariable and IntVariable:

class ObjectVariable {
  public Object value;
  public ObjectVariable(Object value) {
    this.value = value;
  }
}
class IntVariable {
  public int value;
  public ObjectVariable(int value) {
    this.value = value;
  }
}
Comment 1 Markus Keller CLA 2009-06-21 16:58:58 EDT
*** Bug 184558 has been marked as a duplicate of this bug. ***
Comment 2 Markus Keller CLA 2009-06-21 17:02:22 EDT
*** Bug 196648 has been marked as a duplicate of this bug. ***
Comment 3 Benjamin Muskalla CLA 2009-07-28 18:50:32 EDT
Created attachment 142834 [details]
patch

Markus, one thing I wondered about: is there a better way to pass a list into MessageFormat? I'm not quite sure if this is the right way in the presence of BiDi. But could not find any informations on that topic.
Comment 4 Markus Keller CLA 2009-08-03 14:12:21 EDT
*** Bug 89942 has been marked as a duplicate of this bug. ***
Comment 5 Markus Keller CLA 2009-08-03 15:01:32 EDT
> is there a better way to pass a list into MessageFormat?

I don't know of a general way to NLS general item lists. We sometimes have separate message patterns for 1, 2, 3, and for more items. Here, I avoided the issue by listing the variables on a separate line each (we don't yet support top-to-down scripts;-).

BTW: With your code, you could have made it easier, since it only printed out the first two variables (even if there were more). I've fixed that and released to HEAD.

Comment 6 Raksha Vasisht CLA 2009-08-04 05:51:20 EDT
Verified for 3.6 M1 using I20090803-1800