From 55790e1e51cf5bbb5cbec3f0526c56dfbf5c0db7 Mon Sep 17 00:00:00 2001 From: brian Date: Sun, 9 May 2004 08:23:35 +0000 Subject: [PATCH] more stuff darcs-hash:20040509082335-24bed-dd72bd2d1fcb54293dd7a0470c58a35c694d35bd.gz --- src/com/brian_web/gcclass/GCClass.java | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/com/brian_web/gcclass/GCClass.java b/src/com/brian_web/gcclass/GCClass.java index 54a902c..5971591 100644 --- a/src/com/brian_web/gcclass/GCClass.java +++ b/src/com/brian_web/gcclass/GCClass.java @@ -23,14 +23,19 @@ import org.apache.bcel.classfile.*; // FEATURE: Optimize away INSTANCEOF if the class can never be instansiated public class GCClass { - // This is called outside pure java so we don't see the call - private static final String[] PRE_REF = { "java.lang.Thread.run" }; - // The JDK uses some voodoo under the hood to implement these methods + private static final String[] PRE_REF = { + "java.lang.Thread.run", + "java.security.PrivilegedAction.run" + }; + + // NOTE: This doesn't mean these classes are ignored alltogether + // failures to resolve them are just ignored private static final String[] IGNORED_METHODS = { "java.net.SocketImpl.setOption(ILjava/lang/Object;)V", "java.net.SocketImpl.getOption(I)Ljava/lang/Object;", "java.awt.geom.*", - "apple.awt.*" + "apple.awt.*", + "java.security.*" }; private static final String[] NO_OUTPUT = { "java", "javax", "sun", "com.sun", "apple", "com.apple" }; @@ -298,12 +303,7 @@ public class GCClass { this(i.getClassType(cp),i.getMethodName(cp),i.getReturnType(cp),i.getArgumentTypes(cp)); } - public MethodRef(ObjectType c, String name, Type ret, Type[] args) { - this.c = c; - this.name = name; - this.ret = ret; - this.args = args; - } + public MethodRef(ObjectType c, String name, Type ret, Type[] args) { this.c = c; this.name = name; this.ret = ret; this.args = args; } public boolean equals(Object o_) { if(!(o_ instanceof MethodRef)) return false; @@ -311,14 +311,12 @@ public class GCClass { boolean r = name.equals(o.name) && c.equals(o.c) && ret.equals(o.ret) && Arrays.equals(args,o.args); return r; } - // FIXME: ArrayType.java in BCEL doesn't properly implement hashCode() public int hashCode() { int hc = name.hashCode() ^ c.hashCode(); //^ ret.hashCode(); //for(int i=0;i