From 9f3f059c93a98715aa00f37d1ab1e3868fc1fb0f Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 13 Jul 2016 03:26:11 +0800 Subject: Cleanup of JNI code for consistency. * Make sure that arguments are checked for NULL before being passed to ->Get JNI-functions (as these may crash on NULL). * Remove unused argument to from_Device(). * Consistently use jint and jfloat in JNIEXPORTed functions. * Check ctx for NULL in all relevant functions. * Throw Java exception when constructors fail. * to_*_safe() means that the function doesn't fz_throw(). * to_*_own() means that the function takes ownership of the object. * Make sure that jprefixing of argument identifies does not clash with jprefixing of types, specifically jstring. * Rename (j)colorspace -> (j)cs, (j)shade -> (j)shd, (j)device -> (j)dev. * Always check that the context is available in bindings. * Always check that required arguments are non-NULL or have decent default values (e.g. for fz_matrix and fz_rect). --- platform/java/example/TraceDevice.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/java/example') diff --git a/platform/java/example/TraceDevice.java b/platform/java/example/TraceDevice.java index 01e7b6c8..d6bb2953 100644 --- a/platform/java/example/TraceDevice.java +++ b/platform/java/example/TraceDevice.java @@ -81,7 +81,7 @@ public class TraceDevice extends Device implements PathWalker, TextWalker System.out.println("ignoreText " + ctm); traceText(text); } - public void fillShade(Shade shade, Matrix ctm, float alpha) { + public void fillShade(Shade shd, Matrix ctm, float alpha) { System.out.println("fillShade " + ctm + " " + alpha); } public void fillImage(Image img, Matrix ctm, float alpha) { -- cgit v1.2.3