Skip to content

Commit 47c0b8d

Browse files
Code analysis changes were added
1 parent dfee630 commit 47c0b8d

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

src/main/java/ru/mystamps/web/feature/series/importing/JdbcSeriesImportDao.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
*/
1818
package ru.mystamps.web.feature.series.importing;
1919

20+
import java.util.Collections;
21+
import java.util.Date;
22+
import java.util.HashMap;
23+
import java.util.Map;
24+
import java.util.List;
2025
import lombok.RequiredArgsConstructor;
2126
import org.apache.commons.lang3.Validate;
2227
import org.springframework.beans.factory.annotation.Value;
@@ -26,7 +31,6 @@
2631
import org.springframework.jdbc.support.GeneratedKeyHolder;
2732
import org.springframework.jdbc.support.KeyHolder;
2833

29-
import java.util.*;
3034

3135
// it complains that "request_id" is present many times
3236
@SuppressWarnings("PMD.AvoidDuplicateLiterals")

src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportServiceImpl.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@
1717
*/
1818
package ru.mystamps.web.feature.series.importing;
1919

20-
import lombok.RequiredArgsConstructor;
20+
import java.math.BigDecimal;
21+
import java.net.URI;
22+
import java.net.URISyntaxException;
23+
import java.util.Date;
24+
import java.util.List;
25+
import java.util.Set;
2126
import org.apache.commons.lang3.StringUtils;
2227
import org.apache.commons.lang3.Validate;
2328
import org.slf4j.Logger;
2429
import org.springframework.context.ApplicationEventPublisher;
2530
import org.springframework.security.access.prepost.PreAuthorize;
2631
import org.springframework.transaction.annotation.Transactional;
32+
import lombok.RequiredArgsConstructor;
2733
import ru.mystamps.web.Db;
2834
import ru.mystamps.web.Db.SeriesImportRequestStatus;
2935
import ru.mystamps.web.feature.participant.AddParticipantDto;
@@ -38,13 +44,6 @@
3844
import ru.mystamps.web.support.spring.security.HasAuthority;
3945
import ru.mystamps.web.util.CatalogUtils;
4046

41-
import java.math.BigDecimal;
42-
import java.net.URI;
43-
import java.net.URISyntaxException;
44-
import java.util.Date;
45-
import java.util.List;
46-
import java.util.Set;
47-
4847
// it complains on "Request id must be non null"
4948
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
5049
@RequiredArgsConstructor
@@ -131,7 +130,7 @@ public void changeStatus(Integer requestId, String oldStatus, String newStatus)
131130
Validate.isTrue(!oldStatus.equals(newStatus), "Statuses must be different");
132131

133132
Date now = new Date();
134-
UpdateImportRequestStatusDbDto status =new UpdateImportRequestStatusDbDto(requestId, now, oldStatus, newStatus);
133+
UpdateImportRequestStatusDbDto status = new UpdateImportRequestStatusDbDto(requestId, now, oldStatus, newStatus);
135134

136135
seriesImportDao.changeStatus(status);
137136
}
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1+
/*
2+
* Copyright (C) 2009-2019 Slava Semushin <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17+
*/
118
package ru.mystamps.web.feature.series.importing;
219

20+
21+
import java.util.Date;
322
import lombok.Getter;
423
import lombok.RequiredArgsConstructor;
524
import lombok.ToString;
625

7-
import java.util.Date;
8-
926
@Getter
1027
@ToString
1128
@RequiredArgsConstructor
1229
public class UpdateImportRequestStatusDbDto {
1330
private final Integer requestId;
1431
private final Date date;
15-
private final String oldStatus;
32+
private final String oldStatus;
1633
private final String newStatus;
17-
18-
// public UpdateImportRequestStatusDbDto(Integer requestId, Date date, String oldStatus, String newStatus) {
19-
// this.requestId = requestId;
20-
// this.date = date;
21-
// this.oldStatus = oldStatus;
22-
// this.newStatus = newStatus;
23-
// }
2434
}

0 commit comments

Comments
 (0)