01: //
02: // This file is part of the prose package.
03: //
04: // The contents of this file are subject to the Mozilla Public License
05: // Version 1.1 (the "License"); you may not use this file except in
06: // compliance with the License. You may obtain a copy of the License at
07: // http://www.mozilla.org/MPL/
08: //
09: // Software distributed under the License is distributed on an "AS IS" basis,
10: // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11: // for the specific language governing rights and limitations under the
12: // License.
13: //
14: // The Original Code is prose.
15: //
16: // The Initial Developer of the Original Code is Andrei Popovici. Portions
17: // created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18: // All Rights Reserved.
19: //
20: // Contributor(s):
21: // $Id: JoinPointLocation.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
22: // =====================================================================
23: //
24: // (history at end)
25: //
26:
27: package ch.ethz.inf.iks.jvmai.jvmdi;
28:
29: import java.lang.reflect.Method;
30:
31: /**
32: * Class JoinPointLocation denotes a code location: a method
33: * plus a bytecode index. A join-point location is usually
34: * owned by a JoinPointContext, which needs the location information
35: * to obtain information about local variables.
36: *
37: * @version $Revision: 1.1.1.1 $
38: * @author Andrei Popovici
39: */
40: class JoinPointLocation {
41:
42: protected Method executingMethod;
43: protected int executingBci;
44:
45: public JoinPointLocation() {
46: executingMethod = null;
47: executingBci = -1;
48: }
49:
50: public boolean equals(Object other) {
51: JoinPointLocation otherLocation = null;
52: if (other instanceof JoinPointLocation) {
53: otherLocation = (JoinPointLocation) other;
54: return executingMethod
55: .equals(otherLocation.executingMethod)
56: && executingBci == otherLocation.executingBci;
57: } else
58: return false;
59: }
60:
61: public int hashCode() {
62: return executingMethod.hashCode() + executingBci;
63: }
64: }
65:
66: //======================================================================
67: //
68: // $Log: JoinPointLocation.java,v $
69: // Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
70: // Imported from ETH Zurich
71: //
72: // Revision 1.2 2003/03/04 16:09:36 popovici
73: // Documentation improvements
74: //
75: // Revision 1.1 2003/03/04 11:26:42 popovici
76: // Important refactorization step (march):
77: // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
78: // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
79: // structures
80: //
|