Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323907

Summary: Branded ini missing in MacOS builds
Product: z_Archived Reporter: Thorsten Meinl <thorsten>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: thomas, vroldanbet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch to BrandingIron.java that fixed the problem
thomas: iplog+
Fix for NPE thomas: iplog+

Description Thorsten Meinl CLA 2010-08-29 10:05:11 EDT
Build Identifier: I20100608-0911

If the application name is not eclipse but some other name, e.g. "knime" the p2 publisher does not find the branded ini-file:

java.io.FileNotFoundException: 
/tmp/p2.brandingIron3419713815157511588/knime.app/Contents/MacOS/knime.ini 
(Datei oder Verzeichnis nicht gefunden)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at 
org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zipFile(FileUtils.java:357)
        at 
org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:286)
        at 
org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:251)
        at 
org.eclipse.equinox.p2.publisher.AbstractPublisherAction.publishArtifact(AbstractPublisherAction.java:469)
        at 
org.eclipse.equinox.p2.publisher.eclipse.EquinoxExecutableAction.publishExecutableIU(EquinoxExecutableAction.java:129)
        at 
org.eclipse.equinox.p2.publisher.eclipse.EquinoxExecutableAction.perform(EquinoxExecutableAction.java:66)
        at 
org.eclipse.equinox.p2.publisher.eclipse.ApplicationLauncherAction.perform(ApplicationLauncherAction.java:68)
        at 
org.eclipse.equinox.p2.publisher.eclipse.ProductAction.perform(ProductAction.java:91)
        at 
org.eclipse.buckminster.pde.tasks.ProductAction.perform(ProductAction.java:137)
        at 
org.eclipse.equinox.p2.publisher.Publisher$ArtifactProcess.run(Publisher.java:207)
        at 
org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.executeBatch(SimpleArtifactRepository.java:1034)
        at 
org.eclipse.equinox.p2.publisher.Publisher.publish(Publisher.java:231)
        at 
org.eclipse.buckminster.pde.internal.actor.P2SiteGenerator.run(P2SiteGenerator.java:333)
        at 
org.eclipse.buckminster.pde.internal.actor.P2SiteGenerator.internalPerform(P2SiteGenerator.java:430)
        at 
org.eclipse.buckminster.core.actor.AbstractActor.perform(AbstractActor.java:186)
        at 
org.eclipse.buckminster.core.internal.actor.PerformManager$DirectActionInvocation.execute(PerformManager.java:143)
        at 
org.eclipse.buckminster.core.internal.actor.PerformManager.internalPerform(PerformManager.java:454)
        at 
org.eclipse.buckminster.core.internal.actor.PerformManager.perform(PerformManager.java:293)
        at 
org.eclipse.buckminster.core.internal.actor.PerformManager.perform(PerformManager.java:305)
        at 
org.eclipse.buckminster.ui.InvokeAction$ActionJob.runInWorkspace(InvokeAction.java:81)
        at 
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The reason is very likely a typo in BrandingIron.java (see patch below): the original file (before branding) is named "eclipse.ini" (at least on my Linux system) but the BrandingIron looks for "Eclipse.ini" and thus does not find and copy it over to the branded directory.

Reproducible: Always
Comment 1 Thorsten Meinl CLA 2010-08-29 10:06:17 EDT
Created attachment 177684 [details]
Patch to BrandingIron.java that fixed the problem
Comment 2 Thomas Hallgren CLA 2010-08-29 16:29:52 EDT
Patch applied with some modification. The logic will check for both Eclipse.ini and eclipse.ini. IIRC the former can be present under some circumstances. Don't remember which but I thought it saver to keep checking for both.

While fixing this I also changed some System.out.println() to proper logger calls. This will enable stack trace output in debug mode.

Applied to helios-maintencance, rev 11577.
Comment 3 Thorsten Meinl CLA 2010-10-01 09:33:03 EDT
It seems that in some rare cases my patch causes a NullPointerException (which is very hard to track down...). If the project containing the icons does not exists at all, a resource handle is returned, but the following call to findMember returns null which causes an NPE in the next line. This should be checked upon. Minor patch follows.
Comment 4 Thorsten Meinl CLA 2010-10-01 09:33:30 EDT
Created attachment 180053 [details]
Fix for NPE