Skip to content

Commit ef7b41e

Browse files
committed
style: use FIXME in comments instead of TODO to unbreak 0pdd.
Adapt code base to backward incompatible changes in pdd/0pdd. See: yegor256/0pdd#260 No code changes.
1 parent 6f72c3b commit ef7b41e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+62
-62
lines changed

Dangerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ if File.file?(bootlint_output)
239239
file = github.html_link("#{file}#L#{lineno}")
240240
fail("bootlint error in #{file}:\n[#{code}](https://github.com/twbs/bootlint/wiki/#{code}): #{msg}")
241241
end
242-
# TODO: add link to wiki page (#316)
242+
# FIXME: add link to wiki page (#316)
243243
print_errors_summary 'bootlint', errors_count
244244
end
245245

@@ -292,7 +292,7 @@ if File.file?(shellcheck_output)
292292
file = github.html_link("#{file}#L#{lineno}")
293293
fail("shellcheck error in #{file}:\n[#{code}](https://github.com/koalaman/shellcheck/wiki/#{code}): #{msg}")
294294
end
295-
# TODO: add link to wiki page
295+
# FIXME: add link to wiki page
296296
print_errors_summary 'shellcheck', errors_count
297297
end
298298

@@ -395,7 +395,7 @@ if File.file?(validator_output)
395395
fail("html5validator error in #{file}:\n#{msg}")
396396
end
397397

398-
# TODO: add link to wiki page (#541)
398+
# FIXME: add link to wiki page (#541)
399399
print_errors_summary 'html5validator', errors_count
400400
end
401401

@@ -654,7 +654,7 @@ if File.file?(rf_report)
654654
file = github.html_link("#{file}#{line}")
655655
fail("robotframework-maven-plugin error in #{file}:\nTest case `#{testcase}` fails with message:\n#{msg}")
656656
end
657-
# TODO: add link to wiki page (#530)
657+
# FIXME: add link to wiki page (#530)
658658
print_errors_summary 'robotframework-maven-plugin', errors_count
659659
end
660660

@@ -690,7 +690,7 @@ if File.file?(failsafe_report)
690690
file = github.html_link(file)
691691
testcase = clazz.split('.')[-1] + '.' + node['name']
692692
msg = node.xpath('./exception/message').text.strip
693-
# TODO: highlight line number
693+
# FIXME: highlight line number
694694
fail("maven-failsafe-plugin error in #{file}:\nTest case `#{testcase}` fails with error:\n#{msg}")
695695
end
696696

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ENV SPRING_PROFILES_ACTIVE=test
1616
# See also: https://docs.docker.com/engine/reference/builder/#run
1717
# NOTE: /data/uploads and /data/preview are being used only in "prod" profile.
1818
# - Setting up a timezone to Moscow time.
19-
# TODO: remove when #76 will be resolved and application will use UTC timezone.
19+
# FIXME: remove when #76 will be resolved and application will use UTC timezone.
2020
RUN mkdir /data \
2121
&& useradd mystamps --home-dir /data/mystamps --create-home --comment 'MyStamps' \
2222
&& mkdir /data/uploads /data/preview /data/heap-dumps \

docker/prod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
# the generated root password will be printed to stdout (GENERATED ROOT PASSWORD: ...)
3030
- MYSQL_RANDOM_ROOT_PASSWORD=true
3131
- MYSQL_USER=mystamps
32-
# TODO: try to use a secret
32+
# FIXME: try to use a secret
3333
- MYSQL_PASSWORD=secret
3434
# the user specified above will be granted superuser access automatically
3535
- MYSQL_DATABASE=mystamps

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@
726726
<version>${dockerfile.plugin.version}</version>
727727
<configuration>
728728
<repository>phpcoder/mystamps</repository>
729-
<!-- TODO: set it to docker/ after https://github.com/spotify/dockerfile-maven/pull/89 will be merged -->
729+
<!-- FIXME: set it to docker/ after https://github.com/spotify/dockerfile-maven/pull/89 will be merged -->
730730
<contextDirectory>target</contextDirectory>
731731
</configuration>
732732
</plugin>
@@ -859,7 +859,7 @@
859859
<artifactId>maven-resources-plugin</artifactId>
860860
<version>${resources.plugin.version}</version>
861861
<executions>
862-
<!-- TODO: remove this workaround after merging https://github.com/spotify/dockerfile-maven/pull/89 -->
862+
<!-- FIXME: remove this workaround after merging https://github.com/spotify/dockerfile-maven/pull/89 -->
863863
<execution>
864864
<id>copy-docker-resources</id>
865865
<goals>

