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 7682493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:34:53+00:00 2026-05-31T18:34:53+00:00

When refactoring classes and methods JDT doesn’t change referenced resources, while it does when

  • 0

When refactoring classes and methods JDT doesn’t change referenced resources, while it does when refactoring packages. I use the following code:

RefactoringContribution contrib = RefactoringCore.getRefactoringContribution(IJavaRefactorings.RENAME_COMPILATION_UNIT);
RenameJavaElementDescriptor desc =  (RenameJavaElementDescriptor)contrib.createDescriptor();
desc.setUpdateReferences(true);
desc.setJavaElement(classToRename);
desc.setNewName(newName);
Refactoring ref = desc.createRefactoring(new RefactoringStatus());
IProgressMonitor monitor = new NullProgressMonitor();
Change change = refactoring.createChange(monitor);
change.perform(monitor); 

an advice will help:

  • 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-05-31T18:34:54+00:00Added an answer on May 31, 2026 at 6:34 pm

    Well, I investigated JDT thoroughly and came to the following conclusion:

    1. The current JDT API has this maximum potential regarding classes and
      methods
    2. It’s difficult to change the references in case of classes and
      methods because they are not referenced like packages i.e.
      my.package.util is easy where MyClass has no reference and can be
      present in more than one package.

    But it can be done coming out of the known java frameworks like spring, hibernate *iBatis* resource files if JDT developers would give some time to it, but it will be still a whole lot of work and time spending.
    The solution is to refactor yourself through IO streams by putting replacement/change conditions, but also it will be a lot of work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code I'm refactoring: namespace Foo { namespace Bar { ...classes...
While refactoring some old code I have stripped out a number of public methods
I'm refactoring a number of classes in an application to use interfaces instead of
While refactoring code and ridding myself of all those #defines that we're now taught
Whilst refactoring some code I came across some getter methods that returns a std::string.
I'm refactoring some code and want to classes a bit higher in the inheritance
I was hoping someone could help clarify my options regarding refactoring methods from code-behinds
Does anyone know of an automated approach to refactoring code to minimize the visibility
While refactoring some C# classes, I've run into classes that implement IDisposable. Without thinking,
Whilst refactoring some old code I realised that a particular header file was full

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.