Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu2013-07-30 08:14:54 -0400
committerArun Thondapu2013-07-30 13:20:40 -0400
commitcf7558133e9e953c3fd81604968f20b582949c42 (patch)
treeea14778b03f2319d36f3a8ba24c02cff35c4fccb
parentefebdbe09a31719b1891de21e18dce35fbb34134 (diff)
downloadeclipse.platform.swt-cf7558133e9e953c3fd81604968f20b582949c42.tar.gz
eclipse.platform.swt-cf7558133e9e953c3fd81604968f20b582949c42.tar.xz
eclipse.platform.swt-cf7558133e9e953c3fd81604968f20b582949c42.zip
Bug 320487 - Eclipse crashes when listing certain files (e.g. *.fl) in
project explorer
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java6
3 files changed, 10 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 00fdab5a7f..379bf159a9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -2669,23 +2669,23 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1data_1input_1stream_1new)
#ifndef NO__1g_1data_1input_1stream_1read_1line
JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1data_1input_1stream_1read_1line)
- (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintLong arg2, jintLong arg3)
+ (JNIEnv *env, jclass that, jintLong arg0, jlongArray arg1, jintLong arg2, jintLong arg3)
{
- jint *lparg1=NULL;
+ jlong *lparg1=NULL;
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, _1g_1data_1input_1stream_1read_1line_FUNC);
- if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ if (arg1) if ((lparg1 = (*env)->GetLongArrayElements(env, arg1, NULL)) == NULL) goto fail;
/*
rc = (jintLong)g_data_input_stream_read_line(arg0, lparg1, arg2, arg3);
*/
{
OS_LOAD_FUNCTION(fp, g_data_input_stream_read_line)
if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong, jint *, jintLong, jintLong))fp)(arg0, lparg1, arg2, arg3);
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong, jlong *, jintLong, jintLong))fp)(arg0, lparg1, arg2, arg3);
}
}
fail:
- if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
+ if (arg1 && lparg1) (*env)->ReleaseLongArrayElements(env, arg1, lparg1, 0);
OS_NATIVE_EXIT(env, that, _1g_1data_1input_1stream_1read_1line_FUNC);
return rc;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 898301c6d2..722ebee19b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -2017,8 +2017,8 @@ public static final long /*int*/ g_data_input_stream_new(long /*int*/ input_stre
}
}
/** @method flags=dynamic */
-public static final native long /*int*/ _g_data_input_stream_read_line(long /*int*/ stream, int[] count, long /*int*/ cancellable, long /*int*/ error);
-public static final long /*int*/ g_data_input_stream_read_line(long /*int*/ stream, int[] count, long /*int*/ cancellable, long /*int*/ error) {
+public static final native long /*int*/ _g_data_input_stream_read_line(long /*int*/ stream, long[] count, long /*int*/ cancellable, long /*int*/ error);
+public static final long /*int*/ g_data_input_stream_read_line(long /*int*/ stream, long[] count, long /*int*/ cancellable, long /*int*/ error) {
lock.lock();
try {
return _g_data_input_stream_read_line(stream, count, cancellable, error);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
index 9d209316ba..ded302c8ba 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
@@ -690,13 +690,13 @@ static Hashtable gio_getMimeInfo() {
mimeTable = new Hashtable();
modTime = modTimestamp[0];
long /*int*/ reader = OS.g_data_input_stream_new (fileInputStream);
- int[] length = new int[1];
+ long[] length = new long[1];
if (reader != 0) {
long /*int*/ linePtr = OS.g_data_input_stream_read_line (reader, length, 0, 0);
while (linePtr != 0) {
- byte[] lineBytes = new byte[length[0]];
- OS.memmove(lineBytes, linePtr, length[0]);
+ byte[] lineBytes = new byte[(int) length[0]];
+ OS.memmove(lineBytes, linePtr, (int) length[0]);
String line = new String (Converter.mbcsToWcs (null, lineBytes));
int separatorIndex = line.indexOf (':');

Back to the top