You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Jack (JIRA)" <xa...@xml.apache.org> on 2005/03/30 05:22:34 UTC

[jira] Created: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Bug in the class org.apache.xml.serializer.Encodings
----------------------------------------------------

         Key: XALANJ-2086
         URL: http://issues.apache.org/jira/browse/XALANJ-2086
     Project: XalanJ2
        Type: Bug
  Components: Xalan  
    Versions: 2.6    
    Reporter: Jack


There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 

    private static Method findCharToByteConverterMethod() {
        try
        {
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    try {
                        Class charToByteConverterClass = (Class) 
                            Class.forName("sun.io.CharToByteConverter");
                        Class argTypes[] = {String.class};
                        return charToByteConverterClass.getMethod("getConverter", argTypes);
                    }
                    catch (Exception e) {
                        throw new RuntimeException(e.toString());
                    }
                }});
        }
        catch (Exception e)
        {
            System.err.println(
                "Warning: Could not get charToByteConverterClass, haha!");
        }

        return null;
    }

I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:

    private static Method findCharToByteConverterMethod() {
        try
        {
            return AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    try {
                        Class charToByteConverterClass = (Class) 
                            Class.forName("sun.io.CharToByteConverter");
                        Class argTypes[] = {String.class};
                        return charToByteConverterClass.getMethod("getConverter", argTypes);
                    }
                    catch (Exception e) {
                        throw new RuntimeException(e.toString());
                    }
                }});
        }
        catch (Exception e)
        {
            System.err.println(
                "Warning: Could not get charToByteConverterClass, haha!");
        }

        return null;
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2086?page=comments#action_12319275 ] 

Brian Minchau commented on XALANJ-2086:
---------------------------------------

Jack,
this issue is now resolved as being fixed in the Xalan-J 2.7 release. As the issue reporter please confirm the code no longer has this problem so that we can close this issue down.

Actually the code that had the problem is totally gone, haha!  Through XALANJ-2087 the dependancy on CharToByteConverter was removed plus a number of bugs were fixed due to an incorrect algorithm.



> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: 2.7
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=comments#action_61936 ]
     
Brian Minchau commented on XALANJ-2086:
---------------------------------------

The dropping of the return value, as noted in this bug report, was introduced a long time ago, December 4, 2003.

You're the first person to catch this. Thanks. But it does get me wondering about the value this sun.io.CharToByteConverter.

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack

>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=history ]

Brian Minchau updated XALANJ-2086:
----------------------------------

    reviewer: minchau@ca.ibm.com

The patch is in the defect description.  I've assigned this bug to myself, and also made myself the reviewer, per the Xalan JIRA meeting April 5, 2005.

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau

>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Resolved: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=history ]
     
Brian Minchau resolved XALANJ-2086:
-----------------------------------

     Resolution: Fixed
    Fix Version: CurrentCVS

Patch applied to CVS.

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: CurrentCVS
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Assigned: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=history ]

Brian Minchau reassigned XALANJ-2086:
-------------------------------------

    Assign To: Brian Minchau

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau

>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=comments#action_62331 ]
     
Brian Minchau commented on XALANJ-2086:
---------------------------------------

I have reviewed and approve the modification to the code. This dependancy on sun.io.CharToByteConverter, but for the moment I'm restoring the old behavior.




> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: CurrentCVS
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Closed: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=all ]
     
Brian Minchau closed XALANJ-2086:
---------------------------------


Jack, from your comments in XALANJ-2087, you had trouble figuring out how to close this issue.

Your JIRA account is not a "developer" account, so you couldn't close this issue.
Your comments in XALANJ-2087 are sufficient, I'm closing it. Please re-open if I'm mistaken.

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: 2.7
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=all ]

Brian Minchau updated XALANJ-2086:
----------------------------------

    Fix Version: 2.7
                     (was: CurrentCVS)

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: 2.7
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=history ]

Brian Minchau updated XALANJ-2086:
----------------------------------

    Attachment: Encodings.patch1.txt

Attaching a patch based on the reporters comments in this issue.

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack
>     Assignee: Brian Minchau
>      Fix For: CurrentCVS
>  Attachments: Encodings.patch1.txt
>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2086) Bug in the class org.apache.xml.serializer.Encodings

Posted by "Jack (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2086?page=comments#action_61800 ]
     
Jack commented on XALANJ-2086:
------------------------------

Sorry, I made a little modification to the error message. The extra " ,haha" in the message "Warning: Could not get charToByteConverterClass, haha!" should be removed. Thanks!

> Bug in the class org.apache.xml.serializer.Encodings
> ----------------------------------------------------
>
>          Key: XALANJ-2086
>          URL: http://issues.apache.org/jira/browse/XALANJ-2086
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>     Reporter: Jack

>
> There is a bug in the method "findCharToByteConverterMethod()" in the class org.apache.xml.serializer.Encodings. The original code is: 
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }
> I suppose there should be a "return" before the AccessController.doPrivileged() expression. So what I suggest is:
>     private static Method findCharToByteConverterMethod() {
>         try
>         {
>             return AccessController.doPrivileged(new PrivilegedAction() {
>                 public Object run() {
>                     try {
>                         Class charToByteConverterClass = (Class) 
>                             Class.forName("sun.io.CharToByteConverter");
>                         Class argTypes[] = {String.class};
>                         return charToByteConverterClass.getMethod("getConverter", argTypes);
>                     }
>                     catch (Exception e) {
>                         throw new RuntimeException(e.toString());
>                     }
>                 }});
>         }
>         catch (Exception e)
>         {
>             System.err.println(
>                 "Warning: Could not get charToByteConverterClass, haha!");
>         }
>         return null;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org