[libinline-java-perl] 65/398: *** empty log message ***

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:48 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 3e0de3751f3b492e5faaac45b6c0070477d0ac23
Author: patrick <>
Date:   Mon Apr 16 19:42:38 2001 +0000

    *** empty log message ***
---
 Java/Object.pm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Java/Object.pm b/Java/Object.pm
index a6bee0c..47023f2 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -111,6 +111,7 @@ sub __validate_prototype {
 		my $h = {
 			PROTO =>	$proto,
 			NEW_ARGS =>	$new_args,
+			NB_ARGS =>	scalar(@{$new_args}),
 			SCORE =>	$score,
 			STATIC =>	$stat,
 		} ;
@@ -155,6 +156,25 @@ sub __validate_prototype {
 		croak "Method $method of class $inline->{pkg}::$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->{Java}->{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 functionnality described in the documentation." ;
+			carp $msg ;		
+		}
+	}
+
 	return (
 		$chosen->{PROTO}, 
 		$chosen->{NEW_ARGS}, 

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