Fixed @Reuse + @BufferObject generation.
This commit is contained in:
parent
84f28884c5
commit
485f5adca2
|
@ -75,19 +75,19 @@ public class JavaMethodsGenerator {
|
|||
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.CACHEDRESULT, generate_error_checks, context_specific);
|
||||
}
|
||||
|
||||
// Skip the native function if we're re-using.
|
||||
Reuse reuse_annotation = method.getAnnotation(Reuse.class);
|
||||
if ( reuse_annotation != null )
|
||||
return;
|
||||
|
||||
Alternate alt_annotation = method.getAnnotation(Alternate.class);
|
||||
if ( alt_annotation == null || (alt_annotation.nativeAlt() && !alt_annotation.skipNative()) ) {
|
||||
if ( alt_annotation != null && method.getSimpleName().equals(alt_annotation.value()) )
|
||||
throw new RuntimeException("An alternate function with native code should have a different name than the main function.");
|
||||
printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
|
||||
|
||||
if ( reuse_annotation == null )
|
||||
printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
|
||||
|
||||
if (Utils.hasMethodBufferObjectParameter(method)) {
|
||||
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.BUFFEROBJECT, generate_error_checks, context_specific);
|
||||
printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
|
||||
if ( reuse_annotation == null )
|
||||
printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue