[rfc][icedtea-web] add switch to trim main-class attribute

Andrew Azores aazores at redhat.com
Tue Nov 10 16:37:16 UTC 2015


On 07/11/15 03:09 AM, Jiri Vanek wrote:
> On 11/06/2015 04:03 PM, Andrew Azores wrote:
>> On 06/11/15 09:41 AM, Jiri Vanek wrote:
>>> Hello!
>>>
>>>
>>> I'm bugged at elast once per month  last half a year  "oracle can parse
>>> this jnlp, itw can not". The cause is always same - white char on start
>>> or end of amin-class attribute value.
>>>
>>> This patch is for head, and is adding warning when white-char is there
>>> and is adding new Xtrimmainclass javaws switch, which will allow
>>> trimming (if there si whitechat).
>>>
>>> I would like to backport to 1.6 the refactoring of Parser to allow print
>>> this warning also there (so no new switch for 1.6)
>>>
>>>
>>> I recall several discussions about triming by default, and the resutl
>>> was always no. If mood changes I'm 60:40 ok to change this for head.
>>>
>>> Thoughts?
>>>
>>>
>>>   J.
>>>
>>>
>>> unittests and reproducers on way as separate changeset...
>>
>> Code looks fine to me, just one thing:
>>
>>> +    private static final Pattern enyWhiteSpace =
>>> Pattern.compile("\\s");
>>
>> s/enyWhiteSpace/anyWhiteSpace/g
>>
>> FWIW I do think the better approach is to offer this capability but
>> leave it off by default (as you've done here).
>>
>
>
> Thank you!
>
>
> Jacob brought up the question of trimming by default.
>
> May you pledge some thoghts to that thread?
>
>
> J.

1) I think we're all on just about the same page here - the end result 
should be trimming of whitespace characters from the beginning and end 
of the contents of the Main-Class attribute. Whitespaces "in the middle" 
of the attribute should not be touched, characters at the beginning and 
end should only be touched if they are whitespace, etc.

2) If (1) is properly implemented then I think it's acceptable to enable 
this by default even without any additional configurable options or 
command line switches. I would slightly prefer to enable it via a switch 
or other option, simply so that the default run mode is a more strict 
setting and users/developers are more likely to notice that there is 
actually a problem with their JNLP being malformed. However, I'm sure 
many users who run into this will not investigate far enough to even see 
that we issue an error specifically pointing out where the problem is 
and suggesting a switch that can be used to effect a workaround... so 
enabling by default is more user-friendly, which should be more important.

-- 
Thanks,

Andrew Azores


More information about the distro-pkg-dev mailing list