• Andy Wilkinson's avatar
    Truncate files before writing new content to them · 63402a29
    Andy Wilkinson authored
    Previously, UpgradeApplicator would open build.gradle
    using open options that left the fields existing content intact. It
    would then write the new content at the beginning of the file. If
    the new content was n bytes shorter than the existing content, this
    would leave n bytes of the existing content at the end of the file.
    
    This commit updates UpgradeApplicator to truncate the existing file
    when it opens it. This ensures that the existing content is
    completely replaced by the new content, irrespective of their lengths.
    
    Closes gh-25256
    63402a29
Name
Last commit
Last update
.github Loading commit data...
buildSrc Loading commit data...
ci Loading commit data...
eclipse Loading commit data...
git/hooks Loading commit data...
gradle/wrapper Loading commit data...
idea Loading commit data...
spring-boot-project Loading commit data...
spring-boot-tests Loading commit data...
src Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
SUPPORT.adoc Loading commit data...
build.gradle Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle Loading commit data...