[
https://issues.apache.org/jira/browse/ARIES-1423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14935084#comment-14935084
]
John Ross commented on ARIES-1423:
----------------------------------
The commit was http://svn.apache.org/viewvc?rev=1704916&view=rev.
The relevant comment was "Second, fix issue where a
java.lang.StringIndexOutOfBoundsException can be received from
AbstractClauseBasedHeader.toString() because a header with an empty string
value was allowed to be created. One constructor will throw an IAE if there are
no clauses, the other does not. Make it consistent. Since the specification
does not allow empty string header values, continue to throw the IAE..."
Strictly speaking, an empty header is invalid syntax. One with empty quotes is
not. For example,
Build-Plan: ""
Build-Number: ""
My concern is that there are many places that rely on the protection that only
syntactically valid headers will make it through the gauntlet, so allowing it
here could lead to unexpected behaviour elsewhere (such as that
StringIndexOutOfBoundsException) There are two other places that also throw an
IAE if given an empty header value (i.e. AbstractHeader(String, String) and
AbstractClauseBasedHeader(Collection)), so whatever we do, it should be
consistent across the board.
I personally prefer the stricter approach but would like to hear what the best
practices are considered to be within the Aries and broader Apache community
with regard to this matter.
Do you consider this to be a blocking issue?
> IllegalArgumentException when GenericHeader has no clauses
> ----------------------------------------------------------
>
> Key: ARIES-1423
> URL: https://issues.apache.org/jira/browse/ARIES-1423
> Project: Aries
> Issue Type: Bug
> Components: Subsystem
> Affects Versions: subsystem-2.0.3
> Reporter: Wouter Bancken
> Fix For: subsystem-2.0.3
>
> Attachments: MANIFEST.MF
>
>
> When trying to install a subsystem which contains bundles that have a
> manifest that contains empty headers, the AbstractClauseBasedHeader throws an
> IllegalArgumentException.
> Example headers are (manifest attached to this issue)
> {code}
> Build-Plan:
> Build-Number:
> {code}
> The exception is caused by the rework of the AbstractClauseBasedHeader for
> ARIES-1387.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)