[libinline-java-perl] 341/398: ok, towards 0.49_91

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:21 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 cb3b763074ee169f6ef3fcc1fa2e319d165091e0
Author: patrick_leb <>
Date:   Sun Feb 20 21:52:32 2005 +0000

    ok, towards 0.49_91
---
 Java.pm                         | 34 +++++++++++++++++++---------------
 Java.pod                        |  5 +++--
 Java/Array.pm                   |  2 +-
 Java/Callback.pm                |  2 +-
 Java/Class.pm                   | 14 +++++++++-----
 Java/JNI.pm                     |  2 +-
 Java/JVM.pm                     |  2 +-
 Java/Object.pm                  |  2 +-
 Java/PerlNatives/PerlNatives.pm |  2 +-
 Java/Portable.pm                |  4 ++--
 Java/Protocol.pm                |  2 +-
 Java/Server.pm                  |  2 +-
 t/02_primitives.t               |  8 ++++----
 13 files changed, 45 insertions(+), 36 deletions(-)

diff --git a/Java.pm b/Java.pm
index 2527f2b..cf656f8 100644
--- a/Java.pm
+++ b/Java.pm
@@ -8,7 +8,7 @@ package Inline::Java ;
 use strict ;
 require 5.006 ;
 
-$Inline::Java::VERSION = '0.49_90' ;
+$Inline::Java::VERSION = '0.49_91' ;
 
 
 # DEBUG is set via the DEBUG config
