Skip to content

Commit 98ed856

Browse files
committed
GH-2234 - Clean up.
1 parent 01f3b27 commit 98ed856

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/main/java/org/springframework/data/neo4j/core/DefaultNeo4jClient.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,6 @@ private static RuntimeException potentiallyConvertRuntimeException(RuntimeExcept
182182
return resolved == null ? ex : resolved;
183183
}
184184

185-
private String resolveTargetDatabaseName(@Nullable String parameterTargetDatabase) {
186-
if (parameterTargetDatabase != null) {
187-
return parameterTargetDatabase;
188-
}
189-
if (databaseSelectionProvider != null) {
190-
String databaseSelectionProviderValue = databaseSelectionProvider.getDatabaseSelection().getValue();
191-
if (databaseSelectionProviderValue != null) {
192-
return databaseSelectionProviderValue;
193-
}
194-
}
195-
return DatabaseSelectionProvider.getDefaultSelectionProvider().getDatabaseSelection().getValue();
196-
}
197-
198185
class DefaultRunnableSpec implements RunnableSpec {
199186

200187
private RunnableStatement runnableStatement;
@@ -271,6 +258,19 @@ public ResultSummary run() {
271258
throw potentiallyConvertRuntimeException(e, persistenceExceptionTranslator);
272259
}
273260
}
261+
262+
private String resolveTargetDatabaseName(@Nullable String parameterTargetDatabase) {
263+
if (parameterTargetDatabase != null) {
264+
return parameterTargetDatabase;
265+
}
266+
if (databaseSelectionProvider != null) {
267+
String databaseSelectionProviderValue = databaseSelectionProvider.getDatabaseSelection().getValue();
268+
if (databaseSelectionProviderValue != null) {
269+
return databaseSelectionProviderValue;
270+
}
271+
}
272+
return DatabaseSelectionProvider.getDefaultSelectionProvider().getDatabaseSelection().getValue();
273+
}
274274
}
275275

276276
class DefaultRecordFetchSpec<T> implements RecordFetchSpec<T>, MappingSpec<T> {
@@ -359,7 +359,7 @@ class DefaultRunnableDelegation<T> implements RunnableDelegation<T>, OngoingDele
359359

360360
DefaultRunnableDelegation(Function<QueryRunner, Optional<T>> callback, @Nullable String targetDatabase) {
361361
this.callback = callback;
362-
this.targetDatabase = Neo4jClient.verifyDatabaseName(resolveTargetDatabaseName(targetDatabase));
362+
this.targetDatabase = Neo4jClient.verifyDatabaseName(targetDatabase);
363363
}
364364

365365
@Override

0 commit comments

Comments
 (0)