src/main/java/ru/mystamps/web/Url.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public final class Url {
110110
public static final String BOOTSTRAP_LANGUAGE = "https://cdn.rawgit.com/usrz/bootstrap-languages/3ac2a3d2b27ac43a471cd99e79d378a03b2c6b5f/languages.min.css";
111111

112112
// CheckStyle: ignore LineLength for next 3 lines
113-
// TODO: use minimal version of CSS file when it will be available (https://github.com/webjars/selectize.js/issues/3)
113+
// FIXME: use minimal version of CSS file when it will be available (https://github.com/webjars/selectize.js/issues/3)
114114
public static final String SELECTIZE_CSS = "/public/selectize/0.12.4/css/selectize.bootstrap3.css";
115115
public static final String SELECTIZE_JS = "/public/selectize/0.12.4/js/standalone/selectize.min.js";
116116

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void notFound(
5050
@RequestHeader(name = "referer", required = false) String referer,
5151
@RequestHeader(name = "user-agent", required = false) String agent) {
5252

53-
// TODO: sanitize all user's values (#60)
53+
// FIXME: sanitize all user's values (#60)
5454
String ip = request.getRemoteAddr();
5555
String method = request.getMethod();
5656

@@ -64,7 +64,7 @@ public void internalError(
6464
@RequestAttribute(name = RequestDispatcher.ERROR_EXCEPTION, required = false) Exception exception,
6565
@RequestAttribute(name = RequestDispatcher.ERROR_REQUEST_URI, required = false) String page) {
6666

67-
// TODO: log to database (with *.status_code, *.message, *.servlet_name and user details)
67+
// FIXME: log to database (with *.status_code, *.message, *.servlet_name and user details)
6868

6969
if (page != null && !Url.INTERNAL_ERROR_PAGE.equals(page)) {
7070
LOG.error(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
public class SitemapController {
4343
private static final Logger LOG = LoggerFactory.getLogger(SitemapController.class);
4444

45-
// TODO: convert dates to UTC and omit server-specific timezone part
45+
// FIXME: convert dates to UTC and omit server-specific timezone part
4646
// According to http://www.w3.org/TR/NOTE-datetime
4747
private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mmXXX";
4848

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public boolean preHandle(
114114
}
115115

116116
if (!SecurityContextUtils.hasAuthority(Authority.DOWNLOAD_IMAGE)) {
117-
// TODO(security): fix possible log injection
117+
// FIXME(security): fix possible log injection
118118
LOG.warn(
119119
"User #{} without permissions has tried to download a file from '{}'",
120120
SecurityContextUtils.getUserId(),

src/main/java/ru/mystamps/web/feature/category/CategoryServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public List<Integer> findIdsByNames(List<String> names) {
103103
public List<Integer> findIdsWhenNameStartsWith(String name) {
104104
Validate.isTrue(StringUtils.isNotBlank(name), "Name must be non-blank");
105105

106-
// TODO: escape % and _ chars in name
106+
// FIXME: escape % and _ chars in name
107107
Validate.isTrue(
108108
!StringUtils.containsAny(name, '%', '_'),
109109
"Name must not contain '%' or '_' chars"

src/main/java/ru/mystamps/web/feature/collection/CollectionController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public String showPrices(
112112
return null;
113113
}
114114

115-
// TODO: we need only ownerName, without id and slug
115+
// FIXME: we need only ownerName, without id and slug
116116
CollectionInfoDto collection = collectionService.findBySlug(slug);
117117
if (collection == null) {
118118
response.sendError(HttpServletResponse.SC_NOT_FOUND);

src/main/java/ru/mystamps/web/feature/collection/CollectionServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public CollectionInfoDto findBySlug(String slug) {
193193
private static String formatSeriesInfo(AddToCollectionDbDto collectionDto) {
194194
StringBuilder sb = new StringBuilder();
195195

196-
// TODO: it would be good to include number of stamps in series vs in collection
196+
// FIXME: it would be good to include number of stamps in series vs in collection
197197
sb.append("stamps=")
198198
.append(collectionDto.getNumberOfStamps());
199199

src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public List<Integer> findIdsByNames(List<String> names) {
103103
public List<Integer> findIdsWhenNameStartsWith(String name) {
104104
Validate.isTrue(StringUtils.isNotBlank(name), "Name must be non-blank");
105105

106-
// TODO: escape % and _ chars in name
106+
// FIXME: escape % and _ chars in name
107107
Validate.isTrue(
108108
!StringUtils.containsAny(name, '%', '_'),
109109
"Name must not contain '%' or '_' chars"

src/main/java/ru/mystamps/web/feature/image/FilesystemImagePersistenceStrategy.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void init() {
5151

5252
} else if (!storageDir.canWrite()) {
5353
log.warn(
54-
// TODO(java9): log also user: ProcessHandle.current().info().user()
54+
// FIXME(java9): log also user: ProcessHandle.current().info().user()
5555
"Directory '{}' exists but isn't writable for the current user! "
5656
+ "Image uploading won't work.",
5757
storageDir
@@ -67,7 +67,7 @@ public void init() {
6767
);
6868

6969
} else if (!previewDir.canWrite()) {
70-
// TODO(java9): log also user: ProcessHandle.current().info().user()
70+
// FIXME(java9): log also user: ProcessHandle.current().info().user()
7171
log.warn(
7272
"Directory '{}' exists but isn't writable for the current user! "
7373
+ "Image preview generation won't work",
@@ -177,7 +177,7 @@ private ImageDto get(File dir, ImageInfoDto image, boolean logWarning) {
177177
}
178178

179179
private static String generateFileName(ImageInfoDto image) {
180-
// TODO(performance): specify initial capacity explicitly
180+
// FIXME(performance): specify initial capacity explicitly
181181
return new StringBuilder()
182182
.append(image.getId())
183183
.append('.')

src/main/java/ru/mystamps/web/feature/image/ImageController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void getImage(@PathVariable("id") Integer imageId, HttpServletResponse re
5151
return;
5252
}
5353

54-
// TODO: set content disposition
54+
// FIXME: set content disposition
5555
response.setContentType("image/" + image.getType().toLowerCase(Locale.ENGLISH));
5656
response.setContentLength(image.getData().length);
5757

src/main/java/ru/mystamps/web/feature/image/ImageServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private String abbreviateIfLengthGreaterThan(String text, int maxLength) {
175175
return text;
176176
}
177177

178-
// TODO(security): fix possible log injection
178+
// FIXME(security): fix possible log injection
179179
log.warn(
180180
"Length of value for 'filename' field ({}) exceeds max field size ({}): '{}'",
181181
text.length(),

src/main/java/ru/mystamps/web/feature/participant/AddParticipantForm.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public class AddParticipantForm implements AddParticipantDto {
4545
@Size(max = PARTICIPANT_URL_MAX_LENGTH, message = "{value.too-long}")
4646
private String url;
4747

48-
// TODO: must be positive
49-
// TODO: must be existing group
48+
// FIXME: must be positive
49+
// FIXME: must be existing group
5050
private Integer groupId;
5151

5252
@NotNull

src/main/java/ru/mystamps/web/feature/series/JdbcSeriesDao.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
import ru.mystamps.web.support.jdbc.RowMappers;
3838

39-
// TODO: move stamps related methods to separate interface (#88)
39+
// FIXME: move stamps related methods to separate interface (#88)
4040
@SuppressWarnings({
4141
"PMD.AvoidDuplicateLiterals",
4242
"PMD.TooManyMethods",

src/main/java/ru/mystamps/web/feature/series/SeriesController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ private static void addImageFormToModel(Model model) {
664664
}
665665

666666
private static void addStampsToCollectionForm(Model model, SeriesDto series) {
667-
// TODO: only add when isSeriesInCollection
667+
// FIXME: only add when isSeriesInCollection
668668
if (model.containsAttribute("addToCollectionForm")) {
669669
return;
670670
}

src/main/java/ru/mystamps/web/feature/series/SeriesDao.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Date;
2121
import java.util.List;
2222

23-
// TODO: move stamps related methods to separate interface (#88)
23+
// FIXME: move stamps related methods to separate interface (#88)
2424
@SuppressWarnings("PMD.TooManyMethods")
2525
public interface SeriesDao {
2626
Integer add(AddSeriesDbDto series);

src/main/java/ru/mystamps/web/feature/series/SeriesService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Date;
2121
import java.util.List;
2222

23-
// TODO: move stamps related methods to separate interface (#88)
23+
// FIXME: move stamps related methods to separate interface (#88)
2424
@SuppressWarnings("PMD.TooManyMethods")
2525
public interface SeriesService {
2626
Integer add(AddSeriesDto dto, Integer userId, boolean userCanAddComments);

src/main/java/ru/mystamps/web/feature/series/SeriesServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import ru.mystamps.web.support.spring.security.HasAuthority;
3939
import ru.mystamps.web.util.CatalogUtils;
4040

41-
// TODO: move stamps related methods to separate interface (#88)
41+
// FIXME: move stamps related methods to separate interface (#88)
4242
// The String literal "Series id must be non null" appears N times in this file
4343
// and we think that it's OK.
4444
@SuppressWarnings({ "PMD.TooManyMethods", "PMD.AvoidDuplicateLiterals" })

src/main/java/ru/mystamps/web/feature/series/importing/event/DownloadingSucceededEventListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ public void onApplicationEvent(DownloadingSucceeded event) {
6767

6868
SiteParser parser = siteParserService.findForUrl(event.getUrl());
6969
if (parser == null) {
70-
// TODO: how to handle error? maybe publish UnexpectedErrorEvent?
70+
// FIXME: how to handle error? maybe publish UnexpectedErrorEvent?
7171
log.error("Request #{}: could not find appropriate parser", requestId);
7272
return;
7373
}
7474

7575
String content = seriesImportService.getDownloadedContent(requestId);
7676
if (content == null) {
77-
// TODO: how to handle error? maybe publish UnexpectedErrorEvent?
77+
// FIXME: how to handle error? maybe publish UnexpectedErrorEvent?
7878
log.error("Request #{}: could not load a content from database", requestId);
7979
return;
8080
}

src/main/java/ru/mystamps/web/feature/series/importing/event/ParsingFailedEventListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class ParsingFailedEventListener
4242
public void onApplicationEvent(ParsingFailed event) {
4343
Integer requestId = event.getRequestId();
4444

45-
// TODO: more info?
45+
// FIXME: more info?
4646
log.info("Request #{}: parsing failed", requestId);
4747

4848
seriesImportService.changeStatus(

src/main/java/ru/mystamps/web/service/HttpURLConnectionDownloaderService.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public class HttpURLConnectionDownloaderService implements DownloaderService {
5050
LoggerFactory.getLogger(HttpURLConnectionDownloaderService.class);
5151

5252
// We don't support redirects because they allow to bypass some of our validations.
53-
// TODO: How exactly redirects can harm?
53+
// FIXME: How exactly redirects can harm?
5454
@SuppressWarnings({"PMD.RedundantFieldInitializer", "PMD.ImmutableField"})
5555
private boolean followRedirects = false;
5656

5757
// Only types listed here will be downloaded. For other types, INVALID_FILE_TYPE error
5858
// will be returned. An empty array (or null) means that all types are allowed.
59-
// TODO: at this moment we do a case sensitive comparison. Should we change it?
59+
// FIXME: at this moment we do a case sensitive comparison. Should we change it?
6060
private final String[] allowedContentTypes;
6161

6262
// Max time to wait during opening a connection to a resource (in milliseconds).
@@ -67,7 +67,7 @@ public class HttpURLConnectionDownloaderService implements DownloaderService {
6767
@Override
6868
@PreAuthorize(HasAuthority.DOWNLOAD_IMAGE)
6969
public DownloadResult download(String fileUrl) {
70-
// TODO(security): fix possible log injection
70+
// FIXME(security): fix possible log injection
7171
LOG.debug("Downloading '{}'", fileUrl);
7272

7373
try {
@@ -93,7 +93,7 @@ public DownloadResult download(String fileUrl) {
9393
return DownloadResult.failed(validationResult);
9494
}
9595

96-
// TODO(java9): use InputStream.readAllBytes()
96+
// FIXME(java9): use InputStream.readAllBytes()
9797
byte[] data = StreamUtils.copyToByteArray(stream);
9898
String contentType = conn.getContentType();
9999
return DownloadResult.succeeded(data, contentType);
@@ -130,7 +130,7 @@ private static HttpURLConnection openConnection(URL url) throws IOException {
130130
}
131131

132132
private static void configureUserAgent(URLConnection conn) {
133-
// TODO: make it configurable
133+
// FIXME: make it configurable
134134
conn.setRequestProperty(
135135
"User-Agent",
136136
"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0"
@@ -181,7 +181,7 @@ private Code validateConnection(HttpURLConnection conn) throws IOException {
181181
contentType = StringUtils.substringBefore(contentType, ";");
182182

183183
if (allowedContentTypes != null && !ArrayUtils.contains(allowedContentTypes, contentType)) {
184-
// TODO(security): fix possible log injection
184+
// FIXME(security): fix possible log injection
185185
LOG.debug("Couldn't download file: unsupported file type '{}'", contentType);
186186
return Code.INVALID_FILE_TYPE;
187187
}

src/main/java/ru/mystamps/web/service/ReportServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public String prepareDailyStatistics(AdminDailyReport report) {
7474
put(ctx, "failed_auth_cnt", report.getFailedAuthCounter());
7575
put(ctx, "missing_csrf_cnt", report.getMissingCsrfCounter());
7676
put(ctx, "invalid_csrf_cnt", report.getInvalidCsrfCounter());
77-
put(ctx, "bad_request_cnt", -1L); // TODO: #122
77+
put(ctx, "bad_request_cnt", -1L); // FIXME: #122
7878

7979
return new StringSubstitutor(ctx).replace(template);
8080
}

src/main/java/ru/mystamps/web/service/SiteServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private String abbreviateIfLengthGreaterThan(String text, int maxLength, String
187187
return text;
188188
}
189189

190-
// TODO(security): fix possible log injection
190+
// FIXME(security): fix possible log injection
191191
log.warn(
192192
"Length of '{}' exceeds max length for '{}' field: {} > {}",
193193
text,

src/main/java/ru/mystamps/web/support/beanvalidation/FieldsMatchValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public boolean isValid(Object value, ConstraintValidatorContext ctx) {
5959
return true;
6060
}
6161

62-
// TODO: check fields only when both fields are equals
62+
// FIXME: check fields only when both fields are equals
6363

6464
if (!firstFieldValue.equals(secondFieldValue)) {
6565
// bind error message to 2nd field

src/main/java/ru/mystamps/web/support/beanvalidation/FieldsMismatchValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public boolean isValid(Object value, ConstraintValidatorContext ctx) {
5959
return true;
6060
}
6161

62-
// TODO: check fields only when both fields are equals
62+
// FIXME: check fields only when both fields are equals
6363

6464
if (firstFieldValue.equals(secondFieldValue)) {
6565
// bind error message to 2nd field

src/main/java/ru/mystamps/web/support/beanvalidation/ImageFileValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class ImageFileValidator implements ConstraintValidator<ImageFile, Multip
5555
};
5656

5757
private static boolean isJpeg(byte[] bytes) {
58-
// TODO: also check that last 2 bytes are FF D9 (use RandomAccessFile)
58+
// FIXME: also check that last 2 bytes are FF D9 (use RandomAccessFile)
5959

6060
for (byte[] signature: JPEG_SIGNATURES) {
6161
if (Arrays.equals(bytes, signature)) {

src/main/java/ru/mystamps/web/support/spring/security/AuthenticationFailureListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent event) {
5050
return;
5151
}
5252

53-
// TODO: log more info (login for example) (#59)
54-
// TODO: sanitize all user's values (#60)
53+
// FIXME: log more info (login for example) (#59)
54+
// FIXME: sanitize all user's values (#60)
5555
String method = request.getMethod();
5656
String page = request.getRequestURI();
5757
String ip = request.getRemoteAddr();

0 commit comments

Comments
 (0)