Skip to content

Commit ddb55ed

Browse files
jhuttanajerboaa
authored andcommitted
8135292: Remove duplicate code in <OS>Address.java in SA
Reviewed-by: cjplummer, amenkov
1 parent 7905788 commit ddb55ed

File tree

11 files changed

+18
-47
lines changed

11 files changed

+18
-47
lines changed

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -292,11 +292,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
292292
// Internals only below this point
293293
//
294294

295-
long getValue() {
296-
return addr;
297-
}
298-
299-
300295
private static void check(boolean arg, String failMessage) {
301296
if (!arg) {
302297
System.err.println(failMessage + ": FAILED");

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -525,7 +525,7 @@ public long readJLong(long address)
525525
/** From the BsdDebugger interface */
526526
public long getAddressValue(Address addr) {
527527
if (addr == null) return 0;
528-
return ((BsdAddress) addr).getValue();
528+
return addr.asLongValue();
529529
}
530530

531531
/** From the BsdDebugger interface */

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -279,10 +279,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
279279
// Internals only below this point
280280
//
281281

282-
long getValue() {
283-
return addr;
284-
}
285-
286282
private static void check(boolean arg, String failMessage) {
287283
if (!arg) {
288284
System.err.println(failMessage + ": FAILED");

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ public Address parseAddress(String addrStr) {
7373

7474
public long getAddressValue(Address addr) {
7575
if (addr == null) return 0;
76-
return ((DummyAddress) addr).getValue();
76+
return addr.asLongValue();
7777
}
7878

7979
public String getOS() {
@@ -142,7 +142,7 @@ String addressToString(DummyAddress addr) {
142142
if (addr == null) {
143143
val = "0";
144144
} else {
145-
val = Long.toHexString(addr.getValue());
145+
val = Long.toHexString(addr.asLongValue());
146146
}
147147
for (int i = 0; i < ((2 * machDesc.getAddressSize()) - val.length()); i++) {
148148
buf.append('0');

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -293,11 +293,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
293293
// Internals only below this point
294294
//
295295

296-
long getValue() {
297-
return addr;
298-
}
299-
300-
301296
private static void check(boolean arg, String failMessage) {
302297
if (!arg) {
303298
System.err.println(failMessage + ": FAILED");

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -582,7 +582,7 @@ public long readJLong(long address)
582582
/** From the LinuxDebugger interface */
583583
public long getAddressValue(Address addr) {
584584
if (addr == null) return 0;
585-
return ((LinuxAddress) addr).getValue();
585+
return addr.asLongValue();
586586
}
587587

588588
/** From the LinuxDebugger interface */

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -287,11 +287,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
287287
// Internals only below this point
288288
//
289289

290-
long getValue() {
291-
return addr;
292-
}
293-
294-
295290
private static void check(boolean arg, String failMessage) {
296291
if (!arg) {
297292
System.err.println(failMessage + ": FAILED");

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -285,11 +285,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
285285
// Internals only below this point
286286
//
287287

288-
long getValue() {
289-
return addr;
290-
}
291-
292-
293288
private static void check(boolean arg, String failMessage) {
294289
if (!arg) {
295290
System.err.println(failMessage + ": FAILED");

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -303,7 +303,7 @@ public String addressValueToString(long addr) {
303303

304304
public long getAddressValue(Address addr) throws DebuggerException {
305305
if (addr == null) return 0;
306-
return ((RemoteAddress) addr).getValue();
306+
return addr.asLongValue();
307307
}
308308

309309
public Address newAddress(long value) {

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -297,11 +297,6 @@ public Address xorWithMask(long mask) throws UnsupportedOperationException {
297297
// Internals only below this point
298298
//
299299

300-
long getValue() {
301-
return addr;
302-
}
303-
304-
305300
private static void check(boolean arg, String failMessage) {
306301
if (!arg) {
307302
System.err.println(failMessage + ": FAILED");

0 commit comments

Comments
 (0)