sun.misc.FloatingDecimal 在哪里?
Where is sun.misc.FloatingDecimal?
src.zip在jdk1.8.0_144中包含Float.java
那又指的是sun.misc.FloatingDecimal。我在 src.zip 的任何地方都找不到它?谁能告诉我它在哪里?我可以找到 grepcode 中列出的来源:http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/FloatingDecimal.java/?v=source
但显然,代码必须存在,我的库才能调用它。
更奇怪,在 class 浮点数中:
public static float parseFloat(String s) throws NumberFormatException {
return FloatingDecimal.parseFloat(s);
}
但是,搜索我能看到的代码(诚然,只有jdk1.6)连方法都没有FloatingDecimal.parseFloat。
他们没有将其包含在 src.zip
中。
根据 JDK 8 README:
Java programming language source files for all classes that make up
the Java core API (that is, sources files for the java., javax. and
some org.* packages, but not for com.sun.* packages). This source
code is provided for informational purposes only, to help developers
learn and use the Java programming language. These files do not
include platform-specific implementation code and cannot be used to
rebuild the class libraries.
如您所见,您可以从 Grepcode 等第三方来源获取源代码。
src.zip在jdk1.8.0_144中包含Float.java
那又指的是sun.misc.FloatingDecimal。我在 src.zip 的任何地方都找不到它?谁能告诉我它在哪里?我可以找到 grepcode 中列出的来源:http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/FloatingDecimal.java/?v=source
但显然,代码必须存在,我的库才能调用它。
更奇怪,在 class 浮点数中:
public static float parseFloat(String s) throws NumberFormatException {
return FloatingDecimal.parseFloat(s);
}
但是,搜索我能看到的代码(诚然,只有jdk1.6)连方法都没有FloatingDecimal.parseFloat。
他们没有将其包含在 src.zip
中。
根据 JDK 8 README:
Java programming language source files for all classes that make up the Java core API (that is, sources files for the java., javax. and some org.* packages, but not for com.sun.* packages). This source code is provided for informational purposes only, to help developers learn and use the Java programming language. These files do not include platform-specific implementation code and cannot be used to rebuild the class libraries.
如您所见,您可以从 Grepcode 等第三方来源获取源代码。