[libinline-java-perl] 329/398: 0.48_95
Jonas Smedegaard
dr at jones.dk
Thu Feb 26 11:43:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.55
in repository libinline-java-perl.
commit c0e18165c618c3c91d87f805f6c673717d9f09fe
Author: patrick_leb <>
Date: Thu Jun 17 00:46:40 2004 +0000
0.48_95
---
Java.pm | 2 +-
Java/Array.pm | 2 +-
Java/Callback.pm | 36 +++++++++++++++++++++++++++++++-----
Java/Class.pm | 2 +-
Java/JNI.pm | 2 +-
Java/JVM.pm | 2 +-
Java/Object.pm | 2 +-
Java/PerlNatives/PerlNatives.pm | 2 +-
Java/Portable.pm | 2 +-
Java/Protocol.pm | 2 +-
META.yml | 2 +-
t/12_1_callbacks.t | 13 +++++++++++--
t/pod_test.pl | 1 +
13 files changed, 53 insertions(+), 17 deletions(-)
diff --git a/Java.pm b/Java.pm
index c48b489..a912e51 100644
--- a/Java.pm
+++ b/Java.pm
@@ -8,7 +8,7 @@ package Inline::Java ;
use strict ;
require 5.006 ;
-$Inline::Java::VERSION = '0.48_94' ;
+$Inline::Java::VERSION = '0.48_95' ;
# DEBUG is set via the DEBUG config
diff --git a/Java/Array.pm b/Java/Array.pm
index ed2aa2d..11e6768 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -4,7 +4,7 @@ package Inline::Java::Array ;
use strict ;
use Carp ;
-$Inline::Java::Array::VERSION = '0.48_94' ;
+$Inline::Java::Array::VERSION = '0.48_95' ;
# Here we store as keys the knots and as values our blessed objects
my $OBJECTS = {} ;
diff --git a/Java/Callback.pm b/Java/Callback.pm
index 55cb811..0c23b91 100644
--- a/Java/Callback.pm
+++ b/Java/Callback.pm
@@ -3,7 +3,7 @@ package Inline::Java::Callback ;
use strict ;
use Carp ;
-$Inline::Java::Callback::VERSION = '0.48_94' ;
+$Inline::Java::Callback::VERSION = '0.48_95' ;
$Inline::Java::Callback::OBJECT_HOOK = undef ;
@@ -22,7 +22,7 @@ sub InterceptCallback {
$inline = $Inline::Java::JNI::INLINE_HOOK ;
}
- if ($resp =~ s/^callback ([^ ]+) ([\w:]+) ([^ ]+)//){
+ if ($resp =~ s/^callback ([^ ]+) (\@?[\w:]+) ([^ ]+)//){
my $via = $1 ;
my $function = $2 ;
my $cast_return = $3 ;
@@ -50,9 +50,16 @@ sub ProcessCallback {
my $cast_return = shift ;
my @sargs = @_ ;
+ my $list_ctx = 0 ;
+ if ($function =~ s/^\@//){
+ $list_ctx = 1 ;
+ }
+
my $pc = new Inline::Java::Protocol(undef, $inline) ;
my $thrown = 'false' ;
+
my $ret = undef ;
+ my @ret = () ;
eval {
my @args = map {
my $a = $pc->DeserializeObject(0, $_) ;
@@ -66,13 +73,23 @@ sub ProcessCallback {
Inline::Java::debug(2, "processing callback $id" . "->" . "$function(" .
join(", ", @args) . ")") ;
my $obj = Inline::Java::Callback::GetObject($id) ;
- $ret = $obj->$function(@args) ;
+ if ($list_ctx){
+ @ret = $obj->$function(@args) ;
+ }
+ else{
+ $ret = $obj->$function(@args) ;
+ }
}
elsif ($via ne 'null'){
# Call via package
Inline::Java::debug(2, "processing callback $via" . "->" . "$function(" .
join(", ", @args) . ")") ;
- $ret = $via->$function(@args) ;
+ if ($list_ctx){
+ @ret = $via->$function(@args) ;
+ }
+ else{
+ $ret = $via->$function(@args) ;
+ }
}
else {
# Straight call
@@ -81,7 +98,16 @@ sub ProcessCallback {
if ($function !~ /::/){
$function = 'main' . '::' . $function ;
}
- $ret = $function->(@args) ;
+ if ($list_ctx){
+ @ret = $function->(@args) ;
+ }
+ else{
+ $ret = $function->(@args) ;
+ }
+ }
+
+ if ($list_ctx){
+ $ret = \@ret ;
}
} ;
if ($@){
diff --git a/Java/Class.pm b/Java/Class.pm
index fca8735..9c5cddc 100644
--- a/Java/Class.pm
+++ b/Java/Class.pm
@@ -3,7 +3,7 @@ package Inline::Java::Class ;
use strict ;
use Carp ;
-$Inline::Java::Class::VERSION = '0.48_94' ;
+$Inline::Java::Class::VERSION = '0.48_95' ;
$Inline::Java::Class::MAX_SCORE = 10 ;
diff --git a/Java/JNI.pm b/Java/JNI.pm
index a832e17..0706ec1 100644
--- a/Java/JNI.pm
+++ b/Java/JNI.pm
@@ -4,7 +4,7 @@ package Inline::Java::JNI ;
use strict ;
-$Inline::Java::JNI::VERSION = '0.48_94' ;
+$Inline::Java::JNI::VERSION = '0.48_95' ;
use DynaLoader ;
use Carp ;
diff --git a/Java/JVM.pm b/Java/JVM.pm
index 993d7b4..b6bfc87 100644
--- a/Java/JVM.pm
+++ b/Java/JVM.pm
@@ -8,7 +8,7 @@ use IPC::Open3 ;
use IO::Socket ;
use Inline::Java::Portable ;
-$Inline::Java::JVM::VERSION = '0.48_94' ;
+$Inline::Java::JVM::VERSION = '0.48_95' ;
my %SIGS = () ;
diff --git a/Java/Object.pm b/Java/Object.pm
index f715aec..aaf559f 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -5,7 +5,7 @@ use strict ;
use Inline::Java::Protocol ;
use Carp ;
-$Inline::Java::Object::VERSION = '0.48_94' ;
+$Inline::Java::Object::VERSION = '0.48_95' ;
# Here we store as keys the knots and as values our blessed private objects
my $PRIVATES = {} ;
diff --git a/Java/PerlNatives/PerlNatives.pm b/Java/PerlNatives/PerlNatives.pm
index 0c184b0..a4acd9e 100644
--- a/Java/PerlNatives/PerlNatives.pm
+++ b/Java/PerlNatives/PerlNatives.pm
@@ -2,6 +2,6 @@ package Inline::Java::PerlNatives ;
use strict ;
-$Inline::Java::PerlNatives::VERSION = '0.48_94' ;
+$Inline::Java::PerlNatives::VERSION = '0.48_95' ;
1 ;
diff --git a/Java/Portable.pm b/Java/Portable.pm
index 6b294a2..1a36e28 100644
--- a/Java/Portable.pm
+++ b/Java/Portable.pm
@@ -9,7 +9,7 @@ use Config ;
use File::Find ;
use File::Spec ;
-$Inline::Java::Portable::VERSION = '0.48_94' ;
+$Inline::Java::Portable::VERSION = '0.48_95' ;
# Here is some code to figure out if we are running on command.com
# shell under Windows.
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index e0c81da..9fc2e9f 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -5,7 +5,7 @@ use Inline::Java::Object ;
use Inline::Java::Array ;
use Carp ;
-$Inline::Java::Protocol::VERSION = '0.48_94' ;
+$Inline::Java::Protocol::VERSION = '0.48_95' ;
my %CLASSPATH_ENTRIES = () ;
diff --git a/META.yml b/META.yml
index 8ac55ae..d56ad01 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Inline-Java
-version: 0.48_94
+version: 0.48_95
version_from: Java.pm
installdirs: site
requires:
diff --git a/t/12_1_callbacks.t b/t/12_1_callbacks.t
index b3b2825..576ffcd 100755
--- a/t/12_1_callbacks.t
+++ b/t/12_1_callbacks.t
@@ -14,7 +14,7 @@ use Inline::Java qw(caught) ;
BEGIN {
- my $cnt = 24 ;
+ my $cnt = 25 ;
plan(tests => $cnt) ;
}
@@ -28,6 +28,8 @@ my $t = new t15() ;
ok($t->add_via_perl(5, 6), 11) ;
my $a = $t->incr_via_perl([7, 6, 5]) ;
ok($a->[1], 7) ;
+ $a = $t->incr_via_perl_ctx($a) ;
+ ok($a->[1], 8) ;
ok($t->mul(5, 6), 30) ;
ok($t->mul_via_perl(5, 6), 30) ;
ok($t->silly_mul(3, 2), 6) ;
@@ -115,7 +117,7 @@ sub incr {
$ija->[$i]++ ;
}
- return $ija ;
+ return wantarray ? @{$ija} : $ija ;
}
@@ -288,6 +290,13 @@ class t15 extends InlineJavaPerlCaller {
return r ;
}
+ public int [] incr_via_perl_ctx(int a[]) throws InlineJavaException, InlineJavaPerlException {
+ int [] r = (int [])CallPerlSub("@main::incr",
+ new Object [] {a}, a.getClass()) ;
+
+ return r ;
+ }
+
public void death_via_perl() throws InlineJavaException, InlineJavaPerlException {
InlineJavaPerlCaller c = new InlineJavaPerlCaller() ;
c.CallPerlSub("main::death", null) ;
diff --git a/t/pod_test.pl b/t/pod_test.pl
index 60d1f9e..1bdf8a9 100644
--- a/t/pod_test.pl
+++ b/t/pod_test.pl
@@ -51,6 +51,7 @@ foreach my $podf ('Java.pod', 'Java/Callback.pod', 'Java/PerlNatives/PerlNatives
$code =~ s/(\n)( )/$1/gs ;
$code =~ s/(((END(_OF_JAVA_CODE)?)|STUDY)\')/$1, NAME => "main::main" / ;
+ $code =~ s/(STUDY\')/$1, AUTOSTUDY => 1 / ;
if (($code =~ /SHARED_JVM/)&&($opts{o} != $cnt)){
print "skipped\n" ;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git
More information about the Pkg-perl-cvs-commits
mailing list