mirror of https://github.com/apache/lucene.git
LUCENE-10419: revert debugging changes.
This commit is contained in:
parent
50b7e2970f
commit
a861ff8df2
|
@ -173,22 +173,8 @@ class ValidateSourcePatternsTask extends DefaultTask {
|
||||||
def validSPINameJavadocTag = ~$/(?s)\s*\*\s*@lucene\.spi\s+\{@value #NAME\}/$;
|
def validSPINameJavadocTag = ~$/(?s)\s*\*\s*@lucene\.spi\s+\{@value #NAME\}/$;
|
||||||
|
|
||||||
def isLicense = { matcher, ratDocument ->
|
def isLicense = { matcher, ratDocument ->
|
||||||
boolean retValue = false
|
|
||||||
Exception rethrow = null
|
|
||||||
int retries = 5
|
|
||||||
do {
|
|
||||||
try {
|
|
||||||
licenseMatcher.reset()
|
licenseMatcher.reset()
|
||||||
retValue = lineSplitter.split(matcher.group(1)).any { licenseMatcher.match(ratDocument, it) }
|
return lineSplitter.split(matcher.group(1)).any { licenseMatcher.match(ratDocument, it) }
|
||||||
if (retValue) break
|
|
||||||
} catch (StringIndexOutOfBoundsException | RuntimeException e) {
|
|
||||||
logger.error("Exception thrown=" + e + ", retries: " + retries + ", matcher.group(1)=" + matcher.group(1))
|
|
||||||
rethrow = e
|
|
||||||
}
|
|
||||||
} while (retries-- > 0)
|
|
||||||
|
|
||||||
if (rethrow != null) throw rethrow
|
|
||||||
return retValue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def checkLicenseHeaderPrecedes = { f, description, contentPattern, commentPattern, text, ratDocument ->
|
def checkLicenseHeaderPrecedes = { f, description, contentPattern, commentPattern, text, ratDocument ->
|
||||||
|
@ -218,12 +204,11 @@ class ValidateSourcePatternsTask extends DefaultTask {
|
||||||
progress.start(this.name, this.name)
|
progress.start(this.name, this.name)
|
||||||
|
|
||||||
sourceFiles.each { f ->
|
sourceFiles.each { f ->
|
||||||
|
try {
|
||||||
progress.progress("Scanning ${f.name}")
|
progress.progress("Scanning ${f.name}")
|
||||||
logger.debug('Scanning source file: {}', f);
|
logger.debug('Scanning source file: {}', f);
|
||||||
|
|
||||||
def text = f.getText('UTF-8');
|
def text = f.getText('UTF-8');
|
||||||
|
|
||||||
try {
|
|
||||||
invalidPatterns.each { pattern, name ->
|
invalidPatterns.each { pattern, name ->
|
||||||
if (pattern.matcher(text).find()) {
|
if (pattern.matcher(text).find()) {
|
||||||
reportViolation(f, name);
|
reportViolation(f, name);
|
||||||
|
@ -272,7 +257,7 @@ class ValidateSourcePatternsTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
throw new GradleException("Unhandled exception while validating patterns on file: " + f + ", content: >>" + text + "<<", e)
|
throw new GradleException("Unhandled exception while validating patterns on file: " + f, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue