LUCENE-7013: add licence header position checker to -validate-source-patterns, and fix the violations it found

This commit is contained in:
Steve Rowe 2016-07-13 13:17:50 -04:00
parent 4339328982
commit 629346febb
99 changed files with 463 additions and 433 deletions

View File

@ -166,10 +166,17 @@
}
def javadocsPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
def commentPattern = ~$/(?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 packagePattern = ~$/(?m)^\s*package\s+org\.apache.*;/$;
def isLicense = { matcher, ratDocument ->
licenseMatcher.reset();
return lineSplitter.split(matcher.group(1)).any{ licenseMatcher.match(ratDocument, it) };
}
ant.fileScanner{
fileset(dir: baseDir){
extensions.each{
@ -197,17 +204,32 @@
}
}
def javadocsMatcher = javadocsPattern.matcher(text);
def ratDocument = new FileDocument(f);
while (javadocsMatcher.find()) {
def ratDocument = new FileDocument(f);
licenseMatcher.reset();
if (lineSplitter.split(javadocsMatcher.group(1)).any{ licenseMatcher.match(ratDocument, it) }) {
if (isLicense(javadocsMatcher, ratDocument)) {
reportViolation(f, String.format(Locale.ENGLISH, 'javadoc-style license header [%s]',
ratDocument.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME)));
}
}
if (f.toString().endsWith('.java') && text.contains('org.slf4j.LoggerFactory')) {
if (!validLoggerPattern.matcher(text).find()) {
reportViolation(f, 'invalid logging pattern [not private static final, uses static class name]');
if (f.toString().endsWith('.java')) {
if (text.contains('org.slf4j.LoggerFactory')) {
if (!validLoggerPattern.matcher(text).find()) {
reportViolation(f, 'invalid logging pattern [not private static final, uses static class name]');
}
}
def packageMatcher = packagePattern.matcher(text);
if (packageMatcher.find()) {
def packageStartPos = packageMatcher.start();
def commentMatcher = commentPattern.matcher(text);
while (commentMatcher.find()) {
if (isLicense(commentMatcher, ratDocument)) {
if (commentMatcher.start() < packageStartPos) {
break; // This file is all good, so break loop: license header precedes package definition
} else {
reportViolation(f, 'package declaration precedes license header');
}
}
}
}
}
};

View File

@ -16,6 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.charfilter;
import java.io.IOException;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.charfilter;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.analysis.minhash;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -16,6 +14,9 @@ package org.apache.lucene.analysis.minhash;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.minhash;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.analysis.minhash;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -16,6 +14,9 @@ package org.apache.lucene.analysis.minhash;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.minhash;
import java.util.Map;
import org.apache.lucene.analysis.TokenStream;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated from IANA Root Zone Database <http://www.internic.net/zones/root.zone>
// file version from Friday, December 6, 2013 4:34:10 AM UTC
// generated on Friday, December 6, 2013 3:21:59 PM UTC
@ -363,4 +364,3 @@ ASCIITLD = "." (
| [zZ][mM]
| [zZ][wW]
) "."? // Accept trailing root (empty) domain

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;
import java.io.IOException;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;
import java.io.Reader;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;

View File

@ -1,7 +1,5 @@
// DO NOT EDIT THIS FILE! Use "ant unicode-data" to recreate.
package org.apache.lucene.analysis.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -19,6 +17,8 @@ package org.apache.lucene.analysis.util;
* limitations under the License.
*/
package org.apache.lucene.analysis.util;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.SparseFixedBitSet;

View File

@ -16,6 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.wikipedia;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.wikipedia;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.analysis.minhash;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.analysis.minhash;
* limitations under the License.
*/
package org.apache.lucene.analysis.minhash;
import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;

View File

@ -44,8 +44,6 @@ def unicodeVersion = UCharacter.getUnicodeVersion().toString();
def code = """
// DO NOT EDIT THIS FILE! Use "ant unicode-data" to recreate.
package org.apache.lucene.analysis.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -63,6 +61,8 @@ package org.apache.lucene.analysis.util;
* limitations under the License.
*/
package org.apache.lucene.analysis.util;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.SparseFixedBitSet;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;
import java.io.IOException;

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.analysis.standard;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.index;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.index;
* limitations under the License.
*/
package org.apache.lucene.index;
import java.io.IOException;
import org.apache.lucene.codecs.DocValuesProducer;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.index;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.index;
* limitations under the License.
*/
package org.apache.lucene.index;
import java.io.IOException;
import java.util.Arrays;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.store;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.store;
* limitations under the License.
*/
package org.apache.lucene.store;
import java.io.IOException;
/**

View File

@ -1,5 +1,3 @@
package org.apache.lucene.codecs.lucene62;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.codecs.lucene62;
* limitations under the License.
*/
package org.apache.lucene.codecs.lucene62;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseSegmentInfoFormatTestCase;
import org.apache.lucene.util.TestUtil;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.index;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.index;
* limitations under the License.
*/
package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.facet.taxonomy.directory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.facet.taxonomy.directory;
* limitations under the License.
*/
package org.apache.lucene.facet.taxonomy.directory;
import java.io.IOException;
import java.util.HashSet;
import java.util.Random;

View File

@ -1,3 +1,20 @@
/*
* 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.search.join;
import java.io.IOException;
@ -32,23 +49,6 @@ import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.FixedBitSet;
/*
* 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.
*/
// A TermsIncludingScoreQuery variant for point values:
abstract class PointInSetIncludingScoreQuery extends Query {

View File

@ -1,5 +1,3 @@
package org.apache.lucene.store;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.store;
* limitations under the License.
*/
package org.apache.lucene.store;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.store;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.store;
* limitations under the License.
*/
package org.apache.lucene.store;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.Closeable;
import java.io.IOException;
import java.util.Locale;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
/** Holds metadata details about a single file that we use to confirm two files (one remote, one local) are in fact "identical".
*
* @lucene.experimental */

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.Closeable;
import java.io.EOFException;
import java.io.FileNotFoundException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
/**
* Should be thrown by subclasses of {@link PrimaryNode} and {@link ReplicaNode} if a non-fatal exception
* occurred while communicating between nodes.

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
/** A merged segment warmer that pre-copies the merged segment out to
* replicas before primary cuts over to the merged segment. This
* ensures that NRT reopen time on replicas is only in proportion to

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Collections;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.NoSuchFileException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.Closeable;
import java.io.IOException;
import java.util.PriorityQueue;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedOutputStream;
import java.io.EOFException;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedOutputStream;
import java.io.EOFException;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.replicator.nrt;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.replicator.nrt;
* limitations under the License.
*/
package org.apache.lucene.replicator.nrt;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintStream;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.spatial.geopoint.document;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.spatial.geopoint.document;
* limitations under the License.
*/
package org.apache.lucene.spatial.geopoint.document;
import java.util.Objects;
import org.apache.lucene.analysis.TokenStream;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.spatial.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.spatial.util;
* limitations under the License.
*/
package org.apache.lucene.spatial.util;
import org.apache.lucene.spatial.geopoint.document.GeoPointField;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.LuceneTestCase;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.analysis;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.analysis;
* limitations under the License.
*/
package org.apache.lucene.analysis;
/** adds synonym of "dog" for "dogs", and synonym of "cavy" for "guinea pig". */
public class MockSynonymAnalyzer extends Analyzer {
@Override

View File

@ -1,5 +1,3 @@
package org.apache.lucene.analysis;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.analysis;
* limitations under the License.
*/
package org.apache.lucene.analysis;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.geo;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.geo;
* limitations under the License.
*/
package org.apache.lucene.geo;
import org.apache.lucene.util.SloppyMath;
/** Draws shapes on the earth surface and renders using the very cool http://www.webglearth.org.

View File

@ -1,5 +1,3 @@
package org.apache.lucene.mockfile;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.mockfile;
* limitations under the License.
*/
package org.apache.lucene.mockfile;
import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.FileSystem;

View File

@ -1,5 +1,3 @@
package org.apache.lucene.mockfile;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.lucene.mockfile;
* limitations under the License.
*/
package org.apache.lucene.mockfile;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;

View File

@ -1,18 +1,3 @@
package org.apache.solr.cloud;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.solr.cloud.OverseerMessageHandler.Lock;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.CollectionParams.LockLevel;
import org.apache.solr.common.util.StrUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -30,6 +15,21 @@ import org.slf4j.LoggerFactory;
* limitations under the License.
*/
package org.apache.solr.cloud;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.solr.cloud.OverseerMessageHandler.Lock;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.CollectionParams.LockLevel;
import org.apache.solr.common.util.StrUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is a utility class that offers fine grained locking for various Collection Operations
* This class is designed for single threaded operation. It's safe for multiple threads to use it

View File

@ -1,5 +1,3 @@
package org.apache.solr.core.backup.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.core.backup.repository;
* limitations under the License.
*/
package org.apache.solr.core.backup.repository;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Map;

View File

@ -1,5 +1,3 @@
package org.apache.solr.core.backup.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.core.backup.repository;
* limitations under the License.
*/
package org.apache.solr.core.backup.repository;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;

View File

@ -1,5 +1,3 @@
package org.apache.solr.core.backup.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.core.backup.repository;
* limitations under the License.
*/
package org.apache.solr.core.backup.repository;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;

View File

@ -1,5 +1,3 @@
package org.apache.solr.handler;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.handler;
* limitations under the License.
*/
package org.apache.solr.handler;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
@ -278,4 +278,4 @@ public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, P
}
}
}
}

View File

@ -1,5 +1,3 @@
package org.apache.solr.response;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.response;
* limitations under the License.
*/
package org.apache.solr.response;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
@ -164,4 +164,4 @@ public class GraphMLResponseWriter implements QueryResponseWriter {
return s;
}
}
}

View File

@ -1,18 +1,3 @@
package org.apache.solr.security;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import org.apache.solr.util.CommandOperation;
import static org.apache.solr.common.util.Utils.getDeepCopy;
import static org.apache.solr.handler.admin.SecurityConfHandler.getListValue;
import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -30,6 +15,20 @@ import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
* limitations under the License.
*/
package org.apache.solr.security;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import org.apache.solr.util.CommandOperation;
import static org.apache.solr.common.util.Utils.getDeepCopy;
import static org.apache.solr.handler.admin.SecurityConfHandler.getListValue;
import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
enum AutorizationEditOperation {
SET_USER_ROLE("set-user-role") {

View File

@ -1,3 +1,20 @@
/*
* 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.solr.security;
import java.util.Collection;
@ -19,24 +36,6 @@ import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
import static org.apache.solr.common.params.CommonParams.NAME;
/*
* 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.
*/
class Permission {
String name;
Set<String> path, role, collections, method;

View File

@ -1,5 +1,3 @@
package org.apache.solr.security;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.security;
* limitations under the License.
*/
package org.apache.solr.security;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

View File

@ -1,5 +1,3 @@
package org.apache.solr.update;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.update;
* limitations under the License.
*/
package org.apache.solr.update;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.LinkedHashMap;

View File

@ -1,3 +1,20 @@
/*
* 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.solr.update.processor;
import java.io.IOException;
@ -17,23 +34,6 @@ import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.update.AddUpdateCommand;
/*
* 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.
*/
/**
* This Class is a Request Update Processor to classify the document in input and add a field
* containing the class to the Document.

View File

@ -1,13 +1,3 @@
package org.apache.solr.update.processor;
import org.apache.lucene.index.LeafReader;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.IndexSchema;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -25,6 +15,16 @@ import org.apache.solr.schema.IndexSchema;
* limitations under the License.
*/
package org.apache.solr.update.processor;
import org.apache.lucene.index.IndexReader;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.IndexSchema;
/**
* This class implements an UpdateProcessorFactory for the Classification Update Processor.
* It takes in input a series of parameter that will be necessary to instantiate and use the Classifier

View File

@ -1,5 +1,3 @@
package org.apache.solr.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
package org.apache.solr.cloud;
import java.util.ArrayList;
import java.util.Properties;

View File

@ -1,3 +1,20 @@
/*
* 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.solr.cloud;
import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
@ -22,23 +39,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* 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.
*/
public class OverseerModifyCollectionTest extends AbstractFullDistribZkTestBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

View File

@ -1,3 +1,20 @@
/*
* 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.solr.cloud;
import java.io.ByteArrayOutputStream;
@ -20,23 +37,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
/*
* 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.
*/
public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
@BeforeClass

View File

@ -1,3 +1,20 @@
/*
* 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.solr.cloud;
import java.lang.invoke.MethodHandles;
@ -20,23 +37,6 @@ import static org.apache.solr.common.params.CollectionParams.CollectionAction.DE
import static org.apache.solr.common.params.CollectionParams.CollectionAction.MODIFYCOLLECTION;
import static org.apache.solr.common.params.CollectionParams.CollectionAction.SPLITSHARD;
/*
* 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.
*/
public class TestLockTree extends SolrTestCaseJ4 {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

View File

@ -1,5 +1,3 @@
package org.apache.solr.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
package org.apache.solr.cloud;
import java.lang.invoke.MethodHandles;
import java.util.Set;

View File

@ -1,5 +1,3 @@
package org.apache.solr.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
package org.apache.solr.cloud;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.cloud.SolrZkClient;

View File

@ -1,20 +1,3 @@
package org.apache.solr.cloud.rule;
import java.util.HashMap;
import java.util.Map;
import com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -32,6 +15,23 @@ import static org.mockito.Mockito.when;
* limitations under the License.
*/
package org.apache.solr.cloud.rule;
import java.util.HashMap;
import java.util.Map;
import com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
public class ImplicitSnitchTest {
private ImplicitSnitch snitch;
@ -184,4 +184,4 @@ public class ImplicitSnitchTest {
assertFalse(snitch.isKnownTag("ip_5"));
}
}
}

View File

@ -1,5 +1,21 @@
package org.apache.solr.core;
/*
* 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.solr.core;
import java.io.IOException;
import java.nio.ByteBuffer;
@ -18,23 +34,6 @@ import org.apache.solr.handler.TestBlobHandler;
import org.junit.BeforeClass;
import org.junit.Test;
/*
* 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.
*/
public class BlobRepositoryCloudTest extends SolrCloudTestCase {
public static final Path TEST_PATH = getFile("solr/configsets").toPath();

View File

@ -1,3 +1,20 @@
/*
* 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.solr.core;
import java.io.IOException;
@ -22,24 +39,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/*
* 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.
*/
public class BlobRepositoryMockingTest {
private static final Charset UTF8 = Charset.forName("UTF-8");

View File

@ -1,5 +1,3 @@
package org.apache.solr.handler;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.handler;
* limitations under the License.
*/
package org.apache.solr.handler;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;

View File

@ -1,5 +1,3 @@
package org.apache.solr.handler;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.handler;
* limitations under the License.
*/
package org.apache.solr.handler;
import java.io.IOException;
import java.io.InputStream;
import java.lang.invoke.MethodHandles;
@ -248,4 +248,4 @@ public class TestHdfsBackupRestoreCore extends SolrCloudTestCase {
IOUtils.closeQuietly(stream);
}
}
}
}

View File

@ -1,3 +1,20 @@
/*
* 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.solr.handler.component;
import org.apache.solr.common.params.ModifiableSolrParams;
@ -20,23 +37,6 @@ import java.util.stream.Stream;
import static org.junit.Assert.assertEquals;
/*
* 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.
*/
public class ResourceSharingTestComponent extends SearchComponent implements SolrCoreAware {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

View File

@ -1,5 +1,3 @@
package org.apache.solr.request;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.request;
* limitations under the License.
*/
package org.apache.solr.request;
import org.apache.solr.schema.BoolField;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.schema.StrField;

View File

@ -1,5 +1,3 @@
package org.apache.solr.response;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.response;
* limitations under the License.
*/
package org.apache.solr.response;
import java.io.StringWriter;
import java.util.Map;
import java.util.HashMap;

View File

@ -1,5 +1,3 @@
package org.apache.solr.schema;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.schema;
* limitations under the License.
*/
package org.apache.solr.schema;
import org.apache.solr.SolrTestCaseJ4;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -1,3 +1,20 @@
/*
* 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.solr.schema;
import java.io.IOException;
@ -19,23 +36,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* 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.
*/
public class TestManagedSchemaAPI extends SolrCloudTestCase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

View File

@ -1,5 +1,3 @@
package org.apache.solr.search;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.search;
* limitations under the License.
*/
package org.apache.solr.search;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.ModifiableSolrParams;

View File

@ -1,5 +1,3 @@
package org.apache.solr.update.processor;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.update.processor;
* limitations under the License.
*/
package org.apache.solr.update.processor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

View File

@ -1,5 +1,3 @@
package org.apache.solr.client.solrj.io.graph;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.client.solrj.io.graph;
* limitations under the License.
*/
package org.apache.solr.client.solrj.io.graph;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
@ -539,4 +539,4 @@ public class ShortestPathStream extends TupleStream implements Expressible {
public StreamComparator getStreamSort() {
return null;
}
}
}

View File

@ -1,5 +1,3 @@
package org.apache.solr.client.solrj.io.stream;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.client.solrj.io.stream;
* limitations under the License.
*/
package org.apache.solr.client.solrj.io.stream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@ -253,4 +253,4 @@ public class ScoreNodesStream extends TupleStream implements Expressible
return 0;
}
}
}

View File

@ -1,5 +1,3 @@
package org.apache.solr.client.solrj.io.stream;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.client.solrj.io.stream;
* limitations under the License.
*/
package org.apache.solr.client.solrj.io.stream;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;

View File

@ -1,5 +1,3 @@
package org.apache.solr.common.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.common.cloud;
* limitations under the License.
*/
package org.apache.solr.common.cloud;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedHashMap;

View File

@ -1,5 +1,3 @@
package org.apache.solr.common.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.common.cloud;
* limitations under the License.
*/
package org.apache.solr.common.cloud;
import java.util.Set;
import java.util.concurrent.TimeUnit;

View File

@ -1,5 +1,3 @@
package org.apache.solr.common.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -15,7 +13,9 @@ package org.apache.solr.common.cloud;
* 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.solr.common.cloud;
import java.util.Set;

View File

@ -1,3 +1,20 @@
/*
* 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.solr.common.cloud;
import java.io.IOException;
@ -17,23 +34,6 @@ import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* 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.
*/
/**
* Class to hold ZK upload/download/move common code. With the advent of the upconfig/downconfig/cp/ls/mv commands
* in bin/solr it made sense to keep the individual transfer methods in a central place, so here it is.

View File

@ -1,12 +1,3 @@
package org.apache.solr.client.solrj.impl;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.CloudSolrClient.Builder;
import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -24,6 +15,15 @@ import org.junit.Test;
* limitations under the License.
*/
package org.apache.solr.client.solrj.impl;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.CloudSolrClient.Builder;
import org.junit.Test;
public class CloudSolrClientBuilderTest extends LuceneTestCase {
private static final String ANY_CHROOT = "/ANY_CHROOT";
private static final String ANY_ZK_HOST = "ANY_ZK_HOST";

View File

@ -1,9 +1,3 @@
package org.apache.solr.client.solrj.impl;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.Builder;
import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,6 +15,12 @@ import org.junit.Test;
* limitations under the License.
*/
package org.apache.solr.client.solrj.impl;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.Builder;
import org.junit.Test;
/**
* Unit tests for {@link Builder}.
*/

View File

@ -1,14 +1,3 @@
package org.apache.solr.client.solrj.impl;
import java.io.IOException;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.ResponseParser;
import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;
import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -26,6 +15,17 @@ import org.junit.Test;
* limitations under the License.
*/
package org.apache.solr.client.solrj.impl;
import java.io.IOException;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.ResponseParser;
import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;
import org.junit.Test;
/**
* Unit tests for {@link Builder}.
*/

View File

@ -1,12 +1,3 @@
package org.apache.solr.client.solrj.impl;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder;
import org.apache.solr.client.solrj.ResponseParser;
import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -24,6 +15,15 @@ import org.junit.Test;
* limitations under the License.
*/
package org.apache.solr.client.solrj.impl;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder;
import org.apache.solr.client.solrj.ResponseParser;
import org.junit.Test;
/**
* Unit tests for {@link Builder}.
*/

View File

@ -1,5 +1,3 @@
package org.apache.solr.client.solrj.io.graph;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.client.solrj.io.graph;
* limitations under the License.
*/
package org.apache.solr.client.solrj.io.graph;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InputStream;
@ -897,4 +897,4 @@ public class GraphExpressionTest extends SolrCloudTestCase {
return true;
}
}
}

View File

@ -1,5 +1,3 @@
package org.apache.solr.client.solrj.io.graph;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.client.solrj.io.graph;
* limitations under the License.
*/
package org.apache.solr.client.solrj.io.graph;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;

View File

@ -1,5 +1,3 @@
package org.apache.solr.common.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -17,6 +15,8 @@ package org.apache.solr.common.cloud;
* limitations under the License.
*/
package org.apache.solr.common.cloud;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Set;