Skip to content

Commit 16f3add

Browse files
committed
Remove accidental org.jetbrains:annotations usage.
See spring-projects/spring-data-build#2670
1 parent 0e1a97a commit 16f3add

File tree

9 files changed

+35
-27
lines changed

9 files changed

+35
-27
lines changed

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@
243243
<optional>true</optional>
244244
</dependency>
245245

246+
<dependency>
247+
<groupId>org.jetbrains</groupId>
248+
<artifactId>annotations</artifactId>
249+
<version>26.0.2-1</version>
250+
<scope>test</scope>
251+
<optional>true</optional>
252+
</dependency>
253+
246254
<dependency>
247255
<groupId>org.slf4j</groupId>
248256
<artifactId>log4j-over-slf4j</artifactId>

src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
import java.io.IOException;
2828
import java.util.function.Function;
2929

30-
import org.jetbrains.annotations.Nullable;
30+
import org.jspecify.annotations.Nullable;
31+
3132

3233
/**
3334
* Reactive version of {@link co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient}.

src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import co.elastic.clients.elasticsearch.core.search.SearchRequestBody;
4949
import co.elastic.clients.elasticsearch.core.search.SourceConfig;
5050
import co.elastic.clients.elasticsearch.indices.*;
51-
import co.elastic.clients.elasticsearch.indices.ExistsIndexTemplateRequest;
5251
import co.elastic.clients.elasticsearch.indices.ExistsRequest;
5352
import co.elastic.clients.elasticsearch.indices.update_aliases.Action;
5453
import co.elastic.clients.elasticsearch.sql.query.SqlFormat;
@@ -77,14 +76,16 @@
7776

7877
import org.apache.commons.logging.Log;
7978
import org.apache.commons.logging.LogFactory;
80-
import org.jetbrains.annotations.NotNull;
8179
import org.jspecify.annotations.Nullable;
80+
8281
import org.springframework.dao.InvalidDataAccessApiUsageException;
8382
import org.springframework.data.domain.Sort;
8483
import org.springframework.data.elasticsearch.core.RefreshPolicy;
8584
import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
8685
import org.springframework.data.elasticsearch.core.document.Document;
87-
import org.springframework.data.elasticsearch.core.index.*;
86+
import org.springframework.data.elasticsearch.core.index.AliasAction;
87+
import org.springframework.data.elasticsearch.core.index.AliasActionParameters;
88+
import org.springframework.data.elasticsearch.core.index.AliasActions;
8889
import org.springframework.data.elasticsearch.core.index.DeleteIndexTemplateRequest;
8990
import org.springframework.data.elasticsearch.core.index.DeleteTemplateRequest;
9091
import org.springframework.data.elasticsearch.core.index.ExistsTemplateRequest;
@@ -310,7 +311,6 @@ public UpdateAliasesRequest indicesUpdateAliasesRequest(AliasActions aliasAction
310311
return updateAliasRequestBuilder.build();
311312
}
312313

313-
@NotNull
314314
private Action.Builder getBuilder(AliasAction aliasAction) {
315315
Action.Builder actionBuilder = new Action.Builder();
316316

@@ -1897,7 +1897,6 @@ public SearchTemplateRequest searchTemplate(SearchTemplateQuery query, @Nullable
18971897
});
18981898
}
18991899

1900-
@NotNull
19011900
private Map<String, JsonData> getTemplateParams(Set<Map.Entry<String, Object>> query) {
19021901
Function<Map.Entry<String, Object>, String> keyMapper = Map.Entry::getKey;
19031902
Function<Map.Entry<String, Object>, JsonData> valueMapper = entry -> JsonData.of(entry.getValue(), jsonpMapper);

src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
import org.apache.commons.logging.Log;
2525
import org.apache.commons.logging.LogFactory;
26-
import org.jetbrains.annotations.NotNull;
2726
import org.jspecify.annotations.Nullable;
27+
2828
import org.springframework.beans.BeansException;
2929
import org.springframework.beans.factory.InitializingBean;
3030
import org.springframework.context.ApplicationContext;
@@ -62,7 +62,16 @@
6262
import org.springframework.data.mapping.PersistentPropertyAccessor;
6363
import org.springframework.data.mapping.SimplePropertyHandler;
6464
import org.springframework.data.mapping.context.MappingContext;
65-
import org.springframework.data.mapping.model.*;
65+
import org.springframework.data.mapping.model.CachingValueExpressionEvaluatorFactory;
66+
import org.springframework.data.mapping.model.ConvertingPropertyAccessor;
67+
import org.springframework.data.mapping.model.EntityInstantiator;
68+
import org.springframework.data.mapping.model.EntityInstantiators;
69+
import org.springframework.data.mapping.model.ParameterValueProvider;
70+
import org.springframework.data.mapping.model.PersistentEntityParameterValueProvider;
71+
import org.springframework.data.mapping.model.PropertyValueProvider;
72+
import org.springframework.data.mapping.model.SpELContext;
73+
import org.springframework.data.mapping.model.ValueExpressionEvaluator;
74+
import org.springframework.data.mapping.model.ValueExpressionParameterValueProvider;
6675
import org.springframework.data.util.TypeInformation;
6776
import org.springframework.expression.spel.standard.SpelExpressionParser;
6877
import org.springframework.format.datetime.DateFormatterRegistrar;
@@ -1339,7 +1348,6 @@ private List<String> propertyToFieldNames(List<String> propertyNames,
13391348
.collect(Collectors.toList());
13401349
}
13411350

1342-
@NotNull
13431351
private String propertyToFieldName(ElasticsearchPersistentEntity<?> persistentEntity, String propertyName) {
13441352
ElasticsearchPersistentProperty persistentProperty = persistentEntity.getPersistentProperty(propertyName);
13451353
return persistentProperty != null ? persistentProperty.getFieldName() : propertyName;

src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.Optional;
2222
import java.util.stream.Collectors;
2323

24-
import org.jetbrains.annotations.NotNull;
2524
import org.jspecify.annotations.Nullable;
2625
import org.springframework.data.domain.Page;
2726
import org.springframework.data.domain.PageImpl;
@@ -345,7 +344,6 @@ public void deleteAll(Iterable<? extends T> entities, @Nullable RefreshPolicy re
345344
deleteAllById(getEntityIds(entities), refreshPolicy);
346345
}
347346

348-
@NotNull
349347
private List<ID> getEntityIds(Iterable<? extends T> entities) {
350348
Assert.notNull(entities, "Cannot delete 'null' list.");
351349

src/test/java/org/springframework/data/elasticsearch/NestedObjectELCIntegrationTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
import co.elastic.clients.elasticsearch._types.query_dsl.ChildScoreMode;
2222

23-
import org.jetbrains.annotations.NotNull;
23+
import org.jspecify.annotations.NonNull;
24+
2425
import org.springframework.context.annotation.Bean;
2526
import org.springframework.context.annotation.Configuration;
2627
import org.springframework.context.annotation.Import;
@@ -46,7 +47,7 @@ IndexNameProvider indexNameProvider() {
4647
}
4748

4849
@Override
49-
protected @NotNull Query getNestedQuery1() {
50+
protected @NonNull Query getNestedQuery1() {
5051
return NativeQuery.builder().withQuery( //
5152
nested(n -> n //
5253
.path("car") //
@@ -61,7 +62,7 @@ IndexNameProvider indexNameProvider() {
6162
}
6263

6364
@Override
64-
protected @NotNull Query getNestedQuery2() {
65+
protected Query getNestedQuery2() {
6566
return NativeQuery.builder().withQuery( //
6667
bool(b -> b //
6768
.must(nested(n -> n //
@@ -80,7 +81,7 @@ IndexNameProvider indexNameProvider() {
8081
}
8182

8283
@Override
83-
protected @NotNull Query getNestedQuery3() {
84+
protected Query getNestedQuery3() {
8485
return NativeQuery.builder().withQuery( //
8586
nested(n -> n //
8687
.path("books") //
@@ -94,7 +95,7 @@ IndexNameProvider indexNameProvider() {
9495
}
9596

9697
@Override
97-
protected @NotNull Query getNestedQuery4() {
98+
protected Query getNestedQuery4() {
9899
return NativeQuery.builder().withQuery( //
99100
nested(n -> n //
100101
.path("buckets") //

src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.List;
2929
import java.util.Map;
3030

31-
import org.jetbrains.annotations.NotNull;
3231
import org.jspecify.annotations.Nullable;
3332
import org.junit.jupiter.api.BeforeEach;
3433
import org.junit.jupiter.api.DisplayName;
@@ -134,7 +133,7 @@ public void shouldIndexInitialLevelNestedObject() {
134133
assertThat(persons).hasSize(1);
135134
}
136135

137-
@NotNull
136+
138137
abstract protected Query getNestedQuery1();
139138

140139
@Test
@@ -189,7 +188,7 @@ public void shouldSearchUsingNestedQueryOnMultipleLevelNestedObject() {
189188
assertThat(personIndexed.getSearchHit(0).getContent().getId()).isEqualTo("1");
190189
}
191190

192-
@NotNull
191+
193192
abstract protected Query getNestedQuery2();
194193

195194
private List<IndexQuery> createPerson() {
@@ -329,7 +328,7 @@ private static Person getPerson() {
329328
return foo;
330329
}
331330

332-
@NotNull
331+
333332
abstract protected Query getNestedQuery3();
334333

335334
@Test // DATAES-73
@@ -413,7 +412,7 @@ void shouldSupportMappingNullAndEmptyFieldParameter() {
413412
assertThat(nullResults.getSearchHits()).hasSize(1);
414413
}
415414

416-
@NotNull
415+
417416
abstract protected Query getNestedQuery4();
418417

419418
@Document(indexName = "#{@indexNameProvider.indexName()}-book")

src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.List;
2525
import java.util.Map;
2626

27-
import org.jetbrains.annotations.NotNull;
2827
import org.jspecify.annotations.Nullable;
2928
import org.junit.jupiter.api.BeforeEach;
3029
import org.junit.jupiter.api.DisplayName;
@@ -158,7 +157,6 @@ void shouldUseRepositoryMethodWithScriptedFieldParameters() {
158157
assertThat(foundEntity.getScriptedValue2()).isEqualTo(9);
159158
}
160159

161-
@NotNull
162160
private static org.springframework.data.elasticsearch.core.query.ScriptedField getScriptedField(String fieldName,
163161
int factor) {
164162
return org.springframework.data.elasticsearch.core.query.ScriptedField.of(
@@ -214,7 +212,6 @@ void shouldUseRepositoryMethodWithRuntimeFieldParameters() {
214212
assertThat(foundEntity.getScriptedValue2()).isEqualTo(12);
215213
}
216214

217-
@NotNull
218215
private static RuntimeField getRuntimeField(String fieldName, int factor) {
219216
return new RuntimeField(
220217
fieldName,

src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.List;
2222
import java.util.Map;
2323

24-
import org.jetbrains.annotations.NotNull;
2524
import org.jspecify.annotations.Nullable;
2625
import org.junit.jupiter.api.BeforeEach;
2726
import org.junit.jupiter.api.DisplayName;
@@ -307,7 +306,6 @@ void shouldUseRuntimeFieldsInQueriesReturningLists() {
307306
* build a {@link org.springframework.data.elasticsearch.core.query.ScriptedField} to return the product of the
308307
* document's value property and the given factor
309308
*/
310-
@NotNull
311309
private static org.springframework.data.elasticsearch.core.query.ScriptedField buildScriptedField(String fieldName,
312310
int factor) {
313311
return org.springframework.data.elasticsearch.core.query.ScriptedField.of(
@@ -320,7 +318,6 @@ private static org.springframework.data.elasticsearch.core.query.ScriptedField b
320318
/**
321319
* build a {@link RuntimeField} to return the product of the document's value property and the given factor
322320
*/
323-
@NotNull
324321
private static RuntimeField buildRuntimeField(String fieldName, int factor) {
325322
return new RuntimeField(
326323
fieldName,

0 commit comments

Comments
 (0)