@@ -313,6 +313,18 @@ sub build {
 	# 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) ;
@@ -348,17 +360,6 @@ sub build {
 		"javac" . Inline::Java::Portable::portable("EXE_EXTENSION")) ;
 		my $redir = Inline::Java::Portable::portable("IO_REDIR") ;
 
-		# 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}") ;
 		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", 
@@ -375,8 +376,6 @@ sub build {
 		if ($msg){
 			warn("\n$msg\n") ;
 		}
-		$ENV{CLASSPATH} = $cp ;
-		Inline::Java::debug(2, "classpath: $ENV{CLASSPATH}") ;
 
 		# 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
@@ -397,6 +396,9 @@ sub build {
 		}
 	}
 
+	$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")){
@@ -633,6 +635,8 @@ sub load_jdat {
 	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 = '.+' ;
 
@@ -647,7 +651,7 @@ sub load_jdat {
 	}
 	foreach my $line (@{$lines}){
 		chomp($line) ;
-		if ($line =~ /^class ($re) ($re|null)$/){
+		if ($line =~ /^class ($re) ($re)$/){
 			# We found a class definition
 			my $java_class = $1 ;
 			my $parent_java_class = $2 ;
diff --git a/Java.pod b/Java.pod
index a05832f..b932a17 100644
--- a/Java.pod
+++ b/Java.pod
@@ -173,8 +173,9 @@ make use of the same JVM.
 =item CLASSPATH
 
 Adds the specified CLASSPATH. This CLASSPATH will only be available
-threw the use classloader. To set the CLASSPATH globally, use the 
-CLASSPATH environment variable.
+threw 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'
 
diff --git a/Java/Array.pm b/Java/Array.pm
index d374fc8..f7b6f31 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -4,7 +4,7 @@ package Inline::Java::Array ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Array::VERSION = '0.49_90' ;
+$Inline::Java::Array::VERSION = '0.49_91' ;
 
 # Here we store as keys the knots and as values our blessed objects
 my $OBJECTS = {} ;
diff --git a/Java/Callback.pm b/Java/Callback.pm
index 48febb7..5868cb5 100644
--- a/Java/Callback.pm
+++ b/Java/Callback.pm
@@ -3,7 +3,7 @@ package Inline::Java::Callback ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Callback::VERSION = '0.49_90' ;
+$Inline::Java::Callback::VERSION = '0.49_91' ;
 
 $Inline::Java::Callback::OBJECT_HOOK = undef ;
 
diff --git a/Java/Class.pm b/Java/Class.pm
index c667d5c..f69efcc 100644
--- a/Java/Class.pm
+++ b/Java/Class.pm
@@ -3,7 +3,7 @@ package Inline::Java::Class ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Class::VERSION = '0.49_90' ;
+$Inline::Java::Class::VERSION = '0.49_91' ;
 
 $Inline::Java::Class::MAX_SCORE = 10 ;
 
@@ -42,8 +42,8 @@ my $RANGE = {
 	},
 	'java.lang.Double' => {
 		REGEXP => $FLOAT_RE,
-		MAX => 1.7976931348623157e308,
-		MIN => -1.7976931348623157e308,
+		# MAX => 1.79e308,
+		# MIN => -1.79e308,
 		POS_MIN => 4.9e-324,
 		NEG_MAX => -4.9e-324,
 	},
@@ -184,9 +184,13 @@ sub CastArgument {
 			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") ;
+			Inline::Java::debug(4, 
+				"min = " . ($min || '') . ", " . 
+				"max = " . ($max || '') . ", " .
+				"val = $arg") ;
 			if ($arg =~ /$re/){
-				if (($arg >= $min)&&($arg <= $max)){
+				if (((! defined($min))||($arg >= $min))&&
+					((! defined($max))||($arg <= $max))){
 					# number is a pretty precise match, but it's still
 					# guessing amongst the numeric types
 					return ($arg, 5.5) ;
diff --git a/Java/JNI.pm b/Java/JNI.pm
index 7f8abc1..ea5573d 100644
--- a/Java/JNI.pm
+++ b/Java/JNI.pm
@@ -4,7 +4,7 @@ package Inline::Java::JNI ;
 
 use strict ;
 
-$Inline::Java::JNI::VERSION = '0.49_90' ;
+$Inline::Java::JNI::VERSION = '0.49_91' ;
 
 use DynaLoader ;
 use Carp ;
diff --git a/Java/JVM.pm b/Java/JVM.pm
index 161ff67..203676c 100644
--- a/Java/JVM.pm
+++ b/Java/JVM.pm
@@ -8,7 +8,7 @@ use IPC::Open3 ;
 use IO::Socket ;
 use Inline::Java::Portable ;
 
-$Inline::Java::JVM::VERSION = '0.49_90' ;
+$Inline::Java::JVM::VERSION = '0.49_91' ;
 
 my %SIGS = () ;
 
diff --git a/Java/Object.pm b/Java/Object.pm
index e2a46c0..52d38d8 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -5,7 +5,7 @@ use strict ;
 use Inline::Java::Protocol ;
 use Carp ;
 
-$Inline::Java::Object::VERSION = '0.49_90' ;
+$Inline::Java::Object::VERSION = '0.49_91' ;
 
 # Here we store as keys the knots and as values our blessed private objects
 my $PRIVATES = {} ;
diff --git a/Java/PerlNatives/PerlNatives.pm b/Java/PerlNatives/PerlNatives.pm
index 885890b..0104852 100644
--- a/Java/PerlNatives/PerlNatives.pm
+++ b/Java/PerlNatives/PerlNatives.pm
@@ -2,6 +2,6 @@ package Inline::Java::PerlNatives ;
 
 use strict ;
 
-$Inline::Java::PerlNatives::VERSION = '0.49_90' ;
+$Inline::Java::PerlNatives::VERSION = '0.49_91' ;
 
 1 ;
diff --git a/Java/Portable.pm b/Java/Portable.pm
index 7e26ff7..2b244b8 100644
--- a/Java/Portable.pm
+++ b/Java/Portable.pm
@@ -9,7 +9,7 @@ use Config ;
 use File::Find ;
 use File::Spec ;
 
-$Inline::Java::Portable::VERSION = '0.49_90' ;
+$Inline::Java::Portable::VERSION = '0.49_91' ;
 
 # Here is some code to figure out if we are running on command.com
 # shell under Windows.
@@ -60,7 +60,7 @@ sub make_classpath {
 	foreach my $p (@cp){
 		if (($p)&&(-e $p)){
 			if ($cp{$p}){
-				my $fp = (-d $p ? File::Spec->rel2abs($p) : $p) ;
+				my $fp = File::Spec->rel2abs($p) ;
 				push @fcp, Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", $fp) ;
 				delete $cp{$p} ;
 			}
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 7292436..b1e900e 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -5,7 +5,7 @@ use Inline::Java::Object ;
 use Inline::Java::Array ;
 use Carp ;
 
-$Inline::Java::Protocol::VERSION = '0.49_90' ;
+$Inline::Java::Protocol::VERSION = '0.49_91' ;
 
 my %CLASSPATH_ENTRIES = () ;
 
diff --git a/Java/Server.pm b/Java/Server.pm
index 595d227..d0e72d9 100644
--- a/Java/Server.pm
+++ b/Java/Server.pm
@@ -13,7 +13,7 @@ require Inline::Java ;
 use File::Spec ;
 
 
-$Inline::Java::Server::VERSION = '0.49_90' ;
+$Inline::Java::Server::VERSION = '0.49_91' ;
 
 
 # Create a dummy Inline::Java object in order to 
diff --git a/t/02_primitives.t b/t/02_primitives.t
index 2cf60a8..ac10cac 100644
--- a/t/02_primitives.t
+++ b/t/02_primitives.t
@@ -103,8 +103,8 @@ my $t = new types2() ;
 	eval {$t->_Float($max + $max)} ; ok($@, qr/out of range/) ;
 	eval {$t->_Float($min + $min)} ; ok($@, qr/out of range/) ;
 
-	$max = 1.7976931348623157e308 ;
-	$min = -1.7976931348623157e308 ;
+	$max = 1.79e308 ;
+	$min = -1.79e308 ;
 	ok($t->_double(undef) == 1) ;
 	ok($t->_double(0) == 1) ;
 	ok($t->_double($max / 2)) ;
@@ -126,8 +126,8 @@ my $t = new types2() ;
 	# eval {$t->_Double($min + $min)} ; ok($@, qr/out of range/) ;
 	
 	# Number is forced to Double
-	$max = 1.7976931348623157e308 ;
-	$min = -1.7976931348623157e308 ;
+	$max = 1.79e308 ;
+	$min = -1.79e308 ;
 	ok($t->_Number(undef) == 0) ;
 	ok($t->_Number(0) == 0) ;
 	ok($t->_Number($max / 2)) ;

-- 
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