Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325302 - Branding of MacOS eclipse.ini fails on case insensitive filesystem (Windows)
Summary: Branding of MacOS eclipse.ini fails on case insensitive filesystem (Windows)
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Buckminster (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: buckminster.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 325674 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-14 20:23 EDT by Michal Ruzicka CLA
Modified: 2019-02-25 14:41 EST (History)
3 users (show)

See Also:


Attachments
org.eclipse.buckminster.pde-ini_branding.patch (680 bytes, patch)
2010-09-14 21:20 EDT, Michal Ruzicka CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Ruzicka CLA 2010-09-14 20:23:00 EDT
The following code in org.eclipse.buckminster.pde.tasks.BrandingIron.copyMacIni() does not consider case insensitive filesystems:

File ini = getCanonicalFile(new File(initialRoot, "/MacOS/eclipse.ini"));
File ini2 = getCanonicalFile(new File(initialRoot, "/MacOS/Eclipse.ini"));

...

if (ini.exists()) {
	if (ini2.exists()) {
		logger.warning("Found both %s and %s. Discarding the latter", ini.getAbsolutePath(), ini2.getAbsolutePath()); //$NON-NLS-1$
		ini2.delete(); // This should not happen really
	}
} else if (ini2.exists()) {
	ini = ini2;
} else
	return;

...

StringBuffer buffer;
try {
	buffer = readFile(ini);
} catch (IOException e) {
	logger.error(e, "Impossible to brand ini file"); //$NON-NLS-1$
	return;
}

When the MacOS/eclipse.ini file happens to exist in a case insensitive filesystem then both the warning and the error message from the above code excerpt are printed.
The reason is that ini and ini2 files are in fact identical on a case insensitive filesystem, so if ini exists then ini2 must exists too (as it is the same file). The code above misinterprets this and reacts with deletion of the ini2 file (and thus whit deletion of ini). Which is later manifested by the error message when an attempt is made to read the deleted ini file.
Comment 1 Michal Ruzicka CLA 2010-09-14 21:20:00 EDT
Created attachment 178892 [details]
org.eclipse.buckminster.pde-ini_branding.patch

The attached trivial patch should resolve the issue.
Comment 2 Thomas Hallgren CLA 2010-09-15 01:28:31 EDT
Patch looks good. Please commit to helios-maintenance branch.
Comment 3 Michal Ruzicka CLA 2010-09-15 13:15:04 EDT
patch committed to the helios-maintenance branch in revision 11581
Comment 4 Philipp Nanz CLA 2010-09-18 08:13:17 EDT
*** Bug 325674 has been marked as a duplicate of this bug. ***