Skip to content

Commit de74c46

Browse files
committed
Reduce visibility.
1 parent 17a46db commit de74c46

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/main/java/com/github/hrytsenko/jsondata/springboot/error/ExceptionAdvices.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static class InternalExceptionAdvice {
4444

4545
@ExceptionHandler(Exception.class)
4646
@ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR)
47-
public ErrorResponse onInternalError(Exception exception) {
47+
ErrorResponse onInternalError(Exception exception) {
4848
log.error("Unexpected error", exception);
4949
return ErrorResponse.create("INTERNAL_ERROR", correlationSource.getCorrelation());
5050
}
@@ -62,42 +62,42 @@ static class ServiceExceptionAdvice {
6262

6363
@ExceptionHandler(ServiceException.BadRequest.class)
6464
@ResponseStatus(code = HttpStatus.BAD_REQUEST)
65-
public ErrorResponse onBadRequest(ServiceException.BadRequest exception) {
65+
ErrorResponse onBadRequest(ServiceException.BadRequest exception) {
6666
log.error("Bad request", exception);
6767
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
6868
}
6969

7070
@ExceptionHandler(ServiceException.Unauthorized.class)
7171
@ResponseStatus(code = HttpStatus.UNAUTHORIZED)
72-
public ErrorResponse onUnauthorized(ServiceException.Unauthorized exception) {
72+
ErrorResponse onUnauthorized(ServiceException.Unauthorized exception) {
7373
log.error("Unauthorized", exception);
7474
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
7575
}
7676

7777
@ExceptionHandler(ServiceException.Forbidden.class)
7878
@ResponseStatus(code = HttpStatus.FORBIDDEN)
79-
public ErrorResponse onForbidden(ServiceException.Forbidden exception) {
79+
ErrorResponse onForbidden(ServiceException.Forbidden exception) {
8080
log.error("Forbidden", exception);
8181
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
8282
}
8383

8484
@ExceptionHandler(ServiceException.NotFound.class)
8585
@ResponseStatus(code = HttpStatus.NOT_FOUND)
86-
public ErrorResponse onNotFound(ServiceException.NotFound exception) {
86+
ErrorResponse onNotFound(ServiceException.NotFound exception) {
8787
log.error("Not found", exception);
8888
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
8989
}
9090

9191
@ExceptionHandler(ServiceException.InternalError.class)
9292
@ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR)
93-
public ErrorResponse onInternalError(ServiceException.InternalError exception) {
93+
ErrorResponse onInternalError(ServiceException.InternalError exception) {
9494
log.error("Internal error", exception);
9595
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
9696
}
9797

9898
@ExceptionHandler(ServiceException.ServiceUnavailable.class)
9999
@ResponseStatus(code = HttpStatus.SERVICE_UNAVAILABLE)
100-
public ErrorResponse onServiceUnavailable(ServiceException.ServiceUnavailable exception) {
100+
ErrorResponse onServiceUnavailable(ServiceException.ServiceUnavailable exception) {
101101
log.error("Service unavailable", exception);
102102
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());
103103
}
@@ -115,21 +115,21 @@ static class ValidateExceptionAdvice {
115115

116116
@ExceptionHandler(JsonProcessingException.class)
117117
@ResponseStatus(HttpStatus.BAD_REQUEST)
118-
public ErrorResponse onProcessJson(JsonProcessingException exception) {
118+
ErrorResponse onProcessJson(JsonProcessingException exception) {
119119
log.error("JSON processing failed", exception);
120120
return ErrorResponse.create("BAD_CONTENT", correlationSource.getCorrelation());
121121
}
122122

123123
@ExceptionHandler(ValidateRequestException.class)
124124
@ResponseStatus(HttpStatus.BAD_REQUEST)
125-
public ErrorResponse onValidateRequest(ValidateRequestException exception) {
125+
ErrorResponse onValidateRequest(ValidateRequestException exception) {
126126
log.error("Request validation failed", exception);
127127
return ErrorResponse.create("INVALID_REQUEST", correlationSource.getCorrelation());
128128
}
129129

130130
@ExceptionHandler(ValidateResponseException.class)
131131
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
132-
public ErrorResponse onValidateResponse(ValidateResponseException exception) {
132+
ErrorResponse onValidateResponse(ValidateResponseException exception) {
133133
log.error("Response validation failed", exception);
134134
return ErrorResponse.create("INVALID_RESPONSE", correlationSource.getCorrelation());
135135
}

src/main/java/com/github/hrytsenko/jsondata/springboot/error/WrapErrorsAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WrapErrorsAspect {
2727

2828
@Around("@annotation(config)")
2929
@SneakyThrows
30-
public Object handle(ProceedingJoinPoint point, WrapErrors config) {
30+
Object handle(ProceedingJoinPoint point, WrapErrors config) {
3131
try {
3232
return point.proceed();
3333
} catch (ServiceException exception) {

src/main/java/com/github/hrytsenko/jsondata/springboot/web/ValidateRequestAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ValidateRequestAspect {
3333
ValidatorSource validatorSource;
3434

3535
@Before("@annotation(config)")
36-
public void handle(JoinPoint point, ValidateRequest config) {
36+
void handle(JoinPoint point, ValidateRequest config) {
3737
JsonEntity<?> target = (JsonEntity<?>) point.getArgs()[0];
3838

3939
String schemaName = config.value();

src/main/java/com/github/hrytsenko/jsondata/springboot/web/ValidateResponseAspect.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ValidateResponseAspect {
3535

3636
@Around("@annotation(config)")
3737
@SneakyThrows
38-
public Object handle(ProceedingJoinPoint point, ValidateResponse config) {
38+
Object handle(ProceedingJoinPoint point, ValidateResponse config) {
3939
JsonEntity<?> target = (JsonEntity<?>) point.proceed();
4040

4141
String schemaName = config.value();
@@ -48,4 +48,5 @@ public Object handle(ProceedingJoinPoint point, ValidateResponse config) {
4848

4949
return target;
5050
}
51+
5152
}

0 commit comments

Comments
 (0)