Fix forbidden API usage in Groovy code!

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1627166 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-09-23 22:12:34 +00:00
parent 07e00b4ffb
commit c60e7fe419
1 changed files with 5 additions and 9 deletions

View File

@ -202,15 +202,11 @@
<filterchain>
<tokenfilter>
<filetokenizer/>
<scriptfilter language="groovy">
<classpath>
<path refid="groovy.classpath"/>
</classpath><![CDATA[
// private static Codec defaultCodec = Codec . forName ( "Lucene410" ) ;
defaultCodecMatcher = self.getToken() =~ /defaultCodec\s*=\s*Codec\s*\.\s*forName\s*\(\s*"([^"]+)"\s*\)\s*;/
self.setToken(defaultCodecMatcher[0][1].toLowerCase());
]]>
</scriptfilter>
<scriptfilter language="groovy" classpathref="groovy.classpath"><![CDATA[
// private static Codec defaultCodec = Codec . forName ( "LuceneXXX" ) ;
def defaultCodecMatcher = self.getToken() =~ /defaultCodec\s*=\s*Codec\s*\.\s*forName\s*\(\s*"([^"]+)"\s*\)\s*;/
self.setToken(defaultCodecMatcher[0][1].toLowerCase(Locale.ROOT));
]]></scriptfilter>
</tokenfilter>
</filterchain>
</loadfile>