Review for Bug 145350 - JDI Enhancements for Java 6.0
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
index c8236f0..f78bcd3 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
@@ -32,7 +32,7 @@
*/
public void testCanGetClassFileVersion() {
if(fVM.version().indexOf("1.6") > -1) {
- assertFalse("Should have classfile version info", fVM.canGetClassFileVersion());
+ assertTrue("Should have classfile version info", fVM.canGetClassFileVersion());
}
else {
assertTrue("Should not have classfile version info", !fVM.canGetClassFileVersion());
@@ -48,7 +48,7 @@
assertTrue("Should have constant pool info", fVM.canGetConstantPool());
}
else {
- assertTrue("Should not have constant pool info", !fVM.canGetConstantPool());
+ assertFalse("Should not have constant pool info", fVM.canGetConstantPool());
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
index a67d490..9e61a61 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
@@ -522,8 +522,7 @@
* @since 3.3
*/
public boolean canGetMethodReturnValues() {
- getVersionInfo();
- return fJdwpMajorVersion > 1 || fJdwpMinorVersion >= 6;
+ return isJdwpVersionGreaterOrEqual(1, 6);
}
/**
@@ -988,8 +987,7 @@
* @since 3.3
*/
public boolean canGetClassFileVersion() {
- getVersionInfo();
- return fJdwpMajorVersion > 1 || fJdwpMinorVersion >= 6;
+ return isJdwpVersionGreaterOrEqual(1, 6);
}
/**
@@ -1314,7 +1312,11 @@
}
int size = refTypes.size();
if(size == 0) {
- return new long[0];
+ if (isJdwpVersionGreaterOrEqual(1, 6)) {
+ return new long[0];
+ } else {
+ throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_27);
+ }
}
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();