提交 dbffd531 编写于 作者: P ptbrunet

8132249: Clean up JAB debugging code

Summary: remove dead code;  replace DEBUG_CODE with PrintDebugString; fix typos, incorrect print args
Reviewed-by: van
Contributed-by: peter.brunet@oracle.com
上级 7fac6b3b
...@@ -87,7 +87,7 @@ LRESULT ...@@ -87,7 +87,7 @@ LRESULT
AccessBridgeATInstance::initiateIPC() { AccessBridgeATInstance::initiateIPC() {
DWORD errorCode; DWORD errorCode;
PrintDebugString("\r\nin AccessBridgeATInstance::initiateIPC()"); PrintDebugString("\r\nIn AccessBridgeATInstance::initiateIPC()");
// open Windows-initiated IPC filemap & map it to a ptr // open Windows-initiated IPC filemap & map it to a ptr
......
...@@ -40,7 +40,7 @@ AccessBridgeJavaEntryPoints::AccessBridgeJavaEntryPoints(JNIEnv *jniEnvironment, ...@@ -40,7 +40,7 @@ AccessBridgeJavaEntryPoints::AccessBridgeJavaEntryPoints(JNIEnv *jniEnvironment,
jobject bridgeObject) { jobject bridgeObject) {
jniEnv = jniEnvironment; jniEnv = jniEnvironment;
accessBridgeObject = (jobject)bridgeObject; accessBridgeObject = (jobject)bridgeObject;
PrintDebugString("AccessBridgeJavaEntryPoints(%X, %X) called", jniEnv, accessBridgeObject); PrintDebugString("AccessBridgeJavaEntryPoints(%p, %p) called", jniEnv, accessBridgeObject);
} }
......
...@@ -188,7 +188,7 @@ AccessBridgeJavaVMInstance::initiateIPC() { ...@@ -188,7 +188,7 @@ AccessBridgeJavaVMInstance::initiateIPC() {
* with the Java AccessBridge DLL * with the Java AccessBridge DLL
* *
* NOTE: WM_COPYDATA is only for one-way IPC; there * NOTE: WM_COPYDATA is only for one-way IPC; there
* is now way to return parameters (especially big ones) * is no way to return parameters (especially big ones)
* Use sendMemoryPackage() to do that! * Use sendMemoryPackage() to do that!
*/ */
LRESULT LRESULT
......
...@@ -51,7 +51,6 @@ extern "C" { ...@@ -51,7 +51,6 @@ extern "C" {
// open our window // open our window
if (theWindowsAccessBridge != (WinAccessBridge *) 0) { if (theWindowsAccessBridge != (WinAccessBridge *) 0) {
theWindowsAccessBridge->initWindow(); theWindowsAccessBridge->initWindow();
DEBUG_CODE(SetDlgItemText(theDialogWindow, cInvokedByText, "Windows"));
} }
} }
......
...@@ -91,27 +91,6 @@ extern "C" { ...@@ -91,27 +91,6 @@ extern "C" {
theJavaAccessBridge->javaRun(env, obj); theJavaAccessBridge->javaRun(env, obj);
} }
#if 0 // SetDlgItemText has caused problems with JAWS
/**
* Append debug info to dialog
*
*/
void AppendToCallInfo(char *s) {
char buffer[4096];
PrintDebugString(s);
GetDlgItemText(theDialogWindow, cCallInfo, buffer, sizeof(buffer));
if (strlen(buffer) < (sizeof(buffer) - strlen(s))) {
strncat(buffer, s, sizeof(buffer));
SetDlgItemText(theDialogWindow, cCallInfo, buffer);
} else {
SetDlgItemText(theDialogWindow, cCallInfo, s);
}
}
#endif
/** /**
* Our window proc * Our window proc
* *
...@@ -120,24 +99,23 @@ extern "C" { ...@@ -120,24 +99,23 @@ extern "C" {
int command; int command;
COPYDATASTRUCT *sentToUs; COPYDATASTRUCT *sentToUs;
char *package; char *package;
//DEBUG_CODE(char buffer[256]);
switch (message) { switch (message) {
case WM_INITDIALOG: case WM_INITDIALOG:
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Initializing")); PrintDebugString("In AccessBridgeDialog - Initializing");
break; break;
case WM_COMMAND: case WM_COMMAND:
command = LOWORD (wParam); command = LOWORD (wParam);
PrintDebugString("In AccessBridgeDialog - Got WM_COMMAND, command: %X", command);
break; break;
// call from Java with data for us to deliver // call from Java with data for us to deliver
case WM_COPYDATA: case WM_COPYDATA:
if (theDialogWindow == (HWND) wParam) { if (theDialogWindow == (HWND) wParam) {
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got WM_COPYDATA from ourselves")); PrintDebugString("In AccessBridgeDialog - Got WM_COPYDATA from ourselves");
} else { } else {
//DEBUG_CODE(sprintf(buffer, "Got WM_COPYDATA from HWND %p", wParam)); PrintDebugString("In AccessBridgeDialog - Got WM_COPYDATA from HWND %p", wParam);
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
sentToUs = (COPYDATASTRUCT *) lParam; sentToUs = (COPYDATASTRUCT *) lParam;
package = (char *) sentToUs->lpData; package = (char *) sentToUs->lpData;
theJavaAccessBridge->processPackage(package, sentToUs->cbData); theJavaAccessBridge->processPackage(package, sentToUs->cbData);
...@@ -149,18 +127,16 @@ extern "C" { ...@@ -149,18 +127,16 @@ extern "C" {
// wParam == sourceHwnd // wParam == sourceHwnd
// lParam == buffer size in shared memory // lParam == buffer size in shared memory
if (theDialogWindow == (HWND) wParam) { if (theDialogWindow == (HWND) wParam) {
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_MESSAGE_WAITING from ourselves")); PrintDebugString("In AccessBridgeDialog - Got AB_MESSAGE_WAITING from ourselves");
} else { } else {
//DEBUG_CODE(sprintf(buffer, "Got AB_MESSAGE_WAITING from HWND %p", wParam)); PrintDebugString("In AccessBridgeDialog - Got AB_MESSAGE_WAITING from HWND %p", wParam);
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
LRESULT returnVal = theJavaAccessBridge->receiveMemoryPackage((HWND) wParam, (long) lParam); LRESULT returnVal = theJavaAccessBridge->receiveMemoryPackage((HWND) wParam, (long) lParam);
} }
break; break;
// a JavaAccessBridge DLL is going away // a JavaAccessBridge DLL is going away
case AB_DLL_GOING_AWAY: case AB_DLL_GOING_AWAY:
// wParam == sourceHwnd PrintDebugString("In AccessBridgeDialog - Got AB_DLL_GOING_AWAY message");
//DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_DLL_GOING_AWAY message"));
theJavaAccessBridge->WindowsATDestroyed((HWND) wParam); theJavaAccessBridge->WindowsATDestroyed((HWND) wParam);
break; break;
...@@ -171,6 +147,7 @@ extern "C" { ...@@ -171,6 +147,7 @@ extern "C" {
// A new Windows AT just said "hi"; // A new Windows AT just said "hi";
// say "hi" back so it can mate up with us // say "hi" back so it can mate up with us
// otherwise don't do anything (e.g. don't set up data structures yet) // otherwise don't do anything (e.g. don't set up data structures yet)
PrintDebugString("In AccessBridgeDialog - Got theFromWindowsHelloMsgID message");
theJavaAccessBridge->postHelloToWindowsDLLMsg((HWND) wParam); theJavaAccessBridge->postHelloToWindowsDLLMsg((HWND) wParam);
} }
} }
...@@ -326,9 +303,9 @@ JavaAccessBridge::initWindow() { ...@@ -326,9 +303,9 @@ JavaAccessBridge::initWindow() {
*/ */
void void
JavaAccessBridge::postHelloToWindowsDLLMsg(HWND destHwnd) { JavaAccessBridge::postHelloToWindowsDLLMsg(HWND destHwnd) {
PrintDebugString("\r\nin JavaAccessBridge::postHelloToWindowsDLLMsg"); PrintDebugString("\r\nIn JavaAccessBridge::postHelloToWindowsDLLMsg");
PrintDebugString(" calling PostMessage(%p, %X, %p, %p)", PrintDebugString(" calling PostMessage(%p, %X, %p, %p)",
destHwnd, theFromJavaHelloMsgID, dialogWindow, javaVM); destHwnd, theFromJavaHelloMsgID, dialogWindow, dialogWindow);
PostMessage(destHwnd, theFromJavaHelloMsgID, (WPARAM) dialogWindow, (LPARAM) dialogWindow); PostMessage(destHwnd, theFromJavaHelloMsgID, (WPARAM) dialogWindow, (LPARAM) dialogWindow);
} }
...@@ -2495,7 +2472,7 @@ JavaAccessBridge::firePropertyTableModelChange(JNIEnv *env, jobject callingObj, ...@@ -2495,7 +2472,7 @@ JavaAccessBridge::firePropertyTableModelChange(JNIEnv *env, jobject callingObj,
jobject eventObj, jobject source) { \ jobject eventObj, jobject source) { \
\ \
PrintDebugString("\r\nFiring event id = %d(%p, %p, %p, %p); vmID = %X", \ PrintDebugString("\r\nFiring event id = %d(%p, %p, %p, %p); vmID = %X", \
eventConstant, env, callingObj, eventObj, source, javaVM); \ eventConstant, env, callingObj, eventObj, source, dialogWindow); \
\ \
/* sanity check */ \ /* sanity check */ \
if (ATs == (AccessBridgeATInstance *) 0) { \ if (ATs == (AccessBridgeATInstance *) 0) { \
...@@ -2533,7 +2510,7 @@ JavaAccessBridge::firePropertyTableModelChange(JNIEnv *env, jobject callingObj, ...@@ -2533,7 +2510,7 @@ JavaAccessBridge::firePropertyTableModelChange(JNIEnv *env, jobject callingObj,
void JavaAccessBridge::javaShutdown(JNIEnv *env, jobject callingObj) { void JavaAccessBridge::javaShutdown(JNIEnv *env, jobject callingObj) {
PrintDebugString("\r\nFiring event id = %d(%p, %p); vmID = %X", PrintDebugString("\r\nFiring event id = %d(%p, %p); vmID = %X",
cJavaShutdownEvent, env, callingObj, javaVM); cJavaShutdownEvent, env, callingObj, dialogWindow);
/* sanity check */ /* sanity check */
if (ATs == (AccessBridgeATInstance *) 0) { if (ATs == (AccessBridgeATInstance *) 0) {
......
...@@ -338,7 +338,7 @@ LRESULT ...@@ -338,7 +338,7 @@ LRESULT
WinAccessBridge::rendezvousWithNewJavaDLL(HWND JavaBridgeDLLwindow, long vmID) { WinAccessBridge::rendezvousWithNewJavaDLL(HWND JavaBridgeDLLwindow, long vmID) {
LRESULT returnVal; LRESULT returnVal;
PrintDebugString("in JavaAccessBridge::rendezvousWithNewJavaDLL(%p, %X)", PrintDebugString("in WinAccessBridge::rendezvousWithNewJavaDLL(%p, %X)",
JavaBridgeDLLwindow, vmID); JavaBridgeDLLwindow, vmID);
isVMInstanceChainInUse = true; isVMInstanceChainInUse = true;
...@@ -843,7 +843,7 @@ WinAccessBridge::isJavaWindow(HWND window) { ...@@ -843,7 +843,7 @@ WinAccessBridge::isJavaWindow(HWND window) {
return FALSE; return FALSE;
} }
PrintDebugString(" in WinAccessBridge::isJavaWindow"); PrintDebugString("In WinAccessBridge::isJavaWindow");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册