]> source.dussan.org Git - poi.git/commitdiff
Make forbiddenapis also check excelant. Use a separate "classpath" for running forbid...
authorUwe Schindler <uschindler@apache.org>
Sun, 8 Nov 2015 11:57:58 +0000 (11:57 +0000)
committerUwe Schindler <uschindler@apache.org>
Sun, 8 Nov 2015 11:57:58 +0000 (11:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713222 13f79535-47bb-0310-9956-ffa450edef68

build.xml
src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java

index a82dc75cc3e611f2cf464890e5a2d34791357494..5756ffb568292e3948f6c5a863cc411108f22711 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -366,6 +366,15 @@ under the License.
         <path path="${env.CLASSPATH}"/>
     </path>
 
+    <path id="forbiddenapis.classpath">
+        <path refid="main.classpath"/>
+        <path refid="scratchpad.classpath"/>
+        <path refid="ooxml.classpath"/>
+        <path refid="ooxml.xmlsec.classpath"/>
+        <path refid="excelant.classpath"/>
+        <path path="${env.CLASSPATH}"/>
+    </path>
+
     <path id="lib.jacoco">
         <fileset dir="lib">
             <include name="org.jacoco*.jar" />
@@ -1766,7 +1775,7 @@ under the License.
                  classpath="${forbidden.jar}"/>
         <forbiddenapis 
                  internalRuntimeForbidden="true" 
-                 classpathref="javadoc.classpath"
+                 classpathref="forbiddenapis.classpath"
                  suppressAnnotation="org.apache.poi.util.SuppressForbidden"
             >
             <bundledsignatures name="jdk-unsafe-${jdk.version.source}"/>
@@ -1779,10 +1788,7 @@ under the License.
             <fileset dir="${main.output.dir}"/>
             <fileset dir="${ooxml.output.dir}"/>
             <fileset dir="${scratchpad.output.dir}"/>
-            <!--
-            Adding Excelant causes ClassNotFoundException, see https://github.com/policeman-tools/forbidden-apis/issues/85
             <fileset dir="${excelant.output.dir}"/>
-            -->
             <!--
             <fileset dir="${examples.output.dir}"/>
             -->
index 422496988749813722afd0db78f43e7bf3eebd29..ad0cf6b845e3decceaf936941d5b62f2d3c1cc5e 100644 (file)
@@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Locale;
 
 import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtil;
 import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtilFactory;
@@ -88,7 +89,7 @@ public class ExcelAntTask extends Task {
                versionBffr.append(  "ExcelAnt version " ) ;
                versionBffr.append( VERSION ) ;
                versionBffr.append( " Copyright 2011" ) ;
-               SimpleDateFormat sdf = new SimpleDateFormat( "yyyy" ) ;
+               SimpleDateFormat sdf = new SimpleDateFormat( "yyyy", Locale.ROOT ) ;
                double currYear = Double.parseDouble( sdf.format( new Date() ) );
                if( currYear > 2011 ) {
                    versionBffr.append( "-" ) ;