Bug 408718 - PomVersionErrorReporter#validate throws IOE: invalid header field
Summary: PomVersionErrorReporter#validate throws IOE: invalid header field
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.3 RC2   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: example
Depends on:
Blocks:
 
Reported: 2013-05-22 12:03 EDT by Dani Megert CLA
Modified: 2013-05-23 05:32 EDT (History)
0 users

See Also:
daniel_megert: review+


Attachments
Use OSGi's manifest parser (4.21 KB, patch)
2013-05-22 17:18 EDT, Curtis Windatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2013-05-22 12:03:19 EDT
exported master code and ran my IDE with it.

Found in .log:

!ENTRY org.eclipse.releng.tools 4 0 2013-05-22 15:35:12.231
!MESSAGE invalid header field
!STACK 0
java.io.IOException: invalid header field
	at java.util.jar.Attributes.read(Attributes.java:410)
	at java.util.jar.Manifest.read(Manifest.java:199)
	at java.util.jar.Manifest.<init>(Manifest.java:69)
	at org.eclipse.releng.tools.pomversion.PomVersionErrorReporter.validate(PomVersionErrorReporter.java:270)
	at org.eclipse.releng.tools.pomversion.PomVersionErrorReporter$PomResourceDeltaVisitor.visit(PomVersionErrorReporter.java:112)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
	at org.eclipse.releng.tools.pomversion.PomVersionErrorReporter.resourceChanged(PomVersionErrorReporter.java:363)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
	at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:382)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:146)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Comment 1 Curtis Windatt CLA 2013-05-22 17:18:48 EDT
Created attachment 231336 [details]
Use OSGi's manifest parser

This fix avoids logging exceptions when reading the manifest, but it also makes a few additional changes

1) Uses the OSGi manifest parser to create headers, this might have some additional capabilities over the JRE's parser.
2) Changed the header name to the OSGi constant.
3) Catches the illegal argument exception you get from a bad version string. Uses Version.parseVersion() over the constructor as it explicitly throws the exception.
Comment 2 Dani Megert CLA 2013-05-23 04:47:05 EDT
I was not able to reproduce this today on the same workspace.

Committed your patch with http://git.eclipse.org/c/platform/eclipse.platform.releng.git/commit/?id=d6714169a547dce7ffb42622aebf824d58681f57
Comment 3 Dani Megert CLA 2013-05-23 05:32:06 EDT
Verified in I20130522-2000.

Remaining issue is covered by bug 408718.