Skip to content

Commit

Permalink
Merge pull request #896 from jamezp/issue894
Browse files Browse the repository at this point in the history
[894] Use the formattedCode for the formattedHash.
  • Loading branch information
hazendaz authored Jun 4, 2024
2 parents 21d0826 + c3c9bad commit e2ac804
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/net/revelc/code/formatter/FormatterMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -806,19 +806,19 @@ protected void doFormatFile(final File file, final ResultCollector rc, final Pro
formattedHash = originalHash;
// Default to formatted hashing for unknown type otherwise include formatter options
} else if (file.getName().endsWith(".java")) {
formattedHash = this.sha512hash(originalCode + this.javaFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.javaFormatter.getOptions().hashCode());
} else if (file.getName().endsWith(".js")) {
formattedHash = this.sha512hash(originalCode + this.jsFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.jsFormatter.getOptions().hashCode());
} else if (file.getName().endsWith(".html")) {
formattedHash = this.sha512hash(originalCode + this.htmlFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.htmlFormatter.getOptions().hashCode());
} else if (file.getName().endsWith(".xml")) {
formattedHash = this.sha512hash(originalCode + this.xmlFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.xmlFormatter.getOptions().hashCode());
} else if (file.getName().endsWith(".json")) {
formattedHash = this.sha512hash(originalCode + this.jsonFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.jsonFormatter.getOptions().hashCode());
} else if (file.getName().endsWith(".css")) {
formattedHash = this.sha512hash(originalCode + this.cssFormatter.getOptions().hashCode());
formattedHash = this.sha512hash(formattedCode + this.cssFormatter.getOptions().hashCode());
} else {
formattedHash = this.sha512hash(originalCode);
formattedHash = this.sha512hash(formattedCode);
}
hashCache.setProperty(path, formattedHash);
this.hashCacheWritten = true;
Expand Down

0 comments on commit e2ac804

Please sign in to comment.