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