You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/09/06 01:45:51 UTC
[DO NOT REPLY: Bug 3448] New:
Basislibrary constructs unnecessary temporary objects during type conversion
PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3448
*** shadow/3448 Wed Sep 5 16:45:51 2001
--- shadow/3448.tmp.14523 Wed Sep 5 16:45:51 2001
***************
*** 0 ****
--- 1,51 ----
+ +============================================================================+
+ | Basislibrary constructs unnecessary temporary objects during type conversi |
+ +----------------------------------------------------------------------------+
+ | Bug #: 3448 Product: XalanJ2 |
+ | Status: NEW Version: CurrentCVS |
+ | Resolution: Platform: PC |
+ | Severity: Normal OS/Version: Windows NT/2K |
+ | Priority: Other Component: org.apache.xalan.xsltc |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xalan-dev@xml.apache.org |
+ | Reported By: johnh@schemasoft.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Here's the patch:
+
+ RCS file: /home/cvspublic/xml-
+ xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
+ retrieving revision 1.12
+ diff -u -r1.12 BasisLibrary.java
+ --- org/apache/xalan/xsltc/runtime/BasisLibrary.java 2001/08/27 09:07:21
+ 1.12
+ +++ org/apache/xalan/xsltc/runtime/BasisLibrary.java 2001/09/01 02:58:34
+ @@ -789,7 +789,7 @@
+ */
+ public static double stringToReal(String s) {
+ try {
+ - return Double.valueOf(s).doubleValue();
+ + return Double.parseDouble(s); // 'new double' optimization
+ }
+ catch (NumberFormatException e) {
+ return Double.NaN;
+ @@ -801,7 +801,7 @@
+ */
+ public static int stringToInt(String s) {
+ try {
+ - return Integer.valueOf(s).intValue();
+ + return Integer.parseInt(s); // 'new Int' optimization
+ }
+ catch (NumberFormatException e) {
+ return(-1); // ???
+ @@ -825,8 +825,7 @@
+ * Utility function: used in RealType to convert a real to an integer
+ */
+ public static int realToInt(double d) {
+ - final Double result = new Double(d);
+ - return result.intValue();
+ + return (int)d; // 'new Double' optimization
+ }