summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-06-06 10:55:15 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-06 10:55:15 -0700
commit4f54203252733229489e6d09c7d3e0aaa82754d6 (patch)
tree686fff927c6b7c73836de0c9a1cc48b4d5ade106 /support
parentfc041ff241f9a7556e72236f130de0215ecd17db (diff)
parente26b27faf689c17b7894c78caee32432176349ec (diff)
downloadlibcore-4f54203252733229489e6d09c7d3e0aaa82754d6.zip
libcore-4f54203252733229489e6d09c7d3e0aaa82754d6.tar.gz
libcore-4f54203252733229489e6d09c7d3e0aaa82754d6.tar.bz2
Merge "Remove more dead "security theater" cruft." into dalvik-dev
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/org/apache/harmony/security/tests/support/MyBasicPermission.java8
-rw-r--r--support/src/test/java/org/apache/harmony/security/tests/support/MyPermission.java52
-rw-r--r--support/src/test/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java53
3 files changed, 4 insertions, 109 deletions
diff --git a/support/src/test/java/org/apache/harmony/security/tests/support/MyBasicPermission.java b/support/src/test/java/org/apache/harmony/security/tests/support/MyBasicPermission.java
index d0e409a..a0dbcea 100644
--- a/support/src/test/java/org/apache/harmony/security/tests/support/MyBasicPermission.java
+++ b/support/src/test/java/org/apache/harmony/security/tests/support/MyBasicPermission.java
@@ -18,12 +18,12 @@
package org.apache.harmony.security.tests.support;
import java.security.BasicPermission;
+import java.security.Permission;
public class MyBasicPermission extends BasicPermission {
+ public MyBasicPermission(String name) { super(""); }
- private static final long serialVersionUID = -4220730623258019258L;
+ @Override public String getActions() { return null; }
- public MyBasicPermission(String name) {
- super(name);
- }
+ @Override public boolean implies(Permission permission) { return true; }
}
diff --git a/support/src/test/java/org/apache/harmony/security/tests/support/MyPermission.java b/support/src/test/java/org/apache/harmony/security/tests/support/MyPermission.java
deleted file mode 100644
index b52bea9..0000000
--- a/support/src/test/java/org/apache/harmony/security/tests/support/MyPermission.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.support;
-
-import java.security.Permission;
-
-public final class MyPermission extends Permission {
-
- private static final long serialVersionUID = 4208595188308189251L;
-
- public MyPermission(String name) {
- super(name);
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof MyPermission) {
- String name = ((MyPermission) obj).getName();
- if (name == null) {
- return getName() == null;
- }
- return name.equals(getName());
- }
- return false;
- }
-
- public String getActions() {
- return null;
- }
-
- public int hashCode() {
- return 0;
- }
-
- public boolean implies(Permission permission) {
- return false;
- }
-}
diff --git a/support/src/test/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java b/support/src/test/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
deleted file mode 100644
index 360b4f6..0000000
--- a/support/src/test/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.support;
-
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-public class MyPermissionCollection extends PermissionCollection {
-
- private static final long serialVersionUID = -8462474212761656528L;
-
- public MyPermissionCollection(boolean readOnly) {
- if (readOnly) {
- setReadOnly();
- }
- }
-
- public void add(Permission permission) {}
-
- public Enumeration<Permission> elements() {
-
- return new Enumeration<Permission>() {
- public boolean hasMoreElements() {
- return false;
- }
-
- public Permission nextElement() {
- throw new NoSuchElementException();
- }
- };
- }
-
- public boolean implies(Permission permission) {
- return false;
- }
- }