mx4j/src/core/javax/management/loading MLet.java,1.22,1.23

Simone Bordet <[email protected]>
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/javax/management/loading
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14591/src/core/javax/management/loading

Modified Files:
	MLet.java 
Log Message:
Fix for bug #973867: now MLet files are read with UTF-8 encoding

Index: MLet.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/loading/MLet.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** MLet.java	2 Dec 2003 19:24:36 -0000	1.22
--- MLet.java	16 Jun 2004 21:41:29 -0000	1.23
***************
*** 21,24 ****
--- 21,25 ----
  import java.io.ObjectOutput;
  import java.io.OutputStream;
+ import java.io.UnsupportedEncodingException;
  import java.net.MalformedURLException;
  import java.net.URL;
***************
*** 32,36 ****
  import java.util.List;
  import java.util.Set;
- 
  import javax.management.MBeanRegistration;
  import javax.management.MBeanServer;
--- 33,36 ----
***************
*** 314,318 ****
        }
  
!       String mletFileContent = baos.toString();
        if (logger.isEnabledFor(Logger.TRACE)) logger.trace("MLet File content is:\n" + mletFileContent);
  
--- 314,326 ----
        }
  
!       String mletFileContent = null;
!       try
!       {
!          mletFileContent = new String(baos.toByteArray(), "UTF-8");
!       }
!       catch (UnsupportedEncodingException x)
!       {
!          mletFileContent = baos.toString();
!       }
        if (logger.isEnabledFor(Logger.TRACE)) logger.trace("MLet File content is:\n" + mletFileContent);
  
***************
*** 390,398 ****
      * but unfortunately it contains as parameter a package private class, that thus forbids overriding: a big
      * mistake in the JMX 1.2 specification.
      * @since JMX 1.2
      */
     protected URL check(String version, URL codebase, String archive, MLetContent content) throws Exception
     {
!        return codebase;
     }
  
--- 398,407 ----
      * but unfortunately it contains as parameter a package private class, that thus forbids overriding: a big
      * mistake in the JMX 1.2 specification.
+     *
      * @since JMX 1.2
      */
     protected URL check(String version, URL codebase, String archive, MLetContent content) throws Exception
     {
!       return codebase;
     }
  



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.