mirror of
https://github.com/apache/lucene.git
synced 2025-02-23 10:51:29 +00:00
LUCENE-10136: allow 'var' declarations in source code (be reasonable though). (#368)
This commit is contained in:
parent
9b1fc0ecc8
commit
a613021ca4
@ -115,7 +115,6 @@ configure(rootProject) {
|
||||
|
||||
// default excludes.
|
||||
exclude '**/build/**'
|
||||
exclude 'dev-tools/missing-doclet/src/**/*.java' // <-- TODO: remove once we allow "var" on master
|
||||
|
||||
// ourselves :-)
|
||||
exclude 'gradle/validation/validate-source-patterns.gradle'
|
||||
@ -157,8 +156,7 @@ class ValidateSourcePatternsTask extends DefaultTask {
|
||||
|
||||
// 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'
|
||||
(~$/\n\s*var\s+.*=.*<>.*/$) : 'Diamond operators should not be used with var'
|
||||
]
|
||||
|
||||
def found = 0;
|
||||
|
@ -359,6 +359,8 @@ Changes in Backwards Compatibility Policy
|
||||
|
||||
Other
|
||||
|
||||
* LUCENE-10136: allow 'var' declarations in source code (Dawid Weiss)
|
||||
|
||||
* LUCENE-9570, LUCENE-9564: Apply google java format and enforce it on source Java files.
|
||||
Review diffs and correct automatic formatting oddities. (Erick Erickson,
|
||||
Bruno Roustant, Dawid Weiss)
|
||||
|
@ -1965,7 +1965,7 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||
Map<String, String> data = new HashMap<>();
|
||||
Iterable<Map.Entry<String, String>> iter = writer.getLiveCommitData();
|
||||
if (iter != null) {
|
||||
for (Map.Entry<String, String> ent : iter) {
|
||||
for (var ent : iter) {
|
||||
data.put(ent.getKey(), ent.getValue());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user