Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.2
-
None
-
None
-
Patch
Description
The ManifestResourceTransformer class declares a map called manifestEntries with a signature of Map<String, Attributes>. This is incorrect because at runtime this map is actually only ever populated with String values. Furthermore the only place where these map values are used is:
and while the signature of Attributes.put accepts values of any type, the javadoc states that values are checked that they are Strings at runtime:
In fact it turns out that you can change the manifestEntries Map signature to use any type for the value without getting a compile error - and at runtime it's ignored by the code populating the configuration. I only happened to notice this discrepancy when investigating a related issue involving a stricter version of the plexus MapConverter that checks generic bounds when populating maps:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429369
The correct signature of manifestEntries should be Map<String, String>
Attachments
Attachments
Issue Links
- is duplicated by
-
MSHADE-183 Getting "Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String" error when using ManifestResourceTransformer with Maven 3.2.5
- Closed
- relates to
-
MNG-5534 Update to Sisu 0.3.0M1 and Guice 3.2.3
- Closed