harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r414463 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
Date Thu, 15 Jun 2006 04:51:47 GMT
Author: ndbeyer
Date: Wed Jun 14 21:51:46 2006
New Revision: 414463

URL: http://svn.apache.org/viewvc?rev=414463&view=rev
Log:
Generify

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java?rev=414463&r1=414462&r2=414463&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
Wed Jun 14 21:51:46 2006
@@ -26,7 +26,7 @@
  * <code>{@link java.security.AccessController#doPrivileged(PrivilegedAction)}</code>
  * calls.
  */
-public class PriviAction implements PrivilegedAction {
+public class PriviAction<T> implements PrivilegedAction<T> {
 
 	private Object arg1;
 
@@ -51,8 +51,8 @@
 	 * 
 	 * @see Security#getProperty
 	 */
-	public static PrivilegedAction getSecurityProperty(String property) {
-		return new PriviAction(GET_SECURITY_PROPERTY, property);
+	public static <T> PrivilegedAction<T> getSecurityProperty(String property) {
+		return new PriviAction<T>(GET_SECURITY_PROPERTY, property);
 	}
 
 	private PriviAction(int action, Object arg) {
@@ -120,14 +120,14 @@
 	 * 
 	 * @see java.security.PrivilegedAction#run()
 	 */
-	public Object run() {
+	public T run() {
 		switch (action) {
 		case GET_SYSTEM_PROPERTY:
-			return System.getProperty((String) arg1, (String) arg2);
+			return (T)System.getProperty((String) arg1, (String) arg2);
 		case GET_SECURITY_PROPERTY:
-			return Security.getProperty((String) arg1);
+			return (T)Security.getProperty((String) arg1);
 		case GET_SECURITY_POLICY:
-			return Policy.getPolicy();
+			return (T)Policy.getPolicy();
 		case SET_ACCESSIBLE:
 			((AccessibleObject) arg1).setAccessible(true);
 		}



Mime
View raw message