You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by nd...@apache.org on 2008/12/15 00:17:35 UTC
svn commit: r726575 - in
/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl:
TrustManager.java TrustManagerFactory.java TrustManagerFactorySpi.java
Author: ndbeyer
Date: Sun Dec 14 15:17:34 2008
New Revision: 726575
URL: http://svn.apache.org/viewvc?rev=726575&view=rev
Log:
rearrange code to make it more readable, remove unnecessary comments
Modified:
harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java
harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java
harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java?rev=726575&r1=726574&r2=726575&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java Sun Dec 14 15:17:34 2008
@@ -15,16 +15,7 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface TrustManager {
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java?rev=726575&r1=726574&r2=726575&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java Sun Dec 14 15:17:34 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.AccessController;
@@ -28,17 +23,12 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
+import java.security.PrivilegedAction;
import java.security.Provider;
import java.security.Security;
import org.apache.harmony.security.fortress.Engine;
-
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public class TrustManagerFactory {
// Store TrustManager service name
private static final String SERVICE = "TrustManagerFactory";
@@ -49,39 +39,17 @@
// Store default property name
private static final String PROPERTYNAME = "ssl.TrustManagerFactory.algorithm";
- // Store used provider
- private final Provider provider;
-
- // Storeused TrustManagerFactorySpi implementation
- private final TrustManagerFactorySpi spiImpl;
-
- // Store used algorithm
- private final String algorithm;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- protected TrustManagerFactory(TrustManagerFactorySpi factorySpi,
- Provider provider, String algorithm) {
- this.provider = provider;
- this.algorithm = algorithm;
- this.spiImpl = factorySpi;
- }
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final String getAlgorithm() {
- return algorithm;
+ public static final String getDefaultAlgorithm() {
+ return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ public String run() {
+ return Security.getProperty(PROPERTYNAME);
+ }
+ });
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
public static final TrustManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
@@ -90,20 +58,17 @@
}
synchronized (engine) {
engine.getInstance(algorithm, null);
- return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi,
- engine.provider, algorithm);
+ return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi, engine.provider,
+ algorithm);
}
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final TrustManagerFactory getInstance(String algorithm,
- String provider) throws NoSuchAlgorithmException,
- NoSuchProviderException {
+ public static final TrustManagerFactory getInstance(String algorithm, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException {
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException("Provider is null oe empty");
}
@@ -115,13 +80,11 @@
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final TrustManagerFactory getInstance(String algorithm,
- Provider provider) throws NoSuchAlgorithmException {
+ public static final TrustManagerFactory getInstance(String algorithm, Provider provider)
+ throws NoSuchAlgorithmException {
if (provider == null) {
throw new IllegalArgumentException("Provider is null");
}
@@ -130,54 +93,44 @@
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
- return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi,
- provider, algorithm);
+ return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi, provider, algorithm);
}
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ // Store used provider
+ private final Provider provider;
+
+ // Store used TrustManagerFactorySpi implementation
+ private final TrustManagerFactorySpi spiImpl;
+
+ // Store used algorithm
+ private final String algorithm;
+
+ protected TrustManagerFactory(TrustManagerFactorySpi factorySpi, Provider provider,
+ String algorithm) {
+ this.provider = provider;
+ this.algorithm = algorithm;
+ this.spiImpl = factorySpi;
+ }
+
+ public final String getAlgorithm() {
+ return algorithm;
+ }
+
public final Provider getProvider() {
return provider;
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final void init(KeyStore ks) throws KeyStoreException {
spiImpl.engineInit(ks);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final void init(ManagerFactoryParameters spec)
- throws InvalidAlgorithmParameterException {
+ public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException {
spiImpl.engineInit(spec);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final TrustManager[] getTrustManagers() {
return spiImpl.engineGetTrustManagers();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public static final String getDefaultAlgorithm() {
- return AccessController
- .doPrivileged(new java.security.PrivilegedAction<String>() {
- public String run() {
- return Security.getProperty(PROPERTYNAME);
- }
- });
- }
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java?rev=726575&r1=726574&r2=726575&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java Sun Dec 14 15:17:34 2008
@@ -15,46 +15,22 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStore;
import java.security.KeyStoreException;
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public abstract class TrustManagerFactorySpi {
- /**
- * @com.intel.drl.spec_ref
- *
- */
+
public TrustManagerFactorySpi() {
+ super();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract void engineInit(KeyStore ks) throws KeyStoreException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract TrustManager[] engineGetTrustManagers();
-}
\ No newline at end of file
+}