Domino Designer: refactoring issue

Sunday, November 10, 2024 at 4:59 PM UTC

I recently noticed another weird behaviour in Designer using the Eclipse-function to rename a Java class.

When using this function, you will instantly notice another problem with the menu entries increasing every time you open it - but this is another story.

tl;dr

Here is a litte demo video

How to reproduce

To reproduce this, do the following:

Create a new blank database, create 2 classes “FirstClass” and “SecondClass”. Use “FirstClass” in “SecondClass”. Rename the “FistClass” by using right mouse click on the class and then “Refactor, Rename” (always use the last entry/entries in this menu, the others won’t do anything). Now rename the class to whatever you want, .e.g. “BetterFirstClass”. It also “works” just moving it to another package, but for simplicity we only rename it now.

Then, in “SecondClass”, make a change and save it. The editor and the whole IDE will tell you about the error that “BetterFirstClass” cannot be resolved. Hm...

Executing a “Project, Clean” solves this problem for now (because there is none) until you change and save the class(es) that use the renamed one again.

I created an ODP to check the metadata files because they are responsible in most cases. Not this time, everything looks ok.

Solution / Workaround

There is only one solution I am aware of: instead of renaming/moving the existing class, copy the content from the existing to the clipboard or elsewhere so you don’t lose it. Do the refactoring as usual and ignore the problem for now. This is only for the classes that use this class to be adapted. Then, delete the renamed class. Close the application as this name seems to be cached (see the video). Re-open the application and re-create the “new” class as usual. Copy over the content you preserved into the new class and save everything. As a result you should be able to alter everything else without this problem.

Did you experience this, too? I have seen this with different versions of 12.0.x. If you know the reason and/or how to solve this in a better way, please let us know.

SPR & Defect article

Meanwhile HCL created an SPR #ASHEDB2G42 and a defect article: https://support.hcl-software.com/csm?id=kb_article&sysparm_article=KB0117446






Latest comments to this post

Oliver wrote on 20.11.2024, 13:46

Jesper, did you open a case for that? I think I know what you mean, saw it once in a little video somewhere.

 Link to this comment
Jesper Kiaer wrote on 13.11.2024, 11:53

Hi,  I have (maybe) related issues in Java agents and Script Libraries, were the editor stops seeing the libraries, and you have to open all libraries one by one and compile them until it finally works again. So annoying and time consuming.

 

/Jesper Kiaer

 Link to this comment

Leave a comment right here