Bug 579575 - NumberFormatException during "EGit Hidden Resources Clean-up"
Summary: NumberFormatException during "EGit Hidden Resources Clean-up"
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 6.1   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 6.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-05 02:54 EDT by Michael Keppler CLA
Modified: 2022-04-05 14:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keppler CLA 2022-04-05 02:54:44 EDT
This happened when I tried to open some projects (which had been closed when switching to an old branch):

java.lang.IllegalArgumentException: can't parse argument number: 
	at java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1454)
	at java.base/java.text.MessageFormat.applyPattern(MessageFormat.java:492)
	at java.base/java.text.MessageFormat.<init>(MessageFormat.java:371)
	at java.base/java.text.MessageFormat.format(MessageFormat.java:860)
	at org.eclipse.egit.core.internal.efs.HiddenResources.initialize(HiddenResources.java:185)
	at org.eclipse.egit.core.internal.efs.HiddenResources.initialize(HiddenResources.java:128)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:187)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:678)
	at java.base/java.lang.Integer.parseInt(Integer.java:786)
	at java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1452)
	... 7 more
Comment 1 Eclipse Genie CLA 2022-04-05 03:08:24 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/192492
Comment 3 Thomas Wolf CLA 2022-04-05 11:59:36 EDT
Exception is fixed. But why did we run into this at all? You write about closed projects. So we can't remove hidden linked resources if the link target is in a closed project? Why was there a CoreException at all?

I guess now that the NumberFormatException is fixed we should see the CoreException, and then be able to figure out what's going on.
Comment 4 Michael Keppler CLA 2022-04-05 14:17:32 EDT
Of course I've also looked for anything else pointing to the root exception, but there was nothing. Trouble is, I don't understand what HiddenResources is _intended_ to do at the place where the exception is thrown, so I can't even speculate.
Comment 5 Thomas Wolf CLA 2022-04-05 14:24:35 EDT
HiddenResources manages linked resources for the Compare Editor in two cases: comparisons with non-workspace files, and comparisons when the mode is "Work Tree Pre-Merged with 'Ours'".

The Compare editor cleans up these linked resources when it is closed. But if not closed, it's possible that some links remain when the workbench closes. At start-up, HiddenResources tries to remove such left-over links.