[libinline-java-perl] 200/398: Finished debugging subsys rewrite

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit bae6abdfd2a5b548618eba9a8f478b64df943885
Author: patrick_leb <>
Date:   Mon Jun 3 15:52:48 2002 +0000

    Finished debugging subsys rewrite
---
 Java.pm          |  13 +++++++++++--
 Java/Array.pm    |   4 ++--
 Java/Init.pm     |  11 +----------
 Java/JNI.xs      |   2 +-
 Java/JVM.pm      |  16 ++++++++++------
 Java/Object.pm   |  16 ++++++++++------
 Java/Protocol.pm |   2 +-
 README           |   2 +-
 t/no_const.class | Bin 231 -> 231 bytes
 t/types.class    | Bin 15 -> 489 bytes
 10 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/Java.pm b/Java.pm
index 03c6203..b9283f4 100644
--- a/Java.pm
+++ b/Java.pm
@@ -7,7 +7,7 @@ package Inline::Java ;
 
 use strict ;
 
-$Inline::Java::VERSION = '0.32' ;
+$Inline::Java::VERSION = '0.33' ;
 
 
 # DEBUG is set via the DEBUG config
@@ -668,7 +668,16 @@ sub set_classpath {
 		$p =~ s/\s+$// ;
 	}
 
-	$ENV{CLASSPATH} = join($sep, @cp) ;
+	my @fcp = () ;
+	my %cp = map {$_ => 1} @cp ;
+	foreach my $p (@cp){
+		if ($cp{$p}){
+			push @fcp, $p ;
+			delete $cp{$p} ;
+		}
+	}
+
+	$ENV{CLASSPATH} = join($sep, @fcp) ;
 
 	Inline::Java::debug(1, "classpath: " . $ENV{CLASSPATH}) ;
 }
diff --git a/Java/Array.pm b/Java/Array.pm
index 8ebe13f..3df6480 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -150,14 +150,14 @@ sub DESTROY {
 
 	my $knot = tied @{$this} ;
 	if (! $knot){
-		Inline::Java::debug(2, "destroying Inline::Java::Array::Tie") ;
+		Inline::Java::debug(4, "destroying Inline::Java::Array::Tie") ;
 
 		$OBJECTS->{$this} = undef ;
 	}
 	else{
 		# Here we can't untie because we still have a reference in $OBJECTS
 		# untie @{$this} ;
-		Inline::Java::debug(2, "destroying Inline::Java::Array") ;
+		Inline::Java::debug(4, "destroying Inline::Java::Array") ;
 	}
 }
 
diff --git a/Java/Init.pm b/Java/Init.pm
index fb0b022..14f7de4 100644
--- a/Java/Init.pm
+++ b/Java/Init.pm
@@ -79,7 +79,7 @@ public class InlineJavaServer {
 		init() ;
 		debug = d ;
 
-		thread_objects.put(Thread.currentThread().getName(), new HashMap()) ;		
+		thread_objects.put(Thread.currentThread().getName(), new HashMap()) ;
 	}
 
 
