]> source.dussan.org Git - poi.git/commitdiff
bug 58740: return unmodifiable list/map when exposing internal data structures
authorJaven O'Neal <onealj@apache.org>
Sun, 27 Dec 2015 23:17:33 +0000 (23:17 +0000)
committerJaven O'Neal <onealj@apache.org>
Sun, 27 Dec 2015 23:17:33 +0000 (23:17 +0000)
patch from Archie Cobbs

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721857 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java

index d413b64c519e94fc399d071530d9e2a8ff5c5ce4..3c40725ad6017a28e35b7232859e795b5758a512 100644 (file)
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -301,19 +302,19 @@ public class StylesTable extends POIXMLDocumentPart {
     }
 
     public List<XSSFCellBorder> getBorders(){
-        return borders;
+        return Collections.unmodifiableList(borders);
     }
 
     public List<XSSFCellFill> getFills(){
-        return fills;
+        return Collections.unmodifiableList(fills);
     }
 
     public List<XSSFFont> getFonts(){
-        return fonts;
+        return Collections.unmodifiableList(fonts);
     }
 
     public Map<Integer, String> getNumberFormats(){
-        return numberFormats;
+        return Collections.unmodifiableMap(numberFormats);
     }
 
     public int putFill(XSSFCellFill fill) {