Bug 566683 - fix bit operation
Fix bitwise add of signed byte value computed in
org.eclipse.jdi.internal.jdwp.JdwpCommandPacket.readSpecificHeaderFields(byte[],
int)
and org.eclipse.jdi.internal.spy.JdwpCommandPacket.readSpecificHeaderFields(DataInputStream)
to avoid sign extending.
Change-Id: Ic2406a726c79b44b4ec2126ea3101efd84d2274e
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
diff --git a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
index f4eb3af..f91b54d 100644
--- a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.debug; singleton:=true
-Bundle-Version: 3.17.0.qualifier
+Bundle-Version: 3.17.100.qualifier
Bundle-ClassPath: jdimodel.jar,
tools.jar
Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
index 68e99ae..4d4194a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
@@ -234,7 +234,7 @@
@Override
protected int readSpecificHeaderFields(byte[] bytes, int index) {
byte commandSet = bytes[index];
- fCommand = bytes[index + 1] + (commandSet << 8);
+ fCommand = (bytes[index + 1] & 0xff) + (commandSet << 8);
return 2;
}
@@ -264,8 +264,9 @@
for (Field field : fields) {
if ((field.getModifiers() & Modifier.PUBLIC) == 0
|| (field.getModifiers() & Modifier.STATIC) == 0
- || (field.getModifiers() & Modifier.FINAL) == 0)
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
+ }
try {
String name = field.getName();
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
index 7abda70..f6bad5a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
@@ -227,7 +227,7 @@
protected void readSpecificHeaderFields(DataInputStream dataInStream)
throws IOException {
byte commandSet = dataInStream.readByte();
- fCommand = dataInStream.readByte() + (commandSet << 8);
+ fCommand = (dataInStream.readByte() & 0xff) + (commandSet << 8);
}
/**
@@ -255,8 +255,9 @@
for (Field field : fields) {
if ((field.getModifiers() & Modifier.PUBLIC) == 0
|| (field.getModifiers() & Modifier.STATIC) == 0
- || (field.getModifiers() & Modifier.FINAL) == 0)
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
+ }
try {
String name = field.getName();
diff --git a/org.eclipse.jdt.debug/pom.xml b/org.eclipse.jdt.debug/pom.xml
index e6b4d82..14f9e6a 100644
--- a/org.eclipse.jdt.debug/pom.xml
+++ b/org.eclipse.jdt.debug/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.debug</artifactId>
- <version>3.17.0-SNAPSHOT</version>
+ <version>3.17.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>