Skip to content

Commit 1455a9f

Browse files
committed
Polishing
1 parent 36636b0 commit 1455a9f

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/resource/LiteWebJarsResourceResolver.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 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.
@@ -47,21 +47,21 @@ public class LiteWebJarsResourceResolver extends AbstractResourceResolver {
4747

4848
private static final int WEBJARS_LOCATION_LENGTH = WebJarVersionLocator.WEBJARS_PATH_PREFIX.length() + 1;
4949

50-
private final WebJarVersionLocator webJarAssetLocator;
50+
private final WebJarVersionLocator webJarVersionLocator;
5151

5252
/**
5353
* Create a {@code LiteWebJarsResourceResolver} with a default {@code WebJarVersionLocator} instance.
5454
*/
5555
public LiteWebJarsResourceResolver() {
56-
this.webJarAssetLocator = new WebJarVersionLocator();
56+
this.webJarVersionLocator = new WebJarVersionLocator();
5757
}
5858

5959
/**
6060
* Create a {@code LiteWebJarsResourceResolver} with a custom {@code WebJarVersionLocator} instance,
6161
* e.g. with a custom cache implementation.
6262
*/
63-
public LiteWebJarsResourceResolver(WebJarVersionLocator webJarAssetLocator) {
64-
this.webJarAssetLocator = webJarAssetLocator;
63+
public LiteWebJarsResourceResolver(WebJarVersionLocator webJarVersionLocator) {
64+
this.webJarVersionLocator = webJarVersionLocator;
6565
}
6666

6767
@Override
@@ -98,12 +98,12 @@ protected Mono<String> resolveUrlPathInternal(String resourceUrlPath,
9898

9999
@Nullable
100100
protected String findWebJarResourcePath(String path) {
101-
int startOffset = (path.startsWith("/") ? 1 : 0);
102101
int endOffset = path.indexOf('/', 1);
103102
if (endOffset != -1) {
103+
int startOffset = (path.startsWith("/") ? 1 : 0);
104104
String webjar = path.substring(startOffset, endOffset);
105105
String partialPath = path.substring(endOffset + 1);
106-
String webJarPath = this.webJarAssetLocator.fullPath(webjar, partialPath);
106+
String webJarPath = this.webJarVersionLocator.fullPath(webjar, partialPath);
107107
if (webJarPath != null) {
108108
return webJarPath.substring(WEBJARS_LOCATION_LENGTH);
109109
}

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/LiteWebJarsResourceResolver.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ public class LiteWebJarsResourceResolver extends AbstractResourceResolver {
4747

4848
private static final int WEBJARS_LOCATION_LENGTH = WebJarVersionLocator.WEBJARS_PATH_PREFIX.length() + 1;
4949

50-
private final WebJarVersionLocator webJarAssetLocator;
50+
private final WebJarVersionLocator webJarVersionLocator;
5151

5252
/**
5353
* Create a {@code LiteWebJarsResourceResolver} with a default {@code WebJarVersionLocator} instance.
5454
*/
5555
public LiteWebJarsResourceResolver() {
56-
this.webJarAssetLocator = new WebJarVersionLocator();
56+
this.webJarVersionLocator = new WebJarVersionLocator();
5757
}
5858

5959
/**
6060
* Create a {@code LiteWebJarsResourceResolver} with a custom {@code WebJarVersionLocator} instance,
6161
* e.g. with a custom cache implementation.
6262
*/
63-
public LiteWebJarsResourceResolver(WebJarVersionLocator webJarAssetLocator) {
64-
this.webJarAssetLocator = webJarAssetLocator;
63+
public LiteWebJarsResourceResolver(WebJarVersionLocator webJarVersionLocator) {
64+
this.webJarVersionLocator = webJarVersionLocator;
6565
}
6666

6767
@Override
@@ -96,12 +96,12 @@ protected String resolveUrlPathInternal(String resourceUrlPath,
9696

9797
@Nullable
9898
protected String findWebJarResourcePath(String path) {
99-
int startOffset = (path.startsWith("/") ? 1 : 0);
10099
int endOffset = path.indexOf('/', 1);
101100
if (endOffset != -1) {
101+
int startOffset = (path.startsWith("/") ? 1 : 0);
102102
String webjar = path.substring(startOffset, endOffset);
103103
String partialPath = path.substring(endOffset + 1);
104-
String webJarPath = this.webJarAssetLocator.fullPath(webjar, partialPath);
104+
String webJarPath = this.webJarVersionLocator.fullPath(webjar, partialPath);
105105
if (webJarPath != null) {
106106
return webJarPath.substring(WEBJARS_LOCATION_LENGTH);
107107
}

0 commit comments

Comments
 (0)