Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adding license header to files larger than 2048 bytes #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 29, 2021

  1. Fix adding license header to files larger than 2048 bytes

    The `BufferedReader` in `PreparedCommentHeader#update()` is initialized with a read-ahead limit of 2048 bytes.
    
    If a file is larger than that, the mark will be invalidated while the `update()` method skips through the file line-by-line and when no valid existing license header was detected, the `BufferedReader#reset()` method will fail.
    
    ```text
    java.io.IOException: Mark invalid
    	at java.base/java.io.BufferedReader.reset(BufferedReader.java:517)
    	at java_io_BufferedReader$reset$1.call(Unknown Source)
    	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
    	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
    	at org.cadixdev.gradle.licenser.header.PreparedCommentHeader$_update_closure2.doCall(PreparedCommentHeader.groovy:84)
    ```
    joschi committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    0d8612e View commit details
    Browse the repository at this point in the history