1 22 package org.jboss.test.perf.interfaces; 23 24 import java.net.URL ; 25 import java.security.ProtectionDomain ; 26 27 import org.jboss.logging.Logger; 28 29 33 public class EntityPK implements java.io.Serializable 34 { 35 static Logger log = Logger.getLogger(EntityPK.class); 36 37 public int theKey; 38 39 public EntityPK() 40 { 41 } 42 43 public EntityPK(int theKey) 44 { 45 this.theKey = theKey; 46 } 47 48 public boolean equals(Object obj) 49 { 50 boolean equals = false; 51 try 52 { 53 EntityPK key = (EntityPK) obj; 54 equals = theKey == key.theKey; 55 } 56 catch(ClassCastException e) 57 { 58 log.debug("failed", e); 59 ProtectionDomain pd0 = getClass().getProtectionDomain(); 61 URL loc0 = pd0.getCodeSource().getLocation(); 62 ProtectionDomain pd1 = obj.getClass().getProtectionDomain(); 63 URL loc1 = pd1.getCodeSource().getLocation(); 64 log.debug("PK0 location="+loc0); 65 log.debug("PK0 loader="+getClass().getClassLoader()); 66 log.debug("PK1 location="+loc1); 67 log.debug("PK1 loader="+obj.getClass().getClassLoader()); 68 } 69 return equals; 70 } 71 public int hashCode() 72 { 73 return theKey; 74 } 75 76 public String toString() 77 { 78 return "EntityPK[" + theKey + "]"; 79 } 80 81 } 82 83 | Popular Tags |