diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-07-19 15:56:13 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-07-19 15:56:13 +0000 |
commit | 5d63b1b2a6968f9c0146e1946b72ca6073370fbe (patch) | |
tree | d8c9ef35e0f68c95aac11ebd1decd345ba1f82a8 /src/java/com/cycling74/max/Callback.java | |
parent | 0f770551cebca90c92b7a39b0e0135a445af51f9 (diff) |
updated to 0.8.5HEADsvn2git-headexternals/loaders/pdj
svn path=/trunk/externals/loaders/pdj/; revision=11874
Diffstat (limited to 'src/java/com/cycling74/max/Callback.java')
-rw-r--r-- | src/java/com/cycling74/max/Callback.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/java/com/cycling74/max/Callback.java b/src/java/com/cycling74/max/Callback.java index 1eed30f..14d4848 100644 --- a/src/java/com/cycling74/max/Callback.java +++ b/src/java/com/cycling74/max/Callback.java @@ -130,6 +130,7 @@ public class Callback implements Executable { try { method.invoke(obj, args); } catch (IllegalArgumentException e) { + e.printStackTrace(); MaxSystem.error("pdj: IllegalArgumentException:" + e); } catch (IllegalAccessException e) { MaxSystem.error("pdj: IllegalAccessException:" + e); @@ -144,7 +145,7 @@ public class Callback implements Executable { * @return the array of arguments */ public Object[] getArgs() { - return args; + return (Object[]) args[0]; } /** @@ -176,7 +177,7 @@ public class Callback implements Executable { * @param i int value */ public void setArgs(int i) { - args = new Object[] { new Integer(i) }; + setSubArgs(new Object[] { new Integer(i) }); } /** @@ -184,7 +185,7 @@ public class Callback implements Executable { * @param f float argument */ public void setArgs(float f) { - args = new Object[] { new Float(f) }; + setSubArgs(new Object[] { new Float(f) }); } /** @@ -192,7 +193,7 @@ public class Callback implements Executable { * @param value int value */ public void setArgs(String value) { - args = new Object[] { value }; + setSubArgs(new Object[] { value }); } /** @@ -200,7 +201,7 @@ public class Callback implements Executable { * @param flag boolean value */ public void setArgs(boolean flag) { - args = new Object[] { flag ? Boolean.TRUE : Boolean.FALSE }; + setSubArgs(new Object[] { flag ? Boolean.TRUE : Boolean.FALSE }); } /** @@ -208,6 +209,15 @@ public class Callback implements Executable { * @param args the array object to pass to the method */ public void setArgs(Object args[]) { - this.args = (Object[]) args.clone(); + setSubArgs((Object[]) args.clone()); + } + + /** + * Fix for <1.5 method.invoke. + * @param args + */ + private void setSubArgs(Object args[]) { + this.args = new Object[1]; + this.args[0] = args; } } |