Skip to content

Commit f397172

Browse files
committed
GH-247 missing case for java.lang.Short added
1 parent 4e3f799 commit f397172

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

visualvm/libs.profiler/lib.profiler/src/org/graalvm/visualvm/lib/jfluid/server/ProfilerRuntimeCPU.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ private static int getParSize(Object p) {
697697
return 1;
698698
} else if (type == Byte.class) {
699699
return 1;
700+
} else if (type == Short.class) {
701+
return 2;
700702
} else if (type == Character.class) {
701703
return 2;
702704
} else if (type == Long.class) {
@@ -727,6 +729,11 @@ private static int writeParameter(byte[] evBuf, int curPos, Object p) {
727729
byte vp = ((Byte)p).byteValue();
728730
evBuf[curPos++] = ProfilerInterface.BYTE;
729731
evBuf[curPos++] = vp;
732+
} else if (type == Short.class) {
733+
short vp = ((Short)p).shortValue();
734+
evBuf[curPos++] = ProfilerInterface.SHORT;
735+
evBuf[curPos++] = (byte) ((vp >> 8) & 0xFF);
736+
evBuf[curPos++] = (byte) ((vp) & 0xFF);
730737
} else if (type == Character.class) {
731738
char vp = ((Character)p).charValue();
732739
evBuf[curPos++] = ProfilerInterface.CHAR;

0 commit comments

Comments
 (0)