Fwd: Re: RFR(xxs): 8072935: Fix missing newline at end of file after 8067447

Erik Joelsson erik.joelsson at oracle.com
Mon Feb 23 14:10:44 UTC 2015


(replying to fix CC to actual code-tools-dev mailing list)
/Erik

On 2015-02-16 11:55, Volker Simonis wrote:
> On Mon, Feb 16, 2015 at 11:01 AM, Erik Joelsson
> <erik.joelsson at oracle.com> wrote:
>> On 2015-02-13 18:18, Volker Simonis wrote:
>>> On Fri, Feb 13, 2015 at 12:32 PM, Erik Joelsson
>>> <erik.joelsson at oracle.com> wrote:
>>>> I would suggest that. I'm not sure if all the checks apply to .properties
>>>> files, but certainly the line ending at end of file needs care when
>>>> processing .properties files with sed on certain platforms. Tabs obviously
>>>> need to be allowed in Makefiles, but other than that I see no reason for
>>>> exceptions. Is there a way to run jcheck on existing code to see if any
>>>> fixes are needed?
>>> Not sure, but I don't think so. You can give jcheck a range of
>>> revisions to test (e.g. hg jcheck -r 1:5) but that's not what we
>>> actually want.
>>>
>>> I think having such an extension to jcheck would be useful (especially
>>> for the folks who develop new jcheck filters) but probably another
>>> change.
>> Certainly another change.
>>> I also noticed (by running Martins script) that we have a lot of files
>>> with more than one newline at the end of file (in the hotspot forest
>>> it's three in ./agent, 133 in ./test and 77 in ./src). So we should
>>> either relax the requirement of having "exactly one newline at the
>>> eof" into "having at least one newline at the eof" or we have to first
>>> fix the corresponding files in one big change.
>>>
>>> What do you think? Probably we'll have to move this discussion back to
>>> corresponding group lists because they will actually have to decide
>>> this :)
>> If we enforce no trailing whitespace, then enforcing exactly one newline
>> doesn't seem unreasonable to me. Cleaning up the code to actually conform to
>> a new standard will need to be brought to each group with offending code.
>>
> OK. Should I create a RFE and bring this up on the HotSpot list?
>
>> /Erik
>>
>>
>>>> /Erik
>>>>
>>>>
>>>>> Regards,
>>>>> Volker
>>>>>
>>>>>
>>>>> On Fri, Feb 13, 2015 at 11:35 AM, Erik Joelsson
>>>>> <erik.joelsson at oracle.com> wrote:
>>>>>> If we are to create such a check, please also include .gmk,
>>>>>> .properties,
>>>>>> .m4
>>>>>> and Makefile. In JDK-8072950 I'm adding a workaround for missing line
>>>>>> endings in properties files.
>>>>>>
>>>>>> /Erik
>>>>>>
>>>>>>
>>>>>> On 2015-02-13 11:09, David Holmes wrote:
>>>>>>> On 13/02/2015 7:23 PM, Volker Simonis wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> could somebody please sponsor and push this change.
>>>>>>>
>>>>>>> Push it to where, as what? I thought you wanted a jcheck addition.
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Volker
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Feb 13, 2015 at 7:49 AM, Martin Buchholz
>>>>>>>> <martinrb at google.com>
>>>>>>>> wrote:
>>>>>>>>> Source files should have exactly one trailing newline.
>>>>>>>>>
>>>>>>>>> find -iregex '.*\.\(java\|txt\|c\|cc\|h\|hpp\|cpp\)$' | xargs perl
>>>>>>>>> -0777
>>>>>>>>> -ne
>>>>>>>>> 'print "Must have exactly one trailing newline: $ARGV\n" unless
>>>>>>>>> m~[^\n]\Z~s'
>>>>>>>>>
>>>>>>>>>



More information about the code-tools-dev mailing list