Modify

Opened 2 years ago

Closed 19 months ago

Last modified 19 months ago

#22832 closed enhancement (fixed)

[patch] Minor typo fixes, code cleanup

Reported by: gaben Owned by: team
Priority: minor Milestone: 23.08
Component: Core Version:
Keywords: Cc:

Description

I collected these changes along for about a year, it's time to publish.

They are very minor, there shouldn't be any functional change in any of the patches:

  1. typo fixes
  2. simplifications, cleanups
  3. shell file fixes
  4. rest mixed, skip if not necessary

Attachments (5)

josm_22832_typo_documentation_fixes.patch (24.0 KB ) - added by gaben 2 years ago.
josm_22832_minor_fixes.patch (65.9 KB ) - added by gaben 2 years ago.
josm_22832_shell_fixes.patch (2.3 KB ) - added by gaben 2 years ago.
ShellCheck suggestions applied, although haven't tested
josm_22832_general.patch (18.4 KB ) - added by gaben 2 years ago.
since_xxx.patch (3.9 KB ) - added by taylor.smock 19 months ago.

Download all attachments as: .zip

Change History (15)

by gaben, 2 years ago

by gaben, 2 years ago

ShellCheck suggestions applied, although haven't tested

by gaben, 2 years ago

Attachment: josm_22832_general.patch added

comment:1 by gaben, 2 years ago

Summary: Minor typo fixes, code cleanup[patch] Minor typo fixes, code cleanup

comment:2 by gaben, 21 months ago

Maybe I should put them on GitHub to have better visibility...

  • src/org/openstreetmap/josm/data/osm/OsmUtils.java

    Subject: [PATCH] Code cleanup #22832
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/OsmUtils.java b/src/org/openstreetmap/josm/data/osm/OsmUtils.java
    a b  
    3636    /**
    3737     * Discouraged synonym for {@link #TRUE_VALUE}
    3838     */
     39    @Deprecated
    3940    public static final String trueval = TRUE_VALUE;
    4041    /**
    4142     * Discouraged synonym for {@link #FALSE_VALUE}
    4243     */
     44    @Deprecated
    4345    public static final String falseval = FALSE_VALUE;
    4446    /**
    4547     * Discouraged synonym for {@link #REVERSE_VALUE}
    4648     */
     49    @Deprecated
    4750    public static final String reverseval = REVERSE_VALUE;
    4851
    4952    private OsmUtils() {
     
    5356    /**
    5457     * Converts a string to a boolean value
    5558     * @param value The string to convert
    56      * @return {@link Boolean#TRUE} if that string represents a true value,
    57      *         {@link Boolean#FALSE} if it represents a false value,
    58      *         <code>null</code> otherwise.
     59     * @return {@link Boolean#TRUE} if that string represents a true value,<br>
     60     *         {@link Boolean#FALSE} if it represents a false value,<br>
     61     *         {@code null} otherwise.
    5962     */
    6063    public static Boolean getOsmBoolean(String value) {
    6164        if (value == null) return null;
     
    7477     */
    7578    public static String getNamedOsmBoolean(String value) {
    7679        Boolean res = getOsmBoolean(value);
    77         return res == null ? value : (res ? trueval : falseval);
     80        return res == null ? value : (res ? TRUE_VALUE : FALSE_VALUE);
    7881    }
    7982
    8083    /**

comment:4 by taylor.smock, 19 months ago

Milestone: 23.08

comment:5 by taylor.smock, 19 months ago

Resolution: fixed
Status: newclosed

In 18801/josm:

Fix #22832: Code cleanup and some simplification, documentation fixes (patch by gaben)

There should not be any functional changes in this patch; it is intended to do
the following:

  • Simplify and cleanup code (example: Arrays.asList(item) -> Collections.singletonList(item))
  • Fix typos in documentation (which also corrects the documentation to match what actually happens, in some cases)

comment:6 by gaben, 19 months ago

Thank you! :)

I can look at the since xxx fixer script next time.

comment:7 by taylor.smock, 19 months ago

I can look at the since xxx fixer script next time.

I've got some local modifications, that, among other things, lets me run it against a changelist. Poke me about it next week so I can share it with you.

by taylor.smock, 19 months ago

Attachment: since_xxx.patch added

comment:8 by taylor.smock, 19 months ago

In 18813/josm:

See #22832: Don't quote $JPACKAGEOPTIONS

comment:9 by gaben, 19 months ago

Oops :s

comment:10 by taylor.smock, 19 months ago

Mistakes happen.

Don't worry about it too much -- it was one of the reasons why I wanted to merge this patch early in the cycle. I should have checked the builds earlier though.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.