Changeset 13672 in josm


Ignore:
Timestamp:
2018-04-24T00:03:28+02:00 (4 months ago)
Author:
Don-vip
Message:

fix recent SonarQube issues

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r13649 r13672  
    122122                        Logging.warn("Cannot lock cache directory. Will not use disk cache");
    123123                } catch (IOException e) {
    124                     Logging.warn("Cannot create cache dir \"" + cacheDirLockPath.toString() + "\" lock file: " + e.toString());
     124                    Logging.log(Logging.LEVEL_WARN, "Cannot create cache dir \"" + cacheDirLockPath + "\" lock file:", e);
    125125                    Logging.warn("Will not use disk cache");
    126126                }
     
    200200                // in case any error in setting auxiliary cache, do not use disk cache at all - only memory
    201201                cc.setAuxCaches(new AuxiliaryCache[0]);
     202                Logging.debug(e);
    202203            }
    203204        }
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r13670 r13672  
    405405                Logging.error(message);
    406406                if (!GraphicsEnvironment.isHeadless()) {
    407                     GuiHelper.runInEDT(() -> {
    408                         JOptionPane.showMessageDialog(Main.parent, message, tr("Error"), JOptionPane.ERROR_MESSAGE);
    409                     });
     407                    GuiHelper.runInEDT(() ->
     408                        JOptionPane.showMessageDialog(Main.parent, message, tr("Error"), JOptionPane.ERROR_MESSAGE)
     409                    );
    410410                }
    411411            }
  • trunk/src/org/openstreetmap/josm/tools/WinRegistry.java

    r13651 r13672  
    183183            throws IllegalAccessException, InvocationTargetException {
    184184        if (regOpenKey == null || regQueryInfoKey == null || regEnumValue == null || regCloseKey == null) {
    185             return null;
     185            return Collections.emptyMap();
    186186        }
    187187        HashMap<String, String> results = new HashMap<>();
     
    189189        Object handles = regOpenKey.invoke(root, hkey(hkey), toCstr(key), Integer.valueOf(KEY_READ));
    190190        if (getNumber(handles, 1).longValue() != REG_SUCCESS) {
    191             return null;
     191            return Collections.emptyMap();
    192192        }
    193193        // Need to capture both int[] (Java 8-10) and long[] (Java 11+)
     
    208208            throws IllegalAccessException, InvocationTargetException {
    209209        if (regOpenKey == null || regQueryInfoKey == null || regEnumKeyEx == null || regCloseKey == null) {
    210             return null;
     210            return Collections.emptyList();
    211211        }
    212212        List<String> results = new ArrayList<>();
Note: See TracChangeset for help on using the changeset viewer.