Skip to content

Commit 2d441cd

Browse files
committed
Rename variables
1 parent 9c411a1 commit 2d441cd

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/main/java/httpserver/file/PathExaminer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
public class PathExaminer {
1414

15-
public Path getFullPath(Path root, String requestPathString) {
16-
return root.resolve(requestPathString.substring(1));
15+
public Path getFullPath(Path root, String requestPath) {
16+
return root.resolve(requestPath.substring(1));
1717
}
1818

1919
public Path getPath(String input) {

src/main/java/httpserver/header/RangeHeaderValueParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ private Range getRange(String[] parts) {
3636
}
3737

3838
private String[] getParts(String headerValue) {
39-
String rangeString = headerValue.substring(6);
40-
return rangeString.split("-", 2);
39+
String range = headerValue.substring(6);
40+
return range.split("-", 2);
4141
}
4242

4343
private int parseRangeValue(String value) {

src/test/java/httpserver/file/PathExaminerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ public void readsDirContentsToPathList() throws Exception {
6969

7070
@Test
7171
public void makesFullPathFromRootPathAndRequestPathString() throws Exception {
72-
String requestPathString = "/example.txt";
72+
String requestPath= "/example.txt";
7373

7474
Path expected = Paths.get("tmp/serving-dir/example.txt");
7575
assertEquals(expected,
76-
pathExaminer.getFullPath(root, requestPathString));
76+
pathExaminer.getFullPath(root, requestPath));
7777
}
7878

7979
@Test
8080
public void makesFullPathCorrectlyWhenRequestPathIsSlash() throws Exception {
81-
String requestPathString = "/";
81+
String requestPath= "/";
8282

8383
Path expected = Paths.get("tmp/serving-dir");
8484
assertEquals(expected,
85-
pathExaminer.getFullPath(root, requestPathString));
85+
pathExaminer.getFullPath(root, requestPath));
8686
}
8787

8888
@Test

src/test/java/httpserver/header/RangeHeaderValueParserTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package httpserver.header;
22

33
import httpserver.Range;
4-
import httpserver.header.RangeHeaderValueParser;
54
import org.junit.Test;
65

76
import static org.junit.Assert.*;

0 commit comments

Comments
 (0)