diff -Nru libinline-java-perl-0.58~dfsg/bug/croak_bug.pl libinline-java-perl-0.66/bug/croak_bug.pl --- libinline-java-perl-0.58~dfsg/bug/croak_bug.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/croak_bug.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,581 +0,0 @@ -#!/usr/local/perl56/bin/perl -w - -use strict ; - -package class ; -@class::ISA = qw(Inline::Java::Object) ; - -use Carp ; - - -$SIG{__DIE__} = sub { - $Inline::Java::DONE = 1 ; - die @_ ; -} ; - - -sub new { - my $class = shift ; - my @args = @_ ; - - my $o = $Inline::Java::INLINE->{'$modfname'} ; - - my $ret = undef ; - eval { - $ret = $class->__new() ; - } ; - croak $@ if $@ ; - - return $ret ; -} - - - -package Inline::Java::Object ; -@Inline::Java::Object::ISA = qw(Inline::Java::Object::Tie) ; - -use strict ; - -$Inline::Java::Object::VERSION = '0.10' ; - -use Carp ; - - -# Here we store as keys the knots and as values our blessed private objects -my $PRIVATES = {} ; - - -# Bogus constructor. We fall here if no public constructor is defined -# in the Java class. -sub new { - my $class = shift ; - - croak "No public constructor defined for class $class" ; -} - - -# Constructor. Here we create a new object that will be linked -# to a real Java object. -sub __new { - my $class = shift ; - my $java_class = shift ; - my $inline = shift ; - my $objid = shift ; - my $proto = shift ; - my $args = shift ; - - my %this = () ; - - my $knot = tie %this, $class ; - my $this = bless(\%this, $class) ; - - my $priv = Inline::Java::Object::Private->new($java_class, $inline) ; - $PRIVATES->{$knot} = $priv ; - - croak "frog" ; -} - - -sub __get_private { - my $this = shift ; - - my $knot = tied(%{$this}) || $this ; - - my $priv = $PRIVATES->{$knot} ; - if (! defined($priv)){ - croak "Unknown Java object reference" ; - } - - return $priv ; -} - - -# Here an object in destroyed. this function seems to be called twice -# for each object. I think it's because the $this reference is both blessed -# and tied to the same package. -sub DESTROY { - my $this = shift ; - - print STDERR "DESTROY\n" ; - if (! $Inline::Java::DONE){ - if (! $this->__get_private()->{deleted}){ - $this->__get_private()->{deleted} = 1 ; - eval { - $this->__get_private()->{proto}->DeleteJavaObject($this) ; - } ; - croak "In method DESTROY of class $this->__get_private()->{class}: $@" if $@ ; - } - else{ - # Inline::Java::debug("Object destructor called more than once for $this !") ; - } - } - - untie %{$this} ; -} - - - -######################## Hash Methods ######################## -package Inline::Java::Object::Tie ; -@Inline::Java::Object::Tie::ISA = qw(Tie::StdHash) ; - - -use Tie::Hash ; -use Carp ; - - -sub TIEHASH { - my $class = shift ; - - return $class->SUPER::TIEHASH(@_) ; -} - - -sub STORE { - my $this = shift ; - my $key = shift ; - my $value = shift ; - - return $this->__set_member($key, $value) ; -} - - -sub FETCH { - my $this = shift ; - my $key = shift ; - - return $this->__get_member($key) ; -} - - -sub FIRSTKEY { - my $this = shift ; - - return $this->SUPER::FIRSTKEY() ; -} - - -sub NEXTKEY { - my $this = shift ; - - return $this->SUPER::NEXTKEY() ; -} - - -sub EXISTS { - my $this = shift ; - my $key = shift ; - - my $inline = $Inline::Java::INLINE->{$this->__get_private()->{module}} ; - my $fields = $inline->get_fields($this->__get_private()->{java_class}) ; - - if ($fields->{$key}){ - return 1 ; - } - - return 0 ; -} - - -sub DELETE { - my $this = shift ; - my $key = shift ; - - croak "Operation DELETE not supported on Java object" ; -} - - -sub CLEAR { - my $this = shift ; - - croak "Operation CLEAR not supported on Java object" ; -} - - -sub DESTROY { - my $this = shift ; - - $PRIVATES->{$this} = undef ; -} - - - - -######################## Private Object ######################## -package Inline::Java::Object::Private ; - -sub new { - my $class = shift ; - my $java_class = shift ; - my $inline = shift ; - - my $this = {} ; - $this->{class} = $class ; - $this->{java_class} = $java_class ; - $this->{module} = $inline->{modfname} ; - $this->{known_to_perl} = 1 ; - $this->{proto} = new Inline::Java::Protocol($this, $inline) ; - - bless($this, $class) ; - - return $this ; -} - - -package Inline::Java::Protocol ; - - -use strict ; - -$Inline::Java::Protocol::VERSION = '0.10' ; - -use Carp ; - - -sub new { - my $class = shift ; - my $obj = shift ; - my $inline = shift ; - - my $this = {} ; - $this->{obj_priv} = $obj || {} ; - $this->{module} = $inline->{modfname} ; - - bless($this, $class) ; - return $this ; -} - - -sub ISA { - my $this = shift ; - my $proto = shift ; - - Inline::Java::debug("checking if $this is a $proto") ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - my $data = join(" ", - "isa", - $id, - Inline::Java::Class::ValidateClass($class), - Inline::Java::Class::ValidateClass($proto), - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data, 1) ; -} - - -# Called to create a Java object -sub CreateJavaObject { - my $this = shift ; - my $class = shift ; - my $proto = shift ; - my $args = shift ; - - Inline::Java::debug("creating object new $class" . $this->CreateSignature($args)) ; - - my $data = join(" ", - "create_object", - Inline::Java::Class::ValidateClass($class), - $this->CreateSignature($proto, ","), - $this->ValidateArgs($args), - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data, 1) ; -} - - -# Called to call a static Java method -sub CallStaticJavaMethod { - my $this = shift ; - my $class = shift ; - my $method = shift ; - my $proto = shift ; - my $args = shift ; - - Inline::Java::debug("calling $class.$method" . $this->CreateSignature($args)) ; - - my $data = join(" ", - "call_static_method", - Inline::Java::Class::ValidateClass($class), - $this->ValidateMethod($method), - $this->CreateSignature($proto, ","), - $this->ValidateArgs($args), - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data) ; -} - - -# Calls a regular Java method. -sub CallJavaMethod { - my $this = shift ; - my $method = shift ; - my $proto = shift ; - my $args = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug("calling object($id).$method" . $this->CreateSignature($args)) ; - - my $data = join(" ", - "call_method", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMethod($method), - $this->CreateSignature($proto, ","), - $this->ValidateArgs($args), - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data) ; -} - - -# Sets a member variable. -sub SetJavaMember { - my $this = shift ; - my $member = shift ; - my $proto = shift ; - my $arg = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug("setting object($id)->{$member} = $arg->[0]") ; - my $data = join(" ", - "set_member", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMember($member), - Inline::Java::Class::ValidateClass($proto->[0]), - $this->ValidateArgs($arg), - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data) ; -} - - -# Gets a member variable. -sub GetJavaMember { - my $this = shift ; - my $member = shift ; - my $proto = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug("getting object($id)->{$member}") ; - - my $data = join(" ", - "get_member", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMember($member), - Inline::Java::Class::ValidateClass($proto->[0]), - "undef:", - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - return $this->Send($data) ; -} - - -# Deletes a Java object -sub DeleteJavaObject { - my $this = shift ; - my $obj = shift ; - - if (defined($this->{obj_priv}->{id})){ - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - - Inline::Java::debug("deleting object $obj $id ($class)") ; - - my $data = join(" ", - "delete_object", - $id, - ) ; - - Inline::Java::debug(" packet sent is $data") ; - - $this->Send($data) ; - } -} - - -# This method makes sure that the method we are asking for -# has the correct form for a Java method. -sub ValidateMethod { - my $this = shift ; - my $method = shift ; - - if ($method !~ /^(\w+)$/){ - croak "Invalid Java method name $method" ; - } - - return $method ; -} - - -# This method makes sure that the member we are asking for -# has the correct form for a Java member. -sub ValidateMember { - my $this = shift ; - my $member = shift ; - - if ($member !~ /^(\w+)$/){ - croak "Invalid Java member name $member" ; - } - - return $member ; -} - - -# Validates the arguments to be used in a method call. -sub ValidateArgs { - my $this = shift ; - my $args = shift ; - - my @ret = () ; - foreach my $arg (@{$args}){ - if (! defined($arg)){ - push @ret, "undef:" ; - } - elsif (ref($arg)){ - if ((! UNIVERSAL::isa($arg, "Inline::Java::Object"))&&(! UNIVERSAL::isa($arg, "Inline::Java::Array"))){ - croak "A Java method or member can only have Java objects, Java arrays or scalars as arguments" ; - } - - if (UNIVERSAL::isa($arg, "Inline::Java::Array")){ - $arg = $arg->__get_object() ; - } - my $class = $arg->__get_private()->{java_class} ; - my $id = $arg->__get_private()->{id} ; - push @ret, "object:$class:$id" ; - } - else{ - push @ret, "scalar:" . join(".", unpack("C*", $arg)) ; - } - } - - return @ret ; -} - - -sub CreateSignature { - my $this = shift ; - my $proto = shift ; - my $del = shift || ", " ; - - return "(" . join($del, @{$proto}) . ")" ; -} - - -# This actually sends the request to the Java program. It also takes -# care of registering the returned object (if any) -sub Send { - my $this = shift ; - my $data = shift ; - my $const = shift ; - - my $resp = undef ; - my $inline = $Inline::Java::INLINE->{$this->{module}} ; - if (! $inline->{Java}->{JNI}){ - my $sock = $inline->{Java}->{socket} ; - print $sock $data . "\n" or - croak "Can't send packet over socket: $!" ; - - $resp = <$sock> ; - } - else{ - $resp = $inline->{Java}->{JNI}->process_command($data) ; - } - - Inline::Java::debug(" packet recv is $resp") ; - - if (! $resp){ - croak "Can't receive packet over socket: $!" ; - } - elsif ($resp =~ /^error scalar:([\d.]*)$/){ - my $msg = pack("C*", split(/\./, $1)) ; - Inline::Java::debug(" packet recv error: $msg") ; - croak $msg ; - } - elsif ($resp =~ /^ok scalar:([\d.]*)$/){ - return pack("C*", split(/\./, $1)) ; - } - elsif ($resp =~ /^ok undef:$/){ - return undef ; - } - elsif ($resp =~ /^ok object:(\d+):(.*)$/){ - # Create the Perl object wrapper and return it. - my $id = $1 ; - my $class = $2 ; - - if ($const){ - $this->{obj_priv}->{java_class} = $class ; - $this->{obj_priv}->{id} = $id ; - - return undef ; - } - else{ - my $perl_class = $class ; - $perl_class =~ s/[.\$]/::/g ; - my $pkg = $inline->{pkg} ; - $perl_class = $pkg . "::" . $perl_class ; - Inline::Java::debug($perl_class) ; - - my $known = 0 ; - { - no strict 'refs' ; - if (defined(${$perl_class . "::" . "EXISTS"})){ - Inline::Java::debug(" returned class exists!") ; - $known = 1 ; - } - else{ - Inline::Java::debug(" returned class doesn't exist!") ; - } - } - - my $obj = undef ; - if ($known){ - Inline::Java::debug("creating stub for known object...") ; - $obj = $perl_class->__new($class, $inline, $id) ; - Inline::Java::debug("stub created ($obj)...") ; - } - else{ - Inline::Java::debug("creating stub for unknown object...") ; - $obj = Inline::Java::Object->__new($class, $inline, $id) ; - Inline::Java::debug("stub created ($obj)...") ; - $obj->__get_private()->{known_to_perl} = 0 ; - } - - Inline::Java::debug("checking if stub is array...") ; - if (Inline::Java::Class::ClassIsArray($class)){ - Inline::Java::debug("creating array object...") ; - $obj = new Inline::Java::Array($obj) ; - Inline::Java::debug("array object created...") ; - } - - Inline::Java::debug("returning stub...") ; - - return $obj ; - } - } -} - - - -package main ; - -my $o = new class() ; - diff -Nru libinline-java-perl-0.58~dfsg/bug/Employee.pm libinline-java-perl-0.66/bug/Employee.pm --- libinline-java-perl-0.58~dfsg/bug/Employee.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Employee.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -package Employee; -use strict; - -require Exporter; -our @ISA = qw(Exporter); -our @EXPORT_OK = qw(); - - use Person; - @ISA = ("Person"); - - sub new { - my $proto = shift; - my $class = ref($proto) || $proto; - my $self = $class->SUPER::new(); - $self->{SALARY} = undef; - $self->{ID} = undef; - $self->{START_DATE} = undef; - bless ($self, $class); # reconsecrate - return $self; - } - sub salary { - my $self = shift; - if (@_) { $self->{SALARY} = shift } - return $self->{SALARY}; - } sub id_number { - my $self = shift; - if (@_) { $self->{ID} = shift } - return $self->{ID}; - } sub start_date { - my $self = shift; - if (@_) { $self->{START_DATE} = shift } - return $self->{START_DATE}; - } - -1; \ No newline at end of file diff -Nru libinline-java-perl-0.58~dfsg/bug/Foo.java libinline-java-perl-0.66/bug/Foo.java --- libinline-java-perl-0.58~dfsg/bug/Foo.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Foo.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -import javax.xml.parsers.*; -import org.apache.xerces.jaxp.SAXParserFactoryImpl; - -public class Foo { - - // This method works! - public void test_a() throws - javax.xml.parsers.ParserConfigurationException, - org.xml.sax.SAXException - { - javax.xml.parsers.SAXParserFactory si = org.apache.xerces.jaxp.SAXParserFactoryImpl.newInstance() ; - SAXParser y = si.newSAXParser() ; - } - -public void test_b() throws - javax.xml.parsers.ParserConfigurationException, - org.xml.sax.SAXException - { - System.out.println("!!!" + getClass().getClassLoader() + "!!!") ; - System.setProperty("javax.xml.parsers.SAXParserFactory", - "org.apache.xerces.jaxp.SAXParserFactoryImpl"); - SAXParser x = javax.xml.parsers.SAXParserFactory.newInstance().newSAXParser(); - } - - static public void main(String args[]){ - try { - Foo f = new Foo() ; - f.test_a() ; - f.test_b() ; - } - catch (java.lang.Exception e){ - e.printStackTrace() ; - } - } -} - diff -Nru libinline-java-perl-0.58~dfsg/bug/gcj_test.java libinline-java-perl-0.66/bug/gcj_test.java --- libinline-java-perl-0.58~dfsg/bug/gcj_test.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/gcj_test.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -import java.lang.reflect.* ; - - -public class gcj_test { - public static void main(String[] args){ - try { - obj o = new obj() ; - Class c = Class.forName("obj") ; - - Method methods[] = c.getMethods() ; - Field fields[] = c.getFields() ; - Method m = null ; - Field f = null ; - for (int i = 0 ; i < methods.length ; i++){ - if (methods[i].getName().equals("f")){ - m = methods[i] ; - break ; - } - } - for (int i = 0 ; i < fields.length ; i++){ - if (fields[i].getName().equals("s")){ - f = fields[i] ; - break ; - } - } - - - Object a[] = {"test"} ; - m.invoke(o, a) ; - f.set(o, "test") ; - System.out.println("s set to 'test'") ; - System.out.println("s = " + (String)f.get(o)) ; - a[0] = null ; - m.invoke(o, a) ; - f.set(o, null) ; - System.out.println("s set to null") ; - System.out.println("s = " + (String)f.get(o)) ; - f.get(o) ; - } - catch (Exception e){ - System.err.println(e.getClass().getName() + ": " + e.getMessage()) ; - System.exit(1) ; - } - - System.out.println("Done") ; - } -} - - -class obj { - public String s = null ; - - public void f(String s){ - System.out.println("f invoked with param " + s) ; - } -} \ No newline at end of file diff -Nru libinline-java-perl-0.58~dfsg/bug/Hi3.pm libinline-java-perl-0.66/bug/Hi3.pm --- libinline-java-perl-0.58~dfsg/bug/Hi3.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Hi3.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -package Hi3; -use strict; -use warnings; - -BEGIN { - $ENV{CLASSPATH} .= "./Higher.jar"; -} - -use Inline Java => 'STUDY', STUDY => ['Higher']; - -sub new { - my $class = shift; -# print "class name is $class \n"; - my $a = shift; - my $b = shift; - return Hi3::Higher->Higher($a, $b); -} - -1; Binary files /tmp/tmpUk7i_j/j5hnGt6Kv6/libinline-java-perl-0.58~dfsg/bug/Higher.class and /tmp/tmpUk7i_j/mJYapZBRme/libinline-java-perl-0.66/bug/Higher.class differ Binary files /tmp/tmpUk7i_j/j5hnGt6Kv6/libinline-java-perl-0.58~dfsg/bug/Higher.jar and /tmp/tmpUk7i_j/mJYapZBRme/libinline-java-perl-0.66/bug/Higher.jar differ diff -Nru libinline-java-perl-0.58~dfsg/bug/Higher.java libinline-java-perl-0.66/bug/Higher.java --- libinline-java-perl-0.58~dfsg/bug/Higher.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Higher.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -class Lower -{ - int a; - public Lower(int p) - { - a= p; - } - public String outPrintValues() { - return ("a = "+ this.a); - } - -} - -public class Higher extends Lower { - private int b; - - public Higher(int p, int q) { - super(p); - this.b = q; - } - - public int getHigherValues() { - return this.b; - } - public String printValues() { - return "a = "+ this.a + "\nb = " + b; - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/inline3.pl libinline-java-perl-0.66/bug/inline3.pl --- libinline-java-perl-0.58~dfsg/bug/inline3.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/inline3.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use warnings; -use Hi3; - -my $Higher1 = Hi3->new(5,10); -print $Higher1->printValues(), "\n"; Binary files /tmp/tmpUk7i_j/j5hnGt6Kv6/libinline-java-perl-0.58~dfsg/bug/Lower.class and /tmp/tmpUk7i_j/mJYapZBRme/libinline-java-perl-0.66/bug/Lower.class differ diff -Nru libinline-java-perl-0.58~dfsg/bug/nadim.pl libinline-java-perl-0.66/bug/nadim.pl --- libinline-java-perl-0.58~dfsg/bug/nadim.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/nadim.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -#!/usr/bin/perl - -package PBS ; -use Data::Dumper ; - -sub GetConfig { - print "do GetConfig(@_)\n" ; - return 1 ; -} - -sub AddRule { - print "do AddRule( " . Dumper(\@_) . ")\n" ; -} - - -package PBS::Java ; - -my $java_code = <bind( - Java => <run() ; diff -Nru libinline-java-perl-0.58~dfsg/bug/natives_hpux.txt libinline-java-perl-0.66/bug/natives_hpux.txt --- libinline-java-perl-0.58~dfsg/bug/natives_hpux.txt 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/natives_hpux.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,2014 +0,0 @@ - -####### Individual t/12_2 test as asked by Mr. LeBoutillier -####### WITH JNI active - - -# export PERL_INLINE_JAVA_JNI=1 -# export PERL_INLINE_JAVA_DEBUG=4 -# perl -Mblib t/12_2_perl_natives.t -Using /opt/Inline-Java-0.45/blib - -Note: PerlNatives is still experimental and errors here can safely -be ignored if you don't plan on using this feature. However, the -author would appreciate if errors encountered here were reported -to the mailing list (inline@perl.org) along with your hardware/OS -detail. Thank you. -[perl][1] validate done. -[perl][1] Starting load. -[perl][4] portable: ENV_VAR_PATH_SEP_CP for hpux is default ':' -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar for hpux is default '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar' -[perl][2] classpath: /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar -[perl][1] starting JVM... -[perl][1] JNI mode -[perl][2] classpath: -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar for hpux is default '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar' -[perl][2] adding to classpath: '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar' -[perl][3] packet sent is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.98.108.105.98.47.108.105.98.47.73.110.108.105.110.101.47.74.97.118.97.47.73.110.108.105.110.101.74.97.118.97.85.115.101.114.46.106.97.114 -[java][3] packet recv is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.98.108.105.98.47.108.105.98.47.73.110.108.105.110.101.47.74.97.118.97.47.73.110.108.105.110.101.74.97.118.97.85.115.101.114.46.106.97.114 -[java][2] added file:/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar to classpath -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] getting server type -[perl][3] packet sent is server_type -[java][3] packet recv is server_type -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:112.114.105.118.97.116.101 -[perl][3] packet recv is ok scalar:112.114.105.118.97.116.101 -[perl][4] destroying Inline::Java::Protocol -[perl][4] portable: ENV_VAR_PATH_SEP_CP for hpux is default ':' -[perl][2] classpath candidate '' scraped -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54 for hpux is default '/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54' -[perl][2] adding to classpath: '/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54' -[perl][3] packet sent is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.95.73.110.108.105.110.101.95.116.101.115.116.47.108.105.98.47.97.117.116.111.47.95.49.50.95.50.95.112.101.114.108.95.110.97.116.105.118.101.115.95.116.95.57.101.53.52 -[java][3] packet recv is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.95.73.110.108.105.110.101.95.116.101.115.116.47.108.105.98.47.97.117.116.111.47.95.49.50.95.50.95.112.101.114.108.95.110.97.116.105.118.101.115.95.116.95.57.101.53.52 -[java][2] added file:/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54/ to classpath -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] Inline::Java object id is 0 -[perl][1] using jdat cache -[perl][3] perl doesn't know about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] perl doesn't know about 't1212' ('main::t1212') -[perl][2] creating object in java (main::t1212): -[perl][1] load done. -[perl][4] destroying Inline::Java::Protocol -[perl][3] matching arguments to init() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(0).init() -[perl][3] packet sent is call_method 0 t121 init () -[java][3] packet recv is call_method 0 t121 init () -[java][4] class t121 is reference -[java][3] found a init method -[java][3] () = ()? -[java][3] has matching signature () -[java][1] loading InlineJavaUserClassLink via InlineJavaUserClassLoader -[java][2] loading shared library /opt/Inline-Java-0.45/blib/arch/auto/Inline/Java/Natives/Natives.sl -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -1..5 -[perl][3] matching arguments to init() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(0).init() -[perl][3] packet sent is call_method 0 t121 init () -[java][3] packet recv is call_method 0 t121 init () -[java][4] class t121 is reference -[java][3] method was cached -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] matching arguments to new() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] creating object new t121() -[perl][3] packet sent is create_object t121 () -[java][3] packet recv is create_object t121 () -[java][4] class t121 is reference -[java][3] found a t121 constructor -[java][3] () = ()? -[java][3] has matching signature () -[java][3] registering natives for class t121 -[java][3] registering native method array for class t121 -[java][3] signature is ([I[Ljava/lang/String;)Ljava/lang/String; -[java][3] format is LLL -[java][3] registering native method types for class t121 -[java][3] signature is (BSIJFDZCLjava/lang/String;)Ljava/lang/String; -[java][3] format is LBSIJFDZCL -[java][3] registering native method callback for class t121 -[java][3] signature is ()Ljava/lang/String; -[java][3] format is L -[java][3] packet sent is ok object:0:1:t121 -[perl][3] packet recv is ok object:0:1:t121 -[perl][3] matching arguments to types_stub(byte, short, int, long, float, double, boolean, char, java.lang.String) -[perl][4] min = -128, max = 127, val = 1 -[perl][4] min = -32768, max = 32767, val = 2 -[perl][4] min = -2147483648, max = 2147483647, val = 3 -[perl][4] min = -2147483648, max = 2147483647, val = 4 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 5 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 6 -[perl][3] match successful: score is 41 -[perl][3] calling object(1).types_stub(1, 2, 3, 4, 5, 6, 1, 2, 1000) -[perl][3] packet sent is call_method 1 t121 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][3] packet recv is call_method 1 t121 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][4] class t121 is reference -[java][3] found a types_stub method -[java][3] (byte,short,int,long,float,double,boolean,char,java.lang.String) = (byte,short,int,long,float,double,boolean,char,java.lang.String)? -[java][3] has matching signature (byte,short,int,long,float,double,boolean,char,java.lang.String) -[java][4] arg 0 of signature is byte -[java][4] class byte is primitive numeric -[java][4] args is scalar -> forcing to byte -[java][4] result is 1 -[java][4] arg 1 of signature is short -[java][4] class short is primitive numeric -[java][4] args is scalar -> forcing to short -[java][4] result is 2 -[java][4] arg 2 of signature is int -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 3 -[java][4] arg 3 of signature is long -[java][4] class long is primitive numeric -[java][4] args is scalar -> forcing to long -[java][4] result is 4 -[java][4] arg 4 of signature is float -[java][4] class float is primitive numeric -[java][4] args is scalar -> forcing to float -[java][4] result is 5.0 -[java][4] arg 5 of signature is double -[java][4] class double is primitive numeric -[java][4] args is scalar -> forcing to double -[java][4] result is 6.0 -[java][4] arg 6 of signature is boolean -[java][4] class boolean is primitive bool -[java][4] args is scalar -> forcing to bool -[java][4] result is true -[java][4] arg 7 of signature is char -[java][4] class char is primitive char -[java][4] args is scalar -> forcing to char -[java][4] result is 2 -[java][4] arg 8 of signature is java.lang.String -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 1000 -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@b162d5 -[java][3] InvokePerlMethod argument 1 = 0 -[java][3] InvokePerlMethod argument 2 = 0 -[java][3] InvokePerlMethod argument 3 = 3 -[java][3] InvokePerlMethod argument 4 = 4 -[java][3] InvokePerlMethod argument 5 = 5.0 -[java][3] InvokePerlMethod argument 6 = 6.0 -[java][3] InvokePerlMethod argument 7 = false -[java][3] InvokePerlMethod argument 8 = -[java][3] InvokePerlMethod argument 9 = 1000 -[java][3] exiting InvokePerlMethod -[java][4] class java.lang.Byte is primitive numeric -[java][4] class java.lang.Short is primitive numeric -[java][4] class java.lang.Integer is primitive numeric -[java][4] class java.lang.Long is primitive numeric -[java][4] class java.lang.Float is primitive numeric -[java][4] class java.lang.Double is primitive numeric -[java][4] class java.lang.Boolean is primitive bool -[java][4] class java.lang.Character is primitive char -[java][4] class java.lang.String is primitive string -[java][2] callback command: callback ::t121 types null object:0:2:t121 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[java][3] packet sent (callback) is callback ::t121 types null object:0:2:t121 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][2] processing callback main::t121::types(t121=HASH(0x40681674), 0, 0, 3, 4, 5.0, 6.0, 0, , 1000) -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x408b6574) 2 (t121) -[perl][3] packet sent is delete_object 2 -[java][3] packet recv is delete_object 2 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[java][3] packet recv (callback) is callback false scalar:49.48.49.56 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:49.48.49.56 -[perl][3] packet recv is ok scalar:49.48.49.56 -not ok 1 -# Test 1 got: '1018' (t/12_2_perl_natives.t at line 44) -# Expected: '1024' -[perl][3] matching arguments to array_stub([I, [Ljava.lang.String;) -[perl][4] min = -2147483648, max = 2147483647, val = 34 -[perl][4] min = -2147483648, max = 2147483647, val = 56 -[perl][4] array is [2] -[perl][4] array has 2 declared cells -[perl][4] array should have 2 declared cells -[perl][3] creating object new [I(34, 56) -[perl][3] packet sent is create_object [I (2) scalar:51.52 scalar:53.54 -[java][3] packet recv is create_object [I (2) scalar:51.52 scalar:53.54 -[java][4] class [I is reference -[java][4] class [I is array -[java][4] array elements: int -[java][4] array dimension: 2 -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 34 -[java][4] setting array element 0 to 34 -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 56 -[java][4] setting array element 1 to 56 -[java][3] packet sent is ok object:0:3:[I -[perl][3] packet recv is ok object:0:3:[I -[perl][3] checking if [I is a [I -[perl][3] packet sent is isa [I [I -[java][3] packet recv is isa [I [I -[java][4] checking if [I extends [I -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:48 -[perl][3] packet recv is ok scalar:48 -[perl][3] Inline::Java::Array=ARRAY(0x402b4c84) is a [I -[perl][4] array is [2] -[perl][4] array has 2 declared cells -[perl][4] array should have 2 declared cells -[perl][3] creating object new [Ljava.lang.String;(toto, 789) -[perl][3] packet sent is create_object [Ljava.lang.String; (2) scalar:116.111.116.111 scalar:55.56.57 -[java][3] packet recv is create_object [Ljava.lang.String; (2) scalar:116.111.116.111 scalar:55.56.57 -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] array elements: java.lang.String -[java][4] array dimension: 2 -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is toto -[java][4] setting array element 0 to toto -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 789 -[java][4] setting array element 1 to 789 -[java][3] packet sent is ok object:0:4:[Ljava.lang.String; -[perl][3] packet recv is ok object:0:4:[Ljava.lang.String; -[perl][3] checking if [Ljava.lang.String; is a [Ljava.lang.String; -[perl][3] packet sent is isa [Ljava.lang.String; [Ljava.lang.String; -[java][3] packet recv is isa [Ljava.lang.String; [Ljava.lang.String; -[java][4] checking if [Ljava.lang.String; extends [Ljava.lang.String; -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:48 -[perl][3] packet recv is ok scalar:48 -[perl][3] Inline::Java::Array=ARRAY(0x406fa728) is a [Ljava.lang.String; -[perl][3] match successful: score is 15 -[perl][3] calling object(1).array_stub(Inline::Java::Array=ARRAY(0x402b4c84), Inline::Java::Array=ARRAY(0x406fa728)) -[perl][3] packet sent is call_method 1 t121 array_stub ([I,[Ljava.lang.String;) object:[I:3 object:[Ljava.lang.String;:4 -[java][3] packet recv is call_method 1 t121 array_stub ([I,[Ljava.lang.String;) object:[I:3 object:[Ljava.lang.String;:4 -[java][4] class t121 is reference -[java][3] found a array_stub method -[java][3] ([I,[Ljava.lang.String;) = ([I,[Ljava.lang.String;)? -[java][3] has matching signature ([I,[Ljava.lang.String;) -[java][4] arg 0 of signature is [I -[java][4] class [I is reference -[java][4] class [I is reference -[java][4] checking if [I extends [I -[java][4] [I is a kind of [I -[java][4] arg 1 of signature is [Ljava.lang.String; -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is reference -[java][4] checking if [Ljava.lang.String; extends [Ljava.lang.String; -[java][4] [Ljava.lang.String; is a kind of [Ljava.lang.String; -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@b162d5 -[java][3] InvokePerlMethod argument 1 = [I@186d4c1 -[java][3] InvokePerlMethod argument 2 = [Ljava.lang.String;@f9f9d8 -[java][3] exiting InvokePerlMethod -[java][2] callback command: callback ::t121 array null object:0:5:t121 object:0:6:[I object:0:7:[Ljava.lang.String; -[java][3] packet sent (callback) is callback ::t121 array null object:0:5:t121 object:0:6:[I object:0:7:[Ljava.lang.String; -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][3] checking if stub is array... -[perl][3] creating array object... -[perl][2] creating object in java (Inline::Java::Object): -[perl][3] array object created... -[perl][3] returning stub... -[perl][3] checking if stub is array... -[perl][3] creating array object... -[perl][2] creating object in java (Inline::Java::Object): -[perl][3] array object created... -[perl][3] returning stub... -[perl][2] processing callback main::t121::array(t121=HASH(0x406fa80c), Inline::Java::Array=ARRAY(0x406fa83c), Inline::Java::Array=ARRAY(0x406f9bf4)) -[perl][3] calling object(6).getLength() -[perl][3] packet sent is call_method 6 [I getLength () -[java][3] packet recv is call_method 6 [I getLength () -[java][4] class [I is reference -[java][4] class [I is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -[perl][3] getting object(6)->{0} -[perl][3] packet sent is get_member 6 [I 0 java.lang.Object undef: -[java][3] packet recv is get_member 6 [I 0 java.lang.Object undef: -[java][4] class [I is reference -[java][4] class [I is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:51.52 -[perl][3] packet recv is ok scalar:51.52 -[perl][3] calling object(7).getLength() -[perl][3] packet sent is call_method 7 [Ljava.lang.String; getLength () -[java][3] packet recv is call_method 7 [Ljava.lang.String; getLength () -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -[perl][3] getting object(7)->{1} -[perl][3] packet sent is get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][3] packet recv is get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:55.56.57 -[perl][3] packet recv is ok scalar:55.56.57 -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x406f6e94) 5 (t121) -[perl][3] packet sent is delete_object 5 -[java][3] packet recv is delete_object 5 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x406f9bb8) 7 ([Ljava.lang.String;) -[perl][3] packet sent is delete_object 7 -[java][3] packet recv is delete_object 7 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x406f9c6c) 6 ([I) -[perl][3] packet sent is delete_object 6 -[java][3] packet recv is delete_object 6 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[java][3] packet recv (callback) is callback false scalar:56.50.51 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:56.50.51 -[perl][3] packet recv is ok scalar:56.50.51 -ok 2 -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x406fab4c) 4 ([Ljava.lang.String;) -[perl][3] packet sent is delete_object 4 -[java][3] packet recv is delete_object 4 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x408b65ec) 3 ([I) -[perl][3] packet sent is delete_object 3 -[java][3] packet recv is delete_object 3 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][3] matching arguments to new() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] creating object new t1212() -[perl][3] packet sent is create_object t1212 () -[java][3] packet recv is create_object t1212 () -[java][4] class t1212 is reference -[java][3] found a t1212 constructor -[java][3] () = ()? -[java][3] has matching signature () -[java][3] registering natives for class t1212 -[java][3] packet sent is ok object:0:8:t1212 -[perl][3] packet recv is ok object:0:8:t1212 -[perl][3] matching arguments to types_stub(byte, short, int, long, float, double, boolean, char, java.lang.String) -[perl][4] min = -128, max = 127, val = 1 -[perl][4] min = -32768, max = 32767, val = 2 -[perl][4] min = -2147483648, max = 2147483647, val = 3 -[perl][4] min = -2147483648, max = 2147483647, val = 4 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 5 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 6 -[perl][3] match successful: score is 41 -[perl][3] calling object(8).types_stub(1, 2, 3, 4, 5, 6, 1, 2, 1000) -[perl][3] packet sent is call_method 8 t1212 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][3] packet recv is call_method 8 t1212 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][4] class t1212 is reference -[java][3] found a types_stub method -[java][3] (byte,short,int,long,float,double,boolean,char,java.lang.String) = (byte,short,int,long,float,double,boolean,char,java.lang.String)? -[java][3] has matching signature (byte,short,int,long,float,double,boolean,char,java.lang.String) -[java][4] arg 0 of signature is byte -[java][4] class byte is primitive numeric -[java][4] args is scalar -> forcing to byte -[java][4] result is 1 -[java][4] arg 1 of signature is short -[java][4] class short is primitive numeric -[java][4] args is scalar -> forcing to short -[java][4] result is 2 -[java][4] arg 2 of signature is int -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 3 -[java][4] arg 3 of signature is long -[java][4] class long is primitive numeric -[java][4] args is scalar -> forcing to long -[java][4] result is 4 -[java][4] arg 4 of signature is float -[java][4] class float is primitive numeric -[java][4] args is scalar -> forcing to float -[java][4] result is 5.0 -[java][4] arg 5 of signature is double -[java][4] class double is primitive numeric -[java][4] args is scalar -> forcing to double -[java][4] result is 6.0 -[java][4] arg 6 of signature is boolean -[java][4] class boolean is primitive bool -[java][4] args is scalar -> forcing to bool -[java][4] result is true -[java][4] arg 7 of signature is char -[java][4] class char is primitive char -[java][4] args is scalar -> forcing to char -[java][4] result is 2 -[java][4] arg 8 of signature is java.lang.String -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 1000 -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t1212@7ffe01 -[java][3] InvokePerlMethod argument 1 = 0 -[java][3] InvokePerlMethod argument 2 = 0 -[java][3] InvokePerlMethod argument 3 = 3 -[java][3] InvokePerlMethod argument 4 = 4 -[java][3] InvokePerlMethod argument 5 = 5.0 -[java][3] InvokePerlMethod argument 6 = 6.0 -[java][3] InvokePerlMethod argument 7 = false -[java][3] InvokePerlMethod argument 8 = -[java][3] InvokePerlMethod argument 9 = 1000 -[java][3] exiting InvokePerlMethod -[java][4] class java.lang.Byte is primitive numeric -[java][4] class java.lang.Short is primitive numeric -[java][4] class java.lang.Integer is primitive numeric -[java][4] class java.lang.Long is primitive numeric -[java][4] class java.lang.Float is primitive numeric -[java][4] class java.lang.Double is primitive numeric -[java][4] class java.lang.Boolean is primitive bool -[java][4] class java.lang.Character is primitive char -[java][4] class java.lang.String is primitive string -[java][2] callback command: callback ::t121 types null object:0:9:t1212 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[java][3] packet sent (callback) is callback ::t121 types null object:0:9:t1212 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't1212' ('main::t1212') -[perl][2] creating object in java (main::t1212): -[perl][3] returning stub... -[perl][2] processing callback main::t121::types(main::t1212=HASH(0x406fa728), 0, 0, 3, 4, 5.0, 6.0, 0, , 1000) -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t1212): -[perl][3] deleting object main::t1212=HASH(0x406fa7ac) 9 (t1212) -[perl][3] packet sent is delete_object 9 -[java][3] packet recv is delete_object 9 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[java][3] packet recv (callback) is callback false scalar:49.48.49.56 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:49.48.49.56 -[perl][3] packet recv is ok scalar:49.48.49.56 -not ok 3 -# Test 3 got: '1018' (t/12_2_perl_natives.t at line 48) -# Expected: '1024' -[perl][3] matching arguments to callback_stub() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(1).callback_stub() -[perl][3] packet sent is call_method 1 t121 callback_stub () -[java][3] packet recv is call_method 1 t121 callback_stub () -[java][4] class t121 is reference -[java][3] found a callback_stub method -[java][3] () = ()? -[java][3] has matching signature () -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@b162d5 -[java][3] exiting InvokePerlMethod -[java][2] callback command: callback ::t121 callback null object:0:10:t121 -[java][3] packet sent (callback) is callback ::t121 callback null object:0:10:t121 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][2] processing callback main::t121::callback(t121=HASH(0x406f9ae0)) -[perl][3] matching arguments to get_name() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(10).get_name() -[perl][3] packet sent is call_method 10 t121 get_name () -[java][3] packet recv is call_method 10 t121 get_name () -[java][4] class t121 is reference -[java][3] found a get_name method -[java][3] () = ()? -[java][3] has matching signature () -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:116.111.116.111 -[perl][3] packet recv is ok scalar:116.111.116.111 -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x406f9b58) 10 (t121) -[perl][3] packet sent is delete_object 10 -[java][3] packet recv is delete_object 10 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[java][3] packet recv (callback) is callback false scalar:116.111.116.111 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:116.111.116.111 -[perl][3] packet recv is ok scalar:116.111.116.111 -ok 4 -[perl][3] getting object count -[perl][3] packet sent is obj_cnt -[java][3] packet recv is obj_cnt -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -ok 5 -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x40678628) 1 (t121) -[perl][3] packet sent is delete_object 1 -[java][3] packet recv is delete_object 1 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t1212): -[perl][3] deleting object main::t1212=HASH(0x40681608) 8 (t1212) -[perl][3] packet sent is delete_object 8 -[java][3] packet recv is delete_object 8 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][1] killed by natural death. -[perl][1] JVM owner exiting... -[perl][1] exiting with 0 -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java - - - -###### Now make test without JNI active - -# unset PERL_INLINE_JAVA_DEBUG -# unset PERL_INLINE_JAVA_JNI -# unset LD_PRELOAD - -# make test - PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi -I/opt/perl/lib/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t -t/01_init...........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -Perl version is 5.006001 -Inline version is 0.44 -Inline::Java version is 0.45 -J2SDK version is 1.4.2.01, from /opt/java1.4 -CLASSPATH is - -t/01_init...........ok 1/1 - - t/01_init...........ok -t/02_primitives.....Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/02_primitives.....ok 1/99 - - t/02_primitives.....ok 2/99 - - t/02_primitives.....ok 3/99 - - t/02_primitives.....ok 4/99 - - t/02_primitives.....ok 5/99 - - t/02_primitives.....ok 6/99 - - t/02_primitives.....ok 7/99 - - t/02_primitives.....ok 8/99 - - t/02_primitives.....ok 9/99 - - t/02_primitives.....ok 10/99 - - t/02_primitives.....ok 11/99 - - t/02_primitives.....ok 12/99 - - t/02_primitives.....ok 13/99 - - t/02_primitives.....ok 14/99 - - t/02_primitives.....ok 15/99 - - t/02_primitives.....ok 16/99 - - t/02_primitives.....ok 17/99 - - t/02_primitives.....ok 18/99 - - t/02_primitives.....ok 19/99 - - t/02_primitives.....ok 20/99 - - t/02_primitives.....ok 21/99 - - t/02_primitives.....ok 22/99 - - t/02_primitives.....ok 23/99 - - t/02_primitives.....ok 24/99 - - t/02_primitives.....ok 25/99 - - t/02_primitives.....ok 26/99 - - t/02_primitives.....ok 27/99 - - t/02_primitives.....ok 28/99 - - t/02_primitives.....ok 29/99 - - t/02_primitives.....ok 30/99 - - t/02_primitives.....ok 31/99 - - t/02_primitives.....ok 32/99 - - t/02_primitives.....ok 33/99 - - t/02_primitives.....ok 34/99 - - t/02_primitives.....ok 35/99 - - t/02_primitives.....ok 36/99 - - t/02_primitives.....ok 37/99 - - t/02_primitives.....ok 38/99 - - t/02_primitives.....ok 39/99 - - t/02_primitives.....ok 40/99 - - t/02_primitives.....ok 41/99 - - t/02_primitives.....ok 42/99 - - t/02_primitives.....ok 43/99 - - t/02_primitives.....ok 44/99 - - t/02_primitives.....ok 45/99 - - t/02_primitives.....ok 46/99 - - t/02_primitives.....ok 47/99 - - t/02_primitives.....ok 48/99 - - t/02_primitives.....ok 49/99 - - t/02_primitives.....ok 50/99 - - t/02_primitives.....ok 51/99 - - t/02_primitives.....ok 52/99 - - t/02_primitives.....ok 53/99 - - t/02_primitives.....ok 54/99 - - t/02_primitives.....ok 55/99 - - t/02_primitives.....ok 56/99 - - t/02_primitives.....ok 57/99 - - t/02_primitives.....ok 58/99 - - t/02_primitives.....ok 59/99 - - t/02_primitives.....ok 60/99 - - t/02_primitives.....ok 61/99 - - t/02_primitives.....ok 62/99 - - t/02_primitives.....ok 63/99 - - t/02_primitives.....ok 64/99 - - t/02_primitives.....ok 65/99 - - t/02_primitives.....ok 66/99 - - t/02_primitives.....ok 67/99 - - t/02_primitives.....ok 68/99 - - t/02_primitives.....ok 69/99 - - t/02_primitives.....ok 70/99 - - t/02_primitives.....ok 71/99 - - t/02_primitives.....ok 72/99 - - t/02_primitives.....ok 73/99 - - t/02_primitives.....ok 74/99 - - t/02_primitives.....ok 75/99 - - t/02_primitives.....ok 76/99 - - t/02_primitives.....ok 77/99 - - t/02_primitives.....ok 78/99 - - t/02_primitives.....ok 79/99 - - t/02_primitives.....ok 80/99 - - t/02_primitives.....ok 81/99 - - t/02_primitives.....ok 82/99 - - t/02_primitives.....ok 83/99 - - t/02_primitives.....ok 84/99 - - t/02_primitives.....ok 85/99 - - t/02_primitives.....ok 86/99 - - t/02_primitives.....ok 87/99 - - t/02_primitives.....ok 88/99 - - t/02_primitives.....ok 89/99 - - t/02_primitives.....ok 90/99 - - t/02_primitives.....ok 91/99 - - t/02_primitives.....ok 92/99 - - t/02_primitives.....ok 93/99 - - t/02_primitives.....ok 94/99 - - t/02_primitives.....ok 95/99 - - t/02_primitives.....ok 96/99 - - t/02_primitives.....ok 97/99 - - t/02_primitives.....ok 98/99 - - t/02_primitives.....ok 99/99 - - t/02_primitives.....ok -t/03_objects........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/03_objects........ok 1/16 - - t/03_objects........ok 2/16 - - t/03_objects........ok 3/16 - - t/03_objects........ok 4/16 - - t/03_objects........ok 5/16 - - t/03_objects........ok 6/16 - - t/03_objects........ok 7/16 - - t/03_objects........ok 8/16 - - t/03_objects........ok 9/16 - - t/03_objects........ok 10/16 - - t/03_objects........ok 11/16 - - t/03_objects........ok 12/16 - - t/03_objects........ok 13/16 - - t/03_objects........ok 14/16 - - t/03_objects........ok 15/16 - - t/03_objects........ok 16/16 - - t/03_objects........ok -t/04_members........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/04_members........ok 1/28 - - t/04_members........ok 2/28 - - t/04_members........ok 3/28 - - t/04_members........ok 4/28 - - t/04_members........ok 5/28 - - t/04_members........ok 6/28 - - t/04_members........ok 7/28 - - t/04_members........ok 8/28 - - t/04_members........ok 9/28 - - t/04_members........ok 10/28 - - t/04_members........ok 11/28 - - t/04_members........ok 12/28 - - t/04_members........ok 13/28 - - t/04_members........ok 14/28 - - t/04_members........ok 15/28 - - t/04_members........ok 16/28 - - t/04_members........ok 17/28 - - t/04_members........ok 18/28 - - t/04_members........ok 19/28 - - t/04_members........ok 20/28 - - t/04_members........ok 21/28 - - t/04_members........ok 22/28 - - t/04_members........ok 23/28 - - t/04_members........ok 24/28 - - t/04_members........ok 25/28 - - t/04_members........ok 26/28 - - t/04_members........ok 27/28 - - t/04_members........ok 28/28 - - t/04_members........ok -t/05_arrays.........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/05_arrays.........ok 1/55 - - t/05_arrays.........ok 2/55 - - t/05_arrays.........ok 3/55 - - t/05_arrays.........ok 4/55 - - t/05_arrays.........ok 5/55 - - t/05_arrays.........ok 6/55 - - t/05_arrays.........ok 7/55 - - t/05_arrays.........ok 8/55 - - t/05_arrays.........ok 9/55 - - t/05_arrays.........ok 10/55 - - t/05_arrays.........ok 11/55 - - t/05_arrays.........ok 12/55 - - t/05_arrays.........ok 13/55 - - t/05_arrays.........ok 14/55 - - t/05_arrays.........ok 15/55 - - t/05_arrays.........ok 16/55 - - t/05_arrays.........ok 17/55 - - t/05_arrays.........ok 18/55 - - t/05_arrays.........ok 19/55 - - t/05_arrays.........ok 20/55 - - t/05_arrays.........ok 21/55 - - t/05_arrays.........ok 22/55 - - t/05_arrays.........ok 23/55 - - t/05_arrays.........ok 24/55 - - t/05_arrays.........ok 25/55 - - t/05_arrays.........ok 26/55 - - t/05_arrays.........ok 27/55 - - t/05_arrays.........ok 28/55 - - t/05_arrays.........ok 29/55 - - t/05_arrays.........ok 30/55 - - t/05_arrays.........ok 31/55 - - t/05_arrays.........ok 32/55 - - t/05_arrays.........ok 33/55 - - t/05_arrays.........ok 34/55 - - t/05_arrays.........ok 35/55 - - t/05_arrays.........ok 36/55 - - t/05_arrays.........ok 37/55 - - t/05_arrays.........ok 38/55 - - t/05_arrays.........ok 39/55 - - t/05_arrays.........ok 40/55 - - t/05_arrays.........ok 41/55 - - t/05_arrays.........ok 42/55 - - t/05_arrays.........ok 43/55 - - t/05_arrays.........ok 44/55 - - t/05_arrays.........ok 45/55 - - t/05_arrays.........ok 46/55 - - t/05_arrays.........ok 47/55 - - t/05_arrays.........ok 48/55 - - t/05_arrays.........ok 49/55 - - t/05_arrays.........ok 50/55 - - t/05_arrays.........ok 51/55 - - t/05_arrays.........ok 52/55 - - t/05_arrays.........ok 53/55 - - t/05_arrays.........ok 54/55 - - t/05_arrays.........ok 55/55 - - t/05_arrays.........ok -t/06_static.........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/06_static.........ok 1/10 - - t/06_static.........ok 2/10 - - t/06_static.........ok 3/10 - - t/06_static.........ok 4/10 - - t/06_static.........ok 5/10 - - t/06_static.........ok 6/10 - - t/06_static.........ok 7/10 - - t/06_static.........ok 8/10 - - t/06_static.........ok 9/10 - - t/06_static.........ok 10/10 - - t/06_static.........ok -t/07_polymorph......Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/07_polymorph......ok 1/22 - - t/07_polymorph......ok 2/22 - - t/07_polymorph......ok 3/22 - - t/07_polymorph......ok 4/22 - - t/07_polymorph......ok 5/22 - - t/07_polymorph......ok 6/22 - - t/07_polymorph......ok 7/22 - - t/07_polymorph......ok 8/22 - - t/07_polymorph......ok 9/22 - - t/07_polymorph......ok 10/22 - - t/07_polymorph......ok 11/22 - - t/07_polymorph......ok 12/22 - - t/07_polymorph......ok 13/22 - - t/07_polymorph......ok 14/22 - - t/07_polymorph......ok 15/22 - - t/07_polymorph......ok 16/22 - - t/07_polymorph......ok 17/22 - - t/07_polymorph......ok 18/22 - - t/07_polymorph......ok 19/22 - - t/07_polymorph......ok 20/22 - - t/07_polymorph......ok 21/22 - - t/07_polymorph......ok 22/22 - - t/07_polymorph......ok -t/08_study..........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/08_study..........ok 1/9 - - t/08_study..........ok 2/9 - - t/08_study..........ok 3/9 - - t/08_study..........ok 4/9 - - t/08_study..........ok 5/9 - - t/08_study..........ok 6/9 - - t/08_study..........ok 7/9 - - t/08_study..........ok 8/9 - - t/08_study..........ok 9/9 - - t/08_study..........ok -t/09_usages.........Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/09_usages.........ok 1/4 - - t/09_usages.........ok 2/4 - - t/09_usages.........ok 3/4 - - t/09_usages.........ok 4/4 - - t/09_usages.........ok -t/10_1_shared_alone. -t/10_1_shared_alone.ok 1/4 - - t/10_1_shared_alone.ok 2/4 - - t/10_1_shared_alone.ok 3/4 - - t/10_1_shared_alone.ok 4/4 - - t/10_1_shared_alone.ok -t/10_2_shared_start. -t/10_2_shared_start.ok 1/3 - - t/10_2_shared_start.ok 2/3 - - t/10_2_shared_start.ok 3/3 - - t/10_2_shared_start.ok -t/10_3_shared_use... -t/10_3_shared_use...ok 1/3 - - t/10_3_shared_use...ok 2/3 - - t/10_3_shared_use...ok 3/3 - - t/10_3_shared_use...ok -t/10_4_shared_stop.. -t/10_4_shared_stop..ok 1/4 - - t/10_4_shared_stop..ok 2/4 - - t/10_4_shared_stop..ok 3/4 - - t/10_4_shared_stop..ok 4/4 - - t/10_4_shared_stop..ok -t/10_5_shared_fork.. -t/10_5_shared_fork..ok 1/8 - - t/10_5_shared_fork..ok 2/8 - - t/10_5_shared_fork..ok 3/8 - - t/10_5_shared_fork..ok 4/8 - - t/10_5_shared_fork..ok 5/8 - - t/10_5_shared_fork..ok 6/8 - - t/10_5_shared_fork..ok 7/8 - - t/10_5_shared_fork..ok 8/8 - - t/10_5_shared_fork..ok -t/10_6_shared_sim... -t/10_6_shared_sim...ok 1/7 - - t/10_6_shared_sim...ok 2/7 - - t/10_6_shared_sim...ok 3/7 - - t/10_6_shared_sim...ok 4/7 - - t/10_6_shared_sim...ok 5/7 - - t/10_6_shared_sim...ok 6/7 - - t/10_6_shared_sim...ok 7/7 - - t/10_6_shared_sim...ok -t/11_exceptions.....Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/11_exceptions.....ok 1/8 - - t/11_exceptions.....ok 2/8 - - t/11_exceptions.....ok 3/8 - - t/11_exceptions.....ok 4/8 - - t/11_exceptions.....ok 5/8 - - t/11_exceptions.....ok 6/8 - - t/11_exceptions.....ok 7/8 - - t/11_exceptions.....ok 8/8 - - t/11_exceptions.....ok -t/12_1_callbacks.... -t/12_1_callbacks....ok 1/23 - - t/12_1_callbacks....ok 2/23 - - t/12_1_callbacks....ok 3/23 - - t/12_1_callbacks....ok 4/23 - - t/12_1_callbacks....ok 5/23 - - t/12_1_callbacks....ok 6/23 - - t/12_1_callbacks....ok 7/23 - - t/12_1_callbacks....ok 8/23 - - t/12_1_callbacks....ok 9/23 - - t/12_1_callbacks....ok 10/23 - - t/12_1_callbacks....ok 11/23 - - t/12_1_callbacks....ok 12/23 - - t/12_1_callbacks....ok 13/23 - - t/12_1_callbacks....ok 14/23 - - t/12_1_callbacks....ok 15/23 - - t/12_1_callbacks....ok 16/23 - - t/12_1_callbacks....ok 17/23 - - t/12_1_callbacks....ok 18/23 - - t/12_1_callbacks....ok 19/23 - - t/12_1_callbacks....ok 20/23 - - t/12_1_callbacks....ok 21/23 - - t/12_1_callbacks....ok 22/23 - - t/12_1_callbacks....ok 23/23 - - t/12_1_callbacks....ok -t/12_2_perl_natives. -Note: PerlNatives is still experimental and errors here can safely -be ignored if you don't plan on using this feature. However, the -author would appreciate if errors encountered here were reported -to the mailing list (inline@perl.org) along with your hardware/OS -detail. Thank you. -Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: -Argument "" isn't numeric in addition (+) at t/12_2_perl_natives.t line 71, line 7. - -t/12_2_perl_natives.NOK 1 - - t/12_2_perl_natives.ok 2/5 -Argument "" isn't numeric in addition (+) at t/12_2_perl_natives.t line 71, line 26. - -t/12_2_perl_natives.NOK 3 - - t/12_2_perl_natives.ok 4/5 - - t/12_2_perl_natives.ok 5/5 - - t/12_2_perl_natives.FAILED tests 1, 3 -Failed 2/5 tests, 60.00% okay -t/13_end............Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: - -t/13_end............ok 1/1 - - t/13_end............ok -Failed Test Status Wstat Total Fail Failed List of Failed --------------------------------------------------------------------------------- -t/12_2_perl_natives.t 5 2 40.00% 1, 3 -Failed 1/19 test scripts, 94.74% okay. 2/310 subtests failed, 99.35% okay. -*** Error exit code 255 - -Stop. - -####### Individual t/12_2 test as asked by Mr. LeBoutillier -####### WITHOUT JNI active - -# export PERL_INLINE_JAVA_DEBUG=4 -# perl -Mblib t/12_2_perl_natives.t -Using /opt/Inline-Java-0.45/blib - -Note: PerlNatives is still experimental and errors here can safely -be ignored if you don't plan on using this feature. However, the -author would appreciate if errors encountered here were reported -to the mailing list (inline@perl.org) along with your hardware/OS -detail. Thank you. -[perl][1] validate done. -[perl][1] Starting load. -[perl][4] portable: ENV_VAR_PATH_SEP_CP for hpux is default ':' -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar for hpux is default '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar' -[perl][2] classpath: /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaServer.jar -[perl][1] starting JVM... -[perl][1] client/server mode -[perl][4] portable: GOT_NEXT_FREE_PORT for hpux is default '1' -Could not get next available port number, using port 7890 instead. Use the PORT configuration option to suppress this warning. - Error: -[perl][4] portable: EXE_EXTENSION for hpux is default '' -[perl][4] portable: SUB_FIX_CMD_QUOTES => "/opt/java1.4/bin/java" org.perl.inline.java.InlineJavaServer 4 7890 false false for hpux is default '"/opt/java1.4/bin/java" org.perl.inline.java.InlineJavaServer 4 7890 false false' -[perl][2] "/opt/java1.4/bin/java" org.perl.inline.java.InlineJavaServer 4 7890 false false -[perl][4] portable: DEV_NULL for hpux is default '/dev/null' -[perl][4] portable: GOT_ALARM for hpux is default 'define' -[perl][2] classpath: -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar for hpux is default '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar' -[perl][2] adding to classpath: '/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar' -[perl][3] packet sent is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.98.108.105.98.47.108.105.98.47.73.110.108.105.110.101.47.74.97.118.97.47.73.110.108.105.110.101.74.97.118.97.85.115.101.114.46.106.97.114 -[java][3] packet recv is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.98.108.105.98.47.108.105.98.47.73.110.108.105.110.101.47.74.97.118.97.47.73.110.108.105.110.101.74.97.118.97.85.115.101.114.46.106.97.114 -[java][2] added file:/opt/Inline-Java-0.45/blib/lib/Inline/Java/InlineJavaUser.jar to classpath -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] getting server type -[perl][3] packet sent is server_type -[java][3] packet recv is server_type -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:112.114.105.118.97.116.101 -[perl][3] packet recv is ok scalar:112.114.105.118.97.116.101 -[perl][4] destroying Inline::Java::Protocol -[perl][4] portable: ENV_VAR_PATH_SEP_CP for hpux is default ':' -[perl][2] classpath candidate '' scraped -[perl][4] portable: SUB_FIX_CLASSPATH => /opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54 for hpux is default '/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54' -[perl][2] adding to classpath: '/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54' -[perl][3] packet sent is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.95.73.110.108.105.110.101.95.116.101.115.116.47.108.105.98.47.97.117.116.111.47.95.49.50.95.50.95.112.101.114.108.95.110.97.116.105.118.101.115.95.116.95.57.101.53.52 -[java][3] packet recv is add_classpath 47.111.112.116.47.73.110.108.105.110.101.45.74.97.118.97.45.48.46.52.53.47.95.73.110.108.105.110.101.95.116.101.115.116.47.108.105.98.47.97.117.116.111.47.95.49.50.95.50.95.112.101.114.108.95.110.97.116.105.118.101.115.95.116.95.57.101.53.52 -[java][2] added file:/opt/Inline-Java-0.45/_Inline_test/lib/auto/_12_2_perl_natives_t_9e54/ to classpath -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] Inline::Java object id is 0 -[perl][1] using jdat cache -[perl][3] perl doesn't know about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] perl doesn't know about 't1212' ('main::t1212') -[perl][2] creating object in java (main::t1212): -[perl][1] load done. -[perl][4] destroying Inline::Java::Protocol -[perl][3] matching arguments to init() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(0).init() -[perl][3] packet sent is call_method 0 t121 init () -[java][3] packet recv is call_method 0 t121 init () -[java][4] class t121 is reference -[java][3] found a init method -[java][3] () = ()? -[java][3] has matching signature () -[java][1] loading InlineJavaUserClassLink via InlineJavaUserClassLoader -[java][2] loading shared library /opt/Inline-Java-0.45/blib/arch/auto/Inline/Java/Natives/Natives.sl -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -1..5 -[perl][3] matching arguments to init() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(0).init() -[perl][3] packet sent is call_method 0 t121 init () -[java][3] packet recv is call_method 0 t121 init () -[java][4] class t121 is reference -[java][3] method was cached -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][3] matching arguments to new() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] creating object new t121() -[perl][3] packet sent is create_object t121 () -[java][3] packet recv is create_object t121 () -[java][4] class t121 is reference -[java][3] found a t121 constructor -[java][3] () = ()? -[java][3] has matching signature () -[java][3] registering natives for class t121 -[java][3] registering native method array for class t121 -[java][3] signature is ([I[Ljava/lang/String;)Ljava/lang/String; -[java][3] format is LLL -[java][3] registering native method types for class t121 -[java][3] signature is (BSIJFDZCLjava/lang/String;)Ljava/lang/String; -[java][3] format is LBSIJFDZCL -[java][3] registering native method callback for class t121 -[java][3] signature is ()Ljava/lang/String; -[java][3] format is L -[java][3] packet sent is ok object:0:1:t121 -[perl][3] packet recv is ok object:0:1:t121 -[perl][3] matching arguments to types_stub(byte, short, int, long, float, double, boolean, char, java.lang.String) -[perl][4] min = -128, max = 127, val = 1 -[perl][4] min = -32768, max = 32767, val = 2 -[perl][4] min = -2147483648, max = 2147483647, val = 3 -[perl][4] min = -2147483648, max = 2147483647, val = 4 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 5 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 6 -[perl][3] match successful: score is 41 -[perl][3] calling object(1).types_stub(1, 2, 3, 4, 5, 6, 1, 2, 1000) -[perl][3] packet sent is call_method 1 t121 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][3] packet recv is call_method 1 t121 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][4] class t121 is reference -[java][3] found a types_stub method -[java][3] (byte,short,int,long,float,double,boolean,char,java.lang.String) = (byte,short,int,long,float,double,boolean,char,java.lang.String)? -[java][3] has matching signature (byte,short,int,long,float,double,boolean,char,java.lang.String) -[java][4] arg 0 of signature is byte -[java][4] class byte is primitive numeric -[java][4] args is scalar -> forcing to byte -[java][4] result is 1 -[java][4] arg 1 of signature is short -[java][4] class short is primitive numeric -[java][4] args is scalar -> forcing to short -[java][4] result is 2 -[java][4] arg 2 of signature is int -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 3 -[java][4] arg 3 of signature is long -[java][4] class long is primitive numeric -[java][4] args is scalar -> forcing to long -[java][4] result is 4 -[java][4] arg 4 of signature is float -[java][4] class float is primitive numeric -[java][4] args is scalar -> forcing to float -[java][4] result is 5.0 -[java][4] arg 5 of signature is double -[java][4] class double is primitive numeric -[java][4] args is scalar -> forcing to double -[java][4] result is 6.0 -[java][4] arg 6 of signature is boolean -[java][4] class boolean is primitive bool -[java][4] args is scalar -> forcing to bool -[java][4] result is true -[java][4] arg 7 of signature is char -[java][4] class char is primitive char -[java][4] args is scalar -> forcing to char -[java][4] result is 2 -[java][4] arg 8 of signature is java.lang.String -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 1000 -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@117a8bd -[java][3] InvokePerlMethod argument 1 = 0 -[java][3] InvokePerlMethod argument 2 = 0 -[java][3] InvokePerlMethod argument 3 = 3 -[java][3] InvokePerlMethod argument 4 = 4 -[java][3] InvokePerlMethod argument 5 = 5.0 -[java][3] InvokePerlMethod argument 6 = 6.0 -[java][3] InvokePerlMethod argument 7 = false -[java][3] InvokePerlMethod argument 8 = -[java][3] InvokePerlMethod argument 9 = 1000 -[java][3] exiting InvokePerlMethod -[java][4] class java.lang.Byte is primitive numeric -[java][4] class java.lang.Short is primitive numeric -[java][4] class java.lang.Integer is primitive numeric -[java][4] class java.lang.Long is primitive numeric -[java][4] class java.lang.Float is primitive numeric -[java][4] class java.lang.Double is primitive numeric -[java][4] class java.lang.Boolean is primitive bool -[java][4] class java.lang.Character is primitive char -[java][4] class java.lang.String is primitive string -[java][2] callback command: callback ::t121 types null object:0:2:t121 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[java][3] packet sent (callback) is callback ::t121 types null object:0:2:t121 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] packet recv is callback ::t121 types null object:0:2:t121 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][2] processing callback main::t121::types(t121=HASH(0x4053f8e0), 0, 0, 3, 4, 5.0, 6.0, 0, , 1000) -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x4056abf8) 2 (t121) -[perl][3] packet sent is delete_object 2 -[java][3] packet recv (callback) is delete_object 2 -[java][3] packet is not callback response: delete_object 2 -[java][3] packet recv is delete_object 2 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[perl][3] packet sent is callback false scalar:49.48.49.56 -[java][3] packet recv (callback) is callback false scalar:49.48.49.56 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:49.48.49.56 -[perl][3] packet recv is ok scalar:49.48.49.56 -not ok 1 -# Test 1 got: '1018' (t/12_2_perl_natives.t at line 44) -# Expected: '1024' -[perl][3] matching arguments to array_stub([I, [Ljava.lang.String;) -[perl][4] min = -2147483648, max = 2147483647, val = 34 -[perl][4] min = -2147483648, max = 2147483647, val = 56 -[perl][4] array is [2] -[perl][4] array has 2 declared cells -[perl][4] array should have 2 declared cells -[perl][3] creating object new [I(34, 56) -[perl][3] packet sent is create_object [I (2) scalar:51.52 scalar:53.54 -[java][3] packet recv is create_object [I (2) scalar:51.52 scalar:53.54 -[java][4] class [I is reference -[java][4] class [I is array -[java][4] array elements: int -[java][4] array dimension: 2 -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 34 -[java][4] setting array element 0 to 34 -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 56 -[java][4] setting array element 1 to 56 -[java][3] packet sent is ok object:0:3:[I -[perl][3] packet recv is ok object:0:3:[I -[perl][3] checking if [I is a [I -[perl][3] packet sent is isa [I [I -[java][3] packet recv is isa [I [I -[java][4] checking if [I extends [I -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:48 -[perl][3] packet recv is ok scalar:48 -[perl][3] Inline::Java::Array=ARRAY(0x40147504) is a [I -[perl][4] array is [2] -[perl][4] array has 2 declared cells -[perl][4] array should have 2 declared cells -[perl][3] creating object new [Ljava.lang.String;(toto, 789) -[perl][3] packet sent is create_object [Ljava.lang.String; (2) scalar:116.111.116.111 scalar:55.56.57 -[java][3] packet recv is create_object [Ljava.lang.String; (2) scalar:116.111.116.111 scalar:55.56.57 -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] array elements: java.lang.String -[java][4] array dimension: 2 -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is toto -[java][4] setting array element 0 to toto -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 789 -[java][4] setting array element 1 to 789 -[java][3] packet sent is ok object:0:4:[Ljava.lang.String; -[perl][3] packet recv is ok object:0:4:[Ljava.lang.String; -[perl][3] checking if [Ljava.lang.String; is a [Ljava.lang.String; -[perl][3] packet sent is isa [Ljava.lang.String; [Ljava.lang.String; -[java][3] packet recv is isa [Ljava.lang.String; [Ljava.lang.String; -[java][4] checking if [Ljava.lang.String; extends [Ljava.lang.String; -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:48 -[perl][3] packet recv is ok scalar:48 -[perl][3] Inline::Java::Array=ARRAY(0x405b203c) is a [Ljava.lang.String; -[perl][3] match successful: score is 15 -[perl][3] calling object(1).array_stub(Inline::Java::Array=ARRAY(0x40147504), Inline::Java::Array=ARRAY(0x405b203c)) -[perl][3] packet sent is call_method 1 t121 array_stub ([I,[Ljava.lang.String;) object:[I:3 object:[Ljava.lang.String;:4 -[java][3] packet recv is call_method 1 t121 array_stub ([I,[Ljava.lang.String;) object:[I:3 object:[Ljava.lang.String;:4 -[java][4] class t121 is reference -[java][3] found a array_stub method -[java][3] ([I,[Ljava.lang.String;) = ([I,[Ljava.lang.String;)? -[java][3] has matching signature ([I,[Ljava.lang.String;) -[java][4] arg 0 of signature is [I -[java][4] class [I is reference -[java][4] class [I is reference -[java][4] checking if [I extends [I -[java][4] [I is a kind of [I -[java][4] arg 1 of signature is [Ljava.lang.String; -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is reference -[java][4] checking if [Ljava.lang.String; extends [Ljava.lang.String; -[java][4] [Ljava.lang.String; is a kind of [Ljava.lang.String; -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@117a8bd -[java][3] InvokePerlMethod argument 1 = [I@10ef90c -[java][3] InvokePerlMethod argument 2 = [Ljava.lang.String;@a32b -[java][3] exiting InvokePerlMethod -[java][2] callback command: callback ::t121 array null object:0:5:t121 object:0:6:[I object:0:7:[Ljava.lang.String; -[java][3] packet sent (callback) is callback ::t121 array null object:0:5:t121 object:0:6:[I object:0:7:[Ljava.lang.String; -[perl][3] packet recv is callback ::t121 array null object:0:5:t121 object:0:6:[I object:0:7:[Ljava.lang.String; -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][3] checking if stub is array... -[perl][3] creating array object... -[perl][2] creating object in java (Inline::Java::Object): -[perl][3] array object created... -[perl][3] returning stub... -[perl][3] checking if stub is array... -[perl][3] creating array object... -[perl][2] creating object in java (Inline::Java::Object): -[perl][3] array object created... -[perl][3] returning stub... -[perl][2] processing callback main::t121::array(t121=HASH(0x405b2120), Inline::Java::Array=ARRAY(0x405b2150), Inline::Java::Array=ARRAY(0x4056b554)) -[perl][3] calling object(6).getLength() -[perl][3] packet sent is call_method 6 [I getLength () -[java][3] packet recv (callback) is call_method 6 [I getLength () -[java][3] packet is not callback response: call_method 6 [I getLength () -[java][3] packet recv is call_method 6 [I getLength () -[java][4] class [I is reference -[java][4] class [I is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[java][3] packet sent (callback) is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -[perl][3] getting object(6)->{0} -[perl][3] packet sent is get_member 6 [I 0 java.lang.Object undef: -[java][3] packet recv (callback) is get_member 6 [I 0 java.lang.Object undef: -[java][3] packet is not callback response: get_member 6 [I 0 java.lang.Object undef: -[java][3] packet recv is get_member 6 [I 0 java.lang.Object undef: -[java][4] class [I is reference -[java][4] class [I is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:51.52 -[java][3] packet sent (callback) is ok scalar:51.52 -[perl][3] packet recv is ok scalar:51.52 -[perl][3] calling object(7).getLength() -[perl][3] packet sent is call_method 7 [Ljava.lang.String; getLength () -[java][3] packet recv (callback) is call_method 7 [Ljava.lang.String; getLength () -[java][3] packet is not callback response: call_method 7 [Ljava.lang.String; getLength () -[java][3] packet recv is call_method 7 [Ljava.lang.String; getLength () -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[java][3] packet sent (callback) is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -[perl][3] getting object(7)->{1} -[perl][3] packet sent is get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][3] packet recv (callback) is get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][3] packet is not callback response: get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][3] packet recv is get_member 7 [Ljava.lang.String; 1 java.lang.Object undef: -[java][4] class [Ljava.lang.String; is reference -[java][4] class [Ljava.lang.String; is array -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:55.56.57 -[java][3] packet sent (callback) is ok scalar:55.56.57 -[perl][3] packet recv is ok scalar:55.56.57 -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x405b2ca0) 5 (t121) -[perl][3] packet sent is delete_object 5 -[java][3] packet recv (callback) is delete_object 5 -[java][3] packet is not callback response: delete_object 5 -[java][3] packet recv is delete_object 5 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x4056b518) 7 ([Ljava.lang.String;) -[perl][3] packet sent is delete_object 7 -[java][3] packet recv (callback) is delete_object 7 -[java][3] packet is not callback response: delete_object 7 -[java][3] packet recv is delete_object 7 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x4056b5cc) 6 ([I) -[perl][3] packet sent is delete_object 6 -[java][3] packet recv (callback) is delete_object 6 -[java][3] packet is not callback response: delete_object 6 -[java][3] packet recv is delete_object 6 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[perl][3] packet sent is callback false scalar:56.50.51 -[java][3] packet recv (callback) is callback false scalar:56.50.51 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:56.50.51 -[perl][3] packet recv is ok scalar:56.50.51 -ok 2 -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x405b2da8) 4 ([Ljava.lang.String;) -[perl][3] packet sent is delete_object 4 -[java][3] packet recv is delete_object 4 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Array -[perl][4] destroying Inline::Java::Array::Tie -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (Inline::Java::Object): -[perl][3] deleting object Inline::Java::Object=HASH(0x405ab600) 3 ([I) -[perl][3] packet sent is delete_object 3 -[java][3] packet recv is delete_object 3 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][3] matching arguments to new() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] creating object new t1212() -[perl][3] packet sent is create_object t1212 () -[java][3] packet recv is create_object t1212 () -[java][4] class t1212 is reference -[java][3] found a t1212 constructor -[java][3] () = ()? -[java][3] has matching signature () -[java][3] registering natives for class t1212 -[java][3] packet sent is ok object:0:8:t1212 -[perl][3] packet recv is ok object:0:8:t1212 -[perl][3] matching arguments to types_stub(byte, short, int, long, float, double, boolean, char, java.lang.String) -[perl][4] min = -128, max = 127, val = 1 -[perl][4] min = -32768, max = 32767, val = 2 -[perl][4] min = -2147483648, max = 2147483647, val = 3 -[perl][4] min = -2147483648, max = 2147483647, val = 4 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 5 -[perl][4] min = -3.4028235e+38, max = 3.4028235e+38, val = 6 -[perl][3] match successful: score is 41 -[perl][3] calling object(8).types_stub(1, 2, 3, 4, 5, 6, 1, 2, 1000) -[perl][3] packet sent is call_method 8 t1212 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][3] packet recv is call_method 8 t1212 types_stub (byte,short,int,long,float,double,boolean,char,java.lang.String) scalar:49 scalar:50 scalar:51 scalar:52 scalar:53 scalar:54 scalar:49 scalar:50 scalar:49.48.48.48 -[java][4] class t1212 is reference -[java][3] found a types_stub method -[java][3] (byte,short,int,long,float,double,boolean,char,java.lang.String) = (byte,short,int,long,float,double,boolean,char,java.lang.String)? -[java][3] has matching signature (byte,short,int,long,float,double,boolean,char,java.lang.String) -[java][4] arg 0 of signature is byte -[java][4] class byte is primitive numeric -[java][4] args is scalar -> forcing to byte -[java][4] result is 1 -[java][4] arg 1 of signature is short -[java][4] class short is primitive numeric -[java][4] args is scalar -> forcing to short -[java][4] result is 2 -[java][4] arg 2 of signature is int -[java][4] class int is primitive numeric -[java][4] args is scalar -> forcing to int -[java][4] result is 3 -[java][4] arg 3 of signature is long -[java][4] class long is primitive numeric -[java][4] args is scalar -> forcing to long -[java][4] result is 4 -[java][4] arg 4 of signature is float -[java][4] class float is primitive numeric -[java][4] args is scalar -> forcing to float -[java][4] result is 5.0 -[java][4] arg 5 of signature is double -[java][4] class double is primitive numeric -[java][4] args is scalar -> forcing to double -[java][4] result is 6.0 -[java][4] arg 6 of signature is boolean -[java][4] class boolean is primitive bool -[java][4] args is scalar -> forcing to bool -[java][4] result is true -[java][4] arg 7 of signature is char -[java][4] class char is primitive char -[java][4] args is scalar -> forcing to char -[java][4] result is 2 -[java][4] arg 8 of signature is java.lang.String -[java][4] class java.lang.String is primitive string -[java][4] args is scalar -> forcing to java.lang.String -[java][4] result is 1000 -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t1212@12152e6 -[java][3] InvokePerlMethod argument 1 = 0 -[java][3] InvokePerlMethod argument 2 = 0 -[java][3] InvokePerlMethod argument 3 = 3 -[java][3] InvokePerlMethod argument 4 = 4 -[java][3] InvokePerlMethod argument 5 = 5.0 -[java][3] InvokePerlMethod argument 6 = 6.0 -[java][3] InvokePerlMethod argument 7 = false -[java][3] InvokePerlMethod argument 8 = -[java][3] InvokePerlMethod argument 9 = 1000 -[java][3] exiting InvokePerlMethod -[java][4] class java.lang.Byte is primitive numeric -[java][4] class java.lang.Short is primitive numeric -[java][4] class java.lang.Integer is primitive numeric -[java][4] class java.lang.Long is primitive numeric -[java][4] class java.lang.Float is primitive numeric -[java][4] class java.lang.Double is primitive numeric -[java][4] class java.lang.Boolean is primitive bool -[java][4] class java.lang.Character is primitive char -[java][4] class java.lang.String is primitive string -[java][2] callback command: callback ::t121 types null object:0:9:t1212 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[java][3] packet sent (callback) is callback ::t121 types null object:0:9:t1212 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] packet recv is callback ::t121 types null object:0:9:t1212 scalar:48 scalar:48 scalar:51 scalar:52 scalar:53.46.48 scalar:54.46.48 scalar:48 scalar:0 scalar:49.48.48.48 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't1212' ('main::t1212') -[perl][2] creating object in java (main::t1212): -[perl][3] returning stub... -[perl][2] processing callback main::t121::types(main::t1212=HASH(0x405b203c), 0, 0, 3, 4, 5.0, 6.0, 0, , 1000) -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t1212): -[perl][3] deleting object main::t1212=HASH(0x40541d68) 9 (t1212) -[perl][3] packet sent is delete_object 9 -[java][3] packet recv (callback) is delete_object 9 -[java][3] packet is not callback response: delete_object 9 -[java][3] packet recv is delete_object 9 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[perl][3] packet sent is callback false scalar:49.48.49.56 -[java][3] packet recv (callback) is callback false scalar:49.48.49.56 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:49.48.49.56 -[perl][3] packet recv is ok scalar:49.48.49.56 -not ok 3 -# Test 3 got: '1018' (t/12_2_perl_natives.t at line 48) -# Expected: '1024' -[perl][3] matching arguments to callback_stub() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(1).callback_stub() -[perl][3] packet sent is call_method 1 t121 callback_stub () -[java][3] packet recv is call_method 1 t121 callback_stub () -[java][4] class t121 is reference -[java][3] found a callback_stub method -[java][3] () = ()? -[java][3] has matching signature () -[java][3] entering LookupMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] exiting LookupMethod -[java][3] entering InvokePerlMethod -[java][3] entering GetNativeCaller -[java][3] exiting GetNativeCaller -[java][3] InvokePerlMethod argument 0 = t121@117a8bd -[java][3] exiting InvokePerlMethod -[java][2] callback command: callback ::t121 callback null object:0:10:t121 -[java][3] packet sent (callback) is callback ::t121 callback null object:0:10:t121 -[perl][3] packet recv is callback ::t121 callback null object:0:10:t121 -[perl][3] checking if stub is array... -[perl][3] perl knows about 't121' ('main::t121') -[perl][2] creating object in java (main::t121): -[perl][3] returning stub... -[perl][2] processing callback main::t121::callback(t121=HASH(0x4056b434)) -[perl][3] matching arguments to get_name() -[perl][3] match successful: score is 0 -[perl][3] perfect match found, aborting search -[perl][3] calling object(10).get_name() -[perl][3] packet sent is call_method 10 t121 get_name () -[java][3] packet recv (callback) is call_method 10 t121 get_name () -[java][3] packet is not callback response: call_method 10 t121 get_name () -[java][3] packet recv is call_method 10 t121 get_name () -[java][4] class t121 is reference -[java][3] found a get_name method -[java][3] () = ()? -[java][3] has matching signature () -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:116.111.116.111 -[java][3] packet sent (callback) is ok scalar:116.111.116.111 -[perl][3] packet recv is ok scalar:116.111.116.111 -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x4056b548) 10 (t121) -[perl][3] packet sent is delete_object 10 -[java][3] packet recv (callback) is delete_object 10 -[java][3] packet is not callback response: delete_object 10 -[java][3] packet recv is delete_object 10 -[java][3] packet sent is ok undef: -[java][3] packet sent (callback) is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Protocol -[perl][3] packet sent is callback false scalar:116.111.116.111 -[java][3] packet recv (callback) is callback false scalar:116.111.116.111 -[java][4] class java.lang.Object is reference -[java][4] class java.lang.String is primitive string -[java][3] packet sent is ok scalar:116.111.116.111 -[perl][3] packet recv is ok scalar:116.111.116.111 -ok 4 -[perl][3] getting object count -[perl][3] packet sent is obj_cnt -[java][3] packet recv is obj_cnt -[java][4] class java.lang.Integer is primitive numeric -[java][3] packet sent is ok scalar:50 -[perl][3] packet recv is ok scalar:50 -ok 5 -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t121): -[perl][3] deleting object t121=HASH(0x4053f964) 1 (t121) -[perl][3] packet sent is delete_object 1 -[java][3] packet recv is delete_object 1 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object -[perl][4] destroying Inline::Java::Object::Tie -[perl][2] destroying object in java (main::t1212): -[perl][3] deleting object main::t1212=HASH(0x4055a518) 8 (t1212) -[perl][3] packet sent is delete_object 8 -[java][3] packet recv is delete_object 8 -[java][3] packet sent is ok undef: -[perl][3] packet recv is ok undef: -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][1] killed by natural death. -[perl][1] JVM owner exiting... -[perl][1] Sending 'die' message to JVM... -[perl][4] portable: GOT_SAFE_SIGNALS for hpux is default '1' -[perl][1] Sending 15 signal to JVM... -[perl][1] Sending 9 signal to JVM... -[perl][1] exiting with 0 -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Protocol -[perl][4] destroying Inline::Java::Object::Private -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -[perl][4] destroying Inline::Java::Object::Tie -[perl][4] script marked as DONE, object destruction not propagated to Java -# [java][3] packet recv is die -[java][1] received a request to die... -# -# \ No newline at end of file diff -Nru libinline-java-perl-0.58~dfsg/bug/p3.pl libinline-java-perl-0.66/bug/p3.pl --- libinline-java-perl-0.58~dfsg/bug/p3.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/p3.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -use blib ; -use vars qw($JARS); -BEGIN { - $JARS = '/home/patrickl/perl/dev/Inline-Java/bug/piccolo-1.0/build' ; -} -use Inline Java => Config => - CLASSPATH => "$JARS/piccolo.jar:$JARS/piccolox.jar:$JARS/examples.jar"; -use Inline::Java qw(study_classes) ; -study_classes(['java.awt.Color', - 'edu.umd.cs.piccolo.nodes.PPath', - 'edu.umd.cs.piccolo.nodes.PText', - 'edu.umd.cs.piccolo.PCanvas', - 'edu.umd.cs.piccolo.PLayer', - 'java.awt.BasicStroke', - ]); -use Inline Java => 'DATA'; - -use Getopt::Long; -my %OPTIONS; -my $rc = GetOptions(\%OPTIONS, - 'input=s', - 'help', - ); - -my $USAGE = <<"EOU"; -usage: $0 [required params] [options] - require params: - --input=file : gaps file to process - - options: - --help : this message -EOU - -die "Bad option\n$USAGE" unless $rc; -die "$USAGE" if exists $OPTIONS{help}; - -die "Must specify --input\n$USAGE" - unless exists $OPTIONS{input}; - -# create the Java connection -my $t = new Test(); - -# set up some useful constants -my $UNIT = 10; -my $STROKE = java::awt::BasicStroke->new($UNIT); - -# read in the file data -open(IN,$OPTIONS{input}) - or die "Couldn't open $OPTIONS{input} for reading"; -while () { - my ($ref_pos,$query_pos,$length) = m/^\s+(\d+)\s+(\d+)\s+(\d+)\s+/; - push(@gaps,[$ref_pos,$query_pos,$length]); -} -my $max_ref = $gaps[-1]->[0] + $gaps[-1]->[2]; -my $max_query = $gaps[-1]->[1] + $gaps[-1]->[2]; - -# get access to some picolo internal objects -my $c = $t->getCanvas(); -my $layer = $c->getLayer(); - -# create rectangles for the landmarks -for (my $i=0;$i<$max_ref;$i+=10_000) { - print "$i\n" ; - my $r = edu::umd::cs::piccolo::nodes::PPath->createRectangle($i-$UNIT, - $i-$UNIT, - 2*$UNIT, - 2*$UNIT); - $r->setPaint($java::awt::Color::RED); - $layer->addChild($r); - -# FIXME - this line causes the following error: -# Method createPolyline for class edu.umd.cs.piccolo.nodes.PPath with signature ([F,[F) not found at (eval 10) line 1159 -my $text = edu::umd::cs::piccolo::nodes::PText->new("$i"); -$text->setOffset($i,$i); -$layer->addChild($text); - -# FIXME - this line causes the following error: -# Method createPolyline for class edu.umd.cs.piccolo.nodes.PPath with signature ([F,[F) not found at (eval 10) line 1159 -# -# unless you comment out the foreach loop for drawing lines - my $text = $t->getText("$i"); - $text->setOffset($i,$i); - $layer->addChild($text); -} - -my $tag = 0; -my $i = 0 ; -foreach my $gap (@gaps) { - print "$i\n" ; $i++ ; - - my $l = edu::umd::cs::piccolo::nodes::PPath->createPolyline([$gap->[0],$gap->[0]+$gap->[2]], - [$gap->[1],$gap->[1]+$gap->[2]], - ); - $l->setStroke($STROKE); - if ($tag) { - $l->setStrokePaint($java::awt::Color::BLUE); - $tag = 0; - } else { - $l->setStrokePaint($java::awt::Color::GREEN); - $tag = 1; - } -# FIXME - this line causes the following error: -# Method createPolyline for class edu.umd.cs.piccolo.nodes.PPath with signature ([F,[F) not found at (eval 10) line 1159 - $layer->addChild($l); - -# so instead I've created a bogus wrapper method to do the work -# $t->addChild($l); - -} - -while (1) { - sleep 5; -} -print "Finished\n"; - -__DATA__ - -__Java__ - -import java.awt.BasicStroke; -import java.awt.Paint; -// import java.awt.Color; -// import java.awt.Graphics2D; -// import edu.umd.cs.piccolo.activities.PActivity; -// import edu.umd.cs.piccolo.util.PPaintContext; -import edu.umd.cs.piccolo.PLayer; -import edu.umd.cs.piccolo.PCanvas; -import edu.umd.cs.piccolo.PNode; -import edu.umd.cs.piccolox.PFrame; -import edu.umd.cs.piccolo.nodes.PPath; -import edu.umd.cs.piccolo.nodes.PText; - -class Test extends PFrame { - - public Test() { - super(); - } - public void addChild(PNode aNode) { - PLayer layer = getCanvas().getLayer(); - layer.addChild(aNode); - } - public PText getText(String s) { - return new PText(s); - } - public void initialize() { - long currentTime = System.currentTimeMillis(); - } -} -/* -public class SemanticPath extends PPath { - public void paint(PPaintContext aPaintContext) { - double s = aPaintContext.getScale(); - Graphics2D g2 = aPaintContext.getGraphics(); - - if (s < 1) { - g2.setPaint(Color.blue); - } else { - g2.setPaint(Color.orange); - } - - g2.fill(getBoundsReference()); - } -} -*/ diff -Nru libinline-java-perl-0.58~dfsg/bug/PerlObject.java libinline-java-perl-0.66/bug/PerlObject.java --- libinline-java-perl-0.58~dfsg/bug/PerlObject.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/PerlObject.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -import org.perl.inline.java.*; - -// Metodklass som används av Java! -public class PerlObject extends InlineJavaPerlCaller { - String perlName; - // Konstruktor - public PerlObject(String perlName) throws InlineJavaException { - this.perlName = perlName; - } - // Metod för att kalla på Perlobjektens egna metoder. - public Object method (String methodName) { - try { - Object ret = CallPerl( "main", "perlMethods", new Object[] {perlName, methodName} ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } - public Object method (String methodName, Object arg) { - try { - Object ret = CallPerl( "main", "perlMethods", new Object[] {perlName, methodName, arg} ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } - public Object method (String methodName, Object arg[]) { - try { - Object[] perlArg = new Object [arg.length+2]; - perlArg[0] = perlName; - perlArg[1] = methodName; - for (int i = 0; i < arg.length; i++) { - perlArg[i+2] = arg[i]; - } - Object ret = CallPerl( "main", "perlMethods", perlArg ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/Person.pm libinline-java-perl-0.66/bug/Person.pm --- libinline-java-perl-0.58~dfsg/bug/Person.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Person.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -package Person; -use strict; - -require Exporter; -our @ISA = qw(Exporter); -our @EXPORT_OK = qw(); - - ################################################## - ## the object constructor (simplistic version) ## - ################################################## - sub new { - my $self = {}; - $self->{NAME} = undef; - $self->{AGE} = undef; - $self->{PEERS} = []; - bless($self); # but see below - return $self; - } - ############################################## - ## methods to access per-object data ## - ## ## - ## With args, they set the value. Without ## - ## any, they only retrieve it/them. ## - ############################################## - sub name { - my $self = shift; - if (@_) { $self->{NAME} = shift } - return $self->{NAME}; - } - sub age { - my $self = shift; - if (@_) { $self->{AGE} = shift } - return $self->{AGE}; - } - sub peers { - my $self = shift; - if (@_) { @{ $self->{PEERS} } = @_ } - return @{ $self->{PEERS} }; - } - -1; \ No newline at end of file diff -Nru libinline-java-perl-0.58~dfsg/bug/PKG1.pm libinline-java-perl-0.66/bug/PKG1.pm --- libinline-java-perl-0.58~dfsg/bug/PKG1.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/PKG1.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -package PKG1; - -use strict; -use warnings; - -use Inline Java => "DATA"; - -sub new -{ - my $class = shift; - return PKG1::PKG1->new(@_); -} - -1; - -__DATA__ -__Java__ -import java.util.*; -import java.io.*; - -public class PKG1 { - public static String hello(){ - return "hello" ; - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/PKG2.pm libinline-java-perl-0.66/bug/PKG2.pm --- libinline-java-perl-0.58~dfsg/bug/PKG2.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/PKG2.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -package PKG2; - -use strict; -use warnings; -use PKG1 ; - -sub callpkg1 { - print "allo1\n" ; - print PKG1::PKG1->hello() ; - print "allo2\n" ; -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/bug/Program.java libinline-java-perl-0.66/bug/Program.java --- libinline-java-perl-0.58~dfsg/bug/Program.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/Program.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -import org.perl.inline.java.*; - -public class Program { - - // Grundvärden - PerlObject him = new PerlObject("$him"); - - // Konstruktor - public Program() throws InlineJavaException { - } - // Metod som gör något... - public void work () { - // Här skrivs skriptet i Java! - - - String T = (String)him.method("name"); - if (T.equals("Nisse") ) - //him.method("name","Knut-Göran"); - him.method("name", new Object[] {"Knut-Göran" } ); - else - him.method("name","Kurt-Arne"); - him.method("peers", new Object[] {"Tuve", "Bernt-Arne", "Nyman"} ); - - - // Här slutar skriptet som skrivits i Java! - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/roger2.pl libinline-java-perl-0.66/bug/roger2.pl --- libinline-java-perl-0.58~dfsg/bug/roger2.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/roger2.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -#!/usr/bin/perl -w - -use warnings; - -use Inline ( - Java => 'DATA', - DEBUG => 0, -) ; - -my $obj = JavaTestClass->new(); - -$obj->test(); - -#------------------------------------------------------------------------ - -package MODULE; - -use Exporter; - -@ISA = ('Exporter'); -@EXPORT_OK = (); - -use strict; - -sub new{ - my $proto = shift; - my $class = ref($proto) || $proto; - my $self = {}; - bless($self,$class); - return($self); -}; - -1; - -package main ; -__DATA__ - -__Java__ - - -import org.perl.inline.java.* ; - -class JavaTestClass extends InlineJavaPerlCaller { - - public JavaTestClass() throws InlineJavaException - { System.out.println("JavaTestClass::Constructor"); } - - public void test() throws InlineJavaPerlException - { - System.out.println("JavaTestClass::test"); - try - { - // require("MODULE"); - InlineJavaPerlObject po = new InlineJavaPerlObject("MODULE", null ); - System.out.println("created InlineJavaPerlObject"); - } catch (InlineJavaException e) { e.printStackTrace(); } - - } -} - diff -Nru libinline-java-perl-0.58~dfsg/bug/roger.pl libinline-java-perl-0.66/bug/roger.pl --- libinline-java-perl-0.58~dfsg/bug/roger.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/roger.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -use warnings; - -use Inline ( - Java => 'DATA', - DEBUG => 0, -) ; - -package UPPER_MODULE::LOWER_MODULE; - -use Exporter; - -@ISA = ('Exporter'); -@EXPORT_OK = (); - -use strict; - -sub new{ - my $proto = shift; - my $class = ref($proto) || $proto; - my $self = {}; - bless($self,$class); - return($self); -}; - -package main ; - - -my $obj = JavaTestClass->new(); - -$obj->test(); - - -__DATA__ - -__Java__ - - -import org.perl.inline.java.* ; - -class JavaTestClass extends InlineJavaPerlCaller { - - public JavaTestClass() throws InlineJavaException - { System.out.println("JavaTestClass::Constructor"); - try - { - // require("UPPER_MODULE::LOWER_MODULE"); - InlineJavaPerlObject po = new InlineJavaPerlObject("UPPER_MODULE::LOWER_MODULE", new Object [] {} ); - System.out.println("created InlineJavaPerlObject"); - } - catch (InlineJavaPerlException pe) { pe.printStackTrace();} - catch (InlineJavaException e) { e.printStackTrace(); } - } - - public void test() throws InlineJavaPerlException - { - System.out.println("JavaTestClass::test"); - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/sg.pl libinline-java-perl-0.66/bug/sg.pl --- libinline-java-perl-0.58~dfsg/bug/sg.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/sg.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -use Inline Java => 'bug/Foo.java' ; - -eval{ - Foo->new->test_a(); - Foo->new->test_b(); -} ; -if (Inline::Java::caught("javax.xml.parsers.FactoryConfigurationError")){ - my $msg = $@->getMessage() ; - die($msg) ; -} - diff -Nru libinline-java-perl-0.58~dfsg/bug/StudyTest.pl libinline-java-perl-0.66/bug/StudyTest.pl --- libinline-java-perl-0.58~dfsg/bug/StudyTest.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/StudyTest.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -# Detta är en fil som använder Javaklasser fast med Inline. - -use strict; -use FindBin ; -use lib $FindBin::Bin ; - -use Time::HiRes; #För prestandatest! -my $Tstart = [Time::HiRes::gettimeofday]; -use Inline ( Java => 'DATA', - SHARED_JVM => 1, JNI => 0 ); - -Inline::Java::reconnect_JVM() ; - - -# Börja programmet! -use Person; -my $him = new Person; -$him->name('Nisse'); -print ($him->name . "\n"); -for(my $i; $i<1000;$i++) { - my $javaVariable = new Program; # Skapa "javakontakt" - $javaVariable->work; # Kör skriptet - # print ($him->name . "\n"); - # print ("Hans polare är: ", join(", ", $him->peers), "\n"); -} -# Programmet slut! -my $Tend = [Time::HiRes::gettimeofday]; -my $tot = Time::HiRes::tv_interval($Tstart,$Tend); -print('Detta program tog: ' . $tot . ' sekunder att köra.' . "\n"); - -# Metod som används av Java! -sub perlMethods($$@) { # Kör perlmetoder på uppdrag av Java! - my($objectName, $methodName,@inParam) = @_; - return eval($objectName)->$methodName(@inParam); -} - - -__END__ - -__Java__ - -import org.perl.inline.java.*; - -class Program { - - // Grundvärden - PerlObject him = new PerlObject("$him"); - - // Konstruktor - public Program() throws InlineJavaException { - } - // Metod som gör något... - public void work () { - // Här skrivs skriptet i Java! - - - String T = (String)him.method("name"); - if (T.equals("Nisse") ) - //him.method("name","Knut-Göran"); - him.method("name", new Object[] {"Knut-Göran" } ); - else - him.method("name","Kurt-Arne"); - him.method("peers", new Object[] {"Tuve", "Bernt-Arne", "Nyman"} ); - - - // Här slutar skriptet som skrivits i Java! - } -} ; - -// Metodklass som används av Java! -class PerlObject extends InlineJavaPerlCaller { - String perlName; - // Konstruktor - public PerlObject(String perlName) throws InlineJavaException { - this.perlName = perlName; - } - // Metod för att kalla på Perlobjektens egna metoder. - public Object method (String methodName) { - try { - Object ret = CallPerl( "main", "perlMethods", new Object[] {perlName, methodName} ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } - public Object method (String methodName, Object arg) { - try { - Object ret = CallPerl( "main", "perlMethods", new Object[] {perlName, methodName, arg} ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } - public Object method (String methodName, Object arg[]) { - try { - Object[] perlArg = new Object [arg.length+2]; - perlArg[0] = perlName; - perlArg[1] = methodName; - for (int i = 0; i < arg.length; i++) { - perlArg[i+2] = arg[i]; - } - Object ret = CallPerl( "main", "perlMethods", perlArg ); - return ret == null ? new Integer(1) : ret; - } - catch (Exception e) { - return new Integer(-1); - } - } -} ; - diff -Nru libinline-java-perl-0.58~dfsg/bug/test.gaps libinline-java-perl-0.66/bug/test.gaps --- libinline-java-perl-0.58~dfsg/bug/test.gaps 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/test.gaps 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - 1 1 466 none - - - 468 468 589 none 1 1 - 1058 1058 919 none 1 1 - 1978 1978 369 none 1 1 - 2348 2348 184 none 1 1 - 2533 2533 1218 none 1 1 - 3752 3752 261 none 1 1 - 4014 4014 466 none 1 1 - 4481 4481 1271 none 1 1 - 5753 5753 653 none 1 1 - 6407 6407 39 none 1 1 - 6447 6447 915 none 1 1 - 7363 7363 222 none 1 1 - 7586 7586 699 none 1 1 - 8286 8286 455 none 1 1 - 8742 8742 401 none 1 1 - 9144 9144 73 none 1 1 - 9218 9218 86 none 1 1 - 9305 9305 1422 none 1 1 - 10728 10728 1151 none 1 1 - 11880 11880 1317 none 1 1 - 13198 13198 36 none 1 1 - 13234 13235 225 -5 0 1 - 13460 13461 940 none 1 1 - 14401 14402 383 none 1 1 - 14785 14786 331 none 1 1 - 15117 15118 2739 none 1 1 - 17857 17858 3937 none 1 1 - 21795 21796 23 none 1 1 - 21819 21820 444 none 1 1 - 22264 22265 909 none 1 1 - 23174 23175 539 none 1 1 - 23714 23715 579 none 1 1 - 24294 24295 239 none 1 1 - 24534 24535 144 none 1 1 - 24679 24680 41 none 1 1 - 24720 24739 41 -22 0 18 - 24762 24781 525 none 1 1 - 25288 25307 746 none 1 1 - 26035 26054 905 none 1 1 - 26941 26960 509 none 1 1 - 27451 27470 1467 none 1 1 diff -Nru libinline-java-perl-0.58~dfsg/bug/test.pl libinline-java-perl-0.66/bug/test.pl --- libinline-java-perl-0.58~dfsg/bug/test.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/test.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use lib "bug" ; -use PKG1; - -print PKG1->hello() ; - -# use PKG2 ; -# PKG2::callpkg1() ; - diff -Nru libinline-java-perl-0.58~dfsg/bug/toto.java libinline-java-perl-0.66/bug/toto.java --- libinline-java-perl-0.58~dfsg/bug/toto.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/toto.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -import java.util.* ; - -class toto { - static public void main(String args[]){ - HashMap h = new HashMap() ; - - h.put("key", "value") ; - Object valArr[] = h.entrySet().toArray() ; - - for (int i = 0 ; i < valArr.length ; i++){ - System.out.println(valArr[i]) ; - } - } -} diff -Nru libinline-java-perl-0.58~dfsg/bug/toto.pl libinline-java-perl-0.66/bug/toto.pl --- libinline-java-perl-0.58~dfsg/bug/toto.pl 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/toto.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -use Inline ( - Java => 'DATA', - STUDY => ['java.util.HashMap'], - AUTOSTUDY => 1, -) ; - -my $o = test->f() ; -print $o->[0] ; - - -__END__ -__Java__ - -class test { - static public Object f(){ - return new String [] {"allo"} ; - } -} Binary files /tmp/tmpUk7i_j/j5hnGt6Kv6/libinline-java-perl-0.58~dfsg/bug/XDB.class and /tmp/tmpUk7i_j/mJYapZBRme/libinline-java-perl-0.66/bug/XDB.class differ Binary files /tmp/tmpUk7i_j/j5hnGt6Kv6/libinline-java-perl-0.58~dfsg/bug/XDB_TestHarness.class and /tmp/tmpUk7i_j/mJYapZBRme/libinline-java-perl-0.66/bug/XDB_TestHarness.class differ diff -Nru libinline-java-perl-0.58~dfsg/bug/XDB_TestHarness.java libinline-java-perl-0.66/bug/XDB_TestHarness.java --- libinline-java-perl-0.58~dfsg/bug/XDB_TestHarness.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/bug/XDB_TestHarness.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -import java.util.*; -import org.perl.inline.java.*; - -public class XDB_TestHarness extends InlineJavaPerlCaller - { - static private InlineJavaPerlInterpreter pi = null; - - public XDB_TestHarness() throws InlineJavaException - { - } - - public static void main(String argv[]) throws InlineJavaPerlException, -InlineJavaException - { - System.out.println("Test Harness for XDB Java <> Perl Bridge"); - if(argv.length != 4) - { - System.out.println("Usage\n$java XDB_TestHarness dbUserName dbPassword dbHost xdbDbDefinitionFilePath"); - return; - } - - String sDbUser = argv[0]; - String sDbPassword = argv[1]; - String sDbHost = argv[2]; - String sDbDefinitionFilePath = argv[3]; - - XDB xdb = null; - - System.out.println("Instantiating XDB..."); - try - { - xdb = new XDB(sDbUser, sDbPassword, sDbHost, sDbDefinitionFilePath); - } - catch(InlineJavaPerlException pe) - { - System.out.println("PerlException: " + pe.GetString()); - } - catch(InlineJavaException je) - { - System.out.println("JavaException: " + je.getMessage()); - } - - System.out.println("XDB object created."); - - pi.destroy(); - - System.out.println("Done."); - } - }; - -class XDB - { - static private InlineJavaPerlInterpreter pi = null; - static private InlineJavaPerlObject xdb = null; - - public XDB(String sDbUser, String sDbPassword, String sDbHost, String -sDbDefinitionFilePath) throws InlineJavaPerlException, InlineJavaException - { - System.out.print("Creating Perl interpreter..."); - pi = InlineJavaPerlInterpreter.create(); -// this bit won't work unless you've got a module called "XDB" installed in @INC somewhere -// pi.require_module("XDB"); - System.out.println("OK"); - - System.out.print("Creating XDB instance..."); - - HashMap hshDbConnection = new HashMap(); - hshDbConnection.put("User", sDbUser); - hshDbConnection.put("Password", sDbPassword); - hshDbConnection.put("Host", sDbHost); - -/* -// this bit won't work unless you've got a module called "XDB" installed in @INC -somewhere - xdb = (InlineJavaPerlObject) pi.CallPerlSub("XDB::new", new Object [] {"XDB", -hshDbConnection }, InlineJavaPerlObject.class); - System.out.println("OK"); - - System.out.print("Initializing XDB instance..."); - Integer ok = (Integer) xdb.InvokeMethod("DataDefinition", new Object [] { -sDbDefinitionFilePath }, Integer.class); - if(ok.intValue() == 0) - { - String sError = (String) xdb.InvokeMethod("LastError", new Object [] { -sDbDefinitionFilePath }, String.class); - throw new InlineJavaPerlException("Error setting DataDefinition property: " + -sError); - } -*/ - System.out.println("OK"); - } - - protected void finalize() - { - System.out.println("finalizing"); - try - { - xdb.Dispose(); - } - catch(InlineJavaPerlException pe) - { - System.out.println("PerlException: " + pe.GetString()); - } - catch(InlineJavaException je) - { - System.out.println("JavaException: " + je.getMessage()); - } - } - }; diff -Nru libinline-java-perl-0.58~dfsg/CHANGES libinline-java-perl-0.66/CHANGES --- libinline-java-perl-0.58~dfsg/CHANGES 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/CHANGES 2018-04-06 00:28:22.000000000 +0000 @@ -1,6 +1,67 @@ Revision history for Perl extension Inline::Java ------------------------------------------------ -0.54 + +0.66 Fri Apr 6 01:26:50 BST 2018 + - Fix build on Cygwin [RT#119307] - thanks @mperry2! + +0.65 Tue Apr 3 22:10:55 BST 2018 + - put glob in better place to dodge wildcard problems on Win32 gmake 4.2.1 + - use registry on Win32 to find JAVA_HOME if not in env + - support old and apparently-new JDK locations on OSX [RT#116917] + +0.64 Tue Mar 20 15:00:39 GMT 2018 + - apply Debian spelling patch + +0.63 Tue Feb 13 05:52:42 GMT 2018 + - fix JDK 7 problem with "<>" type on HashMap + +0.62 Tue Feb 13 05:37:24 GMT 2018 + - zap (very) long-deprecated CallPerl interface + - type-constrain get*Constructor, all HashMap, ArrayList + - build always -Xlint:unchecked + - now only JDK7+ + - reorganise repo a bit, zap obsolete tests + - author-test all doc code examples + - fix giving "STUDY" as source case-insensitive + - increase maxMemory for t/12_1_callbacks.t + - t/01_init.t show maxMemory + +0.61 Sat Feb 10 05:01:23 GMT 2018 + - manifest test and fix + - no ask about JNI on build + - tidy up repo, use lib dir, zap dup tests + - support Java 9 + - CI tests for Java 7-9 + - remove pointless dep on Inline::C + - update tests to work in parallel + - rework java-build to avoid parallel-build fail + +0.60 Tue Jan 30 18:53:01 GMT 2018 + - apply Debian reproducible-build patch + - Added license meta name. (thanks @manwar) + +0.59 Mon Jan 29 07:02:52 GMT 2018 + - zap no_index line + - put . in Makefile.PL @INC for perl 5.26+ + +0.58 Sat Nov 29 09:18:45 2014 +0000 + - add no_index metadata + +0.57 Sat Nov 29 07:09:57 2014 +0000 + - Fix some language issues in the manual page. + +0.56 Fri Nov 21 15:35:10 2014 +0000 + - Remove unnecessary imports + - Minor XS bug-fix + +0.55 Fri Nov 14 14:54:12 2014 +0000 + - tests restored from 0.53 + +0.540 Tue Sep 9 02:55:18 2014 +0100 + - Update doc for case-insensitive args to Inline. + - Update metadata - git repo, Inline version. + +0.53_90 Tue Aug 19 07:32:57 2014 -0400 - Added AUTOSTUDY to PerlInterpreter - Applied patch by Max Vohlen to fix JNI bug - Applied patch by Charles Brabec to allow wildcards in CLASSPATH diff -Nru libinline-java-perl-0.58~dfsg/debian/changelog libinline-java-perl-0.66/debian/changelog --- libinline-java-perl-0.58~dfsg/debian/changelog 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/changelog 2018-04-08 17:07:45.000000000 +0000 @@ -1,3 +1,59 @@ +libinline-java-perl (0.66-1) unstable; urgency=medium + + * Team upload. + * New upstream release 0.66. + * Declare compliance with Debian Policy 4.1.4. + + -- gregor herrmann Sun, 08 Apr 2018 19:07:45 +0200 + +libinline-java-perl (0.64-1) unstable; urgency=medium + + * Team upload. + + [ Damyan Ivanov ] + * merge extra changelog stanza + + [ gregor herrmann ] + * Install examples. + Thanks to lintian. + * Use HTTPS for Format URL in debian/copyright. + Thanks to lintian. + * Add a lintian override (source-contains-prebuilt-java-object) + for a test file. + * Drop build dependency on libinline-c-perl, as per upstream changes. + * Remove rapackaging fragments. The problematic file, and in fact the + whole directory, was removed upstream in 0.62. + + * New upstream release 0.64. + * Drop pod-spelling.patch, merged upstream. + * autopkgtest: add debian/tests/pkg-perl/use-name to tell autopkgtest's + use.t which module to test, in case META.* is gone like in 0.64. + + -- gregor herrmann Mon, 26 Mar 2018 17:07:38 +0200 + +libinline-java-perl (0.63-1) unstable; urgency=medium + + * Team upload. + + [ Damyan Ivanov ] + * declare conformance with Policy 4.1.3 (no changes needed) + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ Damyan Ivanov ] + * New upstream version 0.63 + * drop 02_reporducibl_build.patch; applied upstream + * enable all hardening build flags + * rules: set DEB_HOST_ARCH only if not already set by dpkg-buildpackage + * bump cdbs build-dependency for possible hardening support + * add Testsuite header + * refresh lines of 03_reproducible_path.patch + * use secure protocol for cpan URL in debian/watch + * add pod-spelling.patch + + -- Damyan Ivanov Sun, 18 Mar 2018 17:54:22 +0000 + libinline-java-perl (0.58~dfsg-3) unstable; urgency=medium * Team upload. diff -Nru libinline-java-perl-0.58~dfsg/debian/control libinline-java-perl-0.66/debian/control --- libinline-java-perl-0.58~dfsg/debian/control 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/control 2018-04-08 17:07:45.000000000 +0000 @@ -1,21 +1,21 @@ Source: libinline-java-perl Section: perl Priority: optional -Build-Depends: cdbs (>= 0.4.106~), +Build-Depends: cdbs (>= 0.4.122~), devscripts, perl, debhelper, dh-buildinfo, libinline-perl (>= 0.68), - libinline-c-perl, default-jdk, chrpath Maintainer: Debian Perl Group Uploaders: Jonas Smedegaard -Standards-Version: 4.0.0 -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libinline-java-perl -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libinline-java-perl.git +Standards-Version: 4.1.4 +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libinline-java-perl.git +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libinline-java-perl Homepage: http://search.cpan.org/dist/Inline-Java/ +Testsuite: autopkgtest-pkg-perl Package: libinline-java-perl Architecture: any diff -Nru libinline-java-perl-0.58~dfsg/debian/control.in libinline-java-perl-0.66/debian/control.in --- libinline-java-perl-0.58~dfsg/debian/control.in 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/control.in 2018-04-08 17:07:45.000000000 +0000 @@ -4,7 +4,7 @@ Build-Depends: @cdbs@ Maintainer: Debian Perl Group Uploaders: Jonas Smedegaard -Standards-Version: 4.0.0 +Standards-Version: 4.1.4 Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libinline-java-perl Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libinline-java-perl.git Homepage: http://search.cpan.org/dist/Inline-Java/ diff -Nru libinline-java-perl-0.58~dfsg/debian/copyright libinline-java-perl-0.66/debian/copyright --- libinline-java-perl-0.58~dfsg/debian/copyright 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/copyright 2018-04-08 17:07:45.000000000 +0000 @@ -1,11 +1,8 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Inline::Java Upstream-Contact: Patrick LeBoutillier Source: http://search.cpan.org/dist/Inline-Java/ https://github.com/ingydotnet/Inline-Java - Repackaged, excluding sourceless jar file -Files-Excluded: - bug/bug.tar.gz Files: * Copyright: 2001-2005, Patrick LeBoutillier diff -Nru libinline-java-perl-0.58~dfsg/debian/copyright_hints libinline-java-perl-0.66/debian/copyright_hints --- libinline-java-perl-0.58~dfsg/debian/copyright_hints 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/copyright_hints 2018-04-08 17:07:45.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: FIXME Upstream-Contact: FIXME Source: FIXME @@ -52,35 +52,6 @@ Makefile.PL README.JNI TODO - bug/Employee.pm - bug/Foo.java - bug/Hi3.pm - bug/Higher.class - bug/Higher.jar - bug/Higher.java - bug/Lower.class - bug/PKG1.pm - bug/PKG2.pm - bug/PerlObject.java - bug/Person.pm - bug/Program.java - bug/StudyTest.pl - bug/XDB.class - bug/XDB_TestHarness.class - bug/XDB_TestHarness.java - bug/croak_bug.pl - bug/gcj_test.java - bug/inline3.pl - bug/nadim.pl - bug/natives_hpux.txt - bug/p3.pl - bug/roger.pl - bug/roger2.pl - bug/sg.pl - bug/test.gaps - bug/test.pl - bug/toto.java - bug/toto.pl debian/README.source debian/clean debian/compat diff -Nru libinline-java-perl-0.58~dfsg/debian/examples libinline-java-perl-0.66/debian/examples --- libinline-java-perl-0.58~dfsg/debian/examples 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/debian/examples 2018-04-08 17:07:45.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru libinline-java-perl-0.58~dfsg/debian/patches/02_reproducible_build.patch libinline-java-perl-0.66/debian/patches/02_reproducible_build.patch --- libinline-java-perl-0.58~dfsg/debian/patches/02_reproducible_build.patch 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/patches/02_reproducible_build.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: Make build reproducible -Author: Chris Lamb -Bug-Debian: https://bugs.debian.org/778983 -Last-Update: 2015-02-22 - ---- a/Makefile.PL -+++ b/Makefile.PL -@@ -235,7 +235,7 @@ - sub Inline::Java::get_default_j2sdk_so_dirs { - return ( - J2SDK_PL --foreach my $d (@main::SO_DIRS){ -+foreach my $d (sort @main::SO_DIRS){ - $d =~ s/'/\'/g ; - print J2SDK "\t\t'$d',\n" ; - } diff -Nru libinline-java-perl-0.58~dfsg/debian/patches/03_reproducible_path.patch libinline-java-perl-0.66/debian/patches/03_reproducible_path.patch --- libinline-java-perl-0.58~dfsg/debian/patches/03_reproducible_path.patch 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/patches/03_reproducible_path.patch 2018-04-08 17:07:45.000000000 +0000 @@ -6,7 +6,7 @@ --- a/Makefile.PL +++ b/Makefile.PL -@@ -172,8 +172,8 @@ +@@ -157,8 +157,8 @@ $user_arch : java.ts MAKE # Used for PerlNatives diff -Nru libinline-java-perl-0.58~dfsg/debian/patches/series libinline-java-perl-0.66/debian/patches/series --- libinline-java-perl-0.58~dfsg/debian/patches/series 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/patches/series 2018-04-08 17:07:45.000000000 +0000 @@ -1,2 +1 @@ -02_reproducible_build.patch 03_reproducible_path.patch diff -Nru libinline-java-perl-0.58~dfsg/debian/rules libinline-java-perl-0.66/debian/rules --- libinline-java-perl-0.58~dfsg/debian/rules 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/rules 2018-04-08 17:07:45.000000000 +0000 @@ -21,6 +21,10 @@ include /usr/share/cdbs/1/class/perl-makemaker.mk include /usr/share/cdbs/1/rules/debhelper.mk +DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + pkg = $(DEB_SOURCE_PACKAGE) perlpath := $(shell perl -MConfig -e 'print $$Config{vendorarch};' ) @@ -30,16 +34,12 @@ DEB_UPSTREAM_URL = https://github.com/ingydotnet/Inline-Java/archive DEB_UPSTREAM_TARBALL_BASENAME = Inline-Java-$(DEB_UPSTREAM_TARBALL_VERSION) -# Repackage to exclude sourceless jar file -DEB_UPSTREAM_REPACKAGE_EXCLUDES += \ - bug/bug.tar.gz - # Build-depend unversioned on debhelper # TODO: Drop when adopted in cdbs CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper # Needed both by upstream build and at runtime -deps = libinline-perl (>= 0.68), libinline-c-perl, default-jdk +deps = libinline-perl (>= 0.68), default-jdk # Needed by upstream build b-depends = chrpath @@ -49,7 +49,7 @@ export JAVA_HOME=/usr/lib/jvm/default-java -DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) NO_JNI_ARCH = hppa hurd-i386 mips mipsel ifeq (,$(filter $(DEB_HOST_ARCH), $(NO_JNI_ARCH))) # Have testsuite use JNI diff -Nru libinline-java-perl-0.58~dfsg/debian/source/lintian-overrides libinline-java-perl-0.66/debian/source/lintian-overrides --- libinline-java-perl-0.58~dfsg/debian/source/lintian-overrides 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/source/lintian-overrides 2018-04-08 17:07:45.000000000 +0000 @@ -6,3 +6,12 @@ # Debhelper 9 is satisfied even in oldstable package-lacks-versioned-build-depends-on-debhelper 9 + +# The jar is indeed prebuilt, for use in a test. +# Luckily the source is there (t/t16subclass.java) +# and upstream commit 769bb39a1954e88e2da510efebb1d86dcfe5c2f9 has a build recipe +# which is confirmed to work: +# javac --release 6 t/t16subclass.java; +# jar cvf t/t16subclass.jar -C t Lower.class -C t t16subclass.class; +# rm t/Lower.class t/t16subclass.class +source-contains-prebuilt-java-object t/t16subclass.jar diff -Nru libinline-java-perl-0.58~dfsg/debian/tests/pkg-perl/use-name libinline-java-perl-0.66/debian/tests/pkg-perl/use-name --- libinline-java-perl-0.58~dfsg/debian/tests/pkg-perl/use-name 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/debian/tests/pkg-perl/use-name 2018-04-08 17:07:45.000000000 +0000 @@ -0,0 +1 @@ +Inline::Java diff -Nru libinline-java-perl-0.58~dfsg/debian/watch libinline-java-perl-0.66/debian/watch --- libinline-java-perl-0.58~dfsg/debian/watch 2017-08-04 19:38:38.000000000 +0000 +++ libinline-java-perl-0.66/debian/watch 2018-04-08 17:07:45.000000000 +0000 @@ -1,8 +1,5 @@ # Run the "uscan" command to check for upstream updates and more. version=3 -opts=dversionmangle=s/\~dfsg.*// \ https://github.com/ingydotnet/Inline-Java/tags .*/archive/v?(\d[\d\.]+).tar.gz -opts=dversionmangle=s/\~dfsg.*// \ -http://www.cpan.org/modules/by-module/Inline/Inline-Java-([\d.]+)\.tar\.gz -opts=dversionmangle=s/\~dfsg.*// \ +https://www.cpan.org/modules/by-module/Inline/Inline-Java-([\d.]+)\.tar\.gz https://metacpan.org/release/Inline-Java .*/Inline-Java-([\d.]+)\.tar\.gz diff -Nru libinline-java-perl-0.58~dfsg/examples/cgi/CGI.cgi libinline-java-perl-0.66/examples/cgi/CGI.cgi --- libinline-java-perl-0.58~dfsg/examples/cgi/CGI.cgi 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/cgi/CGI.cgi 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +package t::CGI ; + +use strict ; + +use CGI ; +use CGI::Carp qw(fatalsToBrowser) ; + +use Inline ( + Java => '/home/patrickl/DEV/Inline-Java/t/counter.java', + DIRECTORY => '/home/patrickl/DEV/Inline-Java/_Inline_web_test', + SHARED_JVM => 1, + NAME => 't::CGI', +) ; + +BEGIN { + $t::CGI::cnt = new t::CGI::counter() ; +} + +my $gnb = $t::CGI::cnt->gincr() ; +my $nb = $t::CGI::cnt->incr() ; + +my $q = new CGI() ; +print "Content-type: text/html\n\n" ; +print + $q->start_html() . + "Inline-Java " . $Inline::Java::VERSION . "

