Skip to content

Apache Lucene open-source search software

LUCENE-4199, LUCENE-4202, LUCENE-4206: Remove noise by not-existing XML CDATA in task; cleanup build.xmls

Uwe Schindler53cfbcda0dc5
diff --git a/lucene/build.xml b/lucene/build.xml
index 8d2b8824f77..df46e7d9e22 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -189,11 +189,8 @@
</target>
<target name="-check-forbidden-test-apis">
- <forbidden-apis>
+ <forbidden-apis apiFile="${custom-tasks.dir}/forbiddenApis/tests.txt">
<classpath refid="junit-path"/>
- <apiFileSet dir="${custom-tasks.dir}/forbiddenApis">
- <include name="tests.txt" />
- </apiFileSet>
<fileset dir="${basedir}/build" includes="**/classes/test/**/*.class,test-framework/**/*.class" />
</forbidden-apis>
</target>
diff --git a/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java b/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java
index 738ddf365be..993a8322daa 100644
--- a/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java
+++ b/lucene/tools/src/java/org/apache/lucene/validation/ForbiddenApisCheckTask.java
@@ -343,8 +343,11 @@ public class ForbiddenApisCheckTask extends Task {
throw new BuildException("Resource does not exist: " + r);
}
if (r instanceof StringResource) {
- log("Reading inline API signatures...", Project.MSG_INFO);
- parseApiFile(new StringReader(((StringResource) r).getValue()));
+ final String s = ((StringResource) r).getValue();
+ if (s != null && s.trim().length() > 0) {
+ log("Reading inline API signatures...", Project.MSG_INFO);
+ parseApiFile(new StringReader(s));
+ }
} else {
log("Reading API signatures: " + r, Project.MSG_INFO);
parseApiFile(new InputStreamReader(r.getInputStream(), "UTF-8"));
diff --git a/solr/build.xml b/solr/build.xml
index e3204d10f4b..b4687dd407e 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -210,11 +210,8 @@
</target>
<target name="-check-forbidden-test-apis">
- <forbidden-apis>
+ <forbidden-apis apiFile="${custom-tasks.dir}/forbiddenApis/tests.txt">
<classpath refid="junit-path"/>
- <apiFileSet dir="${custom-tasks.dir}/forbiddenApis">
- <include name="tests.txt" />
- </apiFileSet>
<fileset dir="${basedir}/build">
<include name="**/classes/test/**/*.class"/>
<include name="solr-test-framework/**/*.class"/>