LUCENE-4357: icu tools/ use forbidden apis

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1380967 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-09-05 03:41:08 +00:00
parent e96e4a62ef
commit 99c26e9955
3 changed files with 13 additions and 4 deletions

View File

@ -97,6 +97,9 @@
<target name="compile-test">
<forall-analyzers target="compile-test"/>
</target>
<target name="compile-tools">
<forall-analyzers target="compile-tools"/>
</target>
<target name="test">
<forall-analyzers target="test"/>
</target>

View File

@ -37,6 +37,7 @@ import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -252,15 +253,15 @@ public class GenerateUTR30DataFiles {
if (it.codepoint != UnicodeSetIterator.IS_STRING) {
if (numericValue) {
for (int cp = it.codepoint ; cp <= it.codepointEnd ; ++cp) {
builder.append(String.format("%04X", cp)).append('>');
builder.append(String.format("%04X", 0x30 + UCharacter.getNumericValue(cp)));
builder.append(String.format(Locale.ROOT, "%04X", cp)).append('>');
builder.append(String.format(Locale.ROOT, "%04X", 0x30 + UCharacter.getNumericValue(cp)));
builder.append(" # ").append(UCharacter.getName(cp));
builder.append("\n");
}
} else {
builder.append(String.format("%04X", it.codepoint));
builder.append(String.format(Locale.ROOT, "%04X", it.codepoint));
if (it.codepointEnd > it.codepoint) {
builder.append("..").append(String.format("%04X", it.codepointEnd));
builder.append("..").append(String.format(Locale.ROOT, "%04X", it.codepointEnd));
}
builder.append('>').append(rightHandSide).append("\n");
}

View File

@ -146,6 +146,11 @@
<!-- Validation (license/notice/api checks). -->
<target name="validate" depends="check-licenses,rat-sources,check-forbidden-apis" description="Validate stuff." />
<!-- Validation here depends on compile-tools: but we want to compile modules' tools too -->
<target name="compile-tools" depends="common.compile-tools">
<modules-crawl target="compile-tools" failonerror="true"/>
</target>
<target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
<license-check-macro dir="${basedir}" licensedir="${common.dir}/licenses" />
</target>