diff options
author | Elliott Hughes <enh@google.com> | 2011-06-06 11:43:53 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-06-06 11:43:53 -0700 |
commit | 90b140190f219fd63ede200a63da40bf9e6ca98d (patch) | |
tree | 561da0c28e93f66323d2b9643c714d81dd2db2ee /luni | |
parent | 4b1a89926910ce7f7c2a063240ceadfcbac74e06 (diff) | |
download | libcore-90b140190f219fd63ede200a63da40bf9e6ca98d.zip libcore-90b140190f219fd63ede200a63da40bf9e6ca98d.tar.gz libcore-90b140190f219fd63ede200a63da40bf9e6ca98d.tar.bz2 |
Remove some unnecessary cruft.
Change-Id: I8d83954d42f3511a24a44a33c3b28f04af6d3b82
Diffstat (limited to 'luni')
4 files changed, 17 insertions, 49 deletions
diff --git a/luni/src/main/java/javax/xml/namespace/QName.java b/luni/src/main/java/javax/xml/namespace/QName.java index eaa908e..f748b64 100644 --- a/luni/src/main/java/javax/xml/namespace/QName.java +++ b/luni/src/main/java/javax/xml/namespace/QName.java @@ -85,21 +85,12 @@ public class QName implements Serializable { * <p>The compatibility Stream Unique Identifier that was introduced * with Java 5 SE SDK.</p> */ - private static final long compatabilitySerialVersionUID = 4418622981026545151L; + private static final long compatibilitySerialVersionUID = 4418622981026545151L; static { - String compatPropValue = null; - try { - compatPropValue = (String)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return System.getProperty("org.apache.xml.namespace.QName.useCompatibleSerialVersionUID"); - } - }); - } - catch (Exception e) {} + String compatPropValue = System.getProperty("org.apache.xml.namespace.QName.useCompatibleSerialVersionUID"); // If 1.0 use compatibility serialVersionUID - serialVersionUID = !"1.0".equals(compatPropValue) ? defaultSerialVersionUID : compatabilitySerialVersionUID; + serialVersionUID = !"1.0".equals(compatPropValue) ? defaultSerialVersionUID : compatibilitySerialVersionUID; } /** diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java index 1f1d789..d21aa2c 100644 --- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java +++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java @@ -278,12 +278,11 @@ public class ClientHandshakeImpl extends HandshakeProtocol { } serverHelloDone = new ServerHelloDone(io_stream, length); if (this.nonBlocking) { - delegatedTasks.add(new DelegatedTask(new PrivilegedExceptionAction<Void>() { - public Void run() throws Exception { + delegatedTasks.add(new DelegatedTask(new Runnable() { + public void run() { processServerHelloDone(); - return null; } - }, this, AccessController.getContext())); + }, this)); return; } processServerHelloDone(); diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java index c110275..0e13bc2 100644 --- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java +++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java @@ -17,42 +17,23 @@ package org.apache.harmony.xnet.provider.jsse; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - /** * Delegated Runnable task for SSLEngine */ public class DelegatedTask implements Runnable { private final HandshakeProtocol handshaker; - private final PrivilegedExceptionAction<Void> action; - private final AccessControlContext context; + private final Runnable action; - /** - * Creates DelegatedTask - * @param action - * @param handshaker - * @param context - */ - public DelegatedTask(PrivilegedExceptionAction<Void> action, HandshakeProtocol handshaker, AccessControlContext context) { + public DelegatedTask(Runnable action, HandshakeProtocol handshaker) { this.action = action; this.handshaker = handshaker; - this.context = context; } - /** - * Executes DelegatedTask - */ public void run() { synchronized (handshaker) { try { - AccessController.doPrivileged(action, context); - } catch (PrivilegedActionException e) { - // pass exception to HandshakeProtocol - handshaker.delegatedTaskErr = e.getException(); + action.run(); } catch (RuntimeException e) { // pass exception to HandshakeProtocol handshaker.delegatedTaskErr = e; diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java index 7961cdc..b6a65b4 100644 --- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java +++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java @@ -119,12 +119,11 @@ public class ServerHandshakeImpl extends HandshakeProtocol { needSendHelloRequest = false; clientHello = new ClientHello(io_stream, length); if (nonBlocking) { - delegatedTasks.add(new DelegatedTask(new PrivilegedExceptionAction<Void>() { - public Void run() throws Exception { + delegatedTasks.add(new DelegatedTask(new Runnable() { + public void run() { processClientHello(); - return null; } - }, this, AccessController.getContext())); + }, this)); return; } processClientHello(); @@ -300,13 +299,11 @@ public class ServerHandshakeImpl extends HandshakeProtocol { return; } if (nonBlocking) { - delegatedTasks.add(new DelegatedTask( - new PrivilegedExceptionAction<Void>() { - public Void run() throws Exception { - processClientHello(); - return null; - } - }, this, AccessController.getContext())); + delegatedTasks.add(new DelegatedTask(new Runnable() { + public void run() { + processClientHello(); + } + }, this)); return; } processClientHello(); |