Skip to content

Commit 5351d97

Browse files
authored
Merge branch 'main' into compiler-metadata
2 parents 8401f29 + 91002d0 commit 5351d97

File tree

135 files changed

+2702
-550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+2702
-550
lines changed

dev-tools/README.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ as to the usefulness of the tools.
55

66
Description of dev-tools/ contents:
77

8-
./size-estimator-lucene-solr.xls -- Spreadsheet for estimating memory and disk usage in Lucene/Solr
8+
./aws-jmh/ -- Scripts for running microbenchmarks across different ec2 instance types.
9+
./doap/ -- Lucene project descriptors in DOAP RDF format.
910
./missing-doclet -- JavaDoc validation doclet subproject
10-
./doap/ -- Lucene and Solr project descriptors in DOAP RDF format.
11-
./scripts/ -- Odds and ends for building releases, etc.
12-
./test-patch/ -- Scripts for automatically validating patches
11+
./scripts/ -- Odds and ends for building releases, etc.
12+
./test-patch/ -- Scripts for automatically validating patches

dev-tools/doap/lucene.rdf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@
6767
</maintainer>
6868

6969
<!-- NOTE: please insert releases in numeric order, NOT chronologically. -->
70+
<release>
71+
<Version>
72+
<name>lucene-9.9.1</name>
73+
<created>2023-12-16</created>
74+
<revision>9.9.1</revision>
75+
</Version>
76+
</release>
77+
<release>
78+
<Version>
79+
<name>lucene-9.9.0</name>
80+
<created>2023-12-04</created>
81+
<revision>9.9.0</revision>
82+
</Version>
83+
</release>
7084
<release>
7185
<Version>
7286
<name>lucene-9.8.0</name>

