You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/05/31 23:42:38 UTC

svn commit: r1129930 - /incubator/jena/Jena2/ARQ/trunk/apacheize

Author: andy
Date: Tue May 31 21:42:38 2011
New Revision: 1129930

URL: http://svn.apache.org/viewvc?rev=1129930&view=rev
Log:
Tidy up

Modified:
    incubator/jena/Jena2/ARQ/trunk/apacheize

Modified: incubator/jena/Jena2/ARQ/trunk/apacheize
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/apacheize?rev=1129930&r1=1129929&r2=1129930&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/apacheize (original)
+++ incubator/jena/Jena2/ARQ/trunk/apacheize Tue May 31 21:42:38 2011
@@ -1,7 +1,9 @@
 #!/usr/bin/perl
-
+# Remove old head/tail /*...*/ comments and add apache boilerplate.
 # find DIRS -name \*.java -o -name .svn -prune | xargs perl perl-script
 
+# TODO Remove only last /*..*/ comment, not all the ones after last }
+
 &setExclude ;
 undef $/ ;
 
@@ -18,24 +20,9 @@ sub process
     open(FILE, "<$file") || die ;
     binmode FILE ;
     $_ = <FILE> ;
-    # my $t = &clean($_) ;
-    my @a = &copyrights($_) ;
-
-    @a = m!\(c\)\s*Copyright(?:[\s\d,]*)(.*)!gx ;
-    map {$copyrights{$_} = 1} @a ;
-
-    print join("\n", keys %copyrights),"\n" ;
-
-##     print "---------------\n" ;
-##     print $t ;
-##     print "---------------\n" ;
-}
-
-sub copyrights
-{
-     my $text = @_[0] ;
-     my @a = m!\(c\)\s*Copyright(?:[\s\d,]*)(.*)!gx ;
-     return @a ;
+    my $t = &clean($_) ;
+    print $t ;
+    print "\n" ;
 }
 
 ## head and tail
@@ -43,8 +30,10 @@ sub clean
 {
     my $text = @_[0] ;
     $text =~ s!^\s*/\*[^{}/]*\*/\s*!!s ;
+    # This removes all trailing comments, not just the last.
     $text =~ s!\s*/\*[^{}]*\*/\s*$!!s ;
-    return $text."\n" ;
+    # No newline on end.
+    return $text ;
 }
 
 ##     # Head
@@ -63,49 +52,6 @@ sub clean
 ## 	##print "TAIL\n" ;
 ##     }
 
-
-
-
-
-
 sub setExclude
 {
-    # Mostly, these files are the output of JavaCC
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrLexer.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrLexer.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrLexer.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParserTokenTypes.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParserTokenTypes.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/N3AntlrParserTokenTypes.java'} = 1 ;
-
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/JavaCharStream.java'}= 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/ParseException.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/Token.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TokenMgrError.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParserConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParserConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParserTokenManager.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/parser/TurtleParserTokenManager.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/test/TurtleTestVocab.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/n3/turtle/test/TurtleTestVocab.java'} = 1 ;
-
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/JavaCharStream.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/ParseException.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParser.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParserConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParserTokenManager.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParserTreeConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParserTreeConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/RDQLParserTreeConstants.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/Token.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/rdql/parser/TokenMgrError.java'} = 1 ;
-
-    $exclude{'src/com/hp/hpl/jena/shared/uuid/MD5.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/vocabulary/TestManifest.java'} = 1 ;
-    $exclude{'src/com/hp/hpl/jena/vocabulary/TestManifestX.java'} = 1 ;
 }