Ignore:
Timestamp:
2023-10-16T19:03:11+02:00 (3 years ago)
Author:
taylor.smock
Message:

See #23218: Use newer error_prone versions when compiling on Java 11+

error_prone 2.11 dropped support for compiling with Java 8, although it still
supports compiling for Java 8. The "major" new check for us is NotJavadoc since
we used /** in quite a few places which were not javadoc.

Other "new" checks that are of interest:

  • AlreadyChecked: if (foo) { doFoo(); } else if (!foo) { doBar(); }
  • UnnecessaryStringBuilder: Avoid StringBuilder (Java converts + to StringBuilder behind-the-scenes, but may also do something else if it performs better)
  • NonApiType: Avoid specific interface types in function definitions
  • NamedLikeContextualKeyword: Avoid using restricted names for classes and methods
  • UnusedMethod: Unused private methods should be removed

This fixes most of the new error_prone issues and some SonarLint issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r18218 r18871  
    1616import org.openstreetmap.josm.gui.download.overpass.OverpassWizardRegistration.OverpassWizardCallbacks;
    1717import org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel;
     18import org.openstreetmap.josm.gui.widgets.JosmComboBoxModel;
    1819import org.openstreetmap.josm.tools.Logging;
    1920import org.openstreetmap.josm.tools.SearchCompilerQueryWizard;
     
    2930
    3031    private static final ListProperty OVERPASS_WIZARD_HISTORY =
    31             new ListProperty("download.overpass.wizard", new ArrayList<String>());
     32            new ListProperty("download.overpass.wizard", new ArrayList<>());
    3233    private final OverpassWizardCallbacks callbacks;
    3334
     
    3738    private static final int CANCEL = 2;
    3839
    39     private AutoCompComboBoxModel<SearchSetting> model;
     40    private final AutoCompComboBoxModel<SearchSetting> model;
    4041
    4142    /** preferences reader/writer with automatic transmogrification to and from String */
    42     private AutoCompComboBoxModel<SearchSetting>.Preferences prefs;
     43    private final JosmComboBoxModel<SearchSetting>.Preferences prefs;
    4344
    4445    /**
Note: See TracChangeset for help on using the changeset viewer.