@@ -87,15 +87,6 @@ public class InlineJavaServer {
 	InlineJavaServer(String[] argv) {
 		init() ;
 
-		try {
-			System.out.close() ;
-			System.in.close() ;
-		}
-		catch (IOException e){
-			System.err.println("IO error: " + e.getMessage()) ;
-			System.err.flush() ;
-		}
-
 		debug = new Integer(argv[0]).intValue() ;
 		port = Integer.parseInt(argv[1]) ;
 		shared_jvm = new Boolean(argv[2]).booleanValue() ;
diff --git a/Java/JNI.xs b/Java/JNI.xs
index d4556a5..be4fb7d 100644
--- a/Java/JNI.xs
+++ b/Java/JNI.xs
@@ -163,7 +163,7 @@ new(CLASS, classpath, debug)
 	check_exception(env, "Can't find class java.lang.String") ;
 	
 	/* Get the method ids that are needed later */
-	RETVAL->jni_main_mid = (*(env))->GetStaticMethodID(env, RETVAL->ijs_class, "jni_main", "(Z)LInlineJavaServer;") ;
+	RETVAL->jni_main_mid = (*(env))->GetStaticMethodID(env, RETVAL->ijs_class, "jni_main", "(I)LInlineJavaServer;") ;
 	check_exception(env, "Can't find method jni_main in class InlineJavaServer") ;
 	RETVAL->process_command_mid = (*(env))->GetMethodID(env, RETVAL->ijs_class, "ProcessCommand", "(Ljava/lang/String;)Ljava/lang/String;") ;
 	check_exception(env, "Can't find method ProcessCommand in class InlineJavaServer") ;
diff --git a/Java/JVM.pm b/Java/JVM.pm
index 1c55dd3..c3e040b 100644
--- a/Java/JVM.pm
+++ b/Java/JVM.pm
@@ -36,8 +36,8 @@ sub new {
 
 	Inline::Java::debug(1, "starting JVM...") ;
 
+	$this->{owner} = 1 ;
 	if ($o->get_java_config('JNI')){
-		$this->{owner} = 1 ;
 		Inline::Java::debug(1, "JNI mode") ;
 
 		my $jni = new Inline::Java::JNI(
@@ -110,15 +110,19 @@ sub launch {
 	if (! defined($in)){
 		croak "Can't open $dn for reading" ;
 	}
-	my $out = new IO::File(">$dn") ;
-	if (! defined($out)){
-		croak "Can't open $dn for writing" ;
+	my $out = ">&STDOUT" ;
+	if ($this->{shared}){
+		$out = new IO::File(">$dn") ;
+		if (! defined($out)){
+			croak "Can't open $dn for writing" ;
+		}
 	}
-
 	my $pid = open3($in, $out, ">&STDERR", $cmd) ;
 
 	close($in) ;
-	close($out) ;
+	if ($this->{shared}){
+		close($out) ;
+	}
 
 	return $pid ;
 }
diff --git a/Java/Object.pm b/Java/Object.pm
index 32995af..4b77ff5 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -53,7 +53,7 @@ sub __new {
 	}
 	else{
 		$this->__get_private()->{id} = $objid ;
-		Inline::Java::debug(2, "object created in java ($class):") ;
+		Inline::Java::debug(2, "creating object in java ($class):") ;
 	}
 
 	Inline::Java::debug_obj($this) ;
@@ -330,7 +330,7 @@ sub DESTROY {
 	
 	my $knot = tied %{$this} ;
 	if (! $knot){
-		Inline::Java::debug(2, "destroying Inline::Java::Object::Tie") ;
+		Inline::Java::debug(4, "destroying Inline::Java::Object::Tie") ;
 		
 		if (! Inline::Java::get_DONE()){
 			if (! $this->__get_private()->{weak_ref}){
@@ -366,17 +366,21 @@ sub DESTROY {
 				$PRIVATES->{$this} = undef ;
 			}
 			else{
-				Inline::Java::debug(2, "object marked as weak reference, object destruction not propagated to Java") ;
+				Inline::Java::debug(4, "object marked as weak reference, object destruction not propagated to Java") ;
 			}
 		}
 		else{
-			Inline::Java::debug(2, "script marked as DONE, object destruction not propagated to Java") ;
+			Inline::Java::debug(4, "script marked as DONE, object destruction not propagated to Java") ;
 		}
 	}
 	else{
 		# Here we can't untie because we still have a reference in $PRIVATES
 		# untie %{$this} ;
-		Inline::Java::debug(2, "destroying Inline::Java::Object") ;
+
+		my $class = $this->__get_private()->{class} ;
+		Inline::Java::debug(2, "destroying object in java ($class):") ;
+
+		Inline::Java::debug(4, "destroying Inline::Java::Object") ;
 	}
 }
 
@@ -539,7 +543,7 @@ sub new {
 sub DESTROY {
 	my $this = shift ;
 
-	Inline::Java::debug(2, "destroying Inline::Java::Object::Private") ;
+	Inline::Java::debug(4, "destroying Inline::Java::Object::Private") ;
 }
 
 
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 54cd0bf..4dd670a 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -393,7 +393,7 @@ sub DeserializeObject {
 sub DESTROY {
 	my $this = shift ;
 
-	Inline::Java::debug(2, "destroying Inline::Java::Protocol") ;
+	Inline::Java::debug(4, "destroying Inline::Java::Protocol") ;
 }
 
 
diff --git a/README b/README
index 196fac5..4e7e43f 100644
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ Inline::Java lets you write Perl classes in Java.
 
 Example:
 
-    use Inline Java => <<'END',
+    use Inline Java => <<'END';
 	    class JAxH {
 			public JAxH(String x){
 				System.out.println("Just Another " + x + " Hacker") ;
diff --git a/t/no_const.class b/t/no_const.class
index 79d98bc..98ea5ef 100644
Binary files a/t/no_const.class and b/t/no_const.class differ
diff --git a/t/types.class b/t/types.class
index fc9e393..918c408 100644
Binary files a/t/types.class and b/t/types.class differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list