Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:37:11+00:00 2026-06-01T21:37:11+00:00

Let there be a method like this: public int a() { return 1 +

  • 0

Let there be a method like this:

public int a() {
   return 1 + b();
}

Is it possible to apply the “Introduce parameter” refactoring in eclipse on the expression b() such that the caller actually calls the method b on the callee? Like this:

o.a()         // old
o.a( o.b() )  // new

When I do it, it basically copy&pastes the string “b()” into the call which doesn’t make sense of cause because this method is on the callee, not the caller. But maybe you know a trick?

Or, alternatively, is it possible to use the “Change Method Signature” refactoring and use an expression in the default value which references the callee? So that I could create a new parameter on a() and let it have a default value of something like ${this}.b()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:37:12+00:00Added an answer on June 1, 2026 at 9:37 pm

    You can do this indirectly:

    1. Introduce Indirection on o.a() (call it a_tmp)
    2. Refactor a_tmp from return o.a() to return o.a(o.b())
    3. Inline a_tmp
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have classes like this: public class Parent { public int
Let's say we have a class that looks like this: class A { public:
Is it possible to do something like this in an ASP.NET MVC controller? public
Let's say I have this code: class Score { public Update(int score) { update
Let's say I have a class that looks like this: public class CallByAttribute {
Ok, let's imagine I have an object like this: public class User { public
Let's say there's a table created as follows: create table testTable ( colA int
Let's say you have a class class C { int * i; public: C(int
So I have two custom complex types like this (oversimplified for this example): public
Assume a legacy class and method structure like below public class Foo { public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.