rename EventLogRecord.getStringData() to getMessage()

This commit is contained in:
Doug MacEachern 2005-09-24 00:24:49 +00:00
parent 80fa6f52eb
commit 67f3334250
2 changed files with 13 additions and 6 deletions

View File

@ -237,13 +237,13 @@ JNIEXPORT jobject SIGAR_JNI(win32_EventLog_readlog)
if ((get_messagefile_dll(name, source, dllfile) == ERROR_SUCCESS) &&
(get_formatted_message(pevlr, dllfile, msg) == ERROR_SUCCESS))
{
id = JENV->GetFieldID(env, cls, "stringData",
id = JENV->GetFieldID(env, cls, "message",
"Ljava/lang/String;");
SetStringField(env, eventObj, id, msg);
} else if (pevlr->StringOffset > 0) {
/* Work around some applications not using a message file */
char *tmp = (LPSTR)((LPBYTE)pevlr + pevlr->StringOffset);
id = JENV->GetFieldID(env, cls, "stringData", "Ljava/lang/String;");
id = JENV->GetFieldID(env, cls, "message", "Ljava/lang/String;");
SetStringField(env, eventObj, id, tmp);
}
JENV->ReleaseStringUTFChars(env, jname, name);

View File

@ -15,7 +15,7 @@ public class EventLogRecord {
String source;
String computerName;
String user;
String stringData;
String message;
/* Get the record number for this event entry */
public long getRecordNumber() {
@ -84,10 +84,17 @@ public class EventLogRecord {
}
/**
* Get the string data for the event. (The message)
* Get the message for the event.
*/
public String getMessage() {
return this.message;
}
/**
* @deprecated
*/
public String getStringData() {
return this.stringData;
return getMessage();
}
/**
@ -100,7 +107,7 @@ public class EventLogRecord {
"source=" + source + " " +
"computerName=" + computerName + " " +
"user=" + user + " " +
"stringData=" + stringData;
"message=" + message;
}
}