Ignore:
Timestamp:
2010-09-10T21:40:00+02:00 (14 years ago)
Author:
miken
Message:

Bug fix JOSM trac #5393 NPE when changing interpolation method.

Location:
applications/editors/josm/plugins/addrinterpolation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/addrinterpolation/build.xml

    r21710 r23102  
    2525
    2626        <property name="commit.message" value="Impoved Icon" />
    27         <property name="plugin.main.version" value="2830" />
     27        <property name="plugin.main.version" value="3514" />
    2828
    2929        <!--
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java

    r18874 r23102  
    283283                        public void focusGained(FocusEvent fe){
    284284                                if (!interpolationMethodSet) {
    285                                         AutoDetectInterpolationMethod();
    286                                         interpolationMethodSet = true;  // Don't auto detect over a previous choice
     285                                        if (AutoDetectInterpolationMethod()) {
     286                                                interpolationMethodSet = true;  // Don't auto detect over a previous choice
     287                                        }
    287288                                }
    288289                        }
     
    343344        // Call after both starting and ending housenumbers have been entered - usually when
    344345        // combo box gets focus.
    345         private void AutoDetectInterpolationMethod() {
     346        // Return true if a method was detected
     347        private boolean AutoDetectInterpolationMethod() {
    346348
    347349                String startValueString = ReadTextField(startTextField);
    348350                String endValueString = ReadTextField(endTextField);
    349                 if (startValueString.equals("") || endValueString.equals("")) {
     351                if ( (startValueString == null) || (endValueString== null) ) {
    350352                        // Not all values entered yet
    351                         return;
     353                        return false;
    352354                }
    353355
     
    384386                                // Both end with alpha
    385387                                SelectInterpolationMethod("alphabetic");
    386                                 return;
     388                                return true;
    387389                        }
    388390
     
    392394                                        // First is a number, last is Latin alpha
    393395                                        SelectInterpolationMethod("alphabetic");
    394                                 }
    395                         }
    396 
    397 
    398                 }
    399 
     396                                        return true;
     397                                }
     398                        }
     399                       
     400                        // Did not detect alpha
     401                        return false;
     402
     403                }
     404               
     405                return true;
    400406
    401407        }
Note: See TracChangeset for help on using the changeset viewer.