]> source.dussan.org Git - poi.git/commitdiff
add stax entries to forbidden apis due to android issues
authorPJ Fanning <fanningpj@apache.org>
Sat, 6 Oct 2018 09:38:58 +0000 (09:38 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 6 Oct 2018 09:38:58 +0000 (09:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843009 13f79535-47bb-0310-9956-ffa450edef68

build.xml
src/java/org/apache/poi/util/StaxHelper.java
src/resources/devtools/forbidden-signatures.txt

index abe465528d9dd5482763a06057406c8219fde521..c55aff304715b4d5656e043aeb5aa5807e0abd30 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -244,8 +244,8 @@ under the License.
     <!-- license and api checks -->
     <property name="rat.jar" location="${main.lib}/apache-rat-0.12.jar"/>
     <property name="rat.url" value="${repository.m2}/maven2/org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar"/>
-    <property name="forbidden.jar" location="${main.lib}/forbiddenapis-2.5.jar"/>
-    <property name="forbidden.url" value="${repository.m2}/maven2/de/thetaphi/forbiddenapis/2.5/forbiddenapis-2.5.jar"/>
+    <property name="forbidden.jar" location="${main.lib}/forbiddenapis-2.6.jar"/>
+    <property name="forbidden.url" value="${repository.m2}/maven2/de/thetaphi/forbiddenapis/2.6/forbiddenapis-2.6.jar"/>
 
     <property name="maven.ooxml.xsds.version.id" value="1.4"/>
        
@@ -652,6 +652,7 @@ under the License.
                 <include name="forbiddenapis-2.0.jar"/>
                 <include name="forbiddenapis-2.1.jar"/>
                 <include name="forbiddenapis-2.3.jar"/>
+                <include name="forbiddenapis-2.5.jar"/>
                 <include name="apache-rat-0.11.jar"/>
                 <include name="mockito-core-2.13.0.jar"/>
             </fileset>
index 58a4959699b4835caa41d03d7c64d97163a28bb5..31530c2e7b58600ac0bbdd4e986128f8a6bf6a50 100644 (file)
@@ -34,7 +34,7 @@ public final class StaxHelper {
      * Creates a new StAX XMLInputFactory, with sensible defaults
      */
     public static XMLInputFactory newXMLInputFactory() {
-        XMLInputFactory factory = XMLInputFactory.newFactory();
+        XMLInputFactory factory = XMLInputFactory.newInstance();
         trySetProperty(factory, XMLInputFactory.IS_NAMESPACE_AWARE, true);
         trySetProperty(factory, XMLInputFactory.IS_VALIDATING, false);
         trySetProperty(factory, XMLInputFactory.SUPPORT_DTD, false);
@@ -46,7 +46,7 @@ public final class StaxHelper {
      * Creates a new StAX XMLOutputFactory, with sensible defaults
      */
     public static XMLOutputFactory newXMLOutputFactory() {
-        XMLOutputFactory factory = XMLOutputFactory.newFactory();
+        XMLOutputFactory factory = XMLOutputFactory.newInstance();
         trySetProperty(factory, XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
         return factory;
     }
index e64d7e02cf73f53a8e777fb3cc3b2f91eeb91de9..9fda92e1b65764274ee241a562104f3c41ed5e29 100644 (file)
@@ -123,6 +123,11 @@ java.util.concurrent.Future#cancel(boolean)
 @defaultMessage Don't use ...InputStream.available() as it gives wrong result for certain streams - use IOUtils.toByteArray to read the stream fully and then count the available bytes \r
 java.io.InputStream#available() \r
 \r
+@defaultMessage Use newInstance, as newFactory does not seem to work on Android - https://github.com/centic9/poi-on-android/issues/44#issuecomment-426517981\r
+javax.xml.stream.XMLEventFactory#newFactory()\r
+javax.xml.stream.XMLInputFactory#newFactory()\r
+javax.xml.stream.XMLOutputFactory#newFactory()\r
+\r
 @defaultMessage Unnecessary, inefficient, and confusing conversion of String.toString\r
 java.lang.String#toString()\r
 \r