Ignore:
Timestamp:
2013-07-30T18:35:47+02:00 (11 years ago)
Author:
akks
Message:

see #8902 - collection size ==/!= 0 -> isEmpty()/!isEmpty() (patch by shinigami)

Location:
trunk/src/org/openstreetmap/josm/data
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r6087 r6093  
    4242
    4343    public void load() {
    44         boolean addedDefault = layers.size() != 0;
     44        boolean addedDefault = !layers.isEmpty();
    4545        List<ImageryPreferenceEntry> entries = Main.pref.getListOfStructs("imagery.entries", null, ImageryPreferenceEntry.class);
    4646        if (entries != null) {
     
    121121
    122122        Collections.sort(defaultLayers);
    123         Main.pref.putCollection("imagery.layers.default", defaultsSave.size() > 0
    124                 ? defaultsSave : defaults);
     123        Main.pref.putCollection("imagery.layers.default", defaultsSave.isEmpty() ? defaults : defaultsSave);
    125124    }
    126125
  • trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java

    r5874 r6093  
    269269        index.setTotalFileSize(totalFileSize);
    270270        for (ProjectionEntries projectionEntries: entries.values()) {
    271             if (projectionEntries.entries.size() > 0) {
     271            if (!projectionEntries.entries.isEmpty()) {
    272272                ProjectionType projectionType = new ProjectionType();
    273273                projectionType.setName(projectionEntries.projection);
  • trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java

    r5909 r6093  
    256256
    257257            //process inner ways
    258             if (innerCandidates.size() > 0) {
     258            if (!innerCandidates.isEmpty()) {
    259259                List<PolygonLevel> innerList = this.findOuterWaysRecursive(level + 1, innerCandidates);
    260260                if (innerList == null) {
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r6084 r6093  
    175175                return false;
    176176            boolean ret = this.content.remove(o);
    177             if (this.content.size() == 0) {
     177            if (this.content.isEmpty()) {
    178178                this.content = null;
    179179            }
     
    492492        boolean canRemove()
    493493        {
    494             if (content != null && content.size() > 0)
     494            if (content != null && !content.isEmpty())
    495495                return false;
    496496            if (this.hasChildren())
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java

    r5874 r6093  
    184184        for (int i = 0; i < subGrid.length; i++) {
    185185            ArrayList<NTV2SubGrid> subSubGrids = subGridMap.get(subGrid[i].getSubGridName());
    186             if (subSubGrids.size() > 0) {
     186            if (!subSubGrids.isEmpty()) {
    187187                NTV2SubGrid[] subGridArray = subSubGrids.toArray(nullArray);
    188188                subGrid[i].setSubGridArray(subGridArray);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java

    r4869 r6093  
    157157                }
    158158
    159                 if (highlight.size() > 0) {
     159                if (!highlight.isEmpty()) {
    160160                    errors.add(new TestError(this, Severity.ERROR, tr("Unconnected coastline"),
    161161                            UNCONNECTED_COASTLINE, primitives, highlight));
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r6068 r6093  
    109109            }
    110110        }
    111         if (allroles.size() == 0) {
     111        if (allroles.isEmpty()) {
    112112            errors.add( new TestError(this, Severity.WARNING, tr("Relation type is unknown"),
    113113                    RELATION_UNKNOWN, n) );
Note: See TracChangeset for help on using the changeset viewer.