File tree Expand file tree Collapse file tree 11 files changed +33
-36
lines changed
spring-core/src/main/java/org/springframework/core/io Expand file tree Collapse file tree 11 files changed +33
-36
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2022 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -56,8 +56,7 @@ public boolean exists() {
5656 // Try a URL connection content-length header
5757 URLConnection con = url .openConnection ();
5858 customizeConnection (con );
59- HttpURLConnection httpCon =
60- (con instanceof HttpURLConnection ? (HttpURLConnection ) con : null );
59+ HttpURLConnection httpCon = (con instanceof HttpURLConnection huc ? huc : null );
6160 if (httpCon != null ) {
6261 httpCon .setRequestMethod ("HEAD" );
6362 int code = httpCon .getResponseCode ();
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2022 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -226,9 +226,9 @@ public String getFilename() {
226226 * @see #getDescription()
227227 */
228228 @ Override
229- public boolean equals (@ Nullable Object other ) {
230- return (this == other || (other instanceof Resource &&
231- (( Resource ) other ). getDescription ().equals (getDescription ())));
229+ public boolean equals (@ Nullable Object obj ) {
230+ return (this == obj || (obj instanceof Resource that &&
231+ getDescription ().equals (that . getDescription ())));
232232 }
233233
234234 /**
Original file line number Diff line number Diff line change @@ -129,9 +129,9 @@ public String getDescription() {
129129 * @see java.util.Arrays#equals(byte[], byte[])
130130 */
131131 @ Override
132- public boolean equals (@ Nullable Object other ) {
133- return (this == other || (other instanceof ByteArrayResource &&
134- Arrays .equals ((( ByteArrayResource ) other ) .byteArray , this .byteArray )));
132+ public boolean equals (@ Nullable Object obj ) {
133+ return (this == obj || (obj instanceof ByteArrayResource that &&
134+ Arrays .equals (this .byteArray , that .byteArray )));
135135 }
136136
137137 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2022 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -272,9 +272,9 @@ public boolean equals(@Nullable Object obj) {
272272 if (this == obj ) {
273273 return true ;
274274 }
275- return ((obj instanceof ClassPathResource other ) &&
276- this .absolutePath .equals (other .absolutePath ) &&
277- ObjectUtils .nullSafeEquals (getClassLoader (), other .getClassLoader ()));
275+ return ((obj instanceof ClassPathResource that ) &&
276+ this .absolutePath .equals (that .absolutePath ) &&
277+ ObjectUtils .nullSafeEquals (getClassLoader (), that .getClassLoader ()));
278278 }
279279
280280 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -72,9 +72,9 @@ public String getDescription() {
7272 * This implementation compares the underlying description String.
7373 */
7474 @ Override
75- public boolean equals (@ Nullable Object other ) {
76- return (this == other || (other instanceof DescriptiveResource &&
77- (( DescriptiveResource ) other ) .description .equals (this .description )));
75+ public boolean equals (@ Nullable Object obj ) {
76+ return (this == obj || (obj instanceof DescriptiveResource that &&
77+ this .description .equals (that .description )));
7878 }
7979
8080 /**
Original file line number Diff line number Diff line change @@ -396,8 +396,7 @@ public String getDescription() {
396396 */
397397 @ Override
398398 public boolean equals (@ Nullable Object obj ) {
399- return (this == obj || (obj instanceof FileSystemResource other &&
400- this .path .equals (other .path )));
399+ return (this == obj || (obj instanceof FileSystemResource that && this .path .equals (that .path )));
401400 }
402401
403402 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -115,9 +115,9 @@ public String getDescription() {
115115 * This implementation compares the underlying InputStream.
116116 */
117117 @ Override
118- public boolean equals (@ Nullable Object other ) {
119- return (this == other || (other instanceof InputStreamResource &&
120- (( InputStreamResource ) other ) .inputStream .equals (this .inputStream )));
118+ public boolean equals (@ Nullable Object obj ) {
119+ return (this == obj || (obj instanceof InputStreamResource that &&
120+ this .inputStream .equals (that .inputStream )));
121121 }
122122
123123 /**
Original file line number Diff line number Diff line change @@ -298,9 +298,8 @@ public String getDescription() {
298298 * This implementation compares the underlying Path references.
299299 */
300300 @ Override
301- public boolean equals (@ Nullable Object other ) {
302- return (this == other || (other instanceof PathResource &&
303- this .path .equals (((PathResource ) other ).path )));
301+ public boolean equals (@ Nullable Object obj ) {
302+ return (this == obj || (obj instanceof PathResource that && this .path .equals (that .path )));
304303 }
305304
306305 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2022 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -343,9 +343,9 @@ public String getDescription() {
343343 * This implementation compares the underlying URL references.
344344 */
345345 @ Override
346- public boolean equals (@ Nullable Object other ) {
347- return (this == other || (other instanceof UrlResource resource &&
348- getCleanedUrl ().equals (resource .getCleanedUrl ())));
346+ public boolean equals (@ Nullable Object obj ) {
347+ return (this == obj || (obj instanceof UrlResource that &&
348+ getCleanedUrl ().equals (that .getCleanedUrl ())));
349349 }
350350
351351 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2022 the original author or authors.
2+ * Copyright 2002-2023 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.
@@ -130,9 +130,9 @@ public String getDescription() {
130130 }
131131
132132 @ Override
133- public boolean equals (@ Nullable Object other ) {
134- return (this == other || (other instanceof VfsResource &&
135- this .resource .equals ((( VfsResource ) other ) .resource )));
133+ public boolean equals (@ Nullable Object obj ) {
134+ return (this == obj || (obj instanceof VfsResource that &&
135+ this .resource .equals (that .resource )));
136136 }
137137
138138 @ Override
You can’t perform that action at this time.
0 commit comments