" . + "Inline-Java says this page received $gnb hits!
" . + "Inline-Java says this CGI ($$) served $nb of those hits." . + $q->end_html() ; + +1 ; diff -Nru libinline-java-perl-0.58~dfsg/examples/cgi/counter.java libinline-java-perl-0.66/examples/cgi/counter.java --- libinline-java-perl-0.58~dfsg/examples/cgi/counter.java 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/cgi/counter.java 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,19 @@ +class counter { + static private int global_i = 0 ; + private int i = 0 ; + + public counter(){ + } + + static public int gincr(){ + global_i++ ; + return global_i ; + } + + public int incr(){ + i++ ; + return i ; + } +} + + diff -Nru libinline-java-perl-0.58~dfsg/examples/cgi/MOD_PERL.pl libinline-java-perl-0.66/examples/cgi/MOD_PERL.pl --- libinline-java-perl-0.58~dfsg/examples/cgi/MOD_PERL.pl 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/cgi/MOD_PERL.pl 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,3 @@ +use lib "/home/patrickl/DEV/Inline-Java" ; + +1 ; diff -Nru libinline-java-perl-0.58~dfsg/examples/cgi/MOD_PERL.pm libinline-java-perl-0.66/examples/cgi/MOD_PERL.pm --- libinline-java-perl-0.58~dfsg/examples/cgi/MOD_PERL.pm 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/cgi/MOD_PERL.pm 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +package t::MOD_PERL ; + +use strict ; + +use CGI ; + +use Inline ( + Java => '/home/patrickl/DEV/Inline-Java/t/counter.java', + DIRECTORY => '/home/patrickl/DEV/Inline-Java/_Inline_web_test', + NAME => 't::MOD_PERL', + SHARED_JVM => 1, +) ; + + +use Apache2::RequestRec ; +use Apache2::RequestIO ; +use Apache2::Const qw(:common) ; + + +my $cnt = new t::MOD_PERL::counter() ; + + +sub handler { + my $r = shift ; + + $r->content_type('text/html') ; + + my $gnb = $cnt->gincr() ; + my $nb = $cnt->incr() ; + + my $q = new CGI() ; + print + $q->start_html() . + "Inline-Java " . $Inline::Java::VERSION . "

