我正在使用 java 7 update 26。我有一个类,我有一个 while 循环。当我用 jd-gui ( http://java.decompiler.free.fr/?q=jdgui )反编译那个 .class 文件时,它给了我一些奇怪的 while 循环。
try {
while (true) {
c = in.read();
if ((c >= '0' && c <= '9') || c == '-' || c == '+')
{
numBuf[len++] = (char) c;
} else if (c == '.' || c == 'e' || c == 'E') {
numBuf[len++] = (char) c;
isFloat = true;
} else if (c == -1) {
throw new IOException("EOF");
} else {
in.unread(c);
}
}
} catch (ArrayIndexOutOfBoundsException e) {
throw new IOException("Exception with Array ");
}
编译后的版本如下:
try {
while (true) {
c = in.read();
if (((c >= 48) && (c <= 57)) || (c == 45) || (c == 43))
{
numBuf[(len++)] = (char)c;
continue;
}
if ((c != 46) && (c != 101) && (c != 69))
break;
numBuf[(len++)] = (char)c;
isFloat = true;
}
if (c == -1) {
throw new IOException("EOF");
}
in.unread(c);
} catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
throw new IOException("Exception with Array ");
}
我的代码似乎完全不同..有什么想法吗?