gradle/generation/extract-jdk-apis.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ configure(project(":lucene:core")) {
6262
classpath = configurations.apiextractor
6363
mainClass = file("${resources}/ExtractJdkApis.java") as String
6464
systemProperties = [
65-
'user.timezone': 'UTC'
65+
'user.timezone': 'UTC',
66+
'file.encoding': 'UTF-8',
6667
]
6768
args = [
6869
jdkVersion,

gradle/generation/extract-jdk-apis/ExtractJdkApis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void visitInnerClass(String name, String outerName, String innerName, int
189189
}
190190

191191
@Override
192-
public void visitPermittedSubclass(String c) {
192+
public void visitPermittedSubclass(String c) {
193193
}
194194

195195
}

gradle/help.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ configure(rootProject) {
4646
help {
4747
doLast {
4848
println ""
49-
println "This is an experimental Lucene/Solr gradle build. See some"
49+
println "This is Lucene's gradle build. See some"
5050
println "guidelines, ant-equivalent commands etc. under help/*; or type:"
5151
println ""
5252
helpFiles.each { section, path, sectionInfo ->

gradle/testing/randomization.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ allprojects {
144144
"tests.leaveTemporary",
145145
"tests.leavetemporary",
146146
"tests.leavetmpdir",
147-
"solr.test.leavetmpdir",
148147
].find { prop ->
149148
def v = Boolean.parseBoolean(propertyOrDefault(prop, "false"))
150149
if (v) {

gradle/testing/randomization/policies/tests.policy

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ grant {
7777
// used by nested tests? (e.g. TestLeaveFilesIfTestFails). TODO: look into this
7878
permission java.util.PropertyPermission "tests.runnested", "write";
7979

80-
// solr properties. TODO: move these out to SolrTestCase
81-
permission java.util.PropertyPermission "solr.data.dir", "write";
82-
permission java.util.PropertyPermission "solr.solr.home", "write";
83-
permission java.util.PropertyPermission "solr.directoryFactory", "write";
84-
8580
// allows LuceneTestCase#runWithRestrictedPermissions to execute with lower (or no) permission
8681
permission java.security.SecurityPermission "createAccessControlContext";
8782

gradle/validation/error-prone.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ allprojects { prj ->
244244
// '-Xep:TryFailThrowable:OFF',
245245
'-Xep:TypeParameterQualifier:ERROR',
246246
'-Xep:UnicodeDirectionalityCharacters:ERROR',
247-
// '-Xep:UnicodeInCode:OFF', // noisy (spatial3d)
247+
'-Xep:UnicodeInCode:ERROR',
248248
'-Xep:UnnecessaryCheckNotNull:ERROR',
249249
'-Xep:UnnecessaryTypeArgument:ERROR',
250250
'-Xep:UnsafeWildcard:ERROR',

gradle/validation/validate-source-patterns.gradle

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18+
import java.nio.charset.CharacterCodingException;
19+
import java.nio.charset.CodingErrorAction;
20+
import java.nio.charset.StandardCharsets;
21+
1822
import org.apache.rat.Defaults
1923
import org.apache.rat.document.impl.FileDocument
2024
import org.apache.rat.api.MetaData
@@ -144,8 +148,8 @@ class ValidateSourcePatternsTask extends DefaultTask {
144148
(~$/\$$Id\b/$) : 'svn keyword',
145149
(~$/\$$Header\b/$) : 'svn keyword',
146150
(~$/\$$Source\b/$) : 'svn keyword',
147-
(~$/^\uFEFF/$) : 'UTF-8 byte order mark',
148-
(~$/import java\.lang\.\w+;/$) : 'java.lang import is unnecessary'
151+
(~$/[\u200B\uFEFF]/$) : 'UTF-8 byte order mark or other zero-width codepoints',
152+
(~$/import java\.lang\.\w+;/$) : 'java.lang import is unnecessary',
149153
]
150154

151155
// Python and others merrily use var declarations, this is a problem _only_ in Java at least for 8x where we're forbidding var declarations
@@ -198,15 +202,29 @@ class ValidateSourcePatternsTask extends DefaultTask {
198202
ProgressLogger progress = progressLoggerFactory.newOperation(this.class)
199203
progress.start(this.name, this.name)
200204

205+
def validatingDecoder = StandardCharsets.UTF_8.newDecoder()
206+
.onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT)
207+
201208
sourceFiles.each { f ->
202209
try {
203210
progress.progress("Scanning ${f.name}")
204211
logger.debug('Scanning source file: {}', f);
205212

206-
def text = f.getText('UTF-8');
213+
String text
214+
try {
215+
validatingDecoder.reset()
216+
text = f.withInputStream {
217+
in -> new InputStreamReader(in, validatingDecoder).getText()
218+
}
219+
} catch (CharacterCodingException e) {
220+
reportViolation(f, "incorrect UTF-8 encoding [${e}]")
221+
return // we can't proceed for this file
222+
}
223+
207224
invalidPatterns.each { pattern, name ->
208-
if (pattern.matcher(text).find()) {
209-
reportViolation(f, name);
225+
def matcher = pattern.matcher(text);
226+
if (matcher.find()) {
227+
reportViolation(f, String.format(Locale.ROOT, '%s [start=%d, end=%d]', name, matcher.start(), matcher.end()));
210228
}
211229
}
212230
def javadocsMatcher = javadocsPattern.matcher(text);
@@ -230,9 +248,10 @@ class ValidateSourcePatternsTask extends DefaultTask {
230248
}
231249
checkLicenseHeaderPrecedes(f, 'package', packagePattern, javaCommentPattern, text, ratDocument);
232250

233-
invalidJavaOnlyPatterns.each { pattern,name ->
234-
if (pattern.matcher(text).find()) {
235-
reportViolation(f, name);
251+
invalidJavaOnlyPatterns.each { pattern, name ->
252+
def matcher = pattern.matcher(text);
253+
if (matcher.find()) {
254+
reportViolation(f, String.format(Locale.ROOT, '%s [start=%d, end=%d]', name, matcher.start(), matcher.end()));
236255
}
237256
}
238257
}

help/tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Larger heap size
139139
By default tests run with a 512 MB max heap. But some tests (monster/nightly)
140140
need more heap. Use "-Dtests.heapsize" for this:
141141

142-
gradlew -p lucene/core test --tests "Test2BFST" -Dtest.heapsize=32g
142+
gradlew -p lucene/core test --tests "Test2BFST" -Dtests.heapsize=32g
143143

144144

145145
Run GUI tests headlessly with Xvfb (Linux only)

0 commit comments

Comments
 (0)