`OS.beginSheetModalForWindow` is declared `void` in Java and `jlong` in the entry
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- java, objective-c
- Área
- desktop
Línea de trabajo
Compara la declaración nativa en OS.java con la entrada beginSheetModalForWindow en os_custom.c, empezando por los puntos de llamada del wrapper de Java en DirectoryDialog, FileDialog y MessageBox. Decide qué tipo de retorno se pretende, haz que ambos lados sean coherentes y ejecuta las pruebas de SWT Cocoa o las comprobaciones de compilación pertinentes para confirmar que el binding nativo sigue siendo utilizable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
OS.java declares:
public static native void beginSheetModalForWindow(long id, long sel, long window, long handler);
and the entry in os_custom.c declares and returns a jlong:
JNIEXPORT jlong JNICALL OS_NATIVE(beginSheetModalForWindow)
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, FunctionPointer arg3)
{
jlong rc = 0;
OS_NATIVE_ENTER(env, that, beginSheetModalForWindow_FUNC);
rc = (jlong)((jlong (*)(jlong, jlong, jlong, void (^)(jlong)))objc_msgSend)(arg0, arg1, arg2, functionToBlock(arg3));
OS_NATIVE_EXIT(env, that, beginSheetModalForWindow_FUNC);
return rc;
}
The VM binds these by name and the mangled symbol carries no return type, so nothing on either side checks that they agree: javac sees only the Java declaration, the C compiler only the definition.
I have not observed any misbehaviour from this and would not expect to. On the ABIs SWT targets the callee writes a return register that a void caller ignores, and rc is unobservable from Java in any case, since DirectoryDialog, FileDialog and MessageBox all call the wrapper as a statement. So this is a JNI signature mismatch rather than a wrong value.
It seems worth mentioning because it looks unintentional and it is isolated: comparing every native declaration in the tree against the return type its own entry declares, this is the only pair that disagrees, out of 3110 comparable pairs at one commit I checked and 2957 at another.
The fix is presumably to declare the entry void and drop rc, unless the value is meant to reach Java, in which case the Java declaration is the side to change.
Checked against master at 3e3b24b4. Found as part of a research project.
- Lenguaje dominante
- Java
- Estrellas
- 202
- Forks
- 206
- Merge medio
- 14 h 7 min
- PR fusionados (30 d)
- 103
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eclipse-platform/eclipse.platform.swt
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
eclipse-platform/eclipse.platform.swt#3717 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.swt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
objectionary/lints#1556 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
wildfly/wildfly-launcher#99 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
apache/rocketmq#11427 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
A failed JNA download is reported as a corrupt zip, because `curl` in `Makefile` lacks `--fail`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
objectionary/phino#1884 · 1 comentario ·
Los mantenedores suelen responder en 1 día