Skip to content

Commit d8d4fa0

Browse files
committed
Polishing
1 parent bfd3b3a commit d8d4fa0

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

spring-context/src/main/java/org/springframework/scheduling/support/BitsCronField.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
* Created using the {@code parse*} methods.
3030
*
3131
* @author Arjen Poutsma
32+
* @author Juergen Hoeller
3233
* @since 5.3
3334
*/
3435
final class BitsCronField extends CronField {
3536

36-
public static BitsCronField ZERO_NANOS = forZeroNanos();
37+
public static final BitsCronField ZERO_NANOS = forZeroNanos();
3738

3839
private static final long MASK = 0xFFFFFFFFFFFFFFFFL;
3940

spring-web/src/main/java/org/springframework/web/client/RestTemplate.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -367,6 +367,7 @@ public void setObservationConvention(ClientRequestObservationConvention observat
367367
this.observationConvention = observationConvention;
368368
}
369369

370+
370371
// GET
371372

372373
@Override
@@ -847,13 +848,14 @@ protected <T> T doExecute(URI url, @Nullable String uriTemplate, @Nullable HttpM
847848
request = createRequest(url, method);
848849
}
849850
catch (IOException ex) {
850-
ResourceAccessException exception = createResourceAccessException(url, method, ex);
851-
throw exception;
851+
throw createResourceAccessException(url, method, ex);
852852
}
853+
853854
ClientRequestObservationContext observationContext = new ClientRequestObservationContext(request);
854855
observationContext.setUriTemplate(uriTemplate);
855-
Observation observation = ClientHttpObservationDocumentation.HTTP_CLIENT_EXCHANGES.observation(this.observationConvention,
856-
DEFAULT_OBSERVATION_CONVENTION, () -> observationContext, this.observationRegistry).start();
856+
Observation observation = ClientHttpObservationDocumentation.HTTP_CLIENT_EXCHANGES.observation(
857+
this.observationConvention, DEFAULT_OBSERVATION_CONVENTION,
858+
() -> observationContext, this.observationRegistry).start();
857859
ClientHttpResponse response = null;
858860
try (Observation.Scope scope = observation.openScope()){
859861
if (requestCallback != null) {
@@ -865,13 +867,13 @@ protected <T> T doExecute(URI url, @Nullable String uriTemplate, @Nullable HttpM
865867
return (responseExtractor != null ? responseExtractor.extractData(response) : null);
866868
}
867869
catch (IOException ex) {
868-
ResourceAccessException exception = createResourceAccessException(url, method, ex);
869-
observation.error(exception);
870-
throw exception;
870+
ResourceAccessException accessEx = createResourceAccessException(url, method, ex);
871+
observation.error(accessEx);
872+
throw accessEx;
871873
}
872-
catch (Throwable exc) {
873-
observation.error(exc);
874-
throw exc;
874+
catch (Throwable ex) {
875+
observation.error(ex);
876+
throw ex;
875877
}
876878
finally {
877879
if (response != null) {

0 commit comments

Comments
 (0)