Commit b4d8d0f1 authored by Chris Simmons's avatar Chris Simmons Committed by Xianwen Chen

Optionally generate interfaces in Java when possible (#288)

* Merge mrdomino's Java interface change with a more recent version of the repo.

* Make generating interfaces instead of abstract classes optional.

* Allow generation of Java interfaces when the Djinni interface is a +c interface and when the Djinni interface includes constants.

* Also omit "public" from constants in a Java interface.

* Revert "Also omit "public" from constants in a Java interface."

This reverts commit a4245b35d84150d9c2c51781780dc68318bf48a6.

* Omit "public" from constants in a Java interface.

* If Java interfaces were requested, generate them regardless of whether the interfaces include static methods.

* Keep CppProxy private if not generating interfaces.

* Change the java tests' target java version to 1.8.

* Place static natic methods in an inner class.

* Remove the StaticNative class and just use CppProxy.

* Minor edits.

* Don't use  --java-generate-interfaces in the yaml test, in order to exercise the code that runs when  --java-generate-interfaces isn't used.

* Revert "Don't use  --java-generate-interfaces in the yaml test, in order to exercise the code that runs when  --java-generate-interfaces isn't used."

This reverts commit cd86c27df026193fe497918eadd064e39076d606.

* Build the example Android project with Java 8.
parent e1dd18e5
......@@ -10,6 +10,12 @@ android {
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
......
......@@ -7,18 +7,24 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/*package*/ abstract class SortItems {
/*package*/ interface SortItems {
/** For the iOS / Android demo */
public abstract void sort(@Nonnull SortOrder order, @Nonnull ItemList items);
public void sort(@Nonnull SortOrder order, @Nonnull ItemList items);
@CheckForNull
public static native SortItems createWithListener(@CheckForNull TextboxListener listener);
public static SortItems createWithListener(@CheckForNull TextboxListener listener)
{
return CppProxy.createWithListener(listener);
}
/** For the localhost / command-line demo */
@Nonnull
public static native ItemList runSort(@Nonnull ItemList items);
public static ItemList runSort(@Nonnull ItemList items)
{
return CppProxy.runSort(items);
}
private static final class CppProxy extends SortItems
static final class CppProxy implements SortItems
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -48,5 +54,11 @@ import javax.annotation.Nonnull;
native_sort(this.nativeRef, order, items);
}
private native void native_sort(long _nativeRef, SortOrder order, ItemList items);
@CheckForNull
public static native SortItems createWithListener(@CheckForNull TextboxListener listener);
@Nonnull
public static native ItemList runSort(@Nonnull ItemList items);
}
}
......@@ -6,6 +6,6 @@ package com.dropbox.textsort;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/*package*/ abstract class TextboxListener {
public abstract void update(@Nonnull ItemList items);
/*package*/ interface TextboxListener {
public void update(@Nonnull ItemList items);
}
......@@ -31,7 +31,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_textsort_SortItems_00024CppProxy_native
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_textsort_SortItems_createWithListener(JNIEnv* jniEnv, jobject /*this*/, jobject j_listener)
CJNIEXPORT jobject JNICALL Java_com_dropbox_textsort_SortItems_00024CppProxy_createWithListener(JNIEnv* jniEnv, jobject /*this*/, jobject j_listener)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -40,7 +40,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_textsort_SortItems_createWithListene
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_textsort_SortItems_runSort(JNIEnv* jniEnv, jobject /*this*/, jobject j_items)
CJNIEXPORT jobject JNICALL Java_com_dropbox_textsort_SortItems_00024CppProxy_runSort(JNIEnv* jniEnv, jobject /*this*/, jobject j_items)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -4,7 +4,7 @@ import android.widget.EditText;
import java.util.ArrayList;
public class TextboxListenerImpl extends TextboxListener {
public class TextboxListenerImpl implements TextboxListener {
private EditText mTextArea;
......
......@@ -54,6 +54,7 @@ fi
--java-out "$temp_out/java" \
--java-package $java_package \
--java-class-access-modifier "package" \
--java-generate-interfaces true \
--java-nullable-annotation "javax.annotation.CheckForNull" \
--java-nonnull-annotation "javax.annotation.Nonnull" \
--ident-java-field mFooBar \
......
......@@ -330,7 +330,7 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
val methodNameMunged = name.replaceAllLiterally("_", "_1")
val zero = ret.fold("")(s => "0 /* value doesn't matter */")
if (static) {
w.wl(s"CJNIEXPORT $jniRetType JNICALL ${prefix}_$methodNameMunged(JNIEnv* jniEnv, jobject /*this*/${preComma(paramList)})").braced {
w.wl(s"CJNIEXPORT $jniRetType JNICALL ${prefix}_00024CppProxy_$methodNameMunged(JNIEnv* jniEnv, jobject /*this*/${preComma(paramList)})").braced {
w.w("try").bracedEnd(s" JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, $zero)") {
w.wl(s"DJINNI_FUNCTION_PROLOGUE0(jniEnv);")
f
......
......@@ -64,7 +64,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
})
}
def generateJavaConstants(w: IndentWriter, consts: Seq[Const]) = {
def generateJavaConstants(w: IndentWriter, consts: Seq[Const], forJavaInterface: Boolean) = {
def writeJavaConst(w: IndentWriter, ty: TypeRef, v: Any): Unit = v match {
case l: Long if marshal.fieldType(ty).equalsIgnoreCase("long") => w.w(l.toString + "l")
......@@ -97,7 +97,11 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
writeDoc(w, c.doc)
javaAnnotationHeader.foreach(w.wl)
marshal.nullityAnnotation(c.ty).foreach(w.wl)
w.w(s"public static final ${marshal.fieldType(c.ty)} ${idJava.const(c.ident)} = ")
// If the constants are part of a Java interface, omit the "public," "static,"
// and "final" specifiers.
val publicStaticFinalString = if (forJavaInterface) "" else "public static final "
w.w(s"${publicStaticFinalString}${marshal.fieldType(c.ty)} ${idJava.const(c.ident)} = ")
writeJavaConst(w, c.ty, c.value)
w.wl(";")
w.wl
......@@ -140,9 +144,16 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
writeDoc(w, doc)
javaAnnotationHeader.foreach(w.wl)
w.w(s"${javaClassAccessModifierString}abstract class $javaClass$typeParamList").braced {
// Generate an interface or an abstract class depending on whether the use
// of Java interfaces was requested.
val classPrefix = if (spec.javaGenerateInterfaces) "interface" else "abstract class"
val methodPrefix = if (spec.javaGenerateInterfaces) "" else "abstract "
val extendsKeyword = if (spec.javaGenerateInterfaces) "implements" else "extends"
val innerClassAccessibility = if (spec.javaGenerateInterfaces) "" else "private "
w.w(s"${javaClassAccessModifierString}$classPrefix $javaClass$typeParamList").braced {
val skipFirst = SkipFirst()
generateJavaConstants(w, i.consts)
generateJavaConstants(w, i.consts, spec.javaGenerateInterfaces)
val throwException = spec.javaCppException.fold("")(" throws " + _)
for (m <- i.methods if !m.static) {
......@@ -154,23 +165,32 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
nullityAnnotation + marshal.paramType(p.ty) + " " + idJava.local(p.ident)
})
marshal.nullityAnnotation(m.ret).foreach(w.wl)
w.wl("public abstract " + ret + " " + idJava.method(m.ident) + params.mkString("(", ", ", ")") + throwException + ";")
w.wl(s"public $methodPrefix" + ret + " " + idJava.method(m.ident) + params.mkString("(", ", ", ")") + throwException + ";")
}
// Implement the interface's static methods as calls to CppProxy's corresponding methods.
for (m <- i.methods if m.static) {
skipFirst { w.wl }
writeMethodDoc(w, m, idJava.local)
val ret = marshal.returnType(m.ret)
val returnPrefix = if (ret == "void") "" else "return "
val params = m.params.map(p => {
val nullityAnnotation = marshal.nullityAnnotation(p.ty).map(_ + " ").getOrElse("")
nullityAnnotation + marshal.paramType(p.ty) + " " + idJava.local(p.ident)
})
val meth = idJava.method(m.ident)
marshal.nullityAnnotation(m.ret).foreach(w.wl)
w.wl("public static native "+ ret + " " + idJava.method(m.ident) + params.mkString("(", ", ", ")") + ";")
w.wl("public static "+ ret + " " + idJava.method(m.ident) + params.mkString("(", ", ", ")")).braced {
writeAlignedCall(w, s"${returnPrefix}CppProxy.${meth}(", m.params, ");", p => idJava.local(p.ident))
w.wl
}
}
if (i.ext.cpp) {
w.wl
javaAnnotationHeader.foreach(w.wl)
w.wl(s"private static final class CppProxy$typeParamList extends $javaClass$typeParamList").braced {
w.wl(s"${innerClassAccessibility}static final class CppProxy$typeParamList $extendsKeyword $javaClass$typeParamList").braced {
w.wl("private final long nativeRef;")
w.wl("private final AtomicBoolean destroyed = new AtomicBoolean(false);")
w.wl
......@@ -188,7 +208,9 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
w.wl("_djinni_private_destroy();")
w.wl("super.finalize();")
}
for (m <- i.methods if !m.static) { // Static methods not in CppProxy
// Implement the interface's non-static methods.
for (m <- i.methods if !m.static) {
val ret = marshal.returnType(m.ret)
val returnStmt = m.ret.fold("")(_ => "return ")
val params = m.params.map(p => marshal.paramType(p.ty) + " " + idJava.local(p.ident)).mkString(", ")
......@@ -202,6 +224,18 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
}
w.wl(s"private native $ret native_$meth(long _nativeRef${preComma(params)});")
}
// Declare a native method for each of the interface's static methods.
for (m <- i.methods if m.static) {
skipFirst { w.wl }
val ret = marshal.returnType(m.ret)
val params = m.params.map(p => {
val nullityAnnotation = marshal.nullityAnnotation(p.ty).map(_ + " ").getOrElse("")
nullityAnnotation + marshal.paramType(p.ty) + " " + idJava.local(p.ident)
})
marshal.nullityAnnotation(m.ret).foreach(w.wl)
w.wl("public static native "+ ret + " " + idJava.method(m.ident) + params.mkString("(", ", ", ")") + ";")
}
}
}
}
......@@ -228,7 +262,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
val implementsSection = if (interfaces.isEmpty) "" else " implements " + interfaces.mkString(", ")
w.w(s"${javaClassAccessModifierString}${javaFinal}class ${self + javaTypeParams(params)}$implementsSection").braced {
w.wl
generateJavaConstants(w, r.consts)
generateJavaConstants(w, r.consts, false)
// Field definitions.
for (f <- r.fields) {
w.wl
......
......@@ -42,6 +42,7 @@ object Main {
var javaClassAccessModifier: JavaAccessModifier.Value = JavaAccessModifier.Public
var javaCppException: Option[String] = None
var javaAnnotation: Option[String] = None
var javaGenerateInterfaces: Boolean = false
var javaNullableAnnotation: Option[String] = None
var javaNonnullAnnotation: Option[String] = None
var javaImplementAndroidOsParcelable : Boolean = false
......@@ -82,7 +83,7 @@ object Main {
var yamlOutFolder: Option[File] = None
var yamlOutFile: Option[String] = None
var yamlPrefix: String = ""
val argParser = new scopt.OptionParser[Unit]("djinni") {
def identStyle(optionName: String, update: IdentConverter => Unit) = {
......@@ -111,6 +112,8 @@ object Main {
.text("The type for translated C++ exceptions in Java (default: java.lang.RuntimeException that is not checked)")
opt[String]("java-annotation").valueName("<annotation-class>").foreach(x => javaAnnotation = Some(x))
.text("Java annotation (@Foo) to place on all generated Java classes")
opt[Boolean]("java-generate-interfaces").valueName("<true/false>").foreach(x => javaGenerateInterfaces = x)
.text("Whether Java interfaces should be used instead of abstract classes where possible (default: false).")
opt[String]("java-nullable-annotation").valueName("<nullable-annotation-class>").foreach(x => javaNullableAnnotation = Some(x))
.text("Java annotation (@Nullable) to place on all fields and return values that are optional")
opt[String]("java-nonnull-annotation").valueName("<nonnull-annotation-class>").foreach(x => javaNonnullAnnotation = Some(x))
......@@ -304,6 +307,7 @@ object Main {
javaIdentStyle,
javaCppException,
javaAnnotation,
javaGenerateInterfaces,
javaNullableAnnotation,
javaNonnullAnnotation,
javaImplementAndroidOsParcelable,
......
......@@ -35,6 +35,7 @@ package object generatorTools {
javaIdentStyle: JavaIdentStyle,
javaCppException: Option[String],
javaAnnotation: Option[String],
javaGenerateInterfaces: Boolean,
javaNullableAnnotation: Option[String],
javaNonnullAnnotation: Option[String],
javaImplementAndroidOsParcelable: Boolean,
......
......@@ -7,19 +7,19 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Client interface */
public abstract class ClientInterface {
public interface ClientInterface {
/** Returns record of given string */
@Nonnull
public abstract ClientReturnedRecord getRecord(long recordId, @Nonnull String utf8string, @CheckForNull String misc);
public ClientReturnedRecord getRecord(long recordId, @Nonnull String utf8string, @CheckForNull String misc);
public abstract double identifierCheck(@Nonnull byte[] data, int r, long jret);
public double identifierCheck(@Nonnull byte[] data, int r, long jret);
@Nonnull
public abstract String returnStr();
public String returnStr();
@Nonnull
public abstract String methTakingInterface(@CheckForNull ClientInterface i);
public String methTakingInterface(@CheckForNull ClientInterface i);
@Nonnull
public abstract String methTakingOptionalInterface(@CheckForNull ClientInterface i);
public String methTakingOptionalInterface(@CheckForNull ClientInterface i);
}
......@@ -11,9 +11,9 @@ import javax.annotation.Nonnull;
* Test for conflict of method name with an interface name.
* See the comments about scopeSymbols in CppMarshal.scala for more info.
*/
public abstract class Conflict {
public interface Conflict {
private static final class CppProxy extends Conflict
static final class CppProxy implements Conflict
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -8,13 +8,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class ConflictUser {
public interface ConflictUser {
@CheckForNull
public abstract Conflict Conflict();
public Conflict Conflict();
public abstract boolean conflictArg(@Nonnull HashSet<Conflict> cs);
public boolean conflictArg(@Nonnull HashSet<Conflict> cs);
private static final class CppProxy extends ConflictUser
static final class CppProxy implements ConflictUser
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -8,42 +8,42 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Interface containing constants */
public abstract class ConstantsInterface {
public static final boolean BOOL_CONSTANT = true;
public interface ConstantsInterface {
boolean BOOL_CONSTANT = true;
public static final byte I8_CONSTANT = 1;
byte I8_CONSTANT = 1;
public static final short I16_CONSTANT = 2;
short I16_CONSTANT = 2;
/** i32_constant has documentation. */
public static final int I32_CONSTANT = 3;
int I32_CONSTANT = 3;
/**
* i64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public static final long I64_CONSTANT = 4l;
long I64_CONSTANT = 4l;
public static final float F32_CONSTANT = 5.0f;
float F32_CONSTANT = 5.0f;
public static final double F64_CONSTANT = 5.0;
double F64_CONSTANT = 5.0;
@CheckForNull
public static final Boolean OPT_BOOL_CONSTANT = true;
Boolean OPT_BOOL_CONSTANT = true;
@CheckForNull
public static final Byte OPT_I8_CONSTANT = 1;
Byte OPT_I8_CONSTANT = 1;
/** opt_i16_constant has documentation. */
@CheckForNull
public static final Short OPT_I16_CONSTANT = 2;
Short OPT_I16_CONSTANT = 2;
@CheckForNull
public static final Integer OPT_I32_CONSTANT = 3;
Integer OPT_I32_CONSTANT = 3;
@CheckForNull
public static final Long OPT_I64_CONSTANT = 4l;
Long OPT_I64_CONSTANT = 4l;
/**
* opt_f32_constant has long documentation.
......@@ -51,19 +51,19 @@ public abstract class ConstantsInterface {
* Indented third line of multi-line documentation.)
*/
@CheckForNull
public static final Float OPT_F32_CONSTANT = 5.0f;
Float OPT_F32_CONSTANT = 5.0f;
@CheckForNull
public static final Double OPT_F64_CONSTANT = 5.0;
Double OPT_F64_CONSTANT = 5.0;
@Nonnull
public static final String STRING_CONSTANT = "string-constant";
String STRING_CONSTANT = "string-constant";
@CheckForNull
public static final String OPT_STRING_CONSTANT = "string-constant";
String OPT_STRING_CONSTANT = "string-constant";
@Nonnull
public static final ConstantRecord OBJECT_CONSTANT = new ConstantRecord(
ConstantRecord OBJECT_CONSTANT = new ConstantRecord(
I32_CONSTANT /* mSomeInteger */ ,
STRING_CONSTANT /* mSomeString */ );
......@@ -72,9 +72,9 @@ public abstract class ConstantsInterface {
* No support for optional constant records
* No support for constant binary, list, set, map
*/
public abstract void dummy();
public void dummy();
private static final class CppProxy extends ConstantsInterface
static final class CppProxy implements ConstantsInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -7,13 +7,16 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class CppException {
public abstract int throwAnException();
public interface CppException {
public int throwAnException();
@CheckForNull
public static native CppException get();
public static CppException get()
{
return CppProxy.get();
}
private static final class CppProxy extends CppException
static final class CppProxy implements CppException
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -43,5 +46,8 @@ public abstract class CppException {
return native_throwAnException(this.nativeRef);
}
private native int native_throwAnException(long _nativeRef);
@CheckForNull
public static native CppException get();
}
}
......@@ -10,23 +10,23 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class EnumUsageInterface {
public interface EnumUsageInterface {
@Nonnull
public abstract Color e(@Nonnull Color e);
public Color e(@Nonnull Color e);
@CheckForNull
public abstract Color o(@CheckForNull Color o);
public Color o(@CheckForNull Color o);
@Nonnull
public abstract ArrayList<Color> l(@Nonnull ArrayList<Color> l);
public ArrayList<Color> l(@Nonnull ArrayList<Color> l);
@Nonnull
public abstract HashSet<Color> s(@Nonnull HashSet<Color> s);
public HashSet<Color> s(@Nonnull HashSet<Color> s);
@Nonnull
public abstract HashMap<Color, Color> m(@Nonnull HashMap<Color, Color> m);
public HashMap<Color, Color> m(@Nonnull HashMap<Color, Color> m);
private static final class CppProxy extends EnumUsageInterface
static final class CppProxy implements EnumUsageInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -5,10 +5,10 @@ package com.dropbox.djinni.test;
import java.util.concurrent.atomic.AtomicBoolean;
public abstract class ExternInterface1 {
public abstract com.dropbox.djinni.test.ClientReturnedRecord foo(com.dropbox.djinni.test.ClientInterface i);
public interface ExternInterface1 {
public com.dropbox.djinni.test.ClientReturnedRecord foo(com.dropbox.djinni.test.ClientInterface i);
private static final class CppProxy extends ExternInterface1
static final class CppProxy implements ExternInterface1
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -3,6 +3,6 @@
package com.dropbox.djinni.test;
public abstract class ExternInterface2 {
public abstract ExternRecordWithDerivings foo(com.dropbox.djinni.test.TestHelpers i);
public interface ExternInterface2 {
public ExternRecordWithDerivings foo(com.dropbox.djinni.test.TestHelpers i);
}
......@@ -7,6 +7,6 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Used for ObjC multiple inheritance tests */
public abstract class FirstListener {
public abstract void first();
public interface FirstListener {
public void first();
}
......@@ -8,20 +8,32 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class FlagRoundtrip {
public interface FlagRoundtrip {
@Nonnull
public static native EnumSet<AccessFlags> roundtripAccess(@Nonnull EnumSet<AccessFlags> flag);
public static EnumSet<AccessFlags> roundtripAccess(@Nonnull EnumSet<AccessFlags> flag)
{
return CppProxy.roundtripAccess(flag);
}
@Nonnull
public static native EnumSet<EmptyFlags> roundtripEmpty(@Nonnull EnumSet<EmptyFlags> flag);
public static EnumSet<EmptyFlags> roundtripEmpty(@Nonnull EnumSet<EmptyFlags> flag)
{
return CppProxy.roundtripEmpty(flag);
}
@CheckForNull
public static native EnumSet<AccessFlags> roundtripAccessBoxed(@CheckForNull EnumSet<AccessFlags> flag);
public static EnumSet<AccessFlags> roundtripAccessBoxed(@CheckForNull EnumSet<AccessFlags> flag)
{
return CppProxy.roundtripAccessBoxed(flag);
}
@CheckForNull
public static native EnumSet<EmptyFlags> roundtripEmptyBoxed(@CheckForNull EnumSet<EmptyFlags> flag);
public static EnumSet<EmptyFlags> roundtripEmptyBoxed(@CheckForNull EnumSet<EmptyFlags> flag)
{
return CppProxy.roundtripEmptyBoxed(flag);
}
private static final class CppProxy extends FlagRoundtrip
static final class CppProxy implements FlagRoundtrip
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -43,5 +55,17 @@ public abstract class FlagRoundtrip {
_djinni_private_destroy();
super.finalize();
}
@Nonnull
public static native EnumSet<AccessFlags> roundtripAccess(@Nonnull EnumSet<AccessFlags> flag);
@Nonnull
public static native EnumSet<EmptyFlags> roundtripEmpty(@Nonnull EnumSet<EmptyFlags> flag);
@CheckForNull
public static native EnumSet<AccessFlags> roundtripAccessBoxed(@CheckForNull EnumSet<AccessFlags> flag);
@CheckForNull
public static native EnumSet<EmptyFlags> roundtripEmptyBoxed(@CheckForNull EnumSet<EmptyFlags> flag);
}
}
......@@ -7,16 +7,16 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class InterfaceUsingExtendedRecord {
public interface InterfaceUsingExtendedRecord {
@Nonnull
public static final RecordUsingExtendedRecord CR = new RecordUsingExtendedRecord(
RecordUsingExtendedRecord CR = new RecordUsingExtendedRecord(
new ExtendedRecord(
false /* mFoo */ ) /* mEr */ );
@Nonnull
public abstract ExtendedRecord meth(@Nonnull ExtendedRecord er);
public ExtendedRecord meth(@Nonnull ExtendedRecord er);
private static final class CppProxy extends InterfaceUsingExtendedRecord
static final class CppProxy implements InterfaceUsingExtendedRecord
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -6,5 +6,5 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class JavaOnlyListener {
public interface JavaOnlyListener {
}
......@@ -13,15 +13,19 @@ import javax.annotation.Nonnull;
* languages, due to the details of multiple inheritance and object
* comparison.
*/
public abstract class ListenerCaller {
public abstract void callFirst();
public interface ListenerCaller {
public void callFirst();
public abstract void callSecond();
public void callSecond();
@CheckForNull
public static native ListenerCaller init(@CheckForNull FirstListener firstL, @CheckForNull SecondListener secondL);
public static ListenerCaller init(@CheckForNull FirstListener firstL, @CheckForNull SecondListener secondL)
{
return CppProxy.init(firstL,
secondL);
}
private static final class CppProxy extends ListenerCaller
static final class CppProxy implements ListenerCaller
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -59,5 +63,8 @@ public abstract class ListenerCaller {
native_callSecond(this.nativeRef);
}
private native void native_callSecond(long _nativeRef);
@CheckForNull
public static native ListenerCaller init(@CheckForNull FirstListener firstL, @CheckForNull SecondListener secondL);
}
}
......@@ -6,5 +6,5 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class ObjcOnlyListener {
public interface ObjcOnlyListener {
}
......@@ -8,13 +8,16 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Used for C++ multiple inheritance tests */
public abstract class ReturnOne {
public abstract byte returnOne();
public interface ReturnOne {
public byte returnOne();
@CheckForNull
public static native ReturnOne getInstance();
public static ReturnOne getInstance()
{
return CppProxy.getInstance();
}
private static final class CppProxy extends ReturnOne
static final class CppProxy implements ReturnOne
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -44,5 +47,8 @@ public abstract class ReturnOne {
return native_returnOne(this.nativeRef);
}
private native byte native_returnOne(long _nativeRef);
@CheckForNull
public static native ReturnOne getInstance();
}
}
......@@ -8,13 +8,16 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Used for C++ multiple inheritance tests */
public abstract class ReturnTwo {
public abstract byte returnTwo();
public interface ReturnTwo {
public byte returnTwo();
@CheckForNull
public static native ReturnTwo getInstance();
public static ReturnTwo getInstance()
{
return CppProxy.getInstance();
}
private static final class CppProxy extends ReturnTwo
static final class CppProxy implements ReturnTwo
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -44,5 +47,8 @@ public abstract class ReturnTwo {
return native_returnTwo(this.nativeRef);
}
private native byte native_returnTwo(long _nativeRef);
@CheckForNull
public static native ReturnTwo getInstance();
}
}
......@@ -7,20 +7,23 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class ReverseClientInterface {
public interface ReverseClientInterface {
@Nonnull
public abstract String returnStr();
public String returnStr();
@Nonnull
public abstract String methTakingInterface(@CheckForNull ReverseClientInterface i);
public String methTakingInterface(@CheckForNull ReverseClientInterface i);
@Nonnull
public abstract String methTakingOptionalInterface(@CheckForNull ReverseClientInterface i);
public String methTakingOptionalInterface(@CheckForNull ReverseClientInterface i);
@CheckForNull
public static native ReverseClientInterface create();
public static ReverseClientInterface create()
{
return CppProxy.create();
}
private static final class CppProxy extends ReverseClientInterface
static final class CppProxy implements ReverseClientInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -66,5 +69,8 @@ public abstract class ReverseClientInterface {
return native_methTakingOptionalInterface(this.nativeRef, i);
}
private native String native_methTakingOptionalInterface(long _nativeRef, ReverseClientInterface i);
@CheckForNull
public static native ReverseClientInterface create();
}
}
......@@ -7,6 +7,6 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Used for ObjC multiple inheritance tests */
public abstract class SecondListener {
public abstract void second();
public interface SecondListener {
public void second();
}
......@@ -7,67 +7,127 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class TestDuration {
public interface TestDuration {
@Nonnull
public static native String hoursString(@Nonnull java.time.Duration dt);
public static String hoursString(@Nonnull java.time.Duration dt)
{
return CppProxy.hoursString(dt);
}
@Nonnull
public static native String minutesString(@Nonnull java.time.Duration dt);
public static String minutesString(@Nonnull java.time.Duration dt)
{
return CppProxy.minutesString(dt);
}
@Nonnull
public static native String secondsString(@Nonnull java.time.Duration dt);
public static String secondsString(@Nonnull java.time.Duration dt)
{
return CppProxy.secondsString(dt);
}
@Nonnull
public static native String millisString(@Nonnull java.time.Duration dt);
public static String millisString(@Nonnull java.time.Duration dt)
{
return CppProxy.millisString(dt);
}
@Nonnull
public static native String microsString(@Nonnull java.time.Duration dt);
public static String microsString(@Nonnull java.time.Duration dt)
{
return CppProxy.microsString(dt);
}
@Nonnull
public static native String nanosString(@Nonnull java.time.Duration dt);
public static String nanosString(@Nonnull java.time.Duration dt)
{
return CppProxy.nanosString(dt);
}
@Nonnull
public static native java.time.Duration hours(int count);
public static java.time.Duration hours(int count)
{
return CppProxy.hours(count);
}
@Nonnull
public static native java.time.Duration minutes(int count);
public static java.time.Duration minutes(int count)
{
return CppProxy.minutes(count);
}
@Nonnull
public static native java.time.Duration seconds(int count);
public static java.time.Duration seconds(int count)
{
return CppProxy.seconds(count);
}
@Nonnull
public static native java.time.Duration millis(int count);
public static java.time.Duration millis(int count)
{
return CppProxy.millis(count);
}
@Nonnull
public static native java.time.Duration micros(int count);
public static java.time.Duration micros(int count)
{
return CppProxy.micros(count);
}
@Nonnull
public static native java.time.Duration nanos(int count);
public static java.time.Duration nanos(int count)
{
return CppProxy.nanos(count);
}
@Nonnull
public static native java.time.Duration hoursf(double count);
public static java.time.Duration hoursf(double count)
{
return CppProxy.hoursf(count);
}
@Nonnull
public static native java.time.Duration minutesf(double count);
public static java.time.Duration minutesf(double count)
{
return CppProxy.minutesf(count);
}
@Nonnull
public static native java.time.Duration secondsf(double count);
public static java.time.Duration secondsf(double count)
{
return CppProxy.secondsf(count);
}
@Nonnull
public static native java.time.Duration millisf(double count);
public static java.time.Duration millisf(double count)
{
return CppProxy.millisf(count);
}
@Nonnull
public static native java.time.Duration microsf(double count);
public static java.time.Duration microsf(double count)
{
return CppProxy.microsf(count);
}
@Nonnull
public static native java.time.Duration nanosf(double count);
public static java.time.Duration nanosf(double count)
{
return CppProxy.nanosf(count);
}
@CheckForNull
public static native java.time.Duration box(long count);
public static java.time.Duration box(long count)
{
return CppProxy.box(count);
}
public static native long unbox(@CheckForNull java.time.Duration dt);
public static long unbox(@CheckForNull java.time.Duration dt)
{
return CppProxy.unbox(dt);
}
private static final class CppProxy extends TestDuration
static final class CppProxy implements TestDuration
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -89,5 +149,64 @@ public abstract class TestDuration {
_djinni_private_destroy();
super.finalize();
}
@Nonnull
public static native String hoursString(@Nonnull java.time.Duration dt);
@Nonnull
public static native String minutesString(@Nonnull java.time.Duration dt);
@Nonnull
public static native String secondsString(@Nonnull java.time.Duration dt);
@Nonnull
public static native String millisString(@Nonnull java.time.Duration dt);
@Nonnull
public static native String microsString(@Nonnull java.time.Duration dt);
@Nonnull
public static native String nanosString(@Nonnull java.time.Duration dt);
@Nonnull
public static native java.time.Duration hours(int count);
@Nonnull
public static native java.time.Duration minutes(int count);
@Nonnull
public static native java.time.Duration seconds(int count);
@Nonnull
public static native java.time.Duration millis(int count);
@Nonnull
public static native java.time.Duration micros(int count);
@Nonnull
public static native java.time.Duration nanos(int count);
@Nonnull
public static native java.time.Duration hoursf(double count);
@Nonnull
public static native java.time.Duration minutesf(double count);
@Nonnull
public static native java.time.Duration secondsf(double count);
@Nonnull
public static native java.time.Duration millisf(double count);
@Nonnull
public static native java.time.Duration microsf(double count);
@Nonnull
public static native java.time.Duration nanosf(double count);
@CheckForNull
public static native java.time.Duration box(long count);
public static native long unbox(@CheckForNull java.time.Duration dt);
}
}
......@@ -13,76 +13,152 @@ import javax.annotation.Nonnull;
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public abstract class TestHelpers {
public interface TestHelpers {
/** Method with documentation */
@Nonnull
public static native SetRecord getSetRecord();
public static SetRecord getSetRecord()
{
return CppProxy.getSetRecord();
}
/**
* Method with long documentation
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public static native boolean checkSetRecord(@Nonnull SetRecord rec);
public static boolean checkSetRecord(@Nonnull SetRecord rec)
{
return CppProxy.checkSetRecord(rec);
}
@Nonnull
public static native PrimitiveList getPrimitiveList();
public static PrimitiveList getPrimitiveList()
{
return CppProxy.getPrimitiveList();
}
public static native boolean checkPrimitiveList(@Nonnull PrimitiveList pl);
public static boolean checkPrimitiveList(@Nonnull PrimitiveList pl)
{
return CppProxy.checkPrimitiveList(pl);
}
@Nonnull
public static native NestedCollection getNestedCollection();
public static NestedCollection getNestedCollection()
{
return CppProxy.getNestedCollection();
}
public static native boolean checkNestedCollection(@Nonnull NestedCollection nc);
public static boolean checkNestedCollection(@Nonnull NestedCollection nc)
{
return CppProxy.checkNestedCollection(nc);
}
@Nonnull
public static native HashMap<String, Long> getMap();
public static HashMap<String, Long> getMap()
{
return CppProxy.getMap();
}
public static native boolean checkMap(@Nonnull HashMap<String, Long> m);
public static boolean checkMap(@Nonnull HashMap<String, Long> m)
{
return CppProxy.checkMap(m);
}
@Nonnull
public static native HashMap<String, Long> getEmptyMap();
public static HashMap<String, Long> getEmptyMap()
{
return CppProxy.getEmptyMap();
}
public static native boolean checkEmptyMap(@Nonnull HashMap<String, Long> m);
public static boolean checkEmptyMap(@Nonnull HashMap<String, Long> m)
{
return CppProxy.checkEmptyMap(m);
}
@Nonnull
public static native MapListRecord getMapListRecord();
public static MapListRecord getMapListRecord()
{
return CppProxy.getMapListRecord();
}
public static native boolean checkMapListRecord(@Nonnull MapListRecord m);
public static boolean checkMapListRecord(@Nonnull MapListRecord m)
{
return CppProxy.checkMapListRecord(m);
}
public static native void checkClientInterfaceAscii(@CheckForNull ClientInterface i);
public static void checkClientInterfaceAscii(@CheckForNull ClientInterface i)
{
CppProxy.checkClientInterfaceAscii(i);
}
public static native void checkClientInterfaceNonascii(@CheckForNull ClientInterface i);
public static void checkClientInterfaceNonascii(@CheckForNull ClientInterface i)
{
CppProxy.checkClientInterfaceNonascii(i);
}
public static native void checkClientInterfaceArgs(@CheckForNull ClientInterface i);
public static void checkClientInterfaceArgs(@CheckForNull ClientInterface i)
{
CppProxy.checkClientInterfaceArgs(i);
}
public static native void checkEnumMap(@Nonnull HashMap<Color, String> m);
public static void checkEnumMap(@Nonnull HashMap<Color, String> m)
{
CppProxy.checkEnumMap(m);
}
public static native void checkEnum(@Nonnull Color c);
public static void checkEnum(@Nonnull Color c)
{
CppProxy.checkEnum(c);
}
@CheckForNull
public static native UserToken tokenId(@CheckForNull UserToken t);
public static UserToken tokenId(@CheckForNull UserToken t)
{
return CppProxy.tokenId(t);
}
@CheckForNull
public static native UserToken createCppToken();
public static UserToken createCppToken()
{
return CppProxy.createCppToken();
}
public static native void checkCppToken(@CheckForNull UserToken t);
public static void checkCppToken(@CheckForNull UserToken t)
{
CppProxy.checkCppToken(t);
}
public static native long cppTokenId(@CheckForNull UserToken t);
public static long cppTokenId(@CheckForNull UserToken t)
{
return CppProxy.cppTokenId(t);
}
public static native void checkTokenType(@CheckForNull UserToken t, @Nonnull String type);
public static void checkTokenType(@CheckForNull UserToken t, @Nonnull String type)
{
CppProxy.checkTokenType(t,
type);
}
@CheckForNull
public static native Integer returnNone();
public static Integer returnNone()
{
return CppProxy.returnNone();
}
/** Ensures that we generate integer translation code */
@Nonnull
public static native AssortedPrimitives assortedPrimitivesId(@Nonnull AssortedPrimitives i);
public static AssortedPrimitives assortedPrimitivesId(@Nonnull AssortedPrimitives i)
{
return CppProxy.assortedPrimitivesId(i);
}
@Nonnull
public static native byte[] idBinary(@Nonnull byte[] b);
public static byte[] idBinary(@Nonnull byte[] b)
{
return CppProxy.idBinary(b);
}
private static final class CppProxy extends TestHelpers
static final class CppProxy implements TestHelpers
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -104,5 +180,66 @@ public abstract class TestHelpers {
_djinni_private_destroy();
super.finalize();
}
@Nonnull
public static native SetRecord getSetRecord();
public static native boolean checkSetRecord(@Nonnull SetRecord rec);
@Nonnull
public static native PrimitiveList getPrimitiveList();
public static native boolean checkPrimitiveList(@Nonnull PrimitiveList pl);
@Nonnull
public static native NestedCollection getNestedCollection();
public static native boolean checkNestedCollection(@Nonnull NestedCollection nc);
@Nonnull
public static native HashMap<String, Long> getMap();
public static native boolean checkMap(@Nonnull HashMap<String, Long> m);
@Nonnull
public static native HashMap<String, Long> getEmptyMap();
public static native boolean checkEmptyMap(@Nonnull HashMap<String, Long> m);
@Nonnull
public static native MapListRecord getMapListRecord();
public static native boolean checkMapListRecord(@Nonnull MapListRecord m);
public static native void checkClientInterfaceAscii(@CheckForNull ClientInterface i);
public static native void checkClientInterfaceNonascii(@CheckForNull ClientInterface i);
public static native void checkClientInterfaceArgs(@CheckForNull ClientInterface i);
public static native void checkEnumMap(@Nonnull HashMap<Color, String> m);
public static native void checkEnum(@Nonnull Color c);
@CheckForNull
public static native UserToken tokenId(@CheckForNull UserToken t);
@CheckForNull
public static native UserToken createCppToken();
public static native void checkCppToken(@CheckForNull UserToken t);
public static native long cppTokenId(@CheckForNull UserToken t);
public static native void checkTokenType(@CheckForNull UserToken t, @Nonnull String type);
@CheckForNull
public static native Integer returnNone();
@Nonnull
public static native AssortedPrimitives assortedPrimitivesId(@Nonnull AssortedPrimitives i);
@Nonnull
public static native byte[] idBinary(@Nonnull byte[] b);
}
}
......@@ -7,11 +7,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class UserToken {
public interface UserToken {
@Nonnull
public abstract String whoami();
public String whoami();
private static final class CppProxy extends UserToken
static final class CppProxy implements UserToken
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -11,18 +11,18 @@ import javax.annotation.Nonnull;
* Generating and compiling this makes sure other languages don't break
* on references to interfaces they don't need.
*/
public abstract class UsesSingleLanguageListeners {
public abstract void callForObjC(@CheckForNull ObjcOnlyListener l);
public interface UsesSingleLanguageListeners {
public void callForObjC(@CheckForNull ObjcOnlyListener l);
@CheckForNull
public abstract ObjcOnlyListener returnForObjC();
public ObjcOnlyListener returnForObjC();
public abstract void callForJava(@CheckForNull JavaOnlyListener l);
public void callForJava(@CheckForNull JavaOnlyListener l);
@CheckForNull
public abstract JavaOnlyListener returnForJava();
public JavaOnlyListener returnForJava();
private static final class CppProxy extends UsesSingleLanguageListeners
static final class CppProxy implements UsesSingleLanguageListeners
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -7,19 +7,19 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class VarnameInterface {
public interface VarnameInterface {
/**
* We should also rewrite parameter names in docstrings.
* RArg should be rewritten.
* _i_arg_ should not.
*/
@Nonnull
public abstract VarnameRecord Rmethod(@Nonnull VarnameRecord RArg);
public VarnameRecord Rmethod(@Nonnull VarnameRecord RArg);
@CheckForNull
public abstract VarnameInterface Imethod(@CheckForNull VarnameInterface IArg);
public VarnameInterface Imethod(@CheckForNull VarnameInterface IArg);
private static final class CppProxy extends VarnameInterface
static final class CppProxy implements VarnameInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......
......@@ -7,18 +7,30 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class WcharTestHelpers {
public interface WcharTestHelpers {
@Nonnull
public static native WcharTestRec getRecord();
public static WcharTestRec getRecord()
{
return CppProxy.getRecord();
}
@Nonnull
public static native String getString();
public static String getString()
{
return CppProxy.getString();
}
public static native boolean checkString(@Nonnull String str);
public static boolean checkString(@Nonnull String str)
{
return CppProxy.checkString(str);
}
public static native boolean checkRecord(@Nonnull WcharTestRec rec);
public static boolean checkRecord(@Nonnull WcharTestRec rec)
{
return CppProxy.checkRecord(rec);
}
private static final class CppProxy extends WcharTestHelpers
static final class CppProxy implements WcharTestHelpers
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
......@@ -40,5 +52,15 @@ public abstract class WcharTestHelpers {
_djinni_private_destroy();
super.finalize();
}
@Nonnull
public static native WcharTestRec getRecord();
@Nonnull
public static native String getString();
public static native boolean checkString(@Nonnull String str);
public static native boolean checkRecord(@Nonnull WcharTestRec rec);
}
}
......@@ -29,7 +29,7 @@ CJNIEXPORT jint JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_CppException_get(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_get(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -21,7 +21,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_00024CppProxy
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripAccess(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_00024CppProxy_roundtripAccess(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -30,7 +30,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripA
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripEmpty(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_00024CppProxy_roundtripEmpty(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -39,7 +39,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripE
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripAccessBoxed(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_00024CppProxy_roundtripAccessBoxed(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -48,7 +48,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripA
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_roundtripEmptyBoxed(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_FlagRoundtrip_00024CppProxy_roundtripEmptyBoxed(JNIEnv* jniEnv, jobject /*this*/, jobject j_flag)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -20,7 +20,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ListenerCaller_00024CppProx
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ListenerCaller_init(JNIEnv* jniEnv, jobject /*this*/, jobject j_firstL, jobject j_secondL)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ListenerCaller_00024CppProxy_init(JNIEnv* jniEnv, jobject /*this*/, jobject j_firstL, jobject j_secondL)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -19,7 +19,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ReturnOne_00024CppProxy_nat
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReturnOne_getInstance(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReturnOne_00024CppProxy_getInstance(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -19,7 +19,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ReturnTwo_00024CppProxy_nat
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReturnTwo_getInstance(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReturnTwo_00024CppProxy_getInstance(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -49,7 +49,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_ReverseClientInterface_0
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReverseClientInterface_create(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_ReverseClientInterface_00024CppProxy_create(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -20,7 +20,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_hoursString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_hoursString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -29,7 +29,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_hoursString
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_minutesString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_minutesString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -38,7 +38,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_minutesStri
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_secondsString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_secondsString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -47,7 +47,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_secondsStri
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_millisString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_millisString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -56,7 +56,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_millisStrin
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_microsString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_microsString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -65,7 +65,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_microsStrin
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_nanosString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::JniType j_dt)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_nanosString(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -74,7 +74,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_TestDuration_nanosString
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_hours(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_hours(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -83,7 +83,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::JniType JNIC
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_minutes(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_minutes(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -92,7 +92,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::JniType JN
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_seconds(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_seconds(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -101,7 +101,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::JniType JNIC
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_millis(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_millis(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -110,7 +110,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_micros(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_micros(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -119,7 +119,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_nanos(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_nanos(JNIEnv* jniEnv, jobject /*this*/, jint j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -128,7 +128,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_hoursf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_hoursf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -137,7 +137,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::JniType JNIC
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_minutesf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_minutesf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -146,7 +146,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::JniType JN
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_secondsf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_secondsf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -155,7 +155,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::JniType JNIC
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_millisf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_millisf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -164,7 +164,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_microsf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_microsf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -173,7 +173,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_nanosf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_nanosf(JNIEnv* jniEnv, jobject /*this*/, jdouble j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -182,7 +182,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::JniType JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>::Boxed::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_box(JNIEnv* jniEnv, jobject /*this*/, jlong j_count)
CJNIEXPORT ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>::Boxed::JniType JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_box(JNIEnv* jniEnv, jobject /*this*/, jlong j_count)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -191,7 +191,7 @@ CJNIEXPORT ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>::Boxed::JniTy
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestDuration_unbox(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>::Boxed::JniType j_dt)
CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestDuration_00024CppProxy_unbox(JNIEnv* jniEnv, jobject /*this*/, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>::Boxed::JniType j_dt)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -27,7 +27,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_n
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getSetRecord(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getSetRecord(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -36,7 +36,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getSetRecord
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkSetRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_rec)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkSetRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_rec)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -45,7 +45,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkSetRec
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getPrimitiveList(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getPrimitiveList(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -54,7 +54,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getPrimitive
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkPrimitiveList(JNIEnv* jniEnv, jobject /*this*/, jobject j_pl)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkPrimitiveList(JNIEnv* jniEnv, jobject /*this*/, jobject j_pl)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -63,7 +63,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkPrimit
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getNestedCollection(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getNestedCollection(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -72,7 +72,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getNestedCol
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkNestedCollection(JNIEnv* jniEnv, jobject /*this*/, jobject j_nc)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkNestedCollection(JNIEnv* jniEnv, jobject /*this*/, jobject j_nc)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -81,7 +81,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkNested
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMap(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getMap(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -90,7 +90,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMap(JNIEn
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -99,7 +99,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMap(JN
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getEmptyMap(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getEmptyMap(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -108,7 +108,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getEmptyMap(
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEmptyMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkEmptyMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -117,7 +117,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEmptyM
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMapListRecord(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_getMapListRecord(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -126,7 +126,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMapListRe
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMapListRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkMapListRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -135,7 +135,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMapLis
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInterfaceAscii(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkClientInterfaceAscii(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -143,7 +143,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInte
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInterfaceNonascii(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkClientInterfaceNonascii(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -151,7 +151,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInte
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInterfaceArgs(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkClientInterfaceArgs(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -159,7 +159,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInte
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEnumMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkEnumMap(JNIEnv* jniEnv, jobject /*this*/, jobject j_m)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -167,7 +167,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEnumMap(JN
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEnum(JNIEnv* jniEnv, jobject /*this*/, jobject j_c)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkEnum(JNIEnv* jniEnv, jobject /*this*/, jobject j_c)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -175,7 +175,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEnum(JNIEn
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_tokenId(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_tokenId(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -184,7 +184,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_tokenId(JNIE
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_createCppToken(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_createCppToken(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -193,7 +193,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_createCppTok
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkCppToken(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkCppToken(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -201,7 +201,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkCppToken(J
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestHelpers_cppTokenId(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_cppTokenId(JNIEnv* jniEnv, jobject /*this*/, jobject j_t)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -210,7 +210,7 @@ CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestHelpers_cppTokenId(JNI
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkTokenType(JNIEnv* jniEnv, jobject /*this*/, jobject j_t, jstring j_type)
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_checkTokenType(JNIEnv* jniEnv, jobject /*this*/, jobject j_t, jstring j_type)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -219,7 +219,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkTokenType(
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_returnNone(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_returnNone(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -228,7 +228,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_returnNone(J
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_assortedPrimitivesId(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_assortedPrimitivesId(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -237,7 +237,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_assortedPrim
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jbyteArray JNICALL Java_com_dropbox_djinni_test_TestHelpers_idBinary(JNIEnv* jniEnv, jobject /*this*/, jbyteArray j_b)
CJNIEXPORT jbyteArray JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_idBinary(JNIEnv* jniEnv, jobject /*this*/, jbyteArray j_b)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -20,7 +20,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppPr
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getRecord(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppProxy_getRecord(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -29,7 +29,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getReco
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getString(JNIEnv* jniEnv, jobject /*this*/)
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppProxy_getString(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -38,7 +38,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getStri
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_checkString(JNIEnv* jniEnv, jobject /*this*/, jstring j_str)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppProxy_checkString(JNIEnv* jniEnv, jobject /*this*/, jstring j_str)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......@@ -47,7 +47,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_checkS
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_checkRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_rec)
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppProxy_checkRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_rec)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
......
......@@ -2,7 +2,7 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
public class ClientInterfaceImpl extends ClientInterface {
public class ClientInterfaceImpl implements ClientInterface {
@Override
public ClientReturnedRecord getRecord(long id, String utf8string, String misc) {
if (!utf8string.equals("Non-ASCII /\0 非 ASCII 字符") && !utf8string.equals("Hello World!")) {
......
......@@ -4,7 +4,7 @@ import junit.framework.TestCase;
public class TokenTest extends TestCase {
private class JavaToken extends UserToken {
private class JavaToken implements UserToken {
public String whoami() { return "Java"; }
}
......
......@@ -35,7 +35,7 @@
<arg value="install"/>
</exec>
<mkdir dir="build/classes"/>
<javac destdir="build/classes" includeantruntime="false" encoding="UTF-8" debug="on" target="1.7" source="1.7">
<javac destdir="build/classes" includeantruntime="false" encoding="UTF-8" debug="on" target="1.8" source="1.8">
<classpath>
<fileset dir="../../deps/java/"><include name="*.jar"/></fileset>
<fileset dir="../../deps/java/test"><include name="*.jar"/></fileset>
......
......@@ -66,6 +66,7 @@ fi
"$base_dir/../src/run-assume-built" \
--java-out "$temp_out_relative/java" \
--java-package $java_package \
--java-generate-interfaces true \
--java-nullable-annotation "javax.annotation.CheckForNull" \
--java-nonnull-annotation "javax.annotation.Nonnull" \
--java-use-final-for-record false \
......@@ -95,6 +96,7 @@ fi
"$base_dir/../src/run-assume-built" \
--java-out "$temp_out_relative/java" \
--java-package $java_package \
--java-generate-interfaces true \
--java-nullable-annotation "javax.annotation.CheckForNull" \
--java-nonnull-annotation "javax.annotation.Nonnull" \
--java-use-final-for-record false \
......@@ -133,6 +135,7 @@ cp "$base_dir/djinni/yaml-test.djinni" "$temp_out/yaml"
"$base_dir/../src/run-assume-built" \
--java-out "$temp_out_relative/java" \
--java-package $java_package \
--java-generate-interfaces true \
--ident-java-field mFooBar \
\
--cpp-out "$temp_out_relative/cpp" \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment