From c3c9bada697c26788f85e67e1be3e2c80f48e99d Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Mon, 3 Jun 2024 16:18:15 -0700 Subject: [PATCH] [894] Use the formattedCode for the formattedHash. resolves #894 Signed-off-by: James R. Perkins --- .../net/revelc/code/formatter/FormatterMojo.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/revelc/code/formatter/FormatterMojo.java b/src/main/java/net/revelc/code/formatter/FormatterMojo.java index c1245ac9..43ff8e4a 100644 --- a/src/main/java/net/revelc/code/formatter/FormatterMojo.java +++ b/src/main/java/net/revelc/code/formatter/FormatterMojo.java @@ -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;