Author: tchemit Date: 2010-04-15 12:42:31 +0200 (Thu, 15 Apr 2010) New Revision: 1748 Log: Anomalie #524: Should not touch file if license is up to date Modified: trunk/src/main/java/org/nuiton/license/plugin/header/FileHeaderFilter.java Modified: trunk/src/main/java/org/nuiton/license/plugin/header/FileHeaderFilter.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/header/FileHeaderFilter.java 2010-04-15 10:21:14 UTC (rev 1747) +++ trunk/src/main/java/org/nuiton/license/plugin/header/FileHeaderFilter.java 2010-04-15 10:42:31 UTC (rev 1748) @@ -106,11 +106,21 @@ // update header String newHeader = treateHeader(ch); - if (!ch.equals(newHeader)) { + if (log.isDebugEnabled()) { + log.debug("old header =\n" + ch); + log.debug("new header =\n" + newHeader); + } + if (!newHeader.contains(ch.trim())) { + // this is a weak test, but should be more enough + // if the new header contains the old one, it would be + // bad luck to not have equality ? + //TODO-TC-20100415 : use an exact test (must remove process tag on new header) +// if (!ch.equals(newHeader)) { // header content was modified, mark it modified = true; } + return newHeader; } // Means we detects the process start tag but not the end one.