Skip to content

Apache Lucene open-source search software

make rat pickier if the license header is screwed up

Robert Muir4de12fe628fd
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java
index 2b56245d209..052878028e3 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java
@@ -1,10 +1,18 @@
/*
- * Licensed under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.lucene.analysis.commongrams;
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/sep/IntIndexOutput.java b/lucene/codecs/src/java/org/apache/lucene/codecs/sep/IntIndexOutput.java
index e2ab76fb329..c3f9fe2945f 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/sep/IntIndexOutput.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/sep/IntIndexOutput.java
@@ -1,7 +1,7 @@
package org.apache.lucene.codecs.sep;
-/**
- * LICENSED to the Apache Software Foundation (ASF) under one or more
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 0b023247752..a76bda759ce 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -1537,6 +1537,14 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<pattern substring="Permission is hereby granted, free of charge, to any person obtaining a copy"/>
</rat:substringMatcher>
+ <!-- apache -->
+ <rat:substringMatcher licenseFamilyCategory="AL "
+ licenseFamilyName="Apache">
+ <pattern substring="Licensed to the Apache Software Foundation (ASF) under"/>
+ <!-- this is the old-school one under some files -->
+ <pattern substring="Licensed under the Apache License, Version 2.0 (the &quot;License&quot;)"/>
+ </rat:substringMatcher>
+
<rat:substringMatcher licenseFamilyCategory="GEN "
licenseFamilyName="Generated">
<!-- svg files generated by gnuplot -->
@@ -1548,7 +1556,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</rat:substringMatcher>
<!-- built in approved licenses -->
- <rat:approvedLicense familyName="Apache License Version 2.0"/>
+ <rat:approvedLicense familyName="Apache"/>
<rat:approvedLicense familyName="The MIT License"/>
<rat:approvedLicense familyName="Modified BSD License"/>
<rat:approvedLicense familyName="Generated"/>
@@ -1558,7 +1566,12 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<echo>${rat.output}</echo>
<delete>
<fileset file="${rat.sources.logfile}">
- <containsregexp expression="^0 Unknown Licenses"/>
+ <and>
+ <containsregexp expression="^0 Unknown Licenses"/>
+ <not>
+ <containsregexp expression="^\s+!AL"/>
+ </not>
+ </and>
</fileset>
</delete>
<!-- fail if we didnt find the pattern -->