Request for review: 8017611: Auto corrector for mistyped vm options
Vladimir Kozlov
vladimir.kozlov at oracle.com
Wed Jun 26 15:27:52 PDT 2013
Tao,
I would like to see it also and additional changes could be very simple:
+ jio_fprintf(defaultStream::error_stream(),
+ "Did you mean '%s%s'?\n", fuzzy_matched->name,
(fuzzy_matched->is_bool() ? "" : "="));
so it would always print '=' for assignable flags. May be also '=X'
instead of simple '=':
Did you mean 'ObjectAlignmentInBytes=X'?
Thanks,
Vladimir
On 6/26/13 3:09 PM, Tao Mao wrote:
> Hi Harold,
>
> This CR only deals with correcting VM option *names*.
>
> If this case needs to be resolved, it would be better to create another
> CR. See how many outcomes you'll get when you try out "~!@#$%^&*()_+" to
> replace "=" here.
>
> Thanks.
> Tao
>
> On 6/26/13 2:45 PM, harold seigel wrote:
>> Hi Tao,
>>
>> This is a big help.
>>
>> In a case like this:
>>
>> % $JAVA_HOME/bin/java -XX:ObjectAlignmentInBytes:16 -version
>> Unrecognized VM option 'ObjectAlignmentInBytes:16'
>>
>>
>> would it ask you: Did you mean ObjectAlignmentInBytes*=* ?
>>
>> Thanks, Harold
>>
>> On 6/26/2013 5:19 PM, Tao Mao wrote:
>>> new webrev:
>>> http://cr.openjdk.java.net/~tamao/8017611/webrev.01/
>>>
>>> diff from the last webrev:
>>> (1) put more restrictive type check when passing strings.
>>> (2) move VMOptionsFuzzyMatchSimilarity to be a local constant.
>>> (3) simplify routine str_similar()
>>> (4) add jtreg test
>>>
>>> Suggestions are taken from Dmitry, Bengt, Vladimir and Christian.
>>> Thank you all.
>>>
>>> Tao
>>>
>>>
>>> On 6/25/13 10:44 AM, Tao Mao wrote:
>>>> I'm kinda tired of mistyping VM options and figuring it out
>>>> "mentally"...let machines do it then.
>>>>
>>>> changeset:
>>>> Currently, when we mistype VM options you will get the warning as
>>>> following
>>>>
>>>> $java -XX:+UseParalelGC -version
>>>> Unrecognized VM option 'UseParalelGC'
>>>>
>>>> I think we can do one step further to interpret the user's intent
>>>> and suggest the correct VM options. Then i start to imagine that we
>>>> have something like this
>>>>
>>>> $java -XX:+UseParalelGC -version
>>>> Unrecognized VM option 'UseParalelGC'
>>>> Did you mean 'UseParallelGC'?
>>>>
>>>> Please refer to the wikipedia
>>>> http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient
>>>> to get an idea of obtaining string similarity. This new feature is
>>>> based on this theory.
>>>>
>>>> webrev:
>>>> http://cr.openjdk.java.net/~tamao/8017611/webrev.00/
>>>>
>>>> Please try out this patch and see if it meets some need.
>>>>
>>>> Thanks.
>>>> Tao
>>
More information about the hotspot-dev
mailing list