You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ho...@apache.org on 2008/12/09 07:57:25 UTC

svn commit: r724624 - in /lucene/solr/trunk: build.xml src/dev-tools/stub-analysis-factory-maker.pl

Author: hossman
Date: Mon Dec  8 22:57:24 2008
New Revision: 724624

URL: http://svn.apache.org/viewvc?rev=724624&view=rev
Log:
improved messages and bug fixes to stub generation

Modified:
    lucene/solr/trunk/build.xml
    lucene/solr/trunk/src/dev-tools/stub-analysis-factory-maker.pl

Modified: lucene/solr/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/build.xml?rev=724624&r1=724623&r2=724624&view=diff
==============================================================================
--- lucene/solr/trunk/build.xml (original)
+++ lucene/solr/trunk/build.xml Mon Dec  8 22:57:24 2008
@@ -283,7 +283,7 @@
               </linecontainsregexp>
               <linecontainsregexp negate="true">
                  <!-- no way to leverage these in Solr (yet) -->
-                 <regexp pattern="Sink\|Tee"/>
+                 <regexp pattern="Sink|Tee"/>
               </linecontainsregexp>
               <linecontainsregexp negate="true">
                  <!-- Solr already has a different impl for this -->

Modified: lucene/solr/trunk/src/dev-tools/stub-analysis-factory-maker.pl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/dev-tools/stub-analysis-factory-maker.pl?rev=724624&r1=724623&r2=724624&view=diff
==============================================================================
--- lucene/solr/trunk/src/dev-tools/stub-analysis-factory-maker.pl (original)
+++ lucene/solr/trunk/src/dev-tools/stub-analysis-factory-maker.pl Mon Dec  8 22:57:24 2008
@@ -43,6 +43,8 @@
 use File::Find;
 
 
+my $errors = 0;
+
 my %classes = ();
 while (<STDIN>) {
     chomp;
@@ -106,13 +108,21 @@
 			 } split /\s*,\s*/, $argline;
 	
 	# wacky, doesn't use Reader or TokenStream ... skip (maybe a Sink?)
-	return unless defined $mainArgType;
+	unless (defined $mainArgType) {
+	    warn "$class doesn't have a constructor with a Reader or TokenStream\n";
+	    return;
+	}
 
 	my $type = ("Reader" eq $mainArgType) ? "Tokenizer" : "TokenFilter";
 
 	my $facClass = "${class}Factory";
 	my $facFile = "${facClass}.java";
-	die "$facFile exists" if -e $facFile;
+
+	if (-e $facFile) {
+	    warn "$facFile already exists (maybe the return type isn't specific?)";
+	    $errors++;
+	    return;
+	}
 	open my $o, ">", $facFile
 	    or die "can't write to $facFile: $!";
 
@@ -140,15 +150,17 @@
 	
 	delete $classes{$fullname}; # we're done with this one
     } else {
-	print STDERR "can't stub $class\n";
+	print STDERR "can't stub $class (no public constructor?)\n";
+	$errors++;
     }
 }
     
 if (keys %classes) {
-    print STDERR "Can't find java files for...\n";
+    print STDERR "Can't stub (or find java files) for...\n";
     foreach (keys %classes) {
 	print STDERR "$_\n";
     }
-    exit -1;
+    $errors++;
 }
+exit -1 if $errors;