You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2021/10/25 16:48:14 UTC

[solr] branch main updated: SOLR-13671 Allow 'var' keyword in Java sources (#366)

This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new e686024  SOLR-13671 Allow 'var' keyword in Java sources (#366)
e686024 is described below

commit e6860240d23a76cd18053f36d303c2af8af97734
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Mon Oct 25 18:48:06 2021 +0200

    SOLR-13671 Allow 'var' keyword in Java sources (#366)
    
    Co-authored-by: Christine Poerschke <cp...@apache.org>
---
 gradle/validation/validate-source-patterns.gradle    | 3 ---
 solr/CHANGES.txt                                     | 2 ++
 solr/solr-ref-guide/src/major-changes-in-solr-9.adoc | 2 ++
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gradle/validation/validate-source-patterns.gradle b/gradle/validation/validate-source-patterns.gradle
index f9639d0..13795c6 100644
--- a/gradle/validation/validate-source-patterns.gradle
+++ b/gradle/validation/validate-source-patterns.gradle
@@ -121,7 +121,6 @@ configure(rootProject) {
       // default excludes.
       exclude '**/build/**'
       exclude '**/.idea/**'
-      exclude 'dev-tools/solr-missing-doclet/src/**/*.java' // <-- TODO: remove once we allow "var" on master
 
       // ourselves :-)
       exclude 'gradle/validation/validate-source-patterns.gradle'
@@ -161,10 +160,8 @@ class ValidateSourcePatternsTask extends DefaultTask {
       (~$/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 found = 0;
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e94610a..2a103bd 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -167,6 +167,8 @@ Build
 
 * LUCENE-10104, SOLR-15631: Upgrade forbiddenapis to version 3.2.  (Uwe Schindler)
 
+* SOLR-13671: Remove check for bare "var" declarations in validate-source-patterns (Erick Erickson, Alex Bulygin, janhoy)
+
 Other Changes
 ----------------------
 * SOLR-15603: Add an option to activate Gradle build cache, build task cleanups (Alexis Tual, Dawid Weiss)
diff --git a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc
index 4319094..a9d2c6e 100644
--- a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc
+++ b/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc
@@ -39,6 +39,8 @@ _(raw; not yet edited)_
 * LUCENE-8738: Move to Java 11 as minimum Java version.
   (Adrien Grand, Uwe Schindler)
 
+* SOLR-13671: Allow 'var' keyword in Java sources
+
 * SOLR-12055 introduces async logging by default. There's a small window where log messages may be lost
   in the event of some hard crash. Switch back to synchronous logging if this is unacceptable, see
   see comments in the log4j2 configuration files (log4j2.xml by default).