]> source.dussan.org Git - poi.git/commitdiff
XDGF: fix jenkins build errors
authorDustin Spicuzza <virtuald@apache.org>
Mon, 19 Oct 2015 06:55:06 +0000 (06:55 +0000)
committerDustin Spicuzza <virtuald@apache.org>
Mon, 19 Oct 2015 06:55:06 +0000 (06:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1709363 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xdgf/extractor/XDGFVisioExtractor.java
src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeTextVisitor.java
src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
src/ooxml/testcases/org/apache/poi/xdgf/extractor/TestXDGFVisioExtractor.java

index c49c2121dcde000babf057c387281ba577a2a3d8..5f474fc73963d89e169943435cc66985432e5c62 100644 (file)
@@ -1,3 +1,19 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
 package org.apache.poi.xdgf.extractor;
 
 import java.io.IOException;
index c42bc34d594a83b0b4464a43843ca694f5c1e9d8..a659a8bcef776593b34cb7aea6f114407b48ecc7 100644 (file)
@@ -32,6 +32,18 @@ public class CombinedIterable<T> implements Iterable<T> {
 
     final SortedMap<Long, T> _baseItems;
     final SortedMap<Long, T> _masterItems;
+    
+    private static final class EmptyIterator<T> implements Iterator<T> {
+
+        public boolean hasNext() {
+            return false;
+        }
+
+        public T next() {
+            return null;
+        }
+        
+    }
 
     public CombinedIterable(SortedMap<Long, T> baseItems,
             SortedMap<Long, T> masterItems) {
@@ -47,7 +59,7 @@ public class CombinedIterable<T> implements Iterable<T> {
         if (_masterItems != null)
             vmasterI = _masterItems.entrySet().iterator();
         else
-            vmasterI = Collections.emptyIterator();
+            vmasterI = new EmptyIterator<Entry<Long, T>>();
 
         return new Iterator<T>() {
 
index 4589bc8ad7f567dc58770da223d06d47c9857e11..9a0f28cf543fccd2d37f4e4b0ce824a2a105eb86 100644 (file)
@@ -1,3 +1,19 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
 package org.apache.poi.xdgf.usermodel.shape;
 
 import java.awt.geom.AffineTransform;
index 6b3a9a5a5fb20c03e49dac321ff0f8907a8318d8..eb9aa9796d2258803fc81097757959327572e8c7 100644 (file)
@@ -24,6 +24,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
 
 import org.apache.poi.xdgf.usermodel.XDGFPage;
 import org.apache.poi.xdgf.usermodel.XDGFShape;
@@ -37,13 +38,13 @@ import org.apache.poi.xdgf.usermodel.shape.ShapeVisitor;
 public class HierarchyPrinter {
 
     public static void printHierarchy(XDGFPage page, File outDir)
-            throws FileNotFoundException {
+            throws FileNotFoundException, UnsupportedEncodingException {
 
         File pageFile = new File(outDir, "page" + page.getPageNumber() + "-"
                 + Util.sanitizeFilename(page.getName()) + ".txt");
 
         OutputStream os = new FileOutputStream(pageFile);
-        PrintStream pos = new PrintStream(os);
+        PrintStream pos = new PrintStream(os, false, "utf-8");
 
         printHierarchy(page, pos);
 
@@ -70,7 +71,7 @@ public class HierarchyPrinter {
     }
 
     public static void printHierarchy(XmlVisioDocument document,
-            String outDirname) throws FileNotFoundException {
+            String outDirname) throws FileNotFoundException, UnsupportedEncodingException {
 
         File outDir = new File(outDirname);
 
index 4c7459518e8aa20a69d60ce35d9091e8e2f4c480..57957fa2988edc1d748868143c3674d1a2956df5 100644 (file)
@@ -1,3 +1,19 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
 package org.apache.poi.xdgf.extractor;
 
 import java.io.IOException;