Index: lucene/build.xml
===================================================================
--- lucene/build.xml	(revision 1359608)
+++ lucene/build.xml	(working copy)
@@ -170,7 +170,7 @@
   </target>
 
   <!-- Validation (license/notice/api checks). -->
-  <target name="validate" depends="check-licenses,check-forbidden-apis" description="Validate stuff." />
+  <target name="validate" depends="check-licenses,check-forbidden-apis,check-system-out" description="Validate stuff." />
 
   <target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
     <license-check-macro dir="${basedir}" />
@@ -186,6 +186,18 @@
     </forbidden-apis>
   </target>
 
+  <target name="check-system-out" depends="compile-tools,load-custom-tasks" description="Check for use of System.out, etc in non-test code.">
+    <forbidden-apis>
+      <apiFileSet dir="${custom-tasks.dir}/forbiddenApis">
+        <include name="system-out.txt" />
+      </apiFileSet>
+      <fileset dir="${basedir}/build">
+        <include name="**/classes/java/**/*.class"/>
+        <exclude name="test-framework/**"/>
+      </fileset>
+    </forbidden-apis>
+  </target>
+
   <target name="resolve">
     <sequential>
       <ant dir="test-framework" target="resolve" inheritall="false">
Index: lucene/tools/forbiddenApis/system-out.txt
===================================================================
--- lucene/tools/forbiddenApis/system-out.txt	(revision 0)
+++ lucene/tools/forbiddenApis/system-out.txt	(working copy)
@@ -0,0 +1,8 @@
+# Don't allow System.out/System.err usage in non-test Lucene code
+java.lang.System#out
+java.lang.System#err
+
+# eclipse autogenerated stubs!
+java.lang.Throwable#printStackTrace()
+java.lang.Throwable#printStackTrace(java.io.PrintStream)
+java.lang.Throwable#printStackTrace(java.io.PrintWriter)

Property changes on: lucene/tools/forbiddenApis/system-out.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
