mirror of
https://github.com/apache/lucene.git
synced 2025-02-10 03:55:46 +00:00
SOLR-13568: Precommit fail Java var until 9x. Fail var...
(cherry picked from commit f6f1b4244c40e5665b20a2a8ef9852c6dd827cb2)
This commit is contained in:
parent
a50927bac0
commit
5df5df9ec3
@ -49,6 +49,13 @@ def invalidPatterns = [
|
||||
(~$/import java\.lang\.\w+;/$) : 'java.lang import is unnecessary'
|
||||
]
|
||||
|
||||
// Python and others merrily use var declarations, this is a problem _only_ in Java at least for 8x where we're forbidding var declarations
|
||||
def invalidJavaOnlyPatterns = [
|
||||
(~$/\n\s*var\s+.*=.*<>.*/$) : 'Diamond operators should not be used with var',
|
||||
(~$/\n\s*var\s+/$) : 'var is not allowed in until we stop development on the 8x code line'
|
||||
]
|
||||
|
||||
|
||||
def baseDir = properties['basedir'];
|
||||
def baseDirLen = baseDir.length() + 1;
|
||||
|
||||
@ -200,6 +207,11 @@ ant.fileScanner{
|
||||
reportViolation(f, "Solr test cases should extend SolrTestCase rather than LuceneTestCase");
|
||||
}
|
||||
}
|
||||
invalidJavaOnlyPatterns.each { pattern,name ->
|
||||
if (pattern.matcher(text).find()) {
|
||||
reportViolation(f, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (f.name.endsWith('.xml') || f.name.endsWith('.xml.template')) {
|
||||
checkLicenseHeaderPrecedes(f, '<tag>', xmlTagPattern, xmlCommentPattern, text, ratDocument);
|
||||
|
@ -114,6 +114,8 @@ Other Changes
|
||||
|
||||
* SOLR-13573: Add SolrRangeQuery getters for upper, lower bound (Brian Rhees via Jason Gerlowski)
|
||||
|
||||
* SOLR-13658: Precommit fail Java "var" until 9x. Fail "var...<>" constructs entirely (Erick Erickson)
|
||||
|
||||
================== 8.2.0 ==================
|
||||
|
||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||
|
@ -70,7 +70,6 @@ import org.apache.solr.common.params.AnalysisParams;
|
||||
import org.apache.solr.common.params.CommonParams;
|
||||
import org.apache.solr.common.params.FacetParams;
|
||||
import org.apache.solr.common.params.ModifiableSolrParams;
|
||||
import org.apache.solr.common.util.ContentStream;
|
||||
import org.apache.solr.common.util.ContentStreamBase;
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.common.util.Pair;
|
||||
@ -697,8 +696,8 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
|
||||
boolean assertClosed = random().nextBoolean();
|
||||
if (assertClosed) {
|
||||
byte[] allBytes = Files.readAllBytes(file.toPath());
|
||||
|
||||
ContentStream contentStreamMock = new ContentStreamBase.ByteArrayStream(allBytes, "solrj/books.csv", "application/csv") {
|
||||
|
||||
ContentStreamBase.ByteArrayStream contentStreamMock = new ContentStreamBase.ByteArrayStream(allBytes, "solrj/books.csv", "application/csv") {
|
||||
@Override
|
||||
public InputStream getStream() throws IOException {
|
||||
opened [0]++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user