You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2003/08/26 23:33:24 UTC

cvs commit: xml-xalan/java/src/org/apache/xml/utils SecuritySupport.java SecuritySupport12.java

zongaro     2003/08/26 14:33:24

  Modified:    java/src/org/apache/xml/utils SecuritySupport.java
                        SecuritySupport12.java
  Log:
  Changed comments that referred to JAXP.  Updated imports to avoid using
  wildcards, which is a practice Xalan-J has largely eschewed.
  
  Revision  Changes    Path
  1.2       +9 -4      xml-xalan/java/src/org/apache/xml/utils/SecuritySupport.java
  
  Index: SecuritySupport.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/SecuritySupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SecuritySupport.java	14 Aug 2003 16:29:44 -0000	1.1
  +++ SecuritySupport.java	26 Aug 2003 21:33:24 -0000	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002,2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -55,11 +55,16 @@
   
   package org.apache.xml.utils;
   
  -import java.io.*;
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.io.FileNotFoundException;
  +import java.io.InputStream;
  +
  +import java.util.Properties;
   
   /**
  - * This class is duplicated for each JAXP subpackage so keep it in sync.
  - * It is package private and therefore is not exposed as part of the JAXP
  + * This class is duplicated for each Xalan-Java subpackage so keep it in sync.
  + * It is package private and therefore is not exposed as part of the Xalan-Java
    * API.
    *
    * Base class with security related methods that work on JDK 1.1.
  
  
  
  1.2       +29 -20    xml-xalan/java/src/org/apache/xml/utils/SecuritySupport12.java
  
  Index: SecuritySupport12.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/SecuritySupport12.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SecuritySupport12.java	14 Aug 2003 16:29:44 -0000	1.1
  +++ SecuritySupport12.java	26 Aug 2003 21:33:24 -0000	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002,2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -55,12 +55,21 @@
   
   package org.apache.xml.utils;
   
  -import java.security.*;
  -import java.io.*;
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.io.FileNotFoundException;
  +import java.io.InputStream;
  +
  +import java.security.AccessController;
  +import java.security.PrivilegedAction;
  +import java.security.PrivilegedActionException;
  +import java.security.PrivilegedExceptionAction;
  +
  +import java.util.Properties;
   
   /**
  - * This class is duplicated for each JAXP subpackage so keep it in sync.
  - * It is package private and therefore is not exposed as part of the JAXP
  + * This class is duplicated for each Xalan-Java subpackage so keep it in sync.
  + * It is package private and therefore is not exposed as part of the Xalan-Java
    * API.
    *
    * Security related methods that only work on J2SE 1.2 and newer.
  @@ -68,16 +77,16 @@
   class SecuritySupport12 extends SecuritySupport {
   
       public ClassLoader getContextClassLoader() {
  -	return (ClassLoader)
  -		AccessController.doPrivileged(new PrivilegedAction() {
  -	    public Object run() {
  -		ClassLoader cl = null;
  -		try {
  -		    cl = Thread.currentThread().getContextClassLoader();
  -		} catch (SecurityException ex) { }
  -		return cl;
  -	    }
  -	});
  +        return (ClassLoader)
  +                AccessController.doPrivileged(new PrivilegedAction() {
  +            public Object run() {
  +                ClassLoader cl = null;
  +                try {
  +                    cl = Thread.currentThread().getContextClassLoader();
  +                } catch (SecurityException ex) { }
  +                return cl;
  +            }
  +        });
       }
   
       public ClassLoader getSystemClassLoader() {
  @@ -110,7 +119,7 @@
       }
   
       public String getSystemProperty(final String propName) {
  -	return (String)
  +        return (String)
               AccessController.doPrivileged(new PrivilegedAction() {
                   public Object run() {
                       return System.getProperty(propName);
  @@ -121,16 +130,16 @@
       public FileInputStream getFileInputStream(final File file)
           throws FileNotFoundException
       {
  -	try {
  +        try {
               return (FileInputStream)
                   AccessController.doPrivileged(new PrivilegedExceptionAction() {
                       public Object run() throws FileNotFoundException {
                           return new FileInputStream(file);
                       }
                   });
  -	} catch (PrivilegedActionException e) {
  -	    throw (FileNotFoundException)e.getException();
  -	}
  +        } catch (PrivilegedActionException e) {
  +            throw (FileNotFoundException)e.getException();
  +        }
       }
   
       public InputStream getResourceAsStream(final ClassLoader cl,
  
  
  

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