Skip to content

Commit 354b0ff

Browse files
committed
refactor: sonarLint 반영
1 parent 22f500e commit 354b0ff

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tomcat/src/main/java/org/apache/coyote/http11/ResourceProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private Optional<URL> findFileURL(String resourcePath) {
2424
}
2525
return Optional.of(resourceURL);
2626
} catch (URISyntaxException e) {
27-
throw new RuntimeException(e);
27+
return Optional.empty();
2828
}
2929
}
3030

@@ -37,7 +37,7 @@ public String resourceBodyOf(String resourcePath) {
3737
}
3838
throw new IllegalArgumentException("파일이 존재하지 않습니다.");
3939
} catch (IOException e) {
40-
throw new RuntimeException(e);
40+
return null;
4141
}
4242
}
4343

tomcat/src/main/java/org/apache/coyote/http11/controller/Controller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
public interface Controller {
77

8-
Response handle(Request request);
8+
Response<Object> handle(Request request);
99
}

tomcat/src/main/java/org/apache/coyote/http11/request/Cookies.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
public class Cookies {
77

88
private static final String SESSION_COOKIE = "JSESSIONID";
9-
private Map<String, String> cookies;
9+
private final Map<String, String> cookieValues;
1010

11-
public Cookies(Map<String, String> cookies) {
12-
this.cookies = cookies;
11+
public Cookies(Map<String, String> cookieValues) {
12+
this.cookieValues = cookieValues;
1313
}
1414

1515
public Optional<String> getCookieOf(String cookieName) {
16-
if (!cookies.containsKey(cookieName)) {
16+
if (!cookieValues.containsKey(cookieName)) {
1717
return Optional.empty();
1818
}
19-
return Optional.of(cookies.get(cookieName));
19+
return Optional.of(cookieValues.get(cookieName));
2020
}
2121

2222
public Optional<String> getSessionCookie() {
23-
if (!cookies.containsKey(SESSION_COOKIE)) {
23+
if (!cookieValues.containsKey(SESSION_COOKIE)) {
2424
return Optional.empty();
2525
}
26-
return Optional.of(cookies.get(SESSION_COOKIE));
26+
return Optional.of(cookieValues.get(SESSION_COOKIE));
2727
}
2828
}

0 commit comments

Comments
 (0)