Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 37692cc

Browse files
committed
code styling
remove extra space on type parameters
1 parent c2493a8 commit 37692cc

File tree

14 files changed

+31
-31
lines changed

14 files changed

+31
-31
lines changed

src/main/java/com/kttdevelopment/simplehttpserver/HttpSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
public abstract class HttpSession {
1515

16-
static final HashMap<String, HttpSession> sessions = new HashMap<>();
16+
static final HashMap<String,HttpSession> sessions = new HashMap<>();
1717

1818
/**
1919
* Creates an empty {@link HttpSession}. Sessions are usually created by {@link HttpSessionHandler#getSession(HttpExchange)}.

src/main/java/com/kttdevelopment/simplehttpserver/HttpSessionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class HttpSessionHandler {
1616

17-
private final Map<String, HttpSession> sessions = Collections.synchronizedMap(new HashMap<>());
17+
private final Map<String,HttpSession> sessions = Collections.synchronizedMap(new HashMap<>());
1818

1919
private final String cookie;
2020

@@ -79,7 +79,7 @@ public final HttpSession getSession(final HttpExchange exchange){
7979

8080
@SuppressWarnings("SpellCheckingInspection")
8181
final String rcookies = exchange.getRequestHeaders().getFirst("Cookie");
82-
final Map<String, String> cookies = new HashMap<>();
82+
final Map<String,String> cookies = new HashMap<>();
8383

8484
if(rcookies != null && !rcookies.isEmpty()){
8585
final String[] pairs = rcookies.split("; ");

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchange.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static SimpleHttpExchange create(final HttpExchange exchange){
220220
* @since 02.00.00
221221
* @author Ktt Development
222222
*/
223-
public abstract Map<String, String> getGetMap();
223+
public abstract Map<String,String> getGetMap();
224224

225225
/**
226226
* Returns if there is a GET request.
@@ -312,7 +312,7 @@ static SimpleHttpExchange create(final HttpExchange exchange){
312312
* @since 02.00.00
313313
* @author Ktt Development
314314
*/
315-
public abstract Map<String, String> getCookies();
315+
public abstract Map<String,String> getCookies();
316316

317317
/**
318318
* Sets a cookie in the response header.

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ final class SimpleHttpExchangeImpl extends SimpleHttpExchange {
3838
private final RequestMethod requestMethod;
3939

4040
private final String rawGet;
41-
private final Map<String, String> getMap;
41+
private final Map<String,String> getMap;
4242
private final boolean hasGet;
4343

4444
private final String rawPost;
4545
@SuppressWarnings("rawtypes")
4646
private final Map postMap;
4747
private final boolean hasPost;
4848

49-
private final Map<String, String> cookies;
49+
private final Map<String,String> cookies;
5050

5151
private final OutputStream outputStream;
5252

5353
@SuppressWarnings("FieldCanBeLocal")
54-
private final Function<String, Map<String, String>> parseWwwFormEnc = s -> {
55-
final LinkedHashMap<String, String> OUT = new LinkedHashMap<>();
54+
private final Function<String,Map<String,String>> parseWwwFormEnc = s -> {
55+
final LinkedHashMap<String,String> OUT = new LinkedHashMap<>();
5656
final String[] pairs = s.split("&");
5757

5858
for(final String pair : pairs){
@@ -145,13 +145,13 @@ static SimpleHttpExchange create(final HttpExchange exchange){
145145
postMap = new HashMap<>();
146146
final String[] pairs = OUT.replace(endBoundary,"").split(Pattern.quote(startBoundary));
147147
for(String pair : pairs){
148-
final Map<String, Map> postHeaders = new HashMap<>();
148+
final Map<String,Map> postHeaders = new HashMap<>();
149149
if(pair.contains("\r\n\r\n")){
150150
final String[] headers = pair.substring(0, pair.indexOf("\r\n\r\n")).split("\r\n");
151151

152152
for (String header : headers) {
153153
final Map headerMap = new HashMap<>();
154-
final Map<String, String> val = new HashMap<>();
154+
final Map<String,String> val = new HashMap<>();
155155

156156
final Matcher headerMatcher = boundaryHeaderPattern.matcher(header);
157157
if (headerMatcher.find()) {
@@ -171,7 +171,7 @@ static SimpleHttpExchange create(final HttpExchange exchange){
171171
row.put("value", pair.substring(pair.indexOf("\r\n\r\n")+4, pair.lastIndexOf("\r\n")));
172172

173173
postMap.put(
174-
((HashMap<String, String>) postHeaders.get("Content-Disposition").get("parameters")).get("name"),
174+
((HashMap<String,String>) postHeaders.get("Content-Disposition").get("parameters")).get("name"),
175175
row
176176
);
177177
}
@@ -260,7 +260,7 @@ public final String getRawGet(){
260260
}
261261

262262
@Override
263-
public final Map<String, String> getGetMap(){
263+
public final Map<String,String> getGetMap(){
264264
return getMap;
265265
}
266266

@@ -301,7 +301,7 @@ public final int getResponseCode(){
301301
//
302302

303303
@Override
304-
public final Map<String, String> getCookies(){
304+
public final Map<String,String> getCookies(){
305305
return new HashMap<>(cookies);
306306
}
307307

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public static SimpleHttpServer create(final int port, final int backlog) throws
414414
* @since 02.00.00
415415
* @author Ktt Development
416416
*/
417-
public abstract Map<HttpContext, HttpHandler> getContexts();
417+
public abstract Map<HttpContext,HttpHandler> getContexts();
418418

419419
//
420420

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class SimpleHttpServerImpl extends SimpleHttpServer {
2323

2424
private HttpSessionHandler sessionHandler;
2525

26-
private final Map<HttpContext, HttpHandler> contexts = new HashMap<>();
26+
private final Map<HttpContext,HttpHandler> contexts = new HashMap<>();
2727

2828
private boolean running = false;
2929

@@ -196,7 +196,7 @@ public synchronized final void removeContext(final HttpContext context){
196196

197197
@Override
198198
public final HttpHandler getContextHandler(final String context){
199-
for(final Map.Entry<HttpContext, HttpHandler> entry : contexts.entrySet())
199+
for(final Map.Entry<HttpContext,HttpHandler> entry : contexts.entrySet())
200200
if(entry.getKey().getPath().equals(ContextUtil.getContext(context, true, false)))
201201
return entry.getValue();
202202
return null;
@@ -208,7 +208,7 @@ public final HttpHandler getContextHandler(final HttpContext context){
208208
}
209209

210210
@Override
211-
public final Map<HttpContext, HttpHandler> getContexts(){
211+
public final Map<HttpContext,HttpHandler> getContexts(){
212212
return new HashMap<>(contexts);
213213
}
214214

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpsServerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class SimpleHttpsServerImpl extends SimpleHttpsServer {
2323

2424
private HttpSessionHandler sessionHandler;
2525

26-
private final Map<HttpContext, HttpHandler> contexts = new HashMap<>();
26+
private final Map<HttpContext,HttpHandler> contexts = new HashMap<>();
2727

2828
private boolean running = false;
2929

@@ -208,7 +208,7 @@ public synchronized final void removeContext(final HttpContext context){
208208

209209
@Override
210210
public final HttpHandler getContextHandler(final String context){
211-
for(final Map.Entry<HttpContext, HttpHandler> entry : contexts.entrySet())
211+
for(final Map.Entry<HttpContext,HttpHandler> entry : contexts.entrySet())
212212
if(entry.getKey().getPath().equals(ContextUtil.getContext(context, true, false)))
213213
return entry.getValue();
214214
return null;
@@ -220,7 +220,7 @@ public final HttpHandler getContextHandler(final HttpContext context){
220220
}
221221

222222
@Override
223-
public final Map<HttpContext, HttpHandler> getContexts(){
223+
public final Map<HttpContext,HttpHandler> getContexts(){
224224
return new HashMap<>(contexts);
225225
}
226226

src/main/java/com/kttdevelopment/simplehttpserver/handler/DirectoryEntry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DirectoryEntry {
2929
private final ByteLoadingOption loadingOption;
3030
private final boolean isWalkthrough;
3131

32-
private final Map<String, FileEntry> preloadedFiles = new ConcurrentHashMap<>(); // preload/watch-load only
32+
private final Map<String,FileEntry> preloadedFiles = new ConcurrentHashMap<>(); // preload/watch-load only
3333
private final Path directoryPath;
3434

3535
/**
@@ -133,7 +133,7 @@ public final FileVisitResult visitFile(final Path path, final BasicFileAttribute
133133
}
134134
}
135135

136-
private final Map<Path, AtomicBoolean> watchService = new ConcurrentHashMap<>();
136+
private final Map<Path,AtomicBoolean> watchService = new ConcurrentHashMap<>();
137137

138138
private void createWatchService(final Path path, final Consumer<WatchEvent<?>> consumer) throws IOException{
139139
final WatchService service = FileSystems.getDefault().newWatchService();
@@ -220,7 +220,7 @@ public final File getDirectory(){
220220
* @since 02.00.00
221221
* @author Ktt Development
222222
*/
223-
public Map<String, FileEntry> getPreloadedFiles(){
223+
public Map<String,FileEntry> getPreloadedFiles(){
224224
return Collections.unmodifiableMap(preloadedFiles);
225225
}
226226

src/main/java/com/kttdevelopment/simplehttpserver/handler/ExchangeThrottler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
public class ExchangeThrottler extends ConnectionThrottler {
2424

25-
private final Map<InetAddress, AtomicInteger> connections = new ConcurrentHashMap<>();
25+
private final Map<InetAddress,AtomicInteger> connections = new ConcurrentHashMap<>();
2626

2727
/**
2828
* Creates a throttler with limits on each exchange.

src/main/java/com/kttdevelopment/simplehttpserver/handler/FileHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class FileHandler implements SimpleHttpHandler {
3131

3232
private final FileHandlerAdapter adapter;
3333

34-
private final Map<String, FileEntry> files = new ConcurrentHashMap<>();
35-
private final Map<String, DirectoryEntry> directories = new ConcurrentHashMap<>();
34+
private final Map<String,FileEntry> files = new ConcurrentHashMap<>();
35+
private final Map<String,DirectoryEntry> directories = new ConcurrentHashMap<>();
3636

3737
/**
3838
* Creates a file handler without a {@link FileHandlerAdapter}. This will use the files name and bytes.

0 commit comments

Comments
 (0)