dsmiley commented on code in PR #4569:
URL: https://github.com/apache/solr/pull/4569#discussion_r3520176152


##########
gradle/validation/validate-source-patterns.gradle:
##########
@@ -171,32 +157,33 @@ class ValidateSourcePatternsTask extends DefaultTask {
     def javadocsPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
     def javaCommentPattern = ~$/(?sm)^\Q/*\E(.*?)\Q*/\E/$;
     def xmlCommentPattern = ~$/(?sm)\Q<!--\E(.*?)\Q-->\E/$;
-    def lineSplitter = ~$/[\r\n]+/$;
-    def licenseMatcher = Defaults.createDefaultMatcher();
     def validLoggerPattern = 
~$/(?s)\b(private\s|static\s|final\s){3}+\s*Logger\s+\p{javaJavaIdentifierStart}+\s+=\s+\QLoggerFactory.getLogger(MethodHandles.lookup().lookupClass());\E/$;
     def validLoggerNamePattern = 
~$/(?s)\b(private\s|static\s|final\s){3}+\s*Logger\s+log+\s+=\s+\QLoggerFactory.getLogger(MethodHandles.lookup().lookupClass());\E/$;
     def packagePattern = ~$/(?m)^\s*package\s+org\.apache.*;/$;
     def xmlTagPattern = ~$/(?m)\s*<[a-zA-Z].*/$;
     def extendsLuceneTestCasePattern = 
~$/public.*?class.*?extends.*?LuceneTestCase[^\n]*?\n/$;
     def validSPINameJavadocTag = ~$/(?s)\s*\*\s*@lucene\.spi\s+\{@value 
#NAME\}/$;
 
-    def isLicense = {matcher, ratDocument ->
-      licenseMatcher.reset()
-      return lineSplitter.split(matcher.group(1)).any 
{licenseMatcher.match(ratDocument, it)}
+    // Detects whether a comment block contains Apache license header text.
+    def isLicense = { matcher ->
+      def content = matcher.group(1)
+      content.contains('Licensed to the Apache Software Foundation') ||

Review Comment:
   indeed; acceptable trade-off.  Prefer to keep things simple.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to