" . + "Inline-Java says this page received $gnb hits!
" . + "Inline-Java says this MOD_PERL ($$) served $nb of those hits." . + $q->end_html() ; + + return OK ; +} + + +1 ; + diff -Nru libinline-java-perl-0.58~dfsg/examples/shared_jvm_server.pl libinline-java-perl-0.66/examples/shared_jvm_server.pl --- libinline-java-perl-0.58~dfsg/examples/shared_jvm_server.pl 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/shared_jvm_server.pl 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,13 @@ +use strict ; + +use blib ; + +use Inline( + Java => 'STUDY', + SHARED_JVM => 1, +) ; + +print "Shared JVM server started\n" ; +while (1){ + sleep(60) ; +} diff -Nru libinline-java-perl-0.58~dfsg/examples/shared_jvm_test.pl libinline-java-perl-0.66/examples/shared_jvm_test.pl --- libinline-java-perl-0.58~dfsg/examples/shared_jvm_test.pl 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/shared_jvm_test.pl 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,70 @@ +package shared_jvm_test ; + +use strict ; + +use blib ; + +use Inline ( + Java => 'DATA', + NAME => "shared_jvm_test", + SHARED_JVM => 1, +) ; + +$shared_jvm_test::t::i = 0 ; + +my $nb = 10 ; +my $sum = (($nb) * ($nb + 1)) / 2 ; +for (my $i = 0 ; $i < $nb ; $i++){ + if (! fork()){ + print STDERR "." ; + shared_jvm_test::do_child($i) ; + } +} + + +# Wait for kids to finish +for (my $i = 0 ; $i < 5 ; $i++){ + sleep(1) ; + print STDERR "." ; +} +print STDERR "\n" ; + +if ($shared_jvm_test::t::i == $sum){ + print STDERR "Test succeeded\n" ; +} +else{ + print STDERR "Test failed ($shared_jvm_test::t::i != $sum)\n" ; +} + + +sub do_child { + my $i = shift ; + + Inline::Java::reconnect_JVM() ; + + my $t = new shared_jvm_test::t() ; + my $j = 0 ; + for ( ; $j <= $i ; $j++){ + $t->incr_i() ; + } + exit ; +} + + +__DATA__ + +__Java__ + + +import java.util.* ; + +class t { + static public int i = 0 ; + + public t(){ + } + + public void incr_i(){ + i++ ; + } +} diff -Nru libinline-java-perl-0.58~dfsg/examples/swing_callback.pl libinline-java-perl-0.66/examples/swing_callback.pl --- libinline-java-perl-0.58~dfsg/examples/swing_callback.pl 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/swing_callback.pl 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,83 @@ +#!/usr/bin/perl +use strict; +use warnings; +use blib ; + +use Inline Java => "DATA" ; + + +package EventHandler ; + +sub new { + my $class = shift ; + my $max = shift ; + + return bless({max => $max, nb => 0}, $class) ; +} + + +sub button_pressed { + my $this = shift ; + my $button = shift ; + + $this->{nb}++ ; + print "Button Pressed $this->{nb} times (from perl)\n" ; + if ($this->{nb} > $this->{max}){ + $button->StopCallbackLoop() ; + } + + return $this->{nb} ; +} + + +my $button = MyButton->new(new EventHandler(10)); +$button->StartCallbackLoop() ; +print "loop done\n" ; + + + +package main ; + +__DATA__ +__Java__ + +import java.util.*; +import org.perl.inline.java.*; +import javax.swing.*; +import java.awt.event.*; + +public class MyButton extends InlineJavaPerlCaller + implements ActionListener +{ + InlineJavaPerlObject po = null ; + + public MyButton(InlineJavaPerlObject _po) throws InlineJavaException + { + po = _po ; + // create frame + JFrame frame = new JFrame("MyButton"); + frame.setSize(200,200); + + // create button + JButton button = new JButton("Click Me!"); + frame.getContentPane().add(button); + + // tell the button that when it's clicked, report it to + // this class. + button.addActionListener(this); + + // all done, everything added, just show it + frame.show(); + } + + public void actionPerformed(ActionEvent e) + { + try + { + String cnt = (String)CallPerlMethod(po, "button_pressed", new Object [] {this}); + System.out.println("Button Pressed " + cnt + " times (from java)") ; + } + catch (InlineJavaPerlException pe) { } + catch (InlineJavaException pe) { pe.printStackTrace() ;} + } +} diff -Nru libinline-java-perl-0.58~dfsg/examples/swing_gui_test.pl libinline-java-perl-0.66/examples/swing_gui_test.pl --- libinline-java-perl-0.58~dfsg/examples/swing_gui_test.pl 1970-01-01 00:00:00.000000000 +0000 +++ libinline-java-perl-0.66/examples/swing_gui_test.pl 2018-04-06 00:28:22.000000000 +0000 @@ -0,0 +1,37 @@ +use strict ; + +use blib ; + +use Inline ( + Java => 'DATA', + STUDY => [ + 'javax.swing.JFrame', + 'javax.swing.JPanel', + ], +) ; + +my $f = HelloJava1->get_frame("HelloJava1") ; +$f->setSize(140, 100) ; +$f->getContentPane()->add(new HelloJava1()) ; +$f->setVisible(1) ; + + ; + +__END__ + +__Java__ + + +class HelloJava1 extends javax.swing.JComponent { + public HelloJava1() { + } + + public void paintComponent(java.awt.Graphics g) { + g.drawString("Hello from Java!", 17, 40) ; + } + + public static javax.swing.JFrame get_frame(String name) { + return new javax.swing.JFrame(name) ; + } +} + diff -Nru libinline-java-perl-0.58~dfsg/.gitignore libinline-java-perl-0.66/.gitignore --- libinline-java-perl-0.58~dfsg/.gitignore 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/.gitignore 2018-04-06 00:28:22.000000000 +0000 @@ -1,14 +1,15 @@ MYMETA.* +MANIFEST*.bak Makefile Makefile.old -Java/InlineJavaServer.jar -Java/InlineJavaUser.jar +lib/Inline/Java/InlineJavaServer.jar +lib/Inline/Java/InlineJavaUser.jar Java/classes/ blib/ java.ts pm_to_blib -_Inline_test/ -Java/default_j2sdk.pl +_Inline/ +lib/Inline/Java/default_j2sdk.pl *.bs *.c *.o diff -Nru libinline-java-perl-0.58~dfsg/Java/Array.pm libinline-java-perl-0.66/Java/Array.pm --- libinline-java-perl-0.58~dfsg/Java/Array.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Array.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,634 +0,0 @@ -package Inline::Java::Array ; -@Inline::Java::Array::ISA = qw(Inline::Java::Array::Tie) ; - -use strict ; -use Carp ; - -$Inline::Java::Array::VERSION = '0.53_90' ; - -# Here we store as keys the knots and as values our blessed objects -my $OBJECTS = {} ; - - -sub new { - my $class = shift ; - my $object = shift ; - - my @this = () ; - my $knot = tie @this, $class ; - my $this = bless (\@this, $class) ; - - $OBJECTS->{$knot} = $object ; - - Inline::Java::debug(5, "this = '$this'") ; - Inline::Java::debug(5, "knot = '$knot'") ; - - return $this ; -} - - -sub __get_object { - my $this = shift ; - - my $knot = tied @{$this} || $this ; - - my $ref = $OBJECTS->{$knot} ; - if (! defined($ref)){ - croak "Unknown Java array reference '$knot'" ; - } - - return $ref ; -} - - -sub __isa { - my $this = shift ; - my $proto = shift ; - - return $this->__get_object()->__isa($proto) ; -} - - -sub length { - my $this = shift ; - - my $obj = $this->__get_object() ; - - my $ret = undef ; - eval { - # Check the cached value - $ret = $obj->__get_private()->{array_length} ; - if (! defined($ret)){ - $ret = $obj->__get_private()->{proto}->CallJavaMethod('getLength', [], []) ; - $obj->__get_private()->{array_length} = $ret ; - } - else{ - Inline::Java::debug(4, "using cached array length $ret") ; - } - } ; - croak $@ if $@ ; - - return $ret ; -} - - -sub __get_element { - my $this = shift ; - my $idx = shift ; - - my $max = $this->length() - 1 ; - if ($idx > $max){ - croak("Java array index out of bounds ($idx > $max)") - } - - my $obj = $this->__get_object() ; - - my $ret = undef ; - eval { - $ret = $obj->__get_private()->{proto}->GetJavaMember($idx, ['java.lang.Object'], [undef]) ; - } ; - croak $@ if $@ ; - - return $ret ; -} - - -sub __set_element { - my $this = shift ; - my $idx = shift ; - my $s = shift ; - - my $max = $this->length() - 1 ; - if ($idx > $max){ - croak("Java array index out of bounds ($idx > $max)") - } - - my $obj = $this->__get_object() ; - - # Now we need to find out if what we are trying to set matches - # the array. - my $java_class = $obj->__get_private()->{java_class} ; - my $elem_class = $java_class ; - my $an = Inline::Java::Array::Normalizer->new($obj->__get_private()->{inline}, $java_class) ; - if ($an->{req_nb_dim} > 1){ - $elem_class =~ s/^\[// ; - } - else{ - $elem_class = $an->{req_element_class} ; - } - - my $ret = undef ; - eval { - my ($new_args, $score) = Inline::Java::Class::CastArguments([$s], [$elem_class], $obj->__get_private()->{inline}) ; - $ret = $obj->__get_private()->{proto}->SetJavaMember($idx, [$elem_class], $new_args) ; - } ; - croak $@ if $@ ; - - return $ret ; -} - - -sub AUTOLOAD { - my $this = shift ; - my @args = @_ ; - - use vars qw($AUTOLOAD) ; - my $func_name = $AUTOLOAD ; - # Strip package from $func_name, Java will take of finding the correct - # method. - $func_name =~ s/^(.*)::// ; - - croak "Can't call method '$func_name' on Java arrays" ; -} - - -sub DESTROY { - my $this = shift ; - - my $knot = tied @{$this} ; - if (! $knot){ - Inline::Java::debug(4, "destroying Inline::Java::Array::Tie") ; - - delete $OBJECTS->{$this} ; - } - else{ - Inline::Java::debug(4, "destroying Inline::Java::Array") ; - } -} - - - - -######################## Array methods ######################## -package Inline::Java::Array::Tie ; -@Inline::Java::Array::Tie::ISA = qw(Tie::StdArray) ; - - -use Tie::Array ; -use Carp ; - - -sub TIEARRAY { - my $class = shift ; - - return $class->SUPER::TIEARRAY(@_) ; -} - - -sub FETCHSIZE { - my $this = shift ; - - my $array = $this->length() ; -} - - -sub STORE { - my $this = shift ; - my $idx = shift ; - my $s = shift ; - - return $this->__set_element($idx, $s) ; -} - - -sub FETCH { - my $this = shift ; - my $idx = shift ; - - return $this->__get_element($idx) ; -} - - -sub EXISTS { - my $this = shift ; - my $idx = shift ; - - return $this->SUPER::EXISTS($idx) ; -} - - -sub STORESIZE { - my $this = shift ; - my $size = shift ; - - croak "Operation STORESIZE not supported on Java array" ; -} - - -sub CLEAR { - my $this = shift ; - - croak "Operation CLEAR not supported on Java array" ; -} - - -sub POP { - my $this = shift ; - - croak "Operation POP not supported on Java array" ; -} - - -sub PUSH { - my $this = shift ; - my @list = @_ ; - - croak "Operation PUSH not supported on Java array" ; -} - - -sub SHIFT { - my $this = shift ; - - croak "Operation SHIFT not supported on Java array" ; -} - - -sub UNSHIFT { - my $this = shift ; - my @list = @_ ; - - croak "Operation UNSHIFT not supported on Java array" ; -} - - -sub DELETE { - my $this = shift ; - my $idx = shift ; - - croak "Operation DELETE not supported on Java array" ; -} - - -sub EXTEND { - my $this = shift ; - my $count = shift ; - - croak "Operation EXTEND not supported on Java array" ; -} - - -sub SPLICE { - my $this = shift ; - my $offset = shift ; - my $length = shift ; - my @LIST = @_ ; - - croak "Operation SPLICE not supported on Java array" ; -} - - -sub DESTROY { - my $this = shift ; -} - - - -######################## Inline::Java::Array::Normalizer ######################## -package Inline::Java::Array::Normalizer ; - - -use Carp ; - - -sub new { - my $class = shift ; - my $inline = shift ; - my $java_class = shift ; - my $ref = shift ; - - if (! Inline::Java::Class::ClassIsArray($java_class)){ - croak "Can't create Java array of non-array class '$java_class'" ; - } - - my $this = {} ; - $this->{class} = $class ; - $this->{java_class} = $java_class ; - $this->{map} = {} ; - $this->{ref} = $ref ; - $this->{array} = [] ; - $this->{score} = 0 ; - $this->{inline} = $inline ; - - bless ($this, $class) ; - - # The first thing we want to do is figure out what kind of array we want, - # and how many dimensions it should have. - $this->AnalyzeArrayClass() ; - - if ($ref){ - $this->InitFromArray($this->{array}) ; - } - - return $this ; -} - - -sub InitFromArray { - my $this = shift ; - my $array = shift ; - my $level = shift ; - - my $ref = $this->{ref} ; - - $this->ValidateArray($ref, $array) ; - - if (! $level){ - Inline::Java::debug_obj($this) ; - } -} - - -sub InitFromFlat { - my $this = shift ; - my $inline = shift ; - my $dims = shift ; - my $list = shift ; - my $level = shift ; - - my $nb_list = scalar(@{$list}) ; - my $parts = $dims->[0] ; - - my $req_nb_elem = 1 ; - foreach my $d (@{$dims}){ - $req_nb_elem *= $d ; - } - if ($req_nb_elem != $nb_list){ - my $ds = "[" . join("][", @{$dims}) . "]" ; - croak "Corrupted array: $ds should contain $req_nb_elem elements, has $nb_list" ; - } - - for (my $i = 0 ; $i < $parts ; $i++){ - my $elem = undef ; - if (scalar(@{$dims}) == 1){ - # We are at the bottom of the list. - $elem = $list->[$i] ; - } - else{ - my $nb_elems = $nb_list / $parts ; - my @sub = splice(@{$list}, 0, $nb_elems) ; - - my $java_class = $this->{java_class} ; - $java_class =~ s/^\[// ; - - my @dims = @{$dims} ; - shift @dims ; - my $obj = Inline::Java::Array::Normalizer->new($inline, $java_class) ; - $obj->InitFromFlat($inline, \@dims, \@sub, $level + 1) ; - $elem = $obj->{array} ; - } - my $nb = scalar(@{$this->{array}}) ; - $this->{array}->[$nb] = $elem ; - } - - if (! $level){ - # Inline::Java::debug_obj($this) ; - } -} - - -# Checks if the contents of the Array match the ones prescribed -# by the Java prototype. -sub AnalyzeArrayClass { - my $this = shift ; - - my $java_class = $this->{java_class} ; - - my ($depth_str, $type, $class) = Inline::Java::Class::ValidateClassSplit($java_class) ; - $depth_str =~ /^(\[+)/ ; - my $depth = length($depth_str) ; - - my %map = ( - B => 'byte', - S => 'short', - I => 'int', - J => 'long', - F => 'float', - D => 'double', - C => 'char', - Z => 'boolean', - L => $class, - ) ; - - my $pclass = $map{$type} ; - if (! $pclass){ - croak "Can't determine array type for '$java_class'" ; - } - - $this->{req_element_class} = $pclass ; - $this->{req_nb_dim} = $depth ; - - return ; -} - - -# This method makes sure that we have a valid array that -# can be used in a Java function. It will return an array -# That contains either all scalars or all object references -# at the lowest level. -sub ValidateArray { - my $this = shift ; - my $ref = shift ; - my $array = shift ; - my $level = shift || 0 ; - - if (! ((defined($ref))&&(UNIVERSAL::isa($ref, "ARRAY")))){ - # We must start with an array of some kind... - croak "'$ref' is not an array reference" ; - } - - my $map = $this->{map} ; - if (! exists($map->{$level}->{max})){ - $map->{$level}->{max} = 0 ; - } - $this->ValidateElements($ref, $array, $level) ; - - foreach my $elem (@{$ref}){ - if ((defined($elem))&&(UNIVERSAL::isa($elem, "ARRAY"))){ - # All the elements at this level are sub-arrays. - my $sarray = [] ; - $this->ValidateArray($elem, $sarray, $level + 1) ; - push @{$array}, $sarray ; - } - } - - $this->FillArray($array, $level) ; - - if (! $level){ - my @levels = (sort {$a <=> $b} keys %{$map}) ; - my $nbl = scalar(@levels) ; - - my $last = $levels[$nbl - 1] ; - my @dims = () ; - my $max_cells = 1 ; - foreach my $l (@levels){ - push @dims, $map->{$l}->{max} ; - $max_cells *= $map->{$l}->{max} ; - } - my $nb_cells = ($map->{$last}->{count} || 0) ; - Inline::Java::debug(4, "array is [" . join("][", @dims) . "]") ; - Inline::Java::debug(4, "array has $nb_cells declared cells") ; - Inline::Java::debug(4, "array should have $max_cells declared cells") ; - $this->{dim} = \@dims ; - $this->{nb_dim} = scalar(@dims) ; - - if ($this->{nb_dim} != $this->{req_nb_dim}){ - croak "Java array should have $this->{req_nb_dim} instead of " . - "$this->{nb_dim} dimensions" ; - } - - Inline::Java::debug_obj($this) ; - } -} - - -# Makes sure that all the elements are of the same type. -sub ValidateElements { - my $this = shift ; - my $ref = shift ; - my $array = shift ; - my $level = shift ; - - my $map = $this->{map} ; - my $cnt = scalar(@{$ref}) ; - my $max = $map->{$level}->{max} ; - if ($cnt > $max){ - $map->{$level}->{max} = $cnt ; - } - - for (my $i = 0 ; $i < $cnt ; $i++){ - my $elem = $ref->[$i] ; - if (defined($elem)){ - if (UNIVERSAL::isa($elem, "ARRAY")){ - $this->CheckMap("SUB_ARRAY", $level) ; - } - elsif ( - (UNIVERSAL::isa($elem, "Inline::Java::Object"))|| - (! ref($elem))){ - $this->CheckMap("BASE_ELEMENT", $level) ; - my @ret = $this->CastArrayArgument($elem) ; - $array->[$i] = $ret[0] ; - $this->{score} += $ret[1] ; - } - else{ - croak "A Java array can only contain scalars, Java objects or array references" ; - } - } - $map->{$level}->{count}++ ; - } -} - -sub CheckMap { - my $this = shift ; - my $type = shift ; - my $level = shift ; - - my $map = $this->{map} ; - - if (! exists($map->{$level}->{type})){ - $map->{$level}->{type} = $type ; - } - elsif ($map->{$level}->{type} ne $type){ - croak "Java array contains mixed types in dimension $level ($type != $map->{$level}->{type})" ; - } -} - - -sub CastArrayArgument { - my $this = shift ; - my $arg = shift ; - - my $element_class = $this->{req_element_class} ; - - my ($new_arg, $score) = Inline::Java::Class::CastArgument($arg, $element_class, $this->{inline}) ; - - return ($new_arg, $score) ; -} - - -# Makes sure that all the dimensions of the array have the same number of elements -sub FillArray { - my $this = shift ; - my $array = shift ; - my $level = shift ; - - my $map = $this->{map} ; - - my $max = $map->{$level}->{max} ; - my $nb = scalar(@{$array}) ; - - my $type = $map->{$level}->{type} ; - # Type can be undefined when array is zero length. - if ((defined($type))&&($type eq "SUB_ARRAY")){ - foreach my $elem (@{$array}){ - if (! defined($elem)){ - $elem = [] ; - $this->FillArray($elem, $level + 1) ; - } - } - } - - if ($nb < $max){ - # We must stuff... - for (my $i = $nb ; $i < $max ; $i++){ - if ((defined($type))&&($type eq "SUB_ARRAY")){ - my $elem = [] ; - $this->FillArray($elem, $level + 1) ; - push @{$array}, $elem ; - } - else{ - push @{$array}, undef ; - } - } - } -} - - -sub FlattenArray { - my $this = shift ; - my $level = shift ; - - my $list = $this->MakeElementList($this->{array}) ; - - my $dim = $this->{dim} ; - my $req_nb_elem = 1 ; - foreach my $d (@{$dim}){ - $req_nb_elem *= $d ; - } - - my $nb_elem = scalar(@{$list}) ; - if ($req_nb_elem != $nb_elem){ - my $ds = "[" . join("][", @{$dim}) . "]" ; - croak "Corrupted array: $ds should contain $req_nb_elem elements, has $nb_elem" ; - } - - my $ret = [$dim, $list] ; - - Inline::Java::debug_obj($ret) ; - - return $ret ; -} - - -sub MakeElementList { - my $this = shift ; - my $array = shift ; - - my @ret = () ; - foreach my $elem (@{$array}){ - if ((defined($elem))&&(UNIVERSAL::isa($elem, "ARRAY"))){ - my $sret = $this->MakeElementList($elem) ; - push @ret, @{$sret} ; - } - else{ - # All elements here are base level elements. - push @ret, @{$array} ; - last ; - } - } - - return \@ret ; -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Callback.pm libinline-java-perl-0.66/Java/Callback.pm --- libinline-java-perl-0.58~dfsg/Java/Callback.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Callback.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -package Inline::Java::Callback ; - -use strict ; -use Carp ; - -$Inline::Java::Callback::VERSION = '0.53_90' ; - -$Inline::Java::Callback::OBJECT_HOOK = undef ; - - -my %OBJECTS = () ; -my $next_id = 1 ; - - -sub InterceptCallback { - my $inline = shift ; - my $resp = shift ; - - # With JNI we need to store the object somewhere since we - # can't drag it along all the way through Java land... - if (! defined($inline)){ - $inline = $Inline::Java::JNI::INLINE_HOOK ; - } - - if ($resp =~ s/^callback ([^ ]+) (\@?[\w:]+) ([^ ]+)//){ - my $via = $1 ; - my $function = $2 ; - my $cast_return = $3 ; - my @args = split(' ', $resp) ; - - # "Relative" namespace... - if ($via =~ /^::/){ - $via = $inline->get_api('pkg') . $via ; - } - if ($function =~ /^::/){ - $function = $inline->get_api('pkg') . $function ; - } - - return Inline::Java::Callback::ProcessCallback($inline, $via, $function, $cast_return, @args) ; - } - - croak "Malformed callback request from server: $resp" ; -} - - -sub ProcessCallback { - my $inline = shift ; - my $via = shift ; - my $function = shift ; - 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, $_) ; - $a ; - } @sargs ; - - no strict 'refs' ; - if ($via =~ /^(\d+)$/){ - # Call via object - my $id = $1 ; - Inline::Java::debug(2, "processing callback $id" . "->" . "$function(" . - join(", ", @args) . ")") ; - my $obj = Inline::Java::Callback::GetObject($id) ; - 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) . ")") ; - if ($list_ctx){ - @ret = $via->$function(@args) ; - } - else{ - $ret = $via->$function(@args) ; - } - } - else { - # Straight call - Inline::Java::debug(2, "processing callback $function(" . - join(", ", @args) . ")") ; - if ($function !~ /::/){ - $function = 'main' . '::' . $function ; - } - if ($list_ctx){ - @ret = $function->(@args) ; - } - else{ - $ret = $function->(@args) ; - } - } - - if ($list_ctx){ - $ret = \@ret ; - } - } ; - if ($@){ - $ret = $@ ; - $thrown = 'true' ; - - if ((ref($ret))&&(! UNIVERSAL::isa($ret, "Inline::Java::Object"))){ - croak "Can't propagate non-Inline::Java reference exception ($ret) to Java" ; - } - } - - ($ret) = Inline::Java::Class::CastArgument($ret, $cast_return, $inline) ; - - # Here we must keep a reference to $ret or else it gets deleted - # before the id is returned to Java... - my $ref = $ret ; - - ($ret) = $pc->ValidateArgs([$ret], 1) ; - - return ("callback $thrown $ret", $ref) ; -} - - -sub GetObject { - my $id = shift ; - - my $obj = $OBJECTS{$id} ; - if (! defined($obj)){ - croak("Can't find object $id") ; - } - - return $obj ; -} - - -sub PutObject { - my $obj = shift ; - - my $id = $next_id ; - $next_id++ ; - - $OBJECTS{$id} = $obj ; - - return $id ; -} - - -sub DeleteObject { - my $id = shift ; - my $quiet = shift || 0 ; - - my $obj = delete $OBJECTS{$id} ; - if ((! $quiet)&&(! defined($obj))){ - croak("Can't find object $id") ; - } -} - - -sub ObjectCount { - return scalar(keys %OBJECTS) ; -} - - -sub __GetObjects { - return \%OBJECTS ; -} - - - -########## Utility methods used by Java to access Perl objects ################# - - -sub java_eval { - my $code = shift ; - - Inline::Java::debug(3, "evaling Perl code: $code") ; - my $ret = eval $code ; - if ($@){ - die($@) ; - } - - return $ret ; -} - - -sub java_require { - my $module = shift ; - my $is_file = shift ; - - if (! defined($is_file)){ - if (-e $module){ - $module = "\"$module\"" ; - } - } - - if ($is_file){ - $module = "\"$module\"" ; - } - - Inline::Java::debug(3, "requiring Perl module/file: $module") ; - return java_eval("require $module ;") ; -} - - -sub java_finalize { - my $id = shift ; - my $gc = shift ; - - Inline::Java::Callback::DeleteObject($id, $gc) ; -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Callback.pod libinline-java-perl-0.66/Java/Callback.pod --- libinline-java-perl-0.58~dfsg/Java/Callback.pod 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Callback.pod 1970-01-01 00:00:00.000000000 +0000 @@ -1,406 +0,0 @@ -=head1 NAME - -Inline::Java::Callback - Callback into Perl from Java. - -=head1 SYNOPSIS - -=for comment - - use Inline Java => <<'END' ; - import org.perl.inline.java.* ; - - class Pod_caller extends InlineJavaPerlCaller { - public Pod_caller() throws InlineJavaException { - } - - public String perl() - throws InlineJavaException, InlineJavaPerlException { - - return (String)CallPerlSub("main::perl", - new Object [] {}) ; - } - } - END - - my $pc = new Pod_caller() ; - print($pc->perl() . "\n") ; # prints perl - - sub perl { - return "perl" ; - } - -=for comment - - -=head1 DESCRIPTION - -C allows you to call Perl functions from Java. To -do this you need to create an C -object. Here is a example of a typical use: - -=for comment - - use Inline Java => <<'END' ; - import java.util.* ; - import org.perl.inline.java.* ; - - class Pod_regexp extends InlineJavaPerlCaller { - public Pod_regexp() throws InlineJavaException { - } - - public boolean match(String target, String pattern) - throws InlineJavaException { - try { - String m = (String)CallPerlSub("main::regexp", - new Object [] {target, pattern}) ; - - if (m.equals("1")){ - return true ; - } - } - catch (InlineJavaPerlException pe){ - // $@ is in pe.GetObject() - } - - return false ; - } - } - END - - my $re = new Pod_regexp() ; - my $match = $re->match("Inline::Java", "^Inline") ; - print($match . "\n") ; # prints 1 - - sub regexp { - my $target = shift ; - my $pattern = shift ; - - return ($target =~ /$pattern/) ; - } - -=for comment - - -=head1 CALLBACK API - -Here are the various methods that one can use to call into -Perl: - -=over 4 - -=item public Object CallPerlSub(String sub, -Object args[], Class cast) -throws InlineJavaException, InlineJavaPerlException - -Calls the specified subroutine with the supplied arguments and tries -to create an object of type 'cast' with the result. - - /* Example */ - Integer sum = (Integer)CallPerlSub("main::add", new Object [] {new Integer(5), new Integer(3)}, Integer.class) ; - -=item public Object CallPerlStaticMethod(String pkg, String method, -Object args[], Class cast) -throws InlineJavaException, InlineJavaPerlException - -Calls the specified static package method (using the $pkg->$method() -notation) with the supplied arguments and tries to create an object -of type 'cast' with the result. - - /* Example */ - Integer sum = (Integer)CallPerlStaticMethod("main", "add", new Object [] {new Integer(5), new Integer(3)}, Integer.class) ; - -=item public Object eval(String code, Class cast) -throws InlineJavaPerlException, InlineJavaException - -Evaluates the given Perl code and tries to create an object -of type 'cast' with the result. - - /* Example */ - Integer sum = (Integer)eval("5 + 3", Integer.class) ; - -=item public Object require(String module_or_file) -throws InlineJavaPerlException, InlineJavaException - -Requires the specified module/file by using a heuristic (currently, -checks whether or not the file exists) and calling Perl's C -function using the appropriate construct. - - /* Example */ - require("Someting") - -=item public Object require_file(String file) -throws InlineJavaPerlException, InlineJavaException - -Requires the specified file. - - /* Example */ - require_file("./my_stuff.pl") ; - -=item public Object require_module(String module) -throws InlineJavaPerlException, InlineJavaException - -Requires the specified module. - - /* Example */ - require_module("Data::Dumper") ; - -=back - -Note: For all CallPerl* and eval methods, the 'cast' parameter is optional -and defaults to 'String.class'. - -These methods can throw 2 types of exceptions: C and -C (both of these belong to the C -package). The former designates an internal C error and the -latter indicates that the Perl callback threw an exception (die() or croak()). -The value of $@ (this can be a scalar or any valid "Inline::Java" object) can -be retrieved using the GetObject() method of the C -object (if you are certain that $@ was a Perl scalar, you can use the -GetString() method). - Z<> - - -=head1 CALLBACK CONTEXT - -By default, callback are executed in scalar context. However if you want to -call certain functions in list context, you must insert "@" in front of the -function name. The result will then be passed on to Java as an Array: - -=for comment - - use Inline Java => <<'END' ; - import org.perl.inline.java.* ; - - class Pod_Context { - static private String dummy[] = {} ; - - static public String [] get_list() - throws InlineJavaException, InlineJavaPerlException { - InlineJavaPerlCaller pc = new InlineJavaPerlCaller() ; - return (String [])pc.CallPerlSub("@main::list", - null, dummy.getClass()) ; - } - } - END - - sub list { - return ('a', 'b', 'c') ; - } - - print(Pod_Context->get_list()->[1] . "\n") ; # prints b - -=for comment - -Note: When calling a Perl function that returns a list or array, you will -need to pass the Class object for the expected array type (in this case -String []). Since these Class objects are difficult to access for array -types, the easiest way to do this is to create a dummy array of the desired -type and call the getClass() method on that object (as seen above). - Z<> - - -=head1 CALLBACK LOOPS - -It is now possible to use callbacks from different Java threads. One of the -big advantages of this is that you can now handle, for example, SWING events -in Perl. Here's an example: - -=for comment - - use Inline Java => <<'END' ; - import java.util.* ; - import org.perl.inline.java.* ; - import javax.swing.* ; - import java.awt.event.* ; - - class Pod_Button extends InlineJavaPerlCaller - implements ActionListener { - JFrame frame = null ; - - public Pod_Button() throws InlineJavaException { - frame = new JFrame("Pod_Button") ; - frame.setSize(100,100) ; - JButton button = new JButton("Click Me!") ; - frame.getContentPane().add(button) ; - button.addActionListener(this) ; - frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE) ; - frame.show() ; - } - - public void actionPerformed(ActionEvent e){ - try { - CallPerlSub("main::button_pressed", new Object [] {}) ; - } - catch (InlineJavaPerlException pe){ - // $@ is in pe.GetObject() - } - catch (InlineJavaException pe) { - pe.printStackTrace() ; - } - } - - public void close(){ - frame.dispose() ; - frame.hide() ; - frame = null ; - } - - public void quit(){ - System.exit(0) ; - } - } - END - - my $b = new Pod_Button() ; - $b->StartCallbackLoop() ; - $b->close() ; - - # Maybe do some other stuff - - exit() ; # in client-server mode, optional - $b->quit() ; # in JNI mode - - sub button_pressed { - print('click!' . "\n") ; # prints click! - $b->StopCallbackLoop() ; - } - -=for comment - -The StartCallbackLoop method can be called on any -C object and will block the -current thread and allow the reception of callbacks through -any InlineJavaPerlCaller that has been created by the same (current) thread. -The only way to interrupt such a StartCallbackLoop method is to call the -StopCallbackLoop method on any C -object that has been created by that same thread. - -Also, only threads that communicate with Perl through C are allowed -to create C objects and invoke their -StartCallbackLoop / StopCallbackLoop methods. - Z<> - - -=head1 SELECT-STYLE CALLBACK LOOPS - -The disadvantage with the type of callback loop presented in the previous -section is that the main portion of the Perl program is completely blocked -while waiting for callbacks. In version 0.51 a new API for callback loops -was introduced, allowing for callbacks to be processed much in the same -fashion one uses select(2) to read data from a filehandle. Here's an -example: - -=for comment - - use Inline Java => <<'END' ; - import java.util.* ; - import org.perl.inline.java.* ; - import javax.swing.* ; - import java.awt.event.* ; - - class Pod_Button extends InlineJavaPerlCaller - implements ActionListener { - JFrame frame = null ; - - public Pod_Button() throws InlineJavaException { - frame = new JFrame("Pod_Button") ; - frame.setSize(100,100) ; - JButton button = new JButton("Click Me!") ; - frame.getContentPane().add(button) ; - button.addActionListener(this) ; - frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE) ; - frame.show() ; - } - - public void actionPerformed(ActionEvent e){ - try { - CallPerlSub("main::button_pressed", new Object [] {}) ; - } - catch (InlineJavaPerlException pe){ - // $@ is in pe.GetObject() - } - catch (InlineJavaException pe) { - pe.printStackTrace() ; - } - } - - public void close(){ - frame.dispose() ; - frame.hide() ; - frame = null ; - } - - public void quit(){ - System.exit(0) ; - } - } - END - - my $b = new Pod_Button() ; - $b->OpenCallbackStream() ; - while ((my $rc = $b->WaitForCallback(5)) > -1){ - if ($rc > 0){ - # A callback is pending, we must process it. - $b->ProcessNextCallback() ; - } - else { - # A timeout has occured after, in this case, 5 secs. - print "5 seconds have passed, still waiting for callback...\n" ; - # Maybe do some other stuff - } - } - $b->close() ; - - # Maybe do some other stuff - - exit() ; # in client-server mode, optional - $b->quit() ; # in JNI mode - - sub button_pressed { - print('click!' . "\n") ; # prints click! - $b->CloseCallbackStream() ; - } - -=for comment - -The StartCallbackStream method can be called on any InlineJavaPerlCaller object -to initialize a channel to receive callbacks. The WaitForCallback method can -then be called with a float timeout value (-1 means wait forever, 0 means return -immediately). The WaitForCallback method can return: - - rc > 0, indicating that rc callbacks are waiting to be processed - rc == 0, indicating that a timeout has occured and no callbacks are waiting - rc == -1, indicating that the callback stream has been closed - -The callback stream can be closed by calling CloseCallbackStream, which works -similarly to the StopCallbackLoop method used in the previous section. - -Also, the restrictions regarding thread communication stated in the previous -section are valid in this case as well. - Z<> - - -=head1 SEE ALSO - -L, L, L. - Z<> - - -=head1 AUTHOR - -Patrick LeBoutillier is the author of Inline::Java. - -Brian Ingerson is the author of Inline. - Z<> - - -=head1 COPYRIGHT - -Copyright (c) 2001-2004, Patrick LeBoutillier. - -All Rights Reserved. This module is free software. It may be used, -redistributed and/or modified under the terms of the Perl Artistic -License. See http://www.perl.com/perl/misc/Artistic.html for more -details. - -=cut diff -Nru libinline-java-perl-0.58~dfsg/Java/Class.pm libinline-java-perl-0.66/Java/Class.pm --- libinline-java-perl-0.58~dfsg/Java/Class.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Class.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,511 +0,0 @@ -package Inline::Java::Class ; - -use strict ; -use Carp ; - -$Inline::Java::Class::VERSION = '0.53_90' ; - -$Inline::Java::Class::MAX_SCORE = 10 ; - -# There is no use supporting exponent notation for integer types since -# Jave does not support it without casting. -my $INT_RE = '^[+-]?\d+$' ; -my $FLOAT_RE = '^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$' ; - -my $RANGE = { - 'java.lang.Byte' => { - REGEXP => $INT_RE, - MAX => 127, - MIN => -128, - }, - 'java.lang.Short' => { - REGEXP => $INT_RE, - MAX => 32767, - MIN => -32768, - }, - 'java.lang.Integer' => { - REGEXP => $INT_RE, - MAX => 2147483647, - MIN => -2147483648, - }, - 'java.lang.Float' => { - REGEXP => $FLOAT_RE, - MAX => 3.4028235e38, - MIN => -3.4028235e38, - # POS_MIN => 1.4e-45, - # NEG_MAX => -1.4e-45, - }, - 'java.lang.Long' => { - REGEXP => $INT_RE, - # MAX => 9223372036854775807, - # MIN => -9223372036854775808, - }, - 'java.lang.Double' => { - REGEXP => $FLOAT_RE, - # MAX => 1.79e308, - # MIN => -1.79e308, - # POS_MIN => 4.9e-324, - # NEG_MAX => -4.9e-324, - }, -} ; -$RANGE->{byte} = $RANGE->{'java.lang.Byte'} ; -$RANGE->{short} = $RANGE->{'java.lang.Short'} ; -$RANGE->{'int'} = $RANGE->{'java.lang.Integer'} ; -$RANGE->{long} = $RANGE->{'java.lang.Long'} ; -$RANGE->{float} = $RANGE->{'java.lang.Float'} ; -$RANGE->{double} = $RANGE->{'java.lang.Double'} ; - -# java.lang.Number support. We allow the widest range -# i.e. Double -$RANGE->{'java.lang.Number'} = $RANGE->{'java.lang.Double'} ; - - -my %numeric_classes = map {($_ => 1)} qw( - java.lang.Byte - java.lang.Short - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - java.lang.Number - byte - short - int - long - float - double -) ; - - -my %double_classes = map {($_ => 1)} qw( - java.lang.Double - double -) ; - -my %string_classes = map {($_ => 1)} qw( - java.lang.String - java.lang.StringBuffer - java.lang.CharSequence -) ; - -my %char_classes = map {($_ => 1)} qw( - java.lang.Character - char -) ; - -my %bool_classes = map {($_ => 1)} qw( - java.lang.Boolean - boolean -) ; - - -# This method makes sure that the class we are asking for -# has the correct form for a Java class. -sub ValidateClass { - my $class = shift ; - - my $ret = ValidateClassSplit($class) ; - - return $ret ; -} - - -my $class_name_regexp = '([\w$]+)(((\.([\w$]+))+)?)' ; -my $class_regexp1 = qr/^($class_name_regexp)()()()$/o ; -my $class_regexp2 = qr/^(\[+)([BCDFIJSZ])()()$/o ; -my $class_regexp3 = qr/^(\[+)([L])($class_name_regexp)(;)$/o ; -sub ValidateClassSplit { - my $class = shift ; - - if (($class =~ $class_regexp1)|| - ($class =~ $class_regexp2)|| - ($class =~ $class_regexp3)){ - return (wantarray ? ($1, $2, $3, $4) : $class) ; - } - - croak "Invalid Java class name $class" ; -} - - -sub CastArguments { - my $args = shift ; - my $proto = shift ; - my $inline = shift ; - - Inline::Java::debug_obj($args) ; - Inline::Java::debug_obj($proto) ; - - my $nb_args = scalar(@{$args}) ; - if ($nb_args != scalar(@{$proto})){ - croak "Wrong number of arguments" ; - } - - my $ret = [] ; - my $score = 0 ; - for (my $i = 0 ; $i < $nb_args ; $i++){ - my $arg = $args->[$i] ; - my $pro = $proto->[$i] ; - my @r = CastArgument($arg, $pro, $inline) ; - $ret->[$i] = $r[0] ; - - $score += $r[1] ; - } - - return ($ret, $score) ; -} - - -sub CastArgument { - my $arg = shift ; - my $proto = shift ; - my $inline = shift ; - - ValidateClass($proto) ; - - my $arg_ori = $arg ; - my $proto_ori = $proto ; - - my $array_score = 0 ; - - my @ret = eval { - my $array_type = undef ; - if ((defined($arg))&&(UNIVERSAL::isa($arg, "Inline::Java::Class::Coerce"))){ - my $v = $arg->__get_value() ; - $proto = $arg->__get_type() ; - $array_type = $arg->__get_array_type() ; - $arg = $v ; - } - - if ((ClassIsReference($proto))&& - (defined($arg))&& - (! UNIVERSAL::isa($arg, "Inline::Java::Object"))){ - # Here we allow scalars to be passed in place of java.lang.Object - # They will wrapped on the Java side. - if (UNIVERSAL::isa($arg, "ARRAY")){ - if (! UNIVERSAL::isa($arg, "Inline::Java::Array")){ - my $an = Inline::Java::Array::Normalizer->new($inline, $array_type || $proto, $arg) ; - $array_score = $an->{score} ; - my $flat = $an->FlattenArray() ; - - # We need to create the array on the Java side, and then grab - # the returned object. - my $obj = Inline::Java::Object->__new($array_type || $proto, $inline, -1, $flat->[0], $flat->[1]) ; - $arg = new Inline::Java::Array($obj) ; - } - else{ - Inline::Java::debug(4, "argument is already an Inline::Java array") ; - } - } - else{ - if (ref($arg)){ - # We got some other type of ref... - if ($arg !~ /^(.*?)=/){ - # We do not have a blessed reference, so ... - croak "Can't convert $arg to object $proto" ; - } - } - else { - # Here we got a scalar - # Here we allow scalars to be passed in place of java.lang.Object - # They will wrapped on the Java side. - if ($proto ne "java.lang.Object"){ - croak "Can't convert $arg to object $proto" ; - } - } - } - } - if ((ClassIsPrimitive($proto))&&(ref($arg))){ - croak "Can't convert $arg to primitive $proto" ; - } - - if (ClassIsNumeric($proto)){ - if (! defined($arg)){ - # undef gets lowest score since it can be passed - # as anything - return (0, 1) ; - } - my $re = $RANGE->{$proto}->{REGEXP} ; - my $min = $RANGE->{$proto}->{MIN} ; - my $max = $RANGE->{$proto}->{MAX} ; - Inline::Java::debug(4, - "min = " . ($min || '') . ", " . - "max = " . ($max || '') . ", " . - "val = $arg") ; - if ($arg =~ /$re/){ - if (((! defined($min))||($arg >= $min))&& - ((! defined($max))||($arg <= $max))){ - # number is a pretty precise match, but it's still - # guessing amongst the numeric types - my $points = 5.5 ; - if (($inline->get_java_config('NATIVE_DOUBLES'))&&(ClassIsDouble($proto))){ - # We want to send the actual double bytes to Java - my $bytes = pack("d", $arg) ; - $arg = bless(\$bytes, 'Inline::Java::double') ; - return ($arg, $points) ; - } - else { - return ($arg, $points) ; - } - } - croak "$arg out of range for type $proto" ; - } - croak "Can't convert $arg to $proto" ; - } - elsif (ClassIsChar($proto)){ - if (! defined($arg)){ - # undef gets lowest score since it can be passed - # as anything - return ("\0", 1) ; - } - if (length($arg) == 1){ - # char is a pretty precise match - return ($arg, 5) ; - } - croak "Can't convert $arg to $proto" ; - } - elsif (ClassIsBool($proto)){ - if (! defined($arg)){ - # undef gets lowest score since it can be passed - # as anything - return (0, 1) ; - } - elsif (! $arg){ - # bool gets lowest score since anything is a bool - return (0, 1) ; - } - else{ - # bool gets lowest score since anything is a bool - return (1, 1) ; - } - } - elsif (ClassIsString($proto)){ - if (! defined($arg)){ - # undef gets lowest score since it can be passed - # as anything - return (undef, 1) ; - } - # string get almost lowest score since anything can match it - # except objects - if ($proto eq "java.lang.StringBuffer"){ - # in case we have both protos, we want to give String - # the advantage - return ($arg, 1.75) ; - } - return ($arg, 2) ; - } - else{ - if (! defined($arg)){ - # undef gets lowest score since it can be passed - # as anything - return ($arg, 1) ; - } - - # Here the prototype calls for an object of type $proto - # We must ask Java if our object extends $proto - if (ref($arg)){ - if ((UNIVERSAL::isa($arg, "Inline::Java::Object"))||(UNIVERSAL::isa($arg, "Inline::Java::Array"))){ - my ($msg, $score) = $arg->__isa($proto) ; - if ($msg){ - croak $msg ; - } - Inline::Java::debug(3, "$arg is a $proto") ; - - # a matching object, pretty good match, except if proto - # is java.lang.Object - if ($proto eq "java.lang.Object"){ - return ($arg, 1) ; - } - - # Here we deduce points the more our argument is "far" - # from the prototype. - if (! UNIVERSAL::isa($arg, "Inline::Java::Array")){ - return ($arg, 7 - ($score * 0.01)) ; - } - else{ - # We need to keep the array score somewhere... - return ($arg, $array_score) ; - } - } - else { - # We want to send a Perl object to the Java side. - my $ijp = new Inline::Java::Protocol(undef, $inline) ; - my $score = $ijp->__ISA('org.perl.inline.java.InlineJavaPerlObject', $proto) ; - if ($score == -1){ - croak "$proto is not a kind of org.perl.inline.java.InlineJavaPerlObject" ; - } - - Inline::Java::debug(3, "$arg is a $proto") ; - - # a matching object, pretty good match, except if proto - # is java.lang.Object - if ($proto eq "java.lang.Object"){ - return ($arg, 1) ; - } - else{ - return ($arg, 7 - ($score * 0.01)) ; - } - } - } - - # Here we are passing a scalar as an object, this is pretty - # vague as well - return ($arg, 1) ; - } - } ; - die("$@\n") if $@ ; - - if ((defined($arg_ori))&&(UNIVERSAL::isa($arg_ori, "Inline::Java::Class::Coerce"))){ - # It seems we had casted the variable to a specific type - if ($arg_ori->__matches($proto_ori)){ - Inline::Java::debug(3, "type coerce match!") ; - $ret[1] = $Inline::Java::Class::MAX_SCORE ; - } - else{ - # We have coerced to something that doesn't exactly match - # any of the available types. - # For now we don't allow this. - croak "Coerce ($proto) doesn't exactly match prototype ($proto_ori)" ; - } - } - - return @ret ; -} - - -sub IsMaxArgumentsScore { - my $args = shift ; - my $score = shift ; - - if ((scalar(@{$args}) * 10) == $score){ - return 1 ; - } - - return 0 ; -} - - -sub ClassIsNumeric { - my $class = shift ; - - return $numeric_classes{$class} ; -} - - -sub ClassIsDouble { - my $class = shift ; - - return $double_classes{$class} ; -} - - -sub ClassIsString { - my $class = shift ; - - return $string_classes{$class} ; -} - - -sub ClassIsChar { - my $class = shift ; - - return $char_classes{$class} ; -} - - -sub ClassIsBool { - my $class = shift ; - - return $bool_classes{$class} ; -} - - -sub ClassIsPrimitive { - my $class = shift ; - - if ((ClassIsNumeric($class))||(ClassIsString($class))||(ClassIsChar($class))||(ClassIsBool($class))){ - return 1 ; - } - - return 0 ; -} - - -sub ClassIsReference { - my $class = shift ; - - if (ClassIsPrimitive($class)){ - return 0 ; - } - - return 1 ; -} - - -sub ClassIsArray { - my $class = shift ; - - if ((ClassIsReference($class))&&($class =~ /^(\[+)(.*)$/)){ - return 1 ; - } - - return 0 ; -} - - - -######################## Inline::Java::Class::Coerce ######################## -package Inline::Java::Class::Coerce ; - - -use Carp ; - -sub new { - my $class = shift ; - my $type = shift ; - my $value = shift ; - my $array_type = shift ; - - if (UNIVERSAL::isa($value, "Inline::Java::Class::Coerce")){ - # This allows chaining - $value = $value->get_value() ; - } - - my $this = {} ; - $this->{cast} = Inline::Java::Class::ValidateClass($type) ; - $this->{value} = $value ; - $this->{array_type} = $array_type ; - - bless($this, $class) ; - return $this ; -} - - -sub __get_value { - my $this = shift ; - - return $this->{value} ; -} - - -sub __get_type { - my $this = shift ; - - return $this->{cast} ; -} - -sub __get_array_type { - my $this = shift ; - - return $this->{array_type} ; -} - - -sub __matches { - my $this = shift ; - my $proto = shift ; - - return ($proto eq $this->{cast}) ; -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Handle.pm libinline-java-perl-0.66/Java/Handle.pm --- libinline-java-perl-0.58~dfsg/Java/Handle.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Handle.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -package Inline::Java::Handle ; -@Inline::Java::Handle::ISA = qw(Inline::Java::Handle::Tie) ; - -use strict ; -use Symbol ; -use Carp ; - -$Inline::Java::Handle::VERSION = '0.53_90' ; - - -# Here we store as keys the knots and as values our blessed objects -my $OBJECTS = {} ; - - -sub new { - my $class = shift ; - my $object = shift ; - - my $fh = gensym() ; - my $knot = tie *{$fh}, $class ; - my $this = bless ($fh, $class) ; - - $OBJECTS->{$knot} = $object ; - - Inline::Java::debug(5, "this = '$this'") ; - Inline::Java::debug(5, "knot = '$knot'") ; - - return $this ; -} - - -sub __get_object { - my $this = shift ; - - my $knot = tied $this || $this ; - - my $ref = $OBJECTS->{$knot} ; - if (! defined($ref)){ - croak "Unknown Java handle reference '$knot'" ; - } - - return $ref ; -} - - -sub __isa { - my $this = shift ; - my $proto = shift ; - - return $this->__get_object()->__isa($proto) ; -} - - -sub __read { - my $this = shift ; - my ($buf, $len, $offset) = @_ ; - - my $obj = $this->__get_object() ; - - my $ret = undef ; - eval { - my $str = $obj->__get_private()->{proto}->ReadFromJavaHandle($len) ; - $len = length($str) ; - if ($len > 0){ - substr($buf, $offset, $len) = $str ; - $_[0] = $buf ; - $ret = $len ; - } - } ; - croak $@ if $@ ; - - return $ret ; -} - - -sub __readline { - my $this = shift ; - - my $obj = $this->__get_object() ; - - my $ret = undef ; - eval { - $ret = $obj->__get_private()->{proto}->ReadLineFromJavaHandle() ; - } ; - croak $@ if $@ ; - - return $ret ; -} - - -sub __write { - my $this = shift ; - my $buf = shift ; - my $len = shift ; - my $offset = shift ; - - my $obj = $this->__get_object() ; - - my $ret = -1 ; - eval { - my $len = $obj->__get_private()->{proto}->WriteToJavaHandle(substr($buf, $offset, $len)) ; - $ret = $len ; - } ; - croak $@ if $@ ; -} - - -sub __eof { - my $this = shift ; -} - - -sub __close { - my $this = shift ; - - my $obj = $this->__get_object() ; - - my $ret = undef ; - { - local $@ ; - eval { - $ret = $obj->__get_private()->{proto}->CloseJavaHandle() ; - $obj->__get_private()->{closed} = 1 ; - } ; - croak $@ if $@ ; - } - - return $ret ; -} - - - -sub AUTOLOAD { - my $this = shift ; - my @args = @_ ; - - use vars qw($AUTOLOAD) ; - my $func_name = $AUTOLOAD ; - # Strip package from $func_name, Java will take of finding the correct - # method. - $func_name =~ s/^(.*)::// ; - - croak "Can't call method '$func_name' on Java handles" ; -} - - -sub DESTROY { - my $this = shift ; - - - my $knot = tied *{$this} ; - if (! $knot){ - Inline::Java::debug(4, "destroying Inline::Java::Handle::Tie") ; - - my $obj = $this->__get_object() ; - if (! $obj->__get_private()->{closed}){ - $this->__close() ; - } - - delete $OBJECTS->{$this} ; - } - else { - Inline::Java::debug(4, "destroying Inline::Java::Handle") ; - } -} - - - -######################## Handle methods ######################## -package Inline::Java::Handle::Tie ; -@Inline::Java::Handle::Tie::ISA = qw(Tie::StdHandle) ; - - -use Tie::Handle ; -use Carp ; - - -sub TIEHANDLE { - my $class = shift ; - my $jclass = shift ; - - return $class->SUPER::TIEHANDLE(@_) ; -} - - -sub READ { - my $this = shift ; - my ($buf, $len, $offset) = @_ ; - - my $ret = $this->__read($buf, $len, $offset) ; - $_[0] = $buf ; - - return $ret ; -} - - -sub READLINE { - my $this = shift ; - - return $this->__readline() ; -} - - -sub WRITE { - my $this = shift ; - my $buf = shift ; - my $len = shift ; - my $offset = shift ; - - return $this->__write($buf, $len, $offset) ; -} - - -sub BINMODE { - my $this = shift ; - - croak "Operation BINMODE not supported on Java handle" ; -} - - -sub OPEN { - my $this = shift ; - - croak "Operation OPEN not supported on Java handle" ; -} - - -sub TELL { - my $this = shift ; - - croak "Operation TELL not supported on Java handle" ; -} - - -sub FILENO { - my $this = shift ; - - croak "Operation FILENO not supported on Java handle" ; -} - - -sub SEEK { - my $this = shift ; - - croak "Operation SEEK not supported on Java handle" ; -} - - -sub EOF { - my $this = shift ; - - return $this->__eof() ; -} - - -sub CLOSE { - my $this = shift ; - - return $this->__close() ; -} - - -sub DESTROY { - my $this = shift ; -} - - -1 ; - diff -Nru libinline-java-perl-0.58~dfsg/Java/JVM.pm libinline-java-perl-0.66/Java/JVM.pm --- libinline-java-perl-0.58~dfsg/Java/JVM.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/JVM.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,449 +0,0 @@ -package Inline::Java::JVM ; - - -use strict ; -use Carp ; -use IO::File ; -use IPC::Open3 ; -use IO::Socket ; -use Text::ParseWords ; -use Inline::Java::Portable ; - -$Inline::Java::JVM::VERSION = '0.53_90' ; - -my %SIGS = () ; - -my @SIG_LIST = ('HUP', 'INT', 'PIPE', 'TERM') ; - -sub new { - my $class = shift ; - my $o = shift ; - - my $this = {} ; - bless($this, $class) ; - - foreach my $sig (@SIG_LIST){ - local $SIG{__WARN__} = sub {} ; - if (exists($SIG{$sig})){ - $SIGS{$sig} = $SIG{$sig} ; - } - } - - $this->{socket} = undef ; - $this->{JNI} = undef ; - $this->{embedded} = $o->get_java_config('EMBEDDED_JNI') ; - $this->{owner} = 1 ; - $this->{destroyed} = 0 ; - $this->{private} = $o->get_java_config('PRIVATE') ; - $this->{debugger} = $o->get_java_config('DEBUGGER') ; - - if ($this->{embedded}){ - Inline::Java::debug(1, "using embedded JVM...") ; - } - else{ - Inline::Java::debug(1, "starting JVM...") ; - } - - my $args = $o->get_java_config('EXTRA_JAVA_ARGS') ; - if ($o->get_java_config('JNI')){ - Inline::Java::debug(1, "JNI mode") ; - - # Split args and remove quotes - my @args = map {s/(['"])(.*)\1/$2/ ; $_} - parse_line('\s+', 1, $args) ; - my $jni = new Inline::Java::JNI( - $ENV{CLASSPATH} || '', - \@args, - $this->{embedded}, - Inline::Java::get_DEBUG(), - $o->get_java_config('NATIVE_DOUBLES'), - ) ; - $jni->create_ijs() ; - - $this->{JNI} = $jni ; - } - else { - Inline::Java::debug(1, "client/server mode") ; - - my $debug = Inline::Java::get_DEBUG() ; - - $this->{shared} = $o->get_java_config('SHARED_JVM') ; - $this->{start_jvm} = $o->get_java_config('START_JVM') ; - $this->{port} = $o->get_java_config('PORT') ; - $this->{host} = $o->get_java_config('HOST') ; - - # Used to limit the bind of the JVM server - $this->{'bind'} = $o->get_java_config('BIND') ; - - # Grab the next free port number and release it. - if ((! $this->{shared})&&($this->{port} < 0)){ - if (Inline::Java::Portable::portable("GOT_NEXT_FREE_PORT")){ - my $sock = IO::Socket::INET->new( - Listen => 0, Proto => 'tcp', - LocalAddr => 'localhost', LocalPort => 0) ; - if ($sock){ - $this->{port} = $sock->sockport() ; - Inline::Java::debug(2, "next available port number is $this->{port}") ; - close($sock) ; - } - else{ - # Revert to the default. - $this->{port} = - $this->{port} ; - carp( - "Could not get next available port number, using port " . - "$this->{port} instead. Use the PORT configuration " . - "option to suppress this warning.\n Error: $!\n") ; - } - } - else{ - # Revert to the default. - # Try this maybe: 9000 + $$ ? - $this->{port} = - $this->{port} ; - } - } - - # Check if JVM is already running - if ($this->{shared}){ - eval { - $this->reconnect() ; - } ; - if (! $@){ - Inline::Java::debug(1, "connected to already running JVM!") ; - return $this ; - } - - if (! $this->{start_jvm}){ - croak("Can't find running JVM and START_JVM = 0") ; - } - } - - my $java = File::Spec->catfile($o->get_java_config('J2SDK'), - Inline::Java::Portable::portable("J2SDK_BIN"), - ($this->{debugger} ? "jdb" : "java") . - Inline::Java::Portable::portable("EXE_EXTENSION")) ; - - my $shared = ($this->{shared} ? "true" : "false") ; - my $priv = ($this->{private} ? "true" : "false") ; - my $native_doubles = ($o->get_java_config('NATIVE_DOUBLES') ? "true" : "false") ; - my $cmd = Inline::Java::Portable::portable("SUB_FIX_CMD_QUOTES", "\"$java\" $args org.perl.inline.java.InlineJavaServer $debug $this->{bind} $this->{port} $shared $priv $native_doubles") ; - Inline::Java::debug(2, $cmd) ; - if ($o->get_config('UNTAINT')){ - ($cmd) = $cmd =~ /(.*)/ ; - } - - my $pid = 0 ; - eval { - $pid = $this->launch($o, $cmd) ; - } ; - croak "Can't exec JVM: $@" if $@ ; - - if ($this->{shared}){ - # As of 0.40, we release by default. - $this->release() ; - } - else{ - $this->capture() ; - } - - $this->{pid} = $pid ; - $this->{socket} = setup_socket( - $this->{host}, - $this->{port}, - # Give the user an extra hour's time set breakpoints and the like... - ($this->{debugger} ? 3600 : 0) + int($o->get_java_config('STARTUP_DELAY')), - 0 - ) ; - } - - return $this ; -} - - -sub launch { - my $this = shift ; - my $o = shift ; - my $cmd = shift ; - - local $SIG{__WARN__} = sub {} ; - - my $dn = Inline::Java::Portable::portable("DEV_NULL") ; - my $in = ($this->{debugger} ? ">&STDIN" : new IO::File("<$dn")) ; - if (! defined($in)){ - croak "Can't open $dn for reading" ; - } - - my $out = ">&STDOUT" ; - if ($this->{shared}){ - $out = new IO::File(">$dn") ; - if (! defined($out)){ - croak "Can't open $dn for writing" ; - } - } - - my $err = ">&STDERR" ; - - my $pid = open3($in, $out, $err, $cmd) ; - - if (! $this->{debugger}){ - close($in) ; - } - if ($this->{shared}){ - close($out) ; - } - - return $pid ; -} - - -sub DESTROY { - my $this = shift ; - - $this->shutdown() ; -} - - -sub shutdown { - my $this = shift ; - - if ($this->{embedded}){ - Inline::Java::debug(1, "embedded JVM, skipping shutdown.") ; - return ; - } - - if (! $this->{destroyed}){ - if ($this->am_owner()){ - Inline::Java::debug(1, "JVM owner exiting...") ; - - if ($this->{socket}){ - # This asks the Java server to stop and die. - my $sock = $this->{socket} ; - if ($sock->peername()){ - Inline::Java::debug(1, "Sending 'die' message to JVM...") ; - print $sock "die\n" ; - } - else{ - carp "Lost connection with Java virtual machine" ; - } - close($sock) ; - - if ($this->{pid}){ - # Here we go ahead and send the signals anyway to be very - # sure it's dead... - # Always be polite first, and then insist. - if (Inline::Java::Portable::portable('GOT_SAFE_SIGNALS')){ - Inline::Java::debug(1, "Sending 15 signal to JVM...") ; - kill(15, $this->{pid}) ; - Inline::Java::debug(1, "Sending 9 signal to JVM...") ; - kill(9, $this->{pid}) ; - } - - # Reap the child... - waitpid($this->{pid}, 0) ; - } - } - if ($this->{JNI}){ - $this->{JNI}->shutdown() ; - } - } - else{ - # We are not the JVM owner, so we simply politely disconnect - if ($this->{socket}){ - Inline::Java::debug(1, "JVM non-owner exiting...") ; - close($this->{socket}) ; - $this->{socket} = undef ; - } - - # This should never happen in JNI mode - } - - $this->{destroyed} = 1 ; - } -} - - -# This cannot be a member function because it can be used -# elsewhere to connect to the JVM. -sub setup_socket { - my $host = shift ; - my $port = shift ; - my $timeout = shift ; - my $one_shot = shift ; - - my $socket = undef ; - - my $last_words = "timeout\n" ; - my $got_alarm = Inline::Java::Portable::portable("GOT_ALARM") ; - - eval { - local $SIG{ALRM} = sub { die($last_words) ; } ; - - if ($got_alarm){ - alarm($timeout) ; - } - - # ignore expected "connection refused" warnings - # Thanks binkley! - local $SIG{__WARN__} = sub { - warn($@) unless ($@ =~ /Connection refused/i) ; - } ; - - while (1){ - $socket = new IO::Socket::INET( - PeerAddr => $host, - PeerPort => $port, - Proto => 'tcp') ; - if (($socket)||($one_shot)){ - last ; - } - select(undef, undef, undef, 0.1) ; - } - - if ($got_alarm){ - alarm(0) ; - } - } ; - if ($@){ - if ($@ eq $last_words){ - croak "JVM taking more than $timeout seconds to start, or died before Perl could connect. Increase config STARTUP_DELAY if necessary." ; - } - else{ - if ($got_alarm){ - alarm(0) ; - } - croak $@ ; - } - } - - if (! $socket){ - croak "Can't connect to JVM at ($host:$port): $!" ; - } - - $socket->autoflush(1) ; - - return $socket ; -} - - -sub reconnect { - my $this = shift ; - - if (($this->{JNI})||(! $this->{shared})){ - return ; - } - - if ($this->{socket}){ - # Close the previous socket - close($this->{socket}) ; - $this->{socket} = undef ; - } - - my $socket = setup_socket( - $this->{host}, - $this->{port}, - 0, - 1 - ) ; - $this->{socket} = $socket ; - - # Now that we have reconnected, we release the JVM - $this->release() ; -} - - -sub capture { - my $this = shift ; - - if (($this->{JNI})||(! $this->{shared})){ - return ; - } - - foreach my $sig (@SIG_LIST){ - if (exists($SIG{$sig})){ - $SIG{$sig} = \&Inline::Java::done ; - } - } - - $this->{owner} = 1 ; -} - - -sub am_owner { - my $this = shift ; - - return $this->{owner} ; -} - - -sub release { - my $this = shift ; - - if (($this->{JNI})||(! $this->{shared})){ - return ; - } - - foreach my $sig (@SIG_LIST){ - local $SIG{__WARN__} = sub {} ; - if (exists($SIG{$sig})){ - $SIG{$sig} = $SIGS{$sig} ; - } - } - - $this->{owner} = 0 ; -} - - -sub process_command { - my $this = shift ; - my $inline = shift ; - my $data = shift ; - - my $resp = undef ; - - # Patch by Simon Cozens for perl -wle 'use Our::Module; do_stuff()' - local $/ = "\n" ; - local $\ = "" ; - # End Patch - - while (1){ - Inline::Java::debug(3, "packet sent is $data") ; - - if ($this->{socket}){ - - my $sock = $this->{socket} ; - print $sock $data . "\n" or - croak "Can't send packet to JVM: $!" ; - - $resp = <$sock> ; - if (! $resp){ - croak "Can't receive packet from JVM: $!" ; - } - - # Release the reference since the object has been sent back - # to Java. - $Inline::Java::Callback::OBJECT_HOOK = undef ; - } - if ($this->{JNI}){ - $Inline::Java::JNI::INLINE_HOOK = $inline ; - $resp = $this->{JNI}->process_command($data) ; - } - chomp($resp) ; - - Inline::Java::debug(3, "packet recv is $resp") ; - - # We got an answer from the server. Is it a callback? - if ($resp =~ /^callback/o){ - ($data, $Inline::Java::Callback::OBJECT_HOOK) = Inline::Java::Callback::InterceptCallback($inline, $resp) ; - next ; - } - else{ - last ; - } - } - - return $resp ; -} - - - -1 ; - diff -Nru libinline-java-perl-0.58~dfsg/Java/Makefile.PL libinline-java-perl-0.66/Java/Makefile.PL --- libinline-java-perl-0.58~dfsg/Java/Makefile.PL 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Makefile.PL 2018-04-06 00:28:22.000000000 +0000 @@ -4,9 +4,8 @@ use strict ; use File::Spec ; -require "Portable.pm" ; # The file we just produced in the parent Makefile.PL -require "default_j2sdk.pl" ; +require "Inline/Java/default_j2sdk.pl" ; my $build_jni = $main::build_jni ; my $build_perl_natives = $main::build_perl_natives ; @@ -49,22 +48,9 @@ $files->{$f}->{default_choice} = 1 ; } - my $build_jni_by_dflt = Inline::Java::Portable::portable("BUILD_JNI_BY_DFLT") ; if (! defined($build_jni)){ - print - "\nInline::Java can use a JNI extension that allows the Java Virtual Machine\n" . - "(JVM) to be dynamically linked with Perl instead of running as a separate\n" . - "process. The use of this extension is optional, and building it still\n" . - "allows Inline::Java to run the JVM in the default (separate process)\n" . - "fashion.\n" . - "Note: You need a C compiler to build the extension.\n" ; -# "Note: You must build the extension if you wish to use PerlNatives or\n" . -# " PerlInterpreter.\n" ; - if (AskYN("Do you wish to build the JNI extension?", - ($build_jni_by_dflt ? 'y' : 'n'))){ - $build_jni = 1 ; - } + $build_jni = $build_jni_by_dflt; } if ($build_jni){ print "\nBuilding JNI extension.\n\n" ; @@ -127,10 +113,11 @@ # Cygwin: create gcc-compatible library wrapper for jvm.dll if ($^O eq 'cygwin') { - my $dll = File::Spec->catfile($jdk_dir, 'lib', 'libjvm.dll.a') ; - print "Creating '$dll' for cygwin.\n\n" ; - system("/usr/bin/dlltool --input-def jvm.def --kill-at --dllname jvm.dll --output-lib '$dll'") - and print "Error attempting to create '$jdk_dir/lib/libjvm.dll.a'\n" ; + my $lib = File::Spec->catfile(Cwd::cwd, 'libjvm.dll.a') ; + my $dll = File::Spec->catfile($files->{$jvm_so}->{selected}, 'jvm.dll') ; + print "Creating '$lib' for cygwin.\n\n" ; + system("/usr/bin/dlltool --kill-at --dllname jvm.dll --output-lib '$lib' '$dll'") + and print "Error attempting to create '$lib'\n" ; } print "Building with:\n" ; @@ -151,6 +138,9 @@ ($files->{'jni.h'}->{selected}, $files->{'jni_md.h'}->{selected}) ; @main::L = map { Inline::Java::Portable::portable('SUB_FIX_MAKE_QUOTES', "-L$_") } ($files->{$jvm_lib}->{selected}) ; + if ($^O eq 'cygwin') { + push @main::L, Inline::Java::Portable::portable('SUB_FIX_MAKE_QUOTES', '-L' . Cwd::cwd); + } my $DIR = [] ; if (! defined($build_perl_interpreter)){ diff -Nru libinline-java-perl-0.58~dfsg/Java/Natives/t/01_init.t libinline-java-perl-0.66/Java/Natives/t/01_init.t --- libinline-java-perl-0.58~dfsg/Java/Natives/t/01_init.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Natives/t/01_init.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -use strict ; -use Test ; - -BEGIN { - plan(tests => 1) ; - mkdir('./_Inline_test', 0777) unless -e './_Inline_test' ; -} - - -ok(1) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Natives/t/02_perl_natives.t libinline-java-perl-0.66/Java/Natives/t/02_perl_natives.t --- libinline-java-perl-0.58~dfsg/Java/Natives/t/02_perl_natives.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Natives/t/02_perl_natives.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -use strict ; -use Test ; - - -BEGIN { - plan(tests => 5) ; -} - - -use Inline Config => - DIRECTORY => './_Inline_test' ; - -use Inline::Java qw(caught) ; - -use Inline ( - Java => 'DATA', -) ; - - -eval { - t121->init() ; - my $t = new t121() ; - ok($t->types_stub(1, 2, 3, 4, 5, 6, 1, 2, "1000"), 1024) ; - ok($t->array_stub([34, 56], ["toto", "789"]), 789 + 34) ; - - my $t2 = new t1212() ; - ok($t2->types_stub(1, 2, 3, 4, 5, 6, 1, 2, "1000"), 1024) ; - - ok($t->callback_stub(), "toto") ; - ok($t->__get_private()->{proto}->ObjectCount(), 2) ; -} ; -if ($@){ - if (caught("java.lang.Throwable")){ - $@->printStackTrace() ; - die("Caught Java Exception") ; - } - else{ - die $@ ; - } -} - - -################################## - -package t121 ; -sub types { - my $this = shift ; - - my $sum = 0 ; - map {$sum += $_} @_ ; - return $sum ; -} - - -sub array { - my $this = shift ; - my $i = shift ; - my $str = shift ; - - return $i->[0] + $str->[1] ; -} - - -sub callback { - my $this = shift ; - - return $this->get_name() ; -} - - -package main ; -__DATA__ - -__Java__ - - -import java.io.* ; -import org.perl.inline.java.* ; - -class t121 extends InlineJavaPerlNatives { - static public boolean got14(){ - return System.getProperty("java.version").startsWith("1.4") ; - } - - public t121() throws InlineJavaException { - } - - static public void init() throws InlineJavaException { - init("test") ; - } - - public String types_stub(byte b, short s, int i, long j, float f, double d, - boolean x, char c, String str){ - return types(b, s, i, j, f, d, x, c, str) ; - } - public native String types(byte b, short s, int i, long j, float f, double d, - boolean x, char c, String str) ; - - public String array_stub(int i[], String str[]){ - return array(i, str) ; - } - private native String array(int i[], String str[]) ; - - public String callback_stub(){ - return callback() ; - } - public native String callback() ; - - public String get_name(){ - return "toto" ; - } -} ; - - -class t1212 extends t121 { - public t1212() throws InlineJavaException { - } -} ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Object.pm libinline-java-perl-0.66/Java/Object.pm --- libinline-java-perl-0.58~dfsg/Java/Object.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Object.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -package Inline::Java::Object ; -@Inline::Java::Object::ISA = qw(Inline::Java::Object::Tie) ; - -use strict ; -use Inline::Java::Protocol ; -use Carp ; - -$Inline::Java::Object::VERSION = '0.53_90' ; - -# Here we store as keys the knots and as values our blessed private objects -my $PRIVATES = {} ; - - -# Bogus constructor. We fall here if no public constructor is defined -# in the Java class. -sub new { - my $class = shift ; - - croak "No public constructor defined for class $class" ; -} - - -# Constructor. Here we create a new object that will be linked -# to a real Java object. -sub __new { - my $class = shift ; - my $java_class = shift ; - my $inline = shift ; - my $objid = shift ; - my $proto = shift ; - my $args = shift ; - - my %this = () ; - - my $knot = tie %this, $class ; - my $this = bless(\%this, $class) ; - - my $pkg = $inline->get_api('pkg') ; - if ($class ne "Inline::Java::Object"){ - $class = Inline::Java::java2perl($pkg, $java_class) ; - } - - my $priv = Inline::Java::Object::Private->new($class, $java_class, $inline) ; - $PRIVATES->{$knot} = $priv ; - - if ($objid <= -1){ - my $obj = undef ; - eval { - $obj = $this->__get_private()->{proto}->CreateJavaObject($java_class, $proto, $args) ; - } ; - croak $@ if $@ ; - - if (! defined($this->__get_private()->{id})){ - # Use created a java::lang::String or something... - return $obj ; - } - } - else{ - $this->__get_private()->{id} = $objid ; - Inline::Java::debug(2, "creating object in java ($class):") ; - } - - Inline::Java::debug_obj($this) ; - - return $this ; -} - - -sub __get_private { - my $this = shift ; - - my $knot = tied(%{$this}) || $this ; - - my $priv = $PRIVATES->{$knot} ; - if (! defined($priv)){ - croak "Unknown Java object reference $knot" ; - } - - return $priv ; -} - - -# Checks to make sure all the arguments can be "cast" to prototype -# types. -sub __validate_prototype { - my $this = shift ; - my $method = shift ; - my $args = shift ; - my $protos = shift ; - my $inline = shift ; - - my @matched = () ; - - my @proto_values = values %{$protos} ; - my @errors = () ; - foreach my $s (@proto_values){ - my $proto = $s->{SIGNATURE} ; - my $stat = $s->{STATIC} ; - my $idx = $s->{IDX} ; - my $new_args = undef ; - my $score = undef ; - - my $sig = Inline::Java::Protocol->CreateSignature($proto) ; - Inline::Java::debug(3, "matching arguments to $method$sig") ; - - eval { - ($new_args, $score) = Inline::Java::Class::CastArguments($args, $proto, $inline) ; - } ; - if ($@){ - if (scalar(@proto_values) == 1){ - # Here we have only 1 prototype, so we return the error. - croak $@ ; - } - push @errors, $@ ; - Inline::Java::debug(3, "error trying to fit args to prototype: $@") ; - next ; - } - - # We passed! - Inline::Java::debug(3, "match successful: score is $score") ; - my $h = { - PROTO => $proto, - NEW_ARGS => $new_args, - NB_ARGS => scalar(@{$new_args}), - SCORE => $score, - STATIC => $stat, - IDX => $idx, - } ; - - # Tiny optimization: abort if type coerce was used and matched for - # every parameter - if (Inline::Java::Class::IsMaxArgumentsScore($new_args, $score)){ - Inline::Java::debug(3, "perfect match found, aborting search") ; - @matched = () ; - push @matched, $h ; - last ; - } - else{ - push @matched, $h ; - } - } - - my $nb_matched = scalar(@matched) ; - if (! $nb_matched){ - my $name = (ref($this) ? $this->__get_private()->{class} : $this) ; - my $sa = Inline::Java::Protocol->CreateSignature($args) ; - my $msg = "In method $method of class $name: Can't find any signature that matches " . - "the arguments passed $sa.\nAvailable signatures are:\n" ; - my $i = 0 ; - foreach my $s (@proto_values){ - my $proto = $s->{SIGNATURE} ; - my $static = ($s->{STATIC} ? "static " : "") ; - - my $sig = Inline::Java::Protocol->CreateSignature($proto) ; - $msg .= "\t$static$method$sig\n" ; - $msg .= "\t\terror was: $errors[$i]" ; - $i++ ; - } - chomp $msg ; - croak $msg ; - } - - my $chosen = undef ; - foreach my $h (@matched){ - my $idx = ($chosen ? $chosen->{IDX} : 0) ; - my $max = ($chosen ? $chosen->{SCORE} : 0) ; - - my $s = $h->{SCORE} ; - my $i = $h->{IDX} ; - if ($s > $max){ - $chosen = $h ; - } - elsif ($s == $max){ - # Here if the scores are equal we take the last one since - # we start with inherited methods and move to class mothods - if ($i > $idx){ - $chosen = $h ; - } - } - } - - if ((! $chosen->{STATIC})&&(! ref($this))){ - # We are trying to call an instance method without an object - # reference - croak "Method $method of class $this must be called from an object reference" ; - } - - # Here we will be polite and warn the user if we had to choose a - # method by ourselves. - if ($inline->get_java_config('WARN_METHOD_SELECT')){ - if (($nb_matched > 1)&& - ($chosen->{SCORE} < ($chosen->{NB_ARGS} * 10))){ - my $msg = "Based on the arguments passed, I had to choose between " . - "the following method signatures:\n" ; - foreach my $m (@matched){ - my $s = Inline::Java::Protocol->CreateSignature($m->{PROTO}) ; - my $c = ($m eq $chosen ? "*" : " ") ; - $msg .= " $c $method$s\n" ; - } - $msg .= "I chose the one indicated by a star (*). To force " . - "the use of another signature or to disable this warning, use " . - "the casting functionality described in the documentation." ; - carp $msg ; - } - } - - return ( - $chosen->{PROTO}, - $chosen->{NEW_ARGS}, - $chosen->{STATIC}, - ) ; -} - - -sub __isa { - my $this = shift ; - my $proto = shift ; - - my $ret = undef ; - eval { - $ret = $this->__get_private()->{proto}->ISA($proto) ; - } ; - if ($@){ - return ($@, 0) ; - } - - if ($ret == -1){ - my $c = $this->__get_private()->{java_class} ; - return ("$c is not a kind of $proto", 0) ; - } - - return ('', $ret) ; -} - - -sub __cast { - my $this = shift ; - my $class = shift ; - - my $ret = $this->__get_private()->{proto}->Cast($class) ; - - return $ret ; -} - - -sub __get_member { - my $this = shift ; - my $key = shift ; - - if ($this->__get_private()->{class} eq "Inline::Java::Object"){ - croak "Can't get member '$key' for an object that is not bound to Perl" ; - } - - Inline::Java::debug(3, "fetching member variable '$key'") ; - - my $inline = $this->__get_private()->{inline} ; - my $fields = $inline->get_fields($this->__get_private()->{class}) ; - - my $types = $fields->{$key} ; - if ($types){ - # We take the last one, which is more specific. Eventually - # we should use a scoring method just like for the methods - my $sign = undef ; - foreach my $s (values %{$types}){ - if ((! defined($sign))||($s->{IDX} > $sign->{IDX})){ - $sign = $s ; - } - } - - my $proto = $sign->{TYPE} ; - - my $ret = $this->__get_private()->{proto}->GetJavaMember($key, [$proto], [undef]) ; - Inline::Java::debug(3, "returning member (" . ($ret || '') . ")") ; - - return $ret ; - } - else{ - my $name = $this->__get_private()->{class} ; - croak "No public member variable '$key' defined for class '$name'" ; - } -} - - -sub __set_member { - my $this = shift ; - my $key = shift ; - my $value = shift ; - - if ($this->__get_private()->{class} eq "Inline::Java::Object"){ - croak "Can't set member '$key' for an object that is not bound to Perl" ; - } - - my $inline = $this->__get_private()->{inline} ; - my $fields = $inline->get_fields($this->__get_private()->{class}) ; - - my $types = $fields->{$key} ; - if ($types){ - # We take the last one, which is more specific. Eventually - # we should use a scoring method just like for the methods - my $sign = undef ; - foreach my $s (values %{$types}){ - if ((! defined($sign))||($s->{IDX} > $sign->{IDX})){ - $sign = $s ; - } - } - - my $proto = $sign->{TYPE} ; - my $new_args = undef ; - my $score = undef ; - - ($new_args, $score) = Inline::Java::Class::CastArguments([$value], [$proto], $this->__get_private()->{inline}) ; - $this->__get_private()->{proto}->SetJavaMember($key, [$proto], $new_args) ; - } - else{ - my $name = $this->__get_private()->{class} ; - croak "No public member variable '$key' defined for class '$name'" ; - } -} - - -sub AUTOLOAD { - my $this = shift ; - my @args = @_ ; - - use vars qw($AUTOLOAD) ; - my $func_name = $AUTOLOAD ; - # Strip package from $func_name, Java will take of finding the correct - # method. - $func_name =~ s/^(.*)::// ; - - Inline::Java::debug(5, "$func_name") ; - - my $name = (ref($this) ? $this->__get_private()->{class} : $this) ; - if ($name eq "Inline::Java::Object"){ - croak "Can't call method '$func_name' on an object ($name) that is not bound to Perl" ; - } - - croak "No public method '$func_name' defined for class '$name'" ; -} - - -sub DESTROY { - my $this = shift ; - - my $knot = tied %{$this} ; - if (! $knot){ - Inline::Java::debug(4, "destroying Inline::Java::Object::Tie") ; - - if (! Inline::Java::get_DONE()){ - - my $class = $this->__get_private()->{class} ; - Inline::Java::debug(2, "destroying object in java ($class):") ; - - { - local $@ ; - eval { - $this->__get_private()->{proto}->DeleteJavaObject($this) ; - } ; - if ($@){ - # We croaked here. Was there already a pending $@? - my $name = $this->__get_private()->{class} ; - croak "In method DESTROY of class $name: $@" ; - } - } - - # Here we have a circular reference so we need to break it - # so that the memory is collected. - my $priv = $this->__get_private() ; - my $proto = $priv->{proto} ; - $priv->{proto} = undef ; - $proto->{obj_priv} = undef ; - delete $PRIVATES->{$this} ; - } - else{ - Inline::Java::debug(4, "script marked as DONE, object destruction not propagated to Java") ; - } - } - else{ - Inline::Java::debug(4, "destroying Inline::Java::Object") ; - } -} - - - -######################## Hash Methods ######################## -package Inline::Java::Object::Tie ; -@Inline::Java::Object::Tie::ISA = qw(Tie::StdHash) ; - - -use Tie::Hash ; -use Carp ; - - -sub TIEHASH { - my $class = shift ; - - return $class->SUPER::TIEHASH(@_) ; -} - - -sub STORE { - my $this = shift ; - my $key = shift ; - my $value = shift ; - - return $this->__set_member($key, $value) ; -} - - -sub FETCH { - my $this = shift ; - my $key = shift ; - - return $this->__get_member($key) ; -} - - -sub FIRSTKEY { - my $this = shift ; - - return $this->SUPER::FIRSTKEY() ; -} - - -sub NEXTKEY { - my $this = shift ; - - return $this->SUPER::NEXTKEY() ; -} - - -sub EXISTS { - my $this = shift ; - my $key = shift ; - - my $inline = $this->__get_private()->{inline} ; - my $fields = $inline->get_fields($this->__get_private()->{class}) ; - - if ($fields->{$key}){ - return 1 ; - } - - return 0 ; -} - - -sub DELETE { - my $this = shift ; - my $key = shift ; - - croak "Operation DELETE not supported on Java object" ; -} - - -sub CLEAR { - my $this = shift ; - - croak "Operation CLEAR not supported on Java object" ; -} - - -sub DESTROY { - my $this = shift ; -} - - - - -######################## Static Member Methods ######################## -package Inline::Java::Object::StaticMember ; -@Inline::Java::Object::StaticMember::ISA = qw(Tie::StdScalar) ; - - -use Tie::Scalar ; -use Carp ; - -my $DUMMIES = {} ; - - -sub TIESCALAR { - my $class = shift ; - my $dummy = shift ; - my $name = shift ; - - my $this = $class->SUPER::TIESCALAR(@_) ; - - $DUMMIES->{$this} = [$dummy, $name] ; - - return $this ; -} - - -sub STORE { - my $this = shift ; - my $value = shift ; - - my ($obj, $key) = @{$DUMMIES->{$this}} ; - - return $obj->__set_member($key, $value) ; -} - - -sub FETCH { - my $this = shift ; - - my ($obj, $key) = @{$DUMMIES->{$this}} ; - - return $obj->__get_member($key) ; -} - - -sub DESTROY { - my $this = shift ; -} - - - -######################## Private Object ######################## -package Inline::Java::Object::Private ; - -sub new { - my $class = shift ; - my $obj_class = shift ; - my $java_class = shift ; - my $inline = shift ; - - my $this = {} ; - $this->{class} = $obj_class ; - $this->{java_class} = $java_class ; - $this->{inline} = $inline ; - $this->{proto} = new Inline::Java::Protocol($this, $inline) ; - - bless($this, $class) ; - - return $this ; -} - - -sub DESTROY { - my $this = shift ; - - Inline::Java::debug(4, "destroying Inline::Java::Object::Private") ; -} - - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/Makefile.PL libinline-java-perl-0.66/Java/PerlInterpreter/Makefile.PL --- libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/Makefile.PL 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlInterpreter/Makefile.PL 2018-04-06 00:28:22.000000000 +0000 @@ -3,7 +3,7 @@ use Config ; use strict ; -require "../Portable.pm" ; +require "../../lib/Inline/Java/Portable.pm" ; my $ccopts = ccopts() ; diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/t/01_init.t libinline-java-perl-0.66/Java/PerlInterpreter/t/01_init.t --- libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/t/01_init.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlInterpreter/t/01_init.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -use strict ; -use Test ; - -BEGIN { - plan(tests => 1) ; - mkdir('./_Inline_test', 0777) unless -e './_Inline_test' ; -} - - -ok(1) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/t/02_perl_interpreter.t libinline-java-perl-0.66/Java/PerlInterpreter/t/02_perl_interpreter.t --- libinline-java-perl-0.58~dfsg/Java/PerlInterpreter/t/02_perl_interpreter.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlInterpreter/t/02_perl_interpreter.t 2018-04-06 00:28:22.000000000 +0000 @@ -14,10 +14,6 @@ plan(tests => 13) ; } - -use Inline Config => - DIRECTORY => './_Inline_test' ; - use Inline ( Java => 'DATA', NAME => 'Tests' @@ -125,7 +121,7 @@ pi.require("Carp") ; ok("1", "1") ; Integer sum = (Integer)pi.eval("34 + 56", Integer.class) ; - ok(sum, new Integer(90)) ; + ok(sum, Integer.valueOf(90)) ; String name = (String)pi.CallPerlSub("whats_your_name", null, String.class) ; ok(name, "perl") ; @@ -136,12 +132,12 @@ pi.StartCallbackLoop(); - ArrayList a = new ArrayList() ; + ArrayList a = new ArrayList<>() ; for (int i = 0 ; i < 100 ; i++){ - a.add(new Integer(i * 2)) ; + a.add(Integer.valueOf(i * 2)) ; } sum = (Integer)pi.CallPerlSub("sum_array_list", new Object [] {a}, Integer.class) ; - ok(sum, new Integer(9900)) ; + ok(sum, Integer.valueOf(9900)) ; pi.destroy() ; ok("1", "1") ; diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlNatives/Makefile.PL libinline-java-perl-0.66/Java/PerlNatives/Makefile.PL --- libinline-java-perl-0.58~dfsg/Java/PerlNatives/Makefile.PL 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlNatives/Makefile.PL 2018-04-06 00:28:22.000000000 +0000 @@ -1,7 +1,7 @@ use ExtUtils::MakeMaker ; use strict ; -require "../Portable.pm" ; +require "../../lib/Inline/Java/Portable.pm" ; WriteMakefile( @@ -11,6 +11,4 @@ LIBS => [join(' ', @main::L) . " -ljvm"], dynamic_lib => Inline::Java::Portable::portable("dynamic_lib"), # CCFLAGS => '-D_REENTRANT', - clean => {FILES => "_Inline_test"}, ) ; - diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlNatives/t/01_init.t libinline-java-perl-0.66/Java/PerlNatives/t/01_init.t --- libinline-java-perl-0.58~dfsg/Java/PerlNatives/t/01_init.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlNatives/t/01_init.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -use strict ; -use Test ; - -BEGIN { - plan(tests => 1) ; - mkdir('./_Inline_test', 0777) unless -e './_Inline_test' ; -} - - -ok(1) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/PerlNatives/t/02_perl_natives.t libinline-java-perl-0.66/Java/PerlNatives/t/02_perl_natives.t --- libinline-java-perl-0.58~dfsg/Java/PerlNatives/t/02_perl_natives.t 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/PerlNatives/t/02_perl_natives.t 2018-04-06 00:28:22.000000000 +0000 @@ -1,15 +1,10 @@ use strict ; use Test ; - BEGIN { plan(tests => 5) ; } - -use Inline Config => - DIRECTORY => './_Inline_test' ; - use Inline::Java qw(caught) ; use Inline ( diff -Nru libinline-java-perl-0.58~dfsg/Java/Portable.pm libinline-java-perl-0.66/Java/Portable.pm --- libinline-java-perl-0.58~dfsg/Java/Portable.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Portable.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -package Inline::Java::Portable ; -@Inline::Java::Portable::ISA = qw(Exporter) ; - - -use strict ; -use Exporter ; -use Carp ; -use Config ; -use File::Find ; -use File::Spec ; - -$Inline::Java::Portable::VERSION = '0.53_90' ; - -# Here is some code to figure out if we are running on command.com -# shell under Windows. -my $COMMAND_COM = - ( - ($^O eq 'MSWin32')&& - ( - ($ENV{PERL_INLINE_JAVA_COMMAND_COM})|| - ( - (defined($ENV{COMSPEC}))&& - ($ENV{COMSPEC} =~ /(command|4dos)\.com/i) - )|| - (`ver` =~ /win(dows )?((9[58])|(m[ei]))/i) - ) - ) || 0 ; - - -sub debug { - if (Inline::Java->can("debug")){ - return Inline::Java::debug(@_) ; - } -} - - -# Cleans the CLASSPATH environment variable and adds -# the paths specified. -sub make_classpath { - my @paths = @_ ; - - my @list = () ; - if (defined($ENV{CLASSPATH})){ - push @list, $ENV{CLASSPATH} ; - } - push @list, @paths ; - - my $sep = Inline::Java::Portable::portable("ENV_VAR_PATH_SEP_CP") ; - my @cp = split(/$sep+/, join($sep, @list)) ; - - # Clean up paths - foreach my $p (@cp){ - $p =~ s/^\s+// ; - $p =~ s/\s+$// ; - } - - # Remove duplicates, remove invalids but preserve order - my @fcp = () ; - my %cp = map {$_ => 1} @cp ; - foreach my $p (@cp){ - if ($cp{$p}){ - if ($p =~ /^(.*)\/\*$/){ - my $d = $1 ; - if (($d)&&(-d $d)){ - Inline::Java::debug(2, "keeping wildcard classpath as '$p'") ; - my $fp = File::Spec->rel2abs($d) . '/*' ; - push @fcp, Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", $fp) ; - } - } - elsif (($p)&&(-e $p)){ - my $fp = File::Spec->rel2abs($p) ; - push @fcp, Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", $fp) ; - } - else{ - Inline::Java::debug(2, "classpath candidate '$p' scraped") ; - } - delete $cp{$p} ; - } - } - - my $cp = join($sep, @fcp) ; - - return (wantarray ? @fcp : $cp) ; -} - - -sub get_jar_dir { - my $path = $INC{"Inline/Java.pm"} ; - my ($v, $d, $f) = File::Spec->splitpath($path) ; - - # This undef for the file should be ok. - my $dir = File::Spec->catpath($v, $d, 'Java', undef) ; - - return File::Spec->rel2abs($dir) ; -} - - -sub get_server_jar { - return File::Spec->catfile(get_jar_dir(), 'InlineJavaServer.jar') ; -} - - -sub get_user_jar { - return File::Spec->catfile(get_jar_dir(), 'InlineJavaUser.jar') ; -} - - -sub get_source_dir { - return File::Spec->catdir(get_jar_dir(), 'sources') ; -} - - -# This maybe could be made more stable -sub find_classes_in_dir { - my $dir = shift ; - - my @ret = () ; - find(sub { - my $f = $_ ; - if ($f =~ /\.class$/){ - my $file = $File::Find::name ; - my $fdir = $File::Find::dir ; - my @dirs = File::Spec->splitdir($fdir) ; - # Remove '.' - shift @dirs ; - # Add an empty dir to get the last '.' (for '.class') - if ((! scalar(@dirs))||($dirs[-1] ne '')){ - push @dirs, '' ; - } - my $pkg = (scalar(@dirs) ? join('.', @dirs) : '') ; - my $class = "$pkg$f" ; - $class =~ s/\.class$// ; - push @ret, {file => $file, class => $class} ; - } - }, $dir) ; - - return @ret ; -} - - - -my $map = { - _DEFAULT_ => { - EXE_EXTENSION => $Config{exe_ext}, - GOT_ALARM => $Config{d_alarm} || 0, - GOT_FORK => $Config{d_fork} || 0, - GOT_NEXT_FREE_PORT => 1, - GOT_SYMLINK => 1, - GOT_SAFE_SIGNALS => 1, - ENV_VAR_PATH_SEP => $Config{path_sep}, - SO_EXT => $Config{dlext}, - PREFIX => $Config{prefix}, - LIBPERL => $Config{libperl}, - DETACH_OK => 1, - SO_LIB_PATH_VAR => $Config{ldlibpthname}, - ENV_VAR_PATH_SEP_CP => ':', - IO_REDIR => '2>&1', - MAKE => 'make', - DEV_NULL => '/dev/null', - COMMAND_COM => 0, - SUB_FIX_JAVA_PATH => undef, - SUB_FIX_CMD_QUOTES => undef, - SUB_FIX_MAKE_QUOTES => undef, - JVM_LIB => "libjvm.$Config{dlext}", - JVM_SO => "libjvm.$Config{dlext}", - PRE_WHOLE_ARCHIVE => '-Wl,--whole-archive', - POST_WHOLE_ARCHIVE => '-Wl,--no-whole-archive', - PERL_PARSE_DUP_ENV => '-DPERL_PARSE_DUP_ENV', - BUILD_JNI_BY_DFLT => 1, - J2SDK_BIN => 'bin', - DEFAULT_J2SDK_DIR => undef, - OTHERLDFLAGS => '', - dynamic_lib => {} - }, - MSWin32 => { - ENV_VAR_PATH_SEP_CP => ';', - # 2>&1 doesn't work under command.com - IO_REDIR => ($COMMAND_COM ? '' : undef), - MAKE => 'nmake', - DEV_NULL => 'nul', - COMMAND_COM => $COMMAND_COM, - SUB_FIX_MAKE_QUOTES => sub { - my $arg = shift ; - $arg = qq{"$arg"} ; - return $arg ; - }, - SO_LIB_PATH_VAR => 'PATH', - DETACH_OK => 0, - JVM_LIB => 'jvm.lib', - JVM_SO => 'jvm.dll', - GOT_NEXT_FREE_PORT => 0, - GOT_SYMLINK => 0, - GOT_SAFE_SIGNALS => 0, - PRE_WHOLE_ARCHIVE => '', - POST_WHOLE_ARCHIVE => '', - }, - cygwin => { - ENV_VAR_PATH_SEP_CP => ';', - SUB_FIX_JAVA_PATH => sub { - my $arg = shift ; - if (defined($arg)&&($arg)){ - $arg = `cygpath -w \"$arg\"` ; - chomp($arg) ; - } - return $arg ; - }, - JVM_LIB => 'jvm.lib', - JVM_SO => 'jvm.dll', - BUILD_JNI_BY_DFLT => 1, - dynamic_lib => { OTHERLDFLAGS => '-Wl,-add-stdcall-alias' }, - }, - hpux => { - GOT_NEXT_FREE_PORT => 0, - }, - solaris => { - GOT_NEXT_FREE_PORT => 0, - PRE_WHOLE_ARCHIVE => '-Wl,-zallextract', - POST_WHOLE_ARCHIVE => '-Wl,-zdefaultextract', - }, - aix => { - JVM_LIB => "libjvm$Config{lib_ext}", - JVM_SO => "libjvm$Config{lib_ext}", - }, - darwin => { - # Suggested by Ken Williams, mailing list 2004/07/07 - SO_EXT => $Config{so}, - # Andrew Bruno - JVM_LIB => "libjvm.dylib", - JVM_SO => "libjvm.dylib", - PRE_WHOLE_ARCHIVE => '-Wl', - POST_WHOLE_ARCHIVE => '-Wl', - GOT_SYMLINK => 1, - J2SDK_BIN => 'Commands', - DEFAULT_J2SDK_DIR => '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK', - # Tim Bunce: - OTHERLDFLAGS => '-framework JavaVM', - }, -} ; - -sub portable { - my $key = shift ; - my $arg = shift ; - - if (! exists($map->{_DEFAULT_}->{$key})){ - croak "Portability issue $key not defined!" ; - } - - my $val = undef ; - if ((defined($map->{$^O}))&&(defined($map->{$^O}->{$key}))){ - $val = $map->{$^O}->{$key} ; - } - else { - $val = $map->{_DEFAULT_}->{$key} ; - } - - if ($key =~ /^SUB_/){ - my $sub = $val ; - if (defined($sub)){ - $arg = $sub->($arg) ; - Inline::Java::Portable::debug(4, "portable: $key => $arg for $^O is '$arg'") ; - return $arg ; - } - else { - Inline::Java::Portable::debug(4, "portable: $key => $arg for $^O is default '$arg'") ; - return $arg ; - } - } - else { - Inline::Java::Portable::debug(4, "portable: $key for $^O is '$val'") ; - return $val ; - } -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Protocol.pm libinline-java-perl-0.66/Java/Protocol.pm --- libinline-java-perl-0.58~dfsg/Java/Protocol.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Protocol.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,612 +0,0 @@ -package Inline::Java::Protocol ; - -use strict ; -use Inline::Java::Object ; -use Inline::Java::Array ; -use Carp ; -use MIME::Base64 ; -BEGIN { - eval "require Encode" ; -} - - -$Inline::Java::Protocol::VERSION = '0.53_90' ; - -my %CLASSPATH_ENTRIES = () ; - - -sub new { - my $class = shift ; - my $obj = shift ; - my $inline = shift ; - - my $this = {} ; - $this->{obj_priv} = $obj || {} ; - $this->{inline} = $inline ; - - bless($this, $class) ; - return $this ; -} - - -sub AddClassPath { - my $this = shift ; - my @paths = @_ ; - - @paths = map { - my $e = $_ ; - if ($CLASSPATH_ENTRIES{$e}){ - () ; - } - else{ - Inline::Java::debug(2, "adding to classpath: '$e'") ; - $CLASSPATH_ENTRIES{$e} = 1 ; - $e ; - } - } @paths ; - - my $data = "add_classpath " . join(" ", map {encode($_)} @paths) ; - - return $this->Send($data) ; -} - - -sub ServerType { - my $this = shift ; - - Inline::Java::debug(3, "getting server type") ; - - my $data = "server_type" ; - - return $this->Send($data) ; -} - - -# Known issue: $classes must contain at least one class name. -sub Report { - my $this = shift ; - my $classes = shift ; - - Inline::Java::debug(3, "reporting on $classes") ; - - my $data = join(" ", - "report", - $this->ValidateArgs([$classes]), - ) ; - - return $this->Send($data) ; -} - - -sub ISA { - my $this = shift ; - my $proto = shift ; - - my $class = $this->{obj_priv}->{java_class} ; - - return $this->__ISA($proto, $class) ; -} - - -sub __ISA { - my $this = shift ; - my $proto = shift ; - my $class = shift ; - - Inline::Java::debug(3, "checking if $class is a $proto") ; - - my $data = join(" ", - "isa", - Inline::Java::Class::ValidateClass($class), - Inline::Java::Class::ValidateClass($proto), - ) ; - - return $this->Send($data) ; -} - - -sub ObjectCount { - my $this = shift ; - - Inline::Java::debug(3, "getting object count") ; - - my $data = join(" ", - "obj_cnt", - ) ; - - return $this->Send($data) ; -} - - -# Called to create a Java object -sub CreateJavaObject { - my $this = shift ; - my $class = shift ; - my $proto = shift ; - my $args = shift ; - - Inline::Java::debug(3, "creating object new $class" . $this->CreateSignature($args)) ; - - my $data = join(" ", - "create_object", - Inline::Java::Class::ValidateClass($class), - $this->CreateSignature($proto, ","), - $this->ValidateArgs($args), - ) ; - - return $this->Send($data, 1) ; -} - - -# Calls a Java method. -sub CallJavaMethod { - my $this = shift ; - my $method = shift ; - my $proto = shift ; - my $args = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug(3, "calling object($id).$method" . $this->CreateSignature($args)) ; - - my $data = join(" ", - "call_method", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMethod($method), - $this->CreateSignature($proto, ","), - $this->ValidateArgs($args), - ) ; - - return $this->Send($data) ; -} - - -# Casts a Java object. -sub Cast { - my $this = shift ; - my $class = shift ; - - my $id = $this->{obj_priv}->{id} ; - Inline::Java::debug(3, "creating a new reference to object($id) with type $class") ; - - my $data = join(" ", - "cast", - $id, - Inline::Java::Class::ValidateClass($class), - ) ; - - return $this->Send($data) ; -} - - -# Sets a member variable. -sub SetJavaMember { - my $this = shift ; - my $member = shift ; - my $proto = shift ; - my $arg = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug(3, "setting object($id)->{$member} = " . ($arg->[0] || '')) ; - my $data = join(" ", - "set_member", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMember($member), - Inline::Java::Class::ValidateClass($proto->[0]), - $this->ValidateArgs($arg), - ) ; - - return $this->Send($data) ; -} - - -# Gets a member variable. -sub GetJavaMember { - my $this = shift ; - my $member = shift ; - my $proto = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug(3, "getting object($id)->{$member}") ; - - my $data = join(" ", - "get_member", - $id, - Inline::Java::Class::ValidateClass($class), - $this->ValidateMember($member), - Inline::Java::Class::ValidateClass($proto->[0]), - "undef:", - ) ; - - return $this->Send($data) ; -} - - -sub ReadFromJavaHandle { - my $this = shift ; - my $len = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug(3, "reading from handle object($id)") ; - - my $data = join(" ", - "read", - $id, - $len, - ) ; - - return $this->Send($data) ; -} - - -sub MakeJavaHandleBuffered { - my $this = shift ; - - my $id = $this->{obj_priv}->{id} ; - Inline::Java::debug(3, "making handle object($id) buffered") ; - - my $data = join(" ", - "make_buffered", - $id, - ) ; - - return $this->Send($data) ; -} - - -sub ReadLineFromJavaHandle { - my $this = shift ; - - my $id = undef ; - if (! defined($this->{obj_priv}->{buffered})){ - my $nid = $this->MakeJavaHandleBuffered() ; - $this->{obj_priv}->{buffered} = Inline::Java::Object->__new('', $this->{inline}, $nid) ; - } - $id = $this->{obj_priv}->{buffered}->__get_private()->{id} ; - Inline::Java::debug(3, "reading line from handle object($id)") ; - - my $data = join(" ", - "readline", - $id, - ) ; - - return $this->Send($data) ; -} - - -sub WriteToJavaHandle { - my $this = shift ; - my $str = shift ; - - my $id = $this->{obj_priv}->{id} ; - Inline::Java::debug(3, "writing to handle object($id)") ; - - my $data = join(" ", - "write", - $id, - $this->ValidateArgs([$str]), - ) ; - - return $this->Send($data) ; -} - - -sub CloseJavaHandle { - my $this = shift ; - - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - Inline::Java::debug(3, "closing handle object($id)") ; - - my $data = join(" ", - "close", - $id, - ) ; - - return $this->Send($data) ; -} - - -# Deletes a Java object -sub DeleteJavaObject { - my $this = shift ; - my $obj = shift ; - - if (defined($this->{obj_priv}->{id})){ - my $id = $this->{obj_priv}->{id} ; - my $class = $this->{obj_priv}->{java_class} ; - - Inline::Java::debug(3, "deleting object $obj $id ($class)") ; - - my $data = join(" ", - "delete_object", - $id, - ) ; - - $this->Send($data) ; - } -} - - -# This method makes sure that the method we are asking for -# has the correct form for a Java method. -sub ValidateMethod { - my $this = shift ; - my $method = shift ; - - if ($method !~ /^(\w+)$/){ - croak "Invalid Java method name $method" ; - } - - return $method ; -} - - -# This method makes sure that the member we are asking for -# has the correct form for a Java member. -sub ValidateMember { - my $this = shift ; - my $member = shift ; - - if ($member !~ /^(\w+)$/){ - croak "Invalid Java member name $member" ; - } - - return $member ; -} - - -# Validates the arguments to be used in a method call. -sub ValidateArgs { - my $this = shift ; - my $args = shift ; - my $callback = shift ; - - my @ret = () ; - foreach my $arg (@{$args}){ - if (! defined($arg)){ - push @ret, "undef:" ; - } - elsif (ref($arg)){ - if ((UNIVERSAL::isa($arg, "Inline::Java::Object"))||(UNIVERSAL::isa($arg, "Inline::Java::Array"))){ - my $obj = $arg ; - if (UNIVERSAL::isa($arg, "Inline::Java::Array")){ - $obj = $arg->__get_object() ; - } - my $class = $obj->__get_private()->{java_class} ; - my $id = $obj->__get_private()->{id} ; - push @ret, "java_object:$class:$id" ; - } - elsif (UNIVERSAL::isa($arg, 'Inline::Java::double')){ - push @ret, "double:" . encode(${$arg}) ; - } - elsif ($arg =~ /^(.*?)=/){ - my $id = Inline::Java::Callback::PutObject($arg) ; - # Bug. The delimiter is :, so we need to escape the package separator (::) - my $pkg = $1 ; - $pkg =~ s/:/\//g ; - push @ret, "perl_object:$pkg:$id" ; - } - else { - if (! $callback){ - croak "A Java method or member can only have Java objects, Java arrays, Perl objects or scalars as arguments" ; - } - else{ - croak "A Java callback function can only return Java objects, Java arrays, Perl objects or scalars" ; - } - } - } - else { - push @ret, "scalar:" . encode($arg) ; - } - } - - return @ret ; -} - - -sub CreateSignature { - my $this = shift ; - my $proto = shift ; - my $del = shift || ", " ; - - no warnings ; - my $sig = join($del, @{$proto}) ; - return "($sig)" ; -} - - -# This actually sends the request to the Java program. It also takes -# care of registering the returned object (if any) -sub Send { - my $this = shift ; - my $data = shift ; - my $const = shift ; - - my $resp = Inline::Java::__get_JVM()->process_command($this->{inline}, $data) ; - if ($resp =~ /^error scalar:([\w+\/=+]*)$/){ - my $msg = decode($1) ; - Inline::Java::debug(3, "packet recv error: $msg") ; - croak $msg ; - } - elsif ($resp =~ s/^ok //){ - return $this->DeserializeObject($const, $resp) ; - } - - croak "Malformed response from server: $resp" ; -} - - -sub DeserializeObject { - my $this = shift ; - my $const = shift ; - my $resp = shift ; - - if ($resp =~ /^scalar:([\w+\/=+]*)$/){ - return decode($1) ; - } - elsif ($resp =~ /^double:(.*)$/){ - my $bytes = decode($1) ; - my $d = unpack('d', $bytes) ; - return $d ; - } - elsif ($resp =~ /^undef:$/){ - return undef ; - } - elsif ($resp =~ /^java_(object|array|handle):([01]):(\d+):(.*)$/){ - # Create the Perl object wrapper and return it. - my $type = $1 ; - my $thrown = $2 ; - my $id = $3 ; - my $class = $4 ; - - if ($thrown){ - # If we receive a thrown object, we jump out of 'constructor - # mode' and process the returned object. - $const = 0 ; - } - - if ($const){ - $this->{obj_priv}->{java_class} = $class ; - $this->{obj_priv}->{id} = $id ; - - return undef ; - } - else { - my $pkg = $this->{inline}->get_api('pkg') ; - - my $obj = undef ; - my $elem_class = $class ; - - Inline::Java::debug(3, "checking if stub is array...") ; - if ($type eq 'array'){ - my @d = Inline::Java::Class::ValidateClassSplit($class) ; - $elem_class = $d[2] ; - } - - my $perl_class = "Inline::Java::Object" ; - if ($elem_class){ - # We have a real class or an array of real classes - $perl_class = Inline::Java::java2perl($pkg, $elem_class) ; - if (Inline::Java::Class::ClassIsReference($elem_class)){ - if (! Inline::Java::known_to_perl($pkg, $elem_class)){ - if (($thrown)||($this->{inline}->get_java_config('AUTOSTUDY'))){ - Inline::Java::debug(2, "autostudying $elem_class...") ; - $this->{inline}->_study([$elem_class]) ; - } - else{ - # Object is not known to Perl, it lives as a - # Inline::Java::Object - $perl_class = "Inline::Java::Object" ; - } - } - } - } - else{ - # We should only get here if an array of primitives types - # was returned, and there is nothing to do since - # the block below will handle it. - } - - if ($type eq 'array'){ - Inline::Java::debug(3, "creating array object...") ; - $obj = Inline::Java::Object->__new($class, $this->{inline}, $id) ; - $obj = new Inline::Java::Array($obj) ; - Inline::Java::debug(3, "array object created...") ; - } - # To be finished at a later time... - # elsif ($type eq 'handle'){ - # Inline::Java::debug(3, "creating handle object...") ; - # $obj = Inline::Java::Object->__new($class, $this->{inline}, $id) ; - # $obj = new Inline::Java::Handle($obj) ; - # Inline::Java::debug(3, "handle object created...") ; - # } - else{ - $obj = $perl_class->__new($class, $this->{inline}, $id) ; - } - - if ($thrown){ - Inline::Java::debug(3, "throwing stub...") ; - my ($msg, $score) = $obj->__isa('org.perl.inline.java.InlineJavaPerlException') ; - if ($msg){ - die $obj ; - } - else{ - die $obj->GetObject() ; - } - } - else{ - Inline::Java::debug(3, "returning stub...") ; - return $obj ; - } - } - } - elsif ($resp =~ /^perl_object:(\d+):(.*)$/){ - my $id = $1 ; - my $pkg = $2 ; - - return Inline::Java::Callback::GetObject($id) ; - } - else{ - croak "Malformed response from server: $resp" ; - } -} - - -sub encode { - my $s = shift ; - - # Get UTF-8 byte representation of the data. - my $bytes = undef ; - if ($INC{'Encode.pm'}){ - $bytes = Encode::encode_utf8($s) ; - } - else { - $bytes = $s ; - $bytes =~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg ; - } - - # Base-64 encode it. - my $base64 = encode_base64($bytes, '') ; - - return $base64 ; -} - - -sub decode { - my $s = shift ; - - # Decode the Base-64 data into bytes (UTF-8 representation of the data). - my $bytes = decode_base64($s) ; - - # Take the UTF-8 encoding and convert it back to logical characters. - my $string = undef ; - if ($INC{'Encode.pm'}){ - $string = Encode::decode_utf8($bytes) ; - } - else { - $string = $bytes ; - $string =~ s/([\xC2\xC3])([\x80-\xBF])/chr(ord($1)<<6&0xC0|ord($2)&0x3F)/eg ; - } - - if (utf8->can('downgrade')){ - utf8::downgrade($string, 1) ; - } - - return $string ; -} - - -sub DESTROY { - my $this = shift ; - - Inline::Java::debug(4, "destroying Inline::Java::Protocol") ; -} - - -1 ; diff -Nru libinline-java-perl-0.58~dfsg/Java/Server.pm libinline-java-perl-0.66/Java/Server.pm --- libinline-java-perl-0.58~dfsg/Java/Server.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/Server.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -package Inline::Java::Server ; -@Inline::Java::Server::ISA = qw(Exporter) ; - -# Export the cast function if wanted -@EXPORT_OK = qw(start stop status) ; - - -use strict ; -use Exporter ; -use Carp ; -require Inline ; -require Inline::Java ; -use File::Spec ; - - -$Inline::Java::Server::VERSION = '0.53_90' ; - - -# Create a dummy Inline::Java object in order to -# get the default options. -my $IJ = bless({}, "Inline::Java") ; -$IJ->validate( - SHARED_JVM => 1 -) ; - - - -sub import { - my $class = shift ; - my $a = shift ; - - my @actions = () ; - if ($a eq 'restart'){ - push @actions, 'stop', 'sleep', 'start' ; - } - else{ - push @actions, $a ; - } - - my $host = $IJ->get_java_config("HOST") ; - my $bind = $IJ->get_java_config("BIND") ; - my $port = $IJ->get_java_config("PORT") ; - foreach $a (@actions){ - if ($a eq 'sleep'){ - sleep(5) ; - next ; - } - - my $status = Inline::Java::Server::status() ; - - if ($a eq 'start'){ - if ($status){ - print "SHARED_JVM server on port $bind:$port is already running\n" ; - } - else{ - Inline::Java::Server::start() ; - my $pid = Inline::Java::__get_JVM()->{pid} ; - print "SHARED_JVM server on port $bind:$port started with pid $pid\n" ; - } - } - elsif ($a eq 'stop'){ - if (! $status){ - print "SHARED_JVM server on port $host:$port is not running\n" ; - } - else { - Inline::Java::Server::stop() ; - print "SHARED_JVM server on port $host:$port stopped\n" ; - } - } - elsif ($a eq 'status'){ - if ($status){ - print "SHARED_JVM on port $host:$port is running\n" ; - } - else { - print "SHARED_JVM on port $host:$port is not running\n" ; - } - } - else{ - croak("Usage: perl -MInline::Java::Server=(start|stop|restart|status)\n") ; - } - } - - exit() ; -} - - - -sub status { - my $socket = undef ; - - eval { - $socket = Inline::Java::JVM::setup_socket( - $IJ->get_java_config("HOST"), - $IJ->get_java_config("PORT"), - 0, - 1 - ) ; - } ; - if ($@){ - return 0 ; - } - else { - close($socket) ; - return 1 ; - } -} - - -sub start { - my $dir = $ENV{PERL_INLINE_JAVA_DIRECTORY} ; - - Inline->bind( - Java => 'STUDY', - SHARED_JVM => 1, - ($dir ? (DIRECTORY => $dir) : ()), - ) ; -} - - -sub stop { - # This will connect us to the running JVM - Inline::Java::Server::start() ; - Inline::Java::capture_JVM() ; - Inline::Java::shutdown_JVM() ; -} - - - -1 ; - diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaArray.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaArray.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaArray.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaArray.java 2018-04-06 00:28:22.000000000 +0000 @@ -19,7 +19,7 @@ sb.replace(sb.length() - 1, sb.length(), "") ; StringTokenizer st2 = new StringTokenizer(sb.toString(), ",") ; - ArrayList al = new ArrayList() ; + ArrayList al = new ArrayList<>() ; while (st2.hasMoreTokens()){ al.add(al.size(), st2.nextToken()) ; } @@ -35,7 +35,7 @@ try { array = Array.newInstance(c, dims) ; - ArrayList args = new ArrayList() ; + ArrayList args = new ArrayList<>() ; while (st.hasMoreTokens()){ args.add(args.size(), st.nextToken()) ; } @@ -66,7 +66,7 @@ for (int i = 0 ; i < nb_sub_dims ; i++){ // We want the args from i*nb_args_per_sub_dim -> - ArrayList sub_args = new ArrayList() ; + ArrayList sub_args = new ArrayList<>() ; for (int j = (i * nb_args_per_sub_dim) ; j < ((i + 1) * nb_args_per_sub_dim) ; j++){ sub_args.add(sub_args.size(), (String)args.get(j)) ; } diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaCallback.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaCallback.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaCallback.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaCallback.java 2018-04-06 00:28:22.000000000 +0000 @@ -128,7 +128,7 @@ StringTokenizer st = new StringTokenizer(resp, " ") ; String c = st.nextToken() ; if (c.equals("callback")){ - boolean thrown = new Boolean(st.nextToken()).booleanValue() ; + boolean thrown = Boolean.parseBoolean(st.nextToken()) ; String arg = st.nextToken() ; InlineJavaClass ijc = new InlineJavaClass(ijs, ijp) ; ret = ijc.CastArgument(cast, arg) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaCallbackQueue.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaCallbackQueue.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaCallbackQueue.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaCallbackQueue.java 2018-04-06 00:28:22.000000000 +0000 @@ -9,7 +9,7 @@ */ class InlineJavaCallbackQueue { // private InlineJavaServer ijs = InlineJavaServer.GetInstance() ; - private ArrayList queue = new ArrayList() ; + private ArrayList queue = new ArrayList<>() ; private boolean wait_interrupted = false ; private boolean stream_opened = false ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaClass.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaClass.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaClass.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaClass.java 2018-04-06 00:28:22.000000000 +0000 @@ -8,7 +8,7 @@ private InlineJavaServer ijs ; private InlineJavaProtocol ijp ; - static private HashMap class2jni_code = new HashMap() ; + static private HashMap class2jni_code = new HashMap<>() ; static { class2jni_code.put(byte.class, "B") ; class2jni_code.put(short.class, "S") ; @@ -21,7 +21,7 @@ class2jni_code.put(void.class, "V") ; } ; - static private HashMap class2wrapper = new HashMap() ; + static private HashMap class2wrapper = new HashMap<>() ; static { class2wrapper.put(byte.class, java.lang.Byte.class) ; class2wrapper.put(short.class, java.lang.Short.class) ; @@ -34,7 +34,7 @@ class2wrapper.put(void.class, java.lang.Void.class) ; } ; - static private HashMap name2class = new HashMap() ; + static private HashMap name2class = new HashMap<>() ; static { name2class.put("byte", byte.class) ; name2class.put("short", short.class) ; @@ -130,7 +130,7 @@ Object CastArgument(Class p, String argument) throws InlineJavaException { Object ret = null ; - ArrayList tokens = new ArrayList() ; + ArrayList tokens = new ArrayList<>() ; StringTokenizer st = new StringTokenizer(argument, ":") ; for (int j = 0 ; st.hasMoreTokens() ; j++){ tokens.add(j, st.nextToken()) ; @@ -186,7 +186,7 @@ l += (((long)c[i]) << (8 * i)) ; } double d = Double.longBitsToDouble(l) ; - ret = new Double(d) ; + ret = Double.valueOf(d) ; } else { throw new InlineJavaCastException("Can't convert reference to " + p.getName()) ; @@ -195,7 +195,7 @@ else if (ClassIsBool(p)){ if (type.equals("undef")){ InlineJavaUtils.debug(4, "args is undef -> forcing to bool false") ; - ret = new Boolean("false") ; + ret = Boolean.FALSE; InlineJavaUtils.debug(4, " result is " + ret.toString()) ; } else if (type.equals("scalar")){ @@ -207,7 +207,7 @@ else{ arg = "true" ; } - ret = new Boolean(arg) ; + ret = Boolean.valueOf(arg) ; InlineJavaUtils.debug(4, " result is " + ret.toString()) ; } else{ @@ -217,7 +217,7 @@ else if (ClassIsChar(p)){ if (type.equals("undef")){ InlineJavaUtils.debug(4, "args is undef -> forcing to char '\0'") ; - ret = new Character('\0') ; + ret = Character.valueOf('\0') ; InlineJavaUtils.debug(4, " result is " + ret.toString()) ; } else if (type.equals("scalar")){ @@ -230,7 +230,7 @@ else if (arg.length() > 1){ throw new InlineJavaCastException("Can't convert " + arg + " to " + p.getName()) ; } - ret = new Character(c) ; + ret = Character.valueOf(c) ; InlineJavaUtils.debug(4, " result is " + ret.toString()) ; } else{ @@ -388,7 +388,7 @@ /* Determines if class is of numerical type. */ - static private HashMap numeric_classes = new HashMap() ; + static private HashMap numeric_classes = new HashMap<>() ; static { Class [] list = { java.lang.Byte.class, @@ -406,7 +406,7 @@ double.class, } ; for (int i = 0 ; i < list.length ; i++){ - numeric_classes.put(list[i], new Boolean(true)) ; + numeric_classes.put(list[i], Boolean.TRUE) ; } } static boolean ClassIsNumeric (Class p){ @@ -414,14 +414,14 @@ } - static private HashMap double_classes = new HashMap() ; + static private HashMap double_classes = new HashMap<>(); static { Class [] list = { java.lang.Double.class, double.class, } ; for (int i = 0 ; i < list.length ; i++){ - double_classes.put(list[i], new Boolean(true)) ; + double_classes.put(list[i], Boolean.TRUE) ; } } static boolean ClassIsDouble (Class p){ @@ -432,7 +432,7 @@ /* Class is String or StringBuffer */ - static private HashMap string_classes = new HashMap() ; + static private HashMap string_classes = new HashMap<>(); static { Class csq = ValidateClassQuiet("java.lang.CharSequence") ; Class [] list = { @@ -441,7 +441,7 @@ csq } ; for (int i = 0 ; i < list.length ; i++){ - string_classes.put(list[i], new Boolean(true)) ; + string_classes.put(list[i], Boolean.TRUE) ; } } static boolean ClassIsString (Class p){ @@ -452,14 +452,14 @@ /* Class is Char */ - static private HashMap char_classes = new HashMap() ; + static private HashMap char_classes = new HashMap<>() ; static { Class [] list = { java.lang.Character.class, char.class, } ; for (int i = 0 ; i < list.length ; i++){ - char_classes.put(list[i], new Boolean(true)) ; + char_classes.put(list[i], Boolean.TRUE) ; } } static boolean ClassIsChar (Class p){ @@ -470,14 +470,14 @@ /* Class is Bool */ - static private HashMap bool_classes = new HashMap() ; + static private HashMap bool_classes = new HashMap<>() ; static { Class [] list = { java.lang.Boolean.class, boolean.class, } ; for (int i = 0 ; i < list.length ; i++){ - bool_classes.put(list[i], new Boolean(true)) ; + bool_classes.put(list[i], Boolean.TRUE) ; } } static boolean ClassIsBool (Class p){ @@ -505,7 +505,7 @@ static boolean ClassIsArray (Class p){ String name = p.getName() ; - if ((ClassIsReference(p))&&(name.startsWith("["))){ + if ((name.startsWith("["))&&(ClassIsReference(p))){ InlineJavaUtils.debug(4, "class " + name + " is array") ; return true ; } diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlCaller.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlCaller.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlCaller.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlCaller.java 2018-04-06 00:28:22.000000000 +0000 @@ -10,7 +10,7 @@ public class InlineJavaPerlCaller { private InlineJavaServer ijs = InlineJavaServer.GetInstance() ; private Thread creator = null ; - static private Map thread_callback_queues = Collections.synchronizedMap(new HashMap()) ; + static private Map thread_callback_queues = Collections.synchronizedMap(new HashMap()) ; static private ResourceBundle resources = null ; static private boolean inited = false ; @@ -49,26 +49,6 @@ return resources ; } - /* Old interface */ - /** - * @deprecated As of 0.48, replaced by {@link #CallPerlSub(String,Object[])} - */ - public Object CallPerl(String pkg, String method, Object args[]) throws InlineJavaException, InlineJavaPerlException { - return CallPerl(pkg, method, args, null) ; - } - - - /* Old interface */ - /** - * @deprecated As of 0.48, replaced by {@link #CallPerlSub(String,Object[],Class)} - */ - public Object CallPerl(String pkg, String method, Object args[], String cast) throws InlineJavaException, InlineJavaPerlException { - InlineJavaCallback ijc = new InlineJavaCallback( - (String)null, pkg + "::" + method, args, - (cast == null ? null : InlineJavaClass.ValidateClass(cast))) ; - return CallPerl(ijc) ; - } - /* New interface */ public Object CallPerlSub(String sub, Object args[]) throws InlineJavaException, InlineJavaPerlException { @@ -128,12 +108,12 @@ public Object require_file(String file) throws InlineJavaPerlException, InlineJavaException { - return CallPerlSub("Inline::Java::Callback::java_require", new Object [] {file, new Boolean("true")}) ; + return CallPerlSub("Inline::Java::Callback::java_require", new Object [] {file, Boolean.TRUE}) ; } public Object require_module(String module) throws InlineJavaPerlException, InlineJavaException { - return CallPerlSub("Inline::Java::Callback::java_require", new Object [] {module, new Boolean("false")}) ; + return CallPerlSub("Inline::Java::Callback::java_require", new Object [] {module, Boolean.FALSE}) ; } diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlNatives.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlNatives.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlNatives.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlNatives.java 2018-04-06 00:28:22.000000000 +0000 @@ -7,8 +7,8 @@ public class InlineJavaPerlNatives extends InlineJavaPerlCaller { static private boolean inited = false ; - static private Map registered_classes = Collections.synchronizedMap(new HashMap()) ; - static private Map registered_methods = Collections.synchronizedMap(new HashMap()) ; + static private Map registered_classes = Collections.synchronizedMap(new HashMap()) ; + static private Map registered_methods = Collections.synchronizedMap(new HashMap()) ; protected InlineJavaPerlNatives() throws InlineJavaException { diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlObject.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlObject.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaPerlObject.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaPerlObject.java 2018-04-06 00:28:22.000000000 +0000 @@ -57,11 +57,12 @@ protected void Dispose(boolean gc) throws InlineJavaPerlException, InlineJavaException { if (id != 0){ - CallPerlSub("Inline::Java::Callback::java_finalize", new Object [] {new Integer(id), new Boolean(gc)}) ; + CallPerlSub("Inline::Java::Callback::java_finalize", new Object [] {Integer.valueOf(id), Boolean.valueOf(gc)}) ; } } - + /* unavoidable due to Perl reference-count behaviour */ + @SuppressWarnings("deprecation") protected void finalize() throws Throwable { try { Dispose(true) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaProtocol.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaProtocol.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaProtocol.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaProtocol.java 2018-04-06 00:28:22.000000000 +0000 @@ -18,7 +18,7 @@ private final String encoding = "UTF-8" ; - static private Map member_cache = Collections.synchronizedMap(new HashMap()) ; + static private Map member_cache = Collections.synchronizedMap(new HashMap()) ; static private final String report_version = "V2" ; InlineJavaProtocol(InlineJavaServer _ijs, String _cmd) { @@ -106,7 +106,7 @@ StringTokenizer st3 = new StringTokenizer(Decode(st2.nextToken()), " ") ; - ArrayList class_list = new ArrayList() ; + ArrayList class_list = new ArrayList<>() ; while (st3.hasMoreTokens()){ String c = st3.nextToken() ; class_list.add(class_list.size(), c) ; @@ -192,12 +192,12 @@ String is_it_a = st.nextToken() ; Class d = ijc.ValidateClass(is_it_a) ; - SetResponse(new Integer(ijc.DoesExtend(c, d))) ; + SetResponse(Integer.valueOf(ijc.DoesExtend(c, d))) ; } void ObjectCount(StringTokenizer st) throws InlineJavaException { - SetResponse(new Integer(ijs.ObjectCount())) ; + SetResponse(Integer.valueOf(ijs.ObjectCount())) ; } @@ -209,7 +209,7 @@ Class c = ijc.ValidateClass(class_name) ; if (! ijc.ClassIsArray(c)){ - ArrayList f = ValidateMethod(true, c, class_name, st) ; + ArrayList f = ValidateMethod(true, c, class_name, st) ; Object p[] = (Object [])f.get(1) ; Class clist[] = (Class [])f.get(2) ; @@ -271,10 +271,10 @@ if ((ijc.ClassIsArray(c))&&(method.equals("getLength"))){ int length = Array.getLength(o) ; - SetResponse(new Integer(length)) ; + SetResponse(Integer.valueOf(length)) ; } else{ - ArrayList f = ValidateMethod(false, c, method, st) ; + ArrayList f = ValidateMethod(false, c, method, st) ; Method m = (Method)f.get(0) ; String name = m.getName() ; Object p[] = (Object [])f.get(1) ; @@ -298,9 +298,16 @@ InlineJavaException ije = (InlineJavaException)t ; throw ije ; } - else{ - SetResponse(new InlineJavaThrown(t)) ; + Throwable retval = t; + if (t instanceof InlineJavaPerlException){ + InlineJavaPerlException ijpe = (InlineJavaPerlException)t; + Object eo = ijpe.GetObject(); + if (eo instanceof Throwable) { + retval = (Throwable)eo; + } + InlineJavaUtils.debug(2, "InlineJavaPerlException " + retval.toString()) ; } + SetResponse(new InlineJavaThrown(retval)) ; } } } @@ -312,22 +319,16 @@ if (o == null){ return null ; } - else { - Class got = o.getClass() ; - if (got.equals(want)){ - return null ; - } - else { - boolean _public = (got.getModifiers() & Modifier.PUBLIC) != 0 ; - if ((_public)||(got.getPackage() == null)){ - return null ; - } - else { - InlineJavaUtils.debug(3, "AutoCast: " + got.getName() + " -> " + want.getName()) ; - return want ; - } - } + Class got = o.getClass() ; + if (got.equals(want)){ + return null ; + } + boolean _public = (got.getModifiers() & Modifier.PUBLIC) != 0 ; + if ((_public)||(got.getPackage() == null)){ + return null ; } + InlineJavaUtils.debug(3, "AutoCast: " + got.getName() + " -> " + want.getName()) ; + return want ; } @@ -373,10 +374,10 @@ ret = InlineJavaHandle.makeBuffered(o) ; if (ret != o){ int buf_id = ijs.PutObject(ret) ; - ret = new Integer(buf_id) ; + ret = Integer.valueOf(buf_id) ; } else { - ret = new Integer(id) ; + ret = Integer.valueOf(id) ; } } catch (java.io.IOException e){ @@ -411,7 +412,7 @@ Object ret = null ; try { int len = InlineJavaHandle.write(o, arg.toString()) ; - ret = new Integer(len) ; + ret = Integer.valueOf(len) ; } catch (java.io.IOException e){ ret = new InlineJavaThrown(e) ; @@ -474,7 +475,7 @@ } } else{ - ArrayList fl = ValidateMember(c, member, st) ; + ArrayList fl = ValidateMember(c, member, st) ; Field f = (Field)fl.get(0) ; String name = f.getName() ; Object p = (Object)fl.get(1) ; @@ -518,7 +519,7 @@ SetResponse(ret, AutoCast(ret, eclass)) ; } else{ - ArrayList fl = ValidateMember(c, member, st) ; + ArrayList fl = ValidateMember(c, member, st) ; Field f = (Field)fl.get(0) ; String name = f.getName() ; @@ -587,20 +588,20 @@ /* Makes sure a method exists */ - ArrayList ValidateMethod(boolean constructor, Class c, String name, StringTokenizer st) throws InlineJavaException { - ArrayList ret = new ArrayList() ; + ArrayList ValidateMethod(boolean constructor, Class c, String name, StringTokenizer st) throws InlineJavaException { + ArrayList ret = new ArrayList<>() ; // Extract signature String signature = st.nextToken() ; // Extract the arguments - ArrayList args = new ArrayList() ; + ArrayList args = new ArrayList<>() ; while (st.hasMoreTokens()){ args.add(args.size(), st.nextToken()) ; } String key = c.getName() + "." + name + signature ; - ArrayList ml = new ArrayList() ; + ArrayList ml = new ArrayList<>() ; Class params[] = null ; Member cached = (Member)member_cache.get(key) ; @@ -685,8 +686,8 @@ /* Makes sure a member exists */ - ArrayList ValidateMember(Class c, String name, StringTokenizer st) throws InlineJavaException { - ArrayList ret = new ArrayList() ; + ArrayList ValidateMember(Class c, String name, StringTokenizer st) throws InlineJavaException { + ArrayList ret = new ArrayList<>() ; // Extract member type String type = st.nextToken() ; @@ -695,7 +696,7 @@ String arg = st.nextToken() ; String key = type + " " + c.getName() + "." + name ; - ArrayList fl = new ArrayList() ; + ArrayList fl = new ArrayList<>() ; Class param = null ; Member cached = (Member)member_cache.get(key) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaServer.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaServer.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaServer.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaServer.java 2018-04-06 00:28:22.000000000 +0000 @@ -20,7 +20,7 @@ private boolean finished = false ; private ServerSocket server_socket = null ; private InlineJavaUserClassLoader ijucl = null ; - private HashMap thread_objects = new HashMap() ; + private HashMap> thread_objects = new HashMap<>(); private int objid = 1 ; private boolean jni = false ; private Thread creator = null ; @@ -207,7 +207,7 @@ throw new InlineJavaException("Can't find thread " + Thread.currentThread().getName() + "!") ; } else{ - o = h.get(new Integer(id)) ; + o = h.get(Integer.valueOf(id)) ; if (o == null){ throw new InlineJavaException("Can't find object " + id + " for thread " +Thread.currentThread().getName()) ; } @@ -218,14 +218,14 @@ synchronized int PutObject(Object o) throws InlineJavaException { - HashMap h = (HashMap)thread_objects.get(Thread.currentThread()) ; + HashMap h = (HashMap)thread_objects.get(Thread.currentThread()) ; int id = objid ; if (h == null){ throw new InlineJavaException("Can't find thread " + Thread.currentThread().getName() + "!") ; } else{ - h.put(new Integer(objid), o) ; + h.put(Integer.valueOf(objid), o) ; objid++ ; } @@ -241,7 +241,7 @@ throw new InlineJavaException("Can't find thread " + Thread.currentThread().getName() + "!") ; } else{ - o = h.remove(new Integer(id)) ; + o = h.remove(Integer.valueOf(id)) ; if (o == null){ throw new InlineJavaException("Can't find object " + id + " for thread " + Thread.currentThread().getName()) ; } @@ -291,7 +291,7 @@ calls this method also. */ synchronized void AddThread(Thread t){ - thread_objects.put(t, new HashMap()) ; + thread_objects.put(t, new HashMap()) ; InlineJavaPerlCaller.AddThread(t) ; } @@ -310,9 +310,9 @@ int debug = Integer.parseInt(argv[0]) ; String host = argv[1] ; int port = Integer.parseInt(argv[2]) ; - boolean shared_jvm = new Boolean(argv[3]).booleanValue() ; - boolean priv = new Boolean(argv[4]).booleanValue() ; - boolean native_doubles = new Boolean(argv[5]).booleanValue() ; + boolean shared_jvm = Boolean.parseBoolean(argv[3]) ; + boolean priv = Boolean.parseBoolean(argv[4]) ; + boolean native_doubles = Boolean.parseBoolean(argv[5]) ; InlineJavaServer ijs = new InlineJavaServer(debug, host, port, shared_jvm, priv, native_doubles) ; ijs.RunMainLoop() ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaUserClassLink.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaUserClassLink.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaUserClassLink.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaUserClassLink.java 2018-04-06 00:28:22.000000000 +0000 @@ -32,10 +32,10 @@ } - public Object create(Class p, Object args[], Class proto[]) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + public Object create(Class p, Object args[], Class proto[]) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // This will allow usage of the default no-arg constructor if (proto.length == 0){ - return p.newInstance() ; + return p.getDeclaredConstructor().newInstance() ; } else{ Constructor con = (Constructor)p.getConstructor(proto) ; diff -Nru libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaUserClassLoader.java libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaUserClassLoader.java --- libinline-java-perl-0.58~dfsg/Java/sources/org/perl/inline/java/InlineJavaUserClassLoader.java 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java/sources/org/perl/inline/java/InlineJavaUserClassLoader.java 2018-04-06 00:28:22.000000000 +0000 @@ -12,7 +12,7 @@ so that it will execute them. */ class InlineJavaUserClassLoader extends URLClassLoader { - private HashMap urls = new HashMap() ; + private HashMap urls = new HashMap<>() ; private Object link = null ; private Method invoke = null ; @@ -50,8 +50,8 @@ if (link == null){ try { InlineJavaUtils.debug(1, "loading InlineJavaUserClassLink via InlineJavaUserClassLoader") ; - Class c = Class.forName("InlineJavaUserClassLink", true, this) ; - link = c.newInstance() ; + Class c = Class.forName("InlineJavaUserClassLink", true, this) ; + link = c.getDeclaredConstructor().newInstance() ; invoke = find_method(c, "invoke") ; get = find_method(c, "get") ; @@ -162,7 +162,7 @@ public Object array_get(Object o, int idx) throws InlineJavaException { check_link() ; try { - return invoke_via_link(array_get, new Object [] {o, new Integer(idx)}) ; + return invoke_via_link(array_get, new Object [] {o, Integer.valueOf(idx)}) ; } catch (NoSuchMethodException me){/* Impossible */} catch (InstantiationException ie){/* Impossible */} @@ -176,7 +176,7 @@ public void array_set(Object o, int idx, Object elem) throws IllegalArgumentException, InlineJavaException { check_link() ; try { - invoke_via_link(array_set, new Object [] {o, new Integer(idx), elem}) ; + invoke_via_link(array_set, new Object [] {o, Integer.valueOf(idx), elem}) ; } catch (NoSuchMethodException me){/* Impossible */} catch (InstantiationException ie){/* Impossible */} diff -Nru libinline-java-perl-0.58~dfsg/Java.pm libinline-java-perl-0.66/Java.pm --- libinline-java-perl-0.58~dfsg/Java.pm 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1182 +0,0 @@ -package Inline::Java; - -use strict; -require 5.006; - -use base qw(Inline Exporter); - -# Export the cast function if wanted -our @EXPORT_OK = qw(cast coerce study_classes caught jar j2sdk); -our $VERSION = '0.58'; - -# DEBUG is set via the DEBUG config -our $DEBUG = 0 unless defined $DEBUG; - -*DEBUG_STREAM = *STDERR; # Set DEBUG stream - -use Carp; -use Config; -use File::Copy; -use File::Spec; -use Cwd; -use Data::Dumper; - -use Inline::Java::Portable; -use Inline::Java::Class; -use Inline::Java::Object; -use Inline::Java::Array; -use Inline::Java::Handle; -use Inline::Java::Protocol; -use Inline::Java::Callback; -# Must be last. -use Inline::Java::JVM; -# Our default J2SK -require Inline::Java->find_default_j2sdk(); - - -# This is set when the script is over. -my $DONE = 0; - -# This is set when at least one JVM is loaded. -my $JVM = undef; - -# This list will store the $o objects... -my @INLINES = (); - -my $report_version = "V2"; - -# This stuff is to control the termination of the Java Interpreter -sub done { - my $signal = shift; - - # To preserve the passed exit code... - my $ec = $?; - - $DONE = 1; - - if (! $signal){ - Inline::Java::debug(1, "killed by natural death."); - } - else{ - Inline::Java::debug(1, "killed by signal SIG$signal."); - } - - shutdown_JVM(); - Inline::Java::debug(1, "exiting with $ec"); - CORE::exit($ec); - exit($ec); -} - - -END { - if ($DONE < 1){ - done(); - } -} - - -# To export the cast function and others. -sub import { - my $class = shift; - - foreach my $a (@_){ - if ($a eq 'jar'){ - print Inline::Java::Portable::get_server_jar(); - exit(); - } - elsif ($a eq 'j2sdk'){ - print Inline::Java->find_default_j2sdk() . " says '" . - Inline::Java::get_default_j2sdk() . "'\n"; - exit(); - } - elsif ($a eq 'so_dirs'){ - print Inline::Java::Portable::portable('SO_LIB_PATH_VAR') . "=" . - join(Inline::Java::Portable::portable('ENV_VAR_PATH_SEP'), - Inline::Java::get_default_j2sdk_so_dirs()); - exit(); - } - } - $class->export_to_level(1, $class, @_); -} - - - -######################## Inline interface ######################## - - - -# Register this module as an Inline language support module -sub register { - return { - language => 'Java', - aliases => ['JAVA', 'java'], - type => 'interpreted', - suffix => 'jdat', - }; -} - - -# Here validate is overridden because some of the config options are needed -# at load as well. -sub validate { - my $o = shift; - - # This might not print since debug is set further down... - Inline::Java::debug(1, "Starting validate."); - - my $jdk = Inline::Java::get_default_j2sdk(); - my $dbg = $Inline::Java::DEBUG; - my %opts = @_; - $o->set_option('DEBUG', $dbg, 'i', 1, \%opts); - $o->set_option('J2SDK', $jdk, 's', 1, \%opts); - $o->set_option('CLASSPATH', '', 's', 1, \%opts); - - $o->set_option('BIND', 'localhost', 's', 1, \%opts); - $o->set_option('HOST', 'localhost', 's', 1, \%opts); - $o->set_option('PORT', -1, 'i', 1, \%opts); - $o->set_option('STARTUP_DELAY', 15, 'i', 1, \%opts); - $o->set_option('SHARED_JVM', 0, 'b', 1, \%opts); - $o->set_option('START_JVM', 1, 'b', 1, \%opts); - $o->set_option('JNI', 0, 'b', 1, \%opts); - $o->set_option('EMBEDDED_JNI', 0, 'b', 1, \%opts); - $o->set_option('NATIVE_DOUBLES', 0, 'b', 1, \%opts); - - $o->set_option('WARN_METHOD_SELECT', 0, 'b', 1, \%opts); - $o->set_option('STUDY', undef, 'a', 0, \%opts); - $o->set_option('AUTOSTUDY', 0, 'b', 1, \%opts); - - $o->set_option('EXTRA_JAVA_ARGS', '', 's', 1, \%opts); - $o->set_option('EXTRA_JAVAC_ARGS', '', 's', 1, \%opts); - $o->set_option('DEBUGGER', 0, 'b', 1, \%opts); - - $o->set_option('PRIVATE', '', 'b', 1, \%opts); - $o->set_option('PACKAGE', '', 's', 1, \%opts); - - my @left_overs = keys(%opts); - if (scalar(@left_overs)){ - croak "'$left_overs[0]' is not a valid configuration option for Inline::Java"; - } - - # Now for the post processing - $Inline::Java::DEBUG = $o->get_java_config('DEBUG'); - - # Embedded JNI turns on regular JNI - if ($o->get_java_config('EMBEDDED_JNI')){ - $o->set_java_config('JNI', 1); - } - - if ($o->get_java_config('PORT') == -1){ - if ($o->get_java_config('SHARED_JVM')){ - $o->set_java_config('PORT', 7891); - } - else{ - $o->set_java_config('PORT', -7890); - } - } - - if (($o->get_java_config('JNI'))&&($o->get_java_config('SHARED_JVM'))){ - croak("You can't use the 'SHARED_JVM' option in 'JNI' mode"); - } - if (($o->get_java_config('JNI'))&&($o->get_java_config('DEBUGGER'))){ - croak("You can't invoke the Java debugger ('DEBUGGER' option) in 'JNI' mode"); - } - if ((! $o->get_java_config('SHARED_JVM'))&&(! $o->get_java_config('START_JVM'))){ - croak("Disabling the 'START_JVM' option only makes sense in 'SHARED_JVM' mode"); - } - - if ($o->get_java_config('JNI')){ - require Inline::Java::JNI; - } - - if ($o->get_java_config('DEBUGGER')){ - # Here we want to tweak a few settings to help debugging... - Inline::Java::debug(1, "Debugger mode activated"); - # Add the -g compile option - $o->set_java_config('EXTRA_JAVAC_ARGS', $o->get_java_config('EXTRA_JAVAC_ARGS') . " -g "); - # Add the -sourcepath runtime option - $o->set_java_config('EXTRA_JAVA_ARGS', $o->get_java_config('EXTRA_JAVA_ARGS') . - " -sourcepath " . $o->get_api('build_dir') . - Inline::Java::Portable::portable("ENV_VAR_PATH_SEP_CP") . - Inline::Java::Portable::get_source_dir() - ); - } - - my $study = $o->get_java_config('STUDY'); - if ((defined($study))&&(ref($study) ne 'ARRAY')){ - croak "Configuration option 'STUDY' must be an array of Java class names"; - } - - Inline::Java::debug(1, "validate done."); -} - - -sub set_option { - my $o = shift; - my $name = shift; - my $default = shift; - my $type = shift; - my $env_or = shift; - my $opts = shift; - my $desc = shift; - - if (! exists($o->{ILSM}->{$name})){ - my $val = undef; - if (($env_or)&&(exists($ENV{"PERL_INLINE_JAVA_$name"}))){ - $val = $ENV{"PERL_INLINE_JAVA_$name"}; - } - elsif (exists($opts->{$name})){ - $val = $opts->{$name}; - } - else{ - $val = $default; - } - - if ($type eq 'b'){ - if (! defined($val)){ - $val = 0; - } - $val = ($val ? 1 : 0); - } - elsif ($type eq 'i'){ - if ((! defined($val))||($val !~ /\d/)){ - $val = 0; - } - $val = int($val); - } - - $o->set_java_config($name, $val); - } - - delete $opts->{$name}; -} - - -sub get_java_config { - my $o = shift; - my $param = shift; - - return $o->{ILSM}->{$param}; -} - - -sub set_java_config { - my $o = shift; - my $param = shift; - my $value = shift; - - return $o->{ILSM}->{$param} = $value; -} - - -# In theory we shouldn't need to use this, but it seems -# it's not all accessible by the API yet. -sub get_config { - my $o = shift; - my $param = shift; - - return $o->{CONFIG}->{$param}; -} - - -sub get_api { - my $o = shift; - my $param = shift; - - # Allows us to force a specific package... - if (($param eq 'pkg')&&($o->get_config('PACKAGE'))){ - return $o->get_config('PACKAGE'); - } - - return $o->{API}->{$param}; -} - - -# Parse and compile Java code -sub build { - my $o = shift; - - if ($o->get_java_config('built')){ - return; - } - - Inline::Java::debug(1, "Starting build."); - - # Grab and untaint the current directory - my $cwd = Cwd::cwd(); - if ($o->get_config('UNTAINT')){ - ($cwd) = $cwd =~ /(.*)/; - } - - # We must grab this before we change to the build dir because - # it could be relative... - my $server_jar = Inline::Java::Portable::get_server_jar(); - - # We need to add all the previous install dirs to the classpath because - # they can access each other. - my @prev_install_dirs = (); - foreach my $in (@INLINES){ - push @prev_install_dirs, File::Spec->catdir($in->get_api('install_lib'), - 'auto', $in->get_api('modpname')); - } - - my $cp = $ENV{CLASSPATH} || ''; - $ENV{CLASSPATH} = Inline::Java::Portable::make_classpath($server_jar, @prev_install_dirs, $o->get_java_config('CLASSPATH')); - Inline::Java::debug(2, "classpath: $ENV{CLASSPATH}"); - - # Create the build dir and go there - my $build_dir = $o->get_api('build_dir'); - $o->mkpath($build_dir); - chdir $build_dir; - - my $code = $o->get_api('code'); - my $pcode = $code; - my $study_only = ($code =~ /^(STUDY|SERVER)$/); - my $source = ($study_only ? '' : $o->get_api('modfname') . ".java"); - - # Parse code to check for public class - $pcode =~ s/\\\"//g; - $pcode =~ s/\"(.*?)\"//g; - $pcode =~ s/\/\*(.*?)\*\///gs; - $pcode =~ s/\/\/(.*)$//gm; - if ($pcode =~ /public\s+(abstract\s+)?class\s+(\w+)/){ - $source = "$2.java"; - } - - my $install_dir = File::Spec->catdir($o->get_api('install_lib'), - 'auto', $o->get_api('modpname')); - $o->mkpath($install_dir); - - if ($source){ - # Dump the source code... - open(Inline::Java::JAVA, ">$source") or - croak "Can't open $source: $!"; - print Inline::Java::JAVA $code; - close(Inline::Java::JAVA); - - # ... and compile it. - my $javac = File::Spec->catfile($o->get_java_config('J2SDK'), - Inline::Java::Portable::portable("J2SDK_BIN"), - "javac" . Inline::Java::Portable::portable("EXE_EXTENSION")); - my $redir = Inline::Java::Portable::portable("IO_REDIR"); - - my $args = "-deprecation " . $o->get_java_config('EXTRA_JAVAC_ARGS'); - my $pinstall_dir = Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", $install_dir); - my $cmd = Inline::Java::Portable::portable("SUB_FIX_CMD_QUOTES", - "\"$javac\" $args -d \"$pinstall_dir\" $source > cmd.out $redir"); - if ($o->get_config('UNTAINT')){ - ($cmd) = $cmd =~ /(.*)/; - } - Inline::Java::debug(2, "$cmd"); - my $res = system($cmd); - my $msg = $o->get_compile_error_msg(); - if ($res){ - croak $o->compile_error_msg($cmd, $msg); - }; - if ($msg){ - warn("\n$msg\n"); - } - - # When we run the commands, we quote them because in WIN32 you need it if - # the programs are in directories which contain spaces. Unfortunately, in - # WIN9x, when you quote a command, it masks it's exit value, and 0 is always - # returned. Therefore a command failure is not detected. - # We need to take care of checking whether there are actually files - # to be copied, and if not will exit the script. - if (Inline::Java::Portable::portable('COMMAND_COM')){ - my @fl = Inline::Java::Portable::find_classes_in_dir($install_dir); - if (! scalar(@fl)){ - croak "No class files produced. Previous command failed under command.com?"; - } - foreach my $f (@fl){ - if (! (-s $f->{file})){ - croak "File $f->{file} has size zero. Previous command failed under command.com?"; - } - } - } - } - - $ENV{CLASSPATH} = $cp; - Inline::Java::debug(2, "classpath: $ENV{CLASSPATH}"); - - # Touch the .jdat file. - my $jdat = File::Spec->catfile($install_dir, $o->get_api('modfname') . '.' . $o->get_api('suffix')); - if (! open(Inline::Java::TOUCH, ">$jdat")){ - croak "Can't create file $jdat"; - } - close(Inline::Java::TOUCH); - - # Go back and clean up - chdir $cwd; - if (($o->get_api('cleanup'))&&(! $o->get_java_config('DEBUGGER'))){ - $o->rmpath('', $build_dir); - } - - $o->set_java_config('built', 1); - Inline::Java::debug(1, "build done."); -} - - -sub get_compile_error_msg { - my $o = shift; - - my $msg = ''; - if (open(Inline::Java::CMD, "); - close(Inline::Java::CMD); - } - - return $msg; -} - - -sub compile_error_msg { - my $o = shift; - my $cmd = shift; - my $error = shift; - - my $build_dir = $o->get_api('build_dir'); - - my $lang = $o->get_api('language'); - return <get_java_config('loaded')){ - return; - } - - Inline::Java::debug(1, "Starting load."); - - my $install_dir = File::Spec->catdir($o->get_api('install_lib'), - 'auto', $o->get_api('modpname')); - - # If the JVM is not running, we need to start it here. - my $cp = $ENV{CLASSPATH} || ''; - if (! $JVM){ - $ENV{CLASSPATH} = Inline::Java::Portable::make_classpath( - Inline::Java::Portable::get_server_jar()); - Inline::Java::debug(2, "classpath: $ENV{CLASSPATH}"); - $JVM = new Inline::Java::JVM($o); - $ENV{CLASSPATH} = $cp; - Inline::Java::debug(2, "classpath: $ENV{CLASSPATH}"); - - my $pc = new Inline::Java::Protocol(undef, $o); - $pc->AddClassPath(Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", Inline::Java::Portable::get_user_jar())); - - my $st = $pc->ServerType(); - if ((($st eq "shared")&&(! $o->get_java_config('SHARED_JVM')))|| - (($st eq "private")&&($o->get_java_config('SHARED_JVM')))){ - croak "JVM type mismatch on port " . $JVM->{port}; - } - } - - $ENV{CLASSPATH} = ''; - my @cp = Inline::Java::Portable::make_classpath($install_dir, $o->get_java_config('CLASSPATH')); - $ENV{CLASSPATH} = $cp; - - my $pc = new Inline::Java::Protocol(undef, $o); - $pc->AddClassPath(@cp); - - # Add our Inline object to the list. - push @INLINES, $o; - $o->set_java_config('id', scalar(@INLINES) - 1); - Inline::Java::debug(3, "Inline::Java object id is " . $o->get_java_config('id')); - - $o->study_module(); - if ((defined($o->get_java_config('STUDY')))&&(scalar($o->get_java_config('STUDY')))){ - $o->_study($o->get_java_config('STUDY')); - } - - $o->set_java_config('loaded', 1); - Inline::Java::debug(1, "load done."); -} - - -# This function 'studies' the classes generated by the inlined code. -sub study_module { - my $o = shift; - - my $install_dir = File::Spec->catdir($o->get_api('install_lib'), - 'auto', $o->get_api('modpname')); - my $cache = $o->get_api('modfname') . '.' . $o->get_api('suffix'); - - my $lines = []; - if (! $o->get_java_config('built')){ - # Since we didn't build the module, this means that - # it was up to date. We can therefore use the data - # from the cache. - Inline::Java::debug(1, "using jdat cache"); - my $p = File::Spec->catfile($install_dir, $cache); - my $size = (-s $p) || 0; - if ($size > 0){ - if (open(Inline::Java::CACHE, "<$p")){ - while (){ - push @{$lines}, $_; - } - close(Inline::Java::CACHE); - } - else{ - croak "Can't open $p for reading: $!"; - } - } - } - else{ - # First thing to do is get the list of classes that comprise the module. - - # We need the classes that are in the directory or under... - my @classes = (); - my $cwd = Cwd::cwd(); - if ($o->get_config('UNTAINT')){ - ($cwd) = $cwd =~ /(.*)/; - } - - # We chdir to the install dir, that makes it easier to figure out - # the packages for the classes. - chdir($install_dir); - my @fl = Inline::Java::Portable::find_classes_in_dir('.'); - chdir $cwd; - foreach my $f (@fl){ - push @classes, $f->{class}; - } - - # Now we ask Java the info about those classes... - $lines = $o->report(@classes); - - # and we update the cache with these results. - Inline::Java::debug(1, "updating jdat cache"); - my $p = File::Spec->catfile($install_dir, $cache); - if (open(Inline::Java::CACHE, ">$p")){ - foreach my $l (@{$lines}){ - print Inline::Java::CACHE "$l\n"; - } - close(Inline::Java::CACHE); - } - else{ - croak "Can't open $p file for writing"; - } - } - - # Now we read up the symbols and bind them to Perl. - $o->bind_jdat($o->load_jdat($lines)); -} - - -# This function 'studies' the specified classes and binds them to -# Perl. -sub _study { - my $o = shift; - my $classes = shift; - - my @new_classes = (); - foreach my $class (@{$classes}){ - $class = Inline::Java::Class::ValidateClass($class); - if (! Inline::Java::known_to_perl($o->get_api('pkg'), $class)){ - push @new_classes, $class; - } - } - if (! scalar(@new_classes)){ - return; - } - - my $lines = $o->report(@new_classes); - # Now we read up the symbols and bind them to Perl. - $o->bind_jdat($o->load_jdat($lines)); -} - - -sub report { - my $o = shift; - my @classes = @_; - - my @lines = (); - if (scalar(@classes)){ - my $pc = new Inline::Java::Protocol(undef, $o); - my $resp = $pc->Report(join(" ", @classes)); - @lines = split("\n", $resp); - } - - return \@lines; -} - - -# Load the jdat code information file. -sub load_jdat { - my $o = shift; - my $lines = shift; - - Inline::Java::debug_obj($lines); - - # We need an array here since the same object can have many - # study sessions. - if (! defined($o->{ILSM}->{data})){ - $o->{ILSM}->{data} = []; - } - my $d = {}; - my $data_idx = scalar(@{$o->{ILSM}->{data}}); - push @{$o->{ILSM}->{data}}, $d; - - # The original regexp didn't match anymore under the debugger... - # Very strange indeed... - # my $re = '[\w.\$\[;]+'; - my $re = '.+'; - - my $idx = 0; - my $current_class = undef; - if (scalar(@{$lines})){ - my $vline = shift @{$lines}; - chomp($vline); - if ($vline ne $report_version){ - croak("Report version mismatch ($vline != $report_version). Delete your '_Inline' and try again."); - } - } - foreach my $line (@{$lines}){ - chomp($line); - if ($line =~ /^class ($re) ($re)$/){ - # We found a class definition - my $java_class = $1; - my $parent_java_class = $2; - $current_class = Inline::Java::java2perl($o->get_api('pkg'), $java_class); - $d->{classes}->{$current_class} = {}; - $d->{classes}->{$current_class}->{java_class} = $java_class; - if ($parent_java_class ne "null"){ - $d->{classes}->{$current_class}->{parent_java_class} = $parent_java_class; - } - $d->{classes}->{$current_class}->{constructors} = {}; - $d->{classes}->{$current_class}->{methods} = {}; - $d->{classes}->{$current_class}->{fields} = {}; - } - elsif ($line =~ /^constructor \((.*)\)$/){ - my $signature = $1; - - $d->{classes}->{$current_class}->{constructors}->{$signature} = - { - SIGNATURE => [split(", ", $signature)], - STATIC => 1, - IDX => $idx, - }; - } - elsif ($line =~ /^method (\w+) ($re) (\w+)\((.*)\)$/){ - my $static = $1; - my $declared_in = $2; - my $method = $3; - my $signature = $4; - - if (! defined($d->{classes}->{$current_class}->{methods}->{$method})){ - $d->{classes}->{$current_class}->{methods}->{$method} = {}; - } - - $d->{classes}->{$current_class}->{methods}->{$method}->{$signature} = - { - SIGNATURE => [split(", ", $signature)], - STATIC => ($static eq "static" ? 1 : 0), - IDX => $idx, - }; - } - elsif ($line =~ /^field (\w+) ($re) (\w+) ($re)$/){ - my $static = $1; - my $declared_in = $2; - my $field = $3; - my $type = $4; - - if (! defined($d->{classes}->{$current_class}->{fields}->{$field})){ - $d->{classes}->{$current_class}->{fields}->{$field} = {}; - } - - $d->{classes}->{$current_class}->{fields}->{$field}->{$type} = - { - TYPE => $type, - STATIC => ($static eq "static" ? 1 : 0), - IDX => $idx, - }; - } - $idx++; - } - - Inline::Java::debug_obj($d); - - return ($d, $data_idx); -} - - -# Binds the classes and the methods to Perl -sub bind_jdat { - my $o = shift; - my $d = shift; - my $idx = shift; - - if (! defined($d->{classes})){ - return; - } - - my $inline_idx = $o->get_java_config('id'); - - my %classes = %{$d->{classes}}; - foreach my $class (sort keys %classes) { - my $class_name = $class; - $class_name =~ s/^(.*):://; - - my $java_class = $d->{classes}->{$class}->{java_class}; - # This parent stuff is needed for PerlNatives (so that you can call PerlNatives methods - # from Perl...) - my $parent_java_class = $d->{classes}->{$class}->{parent_java_class}; - my $parent_module = ''; - my $parent_module_declare = ''; - if (defined($parent_java_class)){ - $parent_module = java2perl($o->get_api('pkg'), $parent_java_class); - $parent_module_declare = "\$$parent_module" . "::EXISTS_AS_PARENT = 1;"; - $parent_module .= ' '; - } - if (Inline::Java::known_to_perl($o->get_api('pkg'), $java_class)){ - next; - } - - my $colon = ":"; - my $dash = "-"; - my $ijo = 'Inline::Java::Object'; - - my $code = <__new( - \$JAVA_CLASS, \$INLINE, 0); - -use Carp; - -CODE - - while (my ($field, $types) = each %{$d->{classes}->{$class}->{fields}}){ - while (my ($type, $sign) = each %{$types}){ - if ($sign->{STATIC}){ - $code .= <{classes}->{$class}->{constructors}})){ - $code .= <{ILSM}->{data}->[$idx]; - my \$signatures = \$d->{classes}->{'$class'}->{constructors}; - my (\$proto, \$new_args, \$static) = \$class->__validate_prototype('new', [\@args], \$signatures, \$o); - - my \$ret = undef; - eval { - \$ret = \$class->__new(\$JAVA_CLASS, \$o, -1, \$proto, \$new_args); - }; - croak \$@ if \$@; - - return \$ret; -} - - -sub $class_name { - return new(\@_); -} - -CODE - } - - while (my ($method, $sign) = each %{$d->{classes}->{$class}->{methods}}){ - $code .= $o->bind_method($idx, $class, $method); - } - - Inline::Java::debug_obj(\$code); - - # open (Inline::Java::CODE, ">>code") and print CODE $code and close(CODE); - - # Here it seems that for the eval below to resolve the @INLINES - # list properly, it must be used in this function... - my $dummy = scalar(@INLINES); - - eval $code; - - croak $@ if $@; - } -} - - -sub bind_method { - my $o = shift; - my $idx = shift; - my $class = shift; - my $method = shift; - my $static = shift; - - my $code = <{ILSM}->{data}->[$idx]; - my \$signatures = \$d->{classes}->{'$class'}->{methods}->{'$method'}; - my (\$proto, \$new_args, \$static) = \$this->__validate_prototype('$method', [\@args], \$signatures, \$o); - - if ((\$static)&&(! ref(\$this))){ - \$this = \$DUMMY_OBJECT; - } - - my \$ret = undef; - eval { - \$ret = \$this->__get_private()->{proto}->CallJavaMethod('$method', \$proto, \$new_args); - }; - croak \$@ if \$@; - - return \$ret; -} - -CODE - - return $code; -} - - -sub get_fields { - my $o = shift; - my $class = shift; - - my $fields = {}; - my $data_list = $o->{ILSM}->{data}; - - foreach my $d (@{$data_list}){ - if (exists($d->{classes}->{$class})){ - while (my ($field, $value) = each %{$d->{classes}->{$class}->{fields}}){ - # Here $value is a hash that contains all the different - # types available for the field $field - $fields->{$field} = $value; - } - } - } - - return $fields; -} - - -# Return a small report about the Java code. -sub info { - my $o = shift; - - if (! (($o->{INLINE}->{object_ready})||($o->get_java_config('built')))){ - $o->build(); - } - - if (! $o->get_java_config('loaded')){ - $o->load(); - } - - my $info = ''; - my $data_list = $o->{ILSM}->{data}; - - foreach my $d (@{$data_list}){ - if (! defined($d->{classes})){ - next; - } - - my %classes = %{$d->{classes}}; - - $info .= "The following Java classes have been bound to Perl:\n"; - foreach my $class (sort keys %classes) { - $info .= "\n class $class:\n"; - - $info .= " public methods:\n"; - while (my ($k, $v) = each %{$d->{classes}->{$class}->{constructors}}){ - my $name = $class; - $name =~ s/^(.*):://; - $info .= " $name($k)\n"; - } - - while (my ($k, $v) = each %{$d->{classes}->{$class}->{methods}}){ - while (my ($k2, $v2) = each %{$d->{classes}->{$class}->{methods}->{$k}}){ - my $static = ($v2->{STATIC} ? "static " : ""); - $info .= " $static$k($k2)\n"; - } - } - - $info .= " public member variables:\n"; - while (my ($k, $v) = each %{$d->{classes}->{$class}->{fields}}){ - while (my ($k2, $v2) = each %{$d->{classes}->{$class}->{fields}->{$k}}){ - my $static = ($v2->{STATIC} ? "static " : ""); - my $type = $v2->{TYPE}; - - $info .= " $static$type $k\n"; - } - } - } - } - - return $info; -} - - - -######################## General Functions ######################## - - -sub __get_JVM { - return $JVM; -} - - -# For testing purposes only... -sub __clear_JVM { - $JVM = undef; -} - - -sub shutdown_JVM { - if ($JVM){ - $JVM->shutdown(); - $JVM = undef; - } -} - - -sub reconnect_JVM { - if ($JVM){ - $JVM->reconnect(); - } -} - - -sub capture_JVM { - if ($JVM){ - $JVM->capture(); - } -} - - -sub i_am_JVM_owner { - if ($JVM){ - return $JVM->am_owner(); - } -} - - -sub release_JVM { - if ($JVM){ - $JVM->release(); - } -} - - -sub get_DEBUG { - return $Inline::Java::DEBUG; -} - - -sub get_DONE { - return $DONE; -} - - -sub set_DONE { - $DONE = 1; -} - - -sub __get_INLINES { - return \@INLINES; -} - - -sub java2perl { - my $pkg = shift; - my $jclass = shift; - - $jclass =~ s/[.\$]/::/g; - - if ((defined($pkg))&&($pkg)){ - $jclass = $pkg . "::" . $jclass; - } - - return $jclass; -} - - -sub known_to_perl { - my $pkg = shift; - my $jclass = shift; - - my $perl_class = java2perl($pkg, $jclass); - - no strict 'refs'; - if (defined(${$perl_class . "::" . "EXISTS"})){ - Inline::Java::debug(3, "perl knows about '$jclass' ('$perl_class')"); - return 1; - } - else{ - Inline::Java::debug(3, "perl doesn't know about '$jclass' ('$perl_class')"); - } - - return 0; -} - - -sub debug { - my $level = shift; - - if (($Inline::Java::DEBUG)&&($Inline::Java::DEBUG >= $level)){ - my $x = " " x $level; - my $str = join("\n$x", @_); - while (chomp($str)) {} - print DEBUG_STREAM sprintf("[perl][%s]$x%s\n", $level, $str); - } -} - - -sub debug_obj { - my $obj = shift; - my $force = shift || 0; - - if (($Inline::Java::DEBUG >= 5)||($force)){ - debug(5, "Dump:\n" . Dumper($obj)); - if (UNIVERSAL::isa($obj, "Inline::Java::Object")){ - # Print the guts as well... - debug(5, "Private Dump:" . Dumper($obj->__get_private())); - } - } -} - - -sub dump_obj { - my $obj = shift; - - return debug_obj($obj, 1); -} - - -######################## Public Functions ######################## - - -# If we are dealing with a Java object, we simply ask for a new "reference" -# with the requested class. -sub cast { - my $type = shift; - my $val = shift; - - if (! UNIVERSAL::isa($val, "Inline::Java::Object")){ - croak("Type casting can only be used on Java objects. Use 'coerce' instead."); - } - - return $val->__cast($type); -} - - -# coerce is used to force a specific prototype to be used. -sub coerce { - my $type = shift; - my $val = shift; - my $array_type = shift; - - if (UNIVERSAL::isa($val, "Inline::Java::Object")){ - croak("Type coercing can't be used on Java objects. Use 'cast' instead."); - } - - my $o = undef; - eval { - $o = new Inline::Java::Class::Coerce($type, $val, $array_type); - }; - croak $@ if $@; - - return $o; -} - - -sub study_classes { - my $classes = shift; - my $package = shift || caller(); - - my $o = undef; - my %pkgs = (); - foreach (@INLINES){ - my $i = $_; - my $pkg = $i->get_api('pkg') || 'main'; - $pkgs{$pkg} = 1; - if ($pkg eq $package){ - $o = $i; - last; - } - } - - if (defined($o)){ - $o->_study($classes); - } - else { - my $msg = "Can't place studied classes under package '$package' since Inline::Java was not used there. Valid packages are:\n"; - foreach my $pkg (keys %pkgs){ - $msg .= " $pkg\n"; - } - croak($msg); - } -} - - -sub caught { - my $class = shift; - - my $e = $@; - - $class = Inline::Java::Class::ValidateClass($class); - - my $ret = 0; - if (($e)&&(UNIVERSAL::isa($e, "Inline::Java::Object"))){ - my ($msg, $score) = $e->__isa($class); - if ($msg){ - $ret = 0; - } - else{ - $ret = 1; - } - } - $@ = $e; - - return $ret; -} - -sub find_default_j2sdk { - my $class = shift; - return File::Spec->catfile('Inline', 'Java', 'default_j2sdk.pl'); -} - -1; diff -Nru libinline-java-perl-0.58~dfsg/Java.pod libinline-java-perl-0.66/Java.pod --- libinline-java-perl-0.58~dfsg/Java.pod 2014-11-29 09:18:45.000000000 +0000 +++ libinline-java-perl-0.66/Java.pod 1970-01-01 00:00:00.000000000 +0000 @@ -1,1158 +0,0 @@ -=head1 NAME - -Inline::Java - Write Perl classes in Java. - -=head1 SYNOPSIS - -=for comment - - use Inline Java => <<'END_OF_JAVA_CODE' ; - class Pod_alu { - public Pod_alu(){ - } - - public int add(int i, int j){ - return i + j ; - } - - public int subtract(int i, int j){ - return i - j ; - } - } - END_OF_JAVA_CODE - - my $alu = new Pod_alu() ; - print($alu->add(9, 16) . "\n") ; # prints 25 - print($alu->subtract(9, 16) . "\n") ; # prints -7 - -=for comment - - -=head1 DESCRIPTION - -The C module allows you to put Java source code -directly "inline" in a Perl script or module. A Java compiler -is launched and the Java code is compiled. Then Perl asks the -Java classes what public methods have been defined. These classes -and methods are available to the Perl program as if they had been -written in Perl. - -The process of interrogating the Java classes for public methods -occurs the first time you run your Java code. The namespace is -cached, and subsequent calls use the cached version. - Z<> - - -=head1 USING THE Inline::Java MODULE - -C is driven by fundamentally the same idea as other -C language modules, like C or C. -Because Java is both compiled and interpreted, the method of getting -your code is different, but overall, using C is very similar -to any other C language module. - -This section will explain the different ways to C Inline::Java. -For more details on C, see 'perldoc Inline'. - -B - -The most basic form for using C is: - - use Inline Java => 'Java source code' ; - -Of course, you can use Perl's "here document" style of quoting to make -the code slightly easier to read: - - use Inline Java => <<'END'; - - Java source code goes here. - - END - -The source code can also be specified as a filename, a subroutine -reference (the subroutine should return source code), or an array -reference (the array contains lines of source code). This information -is detailed in 'perldoc Inline'. - -In order for C to function properly, it needs to know -where to find a Java 2 SDK on your machine. This is done using one -of the following techniques: - -=over 4 - -=item 1 - -Set the J2SDK configuration option to the correct directory - -=item 2 - -Set the PERL_INLINE_JAVA_J2SDK environment variable to the -correct directory - -=back - - -If none of these are specified, C will use the Java -2 SDK that was specified at install time (see below). - - -=head1 DEFAULT JAVA 2 SDK - -When C was installed, the path to the Java 2 SDK that was -used was stored in a file called default_j2sdk.pl that resides within -the C module. You can obtain this path by using the following -command: - - % perl -MInline::Java=j2sdk - -If you wish to permanently change the default Java 2 SDK that is used -by C, edit this file and change the value found there. -If you wish use a different Java 2 SDK temporarily, see the J2SDK -configuration option described below. - -Additionally, you can use the following command to get the list of directories -that you should put in you shared library path when using the JNI extension: - - % perl -MInline::Java=so_dirs - - -=head1 CONFIGURATION OPTIONS - -There are a number of configuration options that dictate the -behavior of C: - -=over 4 - -=item j2sdk - -Specifies the path to your Java 2 SDK. - - Ex: j2sdk => '/my/java/2/sdk/path' - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item port - -Specifies the port number for the server. Default is -1 (next -available port number), default for SHARED_JVM mode is 7891. - - Ex: port => 4567 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item host - -Specifies the host on which the JVM server is running. This option -really only makes sense in SHARED_JVM mode when START_JVM is disabled. - - Ex: host => 'jvm.server.com' - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item bind - -Specifies the IP address on which the JVM server will be listening. By -default the JVM server listens for connections on 'localhost' only. - - Ex: bind => '192.168.1.1' - Ex: bind => '0.0.0.0' - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item startup_delay - -Specifies the maximum number of seconds that the Perl script -will try to connect to the Java server. In other words this is the -delay that Perl gives to the Java server to start. Default -is 15 seconds. - - Ex: startup_delay => 20 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item classpath - -Adds the specified CLASSPATH. This CLASSPATH will only be available -through the user classloader. To set the CLASSPATH globally (which is -most probably what you want to do anyways), use the CLASSPATH -environment variable. - - Ex: classpath => '/my/other/java/classses' - -=item jni - -Toggles the execution mode. The default is to use the client/server -mode. To use the JNI extension (you must have built it at install -time though; see README and README.JNI for more information), set -JNI to 1. - - Ex: jni => 1 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item extra_java_args, extra_javac_args - -Specify extra command line parameters to be passed to, respectively, -the JVM and the Java compiler. Use with caution as some options may -alter normal C behavior. - - Ex: extra_java_args => '-Xmx96m' - -Note: extra_java_args only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item embedded_jni - -Same as jni, except C expects the JVM to already be -loaded and to have loaded the Perl interpreter that is running the -script. This is an advanced feature that should only be need in -very specific circumstances. - - Ex: embedded_jni => 1 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. Also, the embedded_jni option automatically -sets the JNI option. - -=item shared_jvm - -This mode enables multiple processes to share the same JVM. It was -created mainly in order to be able to use C under -mod_perl. - - Ex: shared_jvm => 1 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item start_jvm - -When used with shared_jvm, tells C whether to start -a new JVM (this is the default) or to expect that one is already -running. This option is useful in combination with the command line interface -described in the BUGS AND DEFICIENCIES section. Default is 1. - - Ex: start_jvm => 0 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item private - -In shared_jvm mode, makes every connection to the JVM use a different -classloader so that each connection is isolated from the others. - - Ex: private => 1 - -Note: This configuration option only has an effect on the first -'use Inline Java' call inside a Perl script, since all other calls -make use of the same JVM. - -=item debug - -Enables debugging info. Debugging now uses levels (1 through 5) -that (loosely) follow these definitions: - - 1 = Major program steps - 2 = Object creation/destruction - 3 = Method/member accesses + packet dumps - 4 = Everything else - 5 = Data structure dumps - - Ex: debug => 2 - -=item debugger - -Starts jdb (the Java debugger) instead of the regular Java JVM. -This option will also cause the Java code to be compiled using the -'-g' switch for extra debugging information. EXTRA_JAVA_ARGS can -be used use to pass extra options to the debugger. - - Ex: debugger => 1 - -=item warn_method_select - -Throws a warning when C has to 'choose' between -different method signatures. The warning states the possible -choices and the signature chosen. - - Ex: warn_method_select => 1 - -=item study - -Takes an array of Java classes that you wish to have -C learn about so that you can use them inside Perl. - - Ex: study => ['java.lang.HashMap', 'my.class'] - -=item autostudy - -Makes C automatically study unknown classes when it -encounters them. - - Ex: autostudy => 1 - -=item package - -Forces C to bind the Java code under the specified -package instead of under the current (caller) package. - - Ex: package => 'main' - -=item native_doubles - -Normally, C stringifies floating point numbers when passing -them between Perl and Java. In certain cases, this can lead to loss of -precision. When native_doubles is set, C will send the actual -double bytes in order to preserve precision. -Note: This applies only to doubles, not floats. -Note: This option may not be portable and may not work properly on some -platforms. - - Ex: native_doubles => 1 - -=back - - -=head1 ENVIRONMENT VARIABLES - -Every configuration option listed above, with the exception of STUDY, -can be specified using an environment variable named using the -following convention: - - PERL_INLINE_JAVA_