comparison graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/debug/MethodLocal.java @ 13918:22bf5a8ba9eb

Ruby: restore prototype debugger.
author Chris Seaton <chris.seaton@oracle.com>
date Mon, 10 Feb 2014 03:39:21 +0000
parents
children
comparison
equal deleted inserted replaced
13917:f2345d7c52ef 13918:22bf5a8ba9eb
1 /*
2 * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. This
3 * code is released under a tri EPL/GPL/LGPL license. You can use it,
4 * redistribute it and/or modify it under the terms of the:
5 *
6 * Eclipse Public License version 1.0
7 * GNU General Public License version 2
8 * GNU Lesser General Public License version 2.1
9 */
10 package com.oracle.truffle.ruby.runtime.debug;
11
12 import com.oracle.truffle.ruby.runtime.methods.*;
13
14 /*
15 * Identifies a local in a method.
16 */
17 public class MethodLocal {
18
19 private final UniqueMethodIdentifier method;
20 private final String local;
21
22 public MethodLocal(UniqueMethodIdentifier method, String local) {
23 this.method = method;
24 this.local = local;
25 }
26
27 @Override
28 public int hashCode() {
29 final int prime = 31;
30 int result = 1;
31 result = prime * result + ((local == null) ? 0 : local.hashCode());
32 result = prime * result + ((method == null) ? 0 : method.hashCode());
33 return result;
34 }
35
36 @Override
37 public boolean equals(Object obj) {
38 if (this == obj) {
39 return true;
40 }
41 if (obj == null) {
42 return false;
43 }
44 if (getClass() != obj.getClass()) {
45 return false;
46 }
47 MethodLocal other = (MethodLocal) obj;
48 if (local == null) {
49 if (other.local != null) {
50 return false;
51 }
52 } else if (!local.equals(other.local)) {
53 return false;
54 }
55 if (method == null) {
56 if (other.method != null) {
57 return false;
58 }
59 } else if (!method.equals(other.method)) {
60 return false;
61 }
62 return true;
63 }
64
65 }