Skip to content

Commit 5952501

Browse files
committed
fix pmd/cs
1 parent 59e0433 commit 5952501

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/main/java/ru/mystamps/web/controller/SeriesController.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ public String processInput(
204204
// User without permissions has tried to download a file. It means that he
205205
// didn't specify a file but somehow provide a url to an image. In this case,
206206
// let's show an error message that file is required.
207-
result.rejectValue("image", "ru.mystamps.web.validation.jsr303.NotEmptyFilename.message");
207+
result.rejectValue(
208+
"image",
209+
"ru.mystamps.web.validation.jsr303.NotEmptyFilename.message"
210+
);
208211
form.setImageUrl(null);
209212
break;
210213
default:
@@ -213,6 +216,7 @@ public String processInput(
213216
DownloadResult.class.getName() + "." + code.toString(),
214217
"Could not download image"
215218
);
219+
break;
216220
}
217221
request.removeAttribute(DownloadImageInterceptor.ERROR_CODE_ATTR_NAME);
218222
}

src/main/java/ru/mystamps/web/controller/interceptor/DownloadImageInterceptor.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
@RequiredArgsConstructor
4646
public class DownloadImageInterceptor extends HandlerInterceptorAdapter {
4747

48-
private static final Logger LOG = LoggerFactory.getLogger(DownloadImageInterceptor.class);
49-
5048
/**
5149
* Field name that contains image URL.
5250
*/
@@ -66,6 +64,8 @@ public class DownloadImageInterceptor extends HandlerInterceptorAdapter {
6664
*/
6765
public static final String ERROR_CODE_ATTR_NAME = "DownloadedImage.ErrorCode";
6866

67+
private static final Logger LOG = LoggerFactory.getLogger(DownloadImageInterceptor.class);
68+
6969
private final DownloaderService downloaderService;
7070

7171
@Override
@@ -110,7 +110,10 @@ public boolean preHandle(
110110
SecurityContextUtils.getUserId(),
111111
imageUrl
112112
);
113-
request.setAttribute(ERROR_CODE_ATTR_NAME, DownloadResult.Code.INSUFFICIENT_PERMISSIONS);
113+
request.setAttribute(
114+
ERROR_CODE_ATTR_NAME,
115+
DownloadResult.Code.INSUFFICIENT_PERMISSIONS
116+
);
114117
return true;
115118
}
116119

0 commit comments

Comments
 (0)