Skip to content

Commit 71c40f1

Browse files
DiegoKrupitzaschauder
authored andcommitted
Remove unnecessary toString() call.
There were few explicit `toString()` calls that are not needed, since `toString()` will be called by default. Original pull request #2431
1 parent 242adf5 commit 71c40f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -278,7 +278,7 @@ public String toString() {
278278

279279
StringBuilder sb = new StringBuilder();
280280
if (parent != null) {
281-
sb.append(parent.toString());
281+
sb.append(parent);
282282
sb.append(" -");
283283
sb.append(name);
284284
sb.append("-> ");

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -700,11 +700,11 @@ public Object prepare(@Nullable Object value) {
700700

701701
switch (type) {
702702
case STARTING_WITH:
703-
return String.format("%s%%", value.toString());
703+
return String.format("%s%%", value);
704704
case ENDING_WITH:
705-
return String.format("%%%s", value.toString());
705+
return String.format("%%%s", value);
706706
case CONTAINING:
707-
return String.format("%%%s%%", value.toString());
707+
return String.format("%%%s%%", value);
708708
case LIKE:
709709
default:
710710
return value;

spring-data-jpa/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2021 the original author or authors.
2+
* Copyright 2011-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -179,7 +179,7 @@ private Set<String> scanForMappingFileLocations() {
179179
mappingFileUris.add(resourcePathInClasspath);
180180

181181
} catch (IOException e) {
182-
throw new IllegalStateException(String.format("Couldn't get URI for %s!", resource.toString()), e);
182+
throw new IllegalStateException(String.format("Couldn't get URI for %s!", resource), e);
183183
}
184184
}
185185

0 commit comments

Comments
 (0)