Ignore:
Timestamp:
2016-08-07T14:46:57+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - various fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java

    r10378 r10755  
    3838     * @since 6390
    3939     */
    40     private class UnclosedWaysCheck {
     40    private static class UnclosedWaysCheck {
    4141        /** The unique numeric code for this check */
    4242        public final int code;
     
    9090         * Returns the test error of the given way, if any.
    9191         * @param w The way to check
     92         * @param test parent test
    9293         * @return The test error if the way is erroneous, {@code null} otherwise
    9394         */
    94         public final TestError getTestError(Way w) {
     95        public final TestError getTestError(Way w, UnclosedWays test) {
    9596            String value = w.get(key);
    9697            if (isValueErroneous(value)) {
     
    99100                String etype = engMessage.contains("{0}") ? MessageFormat.format(engMessage, value) : engMessage;
    100101                // CHECKSTYLE.ON: SingleSpaceSeparator
    101                 return new TestError(UnclosedWays.this, Severity.WARNING, tr("Unclosed way"),
     102                return new TestError(test, Severity.WARNING, tr("Unclosed way"),
    102103                        type, etype, code, Arrays.asList(w),
    103104                        // The important parts of an unclosed way are the first and
     
    117118     * @since 6390
    118119     */
    119     private final class UnclosedWaysBooleanCheck extends UnclosedWaysCheck {
     120    private static final class UnclosedWaysBooleanCheck extends UnclosedWaysCheck {
    120121
    121122        /**
     
    137138    }
    138139
    139     private final UnclosedWaysCheck[] checks = {
     140    private static final UnclosedWaysCheck[] checks = {
    140141        // CHECKSTYLE.OFF: SingleSpaceSeparator
    141142        new UnclosedWaysCheck(1101, "natural",   marktr("natural type {0}"),
     
    183184
    184185        for (UnclosedWaysCheck c : checks) {
    185             TestError error = c.getTestError(w);
     186            TestError error = c.getTestError(w, this);
    186187            if (error != null) {
    187188                errors.add(error);
Note: See TracChangeset for help on using the changeset viewer.