Skip to content

Commit f09312a

Browse files
committed
fix errors after rebase
1 parent bb94480 commit f09312a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Diff for: src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class SimpleElasticsearchPersistentEntity<T> extends BasicPersistentEntit
8080
private @Nullable VersionType versionType;
8181
private boolean createIndexAndMapping;
8282
private final Map<String, ElasticsearchPersistentProperty> fieldNamePropertyCache = new ConcurrentHashMap<>();
83-
private final ConcurrentHashMap<String, Expression> templateExpressions = new ConcurrentHashMap<>();
83+
private final ConcurrentHashMap<String, Expression> routingExpressions = new ConcurrentHashMap<>();
8484
private @Nullable String routing;
8585

8686
private final ConcurrentHashMap<String, Expression> indexNameExpressions = new ConcurrentHashMap<>();
@@ -111,10 +111,11 @@ public SimpleElasticsearchPersistentEntity(TypeInformation<T> typeInformation) {
111111
this.routing = document.routing();
112112
}
113113

114-
Setting setting = AnnotatedElementUtils.getMergedAnnotation(clazz, Setting.class);
114+
Setting setting = AnnotatedElementUtils.getMergedAnnotation(clazz, Setting.class);
115115

116-
if (setting != null) {
117-
this.settingPath = setting.settingPath();
116+
if (setting != null) {
117+
this.settingPath = setting.settingPath();
118+
}
118119
}
119120
}
120121

@@ -183,6 +184,7 @@ public String settingPath() {
183184
public boolean isCreateIndexAndMapping() {
184185
return createIndexAndMapping;
185186
}
187+
186188
@Override
187189
public boolean hasScoreProperty() {
188190
return scoreProperty != null;
@@ -194,7 +196,6 @@ public ElasticsearchPersistentProperty getScoreProperty() {
194196
return scoreProperty;
195197
}
196198

197-
198199
@Override
199200
@Nullable
200201
public String getRouting() {
@@ -366,7 +367,8 @@ private String resolve(String name) {
366367

367368
Expression expression = getExpressionForIndexName(name);
368369

369-
String resolvedName = expression != null ? expression.getValue(indexNameEvaluationContext.get(), String.class) : null;
370+
String resolvedName = expression != null ? expression.getValue(indexNameEvaluationContext.get(), String.class)
371+
: null;
370372
return resolvedName != null ? resolvedName : name;
371373
}
372374

@@ -400,13 +402,12 @@ private EvaluationContext getIndexNameEvaluationContext() {
400402
return getEvaluationContext(null, expressionDependencies);
401403
}
402404

403-
404405
@Override
405406
public String resolveRouting(Object bean) {
406407
String resolved = null;
407408

408409
if (hasRouting()) {
409-
Expression expression = expressions.computeIfAbsent(getRouting(), PARSER::parseExpression);
410+
Expression expression = routingExpressions.computeIfAbsent(getRouting(), PARSER::parseExpression);
410411

411412
try {
412413
EvaluationContext context = getEvaluationContext(bean);

0 commit comments

Comments
 (0)