You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/06/08 16:09:36 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang NumberUtils.java
scolebourne 2003/06/08 07:09:36
Modified: lang/src/java/org/apache/commons/lang NumberUtils.java
Log:
Tidy comments
Revision Changes Path
1.9 +16 -16 jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java
Index: NumberUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NumberUtils.java 9 Apr 2003 01:04:47 -0000 1.8
+++ NumberUtils.java 8 Jun 2003 14:09:36 -0000 1.9
@@ -685,7 +685,7 @@
boolean hasDecPoint = false;
boolean allowSigns = false;
boolean foundDigit = false;
- //Deal with any possible sign up front
+ // deal with any possible sign up front
int start = (chars[0] == '-') ? 1 : 0;
if (sz > start + 1) {
if (chars[start] == '0' && chars[start + 1] == 'x') {
@@ -693,7 +693,7 @@
if (i == sz) {
return false; // str == "0x"
}
- //Checking hex (it can't be anything else)
+ // checking hex (it can't be anything else)
for (; i < chars.length; i++) {
if ((chars[i] < '0' || chars[i] > '9')
&& (chars[i] < 'a' || chars[i] > 'f')
@@ -704,11 +704,11 @@
return true;
}
}
- sz--; //Don't want to loop to the last char, check it afterwords
- //for type qualifiers
+ sz--; // don't want to loop to the last char, check it afterwords
+ // for type qualifiers
int i = start;
- //Loop to the next to last char or to the last char if we need another digit to
- //make a valid number (e.g. chars[0..5] = "1234E")
+ // loop to the next to last char or to the last char if we need another digit to
+ // make a valid number (e.g. chars[0..5] = "1234E")
while (i < sz || (i < sz + 1 && allowSigns && !foundDigit)) {
if (chars[i] >= '0' && chars[i] <= '9') {
foundDigit = true;
@@ -716,14 +716,14 @@
} else if (chars[i] == '.') {
if (hasDecPoint || hasExp) {
- //Two decimal points or dec in exponent
+ // two decimal points or dec in exponent
return false;
}
hasDecPoint = true;
} else if (chars[i] == 'e' || chars[i] == 'E') {
- //We've already taken care of hex.
+ // we've already taken care of hex.
if (hasExp) {
- //Two E's
+ // two E's
return false;
}
if (!foundDigit) {
@@ -736,7 +736,7 @@
return false;
}
allowSigns = false;
- foundDigit = false; //We need a digit after the E
+ foundDigit = false; // we need a digit after the E
} else {
return false;
}
@@ -744,11 +744,11 @@
}
if (i < chars.length) {
if (chars[i] >= '0' && chars[i] <= '9') {
- //No type qualifier, OK
+ // no type qualifier, OK
return true;
}
if (chars[i] == 'e' || chars[i] == 'E') {
- //Can't have an E at the last byte
+ // can't have an E at the last byte
return false;
}
if (!allowSigns
@@ -760,12 +760,12 @@
}
if (chars[i] == 'l'
|| chars[i] == 'L') {
- //Not allowing L with an exponoent
+ // not allowing L with an exponoent
return foundDigit && !hasExp;
}
}
- //allowSigns is true iff the val ends in 'E'
- //Found digit it to make sure weird stuff like '.' and '1E-' doesn't pass
+ // allowSigns is true iff the val ends in 'E'
+ // found digit it to make sure weird stuff like '.' and '1E-' doesn't pass
return !allowSigns && foundDigit;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org