Bug 572067 - tooltip link for property file not working correctly
Summary: tooltip link for property file not working correctly
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-18 08:41 EDT by Andy Man CLA
Modified: 2023-04-11 17:57 EDT (History)
3 users (show)

See Also:


Attachments
The minimal example to reproduce the bug (574 bytes, application/octet-stream)
2021-03-18 08:41 EDT, Andy Man CLA
no flags Details
cleanup settings (8.28 KB, text/xml)
2021-03-18 08:42 EDT, Andy Man CLA
no flags Details
stack trace of exception during clean up (17.62 KB, text/plain)
2021-03-23 06:08 EDT, Andy Man CLA
no flags Details
sample project for clean up exception (2.73 KB, application/x-zip-compressed)
2021-03-23 06:40 EDT, Andy Man CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Man CLA 2021-03-18 08:41:47 EDT
Created attachment 285871 [details]
The minimal example to reproduce the bug

The auto detection for property files (which apparently is based on detecting if ResourceBundle.getBundle() exists) is not working correctly.

I attached a minimal example. When ctrl+hovering over Messages or the getString() method of Messages, you will see "Open in 'messages.properties'". Which doesn't make much sense, since what will exist are files like messages_de.properties or messages_en.properties. Therefore clicking that option also doesn't do anything, even if you have for example messages_de.properties in the right place, since it tries to open messages.properties which doesn't exist.

In itself not a huge problem (aside from whenever working with a class that has this, just ctrl clicking to get to the source code is not possible).

But it also causes some option from the "clean up" feature to fail with an exception in whatever class is calling the class containing the ResourceBundle call. This makes it impossible to use clean up on any package/project which contains such a class.

Here is a pastebin of my cleanup settings: https://pastebin.com/gChqNUq0
Comment 1 Andy Man CLA 2021-03-18 08:42:13 EDT
Created attachment 285872 [details]
cleanup settings
Comment 2 Andy Man CLA 2021-03-18 09:05:58 EDT
To break cleanup there needs to be done more, but i know this bug is a necessary requirement. The class from our actual project just is a bit more involved, so i cannot say which other conditions are required. But the problem there vanishes as soon as i delete all references to the ResourceBundle-containing class.
Comment 3 Kalyan Prasad Tatavarthi CLA 2021-03-19 07:02:20 EDT
Please provide the cleanup exception stack trace.
Also please provide a sample project with steps to reproduce this clean up  exception.
Comment 4 Andy Man CLA 2021-03-23 06:08:51 EDT
Created attachment 285927 [details]
stack trace of exception during clean up
Comment 5 Andy Man CLA 2021-03-23 06:10:09 EDT
@ka(In reply to Kalyan Prasad Tatavarthi from comment #3)
> Please provide the cleanup exception stack trace.
> Also please provide a sample project with steps to reproduce this clean up 
> exception.

I attached the stack trace, i will try to setup a sample project for the clean up exception, but since the project i originally tried on is quite large, it might be hard to narrow it down.
Comment 6 Andy Man CLA 2021-03-23 06:40:02 EDT
Created attachment 285928 [details]
sample project for clean up exception
Comment 7 Andy Man CLA 2021-03-23 06:41:05 EDT
(In reply to Kalyan Prasad Tatavarthi from comment #3)
> Please provide the cleanup exception stack trace.
> Also please provide a sample project with steps to reproduce this clean up 
> exception.

I was able to reduce it further. It is actually not related to the property file thing (although that one is still a bug). I uploaded the sample project. Probably need to create a new issue from it.
Comment 8 Kalyan Prasad Tatavarthi CLA 2021-03-24 01:29:08 EDT
(In reply to Andy Man from comment #7)
> (In reply to Kalyan Prasad Tatavarthi from comment #3)
> > Please provide the cleanup exception stack trace.
> > Also please provide a sample project with steps to reproduce this clean up 
> > exception.
> 
> I was able to reduce it further. It is actually not related to the property
> file thing (although that one is still a bug). I uploaded the sample
> project. Probably need to create a new issue from it.

The cleanup issue is happening due to 'cleanup.switch' option being set to true.

In UI it is "Convert if/else if/else chain to switch".

Please open a separate bug for this issue and attach the same project attached here to that bug.


With regards to this bug, please disable the above clean up action and see if you are seeing this issue of auto detection for property files. If so, please provide steps to reproduce this issue independent of the clean up related issue.
Comment 9 Andy Man CLA 2021-03-24 04:20:55 EDT
(In reply to Kalyan Prasad Tatavarthi from comment #8)
> (In reply to Andy Man from comment #7)
> > (In reply to Kalyan Prasad Tatavarthi from comment #3)
> > > Please provide the cleanup exception stack trace.
> > > Also please provide a sample project with steps to reproduce this clean up 
> > > exception.
> > 
> > I was able to reduce it further. It is actually not related to the property
> > file thing (although that one is still a bug). I uploaded the sample
> > project. Probably need to create a new issue from it.
> 
> The cleanup issue is happening due to 'cleanup.switch' option being set to
> true.
> 
> In UI it is "Convert if/else if/else chain to switch".
> 
> Please open a separate bug for this issue and attach the same project
> attached here to that bug.
> 
> 
> With regards to this bug, please disable the above clean up action and see
> if you are seeing this issue of auto detection for property files. If so,
> please provide steps to reproduce this issue independent of the clean up
> related issue.

Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=572249

To clarify: The bug i'm describing here is actually NOT related to cleanup, it is simply the tooltip link to the properties file that is broken. I will edit the title accordingly, cannot change the original comment though.
Comment 10 Eclipse Genie CLA 2023-04-11 17:57:17 EDT
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.