All pastes #558299 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-11 09:59 UTC
rendered paste body
Index: src/org/tp23/antinstaller/renderer/text/TextUtils.java
===================================================================
 
     /**
-     * does the string represent true default = true
+     * check wether the string represent an affermative answer
      * 
      * @param entered String
      * @return boolean
      */
-    static boolean isTrue(String entered) {
+    static boolean isAffirmativeAnswer(String entered) {
         if(entered.length() == 0) {
             return true;
         }

Intanto qui incappo in una bellissima NPE se entered == null,
inoltre perché s'è vuota è considerata una risposta affermativa?!?!

         char first = entered.charAt(0);
         boolean isTrue = false;
-        for(int i = 0; i < affimativeChars.length; i++) {
-            isTrue |= Character.toUpperCase(first) == affimativeChars[i];
+        for(int i = 0; i < affirmativeChars.length; i++) {
+            isTrue |= Character.toUpperCase(first) == affirmativeChars[i];
         }
         return isTrue;
     }
 
     /**
-     * does the string represent false default = false
+     * check wether the string represent a negative answer
      * 
      * @param entered String
      * @return boolean
      */
-    static boolean isFalse(String entered) {
+    static boolean isNegativeAnswer(String entered) {

Anche qui dovrei controllare per null, quindi userei isVoid

         if(entered.length() == 0) {
             return true;
         }