[
https://issues.apache.org/jira/browse/RAT-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065752#comment-13065752
]
Stefan Bodewig commented on RAT-34:
-----------------------------------
I stumbled over this when I refactored the AbstractLicenseAppender code. The
same is true for XML files without an XML decl which would need a slightly
different resolution (the XML decl has to be added so we can add the comment).
I'd prefer the second option myself in particular since we don't have any
documentation anyway.
> No license header added for java files that do not contain project line
> -----------------------------------------------------------------------
>
> Key: RAT-34
> URL: https://issues.apache.org/jira/browse/RAT-34
> Project: RAT
> Issue Type: Bug
> Affects Versions: 0.6
> Reporter: Gavin
>
> When using the -a cmd line switch to automatically add license headers to
> java files, no license headers will be added unless the java file contains
> the 'package' line. This is currently by design. Ideas for change include :-
> 1. Do nothing (almost) - Document that a package line must exist and that the
> license will be appended after that line. Therefore you are actively forcing
> this limitation as an intentional design feature.
> If this route is chosen then you should bail out without writing a .new file
> if there is no package line, perhaps with a WARNING message appended to the
> output. A .new file is currently written anyway because the file has already
> been opened and written ("\n") to before that 'package' check above.
> 2. If no package line exists then put the license in anyway at the very top.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira