]> source.dussan.org Git - poi.git/commitdiff
bug 60288: remove defensive copy for internal relationships. Patch from Tim Helmstedt...
authorJaven O'Neal <onealj@apache.org>
Fri, 21 Oct 2016 07:29:40 +0000 (07:29 +0000)
committerJaven O'Neal <onealj@apache.org>
Fri, 21 Oct 2016 07:29:40 +0000 (07:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765935 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java
src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePart.java

index 759cfdea9fccc9ab9ad05d2462b37a68ae3a3956..506344f93ca2341899b86145b23d503246d06acf 100644 (file)
@@ -1409,7 +1409,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
         */
        @Override
     public boolean isRelationshipExists(PackageRelationship rel) {
-        for (PackageRelationship r : this.getRelationships()) {
+        for (PackageRelationship r : relationships) {
             if (r == rel) {
                 return true;
             }
index bcf457e1aee87742373669676049d1e90c038a85..23969fa68ae3e7168d209c2b6edde73a2d0b5ad5 100644 (file)
@@ -447,12 +447,9 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
         * @see org.apache.poi.openxml4j.opc.RelationshipSource#isRelationshipExists(org.apache.poi.openxml4j.opc.PackageRelationship)
         */
        public boolean isRelationshipExists(PackageRelationship rel) {
-        try {
-            for (PackageRelationship r : this.getRelationships()) {
-                if (r == rel)
-                    return true;
-            }
-        } catch (InvalidFormatException e){
+               for (PackageRelationship r : _relationships) {
+                       if (r == rel)
+                               return true;
                }
         return false;
        }