implement Class.{get|set}Signers

This commit is contained in:
Joel Dice 2009-08-04 18:31:14 -06:00
parent e18ab49f4d
commit 7050448ec5

View File

@ -22,6 +22,8 @@ import java.lang.annotation.Annotation;
import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Map;
import java.util.HashMap;
import java.security.ProtectionDomain;
import java.security.Permissions;
import java.security.AllPermission;
@ -456,7 +458,7 @@ public final class Class <T> implements Type, GenericDeclaration {
}
public Object[] getSigners() {
throw new UnsupportedOperationException();
return Static.signers.get(this);
}
public Annotation[] getDeclaredAnnotations() {
@ -503,6 +505,12 @@ public final class Class <T> implements Type, GenericDeclaration {
// for GNU Classpath compatibility:
void setSigners(Object[] signers) {
throw new UnsupportedOperationException();
if (signers != null && signers.length > 0) {
Static.signers.put(this, signers);
}
}
private static class Static {
public static final Map<Class,Object[]> signers = new HashMap();
}
}