diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-16 08:27:23 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-16 08:27:23 +0000 |
commit | 0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48 (patch) | |
tree | b7f6385f47dbeda7309986def1a4450c64499eb0 /src | |
parent | 3e70d75cfb84a6eb6ddb06d1028e636cf03914d1 (diff) | |
download | poi-0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48.tar.gz poi-0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48.zip |
Remove unnecessary type arguments (Java 8)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808516 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
530 files changed, 1373 insertions, 1374 deletions
diff --git a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java index b5bc875623..cfc064c120 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java @@ -433,7 +433,7 @@ public class CopyCompare /** Contains the directory paths that have already been created in the * output POI filesystem and maps them to their corresponding * {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */ - private final Map<String,DirectoryEntry> paths = new HashMap<String,DirectoryEntry>(); + private final Map<String,DirectoryEntry> paths = new HashMap<>(); diff --git a/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java b/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java index af0042e43a..6fa15f9dc1 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java @@ -323,7 +323,7 @@ public class WriteAuthorAndTitle /** Contains the directory paths that have already been created in the * output POI filesystem and maps them to their corresponding * {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */ - private final Map<String, DirectoryEntry> paths = new HashMap<String, DirectoryEntry>(); + private final Map<String, DirectoryEntry> paths = new HashMap<>(); diff --git a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java index 610d961741..75a6064512 100644 --- a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java +++ b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java @@ -76,7 +76,7 @@ public class XLS2CSVmra implements HSSFListener { /** So we known which sheet we're on */ private int sheetIndex = -1; private BoundSheetRecord[] orderedBSRs; - private List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>(); + private List<BoundSheetRecord> boundSheetRecords = new ArrayList<>(); // For handling formulas with string results private int nextRow; diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java index c568a6ed29..81733a3424 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java @@ -81,7 +81,7 @@ public class InCellLists { // whose items are neither bulleted or numbered - into that cell. row = sheet.createRow(1); cell = row.createCell(0); - ArrayList<String> listItems = new ArrayList<String>(); + ArrayList<String> listItems = new ArrayList<>(); listItems.add("List Item One."); listItems.add("List Item Two."); listItems.add("List Item Three."); @@ -125,8 +125,8 @@ public class InCellLists { // to preserve order. row = sheet.createRow(4); cell = row.createCell(0); - ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<MultiLevelListItem>(); - listItems = new ArrayList<String>(); + ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<>(); + listItems = new ArrayList<>(); listItems.add("ML List Item One - Sub Item One."); listItems.add("ML List Item One - Sub Item Two."); listItems.add("ML List Item One - Sub Item Three."); @@ -137,7 +137,7 @@ public class InCellLists { // item multiLevelListItems.add(new MultiLevelListItem("List Item Two.", null)); multiLevelListItems.add(new MultiLevelListItem("List Item Three.", null)); - listItems = new ArrayList<String>(); + listItems = new ArrayList<>(); listItems.add("ML List Item Four - Sub Item One."); listItems.add("ML List Item Four - Sub Item Two."); listItems.add("ML List Item Four - Sub Item Three."); diff --git a/src/examples/src/org/apache/poi/hssf/view/brush/PendingPaintings.java b/src/examples/src/org/apache/poi/hssf/view/brush/PendingPaintings.java index a8b3849dc5..dcbf8b35c3 100644 --- a/src/examples/src/org/apache/poi/hssf/view/brush/PendingPaintings.java +++ b/src/examples/src/org/apache/poi/hssf/view/brush/PendingPaintings.java @@ -89,7 +89,7 @@ public class PendingPaintings { * @param parent */ public PendingPaintings(JComponent parent) { - paintings = new ArrayList<Painting>(); + paintings = new ArrayList<>(); parent.putClientProperty(PENDING_PAINTINGS, this); } diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java b/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java index dbb759c9c5..a2a0339b51 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java @@ -46,7 +46,7 @@ public class ExtendableTreeCellRenderer implements TreeCellRenderer public ExtendableTreeCellRenderer() { - renderers = new HashMap<Class<?>,TreeCellRenderer>(); + renderers = new HashMap<>(); register(Object.class, new DefaultTreeCellRenderer() { @Override diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java index 2795be98f0..a7d978d234 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java @@ -96,7 +96,7 @@ public class TreeReaderListener implements POIFSReaderListener { this.filename = filename; this.rootNode = rootNode; - pathToNode = new HashMap<Object,MutableTreeNode>(15); // Should be a reasonable guess. + pathToNode = new HashMap<>(15); // Should be a reasonable guess. } diff --git a/src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java b/src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java index d263494ec6..5ff1b2f331 100644 --- a/src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java +++ b/src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java @@ -209,7 +209,7 @@ public class BusinessPlan { * create a library of cell styles */ private static Map<String, CellStyle> createStyles(Workbook wb){ - Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + Map<String, CellStyle> styles = new HashMap<>(); DataFormat df = wb.createDataFormat(); CellStyle style; diff --git a/src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java b/src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java index 4438f22c15..3cf0d2d36d 100644 --- a/src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java +++ b/src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java @@ -148,7 +148,7 @@ public class CalendarDemo { * cell styles used for formatting calendar sheets */ private static Map<String, CellStyle> createStyles(Workbook wb){ - Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + Map<String, CellStyle> styles = new HashMap<>(); short borderColor = IndexedColors.GREY_50_PERCENT.getIndex(); diff --git a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java index 645e798a0d..5c6fa9fa44 100644 --- a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java +++ b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java @@ -88,7 +88,7 @@ public class ExcelComparator { Cell cell; } - List<String> listOfDifferences = new ArrayList<String>(); + List<String> listOfDifferences = new ArrayList<>(); public static void main(String args[]) throws Exception { if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) { diff --git a/src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java b/src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java index d6375dc436..7dc92ee49b 100644 --- a/src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java +++ b/src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java @@ -150,7 +150,7 @@ public class LoanCalculator { * cell styles used for formatting calendar sheets */ private static Map<String, CellStyle> createStyles(Workbook wb){ - Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + Map<String, CellStyle> styles = new HashMap<>(); CellStyle style; Font titleFont = wb.createFont(); diff --git a/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java b/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java index 10c3a4a7dc..30a1dccb7f 100644 --- a/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java +++ b/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java @@ -153,7 +153,7 @@ public class SSPerformanceTest { } static Map<String, CellStyle> createStyles(Workbook wb) { - Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + Map<String, CellStyle> styles = new HashMap<>(); CellStyle style; Font headerFont = wb.createFont(); diff --git a/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java b/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java index 8ef20fe437..6ab8a29438 100644 --- a/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java +++ b/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java @@ -163,7 +163,7 @@ public class TimesheetDemo { * Create a library of cell styles */ private static Map<String, CellStyle> createStyles(Workbook wb){ - Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + Map<String, CellStyle> styles = new HashMap<>(); CellStyle style; Font titleFont = wb.createFont(); titleFont.setFontHeightInPoints((short)18); diff --git a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java index 1a9879f205..af486dbc97 100644 --- a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java +++ b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java @@ -409,7 +409,7 @@ public class ToCSV { Sheet sheet = null; Row row = null; int lastRowNum = 0; - this.csvData = new ArrayList<ArrayList<String>>(); + this.csvData = new ArrayList<>(); System.out.println("Converting files contents to CSV format."); @@ -526,7 +526,7 @@ public class ToCSV { private void rowToCSV(Row row) { Cell cell = null; int lastCellNum = 0; - ArrayList<String> csvLine = new ArrayList<String>(); + ArrayList<String> csvLine = new ArrayList<>(); // Check to ensure that a row was recovered from the sheet as it is // possible that one or more rows between other populated rows could be diff --git a/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java b/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java index 94f7cd1118..adb24eb676 100644 --- a/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java +++ b/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java @@ -57,13 +57,13 @@ public class CheckFunctionsSupported { CheckFunctionsSupported check = new CheckFunctionsSupported(wb); // Fetch all the problems - List<FormulaEvaluationProblems> problems = new ArrayList<CheckFunctionsSupported.FormulaEvaluationProblems>(); + List<FormulaEvaluationProblems> problems = new ArrayList<>(); for (int sn=0; sn<wb.getNumberOfSheets(); sn++) { problems.add(check.getEvaluationProblems(sn)); } // Produce an overall summary - Set<String> unsupportedFunctions = new TreeSet<String>(); + Set<String> unsupportedFunctions = new TreeSet<>(); for (FormulaEvaluationProblems p : problems) { unsupportedFunctions.addAll(p.unsupportedFunctions); } @@ -121,8 +121,8 @@ public class CheckFunctionsSupported { return getEvaluationProblems(workbook.getSheetAt(sheetIndex)); } public FormulaEvaluationProblems getEvaluationProblems(Sheet sheet) { - Set<String> unsupportedFunctions = new HashSet<String>(); - Map<CellReference,Exception> unevaluatableCells = new HashMap<CellReference, Exception>(); + Set<String> unsupportedFunctions = new HashSet<>(); + Map<CellReference,Exception> unevaluatableCells = new HashMap<>(); for (Row r : sheet) { for (Cell c : r) { diff --git a/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java b/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java index 51f7c03670..e94a679e47 100644 --- a/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java +++ b/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java @@ -59,7 +59,7 @@ public class SettingExternalFunction { return ErrorEval.NA; } }; - _functionsByName = new HashMap<String, FreeRefFunction>(); + _functionsByName = new HashMap<>(); _functionsByName.put("BDP", NA); _functionsByName.put("BDH", NA); _functionsByName.put("BDS", NA); diff --git a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java index 2a7fe69f2a..23a161830b 100644 --- a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java +++ b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java @@ -98,7 +98,7 @@ public class ToHtml { @SuppressWarnings({"unchecked"}) private static <K, V> Map<K, V> mapFor(Object... mapping) { - Map<K, V> map = new HashMap<K, V>(); + Map<K, V> map = new HashMap<>(); for (int i = 0; i < mapping.length; i += 2) { map.put((K) mapping[i], (V) mapping[i + 1]); } @@ -260,7 +260,7 @@ public class ToHtml { } // now add css for each used style - Set<CellStyle> seen = new HashSet<CellStyle>(); + Set<CellStyle> seen = new HashSet<>(); for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); Iterator<Row> rows = sheet.rowIterator(); diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java index 6e35e8cdbd..98773eaa56 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java @@ -96,7 +96,7 @@ public class FromHowTo { private String lastContents; private boolean nextIsString; private boolean inlineStr; - private final LruCache<Integer,String> lruCache = new LruCache<Integer,String>(50); + private final LruCache<Integer,String> lruCache = new LruCache<>(50); private static class LruCache<A,B> extends LinkedHashMap<A, B> { private final int maxEntries; diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/AligningCells.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/AligningCells.java index 0bb002fb3c..05e653ee39 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/AligningCells.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/AligningCells.java @@ -131,7 +131,7 @@ public class AligningCells { // You can add multiple spans for one row Object span = start_column + ":" + end_column; - List<Object> spanList = new ArrayList<Object>(); + List<Object> spanList = new ArrayList<>(); spanList.add(span); //add spns to the row diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java index 66bb597623..69dc765033 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java @@ -116,7 +116,7 @@ public class BigGridDemo { * Create a library of cell styles. */ private static Map<String, XSSFCellStyle> createStyles(XSSFWorkbook wb){ - Map<String, XSSFCellStyle> styles = new HashMap<String, XSSFCellStyle>(); + Map<String, XSSFCellStyle> styles = new HashMap<>(); XSSFDataFormat fmt = wb.createDataFormat(); XSSFCellStyle style1 = wb.createCellStyle(); diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/CalendarDemo.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/CalendarDemo.java index 48e3fd122d..99c3c49758 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/CalendarDemo.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/CalendarDemo.java @@ -135,7 +135,7 @@ public class CalendarDemo { * cell styles used for formatting calendar sheets */ private static Map<String, XSSFCellStyle> createStyles(XSSFWorkbook wb){ - Map<String, XSSFCellStyle> styles = new HashMap<String, XSSFCellStyle>(); + Map<String, XSSFCellStyle> styles = new HashMap<>(); XSSFCellStyle style; XSSFFont titleFont = wb.createFont(); diff --git a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java index 625d1a4024..16f2e5ff8e 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java @@ -47,8 +47,8 @@ public class ExcelAntTask extends Task { private LinkedList<ExcelAntUserDefinedFunction> functions ; public ExcelAntTask() { - tests = new LinkedList<ExcelAntTest>() ; - functions = new LinkedList<ExcelAntUserDefinedFunction>() ; + tests = new LinkedList<>() ; + functions = new LinkedList<>() ; } public void addPrecision( ExcelAntPrecision prec ) { diff --git a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java index fc35eba08a..586f855667 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java @@ -56,9 +56,9 @@ public class ExcelAntTest extends Task{ public ExcelAntTest() { - evaluators = new LinkedList<ExcelAntEvaluateCell>(); - failureMessages = new LinkedList<String>(); - testTasks = new LinkedList<Task>(); + evaluators = new LinkedList<>(); + failureMessages = new LinkedList<>(); + testTasks = new LinkedList<>(); } public void setPrecision( double precision ) { diff --git a/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java b/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java index 5c3463d57b..fa98628eee 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java @@ -59,7 +59,7 @@ public class ExcelAntWorkbookUtil extends Typedef { private Workbook workbook; - private final Map<String, FreeRefFunction> xlsMacroList = new HashMap<String, FreeRefFunction>(); + private final Map<String, FreeRefFunction> xlsMacroList = new HashMap<>(); /** * Constructs an instance using a String that contains the fully qualified @@ -215,7 +215,7 @@ public class ExcelAntWorkbookUtil extends Typedef { * @return */ public List<String> getSheets() { - ArrayList<String> sheets = new ArrayList<String>(); + ArrayList<String> sheets = new ArrayList<>(); int sheetCount = workbook.getNumberOfSheets(); diff --git a/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java b/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java index 683ac46368..113f0390f7 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java @@ -46,7 +46,7 @@ public final class ExcelAntWorkbookUtilFactory { */ public static ExcelAntWorkbookUtil getInstance(String fileName) { if(workbookUtilMap == null) { - workbookUtilMap = new HashMap<String, ExcelAntWorkbookUtil>(); + workbookUtilMap = new HashMap<>(); } if(workbookUtilMap.containsKey(fileName)) { diff --git a/src/integrationtest/org/apache/poi/TestAllFiles.java b/src/integrationtest/org/apache/poi/TestAllFiles.java index e3469da9cb..37aa464ee1 100644 --- a/src/integrationtest/org/apache/poi/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/TestAllFiles.java @@ -97,7 +97,7 @@ public class TestAllFiles { // map file extensions to the actual mappers - static final Map<String, FileHandler> HANDLERS = new HashMap<String, FileHandler>(); + static final Map<String, FileHandler> HANDLERS = new HashMap<>(); static { // Excel HANDLERS.put(".xls", new HSSFFileHandler()); @@ -210,7 +210,7 @@ public class TestAllFiles { HANDLERS.put("spreadsheet/BigSSTRecordCR", new NullFileHandler()); HANDLERS.put("spreadsheet/test_properties1", new NullFileHandler()); - Map<String,String> passmap = new HashMap<String,String>(); + Map<String,String> passmap = new HashMap<>(); passmap.put("slideshow/Password_Protected-hello.ppt", "hello"); passmap.put("slideshow/Password_Protected-56-hello.ppt", "hello"); passmap.put("slideshow/Password_Protected-np-hello.ppt", "hello"); @@ -237,7 +237,7 @@ public class TestAllFiles { return Collections.unmodifiableSet(hashSet(a)); } private static Set<String> hashSet(String... a) { - return new HashSet<String>(Arrays.asList(a)); + return new HashSet<>(Arrays.asList(a)); } // Old Word Documents where we can at least extract some text @@ -345,7 +345,7 @@ public class TestAllFiles { System.out.println("Handling " + scanner.getIncludedFiles().length + " files"); - List<Object[]> files = new ArrayList<Object[]>(); + List<Object[]> files = new ArrayList<>(); for(String file : scanner.getIncludedFiles()) { file = file.replace('\\', '/'); // ... failures/handlers lookup doesn't work on windows otherwise if (IGNORED.contains(file)) { diff --git a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java index c4e453e580..ad2150c7f2 100644 --- a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java @@ -38,7 +38,7 @@ import org.apache.poi.util.IOUtils; import org.apache.xmlbeans.XmlException; public abstract class AbstractFileHandler implements FileHandler { - public static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<String>(); + public static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<>(); static { // password protected files without password // ... currently none ... diff --git a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java index d726e2647f..2bad961bdb 100644 --- a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java @@ -63,7 +63,7 @@ public class HPSFFileHandler extends POIFSFileHandler { private static final Set<String> unmodifiableHashSet(String... a) { - return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(a))); + return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(a))); } diff --git a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java index 0f6f65d0b7..871311f114 100644 --- a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java @@ -54,7 +54,7 @@ public class HSSFFileHandler extends SpreadsheetHandler { // TODO: still fails on some records... RecordsStresser.handleWorkbook(wb); } - private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<String>(); + private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<>(); static { // encrypted EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/35897-type4.xls"); diff --git a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java index 7ba697f231..b8bb0b57b0 100644 --- a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java @@ -157,7 +157,7 @@ public class XSSFFileHandler extends SpreadsheetHandler { } } - private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<String>(); + private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<>(); static { // expected sheet-id not found // EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/52348.xlsx"); diff --git a/src/java/org/apache/poi/common/usermodel/HyperlinkType.java b/src/java/org/apache/poi/common/usermodel/HyperlinkType.java index 41de80062a..af86c3e824 100644 --- a/src/java/org/apache/poi/common/usermodel/HyperlinkType.java +++ b/src/java/org/apache/poi/common/usermodel/HyperlinkType.java @@ -70,7 +70,7 @@ public enum HyperlinkType { this.code = code; } - private static final Map<Integer, HyperlinkType> map = new HashMap<Integer, HyperlinkType>(); + private static final Map<Integer, HyperlinkType> map = new HashMap<>(); static { for (HyperlinkType type : values()) { map.put(type.getCode(), type); diff --git a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java index 671f84dff3..191b4e0041 100644 --- a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java +++ b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java @@ -66,7 +66,7 @@ public enum FontGroup { private static NavigableMap<Integer,Range> UCS_RANGES; static { - UCS_RANGES = new TreeMap<Integer,Range>(); + UCS_RANGES = new TreeMap<>(); UCS_RANGES.put(0x0000, new Range(0x007F, LATIN)); UCS_RANGES.put(0x0080, new Range(0x00A6, LATIN)); UCS_RANGES.put(0x00A9, new Range(0x00AF, LATIN)); @@ -111,7 +111,7 @@ public enum FontGroup { * @return the FontGroup */ public static List<FontGroupRange> getFontGroupRanges(String runText) { - List<FontGroupRange> ttrList = new ArrayList<FontGroupRange>(); + List<FontGroupRange> ttrList = new ArrayList<>(); FontGroupRange ttrLast = null; final int rlen = (runText != null) ? runText.length() : 0; for(int cp, i = 0, charCount; i < rlen; i += charCount) { diff --git a/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java b/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java index fa6851c5a0..6009b00522 100644 --- a/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java +++ b/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java @@ -30,7 +30,7 @@ import org.apache.poi.util.LittleEndian; */ public abstract class AbstractEscherOptRecord extends EscherRecord { - private List<EscherProperty> properties = new ArrayList<EscherProperty>(); + private List<EscherProperty> properties = new ArrayList<>(); /** * Add a property to this record. @@ -176,7 +176,7 @@ public abstract class AbstractEscherOptRecord extends EscherRecord @Override protected Object[][] getAttributeMap() { - List<Object> attrList = new ArrayList<Object>(properties.size()*2+2); + List<Object> attrList = new ArrayList<>(properties.size() * 2 + 2); attrList.add("properties"); attrList.add(properties.size()); for ( EscherProperty property : properties ) { diff --git a/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java b/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java index 4342708bff..954163cb60 100644 --- a/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java +++ b/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java @@ -108,7 +108,7 @@ public class DefaultEscherRecordFactory implements EscherRecordFactory { * @return The map containing the id/constructor pairs. */ protected static Map<Short, Constructor<? extends EscherRecord>> recordsToMap(Class<?>[] recClasses) { - Map<Short, Constructor<? extends EscherRecord>> result = new HashMap<Short, Constructor<? extends EscherRecord>>(); + Map<Short, Constructor<? extends EscherRecord>> result = new HashMap<>(); final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0]; for (Class<?> recClass : recClasses) { diff --git a/src/java/org/apache/poi/ddf/EscherContainerRecord.java b/src/java/org/apache/poi/ddf/EscherContainerRecord.java index 82ae37481c..d7889015d5 100644 --- a/src/java/org/apache/poi/ddf/EscherContainerRecord.java +++ b/src/java/org/apache/poi/ddf/EscherContainerRecord.java @@ -68,7 +68,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl */ private int _remainingLength; - private final List<EscherRecord> _childRecords = new ArrayList<EscherRecord>(); + private final List<EscherRecord> _childRecords = new ArrayList<>(); @Override public int fillFields(byte[] data, int pOffset, EscherRecordFactory recordFactory) { @@ -148,7 +148,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl */ @Override public List<EscherRecord> getChildRecords() { - return new ArrayList<EscherRecord>(_childRecords); + return new ArrayList<>(_childRecords); } /** @@ -190,7 +190,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl * @return EscherContainer children */ public List<EscherContainerRecord> getChildContainers() { - List<EscherContainerRecord> containers = new ArrayList<EscherContainerRecord>(); + List<EscherContainerRecord> containers = new ArrayList<>(); for (EscherRecord r : this) { if(r instanceof EscherContainerRecord) { containers.add((EscherContainerRecord) r); @@ -284,7 +284,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl @Override protected Object[][] getAttributeMap() { - List<Object> chList = new ArrayList<Object>(_childRecords.size()*2+2); + List<Object> chList = new ArrayList<>(_childRecords.size() * 2 + 2); chList.add("children"); chList.add(_childRecords.size()); int count = 0; diff --git a/src/java/org/apache/poi/ddf/EscherDggRecord.java b/src/java/org/apache/poi/ddf/EscherDggRecord.java index 7ab5ea9d43..46e1aa8fcf 100644 --- a/src/java/org/apache/poi/ddf/EscherDggRecord.java +++ b/src/java/org/apache/poi/ddf/EscherDggRecord.java @@ -39,7 +39,7 @@ public final class EscherDggRecord extends EscherRecord { // private int field_2_numIdClusters; private int field_3_numShapesSaved; private int field_4_drawingsSaved; - private final List<FileIdCluster> field_5_fileIdClusters = new ArrayList<FileIdCluster>(); + private final List<FileIdCluster> field_5_fileIdClusters = new ArrayList<>(); private int maxDgId; public static class FileIdCluster { @@ -329,7 +329,7 @@ public final class EscherDggRecord extends EscherRecord { @Override protected Object[][] getAttributeMap() { - List<Object> fldIds = new ArrayList<Object>(); + List<Object> fldIds = new ArrayList<>(); fldIds.add("FileId Clusters"); fldIds.add(field_5_fileIdClusters.size()); for (FileIdCluster fic : field_5_fileIdClusters) { diff --git a/src/java/org/apache/poi/ddf/EscherProperties.java b/src/java/org/apache/poi/ddf/EscherProperties.java index 955db365fa..acff6241c2 100644 --- a/src/java/org/apache/poi/ddf/EscherProperties.java +++ b/src/java/org/apache/poi/ddf/EscherProperties.java @@ -334,7 +334,7 @@ public final class EscherProperties { private static final Map<Short, EscherPropertyMetaData> properties = initProps(); private static Map<Short, EscherPropertyMetaData> initProps() { - Map<Short, EscherPropertyMetaData> m = new HashMap<Short, EscherPropertyMetaData>(); + Map<Short, EscherPropertyMetaData> m = new HashMap<>(); addProp(m, TRANSFORM__ROTATION, "transform.rotation"); addProp(m, PROTECTION__LOCKROTATION, "protection.lockrotation"); addProp(m, PROTECTION__LOCKASPECTRATIO, "protection.lockaspectratio"); diff --git a/src/java/org/apache/poi/ddf/EscherPropertyFactory.java b/src/java/org/apache/poi/ddf/EscherPropertyFactory.java index 642c3056d1..3b05034caf 100644 --- a/src/java/org/apache/poi/ddf/EscherPropertyFactory.java +++ b/src/java/org/apache/poi/ddf/EscherPropertyFactory.java @@ -35,7 +35,7 @@ public final class EscherPropertyFactory { * @return The new properties */ public List<EscherProperty> createProperties(byte[] data, int offset, short numProperties) { - List<EscherProperty> results = new ArrayList<EscherProperty>(); + List<EscherProperty> results = new ArrayList<>(); int pos = offset; diff --git a/src/java/org/apache/poi/ddf/EscherTextboxRecord.java b/src/java/org/apache/poi/ddf/EscherTextboxRecord.java index f869d4a9e7..07527cb960 100644 --- a/src/java/org/apache/poi/ddf/EscherTextboxRecord.java +++ b/src/java/org/apache/poi/ddf/EscherTextboxRecord.java @@ -135,7 +135,7 @@ public final class EscherTextboxRecord extends EscherRecord implements Cloneable @Override protected Object[][] getAttributeMap() { int numCh = getChildRecords().size(); - List<Object> chLst = new ArrayList<Object>(numCh*2+2); + List<Object> chLst = new ArrayList<>(numCh * 2 + 2); chLst.add("children"); chLst.add(numCh); for (EscherRecord er : getChildRecords()) { diff --git a/src/java/org/apache/poi/ddf/UnknownEscherRecord.java b/src/java/org/apache/poi/ddf/UnknownEscherRecord.java index 55689e2a42..f722f87b65 100644 --- a/src/java/org/apache/poi/ddf/UnknownEscherRecord.java +++ b/src/java/org/apache/poi/ddf/UnknownEscherRecord.java @@ -35,7 +35,7 @@ public final class UnknownEscherRecord extends EscherRecord implements Cloneable private List<EscherRecord> _childRecords; public UnknownEscherRecord() { - _childRecords = new ArrayList<EscherRecord>(); + _childRecords = new ArrayList<>(); } @Override @@ -139,7 +139,7 @@ public final class UnknownEscherRecord extends EscherRecord implements Cloneable @Override protected Object[][] getAttributeMap() { int numCh = getChildRecords().size(); - List<Object> chLst = new ArrayList<Object>(numCh*2+2); + List<Object> chLst = new ArrayList<>(numCh * 2 + 2); chLst.add("children"); chLst.add(numCh); for (EscherRecord er : _childRecords) { diff --git a/src/java/org/apache/poi/extractor/OLE2ExtractorFactory.java b/src/java/org/apache/poi/extractor/OLE2ExtractorFactory.java index 6c96181e5f..5f895dc375 100644 --- a/src/java/org/apache/poi/extractor/OLE2ExtractorFactory.java +++ b/src/java/org/apache/poi/extractor/OLE2ExtractorFactory.java @@ -214,9 +214,9 @@ public class OLE2ExtractorFactory { throws IOException { // All the embedded directories we spotted - List<Entry> dirs = new ArrayList<Entry>(); + List<Entry> dirs = new ArrayList<>(); // For anything else not directly held in as a POIFS directory - List<InputStream> nonPOIFS = new ArrayList<InputStream>(); + List<InputStream> nonPOIFS = new ArrayList<>(); // Find all the embedded directories DirectoryEntry root = ext.getRoot(); @@ -250,7 +250,7 @@ public class OLE2ExtractorFactory { return new POITextExtractor[0]; } - ArrayList<POITextExtractor> e = new ArrayList<POITextExtractor>(); + ArrayList<POITextExtractor> e = new ArrayList<>(); for (Entry dir : dirs) { e.add(createExtractor( (DirectoryNode) dir diff --git a/src/java/org/apache/poi/hpsf/CustomProperties.java b/src/java/org/apache/poi/hpsf/CustomProperties.java index 8652c3a446..295251b8c2 100644 --- a/src/java/org/apache/poi/hpsf/CustomProperties.java +++ b/src/java/org/apache/poi/hpsf/CustomProperties.java @@ -70,12 +70,12 @@ public class CustomProperties implements Map<String,Object> { /** * The custom properties */ - private final HashMap<Long,CustomProperty> props = new HashMap<Long,CustomProperty>(); + private final HashMap<Long,CustomProperty> props = new HashMap<>(); /** * Maps property IDs to property names and vice versa. */ - private final TreeBidiMap<Long,String> dictionary = new TreeBidiMap<Long,String>(); + private final TreeBidiMap<Long,String> dictionary = new TreeBidiMap<>(); /** * Tells whether this object is pure or not. @@ -219,7 +219,7 @@ public class CustomProperties implements Map<String,Object> { * @return the list of properties */ public List<CustomProperty> properties() { - List<CustomProperty> list = new ArrayList<CustomProperty>(props.size()); + List<CustomProperty> list = new ArrayList<>(props.size()); for (Long l : dictionary.keySet()) { list.add(props.get(l)); } @@ -231,7 +231,7 @@ public class CustomProperties implements Map<String,Object> { */ @Override public Collection<Object> values() { - List<Object> list = new ArrayList<Object>(props.size()); + List<Object> list = new ArrayList<>(props.size()); for (Long l : dictionary.keySet()) { list.add(props.get(l).getValue()); } @@ -240,7 +240,7 @@ public class CustomProperties implements Map<String,Object> { @Override public Set<Entry<String, Object>> entrySet() { - Map<String,Object> set = new LinkedHashMap<String,Object>(props.size()); + Map<String,Object> set = new LinkedHashMap<>(props.size()); for (Entry<Long,String> se : dictionary.entrySet()) { set.put(se.getValue(), props.get(se.getKey()).getValue()); } diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java index 7d86a2b0f3..f10dcc938f 100644 --- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java @@ -825,7 +825,7 @@ public class DocumentSummaryInformation extends PropertySet { throw new HPSFRuntimeException("Illegal internal format of Document SummaryInformation stream: second section is missing."); } - List<Section> l = new LinkedList<Section>(getSections()); + List<Section> l = new LinkedList<>(getSections()); clearSections(); int idx = 0; for (Section s : l) { diff --git a/src/java/org/apache/poi/hpsf/HPSFPropertiesOnlyDocument.java b/src/java/org/apache/poi/hpsf/HPSFPropertiesOnlyDocument.java index 1097b71e48..3f6731c51d 100644 --- a/src/java/org/apache/poi/hpsf/HPSFPropertiesOnlyDocument.java +++ b/src/java/org/apache/poi/hpsf/HPSFPropertiesOnlyDocument.java @@ -83,7 +83,7 @@ public class HPSFPropertiesOnlyDocument extends POIDocument { private void write(NPOIFSFileSystem fs) throws IOException { // For tracking what we've written out, so far - List<String> excepts = new ArrayList<String>(2); + List<String> excepts = new ArrayList<>(2); // Write out our HPFS properties, with any changes writeProperties(fs, excepts); diff --git a/src/java/org/apache/poi/hpsf/PropertySet.java b/src/java/org/apache/poi/hpsf/PropertySet.java index dd6d7e737f..0f5fbdbf6c 100644 --- a/src/java/org/apache/poi/hpsf/PropertySet.java +++ b/src/java/org/apache/poi/hpsf/PropertySet.java @@ -134,7 +134,7 @@ public class PropertySet { /** * The sections in this {@link PropertySet}. */ - private final List<Section> sections = new ArrayList<Section>(); + private final List<Section> sections = new ArrayList<>(); /** diff --git a/src/java/org/apache/poi/hpsf/Section.java b/src/java/org/apache/poi/hpsf/Section.java index 4f62eab80c..8ffa541e4d 100644 --- a/src/java/org/apache/poi/hpsf/Section.java +++ b/src/java/org/apache/poi/hpsf/Section.java @@ -71,7 +71,7 @@ public class Section { /** * This section's properties. */ - private final Map<Long,Property> properties = new LinkedHashMap<Long,Property>(); + private final Map<Long,Property> properties = new LinkedHashMap<>(); /** * This member is {@code true} if the last call to {@link @@ -175,7 +175,7 @@ public class Section { * seconds pass reads the other properties. */ /* Pass 1: Read the property list. */ - final TreeBidiMap<Long,Long> offset2Id = new TreeBidiMap<Long,Long>(); + final TreeBidiMap<Long,Long> offset2Id = new TreeBidiMap<>(); for (int i = 0; i < propertyCount; i++) { /* Read the property ID. */ long id = (int)leis.readUInt(); @@ -662,7 +662,7 @@ public class Section { /* Compare all properties except the dictionary (id 0) and * the codepage (id 1 / ignored) as they must be handled specially. */ - Set<Long> propIds = new HashSet<Long>(properties.keySet()); + Set<Long> propIds = new HashSet<>(properties.keySet()); propIds.addAll(s.properties.keySet()); propIds.remove(0L); propIds.remove(1L); @@ -800,7 +800,7 @@ public class Section { */ private boolean readDictionary(LittleEndianByteArrayInputStream leis, final int length, final int codepage) throws UnsupportedEncodingException { - Map<Long,String> dic = new HashMap<Long,String>(); + Map<Long,String> dic = new HashMap<>(); /* * Read the number of dictionary entries. @@ -919,7 +919,7 @@ public class Section { public void setDictionary(final Map<Long,String> dictionary) throws IllegalPropertySetDataException { if (dictionary != null) { if (this.dictionary == null) { - this.dictionary = new TreeMap<Long,String>(); + this.dictionary = new TreeMap<>(); } this.dictionary.putAll(dictionary); diff --git a/src/java/org/apache/poi/hpsf/Variant.java b/src/java/org/apache/poi/hpsf/Variant.java index ba67252d63..32fc8aba89 100644 --- a/src/java/org/apache/poi/hpsf/Variant.java +++ b/src/java/org/apache/poi/hpsf/Variant.java @@ -387,8 +387,8 @@ public class Variant /* Initialize the number-to-name and number-to-length map: */ static { - Map<Long,String> number2Name = new HashMap<Long,String>(NUMBER_TO_NAME_LIST.length, 1.0F); - Map<Long,Integer> number2Len = new HashMap<Long,Integer>(NUMBER_TO_NAME_LIST.length, 1.0F); + Map<Long,String> number2Name = new HashMap<>(NUMBER_TO_NAME_LIST.length, 1.0F); + Map<Long,Integer> number2Len = new HashMap<>(NUMBER_TO_NAME_LIST.length, 1.0F); for (Object[] nn : NUMBER_TO_NAME_LIST) { number2Name.put((Long)nn[0], (String)nn[1]); diff --git a/src/java/org/apache/poi/hpsf/VariantSupport.java b/src/java/org/apache/poi/hpsf/VariantSupport.java index 373d5df392..cf5cadb0b8 100644 --- a/src/java/org/apache/poi/hpsf/VariantSupport.java +++ b/src/java/org/apache/poi/hpsf/VariantSupport.java @@ -105,7 +105,7 @@ public class VariantSupport extends Variant { if (isLogUnsupportedTypes()) { if (unsupportedMessage == null) { - unsupportedMessage = new LinkedList<Long>(); + unsupportedMessage = new LinkedList<>(); } Long vt = Long.valueOf(ex.getVariantType()); if (!unsupportedMessage.contains(vt)) diff --git a/src/java/org/apache/poi/hpsf/Vector.java b/src/java/org/apache/poi/hpsf/Vector.java index 80c8565631..889c378f0b 100644 --- a/src/java/org/apache/poi/hpsf/Vector.java +++ b/src/java/org/apache/poi/hpsf/Vector.java @@ -47,7 +47,7 @@ class Vector { //of allocating array of length "length". //If the length is corrupted and crazily big but < Integer.MAX_VALUE, //this will trigger a RuntimeException "Buffer overrun" in lei.checkPosition - List<TypedPropertyValue> values = new ArrayList<TypedPropertyValue>(); + List<TypedPropertyValue> values = new ArrayList<>(); int paddedType = (_type == Variant.VT_VARIANT) ? 0 : _type; for ( int i = 0; i < length; i++ ) { TypedPropertyValue value = new TypedPropertyValue(paddedType, null); diff --git a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java index b3aaa87a3c..c103a40678 100644 --- a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java +++ b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java @@ -420,7 +420,7 @@ public class PropertyIDMap implements Map<Long,String> { * @param map The instance to be created is backed by this map. */ private PropertyIDMap(Object[][] idValues) { - Map<Long,String> m = new HashMap<Long,String>(idValues.length); + Map<Long,String> m = new HashMap<>(idValues.length); for (Object[] idValue : idValues) { m.put((Long)idValue[0], (String)idValue[1]); } diff --git a/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java index d8e660f31c..07fb6af4ea 100644 --- a/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java +++ b/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java @@ -45,7 +45,7 @@ public class SectionIDMap { * The default section ID map. It maps section format IDs to {@link PropertyIDMap PropertyIDMaps} */ private static ThreadLocal<Map<ClassID,PropertyIDMap>> defaultMap = - new ThreadLocal<Map<ClassID,PropertyIDMap>>(); + new ThreadLocal<>(); /** * <p>The SummaryInformation's section's format ID.</p> @@ -79,7 +79,7 @@ public class SectionIDMap { public static SectionIDMap getInstance() { Map<ClassID,PropertyIDMap> m = defaultMap.get(); if (m == null) { - m = new HashMap<ClassID,PropertyIDMap>(); + m = new HashMap<>(); m.put(SUMMARY_INFORMATION_ID, PropertyIDMap.getSummaryInformationProperties()); m.put(DOCUMENT_SUMMARY_INFORMATION_ID[0], PropertyIDMap.getDocumentSummaryInformationProperties()); defaultMap.set(m); diff --git a/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java b/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java index 9af5104430..0a9f78b0c3 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java +++ b/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java @@ -57,7 +57,7 @@ public class BiffDrawingToXml { } private static List<Integer> getIndexesByName(String[] params, HSSFWorkbook workbook) { - List<Integer> list = new ArrayList<Integer>(); + List<Integer> list = new ArrayList<>(); int pos = getAttributeIndex(SHEET_NAME_PARAM, params); if (-1 != pos) { if (pos >= params.length) { @@ -74,7 +74,7 @@ public class BiffDrawingToXml { } private static List<Integer> getIndexesByIdArray(String[] params) { - List<Integer> list = new ArrayList<Integer>(); + List<Integer> list = new ArrayList<>(); int pos = getAttributeIndex(SHEET_INDEXES_PARAM, params); if (-1 != pos) { if (pos >= params.length) { @@ -90,7 +90,7 @@ public class BiffDrawingToXml { } private static List<Integer> getSheetsIndexes(String[] params, HSSFWorkbook workbook) { - List<Integer> list = new ArrayList<Integer>(); + List<Integer> list = new ArrayList<>(); list.addAll(getIndexesByIdArray(params)); list.addAll(getIndexesByName(params, workbook)); if (0 == list.size()) { diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java index e7671e3f84..09b57dedb8 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java +++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java @@ -76,7 +76,7 @@ public final class BiffViewer { */ public static Record[] createRecords(InputStream is, PrintWriter ps, BiffRecordListener recListener, boolean dumpInterpretedRecords) throws org.apache.poi.util.RecordFormatException { - List<Record> temp = new ArrayList<Record>(); + List<Record> temp = new ArrayList<>(); RecordInputStream recStream = new RecordInputStream(is); while (true) { @@ -456,7 +456,7 @@ public final class BiffViewer { _hexDumpWriter = hexDumpWriter; _zeroAlignEachRecord = zeroAlignEachRecord; _noHeader = noHeader; - _headers = new ArrayList<String>(); + _headers = new ArrayList<>(); } @Override @@ -480,7 +480,7 @@ public final class BiffViewer { } public List<String> getRecentHeaders() { List<String> result = _headers; - _headers = new ArrayList<String>(); + _headers = new ArrayList<>(); return result; } private static String formatRecordDetails(int globalOffset, int sid, int size, int recordCounter) { diff --git a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java index ed0f8f2469..f55189ea7d 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java @@ -65,7 +65,7 @@ public class EventWorkbookBuilder { */ public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst) { - List<Record> wbRecords = new ArrayList<Record>(); + List<Record> wbRecords = new ArrayList<>(); // Core Workbook records go first if(bounds != null) { @@ -114,8 +114,8 @@ public class EventWorkbookBuilder { */ public static class SheetRecordCollectingListener implements HSSFListener { private final HSSFListener childListener; - private final List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>(); - private final List<ExternSheetRecord> externSheetRecords = new ArrayList<ExternSheetRecord>(); + private final List<BoundSheetRecord> boundSheetRecords = new ArrayList<>(); + private final List<ExternSheetRecord> externSheetRecords = new ArrayList<>(); private SSTRecord sstRecord; public SheetRecordCollectingListener(HSSFListener childListener) { diff --git a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java index de9814e3a2..3fef4d1e7e 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java @@ -45,8 +45,8 @@ public class FormatTrackingHSSFListener implements HSSFListener { private final HSSFListener _childListener; private final HSSFDataFormatter _formatter; private final NumberFormat _defaultFormat; - private final Map<Integer, FormatRecord> _customFormatRecords = new HashMap<Integer, FormatRecord>(); - private final List<ExtendedFormatRecord> _xfRecords = new ArrayList<ExtendedFormatRecord>(); + private final Map<Integer, FormatRecord> _customFormatRecords = new HashMap<>(); + private final List<ExtendedFormatRecord> _xfRecords = new ArrayList<>(); /** * Creates a format tracking wrapper around the given listener, using diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java index 64c11aa65e..62c656ed08 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java @@ -38,7 +38,7 @@ public class HSSFRequest { /** Creates a new instance of HSSFRequest */ public HSSFRequest() { - _records = new HashMap<Short, List<HSSFListener>>(50); // most folks won't listen for too many of these + _records = new HashMap<>(50); // most folks won't listen for too many of these } /** @@ -58,7 +58,7 @@ public class HSSFRequest { List<HSSFListener> list = _records.get(Short.valueOf(sid)); if (list == null) { - list = new ArrayList<HSSFListener>(1); // probably most people will use one listener + list = new ArrayList<>(1); // probably most people will use one listener _records.put(Short.valueOf(sid), list); } list.add(lsnr); diff --git a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java index 1b6b93434b..f83cc9c47c 100644 --- a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java +++ b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java @@ -171,7 +171,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or private int nextRow = -1; public TextListener() { - sheetNames = new ArrayList<String>(); + sheetNames = new ArrayList<>(); } public void processRecord(Record record) { String thisText = null; diff --git a/src/java/org/apache/poi/hssf/model/DrawingManager2.java b/src/java/org/apache/poi/hssf/model/DrawingManager2.java index f8a66f71a4..48356442bb 100644 --- a/src/java/org/apache/poi/hssf/model/DrawingManager2.java +++ b/src/java/org/apache/poi/hssf/model/DrawingManager2.java @@ -30,7 +30,7 @@ import org.apache.poi.util.Removal; */ public class DrawingManager2 { private final EscherDggRecord dgg; - private final List<EscherDgRecord> drawingGroups = new ArrayList<EscherDgRecord>(); + private final List<EscherDgRecord> drawingGroups = new ArrayList<>(); public DrawingManager2( EscherDggRecord dgg ) { diff --git a/src/java/org/apache/poi/hssf/model/InternalSheet.java b/src/java/org/apache/poi/hssf/model/InternalSheet.java index be21dff695..650b4de270 100644 --- a/src/java/org/apache/poi/hssf/model/InternalSheet.java +++ b/src/java/org/apache/poi/hssf/model/InternalSheet.java @@ -125,7 +125,7 @@ public final class InternalSheet { _mergedCellsTable = new MergedCellsTable(); RowRecordsAggregate rra = null; - List<RecordBase> records = new ArrayList<RecordBase>(128); + List<RecordBase> records = new ArrayList<>(128); _records = records; // needed here due to calls to findFirstRecordLocBySid before we're done int dimsloc = -1; @@ -378,7 +378,7 @@ public final class InternalSheet { * @return the cloned sheet */ public InternalSheet cloneSheet() { - List<Record> clonedRecords = new ArrayList<Record>(_records.size()); + List<Record> clonedRecords = new ArrayList<>(_records.size()); for (int i = 0; i < _records.size(); i++) { RecordBase rb = _records.get(i); if (rb instanceof RecordAggregate) { @@ -413,7 +413,7 @@ public final class InternalSheet { } private InternalSheet() { _mergedCellsTable = new MergedCellsTable(); - List<RecordBase> records = new ArrayList<RecordBase>(32); + List<RecordBase> records = new ArrayList<>(32); if (log.check( POILogger.DEBUG )) log.log(POILogger.DEBUG, "Sheet createsheet from scratch called"); @@ -1662,7 +1662,7 @@ public final class InternalSheet { * @return never <code>null</code>, typically empty array */ public NoteRecord[] getNoteRecords() { - List<NoteRecord> temp = new ArrayList<NoteRecord>(); + List<NoteRecord> temp = new ArrayList<>(); for(int i=_records.size()-1; i>=0; i--) { RecordBase rec = _records.get(i); if (rec instanceof NoteRecord) { diff --git a/src/java/org/apache/poi/hssf/model/InternalWorkbook.java b/src/java/org/apache/poi/hssf/model/InternalWorkbook.java index 72aa94696c..44c5fb009d 100644 --- a/src/java/org/apache/poi/hssf/model/InternalWorkbook.java +++ b/src/java/org/apache/poi/hssf/model/InternalWorkbook.java @@ -197,15 +197,15 @@ public final class InternalWorkbook { private InternalWorkbook() { records = new WorkbookRecordList(); - boundsheets = new ArrayList<BoundSheetRecord>(); - formats = new ArrayList<FormatRecord>(); - hyperlinks = new ArrayList<HyperlinkRecord>(); + boundsheets = new ArrayList<>(); + formats = new ArrayList<>(); + hyperlinks = new ArrayList<>(); numxfs = 0; numfonts = 0; maxformatid = -1; uses1904datewindowing = false; - escherBSERecords = new ArrayList<EscherBSERecord>(); - commentRecords = new LinkedHashMap<String, NameCommentRecord>(); + escherBSERecords = new ArrayList<>(); + commentRecords = new LinkedHashMap<>(); } /** @@ -223,7 +223,7 @@ public final class InternalWorkbook { public static InternalWorkbook createWorkbook(List<Record> recs) { LOG.log(DEBUG, "Workbook (readfile) created with reclen=", recs.size()); InternalWorkbook retval = new InternalWorkbook(); - List<Record> records = new ArrayList<Record>(recs.size() / 3); + List<Record> records = new ArrayList<>(recs.size() / 3); retval.records.setRecords(records); boolean eofPassed = false; @@ -369,7 +369,7 @@ public final class InternalWorkbook { LOG.log( DEBUG, "creating new workbook from scratch" ); InternalWorkbook retval = new InternalWorkbook(); - List<Record> records = new ArrayList<Record>( 30 ); + List<Record> records = new ArrayList<>(30); retval.records.setRecords(records); List<FormatRecord> formats = retval.formats; diff --git a/src/java/org/apache/poi/hssf/model/LinkTable.java b/src/java/org/apache/poi/hssf/model/LinkTable.java index 3e12384e9d..0dc7f53eb9 100644 --- a/src/java/org/apache/poi/hssf/model/LinkTable.java +++ b/src/java/org/apache/poi/hssf/model/LinkTable.java @@ -96,7 +96,7 @@ final class LinkTable { public ExternalBookBlock(RecordStream rs) { _externalBookRecord = (SupBookRecord) rs.getNext(); - List<Object> temp = new ArrayList<Object>(); + List<Object> temp = new ArrayList<>(); while(rs.peekNextClass() == ExternalNameRecord.class) { temp.add(rs.getNext()); } @@ -191,7 +191,7 @@ final class LinkTable { _workbookRecordList = workbookRecordList; RecordStream rs = new RecordStream(inputList, startIndex); - List<ExternalBookBlock> temp = new ArrayList<ExternalBookBlock>(); + List<ExternalBookBlock> temp = new ArrayList<>(); while(rs.peekNextClass() == SupBookRecord.class) { temp.add(new ExternalBookBlock(rs)); } @@ -212,7 +212,7 @@ final class LinkTable { _externSheetRecord = null; } - _definedNames = new ArrayList<NameRecord>(); + _definedNames = new ArrayList<>(); // collect zero or more DEFINEDNAMEs id=0x18, // with their comments if present while(true) { @@ -235,7 +235,7 @@ final class LinkTable { } private static ExternSheetRecord readExtSheetRecord(RecordStream rs) { - List<ExternSheetRecord> temp = new ArrayList<ExternSheetRecord>(2); + List<ExternSheetRecord> temp = new ArrayList<>(2); while(rs.peekNextClass() == ExternSheetRecord.class) { temp.add((ExternSheetRecord) rs.getNext()); } @@ -258,7 +258,7 @@ final class LinkTable { public LinkTable(int numberOfSheets, WorkbookRecordList workbookRecordList) { _workbookRecordList = workbookRecordList; - _definedNames = new ArrayList<NameRecord>(); + _definedNames = new ArrayList<>(); _externalBookBlocks = new ExternalBookBlock[] { new ExternalBookBlock(numberOfSheets), }; diff --git a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java index 0bc7e2919a..cf8becadc5 100644 --- a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java +++ b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java @@ -47,12 +47,12 @@ public final class RowBlocksReader { * @param rs the record stream */ public RowBlocksReader(RecordStream rs) { - List<Record> plainRecords = new ArrayList<Record>(); - List<Record> shFrmRecords = new ArrayList<Record>(); - List<CellReference> firstCellRefs = new ArrayList<CellReference>(); - List<Record> arrayRecords = new ArrayList<Record>(); - List<Record> tableRecords = new ArrayList<Record>(); - List<Record> mergeCellRecords = new ArrayList<Record>(); + List<Record> plainRecords = new ArrayList<>(); + List<Record> shFrmRecords = new ArrayList<>(); + List<CellReference> firstCellRefs = new ArrayList<>(); + List<Record> arrayRecords = new ArrayList<>(); + List<Record> tableRecords = new ArrayList<>(); + List<Record> mergeCellRecords = new ArrayList<>(); Record prevRec = null; while(!RecordOrderer.isEndOfRowBlock(rs.peekNextSid())) { diff --git a/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java b/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java index 28c1e519b5..9171dba68b 100644 --- a/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java +++ b/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.poi.hssf.record.Record; public final class WorkbookRecordList { - private List<Record> records = new ArrayList<Record>(); + private List<Record> records = new ArrayList<>(); /** holds the position of the protect record */ private int protpos; diff --git a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java index 65ed15d709..f97e60e195 100644 --- a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java +++ b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java @@ -47,12 +47,12 @@ public abstract class AbstractEscherHolderRecord extends Record implements Clone public AbstractEscherHolderRecord() { - escherRecords = new ArrayList<EscherRecord>(); + escherRecords = new ArrayList<>(); } public AbstractEscherHolderRecord(RecordInputStream in) { - escherRecords = new ArrayList<EscherRecord>(); + escherRecords = new ArrayList<>(); if (! DESERIALISE ) { rawDataContainer.concatenate(in.readRemainder()); } else { diff --git a/src/java/org/apache/poi/hssf/record/EscherAggregate.java b/src/java/org/apache/poi/hssf/record/EscherAggregate.java index 033b4a25a6..7fdf83f55a 100644 --- a/src/java/org/apache/poi/hssf/record/EscherAggregate.java +++ b/src/java/org/apache/poi/hssf/record/EscherAggregate.java @@ -295,12 +295,12 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { /** * Maps shape container objects to their {@link TextObjectRecord} or {@link ObjRecord} */ - private final Map<EscherRecord, Record> shapeToObj = new HashMap<EscherRecord, Record>(); + private final Map<EscherRecord, Record> shapeToObj = new HashMap<>(); /** * list of "tail" records that need to be serialized after all drawing group records */ - private final Map<Integer, NoteRecord> tailRec = new LinkedHashMap<Integer, NoteRecord>(); + private final Map<Integer, NoteRecord> tailRec = new LinkedHashMap<>(); /** * create new EscherAggregate @@ -376,7 +376,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { public static EscherAggregate createAggregate(List<RecordBase> records, int locFirstDrawingRecord) { // Keep track of any shape records created so we can match them back to the object id's. // Textbox objects are also treated as shape objects. - final List<EscherRecord> shapeRecords = new ArrayList<EscherRecord>(); + final List<EscherRecord> shapeRecords = new ArrayList<>(); EscherRecordFactory recordFactory = new DefaultEscherRecordFactory() { public EscherRecord createRecord(byte[] data, int offset) { EscherRecord r = super.createRecord(data, offset); @@ -466,8 +466,8 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { byte[] buffer = new byte[size]; // Serialize escher records into one big data structure and keep note of ending offsets. - final List <Integer>spEndingOffsets = new ArrayList<Integer>(); - final List <EscherRecord> shapes = new ArrayList<EscherRecord>(); + final List <Integer>spEndingOffsets = new ArrayList<>(); + final List <EscherRecord> shapes = new ArrayList<>(); int pos = 0; for (Object record : records) { EscherRecord e = (EscherRecord) record; @@ -594,7 +594,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { List<EscherRecord> records = getEscherRecords(); int rawEscherSize = getEscherRecordSize(records); byte[] buffer = new byte[rawEscherSize]; - final List<Integer> spEndingOffsets = new ArrayList<Integer>(); + final List<Integer> spEndingOffsets = new ArrayList<>(); int pos = 0; for (EscherRecord e : records) { pos += e.serialize(pos, buffer, new EscherSerializationListener() { diff --git a/src/java/org/apache/poi/hssf/record/ExtSSTRecord.java b/src/java/org/apache/poi/hssf/record/ExtSSTRecord.java index 3732fd52a5..8660d97895 100644 --- a/src/java/org/apache/poi/hssf/record/ExtSSTRecord.java +++ b/src/java/org/apache/poi/hssf/record/ExtSSTRecord.java @@ -93,7 +93,7 @@ public final class ExtSSTRecord extends ContinuableRecord { _stringsPerBucket = in.readShort(); int nInfos = in.remaining() / InfoSubRecord.ENCODED_SIZE; - ArrayList<InfoSubRecord> lst = new ArrayList<InfoSubRecord>(nInfos); + ArrayList<InfoSubRecord> lst = new ArrayList<>(nInfos); while (in.available() > 0) { InfoSubRecord info = new InfoSubRecord(in); diff --git a/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java b/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java index 0a75e9c896..ae429bd87c 100644 --- a/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java +++ b/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java @@ -87,11 +87,11 @@ public class ExternSheetRecord extends StandardRecord { public ExternSheetRecord() { - _list = new ArrayList<RefSubRecord>(); + _list = new ArrayList<>(); } public ExternSheetRecord(RecordInputStream in) { - _list = new ArrayList<RefSubRecord>(); + _list = new ArrayList<>(); int nItems = in.readShort(); diff --git a/src/java/org/apache/poi/hssf/record/ObjRecord.java b/src/java/org/apache/poi/hssf/record/ObjRecord.java index da310f415b..e41e6cbc27 100644 --- a/src/java/org/apache/poi/hssf/record/ObjRecord.java +++ b/src/java/org/apache/poi/hssf/record/ObjRecord.java @@ -51,7 +51,7 @@ public final class ObjRecord extends Record implements Cloneable { public ObjRecord() { - subrecords = new ArrayList<SubRecord>(2); + subrecords = new ArrayList<>(2); // TODO - ensure 2 sub-records (ftCmo 15h, and ftEnd 00h) are always created _uninterpretedData = null; } @@ -84,7 +84,7 @@ public final class ObjRecord extends Record implements Cloneable { } */ - subrecords = new ArrayList<SubRecord>(); + subrecords = new ArrayList<>(); ByteArrayInputStream bais = new ByteArrayInputStream(subRecordData); LittleEndianInputStream subRecStream = new LittleEndianInputStream(bais); CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)SubRecord.createSubRecord(subRecStream, 0); diff --git a/src/java/org/apache/poi/hssf/record/PageBreakRecord.java b/src/java/org/apache/poi/hssf/record/PageBreakRecord.java index fe182d05c0..9e053918bd 100644 --- a/src/java/org/apache/poi/hssf/record/PageBreakRecord.java +++ b/src/java/org/apache/poi/hssf/record/PageBreakRecord.java @@ -77,15 +77,15 @@ public abstract class PageBreakRecord extends StandardRecord { } protected PageBreakRecord() { - _breaks = new ArrayList<Break>(); - _breakMap = new HashMap<Integer, Break>(); + _breaks = new ArrayList<>(); + _breakMap = new HashMap<>(); } public PageBreakRecord(RecordInputStream in) { int nBreaks = in.readShort(); - _breaks = new ArrayList<Break>(nBreaks + 2); - _breakMap = new HashMap<Integer, Break>(); + _breaks = new ArrayList<>(nBreaks + 2); + _breakMap = new HashMap<>(); for(int k = 0; k < nBreaks; k++) { Break br = new Break(in); diff --git a/src/java/org/apache/poi/hssf/record/PaletteRecord.java b/src/java/org/apache/poi/hssf/record/PaletteRecord.java index 0741bb27a6..162c67c514 100644 --- a/src/java/org/apache/poi/hssf/record/PaletteRecord.java +++ b/src/java/org/apache/poi/hssf/record/PaletteRecord.java @@ -39,7 +39,7 @@ public final class PaletteRecord extends StandardRecord { public PaletteRecord() { PColor[] defaultPalette = createDefaultPalette(); - _colors = new ArrayList<PColor>(defaultPalette.length); + _colors = new ArrayList<>(defaultPalette.length); for (PColor element : defaultPalette) { _colors.add(element); } @@ -47,7 +47,7 @@ public final class PaletteRecord extends StandardRecord { public PaletteRecord(RecordInputStream in) { int field_1_numcolors = in.readShort(); - _colors = new ArrayList<PColor>(field_1_numcolors); + _colors = new ArrayList<>(field_1_numcolors); for (int k = 0; k < field_1_numcolors; k++) { _colors.add(new PColor(in)); } diff --git a/src/java/org/apache/poi/hssf/record/RecordFactory.java b/src/java/org/apache/poi/hssf/record/RecordFactory.java index 8e994d8dd4..8b5c0224c1 100644 --- a/src/java/org/apache/poi/hssf/record/RecordFactory.java +++ b/src/java/org/apache/poi/hssf/record/RecordFactory.java @@ -425,8 +425,8 @@ public final class RecordFactory { * most of org.apache.poi.hssf.record.* */ private static Map<Integer, I_RecordCreator> recordsToMap(Class<? extends Record> [] records) { - Map<Integer, I_RecordCreator> result = new HashMap<Integer, I_RecordCreator>(); - Set<Class<?>> uniqueRecClasses = new HashSet<Class<?>>(records.length * 3 / 2); + Map<Integer, I_RecordCreator> result = new HashMap<>(); + Set<Class<?>> uniqueRecClasses = new HashSet<>(records.length * 3 / 2); for (Class<? extends Record> recClass : records) { if(!Record.class.isAssignableFrom(recClass)) { @@ -486,7 +486,7 @@ public final class RecordFactory { */ public static List<Record> createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException { - List<Record> records = new ArrayList<Record>(NUM_RECORDS); + List<Record> records = new ArrayList<>(NUM_RECORDS); RecordFactoryInputStream recStream = new RecordFactoryInputStream(in, true); diff --git a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java index 7ec0c83dc1..2bd79d6427 100644 --- a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java +++ b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java @@ -183,7 +183,7 @@ public final class RecordFactoryInputStream { */ public RecordFactoryInputStream(InputStream in, boolean shouldIncludeContinueRecords) { RecordInputStream rs = new RecordInputStream(in); - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); StreamEncryptionInfo sei = new StreamEncryptionInfo(rs, records); if (sei.hasEncryption()) { rs = sei.createDecryptingStream(in); diff --git a/src/java/org/apache/poi/hssf/record/SSTRecord.java b/src/java/org/apache/poi/hssf/record/SSTRecord.java index 43f42defd1..20d99319d6 100644 --- a/src/java/org/apache/poi/hssf/record/SSTRecord.java +++ b/src/java/org/apache/poi/hssf/record/SSTRecord.java @@ -68,7 +68,7 @@ public final class SSTRecord extends ContinuableRecord { { field_1_num_strings = 0; field_2_num_unique_strings = 0; - field_3_strings = new IntMapper<UnicodeString>(); + field_3_strings = new IntMapper<>(); deserializer = new SSTDeserializer(field_3_strings); } @@ -240,7 +240,7 @@ public final class SSTRecord extends ContinuableRecord { // we initialize our fields field_1_num_strings = in.readInt(); field_2_num_unique_strings = in.readInt(); - field_3_strings = new IntMapper<UnicodeString>(); + field_3_strings = new IntMapper<>(); deserializer = new SSTDeserializer(field_3_strings); // Bug 57456: some Excel Sheets send 0 as field=1, but have some random number in field_2, diff --git a/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java index 1a516f3179..87cb834633 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java @@ -72,7 +72,7 @@ public final class CFRecordsAggregate extends RecordAggregate { throw new RecordFormatException("Mismatch number of rules"); } header = pHeader; - rules = new ArrayList<CFRuleBase>(pRules.length); + rules = new ArrayList<>(pRules.length); for (CFRuleBase pRule : pRules) { checkRuleType(pRule); rules.add(pRule); @@ -221,7 +221,7 @@ public final class CFRecordsAggregate extends RecordAggregate { public boolean updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx) { CellRangeAddress[] cellRanges = header.getCellRanges(); boolean changed = false; - List<CellRangeAddress> temp = new ArrayList<CellRangeAddress>(); + List<CellRangeAddress> temp = new ArrayList<>(); for (CellRangeAddress craOld : cellRanges) { CellRangeAddress craNew = shiftRange(shifter, craOld, currentExternSheetIx); if (craNew == null) { diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java index 5df1993e4c..2196c89d4b 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java @@ -38,7 +38,7 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { public ChartSubstreamRecordAggregate(RecordStream rs) { _bofRec = (BOFRecord) rs.getNext(); - List<RecordBase> temp = new ArrayList<RecordBase>(); + List<RecordBase> temp = new ArrayList<>(); while (rs.peekNextClass() != EOFRecord.class) { if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) { if (_psBlock != null) { diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java index 7c02b8bb10..4e9a299186 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java @@ -52,7 +52,7 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements * Creates an empty aggregate */ public ColumnInfoRecordsAggregate() { - records = new ArrayList<ColumnInfoRecord>(); + records = new ArrayList<>(); } public ColumnInfoRecordsAggregate(RecordStream rs) { this(); diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java b/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java index cfbd36995d..625cc9a6ac 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java @@ -37,12 +37,12 @@ public final class ConditionalFormattingTable extends RecordAggregate { * Creates an empty ConditionalFormattingTable */ public ConditionalFormattingTable() { - _cfHeaders = new ArrayList<CFRecordsAggregate>(); + _cfHeaders = new ArrayList<>(); } public ConditionalFormattingTable(RecordStream rs) { - List<CFRecordsAggregate> temp = new ArrayList<CFRecordsAggregate>(); + List<CFRecordsAggregate> temp = new ArrayList<>(); while (rs.peekNextClass() == CFHeaderRecord.class || rs.peekNextClass() == CFHeader12Record.class) { temp.add(CFRecordsAggregate.createCFAggregate(rs)); diff --git a/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java index 7018eec63f..85758fc845 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java @@ -42,7 +42,7 @@ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { if (_begin.getSid() != UserSViewBegin.sid) { throw new IllegalStateException("Bad begin record"); } - List<RecordBase> temp = new ArrayList<RecordBase>(); + List<RecordBase> temp = new ArrayList<>(); while (rs.peekNextSid() != UserSViewEnd.sid) { if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) { if (_psBlock != null) { diff --git a/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java b/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java index a4bb38adad..654abaf41f 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java @@ -39,7 +39,7 @@ public final class DataValidityTable extends RecordAggregate { public DataValidityTable(RecordStream rs) { _headerRec = (DVALRecord) rs.getNext(); - List<DVRecord> temp = new ArrayList<DVRecord>(); + List<DVRecord> temp = new ArrayList<>(); while (rs.peekNextClass() == DVRecord.class) { temp.add((DVRecord) rs.getNext()); } @@ -48,7 +48,7 @@ public final class DataValidityTable extends RecordAggregate { public DataValidityTable() { _headerRec = new DVALRecord(); - _validationList = new ArrayList<DVRecord>(); + _validationList = new ArrayList<>(); } public void visitContainedRecords(RecordVisitor rv) { diff --git a/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java b/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java index cc59338a5e..e7859a087a 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java @@ -38,7 +38,7 @@ public final class MergedCellsTable extends RecordAggregate { * Creates an empty aggregate */ public MergedCellsTable() { - _mergedRegions = new ArrayList<CellRangeAddress>(); + _mergedRegions = new ArrayList<>(); } /** diff --git a/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java b/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java index 73531fe48a..0c4d5b4214 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java @@ -52,7 +52,7 @@ public final class PageSettingsBlock extends RecordAggregate { public PLSAggregate(RecordStream rs) { _pls = rs.getNext(); if (rs.peekNextSid()==ContinueRecord.sid) { - List<ContinueRecord> temp = new ArrayList<ContinueRecord>(); + List<ContinueRecord> temp = new ArrayList<>(); while (rs.peekNextSid()==ContinueRecord.sid) { temp.add((ContinueRecord)rs.getNext()); } @@ -93,11 +93,11 @@ public final class PageSettingsBlock extends RecordAggregate { * The indicator of such records is a non-zero GUID, * see {@link org.apache.poi.hssf.record.HeaderFooterRecord#getGuid()} */ - private final List<HeaderFooterRecord> _sviewHeaderFooters = new ArrayList<HeaderFooterRecord>(); + private final List<HeaderFooterRecord> _sviewHeaderFooters = new ArrayList<>(); private Record _printSize; public PageSettingsBlock(RecordStream rs) { - _plsRecords = new ArrayList<PLSAggregate>(); + _plsRecords = new ArrayList<>(); while(true) { if (!readARecord(rs)) { break; @@ -109,7 +109,7 @@ public final class PageSettingsBlock extends RecordAggregate { * Creates a PageSettingsBlock with default settings */ public PageSettingsBlock() { - _plsRecords = new ArrayList<PLSAggregate>(); + _plsRecords = new ArrayList<>(); _rowBreaksRecord = new HorizontalPageBreakRecord(); _columnBreaksRecord = new VerticalPageBreakRecord(); _header = new HeaderRecord(""); @@ -482,7 +482,7 @@ public final class PageSettingsBlock extends RecordAggregate { private static void shiftBreaks(PageBreakRecord breaks, int start, int stop, int count) { Iterator<PageBreakRecord.Break> iterator = breaks.getBreaksIterator(); - List<PageBreakRecord.Break> shiftedBreak = new ArrayList<PageBreakRecord.Break>(); + List<PageBreakRecord.Break> shiftedBreak = new ArrayList<>(); while(iterator.hasNext()) { PageBreakRecord.Break breakItem = iterator.next(); @@ -672,9 +672,9 @@ public final class PageSettingsBlock extends RecordAggregate { public void positionRecords(List<RecordBase> sheetRecords) { // Take a copy to loop over, so we can update the real one // without concurrency issues - List<HeaderFooterRecord> hfRecordsToIterate = new ArrayList<HeaderFooterRecord>(_sviewHeaderFooters); + List<HeaderFooterRecord> hfRecordsToIterate = new ArrayList<>(_sviewHeaderFooters); - final Map<String, HeaderFooterRecord> hfGuidMap = new HashMap<String, HeaderFooterRecord>(); + final Map<String, HeaderFooterRecord> hfGuidMap = new HashMap<>(); for(final HeaderFooterRecord hf : hfRecordsToIterate) { hfGuidMap.put(HexDump.toHex(hf.getGuid()), hf); diff --git a/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java index d1c12e0fce..e32a74ba42 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java @@ -53,9 +53,9 @@ public final class RowRecordsAggregate extends RecordAggregate { if (svm == null) { throw new IllegalArgumentException("SharedValueManager must be provided."); } - _rowRecords = new TreeMap<Integer, RowRecord>(); + _rowRecords = new TreeMap<>(); _valuesAgg = new ValueRecordsAggregate(); - _unknownRecords = new ArrayList<Record>(); + _unknownRecords = new ArrayList<>(); _sharedValueManager = svm; } diff --git a/src/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java b/src/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java index 5d36fdfb6b..ed5b7ecb3a 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java @@ -122,7 +122,7 @@ public final class SharedValueManager { } _arrayRecords = toList(arrayRecords); _tableRecords = tableRecords; - Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2); + Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<>(nShF * 3 / 2); for (int i = 0; i < nShF; i++) { SharedFormulaRecord sfr = sharedFormulaRecords[i]; m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i])); @@ -134,7 +134,7 @@ public final class SharedValueManager { * @return a modifiable list, independent of the supplied array */ private static <Z> List<Z> toList(Z[] zz) { - List<Z> result = new ArrayList<Z>(zz.length); + List<Z> result = new ArrayList<>(zz.length); for (int i = 0; i < zz.length; i++) { result.add(zz[i]); } @@ -167,7 +167,7 @@ public final class SharedValueManager { private SharedFormulaGroup findFormulaGroupForCell(final CellReference cellRef) { if(null == _groupsCache) { - _groupsCache = new HashMap<Integer,SharedFormulaGroup>(_groupsBySharedFormulaRecord.size()); + _groupsCache = new HashMap<>(_groupsBySharedFormulaRecord.size()); for(SharedFormulaGroup group: _groupsBySharedFormulaRecord.values()) { _groupsCache.put(getKeyForCache(group._firstCell),group); } diff --git a/src/java/org/apache/poi/hssf/record/common/UnicodeString.java b/src/java/org/apache/poi/hssf/record/common/UnicodeString.java index 0bfa6b406e..818e65087b 100644 --- a/src/java/org/apache/poi/hssf/record/common/UnicodeString.java +++ b/src/java/org/apache/poi/hssf/record/common/UnicodeString.java @@ -464,7 +464,7 @@ public class UnicodeString implements Comparable<UnicodeString> { field_3_string = (isCompressed) ? in.readCompressedUnicode(cc) : in.readUnicodeLEString(cc); if (isRichText() && (runCount > 0)) { - field_4_format_runs = new ArrayList<FormatRun>(runCount); + field_4_format_runs = new ArrayList<>(runCount); for (int i=0;i<runCount;i++) { field_4_format_runs.add(new FormatRun(in)); } @@ -610,7 +610,7 @@ public class UnicodeString implements Comparable<UnicodeString> { */ public void addFormatRun(FormatRun r) { if (field_4_format_runs == null) { - field_4_format_runs = new ArrayList<FormatRun>(); + field_4_format_runs = new ArrayList<>(); } int index = findFormatRunAt(r._character); @@ -812,7 +812,7 @@ public class UnicodeString implements Comparable<UnicodeString> { str.field_2_optionflags = field_2_optionflags; str.field_3_string = field_3_string; if (field_4_format_runs != null) { - str.field_4_format_runs = new ArrayList<FormatRun>(); + str.field_4_format_runs = new ArrayList<>(); for (FormatRun r : field_4_format_runs) { str.field_4_format_runs.add(new FormatRun(r._character, r._fontIndex)); } diff --git a/src/java/org/apache/poi/hssf/record/crypto/Biff8EncryptionKey.java b/src/java/org/apache/poi/hssf/record/crypto/Biff8EncryptionKey.java index f589f02cb9..23cd17a823 100644 --- a/src/java/org/apache/poi/hssf/record/crypto/Biff8EncryptionKey.java +++ b/src/java/org/apache/poi/hssf/record/crypto/Biff8EncryptionKey.java @@ -24,7 +24,7 @@ public final class Biff8EncryptionKey { * using a {@link ThreadLocal} in order to avoid further overloading the various public APIs * (e.g. {@link HSSFWorkbook}) that need this functionality. */ - private static final ThreadLocal<String> _userPasswordTLS = new ThreadLocal<String>(); + private static final ThreadLocal<String> _userPasswordTLS = new ThreadLocal<>(); /** * Sets the BIFF8 encryption/decryption password for the current thread. diff --git a/src/java/org/apache/poi/hssf/usermodel/FontDetails.java b/src/java/org/apache/poi/hssf/usermodel/FontDetails.java index 29bcf5ac4b..dd049d2933 100644 --- a/src/java/org/apache/poi/hssf/usermodel/FontDetails.java +++ b/src/java/org/apache/poi/hssf/usermodel/FontDetails.java @@ -29,7 +29,7 @@ public class FontDetails { private String _fontName; private int _height; - private final Map<Character, Integer> charWidths = new HashMap<Character, Integer>(); + private final Map<Character, Integer> charWidths = new HashMap<>(); /** * Construct the font details with the given name and height. diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java index 03f444751a..120af40ea9 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java @@ -116,8 +116,8 @@ public final class HSSFCellStyle implements CellStyle { return Short.MIN_VALUE; } }; - private static final ThreadLocal<List<FormatRecord>> lastFormats = new ThreadLocal<List<FormatRecord>>(); - private static final ThreadLocal<String> getDataFormatStringCache = new ThreadLocal<String>(); + private static final ThreadLocal<List<FormatRecord>> lastFormats = new ThreadLocal<>(); + private static final ThreadLocal<String> getDataFormatStringCache = new ThreadLocal<>(); /** * Get the contents of the format string, by looking up diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java index b6276f0ba0..09284dcb90 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java @@ -42,7 +42,7 @@ import org.apache.poi.ss.usermodel.DataFormat; public final class HSSFDataFormat implements DataFormat { private static final String[] _builtinFormats = BuiltinFormats.getAll(); - private final Vector<String> _formats = new Vector<String>(); + private final Vector<String> _formats = new Vector<>(); private final InternalWorkbook _workbook; private boolean _movedBuiltins; // Flag to see if need to // check the built in list diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java b/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java index d28b7fd7ea..be1f3044f2 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java @@ -137,7 +137,7 @@ public class HSSFOptimiser { // the new locations of the fonts // Remember that one underlying unicode string // may be shared by multiple RichTextStrings! - HashSet<UnicodeString> doneUnicodeStrings = new HashSet<UnicodeString>(); + HashSet<UnicodeString> doneUnicodeStrings = new HashSet<>(); for(int sheetNum=0; sheetNum<workbook.getNumberOfSheets(); sheetNum++) { HSSFSheet s = workbook.getSheetAt(sheetNum); for (Row row : s) { diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java index 0b916aa87a..3c4385ab60 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java @@ -60,7 +60,7 @@ import org.apache.poi.util.StringUtil; */ public final class HSSFPatriarch implements HSSFShapeContainer, Drawing<HSSFShape> { // private static POILogger log = POILogFactory.getLogger(HSSFPatriarch.class); - private final List<HSSFShape> _shapes = new ArrayList<HSSFShape>(); + private final List<HSSFShape> _shapes = new ArrayList<>(); private final EscherSpgrRecord _spgrRecord; private final EscherContainerRecord _mainSpgrContainer; @@ -122,7 +122,7 @@ public final class HSSFPatriarch implements HSSFShapeContainer, Drawing<HSSFShap /** * contains coordinates of comments we iterate over */ - Set<String> coordinates = new HashSet<String>(tailRecords.size()); + Set<String> coordinates = new HashSet<>(tailRecords.size()); for(NoteRecord rec : tailRecords.values()){ String noteRef = new CellReference(rec.getRow(), rec.getColumn()).formatAsString(); // A1-style notation @@ -416,7 +416,7 @@ public final class HSSFPatriarch implements HSSFShapeContainer, Drawing<HSSFShap */ @Override public void clear() { - ArrayList <HSSFShape> copy = new ArrayList<HSSFShape>(_shapes); + ArrayList <HSSFShape> copy = new ArrayList<>(_shapes); for (HSSFShape shape: copy){ removeShape(shape); } diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java b/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java index 4c97d6f0cd..69036df6f1 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java @@ -30,7 +30,7 @@ import java.util.Iterator; * sheet. */ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer { - private final List<HSSFShape> shapes = new ArrayList<HSSFShape>(); + private final List<HSSFShape> shapes = new ArrayList<>(); private EscherSpgrRecord _spgrRecord; public HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord) { @@ -268,7 +268,7 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer { } public void clear() { - ArrayList <HSSFShape> copy = new ArrayList<HSSFShape>(shapes); + ArrayList <HSSFShape> copy = new ArrayList<>(shapes); for (HSSFShape shape: copy){ removeShape(shape); } diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 3a01126d43..4f886d299f 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -124,7 +124,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { */ protected HSSFSheet(HSSFWorkbook workbook) { _sheet = InternalSheet.createSheet(); - _rows = new TreeMap<Integer, HSSFRow>(); + _rows = new TreeMap<>(); this._workbook = workbook; this._book = workbook.getWorkbook(); } @@ -139,7 +139,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { */ protected HSSFSheet(HSSFWorkbook workbook, InternalSheet sheet) { this._sheet = sheet; - _rows = new TreeMap<Integer, HSSFRow>(); + _rows = new TreeMap<>(); this._workbook = workbook; this._book = workbook.getWorkbook(); setPropertiesFromSheet(sheet); @@ -424,7 +424,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { @Override public List<HSSFDataValidation> getDataValidations() { DataValidityTable dvt = _sheet.getOrCreateDataValidityTable(); - final List<HSSFDataValidation> hssfValidations = new ArrayList<HSSFDataValidation>(); + final List<HSSFDataValidation> hssfValidations = new ArrayList<>(); RecordVisitor visitor = new RecordVisitor() { private HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(getWorkbook()); @@ -908,7 +908,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { */ @Override public void removeMergedRegions(Collection<Integer> indices) { - for (int i : (new TreeSet<Integer>(indices)).descendingSet()) { + for (int i : (new TreeSet<>(indices)).descendingSet()) { _sheet.removeMergedRegion(i); } } @@ -936,7 +936,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { */ @Override public List<CellRangeAddress> getMergedRegions() { - List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>(); + List<CellRangeAddress> addresses = new ArrayList<>(); int count = _sheet.getNumMergedRegions(); for (int i=0; i < count; i++) { addresses.add(_sheet.getMergedRegionAt(i)); @@ -2223,7 +2223,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { */ @Override public List<HSSFHyperlink> getHyperlinkList() { - final List<HSSFHyperlink> hyperlinkList = new ArrayList<HSSFHyperlink>(); + final List<HSSFHyperlink> hyperlinkList = new ArrayList<>(); for (RecordBase rec : _sheet.getRecords()) { if (rec instanceof HyperlinkRecord) { HyperlinkRecord link = (HyperlinkRecord) rec; @@ -2290,7 +2290,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { int lastColumn = range.getLastColumn(); int height = lastRow - firstRow + 1; int width = lastColumn - firstColumn + 1; - List<HSSFCell> temp = new ArrayList<HSSFCell>(height * width); + List<HSSFCell> temp = new ArrayList<>(height * width); for (int rowIn = firstRow; rowIn <= lastRow; rowIn++) { for (int colIn = firstColumn; colIn <= lastColumn; colIn++) { HSSFRow row = getRow(rowIn); @@ -2432,7 +2432,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { patriarch = createDrawingPatriarch(); } - Map<CellAddress, HSSFComment> locations = new TreeMap<CellAddress, HSSFComment>(); + Map<CellAddress, HSSFComment> locations = new TreeMap<>(); findCellCommentLocations(patriarch, locations); return locations; } @@ -2530,7 +2530,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { NameRecord.BUILTIN_PRINT_TITLE, sheetIndex); } - List<Ptg> ptgList = new ArrayList<Ptg>(); + List<Ptg> ptgList = new ArrayList<>(); if (setBoth) { final int exprsSize = 2 * 11 + 1; // 2 * Area3DPtg.SIZE + UnionPtg.SIZE ptgList.add(new MemFuncPtg(exprsSize)); diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 69610c5a73..861f3fff5f 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -217,8 +217,8 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss private HSSFWorkbook(InternalWorkbook book) { super((DirectoryNode)null); workbook = book; - _sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY); - names = new ArrayList<HSSFName>(INITIAL_CAPACITY); + _sheets = new ArrayList<>(INITIAL_CAPACITY); + names = new ArrayList<>(INITIAL_CAPACITY); } /** @@ -345,8 +345,8 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss clearDirectory(); } - _sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY); - names = new ArrayList<HSSFName>(INITIAL_CAPACITY); + _sheets = new ArrayList<>(INITIAL_CAPACITY); + names = new ArrayList<>(INITIAL_CAPACITY); // Grab the data from the workbook stream, however // it happens to be spelled. @@ -606,7 +606,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss * @param indexes Array of sheets to select, the index is 0-based. */ public void setSelectedTabs(int[] indexes) { - Collection<Integer> list = new ArrayList<Integer>(indexes.length); + Collection<Integer> list = new ArrayList<>(indexes.length); for (int index : indexes) { list.add(index); } @@ -626,7 +626,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss validateSheetIndex(index); } // ignore duplicates - Set<Integer> set = new HashSet<Integer>(indexes); + Set<Integer> set = new HashSet<>(indexes); int nSheets = _sheets.size(); for (int i=0; i<nSheets; i++) { boolean bSelect = set.contains(i); @@ -643,7 +643,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss * @return indices of selected sheets */ public Collection<Integer> getSelectedTabs() { - Collection<Integer> indexes = new ArrayList<Integer>(); + Collection<Integer> indexes = new ArrayList<>(); int nSheets = _sheets.size(); for (int i=0; i<nSheets; i++) { HSSFSheet sheet = getSheetAt(i); @@ -946,7 +946,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss */ @Override public Iterator<Sheet> sheetIterator() { - return new SheetIterator<Sheet>(); + return new SheetIterator<>(); } /** @@ -1235,7 +1235,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss @Override public HSSFFont getFontAt(short idx) { if(fonts == null) { - fonts = new HashMap<Short, HSSFFont>(); + fonts = new HashMap<>(); } // So we don't confuse users, give them back @@ -1260,7 +1260,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss * and that's not something you should normally do */ protected void resetFontCache() { - fonts = new HashMap<Short, HSSFFont>(); + fonts = new HashMap<>(); } /** @@ -1401,7 +1401,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss private void write(NPOIFSFileSystem fs) throws IOException { // For tracking what we've written out, used if we're // going to be preserving nodes - List<String> excepts = new ArrayList<String>(1); + List<String> excepts = new ArrayList<>(1); // Write out the Workbook stream fs.createDocument(new ByteArrayInputStream(getBytes()), "Workbook"); @@ -1445,7 +1445,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss public SheetRecordCollector() { _totalSize = 0; - _list = new ArrayList<Record>(128); + _list = new ArrayList<>(128); } public int getTotalSize() { return _totalSize; @@ -1597,7 +1597,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss @Override public List<HSSFName> getNames(String name) { - List<HSSFName> nameList = new ArrayList<HSSFName>(); + List<HSSFName> nameList = new ArrayList<>(); for(HSSFName nr : names) { if(nr.getNameName().equals(name)) { nameList.add(nr); @@ -1970,7 +1970,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss public List<HSSFPictureData> getAllPictures() { // The drawing group record always exists at the top level, so we won't need to do this recursively. - List<HSSFPictureData> pictures = new ArrayList<HSSFPictureData>(); + List<HSSFPictureData> pictures = new ArrayList<>(); for (Record r : workbook.getRecords()) { if (r instanceof AbstractEscherHolderRecord) { ((AbstractEscherHolderRecord) r).decode(); @@ -2011,7 +2011,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss } protected static Map<String,ClassID> getOleMap() { - Map<String,ClassID> olemap = new HashMap<String,ClassID>(); + Map<String,ClassID> olemap = new HashMap<>(); olemap.put("PowerPoint Document", ClassID.PPT_SHOW); for (String str : WORKBOOK_DIR_ENTRY_NAMES) { olemap.put(str, ClassID.XLS_WORKBOOK); @@ -2123,7 +2123,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss */ public List<HSSFObjectData> getAllEmbeddedObjects() { - List<HSSFObjectData> objects = new ArrayList<HSSFObjectData>(); + List<HSSFObjectData> objects = new ArrayList<>(); for (HSSFSheet sheet : _sheets) { getAllEmbeddedObjects(sheet, objects); diff --git a/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java b/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java index fcfd23f178..361d8a8c1c 100644 --- a/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java +++ b/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java @@ -41,7 +41,7 @@ final class StaticFontMetrics { /** The font metrics property file we're using */ private static Properties fontMetricsProps; /** Our cache of font details we've already looked up */ - private static final Map<String, FontDetails> fontDetailsMap = new HashMap<String, FontDetails>(); + private static final Map<String, FontDetails> fontDetailsMap = new HashMap<>(); private StaticFontMetrics() {} diff --git a/src/java/org/apache/poi/hssf/util/HSSFColor.java b/src/java/org/apache/poi/hssf/util/HSSFColor.java index b2f3c9c1b0..1490abf791 100644 --- a/src/java/org/apache/poi/hssf/util/HSSFColor.java +++ b/src/java/org/apache/poi/hssf/util/HSSFColor.java @@ -187,7 +187,7 @@ public class HSSFColor implements Color { private static Map<Integer,HSSFColor> createColorsByIndexMap() { Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass(); - Map<Integer,HSSFColor> result = new HashMap<Integer,HSSFColor>(eList.size() * 3 / 2); + Map<Integer,HSSFColor> result = new HashMap<>(eList.size() * 3 / 2); for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) { Integer index1 = (int)colorRef.getKey().getIndex(); @@ -218,7 +218,7 @@ public class HSSFColor implements Color { private static Map<String,HSSFColor> createColorsByHexStringMap() { Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass(); - Map<String,HSSFColor> result = new HashMap<String,HSSFColor>(eList.size()); + Map<String,HSSFColor> result = new HashMap<>(eList.size()); for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) { String hexString = colorRef.getKey().getHexString(); @@ -239,7 +239,7 @@ public class HSSFColor implements Color { @Removal(version="3.18") private static synchronized Map<HSSFColorPredefined,HSSFColor> mapEnumToColorClass() { if (enumList == null) { - enumList = new EnumMap<HSSFColorPredefined,HSSFColor>(HSSFColorPredefined.class); + enumList = new EnumMap<>(HSSFColorPredefined.class); // AUTOMATIC is not add to list addHSSFColorPredefined(HSSFColorPredefined.BLACK); addHSSFColorPredefined(HSSFColorPredefined.BROWN); diff --git a/src/java/org/apache/poi/hssf/util/LazilyConcatenatedByteArray.java b/src/java/org/apache/poi/hssf/util/LazilyConcatenatedByteArray.java index e7ca949e79..d7bb427cba 100644 --- a/src/java/org/apache/poi/hssf/util/LazilyConcatenatedByteArray.java +++ b/src/java/org/apache/poi/hssf/util/LazilyConcatenatedByteArray.java @@ -26,7 +26,7 @@ import java.util.List; * a large amount of time. */ public class LazilyConcatenatedByteArray { - private final List<byte[]> arrays = new ArrayList<byte[]>(1); + private final List<byte[]> arrays = new ArrayList<>(1); /** * Clears the array (sets the concatenated length back to zero. diff --git a/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java b/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java index 2dec416034..2105997068 100644 --- a/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java +++ b/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java @@ -128,7 +128,7 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable { byte buf[] = new byte[8]; bos.write(buf, 0, 8); // skip header - List<StreamDescriptorEntry> descList = new ArrayList<StreamDescriptorEntry>(); + List<StreamDescriptorEntry> descList = new ArrayList<>(); int block = 0; for (Entry entry : entries.getRoot()) { diff --git a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java index 84f2a54632..dc4dd547cc 100644 --- a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java +++ b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java @@ -55,7 +55,7 @@ public class POIFSViewEngine final int indentLevel, final String indentString) { - List<String> objects = new ArrayList<String>(); + List<String> objects = new ArrayList<>(); if (viewable instanceof POIFSViewable) { diff --git a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java index 1ea85f7c81..0a6c29bd9f 100644 --- a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java +++ b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java @@ -57,9 +57,9 @@ class POIFSReaderRegistry POIFSReaderRegistry() { - omnivorousListeners = new HashSet<POIFSReaderListener>(); - selectiveListeners = new HashMap<POIFSReaderListener, Set<DocumentDescriptor>>(); - chosenDocumentDescriptors = new HashMap<DocumentDescriptor,Set<POIFSReaderListener>>(); + omnivorousListeners = new HashSet<>(); + selectiveListeners = new HashMap<>(); + chosenDocumentDescriptors = new HashMap<>(); } /** @@ -85,7 +85,7 @@ class POIFSReaderRegistry { // this listener has not registered before - descriptors = new HashSet<DocumentDescriptor>(); + descriptors = new HashSet<>(); selectiveListeners.put(listener, descriptors); } DocumentDescriptor descriptor = new DocumentDescriptor(path, @@ -104,7 +104,7 @@ class POIFSReaderRegistry { // nobody was listening for this document before - listeners = new HashSet<POIFSReaderListener>(); + listeners = new HashSet<>(); chosenDocumentDescriptors.put(descriptor, listeners); } listeners.add(listener); @@ -143,7 +143,7 @@ class POIFSReaderRegistry Iterator<POIFSReaderListener> getListeners(final POIFSDocumentPath path, final String name) { - Set<POIFSReaderListener> rval = new HashSet<POIFSReaderListener>(omnivorousListeners); + Set<POIFSReaderListener> rval = new HashSet<>(omnivorousListeners); Set<POIFSReaderListener> selectiveListenersInner = chosenDocumentDescriptors.get(new DocumentDescriptor(path, name)); diff --git a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java index b38881021b..9497711e70 100644 --- a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java @@ -107,8 +107,8 @@ public class DirectoryNode property.getName() }); } - _byname = new HashMap<String, Entry>(); - _entries = new ArrayList<Entry>(); + _byname = new HashMap<>(); + _entries = new ArrayList<>(); Iterator<Property> iter = property.getChildren(); while (iter.hasNext()) @@ -588,7 +588,7 @@ public class DirectoryNode */ public Iterator<Object> getViewableIterator() { - List<Object> components = new ArrayList<Object>(); + List<Object> components = new ArrayList<>(); components.add(getProperty()); Iterator<Entry> iter = _entries.iterator(); diff --git a/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java b/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java index fa49ae4900..19143fd745 100644 --- a/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java @@ -131,7 +131,7 @@ public class DocumentNode public Iterator<Object> getViewableIterator() { - List<Object> components = new ArrayList<Object>(); + List<Object> components = new ArrayList<>(); components.add(getProperty()); if (_document != null) { diff --git a/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java b/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java index 3d9b9c6615..e2ba3dc3bd 100644 --- a/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java +++ b/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java @@ -153,7 +153,7 @@ public class EntryUtils } // Next, check entries and their types/sizes - Map<String,Integer> aSizes = new HashMap<String, Integer>(); + Map<String,Integer> aSizes = new HashMap<>(); final int isDirectory = -12345; for (Entry a : dirA) { String aName = a.getName(); diff --git a/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java b/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java index 3296ddb888..9d621dd8b1 100644 --- a/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java @@ -64,8 +64,8 @@ public class FilteringDirectoryNode implements DirectoryEntry this.directory = directory; // Process the excludes - this.excludes = new HashSet<String>(); - this.childExcludes = new HashMap<String, List<String>>(); + this.excludes = new HashSet<>(); + this.childExcludes = new HashMap<>(); for (String excl : excludes) { int splitAt = excl.indexOf('/'); if (splitAt == -1) { @@ -76,7 +76,7 @@ public class FilteringDirectoryNode implements DirectoryEntry String child = excl.substring(0, splitAt); String childExcl = excl.substring(splitAt+1); if (! this.childExcludes.containsKey(child)) { - this.childExcludes.put(child, new ArrayList<String>()); + this.childExcludes.put(child, new ArrayList<>()); } this.childExcludes.get(child).add(childExcl); } @@ -116,7 +116,7 @@ public class FilteringDirectoryNode implements DirectoryEntry } public Set<String> getEntryNames() { - Set<String> names = new HashSet<String>(); + Set<String> names = new HashSet<>(); for (String name : directory.getEntryNames()) { if (!excludes.contains(name)) { names.add(name); diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index fdd8647a72..7429fb58d5 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -97,9 +97,9 @@ public class NPOIFSFileSystem extends BlockStore { _header = new HeaderBlock(bigBlockSize); _property_table = new NPropertyTable(_header); - _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<BATBlock>(), _header); - _xbat_blocks = new ArrayList<BATBlock>(); - _bat_blocks = new ArrayList<BATBlock>(); + _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<>(), _header); + _xbat_blocks = new ArrayList<>(); + _bat_blocks = new ArrayList<>(); _root = null; if(newFS) { @@ -426,7 +426,7 @@ public class NPOIFSFileSystem extends BlockStore // Finally read the Small Stream FAT (SBAT) blocks BATBlock sfat; - List<BATBlock> sbats = new ArrayList<BATBlock>(); + List<BATBlock> sbats = new ArrayList<>(); _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), sbats, _header); nextAt = _header.getSBATStart(); for(int i=0; i<_header.getSBATCount() && nextAt != POIFSConstants.END_OF_CHAIN; i++) { diff --git a/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java b/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java index a7479f3194..8ad74a0163 100644 --- a/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java +++ b/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java @@ -149,7 +149,7 @@ public final class OPOIFSDocument implements BATManaged, BlockWritable, POIFSVie * @param stream the InputStream we read data from */ public OPOIFSDocument(String name, POIFSBigBlockSize bigBlockSize, InputStream stream) throws IOException { - List<DocumentBlock> blocks = new ArrayList<DocumentBlock>(); + List<DocumentBlock> blocks = new ArrayList<>(); _size = 0; _bigBigBlockSize = bigBlockSize; diff --git a/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java index 071288c2ac..925fcbaefd 100644 --- a/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java @@ -88,7 +88,7 @@ public class OPOIFSFileSystem { HeaderBlock header_block = new HeaderBlock(bigBlockSize); _property_table = new PropertyTable(header_block); - _documents = new ArrayList<OPOIFSDocument>(); + _documents = new ArrayList<>(); _root = null; } @@ -309,7 +309,7 @@ public class OPOIFSFileSystem // create a list of BATManaged objects: the documents plus the // property table and the small block table - List<Object> bm_objects = new ArrayList<Object>(); + List<Object> bm_objects = new ArrayList<>(); bm_objects.addAll(_documents); bm_objects.add(_property_table); @@ -362,7 +362,7 @@ public class OPOIFSFileSystem // property table, the small block store, the small block // allocation table, the block allocation table, and the // extended block allocation table blocks) - List<Object> writers = new ArrayList<Object>(); + List<Object> writers = new ArrayList<>(); writers.add(header_block_writer); writers.addAll(_documents); diff --git a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java index a0a1990895..bdcd838313 100644 --- a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java +++ b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java @@ -125,7 +125,7 @@ public class VBAMacroReader implements Closeable { final ModuleMap modules = new ModuleMap(); findMacros(fs.getRoot(), modules); - Map<String, String> moduleSources = new HashMap<String, String>(); + Map<String, String> moduleSources = new HashMap<>(); for (Map.Entry<String, Module> entry : modules.entrySet()) { Module module = entry.getValue(); if (module.buf != null && module.buf.length > 0) { // Skip empty modules diff --git a/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java b/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java index 69f3617910..88094f2e62 100644 --- a/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java +++ b/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java @@ -54,7 +54,7 @@ public class FileBackedDataSource extends DataSource { // See https://bz.apache.org/bugzilla/show_bug.cgi?id=58480, // http://stackoverflow.com/questions/3602783/file-access-synchronized-on-java-object and // http://bugs.java.com/view_bug.do?bug_id=4724038 for related discussions - private List<ByteBuffer> buffersToClean = new ArrayList<ByteBuffer>(); + private List<ByteBuffer> buffersToClean = new ArrayList<>(); public FileBackedDataSource(File file) throws FileNotFoundException { this(newSrcFile(file, "r"), true); diff --git a/src/java/org/apache/poi/poifs/property/DirectoryProperty.java b/src/java/org/apache/poi/poifs/property/DirectoryProperty.java index ef4ff3499c..12d0cc855d 100644 --- a/src/java/org/apache/poi/poifs/property/DirectoryProperty.java +++ b/src/java/org/apache/poi/poifs/property/DirectoryProperty.java @@ -46,8 +46,8 @@ public class DirectoryProperty extends Property implements Parent, Iterable<Prop public DirectoryProperty(String name) { super(); - _children = new ArrayList<Property>(); - _children_names = new HashSet<String>(); + _children = new ArrayList<>(); + _children_names = new HashSet<>(); setName(name); setSize(0); setPropertyType(PropertyConstants.DIRECTORY_TYPE); @@ -66,8 +66,8 @@ public class DirectoryProperty extends Property implements Parent, Iterable<Prop final int offset) { super(index, array, offset); - _children = new ArrayList<Property>(); - _children_names = new HashSet<String>(); + _children = new ArrayList<>(); + _children_names = new HashSet<>(); } /** diff --git a/src/java/org/apache/poi/poifs/property/NPropertyTable.java b/src/java/org/apache/poi/poifs/property/NPropertyTable.java index 12b4ffe194..fe948baf2c 100644 --- a/src/java/org/apache/poi/poifs/property/NPropertyTable.java +++ b/src/java/org/apache/poi/poifs/property/NPropertyTable.java @@ -76,7 +76,7 @@ public final class NPropertyTable extends PropertyTableBase { private static List<Property> buildProperties(final Iterator<ByteBuffer> dataSource, final POIFSBigBlockSize bigBlockSize) throws IOException { - List<Property> properties = new ArrayList<Property>(); + List<Property> properties = new ArrayList<>(); while(dataSource.hasNext()) { ByteBuffer bb = dataSource.next(); @@ -126,7 +126,7 @@ public final class NPropertyTable extends PropertyTableBase { * Prepare to be written */ public void preWrite() { - List<Property> pList = new ArrayList<Property>(); + List<Property> pList = new ArrayList<>(); // give each property its index int i=0; for (Property p : _properties) { diff --git a/src/java/org/apache/poi/poifs/property/PropertyFactory.java b/src/java/org/apache/poi/poifs/property/PropertyFactory.java index df3dcba294..1fdf924682 100644 --- a/src/java/org/apache/poi/poifs/property/PropertyFactory.java +++ b/src/java/org/apache/poi/poifs/property/PropertyFactory.java @@ -57,7 +57,7 @@ class PropertyFactory { static List<Property> convertToProperties(ListManagedBlock [] blocks) throws IOException { - List<Property> properties = new ArrayList<Property>(); + List<Property> properties = new ArrayList<>(); for (ListManagedBlock block : blocks) { byte[] data = block.getData(); diff --git a/src/java/org/apache/poi/poifs/property/PropertyTableBase.java b/src/java/org/apache/poi/poifs/property/PropertyTableBase.java index 82f57bf724..a4ed5ace90 100644 --- a/src/java/org/apache/poi/poifs/property/PropertyTableBase.java +++ b/src/java/org/apache/poi/poifs/property/PropertyTableBase.java @@ -44,7 +44,7 @@ public abstract class PropertyTableBase implements BATManaged { public PropertyTableBase(final HeaderBlock header_block) { _header_block = header_block; - _properties = new ArrayList<Property>(); + _properties = new ArrayList<>(); addProperty(new RootProperty()); } @@ -110,7 +110,7 @@ public abstract class PropertyTableBase implements BATManaged { // property has no children return; } - Stack<Property> children = new Stack<Property>(); + Stack<Property> children = new Stack<>(); children.push(_properties.get(index)); while (!children.empty()) diff --git a/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java b/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java index b96ec20886..50341b33c8 100644 --- a/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java +++ b/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java @@ -206,7 +206,7 @@ public final class BlockAllocationTableReader { */ ListManagedBlock[] fetchBlocks(int startBlock, int headerPropertiesStartBlock, BlockList blockList) throws IOException { - List<ListManagedBlock> blocks = new ArrayList<ListManagedBlock>(); + List<ListManagedBlock> blocks = new ArrayList<>(); int currentBlock = startBlock; boolean firstPass = true; ListManagedBlock dataBlock = null; diff --git a/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java b/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java index eb8bcc085c..fd468b6486 100644 --- a/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java +++ b/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java @@ -48,7 +48,7 @@ public class RawDataBlockList public RawDataBlockList(final InputStream stream, POIFSBigBlockSize bigBlockSize) throws IOException { - List<RawDataBlock> blocks = new ArrayList<RawDataBlock>(); + List<RawDataBlock> blocks = new ArrayList<>(); while (true) { diff --git a/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java b/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java index 9c98bb4595..3d2b16fe5b 100644 --- a/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java +++ b/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java @@ -55,7 +55,7 @@ public class SmallBlockTableWriter final RootProperty root) { _sbat = new BlockAllocationTableWriter(bigBlockSize); - _small_blocks = new ArrayList<SmallDocumentBlock>(); + _small_blocks = new ArrayList<>(); _root = root; for (OPOIFSDocument doc : documents) diff --git a/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java b/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java index d09bf9ecf5..711a2d56a3 100644 --- a/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java +++ b/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java @@ -171,7 +171,7 @@ public final class SmallDocumentBlock implements BlockWritable, ListManagedBlock { int _blocks_per_big_block = getBlocksPerBigBlock(bigBlockSize); - List<SmallDocumentBlock> sdbs = new ArrayList<SmallDocumentBlock>(); + List<SmallDocumentBlock> sdbs = new ArrayList<>(); for (int j = 0; j < blocks.length; j++) { diff --git a/src/java/org/apache/poi/sl/draw/DrawFactory.java b/src/java/org/apache/poi/sl/draw/DrawFactory.java index 631b51e0c3..98c41ed993 100644 --- a/src/java/org/apache/poi/sl/draw/DrawFactory.java +++ b/src/java/org/apache/poi/sl/draw/DrawFactory.java @@ -43,7 +43,7 @@ import org.apache.poi.sl.usermodel.TextShape; import org.apache.poi.util.JvmBugs; public class DrawFactory { - protected static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<DrawFactory>(); + protected static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<>(); /** * Set a custom draw factory for the current thread. @@ -224,7 +224,7 @@ public class DrawFactory { @SuppressWarnings("unchecked") Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(Drawable.FONT_MAP); if (fontMap == null) { - fontMap = new HashMap<String,String>(); + fontMap = new HashMap<>(); graphics.setRenderingHint(Drawable.FONT_MAP, fontMap); } diff --git a/src/java/org/apache/poi/sl/draw/DrawFreeformShape.java b/src/java/org/apache/poi/sl/draw/DrawFreeformShape.java index cecf2e9c66..6eb60dfb52 100644 --- a/src/java/org/apache/poi/sl/draw/DrawFreeformShape.java +++ b/src/java/org/apache/poi/sl/draw/DrawFreeformShape.java @@ -34,7 +34,7 @@ public class DrawFreeformShape extends DrawAutoShape { } protected Collection<Outline> computeOutlines(Graphics2D graphics) { - List<Outline> lst = new ArrayList<Outline>(); + List<Outline> lst = new ArrayList<>(); FreeformShape<?,?> fsh = (FreeformShape<?, ?>) getShape(); Path2D sh = fsh.getPath(); diff --git a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java index 912cf3e7a0..c5abefa4c5 100644 --- a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java +++ b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java @@ -119,7 +119,7 @@ public class DrawSimpleShape extends DrawShape { } graphics.setPaint(line); - List<Outline> lst = new ArrayList<Outline>(); + List<Outline> lst = new ArrayList<>(); LineDecoration deco = getShape().getLineDecoration(); Outline head = getHeadDecoration(graphics, deco, stroke); if (head != null) { @@ -347,7 +347,7 @@ public class DrawSimpleShape extends DrawShape { : (Map<String, CustomGeometry>)graphics.getRenderingHint(Drawable.PRESET_GEOMETRY_CACHE); if (presets == null) { - presets = new HashMap<String,CustomGeometry>(); + presets = new HashMap<>(); if (graphics != null) { graphics.setRenderingHint(Drawable.PRESET_GEOMETRY_CACHE, presets); } @@ -398,7 +398,7 @@ public class DrawSimpleShape extends DrawShape { protected Collection<Outline> computeOutlines(Graphics2D graphics) { final SimpleShape<?,?> sh = getShape(); - List<Outline> lst = new ArrayList<Outline>(); + List<Outline> lst = new ArrayList<>(); CustomGeometry geom = sh.getGeometry(); if(geom == null) { return lst; diff --git a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java index c3c1328867..bec5d898f4 100644 --- a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java +++ b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java @@ -67,7 +67,7 @@ public class DrawTextParagraph implements Drawable { protected TextParagraph<?,?,?> paragraph; double x, y; - protected List<DrawTextFragment> lines = new ArrayList<DrawTextFragment>(); + protected List<DrawTextFragment> lines = new ArrayList<>(); protected String rawText; protected DrawTextFragment bullet; protected int autoNbrIdx; @@ -563,7 +563,7 @@ public class DrawTextParagraph implements Drawable { } protected AttributedString getAttributedString(Graphics2D graphics, StringBuilder text){ - List<AttributedStringData> attList = new ArrayList<AttributedStringData>(); + List<AttributedStringData> attList = new ArrayList<>(); if (text == null) { text = new StringBuilder(); } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java b/src/java/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java index 0ca4ce5371..e86e38e763 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java @@ -83,7 +83,7 @@ public class CTAdjustHandleList { */ public List<Object> getAhXYOrAhPolar() { if (ahXYOrAhPolar == null) { - ahXYOrAhPolar = new ArrayList<Object>(); + ahXYOrAhPolar = new ArrayList<>(); } return this.ahXYOrAhPolar; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTColorMRU.java b/src/java/org/apache/poi/sl/draw/binding/CTColorMRU.java index e0d281e28c..7746d2c685 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTColorMRU.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTColorMRU.java @@ -90,7 +90,7 @@ public class CTColorMRU { */ public List<Object> getEGColorChoice() { if (egColorChoice == null) { - egColorChoice = new ArrayList<Object>(); + egColorChoice = new ArrayList<>(); } return this.egColorChoice; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java b/src/java/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java index 0ae1ee14e6..067bd1185c 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java @@ -77,7 +77,7 @@ public class CTConnectionSiteList { */ public List<CTConnectionSite> getCxn() { if (cxn == null) { - cxn = new ArrayList<CTConnectionSite>(); + cxn = new ArrayList<>(); } return this.cxn; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTGeomGuideList.java b/src/java/org/apache/poi/sl/draw/binding/CTGeomGuideList.java index 96886d49bb..8e9df371e1 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTGeomGuideList.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTGeomGuideList.java @@ -77,7 +77,7 @@ public class CTGeomGuideList { */ public List<CTGeomGuide> getGd() { if (gd == null) { - gd = new ArrayList<CTGeomGuide>(); + gd = new ArrayList<>(); } return this.gd; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTHslColor.java b/src/java/org/apache/poi/sl/draw/binding/CTHslColor.java index 3d9f376072..ee9033cdca 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTHslColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTHslColor.java @@ -145,7 +145,7 @@ public class CTHslColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java b/src/java/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java index 4dd5021adc..f0d970f43b 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java @@ -77,7 +77,7 @@ public class CTOfficeArtExtensionList { */ public List<CTOfficeArtExtension> getExt() { if (ext == null) { - ext = new ArrayList<CTOfficeArtExtension>(); + ext = new ArrayList<>(); } return this.ext; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTPath2D.java b/src/java/org/apache/poi/sl/draw/binding/CTPath2D.java index 6b1ba02729..740e9d8907 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTPath2D.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTPath2D.java @@ -111,7 +111,7 @@ public class CTPath2D { */ public List<Object> getCloseOrMoveToOrLnTo() { if (closeOrMoveToOrLnTo == null) { - closeOrMoveToOrLnTo = new ArrayList<Object>(); + closeOrMoveToOrLnTo = new ArrayList<>(); } return this.closeOrMoveToOrLnTo; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java b/src/java/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java index b6042366fb..603f26f008 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java @@ -77,7 +77,7 @@ public class CTPath2DCubicBezierTo { */ public List<CTAdjPoint2D> getPt() { if (pt == null) { - pt = new ArrayList<CTAdjPoint2D>(); + pt = new ArrayList<>(); } return this.pt; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTPath2DList.java b/src/java/org/apache/poi/sl/draw/binding/CTPath2DList.java index 4abc906eb0..2ff060ac05 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTPath2DList.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTPath2DList.java @@ -77,7 +77,7 @@ public class CTPath2DList { */ public List<CTPath2D> getPath() { if (path == null) { - path = new ArrayList<CTPath2D>(); + path = new ArrayList<>(); } return this.path; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java b/src/java/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java index 06f3082047..220e0aa05a 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java @@ -77,7 +77,7 @@ public class CTPath2DQuadBezierTo { */ public List<CTAdjPoint2D> getPt() { if (pt == null) { - pt = new ArrayList<CTAdjPoint2D>(); + pt = new ArrayList<>(); } return this.pt; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTPresetColor.java b/src/java/org/apache/poi/sl/draw/binding/CTPresetColor.java index b1bc857f53..aa88ff03a1 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTPresetColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTPresetColor.java @@ -139,7 +139,7 @@ public class CTPresetColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTSRgbColor.java b/src/java/org/apache/poi/sl/draw/binding/CTSRgbColor.java index be4d49b276..71909e6625 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTSRgbColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTSRgbColor.java @@ -142,7 +142,7 @@ public class CTSRgbColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTScRgbColor.java b/src/java/org/apache/poi/sl/draw/binding/CTScRgbColor.java index 7e8292149f..e95fb91e05 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTScRgbColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTScRgbColor.java @@ -145,7 +145,7 @@ public class CTScRgbColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTSchemeColor.java b/src/java/org/apache/poi/sl/draw/binding/CTSchemeColor.java index fcafd606fc..063f74d1e3 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTSchemeColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTSchemeColor.java @@ -139,7 +139,7 @@ public class CTSchemeColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/CTSystemColor.java b/src/java/org/apache/poi/sl/draw/binding/CTSystemColor.java index b5657ff21b..7e9f33a354 100644 --- a/src/java/org/apache/poi/sl/draw/binding/CTSystemColor.java +++ b/src/java/org/apache/poi/sl/draw/binding/CTSystemColor.java @@ -147,7 +147,7 @@ public class CTSystemColor { */ public List<JAXBElement<?>> getEGColorTransform() { if (egColorTransform == null) { - egColorTransform = new ArrayList<JAXBElement<?>>(); + egColorTransform = new ArrayList<>(); } return this.egColorTransform; } diff --git a/src/java/org/apache/poi/sl/draw/binding/ObjectFactory.java b/src/java/org/apache/poi/sl/draw/binding/ObjectFactory.java index 1a2e14db3a..3ea6e38d5a 100644 --- a/src/java/org/apache/poi/sl/draw/binding/ObjectFactory.java +++ b/src/java/org/apache/poi/sl/draw/binding/ObjectFactory.java @@ -514,7 +514,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); } /** @@ -523,7 +523,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -532,7 +532,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSRgbColor.class) public JAXBElement<CTGammaTransform> createCTSRgbColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSRgbColor.class, value); } /** @@ -541,7 +541,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSRgbColor.class) public JAXBElement<CTInverseGammaTransform> createCTSRgbColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSRgbColor.class, value); } /** @@ -550,7 +550,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -559,7 +559,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSRgbColor.class) public JAXBElement<CTPositivePercentage> createCTSRgbColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); } /** @@ -568,7 +568,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSRgbColor.class) public JAXBElement<CTFixedPercentage> createCTSRgbColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSRgbColor.class, value); } /** @@ -577,7 +577,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -586,7 +586,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -595,7 +595,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSRgbColor.class) public JAXBElement<CTPositiveFixedAngle> createCTSRgbColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSRgbColor.class, value); } /** @@ -604,7 +604,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -613,7 +613,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -622,7 +622,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -631,7 +631,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -640,7 +640,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -649,7 +649,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -658,7 +658,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSRgbColor.class) public JAXBElement<CTAngle> createCTSRgbColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSRgbColor.class, value); } /** @@ -667,7 +667,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -676,7 +676,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); } /** @@ -685,7 +685,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -694,7 +694,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSRgbColor.class) public JAXBElement<CTInverseTransform> createCTSRgbColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSRgbColor.class, value); } /** @@ -703,7 +703,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -712,7 +712,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); } /** @@ -721,7 +721,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -730,7 +730,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSRgbColor.class) public JAXBElement<CTComplementTransform> createCTSRgbColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSRgbColor.class, value); } /** @@ -739,7 +739,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSRgbColor.class) public JAXBElement<CTPercentage> createCTSRgbColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); } /** @@ -748,7 +748,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSRgbColor.class) public JAXBElement<CTPositivePercentage> createCTSRgbColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); } /** @@ -757,7 +757,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSRgbColor.class) public JAXBElement<CTGrayscaleTransform> createCTSRgbColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSRgbColor.class, value); } /** @@ -766,7 +766,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -775,7 +775,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSystemColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); } /** @@ -784,7 +784,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSystemColor.class) public JAXBElement<CTGammaTransform> createCTSystemColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSystemColor.class, value); } /** @@ -793,7 +793,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSystemColor.class) public JAXBElement<CTInverseGammaTransform> createCTSystemColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSystemColor.class, value); } /** @@ -802,7 +802,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSystemColor.class) public JAXBElement<CTPositivePercentage> createCTSystemColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); } /** @@ -811,7 +811,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -820,7 +820,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSystemColor.class) public JAXBElement<CTFixedPercentage> createCTSystemColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSystemColor.class, value); } /** @@ -829,7 +829,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -838,7 +838,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -847,7 +847,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSystemColor.class) public JAXBElement<CTPositiveFixedAngle> createCTSystemColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSystemColor.class, value); } /** @@ -856,7 +856,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -865,7 +865,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -874,7 +874,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -883,7 +883,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -892,7 +892,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -901,7 +901,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -910,7 +910,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -919,7 +919,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSystemColor.class) public JAXBElement<CTAngle> createCTSystemColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSystemColor.class, value); } /** @@ -928,7 +928,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSystemColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); } /** @@ -937,7 +937,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -946,7 +946,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSystemColor.class) public JAXBElement<CTInverseTransform> createCTSystemColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSystemColor.class, value); } /** @@ -955,7 +955,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -964,7 +964,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSystemColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); } /** @@ -973,7 +973,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -982,7 +982,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSystemColor.class) public JAXBElement<CTComplementTransform> createCTSystemColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSystemColor.class, value); } /** @@ -991,7 +991,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSystemColor.class) public JAXBElement<CTPercentage> createCTSystemColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSystemColor.class, value); } /** @@ -1000,7 +1000,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSystemColor.class) public JAXBElement<CTPositivePercentage> createCTSystemColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); } /** @@ -1009,7 +1009,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSystemColor.class) public JAXBElement<CTGrayscaleTransform> createCTSystemColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSystemColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSystemColor.class, value); } /** @@ -1018,7 +1018,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1027,7 +1027,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSchemeColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); } /** @@ -1036,7 +1036,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSchemeColor.class) public JAXBElement<CTGammaTransform> createCTSchemeColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSchemeColor.class, value); } /** @@ -1045,7 +1045,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSchemeColor.class) public JAXBElement<CTInverseGammaTransform> createCTSchemeColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSchemeColor.class, value); } /** @@ -1054,7 +1054,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1063,7 +1063,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSchemeColor.class) public JAXBElement<CTPositivePercentage> createCTSchemeColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); } /** @@ -1072,7 +1072,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSchemeColor.class) public JAXBElement<CTFixedPercentage> createCTSchemeColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSchemeColor.class, value); } /** @@ -1081,7 +1081,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1090,7 +1090,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSchemeColor.class) public JAXBElement<CTPositiveFixedAngle> createCTSchemeColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSchemeColor.class, value); } /** @@ -1099,7 +1099,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1108,7 +1108,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1117,7 +1117,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1126,7 +1126,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1135,7 +1135,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1144,7 +1144,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1153,7 +1153,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1162,7 +1162,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSchemeColor.class) public JAXBElement<CTAngle> createCTSchemeColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSchemeColor.class, value); } /** @@ -1171,7 +1171,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1180,7 +1180,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSchemeColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); } /** @@ -1189,7 +1189,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1198,7 +1198,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSchemeColor.class) public JAXBElement<CTInverseTransform> createCTSchemeColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSchemeColor.class, value); } /** @@ -1207,7 +1207,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1216,7 +1216,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSchemeColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); } /** @@ -1225,7 +1225,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1234,7 +1234,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSchemeColor.class) public JAXBElement<CTComplementTransform> createCTSchemeColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSchemeColor.class, value); } /** @@ -1243,7 +1243,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSchemeColor.class) public JAXBElement<CTPercentage> createCTSchemeColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); } /** @@ -1252,7 +1252,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSchemeColor.class) public JAXBElement<CTPositivePercentage> createCTSchemeColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); } /** @@ -1261,7 +1261,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSchemeColor.class) public JAXBElement<CTGrayscaleTransform> createCTSchemeColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSchemeColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSchemeColor.class, value); } /** @@ -1270,7 +1270,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1279,7 +1279,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTScRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); } /** @@ -1288,7 +1288,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTScRgbColor.class) public JAXBElement<CTGammaTransform> createCTScRgbColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTScRgbColor.class, value); } /** @@ -1297,7 +1297,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTScRgbColor.class) public JAXBElement<CTInverseGammaTransform> createCTScRgbColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTScRgbColor.class, value); } /** @@ -1306,7 +1306,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1315,7 +1315,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTScRgbColor.class) public JAXBElement<CTPositivePercentage> createCTScRgbColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); } /** @@ -1324,7 +1324,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTScRgbColor.class) public JAXBElement<CTFixedPercentage> createCTScRgbColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTScRgbColor.class, value); } /** @@ -1333,7 +1333,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1342,7 +1342,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTScRgbColor.class) public JAXBElement<CTPositiveFixedAngle> createCTScRgbColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTScRgbColor.class, value); } /** @@ -1351,7 +1351,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1360,7 +1360,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1369,7 +1369,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1378,7 +1378,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1387,7 +1387,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1396,7 +1396,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1405,7 +1405,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1414,7 +1414,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTScRgbColor.class) public JAXBElement<CTAngle> createCTScRgbColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTScRgbColor.class, value); } /** @@ -1423,7 +1423,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1432,7 +1432,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTScRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); } /** @@ -1441,7 +1441,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1450,7 +1450,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTScRgbColor.class) public JAXBElement<CTInverseTransform> createCTScRgbColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTScRgbColor.class, value); } /** @@ -1459,7 +1459,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1468,7 +1468,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTScRgbColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); } /** @@ -1477,7 +1477,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1486,7 +1486,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTScRgbColor.class) public JAXBElement<CTComplementTransform> createCTScRgbColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTScRgbColor.class, value); } /** @@ -1495,7 +1495,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTScRgbColor.class) public JAXBElement<CTPercentage> createCTScRgbColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); } /** @@ -1504,7 +1504,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTScRgbColor.class) public JAXBElement<CTPositivePercentage> createCTScRgbColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); } /** @@ -1513,7 +1513,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTScRgbColor.class) public JAXBElement<CTGrayscaleTransform> createCTScRgbColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTScRgbColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTScRgbColor.class, value); } /** @@ -1522,7 +1522,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTHslColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTHslColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); } /** @@ -1531,7 +1531,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1540,7 +1540,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTHslColor.class) public JAXBElement<CTGammaTransform> createCTHslColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTHslColor.class, value); } /** @@ -1549,7 +1549,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTHslColor.class) public JAXBElement<CTInverseGammaTransform> createCTHslColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTHslColor.class, value); } /** @@ -1558,7 +1558,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTHslColor.class) public JAXBElement<CTPositivePercentage> createCTHslColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); } /** @@ -1567,7 +1567,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1576,7 +1576,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTHslColor.class) public JAXBElement<CTFixedPercentage> createCTHslColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTHslColor.class, value); } /** @@ -1585,7 +1585,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1594,7 +1594,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTHslColor.class) public JAXBElement<CTPositiveFixedAngle> createCTHslColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTHslColor.class, value); } /** @@ -1603,7 +1603,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1612,7 +1612,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1621,7 +1621,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1630,7 +1630,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1639,7 +1639,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1648,7 +1648,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1657,7 +1657,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1666,7 +1666,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1675,7 +1675,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTHslColor.class) public JAXBElement<CTAngle> createCTHslColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTHslColor.class, value); } /** @@ -1684,7 +1684,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTHslColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTHslColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); } /** @@ -1693,7 +1693,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1702,7 +1702,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTHslColor.class) public JAXBElement<CTInverseTransform> createCTHslColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTHslColor.class, value); } /** @@ -1711,7 +1711,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1720,7 +1720,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTHslColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTHslColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); } /** @@ -1729,7 +1729,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1738,7 +1738,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTHslColor.class) public JAXBElement<CTComplementTransform> createCTHslColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTHslColor.class, value); } /** @@ -1747,7 +1747,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTHslColor.class) public JAXBElement<CTPercentage> createCTHslColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTHslColor.class, value); } /** @@ -1756,7 +1756,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTHslColor.class) public JAXBElement<CTPositivePercentage> createCTHslColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); } /** @@ -1765,7 +1765,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTHslColor.class) public JAXBElement<CTGrayscaleTransform> createCTHslColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTHslColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTHslColor.class, value); } /** @@ -1774,7 +1774,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorLum(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1783,7 +1783,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTPresetColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorAlpha(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); } /** @@ -1792,7 +1792,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTPresetColor.class) public JAXBElement<CTGammaTransform> createCTPresetColorGamma(CTGammaTransform value) { - return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTPresetColor.class, value); } /** @@ -1801,7 +1801,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTPresetColor.class) public JAXBElement<CTInverseGammaTransform> createCTPresetColorInvGamma(CTInverseGammaTransform value) { - return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTPresetColor.class, value); } /** @@ -1810,7 +1810,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorRedOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1819,7 +1819,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTPresetColor.class) public JAXBElement<CTPositivePercentage> createCTPresetColorAlphaMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); } /** @@ -1828,7 +1828,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTPresetColor.class) public JAXBElement<CTFixedPercentage> createCTPresetColorAlphaOff(CTFixedPercentage value) { - return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTPresetColor.class, value); } /** @@ -1837,7 +1837,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorGreenOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1846,7 +1846,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTPresetColor.class) public JAXBElement<CTPositiveFixedAngle> createCTPresetColorHue(CTPositiveFixedAngle value) { - return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTPresetColor.class, value); } /** @@ -1855,7 +1855,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorRedMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1864,7 +1864,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorSatOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1873,7 +1873,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorGreenMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1882,7 +1882,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorBlue(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1891,7 +1891,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorSat(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1900,7 +1900,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorRed(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1909,7 +1909,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorSatMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1918,7 +1918,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorBlueMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1927,7 +1927,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTPresetColor.class) public JAXBElement<CTAngle> createCTPresetColorHueOff(CTAngle value) { - return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTPresetColor.class, value); } /** @@ -1936,7 +1936,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTPresetColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorShade(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); } /** @@ -1945,7 +1945,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorLumMod(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1954,7 +1954,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTPresetColor.class) public JAXBElement<CTInverseTransform> createCTPresetColorInv(CTInverseTransform value) { - return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTPresetColor.class, value); } /** @@ -1963,7 +1963,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorLumOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1972,7 +1972,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTPresetColor.class) public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorTint(CTPositiveFixedPercentage value) { - return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); } /** @@ -1981,7 +1981,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorGreen(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -1990,7 +1990,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTPresetColor.class) public JAXBElement<CTComplementTransform> createCTPresetColorComp(CTComplementTransform value) { - return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTPresetColor.class, value); } /** @@ -1999,7 +1999,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTPresetColor.class) public JAXBElement<CTPercentage> createCTPresetColorBlueOff(CTPercentage value) { - return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTPresetColor.class, value); } /** @@ -2008,7 +2008,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTPresetColor.class) public JAXBElement<CTPositivePercentage> createCTPresetColorHueMod(CTPositivePercentage value) { - return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); } /** @@ -2017,7 +2017,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTPresetColor.class) public JAXBElement<CTGrayscaleTransform> createCTPresetColorGray(CTGrayscaleTransform value) { - return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTPresetColor.class, value); + return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTPresetColor.class, value); } } diff --git a/src/java/org/apache/poi/sl/draw/geom/Context.java b/src/java/org/apache/poi/sl/draw/geom/Context.java index 118c87f653..283444a980 100644 --- a/src/java/org/apache/poi/sl/draw/geom/Context.java +++ b/src/java/org/apache/poi/sl/draw/geom/Context.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; public class Context { - final Map<String, Double> _ctx = new HashMap<String, Double>(); + final Map<String, Double> _ctx = new HashMap<>(); final IAdjustableShape _props; final Rectangle2D _anchor; diff --git a/src/java/org/apache/poi/sl/draw/geom/CustomGeometry.java b/src/java/org/apache/poi/sl/draw/geom/CustomGeometry.java index 1250618bf5..2be58130a5 100644 --- a/src/java/org/apache/poi/sl/draw/geom/CustomGeometry.java +++ b/src/java/org/apache/poi/sl/draw/geom/CustomGeometry.java @@ -34,9 +34,9 @@ import org.apache.poi.sl.draw.binding.CTPath2DList; * Definition of a custom geometric shape */ public class CustomGeometry implements Iterable<Path>{ - final List<Guide> adjusts = new ArrayList<Guide>(); - final List<Guide> guides = new ArrayList<Guide>(); - final List<Path> paths = new ArrayList<Path>(); + final List<Guide> adjusts = new ArrayList<>(); + final List<Guide> guides = new ArrayList<>(); + final List<Path> paths = new ArrayList<>(); Path textBounds; public CustomGeometry(CTCustomGeometry2D geom) { diff --git a/src/java/org/apache/poi/sl/draw/geom/Path.java b/src/java/org/apache/poi/sl/draw/geom/Path.java index cf50f49c9b..07ec9f861f 100644 --- a/src/java/org/apache/poi/sl/draw/geom/Path.java +++ b/src/java/org/apache/poi/sl/draw/geom/Path.java @@ -49,7 +49,7 @@ public class Path { } public Path(boolean fill, boolean stroke){ - commands = new ArrayList<PathCommand>(); + commands = new ArrayList<>(); _w = -1; _h = -1; _fill = (fill) ? PaintModifier.NORM : PaintModifier.NONE; @@ -70,7 +70,7 @@ public class Path { _w = spPath.isSetW() ? spPath.getW() : -1; _h = spPath.isSetH() ? spPath.getH() : -1; - commands = new ArrayList<PathCommand>(); + commands = new ArrayList<>(); for(Object ch : spPath.getCloseOrMoveToOrLnTo()){ if(ch instanceof CTPath2DMoveTo){ diff --git a/src/java/org/apache/poi/sl/usermodel/PresetColor.java b/src/java/org/apache/poi/sl/usermodel/PresetColor.java index b5c8e1ad56..9c4df2f9f6 100644 --- a/src/java/org/apache/poi/sl/usermodel/PresetColor.java +++ b/src/java/org/apache/poi/sl/usermodel/PresetColor.java @@ -260,7 +260,7 @@ public enum PresetColor { private static final Map<String,PresetColor> lookupOoxmlId; static { - lookupOoxmlId = new HashMap<String,PresetColor>(); + lookupOoxmlId = new HashMap<>(); for(PresetColor pc : PresetColor.values()) { if (pc.ooxmlId != null) { lookupOoxmlId.put(pc.ooxmlId, pc); diff --git a/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java b/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java index c0cdb7b90c..12654a7944 100644 --- a/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java +++ b/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java @@ -132,7 +132,7 @@ public class CellElapsedFormatter extends CellFormatter { public CellElapsedFormatter(String pattern) { super(pattern); - specs = new ArrayList<TimeSpec>(); + specs = new ArrayList<>(); StringBuffer desc = CellFormatPart.parseFormat(pattern, CellFormatType.ELAPSED, new ElapsedPartHandler()); diff --git a/src/java/org/apache/poi/ss/format/CellFormat.java b/src/java/org/apache/poi/ss/format/CellFormat.java index 832c793dd1..6d2b4e9711 100644 --- a/src/java/org/apache/poi/ss/format/CellFormat.java +++ b/src/java/org/apache/poi/ss/format/CellFormat.java @@ -129,7 +129,7 @@ public class CellFormat { /** Maps a format string to its parsed version for efficiencies sake. */ private static final Map<Locale, Map<String, CellFormat>> formatCache = - new WeakHashMap<Locale, Map<String, CellFormat>>(); + new WeakHashMap<>(); /** * Returns a {@link CellFormat} that applies the given format. Two calls @@ -155,7 +155,7 @@ public class CellFormat { public static synchronized CellFormat getInstance(Locale locale, String format) { Map<String, CellFormat> formatMap = formatCache.get(locale); if (formatMap == null) { - formatMap = new WeakHashMap<String, CellFormat>(); + formatMap = new WeakHashMap<>(); formatCache.put(locale, formatMap); } CellFormat fmt = formatMap.get(format); @@ -179,7 +179,7 @@ public class CellFormat { this.format = format; CellFormatPart defaultTextFormat = new CellFormatPart(locale, "@"); Matcher m = ONE_PART.matcher(format); - List<CellFormatPart> parts = new ArrayList<CellFormatPart>(); + List<CellFormatPart> parts = new ArrayList<>(); while (m.find()) { try { diff --git a/src/java/org/apache/poi/ss/format/CellFormatCondition.java b/src/java/org/apache/poi/ss/format/CellFormatCondition.java index 23fd2f2e7a..96e9c5fcd8 100644 --- a/src/java/org/apache/poi/ss/format/CellFormatCondition.java +++ b/src/java/org/apache/poi/ss/format/CellFormatCondition.java @@ -35,7 +35,7 @@ public abstract class CellFormatCondition { private static final Map<String, Integer> TESTS; static { - TESTS = new HashMap<String, Integer>(); + TESTS = new HashMap<>(); TESTS.put("<", LT); TESTS.put("<=", LE); TESTS.put(">", GT); diff --git a/src/java/org/apache/poi/ss/format/CellFormatPart.java b/src/java/org/apache/poi/ss/format/CellFormatPart.java index 699475760c..02a4797835 100644 --- a/src/java/org/apache/poi/ss/format/CellFormatPart.java +++ b/src/java/org/apache/poi/ss/format/CellFormatPart.java @@ -56,7 +56,7 @@ public class CellFormatPart { private static final Map<String, Color> NAMED_COLORS; static { - NAMED_COLORS = new TreeMap<String, Color>( + NAMED_COLORS = new TreeMap<>( String.CASE_INSENSITIVE_ORDER); Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash(); diff --git a/src/java/org/apache/poi/ss/format/CellNumberFormatter.java b/src/java/org/apache/poi/ss/format/CellNumberFormatter.java index 2c193fac2b..acd9838821 100644 --- a/src/java/org/apache/poi/ss/format/CellNumberFormatter.java +++ b/src/java/org/apache/poi/ss/format/CellNumberFormatter.java @@ -50,13 +50,13 @@ public class CellNumberFormatter extends CellFormatter { private final Special afterInteger; private final Special afterFractional; private final boolean showGroupingSeparator; - private final List<Special> specials = new ArrayList<Special>(); - private final List<Special> integerSpecials = new ArrayList<Special>(); - private final List<Special> fractionalSpecials = new ArrayList<Special>(); - private final List<Special> numeratorSpecials = new ArrayList<Special>(); - private final List<Special> denominatorSpecials = new ArrayList<Special>(); - private final List<Special> exponentSpecials = new ArrayList<Special>(); - private final List<Special> exponentDigitSpecials = new ArrayList<Special>(); + private final List<Special> specials = new ArrayList<>(); + private final List<Special> integerSpecials = new ArrayList<>(); + private final List<Special> fractionalSpecials = new ArrayList<>(); + private final List<Special> numeratorSpecials = new ArrayList<>(); + private final List<Special> denominatorSpecials = new ArrayList<>(); + private final List<Special> exponentSpecials = new ArrayList<>(); + private final List<Special> exponentDigitSpecials = new ArrayList<>(); private final int maxDenominator; private final String numeratorFmt; private final String denominatorFmt; @@ -448,7 +448,7 @@ public class CellNumberFormatter extends CellFormatter { } } - Set<CellNumberStringMod> mods = new TreeSet<CellNumberStringMod>(); + Set<CellNumberStringMod> mods = new TreeSet<>(); StringBuffer output = new StringBuffer(localiseFormat(desc)); if (exponent != null) { diff --git a/src/java/org/apache/poi/ss/format/CellNumberPartHandler.java b/src/java/org/apache/poi/ss/format/CellNumberPartHandler.java index 8f2c024abb..a9af31851f 100644 --- a/src/java/org/apache/poi/ss/format/CellNumberPartHandler.java +++ b/src/java/org/apache/poi/ss/format/CellNumberPartHandler.java @@ -36,7 +36,7 @@ public class CellNumberPartHandler implements PartHandler { private Special slash; private Special exponent; private Special numerator; - private final List<Special> specials = new LinkedList<Special>(); + private final List<Special> specials = new LinkedList<>(); private boolean improperFraction; public String handlePart(Matcher m, String part, CellFormatType type, StringBuffer descBuf) { diff --git a/src/java/org/apache/poi/ss/formula/CellEvaluationFrame.java b/src/java/org/apache/poi/ss/formula/CellEvaluationFrame.java index 1d08eac1be..7abfce3c80 100644 --- a/src/java/org/apache/poi/ss/formula/CellEvaluationFrame.java +++ b/src/java/org/apache/poi/ss/formula/CellEvaluationFrame.java @@ -33,7 +33,7 @@ final class CellEvaluationFrame { public CellEvaluationFrame(FormulaCellCacheEntry cce) { _cce = cce; - _sensitiveInputCells = new HashSet<CellCacheEntry>(); + _sensitiveInputCells = new HashSet<>(); } public CellCacheEntry getCCE() { return _cce; diff --git a/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java b/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java index 58ce3d929f..bfd1f4e35b 100644 --- a/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java +++ b/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java @@ -75,7 +75,7 @@ public final class CollaboratingWorkbooksEnvironment { new CollaboratingWorkbooksEnvironment(evaluatorsByName, evaluators); } public static void setupFormulaEvaluator(Map<String,FormulaEvaluator> evaluators) { - Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<String, WorkbookEvaluator>(evaluators.size()); + Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<>(evaluators.size()); for (Map.Entry<String,FormulaEvaluator> swb : evaluators.entrySet()) { String wbName = swb.getKey(); FormulaEvaluator eval = swb.getValue(); @@ -93,7 +93,7 @@ public final class CollaboratingWorkbooksEnvironment { this(toUniqueMap(workbookNames, evaluators, nItems), evaluators); } private static Map<String, WorkbookEvaluator> toUniqueMap(String[] workbookNames, WorkbookEvaluator[] evaluators, int nItems) { - Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<String, WorkbookEvaluator>(nItems * 3 / 2); + Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<>(nItems * 3 / 2); for(int i=0; i<nItems; i++) { String wbName = workbookNames[i]; WorkbookEvaluator wbEval = evaluators[i]; @@ -105,7 +105,7 @@ public final class CollaboratingWorkbooksEnvironment { return evaluatorsByName; } private CollaboratingWorkbooksEnvironment(Map<String, WorkbookEvaluator> evaluatorsByName, WorkbookEvaluator[] evaluators) { - IdentityHashMap<WorkbookEvaluator, String> uniqueEvals = new IdentityHashMap<WorkbookEvaluator, String>(evaluators.length); + IdentityHashMap<WorkbookEvaluator, String> uniqueEvals = new IdentityHashMap<>(evaluators.length); for (Map.Entry<String, WorkbookEvaluator> me : evaluatorsByName.entrySet()) { String uniEval = uniqueEvals.put(me.getValue(), me.getKey()); if (uniEval != null) { @@ -144,7 +144,7 @@ public final class CollaboratingWorkbooksEnvironment { * Completely dismantles all workbook environments that the supplied evaluators are part of */ private void unhookOldEnvironments(WorkbookEvaluator[] evaluators) { - Set<CollaboratingWorkbooksEnvironment> oldEnvs = new HashSet<CollaboratingWorkbooksEnvironment>(); + Set<CollaboratingWorkbooksEnvironment> oldEnvs = new HashSet<>(); for(int i=0; i<evaluators.length; i++) { oldEnvs.add(evaluators[i].getEnvironment()); } diff --git a/src/java/org/apache/poi/ss/formula/ConditionalFormattingEvaluator.java b/src/java/org/apache/poi/ss/formula/ConditionalFormattingEvaluator.java index fcc35c8f15..fee64cc06d 100644 --- a/src/java/org/apache/poi/ss/formula/ConditionalFormattingEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/ConditionalFormattingEvaluator.java @@ -60,7 +60,7 @@ public class ConditionalFormattingEvaluator { * there's no guarantee instances won't be recreated on the fly by some implementation. * So we use sheet name. */ - private final Map<String, List<EvaluationConditionalFormatRule>> formats = new HashMap<String, List<EvaluationConditionalFormatRule>>(); + private final Map<String, List<EvaluationConditionalFormatRule>> formats = new HashMap<>(); /** * Evaluating rules for cells in their region(s) is expensive, so we want to cache them, @@ -70,7 +70,7 @@ public class ConditionalFormattingEvaluator { * <p> * CellReference implements equals(). */ - private final Map<CellReference, List<EvaluationConditionalFormatRule>> values = new HashMap<CellReference, List<EvaluationConditionalFormatRule>>(); + private final Map<CellReference, List<EvaluationConditionalFormatRule>> values = new HashMap<>(); public ConditionalFormattingEvaluator(Workbook wb, WorkbookEvaluatorProvider provider) { this.workbook = wb; @@ -115,7 +115,7 @@ public class ConditionalFormattingEvaluator { } final SheetConditionalFormatting scf = sheet.getSheetConditionalFormatting(); final int count = scf.getNumConditionalFormattings(); - rules = new ArrayList<EvaluationConditionalFormatRule>(count); + rules = new ArrayList<>(count); formats.put(sheetName, rules); for (int i=0; i < count; i++) { ConditionalFormatting f = scf.getConditionalFormattingAt(i); @@ -154,7 +154,7 @@ public class ConditionalFormattingEvaluator { if (rules == null) { // compute and cache them - rules = new ArrayList<EvaluationConditionalFormatRule>(); + rules = new ArrayList<>(); Sheet sheet = null; if (cellRef.getSheetName() != null) sheet = workbook.getSheet(cellRef.getSheetName()); @@ -252,7 +252,7 @@ public class ConditionalFormattingEvaluator { * @return unmodifiable List of all cells in the rule's region matching the rule's condition */ public List<Cell> getMatchingCells(EvaluationConditionalFormatRule rule) { - final List<Cell> cells = new ArrayList<Cell>(); + final List<Cell> cells = new ArrayList<>(); final Sheet sheet = rule.getSheet(); for (CellRangeAddress region : rule.getRegions()) { diff --git a/src/java/org/apache/poi/ss/formula/DataValidationEvaluator.java b/src/java/org/apache/poi/ss/formula/DataValidationEvaluator.java index 46ebe13304..866669016f 100644 --- a/src/java/org/apache/poi/ss/formula/DataValidationEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/DataValidationEvaluator.java @@ -63,7 +63,7 @@ public class DataValidationEvaluator { * there's no guarantee instances won't be recreated on the fly by some implementation. * So we use sheet name. */ - private final Map<String, List<? extends DataValidation>> validations = new HashMap<String, List<? extends DataValidation>>(); + private final Map<String, List<? extends DataValidation>> validations = new HashMap<>(); private final Workbook workbook; private final WorkbookEvaluator workbookEvaluator; @@ -187,7 +187,7 @@ public class DataValidationEvaluator { String formula = val.getFormula1(); - final List<ValueEval> values = new ArrayList<ValueEval>(); + final List<ValueEval> values = new ArrayList<>(); if (val.getExplicitListValues() != null && val.getExplicitListValues().length > 0) { // assumes parsing interprets the overloaded property right for XSSF diff --git a/src/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java b/src/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java index 56c19472fc..8bfe0932c3 100644 --- a/src/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java +++ b/src/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java @@ -78,7 +78,7 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon * Depending on the rule type, it may want to know about certain values in the region when evaluating {@link #matches(Cell)}, * such as top 10, unique, duplicate, average, etc. This collection stores those if needed so they are not repeatedly calculated */ - private final Map<CellRangeAddress, Set<ValueAndFormat>> meaningfulRegionValues = new HashMap<CellRangeAddress, Set<ValueAndFormat>>(); + private final Map<CellRangeAddress, Set<ValueAndFormat>> meaningfulRegionValues = new HashMap<>(); private final int priority; private final int formattingIndex; @@ -435,10 +435,10 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon limit = allValues.size() * limit / 100; } if (allValues.size() <= limit) { - return new HashSet<ValueAndFormat>(allValues); + return new HashSet<>(allValues); } - return new HashSet<ValueAndFormat>(allValues.subList(0, limit)); + return new HashSet<>(allValues.subList(0, limit)); } }).contains(cv); case UNIQUE_VALUES: @@ -450,7 +450,7 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon List<ValueAndFormat> values = allValues; Collections.sort(values); - final Set<ValueAndFormat> unique = new HashSet<ValueAndFormat>(); + final Set<ValueAndFormat> unique = new HashSet<>(); for (int i=0; i < values.size(); i++) { final ValueAndFormat v = values.get(i); @@ -475,7 +475,7 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon List<ValueAndFormat> values = allValues; Collections.sort(values); - final Set<ValueAndFormat> dup = new HashSet<ValueAndFormat>(); + final Set<ValueAndFormat> dup = new HashSet<>(); for (int i=0; i < values.size(); i++) { final ValueAndFormat v = values.get(i); @@ -496,21 +496,21 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon final ConditionFilterData conf = rule.getFilterConfiguration(); // actually ordered, so iteration order is predictable - List<ValueAndFormat> values = new ArrayList<ValueAndFormat>(getMeaningfulValues(region, false, new ValueFunction() { + List<ValueAndFormat> values = new ArrayList<>(getMeaningfulValues(region, false, new ValueFunction() { @Override public Set<ValueAndFormat> evaluate(List<ValueAndFormat> allValues) { List<ValueAndFormat> values = allValues; double total = 0; ValueEval[] pop = new ValueEval[values.size()]; - for (int i=0; i < values.size(); i++) { + for (int i = 0; i < values.size(); i++) { ValueAndFormat v = values.get(i); total += v.value.doubleValue(); pop[i] = new NumberEval(v.value.doubleValue()); } - - final Set<ValueAndFormat> avgSet = new LinkedHashSet<ValueAndFormat>(1); + + final Set<ValueAndFormat> avgSet = new LinkedHashSet<>(1); avgSet.add(new ValueAndFormat(new Double(values.size() == 0 ? 0 : total / values.size()), null)); - + final double stdDev = values.size() <= 1 ? 0 : ((NumberEval) AggregateFunction.STDEV.evaluate(pop, 0, 0)).getNumberValue(); avgSet.add(new ValueAndFormat(new Double(stdDev), null)); return avgSet; @@ -603,7 +603,7 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon return values; } - List<ValueAndFormat> allValues = new ArrayList<ValueAndFormat>((region.getLastColumn() - region.getFirstColumn()+1) * (region.getLastRow() - region.getFirstRow() + 1)); + List<ValueAndFormat> allValues = new ArrayList<>((region.getLastColumn() - region.getFirstColumn() + 1) * (region.getLastRow() - region.getFirstRow() + 1)); for (int r=region.getFirstRow(); r <= region.getLastRow(); r++) { final Row row = sheet.getRow(r); diff --git a/src/java/org/apache/poi/ss/formula/EvaluationTracker.java b/src/java/org/apache/poi/ss/formula/EvaluationTracker.java index bb21e4a8c7..35b7f32ba0 100644 --- a/src/java/org/apache/poi/ss/formula/EvaluationTracker.java +++ b/src/java/org/apache/poi/ss/formula/EvaluationTracker.java @@ -43,8 +43,8 @@ final class EvaluationTracker { public EvaluationTracker(EvaluationCache cache) { _cache = cache; - _evaluationFrames = new ArrayList<CellEvaluationFrame>(); - _currentlyEvaluatingCells = new HashSet<FormulaCellCacheEntry>(); + _evaluationFrames = new ArrayList<>(); + _currentlyEvaluatingCells = new HashSet<>(); } /** diff --git a/src/java/org/apache/poi/ss/formula/FormulaCellCache.java b/src/java/org/apache/poi/ss/formula/FormulaCellCache.java index 63a1da166d..fc097eb884 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaCellCache.java +++ b/src/java/org/apache/poi/ss/formula/FormulaCellCache.java @@ -35,7 +35,7 @@ final class FormulaCellCache { public FormulaCellCache() { // assumes the object returned by EvaluationCell.getIdentityKey() has a well behaved hashCode+equals - _formulaEntriesByCell = new HashMap<Object, FormulaCellCacheEntry>(); + _formulaEntriesByCell = new HashMap<>(); } public CellCacheEntry[] getCacheEntries() { diff --git a/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java b/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java index 0561956181..63142e88b6 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java +++ b/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java @@ -93,7 +93,7 @@ final class FormulaCellCacheEntry extends CellCacheEntry { if (nUsed < 1) { usedSet = Collections.emptySet(); } else { - usedSet = new HashSet<CellCacheEntry>(nUsed * 3 / 2); + usedSet = new HashSet<>(nUsed * 3 / 2); for (int i = 0; i < nUsed; i++) { usedSet.add(usedCells[i]); } diff --git a/src/java/org/apache/poi/ss/formula/FormulaParser.java b/src/java/org/apache/poi/ss/formula/FormulaParser.java index fd17aca184..f64f687550 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaParser.java +++ b/src/java/org/apache/poi/ss/formula/FormulaParser.java @@ -1448,7 +1448,7 @@ public final class FormulaParser { /** get arguments to a function */ private ParseNode[] Arguments() { //average 2 args per function - List<ParseNode> temp = new ArrayList<ParseNode>(2); + List<ParseNode> temp = new ArrayList<>(2); SkipWhite(); if(look == ')') { return ParseNode.EMPTY_ARRAY; @@ -1576,7 +1576,7 @@ public final class FormulaParser { } private ParseNode parseArray() { - List<Object[]> rowsData = new ArrayList<Object[]>(); + List<Object[]> rowsData = new ArrayList<>(); while(true) { Object[] singleRowData = parseArrayRow(); rowsData.add(singleRowData); @@ -1607,7 +1607,7 @@ public final class FormulaParser { } private Object[] parseArrayRow() { - List<Object> temp = new ArrayList<Object>(); + List<Object> temp = new ArrayList<>(); while (true) { temp.add(parseArrayItem()); SkipWhite(); diff --git a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java index 208f55918c..c247b1b61e 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java +++ b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java @@ -47,7 +47,7 @@ public class FormulaRenderer { if (ptgs == null || ptgs.length == 0) { throw new IllegalArgumentException("ptgs must not be null"); } - Stack<String> stack = new Stack<String>(); + Stack<String> stack = new Stack<>(); for (Ptg ptg : ptgs) { // TODO - what about MemNoMemPtg? diff --git a/src/java/org/apache/poi/ss/formula/FormulaUsedBlankCellSet.java b/src/java/org/apache/poi/ss/formula/FormulaUsedBlankCellSet.java index a07cb9c70b..69069f9056 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaUsedBlankCellSet.java +++ b/src/java/org/apache/poi/ss/formula/FormulaUsedBlankCellSet.java @@ -59,7 +59,7 @@ final class FormulaUsedBlankCellSet { private BlankCellRectangleGroup _currentRectangleGroup; public BlankCellSheetGroup() { - _rectangleGroups = new ArrayList<BlankCellRectangleGroup>(); + _rectangleGroups = new ArrayList<>(); _currentRowIndex = -1; } @@ -164,7 +164,7 @@ final class FormulaUsedBlankCellSet { private final Map<BookSheetKey, BlankCellSheetGroup> _sheetGroupsByBookSheet; public FormulaUsedBlankCellSet() { - _sheetGroupsByBookSheet = new HashMap<BookSheetKey, BlankCellSheetGroup>(); + _sheetGroupsByBookSheet = new HashMap<>(); } public void addCell(int bookIndex, int sheetIndex, int rowIndex, int columnIndex) { diff --git a/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java b/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java index 44faa06023..58d3130a4e 100644 --- a/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java +++ b/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java @@ -71,7 +71,7 @@ final class OperationEvaluatorFactory { } private static Map<OperationPtg, Function> initialiseInstancesMap() { - Map<OperationPtg, Function> m = new HashMap<OperationPtg, Function>(32); + Map<OperationPtg, Function> m = new HashMap<>(32); put(m, EqualPtg.instance, RelationalOperationEval.EqualEval); put(m, GreaterEqualPtg.instance, RelationalOperationEval.GreaterEqualEval); diff --git a/src/java/org/apache/poi/ss/formula/PlainCellCache.java b/src/java/org/apache/poi/ss/formula/PlainCellCache.java index 2514c0711f..30a01745ec 100644 --- a/src/java/org/apache/poi/ss/formula/PlainCellCache.java +++ b/src/java/org/apache/poi/ss/formula/PlainCellCache.java @@ -78,7 +78,7 @@ final class PlainCellCache { private Map<Loc, PlainValueCellCacheEntry> _plainValueEntriesByLoc; public PlainCellCache() { - _plainValueEntriesByLoc = new HashMap<Loc, PlainValueCellCacheEntry>(); + _plainValueEntriesByLoc = new HashMap<>(); } public void put(Loc key, PlainValueCellCacheEntry cce) { _plainValueEntriesByLoc.put(key, cce); diff --git a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java index 90a2509afa..ed42c297ac 100644 --- a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java @@ -95,8 +95,8 @@ public final class WorkbookEvaluator { _workbook = workbook; _evaluationListener = evaluationListener; _cache = new EvaluationCache(evaluationListener); - _sheetIndexesBySheet = new IdentityHashMap<EvaluationSheet, Integer>(); - _sheetIndexesByName = new IdentityHashMap<String, Integer>(); + _sheetIndexesBySheet = new IdentityHashMap<>(); + _sheetIndexesByName = new IdentityHashMap<>(); _collaboratingWorkbookEnvironment = CollaboratingWorkbooksEnvironment.EMPTY; _workbookIx = 0; _stabilityClassifier = stabilityClassifier; @@ -401,7 +401,7 @@ public final class WorkbookEvaluator { dbgEvaluationOutputIndent++; } - Stack<ValueEval> stack = new Stack<ValueEval>(); + Stack<ValueEval> stack = new Stack<>(); for (int i = 0, iSize = ptgs.length; i < iSize; i++) { // since we don't know how to handle these yet :( Ptg ptg = ptgs[i]; @@ -928,7 +928,7 @@ public final class WorkbookEvaluator { * @return names of functions supported by POI */ public static Collection<String> getSupportedFunctionNames(){ - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); lst.addAll(FunctionEval.getSupportedFunctionNames()); lst.addAll(AnalysisToolPak.getSupportedFunctionNames()); return Collections.unmodifiableCollection(lst); @@ -940,7 +940,7 @@ public final class WorkbookEvaluator { * @return names of functions NOT supported by POI */ public static Collection<String> getNotSupportedFunctionNames(){ - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); lst.addAll(FunctionEval.getNotSupportedFunctionNames()); lst.addAll(AnalysisToolPak.getNotSupportedFunctionNames()); return Collections.unmodifiableCollection(lst); diff --git a/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java b/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java index df99b10707..5f31274439 100644 --- a/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java +++ b/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java @@ -78,7 +78,7 @@ public final class AnalysisToolPak implements UDFFinder { } private Map<String, FreeRefFunction> createFunctionsMap() { - Map<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(108); + Map<String, FreeRefFunction> m = new HashMap<>(108); r(m, "ACCRINT", null); r(m, "ACCRINTM", null); @@ -211,7 +211,7 @@ public final class AnalysisToolPak implements UDFFinder { */ public static Collection<String> getSupportedFunctionNames(){ AnalysisToolPak inst = (AnalysisToolPak)instance; - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); for(Map.Entry<String, FreeRefFunction> me : inst._functionsByName.entrySet()){ FreeRefFunction func = me.getValue(); if(func != null && !(func instanceof NotImplemented)){ @@ -229,7 +229,7 @@ public final class AnalysisToolPak implements UDFFinder { */ public static Collection<String> getNotSupportedFunctionNames(){ AnalysisToolPak inst = (AnalysisToolPak)instance; - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); for(Map.Entry<String, FreeRefFunction> me : inst._functionsByName.entrySet()){ FreeRefFunction func = me.getValue(); if (func instanceof NotImplemented) { diff --git a/src/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java b/src/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java index fa5d50aee6..f97728c341 100644 --- a/src/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java +++ b/src/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java @@ -82,7 +82,7 @@ final class ArgumentsEvaluator { if (arg instanceof StringEval) { return new double[]{ evaluateDateArg(arg, srcCellRow, srcCellCol) }; } else if (arg instanceof AreaEvalBase) { - List<Double> valuesList = new ArrayList<Double>(); + List<Double> valuesList = new ArrayList<>(); AreaEvalBase area = (AreaEvalBase) arg; for (int i = area.getFirstRow(); i <= area.getLastRow(); i++) { for (int j = area.getFirstColumn(); j <= area.getLastColumn(); j++) { diff --git a/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java b/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java index e9c2289752..faa8bed265 100644 --- a/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java +++ b/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java @@ -26,7 +26,7 @@ import org.apache.poi.ss.usermodel.FormulaError; * Evaluations for formula errors */ public final class ErrorEval implements ValueEval { - private static final Map<FormulaError,ErrorEval> evals = new HashMap<FormulaError, ErrorEval>(); + private static final Map<FormulaError,ErrorEval> evals = new HashMap<>(); /** <b>#NULL!</b> - Intersection of two cell ranges is empty */ public static final ErrorEval NULL_INTERSECTION = new ErrorEval(FormulaError.NULL); diff --git a/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java b/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java index f2cee518f7..b327f25043 100644 --- a/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java +++ b/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java @@ -395,7 +395,7 @@ public final class FunctionEval { * @since 3.8 beta6 */ public static Collection<String> getSupportedFunctionNames() { - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); for (int i = 0; i < functions.length; i++) { Function func = functions[i]; FunctionMetadata metaData = FunctionMetadataRegistry.getFunctionByIndex(i); @@ -414,7 +414,7 @@ public final class FunctionEval { * @since 3.8 beta6 */ public static Collection<String> getNotSupportedFunctionNames() { - Collection<String> lst = new TreeSet<String>(); + Collection<String> lst = new TreeSet<>(); for (int i = 0; i < functions.length; i++) { Function func = functions[i]; if (func != null && (func instanceof NotImplementedFunction)) { diff --git a/src/java/org/apache/poi/ss/formula/eval/RefListEval.java b/src/java/org/apache/poi/ss/formula/eval/RefListEval.java index ee884da78d..99d9b3e841 100644 --- a/src/java/org/apache/poi/ss/formula/eval/RefListEval.java +++ b/src/java/org/apache/poi/ss/formula/eval/RefListEval.java @@ -24,7 +24,7 @@ import java.util.List; * Handling of a list of values, e.g. the 2nd argument in RANK(A1,(B1,B2,B3),1) */ public class RefListEval implements ValueEval { - private final List<ValueEval> list = new ArrayList<ValueEval>(); + private final List<ValueEval> list = new ArrayList<>(); public RefListEval(ValueEval v1, ValueEval v2) { add(v1); diff --git a/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationSheet.java b/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationSheet.java index 8d271e3da5..bc5fdf1741 100644 --- a/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationSheet.java +++ b/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationSheet.java @@ -49,7 +49,7 @@ final class ForkedEvaluationSheet implements EvaluationSheet { public ForkedEvaluationSheet(EvaluationSheet masterSheet) { _masterSheet = masterSheet; - _sharedCellsByRowCol = new HashMap<RowColKey, ForkedEvaluationCell>(); + _sharedCellsByRowCol = new HashMap<>(); } @Override diff --git a/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationWorkbook.java b/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationWorkbook.java index 704aa75ced..8ba3aeef75 100644 --- a/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationWorkbook.java +++ b/src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationWorkbook.java @@ -47,7 +47,7 @@ final class ForkedEvaluationWorkbook implements EvaluationWorkbook { public ForkedEvaluationWorkbook(EvaluationWorkbook master) { _masterBook = master; - _sharedSheetsByName = new HashMap<String, ForkedEvaluationSheet>(); + _sharedSheetsByName = new HashMap<>(); } public ForkedEvaluationCell getOrCreateUpdatableCell(String sheetName, int rowIndex, diff --git a/src/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java b/src/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java index b44a03ef3d..c535bf4ca2 100644 --- a/src/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java +++ b/src/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java @@ -37,9 +37,9 @@ final class FunctionDataBuilder { public FunctionDataBuilder(int sizeEstimate) { _maxFunctionIndex = -1; - _functionDataByName = new HashMap<String,FunctionMetadata>(sizeEstimate * 3 / 2); - _functionDataByIndex = new HashMap<Integer,FunctionMetadata>(sizeEstimate * 3 / 2); - _mutatingFunctionIndexes = new HashSet<Integer>(); + _functionDataByName = new HashMap<>(sizeEstimate * 3 / 2); + _functionDataByIndex = new HashMap<>(sizeEstimate * 3 / 2); + _mutatingFunctionIndexes = new HashSet<>(); } public void add(int functionIndex, String functionName, int minParams, int maxParams, diff --git a/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java b/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java index 02a9267df1..29b9612aec 100644 --- a/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java +++ b/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java @@ -50,7 +50,7 @@ final class FunctionMetadataReader { // except in these cases "LOG10", "ATAN2", "DAYS360", "SUMXMY2", "SUMX2MY2", "SUMX2PY2", }; - private static final Set<String> DIGIT_ENDING_FUNCTION_NAMES_SET = new HashSet<String>(Arrays.asList(DIGIT_ENDING_FUNCTION_NAMES)); + private static final Set<String> DIGIT_ENDING_FUNCTION_NAMES_SET = new HashSet<>(Arrays.asList(DIGIT_ENDING_FUNCTION_NAMES)); public static FunctionMetadataRegistry createRegistry() { try { diff --git a/src/java/org/apache/poi/ss/formula/functions/FactDouble.java b/src/java/org/apache/poi/ss/formula/functions/FactDouble.java index c96c4c6e54..8c3394854d 100644 --- a/src/java/org/apache/poi/ss/formula/functions/FactDouble.java +++ b/src/java/org/apache/poi/ss/formula/functions/FactDouble.java @@ -46,7 +46,7 @@ public class FactDouble extends Fixed1ArgFunction implements FreeRefFunction { public static final FreeRefFunction instance = new FactDouble(); //Caching of previously calculated factorial for speed - static HashMap<Integer, BigInteger> cache = new HashMap<Integer, BigInteger>(); + static HashMap<Integer, BigInteger> cache = new HashMap<>(); public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval numberVE) { int number; diff --git a/src/java/org/apache/poi/ss/formula/functions/Mode.java b/src/java/org/apache/poi/ss/formula/functions/Mode.java index 5f21324d53..fb285bc34c 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Mode.java +++ b/src/java/org/apache/poi/ss/formula/functions/Mode.java @@ -76,7 +76,7 @@ public final class Mode implements Function { public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) { double result; try { - List<Double> temp = new ArrayList<Double>(); + List<Double> temp = new ArrayList<>(); for (int i = 0; i < args.length; i++) { collectValues(args[i], temp); } diff --git a/src/java/org/apache/poi/ss/formula/functions/Subtotal.java b/src/java/org/apache/poi/ss/formula/functions/Subtotal.java index c2c5829359..9b5bff897f 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Subtotal.java +++ b/src/java/org/apache/poi/ss/formula/functions/Subtotal.java @@ -102,7 +102,7 @@ public class Subtotal implements Function { } // ignore the first arg, this is the function-type, we check for the length above - final List<ValueEval> list = new ArrayList<ValueEval>(Arrays.asList(args).subList(1, args.length)); + final List<ValueEval> list = new ArrayList<>(Arrays.asList(args).subList(1, args.length)); Iterator<ValueEval> it = list.iterator(); diff --git a/src/java/org/apache/poi/ss/formula/ptg/Ptg.java b/src/java/org/apache/poi/ss/formula/ptg/Ptg.java index fc5e6e8991..ed7c1d4c30 100644 --- a/src/java/org/apache/poi/ss/formula/ptg/Ptg.java +++ b/src/java/org/apache/poi/ss/formula/ptg/Ptg.java @@ -44,7 +44,7 @@ public abstract class Ptg { * Extra data (beyond <tt>size</tt>) may be read if and <tt>ArrayPtg</tt>s are present. */ public static Ptg[] readTokens(int size, LittleEndianInput in) { - List<Ptg> temp = new ArrayList<Ptg>(4 + size / 2); + List<Ptg> temp = new ArrayList<>(4 + size / 2); int pos = 0; boolean hasArrayPtgs = false; while (pos < size) { @@ -205,7 +205,7 @@ public abstract class Ptg { ptg.write(out); if (ptg instanceof ArrayPtg) { if (arrayPtgs == null) { - arrayPtgs = new ArrayList<Ptg>(5); + arrayPtgs = new ArrayList<>(5); } arrayPtgs.add(ptg); } diff --git a/src/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java b/src/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java index ece80345c0..593a0ee1b5 100644 --- a/src/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java +++ b/src/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java @@ -39,7 +39,7 @@ public class AggregatingUDFFinder implements UDFFinder { private final Collection<UDFFinder> _usedToolPacks; public AggregatingUDFFinder(UDFFinder ... usedToolPacks) { - _usedToolPacks = new ArrayList<UDFFinder>(usedToolPacks.length); + _usedToolPacks = new ArrayList<>(usedToolPacks.length); _usedToolPacks.addAll(Arrays.asList(usedToolPacks)); } diff --git a/src/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java b/src/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java index 382820b1ef..4234054583 100644 --- a/src/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java +++ b/src/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java @@ -37,7 +37,7 @@ public final class DefaultUDFFinder implements UDFFinder { throw new IllegalArgumentException( "Mismatch in number of function names and implementations"); } - HashMap<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(nFuncs * 3 / 2); + HashMap<String, FreeRefFunction> m = new HashMap<>(nFuncs * 3 / 2); for (int i = 0; i < functionImpls.length; i++) { m.put(functionNames[i].toUpperCase(Locale.ROOT), functionImpls[i]); } diff --git a/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java b/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java index 27ceaef3c1..c5af8d5254 100644 --- a/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java +++ b/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java @@ -32,7 +32,7 @@ public class IndexedUDFFinder extends AggregatingUDFFinder { public IndexedUDFFinder(UDFFinder... usedToolPacks) { super(usedToolPacks); - _funcMap = new HashMap<Integer, String>(); + _funcMap = new HashMap<>(); } @Override diff --git a/src/java/org/apache/poi/ss/usermodel/ConditionType.java b/src/java/org/apache/poi/ss/usermodel/ConditionType.java index ab3653af33..a5681cd4b9 100644 --- a/src/java/org/apache/poi/ss/usermodel/ConditionType.java +++ b/src/java/org/apache/poi/ss/usermodel/ConditionType.java @@ -26,7 +26,7 @@ import java.util.Map; * Represents a type of a conditional formatting rule */ public class ConditionType { - private static Map<Integer,ConditionType> lookup = new HashMap<Integer, ConditionType>(); + private static Map<Integer,ConditionType> lookup = new HashMap<>(); /** * This conditional formatting rule compares a cell value diff --git a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java index 9cacd0d6fc..66e8c28344 100644 --- a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -202,7 +202,7 @@ public class DataFormatter implements Observer { * A map to cache formats. * Map<String,Format> formats */ - private final Map<String,Format> formats = new HashMap<String,Format>(); + private final Map<String,Format> formats = new HashMap<>(); private final boolean emulateCSV; @@ -508,7 +508,7 @@ public class DataFormatter implements Observer { StringBuilder sb = new StringBuilder(); char[] chars = formatStr.toCharArray(); boolean mIsMonth = true; - List<Integer> ms = new ArrayList<Integer>(); + List<Integer> ms = new ArrayList<>(); boolean isElapsed = false; for(int j=0; j<chars.length; j++) { char c = chars[j]; diff --git a/src/java/org/apache/poi/ss/usermodel/DateUtil.java b/src/java/org/apache/poi/ss/usermodel/DateUtil.java index ffaaa0f1ba..60cc74500a 100644 --- a/src/java/org/apache/poi/ss/usermodel/DateUtil.java +++ b/src/java/org/apache/poi/ss/usermodel/DateUtil.java @@ -333,8 +333,8 @@ public class DateUtil { return -1; } }; - private static ThreadLocal<String> lastFormatString = new ThreadLocal<String>(); - private static ThreadLocal<Boolean> lastCachedResult = new ThreadLocal<Boolean>(); + private static ThreadLocal<String> lastFormatString = new ThreadLocal<>(); + private static ThreadLocal<Boolean> lastCachedResult = new ThreadLocal<>(); private static boolean isCached(String formatString, int formatIndex) { String cachedFormatString = lastFormatString.get(); diff --git a/src/java/org/apache/poi/ss/usermodel/FormulaError.java b/src/java/org/apache/poi/ss/usermodel/FormulaError.java index fa102299e8..2ce1e44fe2 100644 --- a/src/java/org/apache/poi/ss/usermodel/FormulaError.java +++ b/src/java/org/apache/poi/ss/usermodel/FormulaError.java @@ -147,9 +147,9 @@ public enum FormulaError { return repr; } - private static final Map<String, FormulaError> smap = new HashMap<String, FormulaError>(); - private static final Map<Byte, FormulaError> bmap = new HashMap<Byte, FormulaError>(); - private static final Map<Integer, FormulaError> imap = new HashMap<Integer, FormulaError>(); + private static final Map<String, FormulaError> smap = new HashMap<>(); + private static final Map<Byte, FormulaError> bmap = new HashMap<>(); + private static final Map<Integer, FormulaError> imap = new HashMap<>(); static{ for (FormulaError error : values()) { bmap.put(error.getCode(), error); diff --git a/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java b/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java index 75e7fd9a81..a0d293c78b 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/DataSources.java @@ -35,7 +35,7 @@ public class DataSources { } public static <T> ChartDataSource<T> fromArray(T[] elements) { - return new ArrayDataSource<T>(elements); + return new ArrayDataSource<>(elements); } public static ChartDataSource<Number> fromNumericCellRange(Sheet sheet, CellRangeAddress cellRangeAddress) { diff --git a/src/java/org/apache/poi/ss/usermodel/helpers/RowShifter.java b/src/java/org/apache/poi/ss/usermodel/helpers/RowShifter.java index 13777dc909..83c634de73 100644 --- a/src/java/org/apache/poi/ss/usermodel/helpers/RowShifter.java +++ b/src/java/org/apache/poi/ss/usermodel/helpers/RowShifter.java @@ -50,8 +50,8 @@ public abstract class RowShifter { * @return an array of affected merged regions, doesn't contain deleted ones */ public List<CellRangeAddress> shiftMergedRegions(int startRow, int endRow, int n) { - List<CellRangeAddress> shiftedRegions = new ArrayList<CellRangeAddress>(); - Set<Integer> removedIndices = new HashSet<Integer>(); + List<CellRangeAddress> shiftedRegions = new ArrayList<>(); + Set<Integer> removedIndices = new HashSet<>(); //move merged regions completely if they fall within the new region boundaries when they are shifted int size = sheet.getNumMergedRegions(); for (int i = 0; i < size; i++) { diff --git a/src/java/org/apache/poi/ss/util/AreaReference.java b/src/java/org/apache/poi/ss/util/AreaReference.java index fab3619b35..44fcab2b6d 100644 --- a/src/java/org/apache/poi/ss/util/AreaReference.java +++ b/src/java/org/apache/poi/ss/util/AreaReference.java @@ -236,7 +236,7 @@ public class AreaReference { if (null == version) { version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave. } - List<AreaReference> refs = new ArrayList<AreaReference>(); + List<AreaReference> refs = new ArrayList<>(); StringTokenizer st = new StringTokenizer(reference, ","); while(st.hasMoreTokens()) { refs.add( @@ -287,7 +287,7 @@ public class AreaReference { int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol()); String sheetName = _firstCell.getSheetName(); - List<CellReference> refs = new ArrayList<CellReference>(); + List<CellReference> refs = new ArrayList<>(); for(int row=minRow; row<=maxRow; row++) { for(int col=minCol; col<=maxCol; col++) { CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute()); diff --git a/src/java/org/apache/poi/ss/util/CellRangeAddressList.java b/src/java/org/apache/poi/ss/util/CellRangeAddressList.java index 8d99198234..7dad2a763d 100644 --- a/src/java/org/apache/poi/ss/util/CellRangeAddressList.java +++ b/src/java/org/apache/poi/ss/util/CellRangeAddressList.java @@ -45,7 +45,7 @@ public class CellRangeAddressList { protected final List<CellRangeAddress> _list; public CellRangeAddressList() { - _list = new ArrayList<CellRangeAddress>(); + _list = new ArrayList<>(); } /** * Convenience constructor for creating a <tt>CellRangeAddressList</tt> with a single diff --git a/src/java/org/apache/poi/ss/util/CellRangeUtil.java b/src/java/org/apache/poi/ss/util/CellRangeUtil.java index e60230ed8b..892778d457 100644 --- a/src/java/org/apache/poi/ss/util/CellRangeUtil.java +++ b/src/java/org/apache/poi/ss/util/CellRangeUtil.java @@ -171,7 +171,7 @@ public final class CellRangeUtil { return result; } private static List<CellRangeAddress> toList(CellRangeAddress[] temp) { - List<CellRangeAddress> result = new ArrayList<CellRangeAddress>(temp.length); + List<CellRangeAddress> result = new ArrayList<>(temp.length); for (CellRangeAddress range : temp) { result.add(range); } diff --git a/src/java/org/apache/poi/ss/util/CellUtil.java b/src/java/org/apache/poi/ss/util/CellUtil.java index 855c284469..cab7d8f49b 100644 --- a/src/java/org/apache/poi/ss/util/CellUtil.java +++ b/src/java/org/apache/poi/ss/util/CellUtil.java @@ -75,7 +75,7 @@ public final class CellUtil { public static final String WRAP_TEXT = "wrapText"; private static final Set<String> shortValues = Collections.unmodifiableSet( - new HashSet<String>(Arrays.asList( + new HashSet<>(Arrays.asList( BOTTOM_BORDER_COLOR, LEFT_BORDER_COLOR, RIGHT_BORDER_COLOR, @@ -86,20 +86,20 @@ public final class CellUtil { DATA_FORMAT, FONT, ROTATION - ))); + ))); private static final Set<String> booleanValues = Collections.unmodifiableSet( - new HashSet<String>(Arrays.asList( + new HashSet<>(Arrays.asList( LOCKED, HIDDEN, WRAP_TEXT - ))); + ))); private static final Set<String> borderTypeValues = Collections.unmodifiableSet( - new HashSet<String>(Arrays.asList( + new HashSet<>(Arrays.asList( BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT, BORDER_TOP - ))); + ))); @@ -334,7 +334,7 @@ public final class CellUtil { * @see #setFormatProperties(org.apache.poi.ss.usermodel.CellStyle, org.apache.poi.ss.usermodel.Workbook, java.util.Map) */ private static Map<String, Object> getFormatProperties(CellStyle style) { - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); put(properties, ALIGNMENT, style.getAlignmentEnum()); put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum()); put(properties, BORDER_BOTTOM, style.getBorderBottomEnum()); diff --git a/src/java/org/apache/poi/ss/util/DateFormatConverter.java b/src/java/org/apache/poi/ss/util/DateFormatConverter.java index 4d24a62ec8..cfe403b5af 100644 --- a/src/java/org/apache/poi/ss/util/DateFormatConverter.java +++ b/src/java/org/apache/poi/ss/util/DateFormatConverter.java @@ -81,7 +81,7 @@ public class DateFormatConverter { } public static String[] tokenize( String format ) { - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); DateFormatTokenizer tokenizer = new DateFormatTokenizer(format); String token; @@ -113,7 +113,7 @@ public class DateFormatConverter { private static Map<String,String> localePrefixes = prepareLocalePrefixes(); private static Map<String,String> prepareTokenConversions() { - Map<String,String> result = new HashMap<String,String>(); + Map<String,String> result = new HashMap<>(); result.put( "EEEE", "dddd" ); result.put( "EEE", "ddd" ); @@ -135,7 +135,7 @@ public class DateFormatConverter { } private static Map<String,String> prepareLocalePrefixes() { - Map<String,String> result = new HashMap<String,String>(); + Map<String,String> result = new HashMap<>(); result.put( "af", "[$-0436]" ); result.put( "am", "[$-45E]" ); diff --git a/src/java/org/apache/poi/ss/util/PropertyTemplate.java b/src/java/org/apache/poi/ss/util/PropertyTemplate.java index 1b0e27593b..7b310cdbd7 100644 --- a/src/java/org/apache/poi/ss/util/PropertyTemplate.java +++ b/src/java/org/apache/poi/ss/util/PropertyTemplate.java @@ -63,7 +63,7 @@ public final class PropertyTemplate { * Create a PropertyTemplate object */ public PropertyTemplate() { - _propertyTemplate = new HashMap<CellAddress, Map<String, Object>>(); + _propertyTemplate = new HashMap<>(); } /** @@ -83,7 +83,7 @@ public final class PropertyTemplate { } private static Map<String, Object> cloneCellProperties(Map<String, Object> properties) { - Map<String, Object> newProperties = new HashMap<String, Object>(); + Map<String, Object> newProperties = new HashMap<>(); for(Map.Entry<String, Object> entry : properties.entrySet()) { newProperties.put(entry.getKey(), entry.getValue()); } @@ -411,7 +411,7 @@ public final class PropertyTemplate { * @parm range - {@link CellRangeAddress} range of cells to remove borders. */ private void removeBorders(CellRangeAddress range) { - Set<String> properties = new HashSet<String>(); + Set<String> properties = new HashSet<>(); properties.add(CellUtil.BORDER_TOP); properties.add(CellUtil.BORDER_BOTTOM); properties.add(CellUtil.BORDER_LEFT); @@ -758,7 +758,7 @@ public final class PropertyTemplate { * @parm range - {@link CellRangeAddress} range of cells to remove borders. */ private void removeBorderColors(CellRangeAddress range) { - Set<String> properties = new HashSet<String>(); + Set<String> properties = new HashSet<>(); properties.add(CellUtil.TOP_BORDER_COLOR); properties.add(CellUtil.BOTTOM_BORDER_COLOR); properties.add(CellUtil.LEFT_BORDER_COLOR); @@ -795,7 +795,7 @@ public final class PropertyTemplate { CellAddress cell = new CellAddress(row, col); Map<String, Object> cellProperties = _propertyTemplate.get(cell); if (cellProperties == null) { - cellProperties = new HashMap<String, Object>(); + cellProperties = new HashMap<>(); } cellProperties.put(property, value); _propertyTemplate.put(cell, cellProperties); diff --git a/src/java/org/apache/poi/ss/util/SSCellRange.java b/src/java/org/apache/poi/ss/util/SSCellRange.java index f58a2780e8..e948465567 100644 --- a/src/java/org/apache/poi/ss/util/SSCellRange.java +++ b/src/java/org/apache/poi/ss/util/SSCellRange.java @@ -57,7 +57,7 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> { @SuppressWarnings("unchecked") B[] flattenedArray = (B[]) Array.newInstance(cellClass, nItems); flattenedList.toArray(flattenedArray); - return new SSCellRange<B>(firstRow, firstColumn, height, width, flattenedArray); + return new SSCellRange<>(firstRow, firstColumn, height, width, flattenedArray); } public int getHeight() { @@ -109,7 +109,7 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> { return result; } public Iterator<K> iterator() { - return new ArrayIterator<K>(_flattenedArray); + return new ArrayIterator<>(_flattenedArray); } private static final class ArrayIterator<D> implements Iterator<D> { diff --git a/src/java/org/apache/poi/util/BitFieldFactory.java b/src/java/org/apache/poi/util/BitFieldFactory.java index 047d5cb1da..e35c80cacc 100644 --- a/src/java/org/apache/poi/util/BitFieldFactory.java +++ b/src/java/org/apache/poi/util/BitFieldFactory.java @@ -24,7 +24,7 @@ import java.util.*; * Returns immutable Bitfield instances. */ public class BitFieldFactory { - private static Map<Integer, BitField> instances = new HashMap<Integer, BitField>(); + private static Map<Integer, BitField> instances = new HashMap<>(); public static BitField getInstance(int mask) { BitField f = instances.get(Integer.valueOf(mask)); diff --git a/src/java/org/apache/poi/util/HexRead.java b/src/java/org/apache/poi/util/HexRead.java index 97b3eca3e6..1db930f25d 100644 --- a/src/java/org/apache/poi/util/HexRead.java +++ b/src/java/org/apache/poi/util/HexRead.java @@ -95,7 +95,7 @@ public class HexRead { { int characterCount = 0; byte b = (byte) 0; - List<Byte> bytes = new ArrayList<Byte>(); + List<Byte> bytes = new ArrayList<>(); final char a = 'a' - 10; final char A = 'A' - 10; while ( true ) { diff --git a/src/java/org/apache/poi/util/IntMapper.java b/src/java/org/apache/poi/util/IntMapper.java index d5cdc7b67b..921b820b84 100644 --- a/src/java/org/apache/poi/util/IntMapper.java +++ b/src/java/org/apache/poi/util/IntMapper.java @@ -52,8 +52,8 @@ public class IntMapper<T> public IntMapper(final int initialCapacity) { - elements = new ArrayList<T>(initialCapacity); - valueKeyMap = new HashMap<T,Integer>(initialCapacity); + elements = new ArrayList<>(initialCapacity); + valueKeyMap = new HashMap<>(initialCapacity); } /** diff --git a/src/java/org/apache/poi/util/LocaleUtil.java b/src/java/org/apache/poi/util/LocaleUtil.java index 35d0b0ebe1..70d9a50750 100644 --- a/src/java/org/apache/poi/util/LocaleUtil.java +++ b/src/java/org/apache/poi/util/LocaleUtil.java @@ -52,8 +52,8 @@ public final class LocaleUtil { */ public static final Charset CHARSET_1252 = Charset.forName("CP1252"); - private static final ThreadLocal<TimeZone> userTimeZone = new ThreadLocal<TimeZone>(); - private static final ThreadLocal<Locale> userLocale = new ThreadLocal<Locale>(); + private static final ThreadLocal<TimeZone> userTimeZone = new ThreadLocal<>(); + private static final ThreadLocal<Locale> userLocale = new ThreadLocal<>(); /** * As time zone information is not stored in any format, it can be diff --git a/src/java/org/apache/poi/util/POILogFactory.java b/src/java/org/apache/poi/util/POILogFactory.java index 34460702fc..528c918939 100644 --- a/src/java/org/apache/poi/util/POILogFactory.java +++ b/src/java/org/apache/poi/util/POILogFactory.java @@ -35,7 +35,7 @@ public final class POILogFactory { /** * Map of POILogger instances, with classes as keys */ - private static final Map<String,POILogger> _loggers = new HashMap<String,POILogger>(); + private static final Map<String,POILogger> _loggers = new HashMap<>(); /** * A common instance of NullLogger, as it does nothing diff --git a/src/java/org/apache/poi/util/StringUtil.java b/src/java/org/apache/poi/util/StringUtil.java index 30aee7a066..ddfc8e2fe4 100644 --- a/src/java/org/apache/poi/util/StringUtil.java +++ b/src/java/org/apache/poi/util/StringUtil.java @@ -370,7 +370,7 @@ public class StringUtil { private static synchronized void initMsCodepointMap() { if (msCodepointToUnicode != null) return; - msCodepointToUnicode = new HashMap<Integer,Integer>(); + msCodepointToUnicode = new HashMap<>(); int i=0xF020; for (int ch : symbolMap_f020) { msCodepointToUnicode.put(i++, ch); diff --git a/src/ooxml/java/org/apache/poi/POIXMLDocument.java b/src/ooxml/java/org/apache/poi/POIXMLDocument.java index 9cba7545e9..a7eaaf2c87 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLDocument.java +++ b/src/ooxml/java/org/apache/poi/POIXMLDocument.java @@ -159,7 +159,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close public abstract List<PackagePart> getAllEmbedds() throws OpenXML4JException; protected final void load(POIXMLFactory factory) throws IOException { - Map<PackagePart, POIXMLDocumentPart> context = new HashMap<PackagePart, POIXMLDocumentPart>(); + Map<PackagePart, POIXMLDocumentPart> context = new HashMap<>(); try { read(factory, context); } catch (OpenXML4JException e){ @@ -216,7 +216,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close //force all children to commit their changes into the underlying OOXML Package // TODO Shouldn't they be committing to the new one instead? - Set<PackagePart> context = new HashSet<PackagePart>(); + Set<PackagePart> context = new HashSet<>(); onSave(context); context.clear(); diff --git a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java index a777887e96..c5afb15446 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java +++ b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java @@ -54,7 +54,7 @@ public class POIXMLDocumentPart { private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT; private PackagePart packagePart; private POIXMLDocumentPart parent; - private Map<String,RelationPart> relations = new LinkedHashMap<String,RelationPart>(); + private Map<String,RelationPart> relations = new LinkedHashMap<>(); /** * The RelationPart is a cached relationship between the document, which contains the RelationPart, @@ -202,7 +202,7 @@ public class POIXMLDocumentPart { * @return child relations */ public final List<POIXMLDocumentPart> getRelations(){ - List<POIXMLDocumentPart> l = new ArrayList<POIXMLDocumentPart>(); + List<POIXMLDocumentPart> l = new ArrayList<>(); for (RelationPart rp : relations.values()) { l.add(rp.getDocumentPart()); } @@ -215,7 +215,7 @@ public class POIXMLDocumentPart { * @return child relations */ public final List<RelationPart> getRelationParts() { - List<RelationPart> l = new ArrayList<RelationPart>(relations.values()); + List<RelationPart> l = new ArrayList<>(relations.values()); return Collections.unmodifiableList(l); } @@ -554,7 +554,7 @@ public class POIXMLDocumentPart { if (!pp.hasRelationships()) return; PackageRelationshipCollection rels = packagePart.getRelationships(); - List<POIXMLDocumentPart> readLater = new ArrayList<POIXMLDocumentPart>(); + List<POIXMLDocumentPart> readLater = new ArrayList<>(); // scan breadth-first, so parent-relations are hopefully the shallowest element for (PackageRelationship rel : rels) { diff --git a/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java b/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java index 7452da8f71..0bfdcfd7c1 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java +++ b/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java @@ -50,7 +50,7 @@ import org.xml.sax.SAXException; @SuppressWarnings("deprecation") public class POIXMLTypeLoader { - private static ThreadLocal<SchemaTypeLoader> typeLoader = new ThreadLocal<SchemaTypeLoader>(); + private static ThreadLocal<SchemaTypeLoader> typeLoader = new ThreadLocal<>(); // TODO: Do these have a good home like o.a.p.openxml4j.opc.PackageNamespaces and PackageRelationshipTypes? // These constants should be common to all of POI and easy to use by other applications such as Tika @@ -76,7 +76,7 @@ public class POIXMLTypeLoader { // when reading properties in separate workbooks in multiple threads // DEFAULT_XML_OPTIONS.setUnsynchronized(); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a"); map.put("http://schemas.openxmlformats.org/drawingml/2006/chart", "c"); map.put("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wp"); diff --git a/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java b/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java index b51c31d78e..3ee469d1b9 100644 --- a/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java +++ b/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java @@ -326,9 +326,9 @@ public class ExtractorFactory { */ public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException, OpenXML4JException, XmlException { // All the embedded directories we spotted - ArrayList<Entry> dirs = new ArrayList<Entry>(); + ArrayList<Entry> dirs = new ArrayList<>(); // For anything else not directly held in as a POIFS directory - ArrayList<InputStream> nonPOIFS = new ArrayList<InputStream>(); + ArrayList<InputStream> nonPOIFS = new ArrayList<>(); // Find all the embedded directories DirectoryEntry root = ext.getRoot(); @@ -381,7 +381,7 @@ public class ExtractorFactory { return new POITextExtractor[0]; } - ArrayList<POITextExtractor> textExtractors = new ArrayList<POITextExtractor>(); + ArrayList<POITextExtractor> textExtractors = new ArrayList<>(); for (Entry dir : dirs) { textExtractors.add(createExtractor((DirectoryNode) dir)); } diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java index 15031fbcf6..636a3f7329 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java @@ -146,8 +146,8 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * Initialize the package instance. */ private void init() { - this.partMarshallers = new HashMap<ContentType, PartMarshaller>(5); - this.partUnmarshallers = new HashMap<ContentType, PartUnmarshaller>(2); + this.partMarshallers = new HashMap<>(5); + this.partUnmarshallers = new HashMap<>(2); try { // Add 'default' unmarshaller @@ -417,7 +417,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { pkg.packageProperties = new PackagePropertiesPart(pkg, PackagingURIHelper.CORE_PROPERTIES_PART_NAME); pkg.packageProperties.setCreatorProperty("Generated by Apache POI OpenXML4J"); - pkg.packageProperties.setCreatedProperty(new Nullable<Date>(new Date())); + pkg.packageProperties.setCreatedProperty(new Nullable<>(new Date())); } catch (InvalidFormatException e) { // Should never happen throw new IllegalStateException(e); @@ -648,7 +648,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * @return All part associated to the specified content type. */ public ArrayList<PackagePart> getPartsByContentType(String contentType) { - ArrayList<PackagePart> retArr = new ArrayList<PackagePart>(); + ArrayList<PackagePart> retArr = new ArrayList<>(); for (PackagePart part : partList.sortedValues()) { if (part.getContentType().equals(contentType)) { retArr.add(part); @@ -671,7 +671,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { if (relationshipType == null) { throw new IllegalArgumentException("relationshipType"); } - ArrayList<PackagePart> retArr = new ArrayList<PackagePart>(); + ArrayList<PackagePart> retArr = new ArrayList<>(); for (PackageRelationship rel : getRelationshipsByType(relationshipType)) { PackagePart part = getPart(rel); if (part != null) { @@ -695,7 +695,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { throw new IllegalArgumentException("name pattern must not be null"); } Matcher matcher = namePattern.matcher(""); - ArrayList<PackagePart> result = new ArrayList<PackagePart>(); + ArrayList<PackagePart> result = new ArrayList<>(); for (PackagePart part : partList.sortedValues()) { PackagePartName partName = part.getPartName(); if (matcher.reset(partName.getName()).matches()) { @@ -811,7 +811,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { } } } - return new ArrayList<PackagePart>(partList.sortedValues()); + return new ArrayList<>(partList.sortedValues()); } /** diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java index 71cb6e7fd6..ed0b9f7897 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java @@ -36,10 +36,10 @@ public final class PackagePartCollection implements Serializable { * HashSet use to store this collection part names as string for rule * M1.11 optimized checking. */ - private HashSet<String> registerPartNameStr = new HashSet<String>(); + private HashSet<String> registerPartNameStr = new HashSet<>(); - private final HashMap<PackagePartName, PackagePart> packagePartLookup = new HashMap<PackagePartName, PackagePart>(); + private final HashMap<PackagePartName, PackagePart> packagePartLookup = new HashMap<>(); /** @@ -79,7 +79,7 @@ public final class PackagePartCollection implements Serializable { * avoids paying the high cost of Natural Ordering per insertion. */ public Collection<PackagePart> sortedValues() { - ArrayList<PackagePart> packageParts = new ArrayList<PackagePart>(packagePartLookup.values()); + ArrayList<PackagePart> packageParts = new ArrayList<>(packagePartLookup.values()); Collections.sort(packageParts); return packageParts; diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java index 912a3d5b8c..953af91eeb 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java @@ -55,7 +55,7 @@ public final class PackageRelationshipCollection implements /** * A lookup of internal relationships to avoid */ - private HashMap<String, PackageRelationship> internalRelationshipsByTargetName = new HashMap<String, PackageRelationship>(); + private HashMap<String, PackageRelationship> internalRelationshipsByTargetName = new HashMap<>(); /** @@ -88,8 +88,8 @@ public final class PackageRelationshipCollection implements * Constructor. */ PackageRelationshipCollection() { - relationshipsByID = new TreeMap<String, PackageRelationship>(); - relationshipsByType = new TreeMap<String, PackageRelationship>(); + relationshipsByID = new TreeMap<>(); + relationshipsByType = new TreeMap<>(); } /** @@ -392,7 +392,7 @@ public final class PackageRelationshipCollection implements * specified type contain in this collection. */ public Iterator<PackageRelationship> iterator(String typeFilter) { - ArrayList<PackageRelationship> retArr = new ArrayList<PackageRelationship>(); + ArrayList<PackageRelationship> retArr = new ArrayList<>(); for (PackageRelationship rel : relationshipsByID.values()) { if (rel.getRelationshipType().equals(typeFilter)) retArr.add(rel); diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentType.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentType.java index a56e0cdf35..276aba59cd 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentType.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentType.java @@ -162,7 +162,7 @@ public final class ContentType { this.subType = mMediaType.group(2); // Parameters - this.parameters = new HashMap<String, String>(); + this.parameters = new HashMap<>(); // Java RegExps are unhelpful, and won't do multiple group captures // See http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#cg if (mMediaType.groupCount() >= 5) { diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java index 750f9cd71a..1740d57947 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java @@ -94,7 +94,7 @@ public abstract class ContentTypeManager { public ContentTypeManager(InputStream in, OPCPackage pkg) throws InvalidFormatException { this.container = pkg; - this.defaultContentType = new TreeMap<String, String>(); + this.defaultContentType = new TreeMap<>(); if (in != null) { try { parseContentTypesFile(in); @@ -167,7 +167,7 @@ public abstract class ContentTypeManager { private void addOverrideContentType(PackagePartName partName, String contentType) { if (overrideContentType == null) - overrideContentType = new TreeMap<PackagePartName, String>(); + overrideContentType = new TreeMap<>(); overrideContentType.put(partName, contentType); } diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java index b1ea4f359c..b3d29d1724 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java @@ -95,7 +95,7 @@ public final class PackagePropertiesPart extends PackagePart implements * value might be used by an application's user interface to facilitate * navigation of a large set of documents. end example] */ - protected Nullable<String> category = new Nullable<String>(); + protected Nullable<String> category = new Nullable<>(); /** * The status of the content. @@ -103,7 +103,7 @@ public final class PackagePropertiesPart extends PackagePart implements * [Example: Values might include "Draft", "Reviewed", and "Final". end * example] */ - protected Nullable<String> contentStatus = new Nullable<String>(); + protected Nullable<String> contentStatus = new Nullable<>(); /** * The type of content represented, generally defined by a specific use and @@ -113,17 +113,17 @@ public final class PackagePropertiesPart extends PackagePart implements * "Exam". end example] [Note: This property is distinct from MIME content * types as defined in RFC 2616. end note] */ - protected Nullable<String> contentType = new Nullable<String>(); + protected Nullable<String> contentType = new Nullable<>(); /** * Date of creation of the resource. */ - protected Nullable<Date> created = new Nullable<Date>(); + protected Nullable<Date> created = new Nullable<>(); /** * An entity primarily responsible for making the content of the resource. */ - protected Nullable<String> creator = new Nullable<String>(); + protected Nullable<String> creator = new Nullable<>(); /** * An explanation of the content of the resource. @@ -132,19 +132,19 @@ public final class PackagePropertiesPart extends PackagePart implements * to a graphical representation of content, and a free-text account of the * content. end example] */ - protected Nullable<String> description = new Nullable<String>(); + protected Nullable<String> description = new Nullable<>(); /** * An unambiguous reference to the resource within a given context. */ - protected Nullable<String> identifier = new Nullable<String>(); + protected Nullable<String> identifier = new Nullable<>(); /** * A delimited set of keywords to support searching and indexing. This is * typically a list of terms that are not available elsewhere in the * properties. */ - protected Nullable<String> keywords = new Nullable<String>(); + protected Nullable<String> keywords = new Nullable<>(); /** * The language of the intellectual content of the resource. @@ -152,7 +152,7 @@ public final class PackagePropertiesPart extends PackagePart implements * [Note: IETF RFC 3066 provides guidance on encoding to represent * languages. end note] */ - protected Nullable<String> language = new Nullable<String>(); + protected Nullable<String> language = new Nullable<>(); /** * The user who performed the last modification. The identification is @@ -161,17 +161,17 @@ public final class PackagePropertiesPart extends PackagePart implements * [Example: A name, email address, or employee ID. end example] It is * recommended that this value be as concise as possible. */ - protected Nullable<String> lastModifiedBy = new Nullable<String>(); + protected Nullable<String> lastModifiedBy = new Nullable<>(); /** * The date and time of the last printing. */ - protected Nullable<Date> lastPrinted = new Nullable<Date>(); + protected Nullable<Date> lastPrinted = new Nullable<>(); /** * Date on which the resource was changed. */ - protected Nullable<Date> modified = new Nullable<Date>(); + protected Nullable<Date> modified = new Nullable<>(); /** * The revision number. @@ -179,22 +179,22 @@ public final class PackagePropertiesPart extends PackagePart implements * [Example: This value might indicate the number of saves or revisions, * provided the application updates it after each revision. end example] */ - protected Nullable<String> revision = new Nullable<String>(); + protected Nullable<String> revision = new Nullable<>(); /** * The topic of the content of the resource. */ - protected Nullable<String> subject = new Nullable<String>(); + protected Nullable<String> subject = new Nullable<>(); /** * The name given to the resource. */ - protected Nullable<String> title = new Nullable<String>(); + protected Nullable<String> title = new Nullable<>(); /** * The version number. This value is set by the user or by the application. */ - protected Nullable<String> version = new Nullable<String>(); + protected Nullable<String> version = new Nullable<>(); /* * Getters and setters @@ -335,7 +335,7 @@ public final class PackagePropertiesPart extends PackagePart implements if (modified.hasValue()) { return getDateValue(modified); } - return getDateValue(new Nullable<Date>(new Date())); + return getDateValue(new Nullable<>(new Date())); } /** @@ -567,9 +567,9 @@ public final class PackagePropertiesPart extends PackagePart implements */ private Nullable<String> setStringValue(String s) { if (s == null || s.equals("")) { - return new Nullable<String>(); + return new Nullable<>(); } - return new Nullable<String>(s); + return new Nullable<>(s); } /** @@ -580,7 +580,7 @@ public final class PackagePropertiesPart extends PackagePart implements */ private Nullable<Date> setDateValue(String dateStr) throws InvalidFormatException { if (dateStr == null || dateStr.equals("")) { - return new Nullable<Date>(); + return new Nullable<>(); } Matcher m = TIME_ZONE_PAT.matcher(dateStr); @@ -592,7 +592,7 @@ public final class PackagePropertiesPart extends PackagePart implements df.setTimeZone(LocaleUtil.TIMEZONE_UTC); Date d = df.parse(dateTzStr, new ParsePosition(0)); if (d != null) { - return new Nullable<Date>(d); + return new Nullable<>(d); } } } @@ -602,7 +602,7 @@ public final class PackagePropertiesPart extends PackagePart implements df.setTimeZone(LocaleUtil.TIMEZONE_UTC); Date d = df.parse(dateTzStr, new ParsePosition(0)); if (d != null) { - return new Nullable<Date>(d); + return new Nullable<>(d); } } //if you're here, no pattern matched, throw exception diff --git a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipInputStreamZipEntrySource.java b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipInputStreamZipEntrySource.java index 4c2b9df3e7..dfa9924617 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipInputStreamZipEntrySource.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipInputStreamZipEntrySource.java @@ -45,7 +45,7 @@ public class ZipInputStreamZipEntrySource implements ZipEntrySource { * work with the entries at-will. */ public ZipInputStreamZipEntrySource(ThresholdInputStream inp) throws IOException { - zipEntries = new ArrayList<FakeZipEntry>(); + zipEntries = new ArrayList<>(); boolean going = true; while(going) { diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java index c10dd510e2..82eb138171 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java @@ -47,7 +47,7 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone byte certVerifier[]; } - private List<AgileCertificateEntry> certList = new ArrayList<AgileCertificateEntry>(); + private List<AgileCertificateEntry> certList = new ArrayList<>(); private int keyBits = -1; private int blockSize = -1; @@ -176,7 +176,7 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone public AgileEncryptionVerifier clone() throws CloneNotSupportedException { AgileEncryptionVerifier other = (AgileEncryptionVerifier)super.clone(); // TODO: deep copy of certList - other.certList = new ArrayList<AgileCertificateEntry>(certList); + other.certList = new ArrayList<>(certList); return other; } diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptor.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptor.java index 3ffb810030..99eb220012 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptor.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptor.java @@ -364,7 +364,7 @@ public class AgileEncryptor extends Encryptor implements Cloneable { protected void marshallEncryptionDocument(EncryptionDocument ed, LittleEndianByteArrayOutputStream os) { XmlOptions xo = new XmlOptions(); xo.setCharacterEncoding("UTF-8"); - Map<String,String> nsMap = new HashMap<String,String>(); + Map<String,String> nsMap = new HashMap<>(); nsMap.put(passwordUri.toString(),"p"); nsMap.put(certificateUri.toString(), "c"); xo.setUseDefaultNamespace(); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java index f4402dcc81..f7729ecb27 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java @@ -49,7 +49,7 @@ public class KeyInfoKeySelector extends KeySelector implements KeySelectorResult private static final POILogger LOG = POILogFactory.getLogger(KeyInfoKeySelector.class); - private List<X509Certificate> certChain = new ArrayList<X509Certificate>(); + private List<X509Certificate> certChain = new ArrayList<>(); @SuppressWarnings("unchecked") @Override diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java index 187272a90e..6784ef10aa 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java @@ -68,12 +68,12 @@ public class SignatureConfig { void setSignatureConfig(SignatureConfig signatureConfig); } - private ThreadLocal<OPCPackage> opcPackage = new ThreadLocal<OPCPackage>(); - private ThreadLocal<XMLSignatureFactory> signatureFactory = new ThreadLocal<XMLSignatureFactory>(); - private ThreadLocal<KeyInfoFactory> keyInfoFactory = new ThreadLocal<KeyInfoFactory>(); - private ThreadLocal<Provider> provider = new ThreadLocal<Provider>(); + private ThreadLocal<OPCPackage> opcPackage = new ThreadLocal<>(); + private ThreadLocal<XMLSignatureFactory> signatureFactory = new ThreadLocal<>(); + private ThreadLocal<KeyInfoFactory> keyInfoFactory = new ThreadLocal<>(); + private ThreadLocal<Provider> provider = new ThreadLocal<>(); - private List<SignatureFacet> signatureFacets = new ArrayList<SignatureFacet>(); + private List<SignatureFacet> signatureFacets = new ArrayList<>(); private HashAlgorithm digestAlgo = HashAlgorithm.sha1; private Date executionTime = new Date(); private PrivateKey key; @@ -156,7 +156,7 @@ public class SignatureConfig { * Map of namespace uris to prefix * If a mapping is specified, the corresponding elements will be prefixed */ - Map<String,String> namespacePrefixes = new HashMap<String,String>(); + Map<String,String> namespacePrefixes = new HashMap<>(); /** * Inits and checks the config object. diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java index 766f8e6863..955dc74453 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java @@ -473,7 +473,7 @@ public class SignatureInfo implements SignatureConfigurable { /* * Add ds:References that come from signing client local files. */ - List<Reference> references = new ArrayList<Reference>(); + List<Reference> references = new ArrayList<>(); for (DigestInfo digestInfo : safe(digestInfos)) { byte[] documentDigestValue = digestInfo.digestValue; @@ -486,7 +486,7 @@ public class SignatureInfo implements SignatureConfigurable { /* * Invoke the signature facets. */ - List<XMLObject> objects = new ArrayList<XMLObject>(); + List<XMLObject> objects = new ArrayList<>(); for (SignatureFacet signatureFacet : signatureConfig.getSignatureFacets()) { LOG.log(POILogger.DEBUG, "invoking signature facet: " + signatureFacet.getClass().getSimpleName()); signatureFacet.preSign(document, references, objects); @@ -618,7 +618,7 @@ public class SignatureInfo implements SignatureConfigurable { */ protected void writeDocument(Document document) throws MarshalException { XmlOptions xo = new XmlOptions(); - Map<String,String> namespaceMap = new HashMap<String,String>(); + Map<String,String> namespaceMap = new HashMap<>(); for(Map.Entry<String,String> entry : signatureConfig.getNamespacePrefixes().entrySet()){ namespaceMap.put(entry.getValue(), entry.getKey()); } diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureMarshalListener.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureMarshalListener.java index 338174fceb..017953f570 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureMarshalListener.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureMarshalListener.java @@ -34,7 +34,7 @@ import org.w3c.dom.events.MutationEvent; * e.g. to register id attributes or set prefixes for registered namespaces */ public class SignatureMarshalListener implements EventListener, SignatureConfigurable { - ThreadLocal<EventTarget> target = new ThreadLocal<EventTarget>(); + ThreadLocal<EventTarget> target = new ThreadLocal<>(); SignatureConfig signatureConfig; public void setEventTarget(EventTarget target) { this.target.set(target); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java index 2a98e3b888..12ba42c14c 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java @@ -48,7 +48,7 @@ public class EnvelopedSignatureFacet extends SignatureFacet { , List<Reference> references , List<XMLObject> objects) throws XMLSignatureException { - List<Transform> transforms = new ArrayList<Transform>(); + List<Transform> transforms = new ArrayList<>(); Transform envelopedTransform = newTransform(CanonicalizationMethod.ENVELOPED); transforms.add(envelopedTransform); Transform exclusiveTransform = newTransform(CanonicalizationMethod.EXCLUSIVE); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java index 67d18dd28b..b3bfe9ecfb 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java @@ -75,10 +75,10 @@ public class KeyInfoSignatureFacet extends SignatureFacet { * Construct the ds:KeyInfo element using JSR 105. */ KeyInfoFactory keyInfoFactory = signatureConfig.getKeyInfoFactory(); - List<Object> x509DataObjects = new ArrayList<Object>(); + List<Object> x509DataObjects = new ArrayList<>(); X509Certificate signingCertificate = signatureConfig.getSigningCertificateChain().get(0); - List<XMLStructure> keyInfoContent = new ArrayList<XMLStructure>(); + List<XMLStructure> keyInfoContent = new ArrayList<>(); if (signatureConfig.isIncludeKeyValue()) { KeyValue keyValue; diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java index f7b1f95470..05073d21e6 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java @@ -98,11 +98,11 @@ public class OOXMLSignatureFacet extends SignatureFacet { , List<XMLObject> objects) throws XMLSignatureException { - List<Reference> manifestReferences = new ArrayList<Reference>(); + List<Reference> manifestReferences = new ArrayList<>(); addManifestReferences(manifestReferences); Manifest manifest = getSignatureFactory().newManifest(manifestReferences); - List<XMLStructure> objectContent = new ArrayList<XMLStructure>(); + List<XMLStructure> objectContent = new ArrayList<>(); objectContent.add(manifest); addSignatureTime(document, objectContent); @@ -121,7 +121,7 @@ public class OOXMLSignatureFacet extends SignatureFacet { OPCPackage ooxml = signatureConfig.getOpcPackage(); List<PackagePart> relsEntryNames = ooxml.getPartsByContentType(ContentTypes.RELATIONSHIPS_PART); - Set<String> digestedPartNames = new HashSet<String>(); + Set<String> digestedPartNames = new HashSet<>(); for (PackagePart pp : relsEntryNames) { final String baseUri = pp.getPartName().getName().replaceFirst("(.*)/_rels/.*", "$1"); @@ -181,7 +181,7 @@ public class OOXMLSignatureFacet extends SignatureFacet { } if (parameterSpec.hasSourceIds()) { - List<Transform> transforms = new ArrayList<Transform>(); + List<Transform> transforms = new ArrayList<>(); transforms.add(newTransform(RelationshipTransformService.TRANSFORM_URI, parameterSpec)); transforms.add(newTransform(CanonicalizationMethod.INCLUSIVE)); String uri = normalizePartName(pp.getPartName().getURI(), baseUri) @@ -232,12 +232,12 @@ public class OOXMLSignatureFacet extends SignatureFacet { ctTime.setValue(nowStr); Element n = (Element)document.importNode(ctTime.getDomNode(),true); - List<XMLStructure> signatureTimeContent = new ArrayList<XMLStructure>(); + List<XMLStructure> signatureTimeContent = new ArrayList<>(); signatureTimeContent.add(new DOMStructure(n)); SignatureProperty signatureTimeSignatureProperty = getSignatureFactory() .newSignatureProperty(signatureTimeContent, "#" + signatureConfig.getPackageSignatureId(), "idSignatureTime"); - List<SignatureProperty> signaturePropertyContent = new ArrayList<SignatureProperty>(); + List<SignatureProperty> signaturePropertyContent = new ArrayList<>(); signaturePropertyContent.add(signatureTimeSignatureProperty); SignatureProperties signatureProperties = getSignatureFactory() .newSignatureProperties(signaturePropertyContent, null); @@ -248,7 +248,7 @@ public class OOXMLSignatureFacet extends SignatureFacet { List<Reference> references, List<XMLObject> objects) throws XMLSignatureException { - List<XMLStructure> objectContent = new ArrayList<XMLStructure>(); + List<XMLStructure> objectContent = new ArrayList<>(); SignatureInfoV1Document sigV1 = SignatureInfoV1Document.Factory.newInstance(); CTSignatureInfoV1 ctSigV1 = sigV1.addNewSignatureInfoV1(); @@ -256,13 +256,13 @@ public class OOXMLSignatureFacet extends SignatureFacet { Element n = (Element)document.importNode(ctSigV1.getDomNode(), true); n.setAttributeNS(XML_NS, XMLConstants.XMLNS_ATTRIBUTE, MS_DIGSIG_NS); - List<XMLStructure> signatureInfoContent = new ArrayList<XMLStructure>(); + List<XMLStructure> signatureInfoContent = new ArrayList<>(); signatureInfoContent.add(new DOMStructure(n)); SignatureProperty signatureInfoSignatureProperty = getSignatureFactory() .newSignatureProperty(signatureInfoContent, "#" + signatureConfig.getPackageSignatureId(), "idOfficeV1Details"); - List<SignatureProperty> signaturePropertyContent = new ArrayList<SignatureProperty>(); + List<SignatureProperty> signaturePropertyContent = new ArrayList<>(); signaturePropertyContent.add(signatureInfoSignatureProperty); SignatureProperties signatureProperties = getSignatureFactory() .newSignatureProperties(signaturePropertyContent, null); @@ -294,26 +294,26 @@ public class OOXMLSignatureFacet extends SignatureFacet { /** * Office 2010 list of signed types (extensions). */ - private static final Set<String> signed = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList( - "activeXControlBinary","aFChunk","attachedTemplate","attachedToolbars","audio","calcChain","chart","chartColorStyle", - "chartLayout","chartsheet","chartStyle","chartUserShapes","commentAuthors","comments","connections","connectorXml", - "control","ctrlProp","customData","customData","customProperty","customXml","diagram","diagramColors", - "diagramColorsHeader","diagramData","diagramDrawing","diagramLayout","diagramLayoutHeader","diagramQuickStyle", - "diagramQuickStyleHeader","dialogsheet","dictionary","documentParts","downRev","drawing","endnotes","externalLink", - "externalLinkPath","font","fontTable","footer","footnotes","functionPrototypes","glossaryDocument","graphicFrameDoc", - "groupShapeXml","handoutMaster","hdphoto","header","hyperlink","image","ink","inkXml","keyMapCustomizations", - "legacyDiagramText","legacyDocTextInfo","mailMergeHeaderSource","mailMergeRecipientData","mailMergeSource","media", - "notesMaster","notesSlide","numbering","officeDocument","officeDocument","oleObject","package","pictureXml", - "pivotCacheDefinition","pivotCacheRecords","pivotTable","powerPivotData","presProps","printerSettings","queryTable", - "recipientData","settings","shapeXml","sharedStrings","sheetMetadata","slicer","slicer","slicerCache","slicerCache", - "slide","slideLayout","slideMaster","slideUpdateInfo","slideUpdateUrl","smartTags","styles","stylesWithEffects", - "table","tableSingleCells","tableStyles","tags","theme","themeOverride","timeline","timelineCache","transform", - "ui/altText","ui/buttonSize","ui/controlID","ui/description","ui/enabled","ui/extensibility","ui/extensibility", - "ui/helperText","ui/imageID","ui/imageMso","ui/keyTip","ui/label","ui/lcid","ui/loud","ui/pressed","ui/progID", - "ui/ribbonID","ui/showImage","ui/showLabel","ui/supertip","ui/target","ui/text","ui/title","ui/tooltip", - "ui/userCustomization","ui/visible","userXmlData","vbaProject","video","viewProps","vmlDrawing", - "volatileDependencies","webSettings","wordVbaData","worksheet","wsSortMap","xlBinaryIndex", - "xlExternalLinkPath/xlAlternateStartup","xlExternalLinkPath/xlLibrary","xlExternalLinkPath/xlPathMissing", - "xlExternalLinkPath/xlStartup","xlIntlMacrosheet","xlMacrosheet","xmlMaps" + private static final Set<String> signed = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + "activeXControlBinary", "aFChunk", "attachedTemplate", "attachedToolbars", "audio", "calcChain", "chart", "chartColorStyle", + "chartLayout", "chartsheet", "chartStyle", "chartUserShapes", "commentAuthors", "comments", "connections", "connectorXml", + "control", "ctrlProp", "customData", "customData", "customProperty", "customXml", "diagram", "diagramColors", + "diagramColorsHeader", "diagramData", "diagramDrawing", "diagramLayout", "diagramLayoutHeader", "diagramQuickStyle", + "diagramQuickStyleHeader", "dialogsheet", "dictionary", "documentParts", "downRev", "drawing", "endnotes", "externalLink", + "externalLinkPath", "font", "fontTable", "footer", "footnotes", "functionPrototypes", "glossaryDocument", "graphicFrameDoc", + "groupShapeXml", "handoutMaster", "hdphoto", "header", "hyperlink", "image", "ink", "inkXml", "keyMapCustomizations", + "legacyDiagramText", "legacyDocTextInfo", "mailMergeHeaderSource", "mailMergeRecipientData", "mailMergeSource", "media", + "notesMaster", "notesSlide", "numbering", "officeDocument", "officeDocument", "oleObject", "package", "pictureXml", + "pivotCacheDefinition", "pivotCacheRecords", "pivotTable", "powerPivotData", "presProps", "printerSettings", "queryTable", + "recipientData", "settings", "shapeXml", "sharedStrings", "sheetMetadata", "slicer", "slicer", "slicerCache", "slicerCache", + "slide", "slideLayout", "slideMaster", "slideUpdateInfo", "slideUpdateUrl", "smartTags", "styles", "stylesWithEffects", + "table", "tableSingleCells", "tableStyles", "tags", "theme", "themeOverride", "timeline", "timelineCache", "transform", + "ui/altText", "ui/buttonSize", "ui/controlID", "ui/description", "ui/enabled", "ui/extensibility", "ui/extensibility", + "ui/helperText", "ui/imageID", "ui/imageMso", "ui/keyTip", "ui/label", "ui/lcid", "ui/loud", "ui/pressed", "ui/progID", + "ui/ribbonID", "ui/showImage", "ui/showLabel", "ui/supertip", "ui/target", "ui/text", "ui/title", "ui/tooltip", + "ui/userCustomization", "ui/visible", "userXmlData", "vbaProject", "video", "viewProps", "vmlDrawing", + "volatileDependencies", "webSettings", "wordVbaData", "worksheet", "wsSortMap", "xlBinaryIndex", + "xlExternalLinkPath/xlAlternateStartup", "xlExternalLinkPath/xlLibrary", "xlExternalLinkPath/xlPathMissing", + "xlExternalLinkPath/xlStartup", "xlIntlMacrosheet", "xlMacrosheet", "xmlMaps" ))); }
\ No newline at end of file diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java index a556f1f794..0e3bb7b31a 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java @@ -92,7 +92,7 @@ public class XAdESSignatureFacet extends SignatureFacet { private static final String XADES_TYPE = "http://uri.etsi.org/01903#SignedProperties"; - private Map<String, String> dataObjectFormatMimeTypes = new HashMap<String, String>(); + private Map<String, String> dataObjectFormatMimeTypes = new HashMap<>(); @Override @@ -192,7 +192,7 @@ public class XAdESSignatureFacet extends SignatureFacet { } // add XAdES ds:Object - List<XMLStructure> xadesObjectContent = new ArrayList<XMLStructure>(); + List<XMLStructure> xadesObjectContent = new ArrayList<>(); Element qualDocElSrc = (Element)qualifyingProperties.getDomNode(); Element qualDocEl = (Element)document.importNode(qualDocElSrc, true); xadesObjectContent.add(new DOMStructure(qualDocEl)); @@ -200,7 +200,7 @@ public class XAdESSignatureFacet extends SignatureFacet { objects.add(xadesObject); // add XAdES ds:Reference - List<Transform> transforms = new ArrayList<Transform>(); + List<Transform> transforms = new ArrayList<>(); Transform exclusiveTransform = newTransform(CanonicalizationMethod.INCLUSIVE); transforms.add(exclusiveTransform); Reference reference = newReference diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java index 11a11eeae2..795c317a1b 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java @@ -249,7 +249,7 @@ public class XAdESXLSignatureFacet extends SignatureFacet { // marshal XAdES-C // XAdES-X Type 1 timestamp - List<Node> timeStampNodesXadesX1 = new ArrayList<Node>(); + List<Node> timeStampNodesXadesX1 = new ArrayList<>(); timeStampNodesXadesX1.add(nlSigVal.item(0)); timeStampNodesXadesX1.add(signatureTimeStamp.getDomNode()); timeStampNodesXadesX1.add(completeCertificateRefs.getDomNode()); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java index ff0564bbac..79c2b49680 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java @@ -82,7 +82,7 @@ public class RelationshipTransformService extends TransformService { * Relationship Transform parameter specification class. */ public static class RelationshipTransformParameterSpec implements TransformParameterSpec { - List<String> sourceIds = new ArrayList<String>(); + List<String> sourceIds = new ArrayList<>(); public void addRelationshipReference(String relationshipId) { sourceIds.add(relationshipId); } @@ -95,7 +95,7 @@ public class RelationshipTransformService extends TransformService { public RelationshipTransformService() { super(); LOG.log(POILogger.DEBUG, "constructor"); - this.sourceIds = new ArrayList<String>(); + this.sourceIds = new ArrayList<>(); } /** @@ -197,7 +197,7 @@ public class RelationshipTransformService extends TransformService { // keep only those relationships which id is registered in the sourceIds Element root = doc.getDocumentElement(); NodeList nl = root.getChildNodes(); - TreeMap<String,Element> rsList = new TreeMap<String,Element>(); + TreeMap<String,Element> rsList = new TreeMap<>(); for (int i=nl.getLength()-1; i>=0; i--) { Node n = nl.item(i); if ("Relationship".equals(n.getLocalName())) { diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java index 66a78e396d..ca89ba4c99 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java @@ -45,8 +45,8 @@ public class RevocationData { * Default constructor. */ public RevocationData() { - this.crls = new ArrayList<byte[]>(); - this.ocsps = new ArrayList<byte[]>(); + this.crls = new ArrayList<>(); + this.ocsps = new ArrayList<>(); } /** diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java index bc3e744559..8207a0900d 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java @@ -207,7 +207,7 @@ public class TSPTimeStampService implements TimeStampService { Collection<X509CertificateHolder> certificates = timeStampToken.getCertificates().getMatches(null); X509CertificateHolder signerCert = null; - Map<X500Name, X509CertificateHolder> certificateMap = new HashMap<X500Name, X509CertificateHolder>(); + Map<X500Name, X509CertificateHolder> certificateMap = new HashMap<>(); for (X509CertificateHolder certificate : certificates) { if (signerCertIssuer.equals(certificate.getIssuer()) && signerCertSerialNumber.equals(certificate.getSerialNumber())) { @@ -220,7 +220,7 @@ public class TSPTimeStampService implements TimeStampService { if (signerCert == null) { throw new RuntimeException("TSP response token has no signer certificate"); } - List<X509Certificate> tspCertificateChain = new ArrayList<X509Certificate>(); + List<X509Certificate> tspCertificateChain = new ArrayList<>(); JcaX509CertificateConverter x509converter = new JcaX509CertificateConverter(); x509converter.setProvider("BC"); X509CertificateHolder certificate = signerCert; diff --git a/src/ooxml/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java b/src/ooxml/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java index e3d80cecf8..2fa5fc21d7 100644 --- a/src/ooxml/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java +++ b/src/ooxml/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java @@ -98,7 +98,7 @@ public class EmbeddedExtractor implements Iterable<EmbeddedExtractor> { if (null == patriarch){ return Collections.emptyList(); } - List<EmbeddedData> embeddings = new ArrayList<EmbeddedData>(); + List<EmbeddedData> embeddings = new ArrayList<>(); extractAll(patriarch, embeddings); return embeddings; } diff --git a/src/ooxml/java/org/apache/poi/util/IdentifierManager.java b/src/ooxml/java/org/apache/poi/util/IdentifierManager.java index 88822351f0..a863dabe60 100644 --- a/src/ooxml/java/org/apache/poi/util/IdentifierManager.java +++ b/src/ooxml/java/org/apache/poi/util/IdentifierManager.java @@ -69,7 +69,7 @@ public class IdentifierManager { } this.lowerbound = lowerbound; this.upperbound = upperbound; - this.segments = new LinkedList<Segment>(); + this.segments = new LinkedList<>(); segments.add(new Segment(lowerbound, upperbound)); } diff --git a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java index e6dc38ce78..d4cf6c6c60 100644 --- a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java +++ b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java @@ -89,7 +89,7 @@ public final class OOXMLLite { } void build() throws IOException, ClassNotFoundException { - List<Class<?>> lst = new ArrayList<Class<?>>(); + List<Class<?>> lst = new ArrayList<>(); //collect unit tests String exclude = StringUtil.join("|", "BaseTestXWorkbook", @@ -276,7 +276,7 @@ public final class OOXMLLite { ClassLoader appLoader = ClassLoader.getSystemClassLoader(); try { Vector<Class<?>> classes = (Vector<Class<?>>) _classes.get(appLoader); - Map<String, Class<?>> map = new HashMap<String, Class<?>>(); + Map<String, Class<?>> map = new HashMap<>(); for (Class<?> cls : classes) { // e.g. proxy-classes, ... ProtectionDomain pd = cls.getProtectionDomain(); diff --git a/src/ooxml/java/org/apache/poi/xdgf/geom/SplineCollector.java b/src/ooxml/java/org/apache/poi/xdgf/geom/SplineCollector.java index a977cb627a..a96071a3bb 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/geom/SplineCollector.java +++ b/src/ooxml/java/org/apache/poi/xdgf/geom/SplineCollector.java @@ -32,7 +32,7 @@ import com.graphbuilder.geom.PointFactory; public class SplineCollector { SplineStart _start; - ArrayList<SplineKnot> _knots = new ArrayList<SplineKnot>(); + ArrayList<SplineKnot> _knots = new ArrayList<>(); public SplineCollector(SplineStart start) { _start = start; diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java index 3192230754..37927d486d 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java @@ -49,9 +49,9 @@ public class XDGFBaseContents extends XDGFXMLDocumentPart { protected PageContentsType _pageContents; // shapes without parents - protected List<XDGFShape> _toplevelShapes = new ArrayList<XDGFShape>(); - protected Map<Long, XDGFShape> _shapes = new HashMap<Long, XDGFShape>(); - protected List<XDGFConnection> _connections = new ArrayList<XDGFConnection>(); + protected List<XDGFShape> _toplevelShapes = new ArrayList<>(); + protected Map<Long, XDGFShape> _shapes = new HashMap<>(); + protected List<XDGFConnection> _connections = new ArrayList<>(); /** * @since POI 3.14-Beta1 diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java index 1fe9515e3d..1f6c00994a 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java @@ -37,7 +37,7 @@ public class XDGFDocument { protected VisioDocumentType _document; - Map<Long, XDGFStyleSheet> _styleSheets = new HashMap<Long, XDGFStyleSheet>(); + Map<Long, XDGFStyleSheet> _styleSheets = new HashMap<>(); // defaults long _defaultFillStyle; diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java index d2f72d4a26..fdbd43d2aa 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java @@ -43,7 +43,7 @@ public class XDGFMasters extends XDGFXMLDocumentPart { MastersType _mastersObject; // key: id of master - protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>(); + protected Map<Long, XDGFMaster> _masters = new HashMap<>(); /** * @since POI 3.14-Beta1 @@ -68,7 +68,7 @@ public class XDGFMasters extends XDGFXMLDocumentPart { throw new POIXMLException(e); } - Map<String, MasterType> masterSettings = new HashMap<String, MasterType>(); + Map<String, MasterType> masterSettings = new HashMap<>(); for (MasterType master: _mastersObject.getMasterArray()) { masterSettings.put(master.getRel().getId(), master); } diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java index 54cf02f28e..3dfe3c9cc2 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java @@ -31,7 +31,7 @@ import com.microsoft.schemas.office.visio.x2012.main.PageContentsDocument; public class XDGFPageContents extends XDGFBaseContents { - protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>(); + protected Map<Long, XDGFMaster> _masters = new HashMap<>(); protected XDGFPage _page; /** diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java index 0ae3a039a6..65d2f50cc3 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java @@ -42,7 +42,7 @@ public class XDGFPages extends XDGFXMLDocumentPart { PagesType _pagesObject; // ordered by page number - List<XDGFPage> _pages = new ArrayList<XDGFPage>(); + List<XDGFPage> _pages = new ArrayList<>(); /** * @since POI 3.14-Beta1 diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java index 3ab1f91d3b..36911dca9f 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java @@ -29,7 +29,7 @@ public class XDGFRelation extends POIXMLRelation { /** * A map to lookup POIXMLRelation by its relation type */ - private static final Map<String, XDGFRelation> _table = new HashMap<String, XDGFRelation>(); + private static final Map<String, XDGFRelation> _table = new HashMap<>(); public static final XDGFRelation DOCUMENT = new XDGFRelation( "application/vnd.ms-visio.drawing.main+xml", diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java index 7cb2be6298..f997c3b0fd 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java @@ -120,7 +120,7 @@ public class XDGFShape extends XDGFSheet { _text = new XDGFText(text, this); if (shapeSheet.isSetShapes()) { - _shapes = new ArrayList<XDGFShape>(); + _shapes = new ArrayList<>(); for (ShapeSheetType shape : shapeSheet.getShapes().getShapeArray()) _shapes.add(new XDGFShape(this, shape, parentPage, document)); } @@ -781,7 +781,7 @@ public class XDGFShape extends XDGFSheet { // public Iterable<GeometrySection> getGeometrySections() { - return new CombinedIterable<GeometrySection>(_geometry, + return new CombinedIterable<>(_geometry, _masterShape != null ? _masterShape._geometry : null); } diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java index ab2c1d5111..1459cfd8b9 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java @@ -43,13 +43,13 @@ public abstract class XDGFSheet { protected SheetType _sheet; // cells - protected Map<String, XDGFCell> _cells = new HashMap<String, XDGFCell>(); + protected Map<String, XDGFCell> _cells = new HashMap<>(); // sections - protected Map<String, XDGFSection> _sections = new HashMap<String, XDGFSection>(); + protected Map<String, XDGFSection> _sections = new HashMap<>(); // special: geometry sections (key: index, value: section) - protected SortedMap<Long, GeometrySection> _geometry = new TreeMap<Long, GeometrySection>(); + protected SortedMap<Long, GeometrySection> _geometry = new TreeMap<>(); // special: character section protected CharacterSection _character; diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java index 8794874040..071389200b 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java @@ -113,7 +113,7 @@ public class XmlVisioDocument extends POIXMLDocument { */ @Override public List<PackagePart> getAllEmbedds() throws OpenXML4JException { - return new ArrayList<PackagePart>(); + return new ArrayList<>(); } // diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java index 97d62c5c2a..e98d08296f 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java @@ -33,7 +33,7 @@ public class CharacterSection extends XDGFSection { Double _fontSize; Color _fontColor; - Map<String, XDGFCell> _characterCells = new HashMap<String, XDGFCell>(); + Map<String, XDGFCell> _characterCells = new HashMap<>(); public CharacterSection(SectionType section, XDGFSheet containingSheet) { super(section, containingSheet); diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java index 6f47ad5933..535781d130 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java @@ -43,7 +43,7 @@ public class GeometrySection extends XDGFSection { GeometrySection _master; // rows - SortedMap<Long, GeometryRow> _rows = new TreeMap<Long, GeometryRow>(); + SortedMap<Long, GeometryRow> _rows = new TreeMap<>(); public GeometrySection(SectionType section, XDGFSheet containingSheet) { super(section, containingSheet); @@ -89,7 +89,7 @@ public class GeometrySection extends XDGFSection { } public Iterable<GeometryRow> getCombinedRows() { - return new CombinedIterable<GeometryRow>(_rows, + return new CombinedIterable<>(_rows, _master == null ? null : _master._rows); } diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/XDGFSection.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/XDGFSection.java index 1448a60ba9..d26fc888cf 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/XDGFSection.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/XDGFSection.java @@ -34,7 +34,7 @@ public abstract class XDGFSection { static final ObjectFactory<XDGFSection, SectionType> _sectionTypes; static { - _sectionTypes = new ObjectFactory<XDGFSection, SectionType>(); + _sectionTypes = new ObjectFactory<>(); try { _sectionTypes.put("LineGradient", GenericSection.class, SectionType.class, XDGFSheet.class); _sectionTypes.put("FillGradient", GenericSection.class, SectionType.class, XDGFSheet.class); @@ -71,7 +71,7 @@ public abstract class XDGFSection { protected SectionType _section; protected XDGFSheet _containingSheet; - protected Map<String, XDGFCell> _cells = new HashMap<String, XDGFCell>(); + protected Map<String, XDGFCell> _cells = new HashMap<>(); public XDGFSection(SectionType section, XDGFSheet containingSheet) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/GeometryRowFactory.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/GeometryRowFactory.java index 003169f5f5..aa9c336d56 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/GeometryRowFactory.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/GeometryRowFactory.java @@ -27,7 +27,7 @@ public class GeometryRowFactory { static final ObjectFactory<GeometryRow, RowType> _rowTypes; static { - _rowTypes = new ObjectFactory<GeometryRow, RowType>(); + _rowTypes = new ObjectFactory<>(); try { _rowTypes.put("ArcTo", ArcTo.class, RowType.class); _rowTypes.put("Ellipse", Ellipse.class, RowType.class); diff --git a/src/ooxml/java/org/apache/poi/xdgf/util/ObjectFactory.java b/src/ooxml/java/org/apache/poi/xdgf/util/ObjectFactory.java index af0253f594..7fc7c8c44a 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/util/ObjectFactory.java +++ b/src/ooxml/java/org/apache/poi/xdgf/util/ObjectFactory.java @@ -28,7 +28,7 @@ import org.apache.xmlbeans.XmlObject; public class ObjectFactory<T, X extends XmlObject> { - Map<String, Constructor<? extends T>> _types = new HashMap<String, Constructor<? extends T>>(); + Map<String, Constructor<? extends T>> _types = new HashMap<>(); public void put(String typeName, Class<? extends T> cls, Class<?>... varargs) throws NoSuchMethodException, SecurityException { _types.put(typeName, cls.getDeclaredConstructor(varargs)); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java index c3fbac9dae..8f13332af2 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java @@ -126,8 +126,8 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS); _presentation = doc.getPresentation(); - Map<String, XSLFSlideMaster> masterMap = new HashMap<String, XSLFSlideMaster>(); - Map<String, XSLFSlide> shIdMap = new HashMap<String, XSLFSlide>(); + Map<String, XSLFSlideMaster> masterMap = new HashMap<>(); + Map<String, XSLFSlide> shIdMap = new HashMap<>(); for (RelationPart rp : getRelationParts()) { POIXMLDocumentPart p = rp.getDocumentPart(); if (p instanceof XSLFSlide) { @@ -143,13 +143,13 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { } } - _masters = new ArrayList<XSLFSlideMaster>(masterMap.size()); + _masters = new ArrayList<>(masterMap.size()); for (CTSlideMasterIdListEntry masterId : _presentation.getSldMasterIdLst().getSldMasterIdList()) { XSLFSlideMaster master = masterMap.get(masterId.getId2()); _masters.add(master); } - _slides = new ArrayList<XSLFSlide>(shIdMap.size()); + _slides = new ArrayList<>(shIdMap.size()); if (_presentation.isSetSldIdLst()) { for (CTSlideIdListEntry slId : _presentation.getSldIdLst().getSldIdList()) { XSLFSlide sh = shIdMap.get(slId.getId2()); @@ -187,7 +187,7 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { public List<XSLFPictureData> getPictureData() { if(_pictures == null){ List<PackagePart> mediaParts = getPackage().getPartsByName(Pattern.compile("/ppt/media/.*?")); - _pictures = new ArrayList<XSLFPictureData>(mediaParts.size()); + _pictures = new ArrayList<>(mediaParts.size()); for(PackagePart part : mediaParts){ XSLFPictureData pd = new XSLFPictureData(part); pd.setIndex(_pictures.size()); @@ -354,7 +354,7 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { Integer themeIndex = 1; // TODO: check if that list can be replaced by idx = Math.max(idx,themeIdx) - List<Integer> themeIndexList = new ArrayList<Integer>(); + List<Integer> themeIndexList = new ArrayList<>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFTheme) { themeIndexList.add(XSLFRelation.THEME.getFileNameIndex(p)); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java index 2fd3365431..347eaf9f57 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java @@ -54,7 +54,7 @@ public class XSLFCommonSlideData { public List<DrawingTextBody> getDrawingText() { CTGroupShape gs = data.getSpTree(); - List<DrawingTextBody> out = new ArrayList<DrawingTextBody>(); + List<DrawingTextBody> out = new ArrayList<>(); processShape(gs, out); @@ -97,7 +97,7 @@ public class XSLFCommonSlideData { return out; } public List<DrawingParagraph> getText() { - List<DrawingParagraph> paragraphs = new ArrayList<DrawingParagraph>(); + List<DrawingParagraph> paragraphs = new ArrayList<>(); for(DrawingTextBody textBody : getDrawingText()) { paragraphs.addAll(Arrays.asList(textBody.getParagraphs())); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java index 7084082f44..3c6ae88e0b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java @@ -391,7 +391,7 @@ implements XSLFShapeContainer, GroupShape<XSLFShape,XSLFTextParagraph> { */ @Override public void clear() { - List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes()); + List<XSLFShape> shapes = new ArrayList<>(getShapes()); for(XSLFShape shape : shapes){ removeShape(shape); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java index 5472011c06..180659a061 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java @@ -99,7 +99,7 @@ implements Notes<XSLFShape,XSLFTextParagraph> { @Override public List<List<XSLFTextParagraph>> getTextParagraphs() { - List<List<XSLFTextParagraph>> tp = new ArrayList<List<XSLFTextParagraph>>(); + List<List<XSLFTextParagraph>> tp = new ArrayList<>(); for (XSLFShape sh : super.getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape)sh; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java index f3f59b918a..3285b67382 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java @@ -30,7 +30,7 @@ public class XSLFRelation extends POIXMLRelation { /** * A map to lookup POIXMLRelation by its relation type */ - private static final Map<String, XSLFRelation> _table = new HashMap<String, XSLFRelation>(); + private static final Map<String, XSLFRelation> _table = new HashMap<>(); public static final XSLFRelation MAIN = new XSLFRelation( "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml", diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java index d3af46bff7..6b0734f257 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java @@ -94,7 +94,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { } protected static List<XSLFShape> buildShapes(CTGroupShape spTree, XSLFSheet sheet){ - List<XSLFShape> shapes = new ArrayList<XSLFShape>(); + List<XSLFShape> shapes = new ArrayList<>(); XmlCursor cur = spTree.newCursor(); try { for (boolean b=cur.toFirstChild();b;b=cur.toNextSibling()) { @@ -324,7 +324,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { */ @Override public void clear() { - List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes()); + List<XSLFShape> shapes = new ArrayList<>(getShapes()); for(XSLFShape shape : shapes){ removeShape(shape); } @@ -472,9 +472,9 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { void initPlaceholders() { if(_placeholders == null) { - _placeholders = new ArrayList<XSLFTextShape>(); - _placeholderByIdMap = new HashMap<Integer, XSLFSimpleShape>(); - _placeholderByTypeMap = new HashMap<Integer, XSLFSimpleShape>(); + _placeholders = new ArrayList<>(); + _placeholderByIdMap = new HashMap<>(); + _placeholderByTypeMap = new HashMap<>(); for(XSLFShape sh : getShapes()){ if(sh instanceof XSLFTextShape){ diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java index eefa79e3b5..cdf034aafb 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java @@ -96,7 +96,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.SldMasterDocument; private Map<String, XSLFSlideLayout> getLayouts(){ if(_layouts == null){ - _layouts = new HashMap<String, XSLFSlideLayout>(); + _layouts = new HashMap<>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideLayout){ XSLFSlideLayout layout = (XSLFSlideLayout)p; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java index 8a49e39435..c2e6086902 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java @@ -77,7 +77,7 @@ public class XSLFSlideShow extends POIXMLDocument { presentationDoc = PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS); - embedds = new LinkedList<PackagePart>(); + embedds = new LinkedList<>(); for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) { PackagePart corePart = getCorePart(); PackagePart slidePart = corePart.getRelatedPart(corePart.getRelationship(ctSlide.getId2())); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java index 484fa5f66f..f1269a7995 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java @@ -78,7 +78,7 @@ public class XSLFTable extends XSLFGraphicFrame implements Iterable<XSLFTableRow _table = (CTTable)xo; xc.dispose(); - _rows = new ArrayList<XSLFTableRow>(_table.sizeOfTrArray()); + _rows = new ArrayList<>(_table.sizeOfTrArray()); for(CTTableRow row : _table.getTrArray()) { _rows.add(new XSLFTableRow(row, this)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java index a49d5a9242..835b4438a7 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java @@ -40,7 +40,7 @@ public class XSLFTableRow implements Iterable<XSLFTableCell> { _row = row; _table = table; CTTableCell[] tcArray = _row.getTcArray(); - _cells = new ArrayList<XSLFTableCell>(tcArray.length); + _cells = new ArrayList<>(tcArray.length); for(CTTableCell cell : tcArray) { _cells.add(new XSLFTableCell(cell, table)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java index 487b339643..7773883b44 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java @@ -51,7 +51,7 @@ public class XSLFTableStyles extends POIXMLDocumentPart implements Iterable<XSLF is.close(); _tblStyleLst = styleDoc.getTblStyleLst(); CTTableStyle[] tblStyleArray = _tblStyleLst.getTblStyleArray(); - _styles = new ArrayList<XSLFTableStyle>(tblStyleArray.length); + _styles = new ArrayList<>(tblStyleArray.length); for(CTTableStyle c : tblStyleArray){ _styles.add(new XSLFTableStyle(c)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java index 0944d542ee..4c535cfc04 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java @@ -69,7 +69,7 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr XSLFTextParagraph(CTTextParagraph p, XSLFTextShape shape){ _p = p; - _runs = new ArrayList<XSLFTextRun>(); + _runs = new ArrayList<>(); _shape = shape; XmlCursor c = _p.newCursor(); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java index 502d2b6d04..86aa0b7c88 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java @@ -59,7 +59,7 @@ public abstract class XSLFTextShape extends XSLFSimpleShape /*package*/ XSLFTextShape(XmlObject shape, XSLFSheet sheet) { super(shape, sheet); - _paragraphs = new ArrayList<XSLFTextParagraph>(); + _paragraphs = new ArrayList<>(); CTTextBody txBody = getTextBody(false); if (txBody != null) { for (CTTextParagraph p : txBody.getPArray()) { diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java index d3bd3a847c..dce8a2a026 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java @@ -75,7 +75,7 @@ public class XSLFTheme extends POIXMLDocumentPart { CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. - _schemeColors = new HashMap<String, CTColor>(12); + _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); diff --git a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java index 31475410df..938e966a68 100644 --- a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java +++ b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java @@ -174,7 +174,7 @@ public class PPTX2PNG { } private static Set<Integer> slideIndexes(final int slideCount, String range) { - Set<Integer> slideIdx = new TreeSet<Integer>(); + Set<Integer> slideIdx = new TreeSet<>(); if ("-1".equals(range)) { for (int i=0; i<slideCount; i++) { slideIdx.add(i); diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java index fa81c44b38..f84017b764 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java @@ -36,9 +36,9 @@ import org.apache.poi.util.LittleEndian; @Internal public class XSSFBCommentsTable extends XSSFBParser { - private Map<CellAddress, XSSFBComment> comments = new TreeMap<CellAddress, XSSFBComment>(); - private Queue<CellAddress> commentAddresses = new LinkedList<CellAddress>(); - private List<String> authors = new ArrayList<String>(); + private Map<CellAddress, XSSFBComment> comments = new TreeMap<>(); + private Queue<CellAddress> commentAddresses = new LinkedList<>(); + private List<String> authors = new ArrayList<>(); //these are all used only during parsing, and they are mutable! private int authorId = -1; diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBHyperlinksTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBHyperlinksTable.java index fd4eee0f15..71fb2322e6 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBHyperlinksTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBHyperlinksTable.java @@ -51,10 +51,10 @@ public class XSSFBHyperlinksTable { } - private final List<XSSFHyperlinkRecord> hyperlinkRecords = new ArrayList<XSSFHyperlinkRecord>(); + private final List<XSSFHyperlinkRecord> hyperlinkRecords = new ArrayList<>(); //cache the relId to hyperlink url from the sheet's .rels - private Map<String, String> relIdToHyperlink = new HashMap<String, String>(); + private Map<String, String> relIdToHyperlink = new HashMap<>(); public XSSFBHyperlinksTable(PackagePart sheetPart) throws IOException { //load the urls from the sheet .rels @@ -70,13 +70,13 @@ public class XSSFBHyperlinksTable { */ public Map<CellAddress, List<XSSFHyperlinkRecord>> getHyperLinks() { Map<CellAddress, List<XSSFHyperlinkRecord>> hyperlinkMap = - new TreeMap<CellAddress, List<XSSFHyperlinkRecord>>(new TopLeftCellAddressComparator()); + new TreeMap<>(new TopLeftCellAddressComparator()); for (XSSFHyperlinkRecord hyperlinkRecord : hyperlinkRecords) { CellAddress cellAddress = new CellAddress(hyperlinkRecord.getCellRangeAddress().getFirstRow(), hyperlinkRecord.getCellRangeAddress().getFirstColumn()); List<XSSFHyperlinkRecord> list = hyperlinkMap.get(cellAddress); if (list == null) { - list = new ArrayList<XSSFHyperlinkRecord>(); + list = new ArrayList<>(); } list.add(hyperlinkRecord); hyperlinkMap.put(cellAddress, list); @@ -99,7 +99,7 @@ public class XSSFBHyperlinksTable { for (XSSFHyperlinkRecord record : hyperlinkRecords) { if (CellRangeUtil.intersect(targetCellRangeAddress, record.getCellRangeAddress()) != CellRangeUtil.NO_INTERSECTION) { if (overlapping == null) { - overlapping = new ArrayList<XSSFHyperlinkRecord>(); + overlapping = new ArrayList<>(); } overlapping.add(record); } diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRecordType.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRecordType.java index aa417a46d1..e54f5a5a72 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRecordType.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRecordType.java @@ -82,7 +82,7 @@ public enum XSSFBRecordType { Unimplemented(-1); private static final Map<Integer, XSSFBRecordType> TYPE_MAP = - new HashMap<Integer, XSSFBRecordType>(); + new HashMap<>(); static { for (XSSFBRecordType type : XSSFBRecordType.values()) { diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java index 2dc1978416..c14cdc4edf 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java @@ -50,7 +50,7 @@ public class XSSFBSharedStringsTable { /** * The shared strings table. */ - private List<String> strings = new ArrayList<String>(); + private List<String> strings = new ArrayList<>(); /** * @param pkg The {@link OPCPackage} to use as basis for the shared-strings table. @@ -87,7 +87,7 @@ public class XSSFBSharedStringsTable { * @return a defensive copy of strings */ public List<String> getItems() { - List<String> ret = new ArrayList<String>(strings.size()); + List<String> ret = new ArrayList<>(strings.size()); ret.addAll(strings); return ret; } diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java index 6394074ba8..06835b21d0 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java @@ -37,8 +37,8 @@ import org.apache.poi.util.Internal; @Internal public class XSSFBStylesTable extends XSSFBParser { - private final SortedMap<Short, String> numberFormats = new TreeMap<Short,String>(); - private final List<Short> styleIds = new ArrayList<Short>(); + private final SortedMap<Short, String> numberFormats = new TreeMap<>(); + private final List<Short> styleIds = new ArrayList<>(); private boolean inCellXFS; private boolean inFmts; diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java index a482049b6e..991ccdb3e3 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java @@ -239,8 +239,8 @@ public class ReadOnlySharedStringsTable extends DefaultHandler { String uniqueCount = attributes.getValue("uniqueCount"); if(uniqueCount != null) this.uniqueCount = Integer.parseInt(uniqueCount); - this.strings = new ArrayList<String>(this.uniqueCount); - this.phoneticStrings = new HashMap<Integer, String>(); + this.strings = new ArrayList<>(this.uniqueCount); + this.phoneticStrings = new HashMap<>(); characters = new StringBuffer(); } else if ("si".equals(localName)) { characters.setLength(0); diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java index aa1f2b2148..a1872daeb2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java @@ -59,7 +59,7 @@ public class XSSFBReader extends XSSFReader { private static final POILogger log = POILogFactory.getLogger(XSSFBReader.class); private static final Set<String> WORKSHEET_RELS = - Collections.unmodifiableSet(new HashSet<String>( + Collections.unmodifiableSet(new HashSet<>( Arrays.asList(new String[]{ XSSFRelation.WORKSHEET.getRelation(), XSSFRelation.CHARTSHEET.getRelation(), @@ -208,7 +208,7 @@ public class XSSFBReader extends XSSFReader { } private static class SheetRefLoader extends XSSFBParser { - List<XSSFSheetRef> sheets = new LinkedList<XSSFSheetRef>(); + List<XSSFSheetRef> sheets = new LinkedList<>(); private SheetRefLoader(InputStream is) { super(is); diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java index 1652b2a774..8aeb0df881 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java @@ -67,7 +67,7 @@ import org.xml.sax.helpers.DefaultHandler; public class XSSFReader { private static final Set<String> WORKSHEET_RELS = - Collections.unmodifiableSet(new HashSet<String>( + Collections.unmodifiableSet(new HashSet<>( Arrays.asList(new String[]{ XSSFRelation.WORKSHEET.getRelation(), XSSFRelation.CHARTSHEET.getRelation(), @@ -229,7 +229,7 @@ public class XSSFReader { */ try { //step 1. Map sheet's relationship Id and the corresponding PackagePart - sheetMap = new HashMap<String, PackagePart>(); + sheetMap = new HashMap<>(); OPCPackage pkg = wb.getPackage(); Set<String> worksheetRels = getSheetRelationships(); for(PackageRelationship rel : wb.getRelationships()){ @@ -265,7 +265,7 @@ public class XSSFReader { throw new POIXMLException(e); } - List<XSSFSheetRef> validSheets = new ArrayList<XSSFSheetRef>(); + List<XSSFSheetRef> validSheets = new ArrayList<>(); for (XSSFSheetRef xssfSheetRef : xmlSheetRefReader.getSheetRefs()) { //if there's no relationship id, silently skip the sheet String sheetId = xssfSheetRef.getId(); @@ -356,7 +356,7 @@ public class XSSFReader { */ public List<XSSFShape> getShapes() { PackagePart sheetPkg = getSheetPart(); - List<XSSFShape> shapes= new LinkedList<XSSFShape>(); + List<XSSFShape> shapes= new LinkedList<>(); // Do we have a comments relationship? (Only ever one if so) try { PackageRelationshipCollection drawingsList = sheetPkg.getRelationshipsByType(XSSFRelation.DRAWINGS.getRelation()); @@ -421,7 +421,7 @@ public class XSSFReader { private static final String ID = "id"; private static final String NAME = "name"; - private final List<XSSFSheetRef> sheetRefs = new LinkedList<XSSFSheetRef>(); + private final List<XSSFSheetRef> sheetRefs = new LinkedList<>(); // read <sheet name="Sheet6" sheetId="4" r:id="rId6"/> // and add XSSFSheetRef(id="rId6", name="Sheet6") to sheetRefs diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index b37c71ab7d..8f7b30d3c1 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -162,7 +162,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler { private void init() { if (commentsTable != null) { - commentCellRefs = new LinkedList<CellAddress>(); + commentCellRefs = new LinkedList<>(); //noinspection deprecation for (CTComment comment : commentsTable.getCTComments().getCommentList().getCommentArray()) { commentCellRefs.add(new CellAddress(comment.getRef())); diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java index b80df39606..000ee5387c 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java @@ -335,7 +335,7 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor protected SheetTextExtractor() { this.output = new StringBuffer(); this.firstCellOfRow = true; - this.headerFooterMap = includeHeadersFooters ? new HashMap<String, String>() : null; + this.headerFooterMap = includeHeadersFooters ? new HashMap<>() : null; } @Override diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java index 814f0a04e1..0da032c592 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java @@ -133,9 +133,9 @@ public class XSSFExportToXml implements Comparator<String>{ doc.appendChild(root); - List<String> xpaths = new Vector<String>(); - Map<String,XSSFSingleXmlCell> singleXmlCellsMappings = new HashMap<String,XSSFSingleXmlCell>(); - Map<String,XSSFTable> tableMappings = new HashMap<String,XSSFTable>(); + List<String> xpaths = new Vector<>(); + Map<String,XSSFSingleXmlCell> singleXmlCellsMappings = new HashMap<>(); + Map<String,XSSFTable> tableMappings = new HashMap<>(); for(XSSFSingleXmlCell simpleXmlCell : singleXMLCells) { xpaths.add(simpleXmlCell.getXpath()); diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java index 4f09db6354..8ea6f1a8a4 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java @@ -171,7 +171,7 @@ public class XSSFImportFromXML { private Set<STXmlDataType.Enum> xmlDataTypes; private DataType(STXmlDataType.Enum... xmlDataTypes) { - this.xmlDataTypes = new HashSet<STXmlDataType.Enum>(Arrays.asList(xmlDataTypes)); + this.xmlDataTypes = new HashSet<>(Arrays.asList(xmlDataTypes)); } public static DataType getDataType(STXmlDataType.Enum xmlDataType) { diff --git a/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java b/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java index cfc82cd0d6..168959f1cb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java @@ -157,7 +157,7 @@ public class CommentsTable extends POIXMLDocumentPart { */ public Map<CellAddress, XSSFComment> getCellComments() { prepareCTCommentCache(); - final TreeMap<CellAddress, XSSFComment> map = new TreeMap<CellAddress, XSSFComment>(); + final TreeMap<CellAddress, XSSFComment> map = new TreeMap<>(); for (final Entry<CellAddress, CTComment> e: commentRefs.entrySet()) { map.put(e.getKey(), new XSSFComment(this, e.getValue(), null)); @@ -174,7 +174,7 @@ public class CommentsTable extends POIXMLDocumentPart { private void prepareCTCommentCache() { // Create the cache if needed if(commentRefs == null) { - commentRefs = new HashMap<CellAddress, CTComment>(); + commentRefs = new HashMap<>(); for (CTComment comment : comments.getCommentList().getCommentArray()) { commentRefs.put(new CellAddress(comment.getRef()), comment); } diff --git a/src/ooxml/java/org/apache/poi/xssf/model/ExternalLinksTable.java b/src/ooxml/java/org/apache/poi/xssf/model/ExternalLinksTable.java index 8a796924d6..91388e2dda 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/ExternalLinksTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/ExternalLinksTable.java @@ -122,7 +122,7 @@ public class ExternalLinksTable extends POIXMLDocumentPart { public List<String> getSheetNames() { CTExternalSheetName[] sheetNames = link.getExternalBook().getSheetNames().getSheetNameArray(); - List<String> names = new ArrayList<String>(sheetNames.length); + List<String> names = new ArrayList<>(sheetNames.length); for (CTExternalSheetName name : sheetNames) { names.add(name.getVal()); } @@ -132,7 +132,7 @@ public class ExternalLinksTable extends POIXMLDocumentPart { public List<Name> getDefinedNames() { CTExternalDefinedName[] extNames = link.getExternalBook().getDefinedNames().getDefinedNameArray(); - List<Name> names = new ArrayList<Name>(extNames.length); + List<Name> names = new ArrayList<>(extNames.length); for (CTExternalDefinedName extName : extNames) { names.add(new ExternalName(extName)); } diff --git a/src/ooxml/java/org/apache/poi/xssf/model/MapInfo.java b/src/ooxml/java/org/apache/poi/xssf/model/MapInfo.java index ab4522134e..957e8771e5 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/MapInfo.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/MapInfo.java @@ -73,7 +73,7 @@ public class MapInfo extends POIXMLDocumentPart { MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); mapInfo = doc.getMapInfo(); - maps= new HashMap<Integer, XSSFMap>(); + maps= new HashMap<>(); for(CTMap map :mapInfo.getMapArray()){ maps.put((int)map.getID(), new XSSFMap(map,this)); } diff --git a/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java index 5e9cbff6e5..934a96738f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java @@ -63,12 +63,12 @@ public class SharedStringsTable extends POIXMLDocumentPart { /** * Array of individual string items in the Shared String table. */ - private final List<CTRst> strings = new ArrayList<CTRst>(); + private final List<CTRst> strings = new ArrayList<>(); /** * Maps strings and their indexes in the <code>strings</code> arrays */ - private final Map<String, Integer> stmap = new HashMap<String, Integer>(); + private final Map<String, Integer> stmap = new HashMap<>(); /** * An integer representing the total count of strings in the workbook. This count does not diff --git a/src/ooxml/java/org/apache/poi/xssf/model/SingleXmlCells.java b/src/ooxml/java/org/apache/poi/xssf/model/SingleXmlCells.java index fb1c80bb3f..fe18d0c947 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/SingleXmlCells.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/SingleXmlCells.java @@ -98,7 +98,7 @@ public class SingleXmlCells extends POIXMLDocumentPart { * @return all the SimpleXmlCell contained in this SingleXmlCells element */ public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){ - List<XSSFSingleXmlCell> list = new Vector<XSSFSingleXmlCell>(); + List<XSSFSingleXmlCell> list = new Vector<>(); for(CTSingleXmlCell singleXmlCell: singleXMLCells.getSingleXmlCellArray()){ list.add(new XSSFSingleXmlCell(singleXmlCell,this)); diff --git a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java index 0b924a66e0..6186bfe5ff 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java @@ -60,15 +60,15 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.*; * Table of styles shared across all sheets in a workbook. */ public class StylesTable extends POIXMLDocumentPart { - private final SortedMap<Short, String> numberFormats = new TreeMap<Short,String>(); - private final List<XSSFFont> fonts = new ArrayList<XSSFFont>(); - private final List<XSSFCellFill> fills = new ArrayList<XSSFCellFill>(); - private final List<XSSFCellBorder> borders = new ArrayList<XSSFCellBorder>(); - private final List<CTXf> styleXfs = new ArrayList<CTXf>(); - private final List<CTXf> xfs = new ArrayList<CTXf>(); - - private final List<CTDxf> dxfs = new ArrayList<CTDxf>(); - private final Map<String, TableStyle> tableStyles = new HashMap<String, TableStyle>(); + private final SortedMap<Short, String> numberFormats = new TreeMap<>(); + private final List<XSSFFont> fonts = new ArrayList<>(); + private final List<XSSFCellFill> fills = new ArrayList<>(); + private final List<XSSFCellBorder> borders = new ArrayList<>(); + private final List<CTXf> styleXfs = new ArrayList<>(); + private final List<CTXf> xfs = new ArrayList<>(); + + private final List<CTDxf> dxfs = new ArrayList<>(); + private final Map<String, TableStyle> tableStyles = new HashMap<>(); private IndexedColorMap indexedColors = new DefaultIndexedColorMap(); diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java b/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java index 06b02c9bcc..e8975ecb37 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java @@ -55,10 +55,10 @@ import org.apache.poi.util.Internal; // will be called more frequently than getTrackedColumns(). The O(1) cost of insertion, removal, and membership operations // outweigh the infrequent O(n*log n) cost of sorting getTrackedColumns(). // Memory consumption for a HashMap and TreeMap is about the same - private final Map<Integer, ColumnWidthPair> maxColumnWidths = new HashMap<Integer, ColumnWidthPair>(); + private final Map<Integer, ColumnWidthPair> maxColumnWidths = new HashMap<>(); // untrackedColumns stores columns have been explicitly untracked so they aren't implicitly re-tracked by trackAllColumns // Using a HashSet instead of a TreeSet because we don't care about order. - private final Set<Integer> untrackedColumns = new HashSet<Integer>(); + private final Set<Integer> untrackedColumns = new HashSet<>(); private boolean trackAllColumns; /** @@ -126,7 +126,7 @@ import org.apache.poi.util.Internal; * @since 3.14beta1 */ public SortedSet<Integer> getTrackedColumns() { - SortedSet<Integer> sorted = new TreeSet<Integer>(maxColumnWidths.keySet()); + SortedSet<Integer> sorted = new TreeSet<>(maxColumnWidths.keySet()); return Collections.unmodifiableSortedSet(sorted); } diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java index 1ab5c8a231..572383becf 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java @@ -39,7 +39,7 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow> private static final Boolean UNDEFINED = null; private final SXSSFSheet _sheet; // parent sheet - private final SortedMap<Integer, SXSSFCell> _cells = new TreeMap<Integer, SXSSFCell>(); + private final SortedMap<Integer, SXSSFCell> _cells = new TreeMap<>(); private short _style = -1; // index of cell style in style table private short _height = -1; // row height in twips (1/20 point) private boolean _zHeight; // row zero-height (this is somehow different than being hidden) diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 78a8a4916e..bb378d7e56 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -66,7 +66,7 @@ public class SXSSFSheet implements Sheet { /*package*/ final XSSFSheet _sh; private final SXSSFWorkbook _workbook; - private final TreeMap<Integer,SXSSFRow> _rows=new TreeMap<Integer,SXSSFRow>(); + private final TreeMap<Integer,SXSSFRow> _rows= new TreeMap<>(); private final SheetDataWriter _writer; private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE; private final AutoSizeColumnTracker _autoSizeColumnTracker; diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java index 9cc402ba02..931ddcce5f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java @@ -94,8 +94,8 @@ public class SXSSFWorkbook implements Workbook { private final XSSFWorkbook _wb; - private final Map<SXSSFSheet,XSSFSheet> _sxFromXHash = new HashMap<SXSSFSheet,XSSFSheet>(); - private final Map<XSSFSheet,SXSSFSheet> _xFromSxHash = new HashMap<XSSFSheet,SXSSFSheet>(); + private final Map<SXSSFSheet,XSSFSheet> _sxFromXHash = new HashMap<>(); + private final Map<XSSFSheet,SXSSFSheet> _xFromSxHash = new HashMap<>(); private int _randomAccessWindowSize = DEFAULT_WINDOW_SIZE; @@ -707,7 +707,7 @@ public class SXSSFWorkbook implements Workbook { */ @Override public Iterator<Sheet> sheetIterator() { - return new SheetIterator<Sheet>(); + return new SheetIterator<>(); } private final class SheetIterator<T extends Sheet> implements Iterator<T> { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java index e6400c4476..64ead9f4b5 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java @@ -369,7 +369,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork return _tableCache; } // FIXME: use org.apache.commons.collections.map.CaseInsensitiveMap - _tableCache = new HashMap<String, XSSFTable>(); + _tableCache = new HashMap<>(); for (Sheet sheet : _uBook) { for (XSSFTable tbl : ((XSSFSheet)sheet).getTables()) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java index 67555566fc..440aaf69b7 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java @@ -334,7 +334,7 @@ public enum XSSFBuiltinTableStyle { /** * Interestingly, this is initialized after the enum instances, so using an {@link EnumMap} works. */ - private static final Map<XSSFBuiltinTableStyle, TableStyle> styleMap = new EnumMap<XSSFBuiltinTableStyle, TableStyle>(XSSFBuiltinTableStyle.class); + private static final Map<XSSFBuiltinTableStyle, TableStyle> styleMap = new EnumMap<>(XSSFBuiltinTableStyle.class); private XSSFBuiltinTableStyle() { } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java index ed9a88b3ea..df0e951c10 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java @@ -84,7 +84,7 @@ public final class XSSFChart extends POIXMLDocumentPart implements Chart, ChartA */ private CTChart chart; - List<XSSFChartAxis> axis = new ArrayList<XSSFChartAxis>(); + List<XSSFChartAxis> axis = new ArrayList<>(); /** * Create a new SpreadsheetML chart diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java index 821fd41647..671e781c82 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java @@ -54,7 +54,7 @@ public class XSSFConditionalFormatting implements ConditionalFormatting { */ @Override public CellRangeAddress[] getFormattingRanges() { - ArrayList<CellRangeAddress> lst = new ArrayList<CellRangeAddress>(); + ArrayList<CellRangeAddress> lst = new ArrayList<>(); for (Object stRef : _cf.getSqref()) { String[] regions = stRef.toString().split(" "); for (final String region : regions) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java index bedb2183f1..f3904406ea 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java @@ -35,8 +35,8 @@ public class XSSFConditionalFormattingRule implements ConditionalFormattingRule private final CTCfRule _cfRule; private XSSFSheet _sh; - private static Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<STCfType.Enum, ConditionType>(); - private static Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<STCfType.Enum, ConditionFilterType>(); + private static Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<>(); + private static Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<>(); static { typeLookup.put(STCfType.CELL_IS, ConditionType.CELL_VALUE_IS); typeLookup.put(STCfType.EXPRESSION, ConditionType.FORMULA); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java index 9f945ddbe3..15d88f3648 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java @@ -41,11 +41,11 @@ public class XSSFDataValidation implements DataValidation { private XSSFDataValidationConstraint validationConstraint; private CellRangeAddressList regions; - static Map<Integer,STDataValidationOperator.Enum> operatorTypeMappings = new HashMap<Integer,STDataValidationOperator.Enum>(); - static Map<STDataValidationOperator.Enum,Integer> operatorTypeReverseMappings = new HashMap<STDataValidationOperator.Enum,Integer>(); - static Map<Integer,STDataValidationType.Enum> validationTypeMappings = new HashMap<Integer,STDataValidationType.Enum>(); - static Map<STDataValidationType.Enum,Integer> validationTypeReverseMappings = new HashMap<STDataValidationType.Enum,Integer>(); - static Map<Integer,STDataValidationErrorStyle.Enum> errorStyleMappings = new HashMap<Integer,STDataValidationErrorStyle.Enum>(); + static Map<Integer,STDataValidationOperator.Enum> operatorTypeMappings = new HashMap<>(); + static Map<STDataValidationOperator.Enum,Integer> operatorTypeReverseMappings = new HashMap<>(); + static Map<Integer,STDataValidationType.Enum> validationTypeMappings = new HashMap<>(); + static Map<STDataValidationType.Enum,Integer> validationTypeReverseMappings = new HashMap<>(); + static Map<Integer,STDataValidationErrorStyle.Enum> errorStyleMappings = new HashMap<>(); static { errorStyleMappings.put(DataValidation.ErrorStyle.INFO, STDataValidationErrorStyle.INFORMATION); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java index 8f7908dbd6..9e62aa07e7 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java @@ -163,7 +163,7 @@ public class XSSFDataValidationHelper implements DataValidationHelper { } CellRangeAddress[] cellRangeAddresses = cellRangeAddressList.getCellRangeAddresses(); - List<String> sqref = new ArrayList<String>(); + List<String> sqref = new ArrayList<>(); for (int i = 0; i < cellRangeAddresses.length; i++) { CellRangeAddress cellRangeAddress = cellRangeAddresses[i]; sqref.add(cellRangeAddress.formatAsString()); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java index b67c7eb449..5c88adb316 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java @@ -482,7 +482,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSS * Returns all charts in this drawing. */ public List<XSSFChart> getCharts() { - List<XSSFChart> charts = new ArrayList<XSSFChart>(); + List<XSSFChart> charts = new ArrayList<>(); for(POIXMLDocumentPart part : getRelations()) { if(part instanceof XSSFChart) { charts.add((XSSFChart)part); @@ -549,7 +549,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSS * @return list of shapes in this drawing */ public List<XSSFShape> getShapes(){ - List<XSSFShape> lst = new ArrayList<XSSFShape>(); + List<XSSFShape> lst = new ArrayList<>(); XmlCursor cur = drawing.newCursor(); try { if (cur.toFirstChild()) { @@ -565,7 +565,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSS * @return list of shapes in this shape group */ public List<XSSFShape> getShapes(XSSFShapeGroup groupshape){ - List<XSSFShape> lst = new ArrayList<XSSFShape>(); + List<XSSFShape> lst = new ArrayList<>(); XmlCursor cur = groupshape.getCTGroupShape().newCursor(); try { addShapes(cur, lst); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java index fb042afaf4..d8391ebf78 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java @@ -55,7 +55,7 @@ final class XSSFEvaluationSheet implements EvaluationSheet { public EvaluationCell getCell(int rowIndex, int columnIndex) { // cache for performance: ~30% speedup due to caching if (_cellCache == null) { - _cellCache = new HashMap<CellKey, EvaluationCell>(_xs.getLastRowNum()*3); + _cellCache = new HashMap<>(_xs.getLastRowNum() * 3); for (final Row row : _xs) { final int rowNum = row.getRowNum(); for (final Cell cell : row) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java index d71d7a68fe..221df66fb6 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java @@ -76,7 +76,7 @@ public class XSSFMap { * @return the list of Single Xml Cells that provide a map rule to this mapping. */ public List<XSSFSingleXmlCell> getRelatedSingleXMLCell() { - List<XSSFSingleXmlCell> relatedSimpleXmlCells = new ArrayList<XSSFSingleXmlCell>(); + List<XSSFSingleXmlCell> relatedSimpleXmlCells = new ArrayList<>(); int sheetNumber = mapInfo.getWorkbook().getNumberOfSheets(); for (int i = 0; i < sheetNumber; i++) { @@ -99,7 +99,7 @@ public class XSSFMap { * @return the list of all Tables that provide a map rule to this mapping */ public List<XSSFTable> getRelatedTables() { - List<XSSFTable> tables = new ArrayList<XSSFTable>(); + List<XSSFTable> tables = new ArrayList<>(); for (Sheet sheet : mapInfo.getWorkbook()) { for (RelationPart rp : ((XSSFSheet)sheet).getRelationParts()) { if (rp.getRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation())) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java index 8b640590be..acc7afe5f0 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java @@ -283,7 +283,7 @@ public class XSSFPivotTable extends POIXMLDocumentPart { @Beta public List<Integer> getRowLabelColumns() { if (pivotTableDefinition.getRowFields() != null) { - List<Integer> columnIndexes = new ArrayList<Integer>(); + List<Integer> columnIndexes = new ArrayList<>(); for (CTField f : pivotTableDefinition.getRowFields().getFieldArray()) { columnIndexes.add(f.getX()); } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java index dee6706f30..882f12b357 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java @@ -41,7 +41,7 @@ public final class XSSFRelation extends POIXMLRelation { /** * A map to lookup POIXMLRelation by its relation type */ - private static final Map<String, XSSFRelation> _table = new HashMap<String, XSSFRelation>(); + private static final Map<String, XSSFRelation> _table = new HashMap<>(); public static final XSSFRelation WORKBOOK = new XSSFRelation( diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java index e93f0fa4af..3c944d4cde 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java @@ -559,7 +559,7 @@ public class XSSFRichTextString implements RichTextString { TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){ int length = 0; - TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>(); + TreeMap<Integer, CTRPrElt> formats = new TreeMap<>(); //noinspection deprecation - for performance reasons! for (CTRElt r : entry.getRArray()) { String txt = r.getT(); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java index 35ed242813..fed5d383c2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java @@ -70,7 +70,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> { protected XSSFRow(CTRow row, XSSFSheet sheet) { _row = row; _sheet = sheet; - _cells = new TreeMap<Integer, XSSFCell>(); + _cells = new TreeMap<>(); for (CTCell c : row.getCArray()) { XSSFCell cell = new XSSFCell(this, c); // Performance optimization for bug 57840: explicit boxing is slightly faster than auto-unboxing, though may use more memory @@ -617,7 +617,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> { // Remove MergedRegions in dest row final int destRowNum = getRowNum(); int index = 0; - final Set<Integer> indices = new HashSet<Integer>(); + final Set<Integer> indices = new HashSet<>(); for (CellRangeAddress destRegion : getSheet().getMergedRegions()) { if (destRowNum == destRegion.getFirstRow() && destRowNum == destRegion.getLastRow()) { indices.add(index); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index d6b7baf340..6dea9a792d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -162,7 +162,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { protected CTSheet sheet; protected CTWorksheet worksheet; - private final SortedMap<Integer, XSSFRow> _rows = new TreeMap<Integer, XSSFRow>(); + private final SortedMap<Integer, XSSFRow> _rows = new TreeMap<>(); private List<XSSFHyperlink> hyperlinks; private ColumnHelper columnHelper; private CommentsTable sheetComments; @@ -256,14 +256,14 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { worksheet = newSheet(); initRows(worksheet); columnHelper = new ColumnHelper(worksheet); - hyperlinks = new ArrayList<XSSFHyperlink>(); + hyperlinks = new ArrayList<>(); } private void initRows(CTWorksheet worksheetParam) { _rows.clear(); - tables = new TreeMap<String, XSSFTable>(); - sharedFormulas = new HashMap<Integer, CTCellFormula>(); - arrayFormulas = new ArrayList<CellRangeAddress>(); + tables = new TreeMap<>(); + sharedFormulas = new HashMap<>(); + arrayFormulas = new ArrayList<>(); for (CTRow row : worksheetParam.getSheetData().getRowArray()) { XSSFRow r = new XSSFRow(row, this); // Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory @@ -277,7 +277,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * and initialize the internal array of XSSFHyperlink objects */ private void initHyperlinks() { - hyperlinks = new ArrayList<XSSFHyperlink>(); + hyperlinks = new ArrayList<>(); if(!worksheet.isSetHyperlinks()) { return; @@ -1316,7 +1316,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { */ @Override public List<CellRangeAddress> getMergedRegions() { - List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>(); + List<CellRangeAddress> addresses = new ArrayList<>(); CTMergeCells ctMergeCells = worksheet.getMergeCells(); if(ctMergeCells == null) { return addresses; @@ -1468,7 +1468,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { if (startRowNum > endRowNum) { throw new IllegalArgumentException("getRows: startRowNum must be less than or equal to endRowNum"); } - final List<XSSFRow> rows = new ArrayList<XSSFRow>(); + final List<XSSFRow> rows = new ArrayList<>(); if (createRowIfMissing) { for (int i = startRowNum; i <= endRowNum; i++) { XSSFRow row = getRow(i); @@ -1944,7 +1944,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { } CTMergeCells ctMergeCells = worksheet.getMergeCells(); - List<CTMergeCell> newMergeCells = new ArrayList<CTMergeCell>(ctMergeCells.sizeOfMergeCellArray()); + List<CTMergeCell> newMergeCells = new ArrayList<>(ctMergeCells.sizeOfMergeCellArray()); int idx = 0; for (CTMergeCell mc : ctMergeCells.getMergeCellArray()) { @@ -1972,7 +1972,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { throw new IllegalArgumentException("Specified row does not belong to this sheet"); } // collect cells into a temporary array to avoid ConcurrentModificationException - ArrayList<XSSFCell> cellsToDelete = new ArrayList<XSSFCell>(); + ArrayList<XSSFCell> cellsToDelete = new ArrayList<>(); for (Cell cell : row) { cellsToDelete.add((XSSFCell)cell); } @@ -3020,7 +3020,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { // FIXME: (performance optimization) this should be moved outside the for-loop so that hyperlinks only needs to be iterated over once. // also remove any hyperlinks associated with this row if (hyperlinks != null) { - for (XSSFHyperlink link : new ArrayList<XSSFHyperlink>(hyperlinks)) { + for (XSSFHyperlink link : new ArrayList<>(hyperlinks)) { CellReference ref = new CellReference(link.getCellRef()); if (ref.getRow() == rownum) { hyperlinks.remove(link); @@ -3033,20 +3033,20 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { // then do the actual moving and also adjust comments/rowHeight // we need to sort it in a way so the shifting does not mess up the structures, // i.e. when shifting down, start from down and go up, when shifting up, vice-versa - SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<XSSFComment, Integer>(new Comparator<XSSFComment>() { + SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<>(new Comparator<XSSFComment>() { @Override public int compare(XSSFComment o1, XSSFComment o2) { int row1 = o1.getRow(); int row2 = o2.getRow(); - - if(row1 == row2) { + + if (row1 == row2) { // ordering is not important when row is equal, but don't return zero to still // get multiple comments per row into the map return o1.hashCode() - o2.hashCode(); } // when shifting down, sort higher row-values first - if(n > 0) { + if (n > 0) { return row1 < row2 ? 1 : -1; } else { // sort lower-row values first when shifting up @@ -3116,7 +3116,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { rowShifter.updateHyperlinks(shifter); //rebuild the _rows map - Map<Integer, XSSFRow> map = new HashMap<Integer, XSSFRow>(); + Map<Integer, XSSFRow> map = new HashMap<>(); for(XSSFRow r : _rows.values()) { // Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory final Integer rownumI = new Integer(r.getRowNum()); // NOSONAR @@ -3833,7 +3833,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { int lastColumn = range.getLastColumn(); int height = lastRow - firstRow + 1; int width = lastColumn - firstColumn + 1; - List<XSSFCell> temp = new ArrayList<XSSFCell>(height*width); + List<XSSFCell> temp = new ArrayList<>(height * width); for (int rowIn = firstRow; rowIn <= lastRow; rowIn++) { for (int colIn = firstColumn; colIn <= lastColumn; colIn++) { XSSFRow row = getRow(rowIn); @@ -3888,7 +3888,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { @Override public List<XSSFDataValidation> getDataValidations() { - List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>(); + List<XSSFDataValidation> xssfValidations = new ArrayList<>(); CTDataValidations dataValidations = this.worksheet.getDataValidations(); if( dataValidations!=null && dataValidations.getCount() > 0 ) { for (CTDataValidation ctDataValidation : dataValidations.getDataValidationArray()) { @@ -3983,7 +3983,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Returns any tables associated with this Sheet */ public List<XSSFTable> getTables() { - return new ArrayList<XSSFTable>(tables.values()); + return new ArrayList<>(tables.values()); } /** @@ -4374,7 +4374,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { */ @Beta public List<XSSFPivotTable> getPivotTables() { - List<XSSFPivotTable> tables = new ArrayList<XSSFPivotTable>(); + List<XSSFPivotTable> tables = new ArrayList<>(); for (XSSFPivotTable table : getWorkbook().getPivotTables()) { if (table.getParent() == this) { tables.add(table); @@ -4421,12 +4421,12 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * @return Map of error type to the range(s) where they are ignored. */ public Map<IgnoredErrorType, Set<CellRangeAddress>> getIgnoredErrors() { - Map<IgnoredErrorType, Set<CellRangeAddress>> result = new LinkedHashMap<IgnoredErrorType, Set<CellRangeAddress>>(); + Map<IgnoredErrorType, Set<CellRangeAddress>> result = new LinkedHashMap<>(); if (worksheet.isSetIgnoredErrors()) { for (CTIgnoredError err : worksheet.getIgnoredErrors().getIgnoredErrorList()) { for (IgnoredErrorType errType : XSSFIgnoredErrorHelper.getErrorTypes(err)) { if (!result.containsKey(errType)) { - result.put(errType, new LinkedHashSet<CellRangeAddress>()); + result.put(errType, new LinkedHashSet<>()); } for (Object ref : err.getSqref()) { result.get(errType).add(CellRangeAddress.valueOf(ref.toString())); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java index 76138246ff..173e24fbeb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java @@ -200,7 +200,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin CellRangeAddress[] mergeCellRanges = CellRangeUtil.mergeCellRanges(regions); CTConditionalFormatting cf = _sheet.getCTWorksheet().addNewConditionalFormatting(); - List<String> refs = new ArrayList<String>(); + List<String> refs = new ArrayList<>(); for(CellRangeAddress a : mergeCellRanges) refs.add(a.formatAsString()); cf.setSqref(refs); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java index 08e35f30e5..4696030ba6 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java @@ -57,7 +57,7 @@ public class XSSFSimpleShape extends XSSFShape implements Iterable<XSSFTextParag this.drawing = drawing; this.ctShape = ctShape; - _paragraphs = new ArrayList<XSSFTextParagraph>(); + _paragraphs = new ArrayList<>(); // initialize any existing paragraphs - this will be the default body paragraph in a new shape, // or existing paragraphs that have been loaded from the file @@ -132,7 +132,7 @@ public class XSSFSimpleShape extends XSSFShape implements Iterable<XSSFTextParag public String getText() { final int MAX_LEVELS = 9; StringBuilder out = new StringBuilder(); - List<Integer> levelCount = new ArrayList<Integer>(MAX_LEVELS); // maximum 9 levels + List<Integer> levelCount = new ArrayList<>(MAX_LEVELS); // maximum 9 levels XSSFTextParagraph p = null; // initialise the levelCount array - this maintains a record of the numbering to be used at each level diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 7435ce6add..39b1ab7da2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -219,7 +219,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { */ public List<XSSFXmlColumnPr> getXmlColumnPrs() { if (xmlColumnPr==null) { - xmlColumnPr = new ArrayList<XSSFXmlColumnPr>(); + xmlColumnPr = new ArrayList<>(); for (CTTableColumn column: getTableColumns()) { if (column.getXmlColumnPr()!=null) { XSSFXmlColumnPr columnPr = new XSSFXmlColumnPr(this,column,column.getXmlColumnPr()); @@ -520,7 +520,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { if (columnMap == null) { // FIXME: replace with org.apache.commons.collections.map.CaseInsensitiveMap final int count = getTableColumns().length; - columnMap = new HashMap<String, Integer>(count * 3 / 2); + columnMap = new HashMap<>(count * 3 / 2); int i = 0; for (CTTableColumn column : getTableColumns()) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java index 2cff0a5c9e..74652b9f68 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java @@ -45,7 +45,7 @@ public class XSSFTableStyle implements TableStyle { private final String name; private final int index; - private final Map<TableStyleType, DifferentialStyleProvider> elementMap = new EnumMap<TableStyleType, DifferentialStyleProvider>(TableStyleType.class); + private final Map<TableStyleType, DifferentialStyleProvider> elementMap = new EnumMap<>(TableStyleType.class); /** * @param index style definition index or built-in ordinal depending on use @@ -58,7 +58,7 @@ public class XSSFTableStyle implements TableStyle { this.name = tableStyle.getName(); this.index = index; - List<CTDxf> dxfList = new ArrayList<CTDxf>(); + List<CTDxf> dxfList = new ArrayList<>(); // CT* classes don't handle "mc:AlternateContent" elements, so get the Dxf instances manually XmlCursor cur = dxfs.newCursor(); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java index e03107e41e..5df01abda2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java @@ -41,7 +41,7 @@ public class XSSFTextParagraph implements Iterable<XSSFTextRun>{ XSSFTextParagraph(CTTextParagraph p, CTShape ctShape){ _p = p; _shape = ctShape; - _runs = new ArrayList<XSSFTextRun>(); + _runs = new ArrayList<>(); for(XmlObject ch : _p.selectPath("*")){ if(ch instanceof CTRegularTextRun){ diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java index 43c38bce5b..5cfd38294a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java @@ -92,8 +92,8 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart { */ private static final Pattern ptrn_shapeId = Pattern.compile("_x0000_s(\\d+)"); - private List<QName> _qnames = new ArrayList<QName>(); - private List<XmlObject> _items = new ArrayList<XmlObject>(); + private List<QName> _qnames = new ArrayList<>(); + private List<XmlObject> _items = new ArrayList<>(); private String _shapeTypeId; private int _shapeId = 1024; @@ -135,8 +135,8 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart { } XmlObject root = XmlObject.Factory.parse(doc, DEFAULT_XML_OPTIONS); - _qnames = new ArrayList<QName>(); - _items = new ArrayList<XmlObject>(); + _qnames = new ArrayList<>(); + _items = new ArrayList<>(); for(XmlObject obj : root.selectPath("$this/xml/*")) { Node nd = obj.getDomNode(); QName qname = new QName(nd.getNamespaceURI(), nd.getLocalName()); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index 08c565a346..b7d27bfa82 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -347,8 +347,8 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { } // Create arrays for parts attached to the workbook itself - pivotTables = new ArrayList<XSSFPivotTable>(); - pivotCaches = new ArrayList<CTPivotCache>(); + pivotTables = new ArrayList<>(); + pivotCaches = new ArrayList<>(); } @Override @@ -358,8 +358,8 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { this.workbook = doc.getWorkbook(); ThemesTable theme = null; - Map<String, XSSFSheet> shIdMap = new HashMap<String, XSSFSheet>(); - Map<String, ExternalLinksTable> elIdMap = new HashMap<String, ExternalLinksTable>(); + Map<String, XSSFSheet> shIdMap = new HashMap<>(); + Map<String, ExternalLinksTable> elIdMap = new HashMap<>(); for(RelationPart rp : getRelationParts()){ POIXMLDocumentPart p = rp.getDocumentPart(); if(p instanceof SharedStringsTable) { @@ -402,7 +402,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { // Load individual sheets. The order of sheets is defined by the order // of CTSheet elements in the workbook - sheets = new ArrayList<XSSFSheet>(shIdMap.size()); + sheets = new ArrayList<>(shIdMap.size()); //noinspection deprecation for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) { parseSheet(shIdMap, ctSheet); @@ -410,7 +410,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { // Load the external links tables. Their order is defined by the order // of CTExternalReference elements in the workbook - externalLinks = new ArrayList<ExternalLinksTable>(elIdMap.size()); + externalLinks = new ArrayList<>(elIdMap.size()); if (this.workbook.isSetExternalReferences()) { for (CTExternalReference er : this.workbook.getExternalReferences().getExternalReferenceArray()) { ExternalLinksTable el = elIdMap.get(er.getId()); @@ -466,10 +466,10 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { stylesSource = (StylesTable)createRelationship(XSSFRelation.STYLES, XSSFFactory.getInstance()); stylesSource.setWorkbook(this); - namedRanges = new ArrayList<XSSFName>(); - namedRangesByName = new ArrayListValuedHashMap<String, XSSFName>(); - sheets = new ArrayList<XSSFSheet>(); - pivotTables = new ArrayList<XSSFPivotTable>(); + namedRanges = new ArrayList<>(); + namedRangesByName = new ArrayListValuedHashMap<>(); + sheets = new ArrayList<>(); + pivotTables = new ArrayList<>(); } /** @@ -932,7 +932,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { public List<XSSFPictureData> getAllPictures() { if(pictures == null){ List<PackagePart> mediaParts = getPackage().getPartsByName(Pattern.compile("/xl/media/.*?")); - pictures = new ArrayList<XSSFPictureData>(mediaParts.size()); + pictures = new ArrayList<>(mediaParts.size()); for(PackagePart part : mediaParts){ pictures.add(new XSSFPictureData(part)); } @@ -1189,7 +1189,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { */ @Override public Iterator<Sheet> sheetIterator() { - return new SheetIterator<Sheet>(); + return new SheetIterator<>(); } /** @@ -1381,7 +1381,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { } //adjust indices of names ranges - List<XSSFName> toRemove = new ArrayList<XSSFName>(); + List<XSSFName> toRemove = new ArrayList<>(); for (XSSFName nm : namedRanges) { CTDefinedName ct = nm.getCTName(); if(!ct.isSetLocalSheetId()) { @@ -1722,8 +1722,8 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { } private void reprocessNamedRanges() { - namedRangesByName = new ArrayListValuedHashMap<String, XSSFName>(); - namedRanges = new ArrayList<XSSFName>(); + namedRangesByName = new ArrayListValuedHashMap<>(); + namedRanges = new ArrayList<>(); if(workbook.isSetDefinedNames()) { for(CTDefinedName ctName : workbook.getDefinedNames().getDefinedNameArray()) { createAndStoreName(ctName); @@ -1843,7 +1843,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { */ @Override public List<PackagePart> getAllEmbedds() throws OpenXML4JException { - List<PackagePart> embedds = new LinkedList<PackagePart>(); + List<PackagePart> embedds = new LinkedList<>(); for(XSSFSheet sheet : sheets){ // Get the embeddings for the workbook @@ -1978,7 +1978,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { * @return a collection of custom XML mappings defined in this workbook */ public Collection<XSSFMap> getCustomXMLMappings(){ - return mapInfo == null ? new ArrayList<XSSFMap>() : mapInfo.getAllXSSFMaps(); + return mapInfo == null ? new ArrayList<>() : mapInfo.getAllXSSFMaps(); } /** @@ -2244,7 +2244,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { cache.setCacheId(tableId); cache.setId(rId); if(pivotCaches == null) { - pivotCaches = new ArrayList<CTPivotCache>(); + pivotCaches = new ArrayList<>(); } pivotCaches.add(cache); return cache; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java index 64c72c250e..7038745033 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java @@ -46,7 +46,7 @@ public class XSSFLineChartData implements LineChartData { private List<Series> series; public XSSFLineChartData() { - series = new ArrayList<Series>(); + series = new ArrayList<>(); } static class Series extends AbstractXSSFChartSeries implements LineChartSeries { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java index f31b355031..b192c36bd9 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java @@ -48,7 +48,7 @@ public class XSSFScatterChartData implements ScatterChartData { private List<Series> series; public XSSFScatterChartData() { - series = new ArrayList<Series>(); + series = new ArrayList<>(); } /** diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java index b27100656b..bccbbf167f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java @@ -47,7 +47,7 @@ public class ColumnHelper { } public void cleanColumns() { - TreeSet<CTCol> trackedCols = new TreeSet<CTCol>(CTColComparator.BY_MIN_MAX); + TreeSet<CTCol> trackedCols = new TreeSet<>(CTColComparator.BY_MIN_MAX); CTCols newCols = CTCols.Factory.newInstance(); CTCols[] colsArray = worksheet.getColsArray(); int i = 0; @@ -72,7 +72,7 @@ public class ColumnHelper { // class then we could keep trackedCols as state, // making this log(N) rather than Nlog(N). We do this for the initial // read above. - TreeSet<CTCol> trackedCols = new TreeSet<CTCol>( + TreeSet<CTCol> trackedCols = new TreeSet<>( CTColComparator.BY_MIN_MAX); trackedCols.addAll(cols.getColList()); addCleanColIntoCols(cols, newCol, trackedCols); @@ -130,7 +130,7 @@ public class ColumnHelper { private List<CTCol> getOverlappingCols(final CTCol newCol, final TreeSet<CTCol> trackedCols) { CTCol lower = trackedCols.lower(newCol); NavigableSet<CTCol> potentiallyOverlapping = lower == null ? trackedCols : trackedCols.tailSet(lower, overlaps(lower, newCol)); - List<CTCol> overlapping = new ArrayList<CTCol>(); + List<CTCol> overlapping = new ArrayList<>(); for (CTCol existing : potentiallyOverlapping) { if (overlaps(newCol, existing)) { overlapping.add(existing); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFIgnoredErrorHelper.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFIgnoredErrorHelper.java index d0dc0b7606..61ea8d291a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFIgnoredErrorHelper.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFIgnoredErrorHelper.java @@ -95,7 +95,7 @@ public class XSSFIgnoredErrorHelper { } public static Set<IgnoredErrorType> getErrorTypes(CTIgnoredError err) { - Set<IgnoredErrorType> result = new LinkedHashSet<IgnoredErrorType>(); + Set<IgnoredErrorType> result = new LinkedHashSet<>(); for (IgnoredErrorType errType : IgnoredErrorType.values()) { if (XSSFIgnoredErrorHelper.isSet(errType, err)) { result.add(errType); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java index 46f0b892cf..60e7ce78f6 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java @@ -206,7 +206,7 @@ public final class XSSFRowShifter extends RowShifter { for (int j = conditionalFormattingArray.length - 1; j >= 0; j--) { CTConditionalFormatting cf = conditionalFormattingArray[j]; - ArrayList<CellRangeAddress> cellRanges = new ArrayList<CellRangeAddress>(); + ArrayList<CellRangeAddress> cellRanges = new ArrayList<>(); for (Object stRef : cf.getSqref()) { String[] regions = stRef.toString().split(" "); for (String region : regions) { @@ -215,7 +215,7 @@ public final class XSSFRowShifter extends RowShifter { } boolean changed = false; - List<CellRangeAddress> temp = new ArrayList<CellRangeAddress>(); + List<CellRangeAddress> temp = new ArrayList<>(); for (CellRangeAddress craOld : cellRanges) { CellRangeAddress craNew = shiftRange(shifter, craOld, sheetIndex); if (craNew == null) { @@ -234,7 +234,7 @@ public final class XSSFRowShifter extends RowShifter { ctWorksheet.removeConditionalFormatting(j); continue; } - List<String> refs = new ArrayList<String>(); + List<String> refs = new ArrayList<>(); for(CellRangeAddress a : temp) refs.add(a.formatAsString()); cf.setSqref(refs); } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java index 69e039120e..d77e7f088f 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java @@ -600,7 +600,7 @@ public enum Borders { ZIG_ZAG_STITCH(191); - private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>(); + private static Map<Integer, Borders> imap = new HashMap<>(); static { for (Borders p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java index 5e49ee479c..895c143b0c 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java @@ -83,7 +83,7 @@ public enum BreakClear { */ ALL(4); - private static Map<Integer, BreakClear> imap = new HashMap<Integer, BreakClear>(); + private static Map<Integer, BreakClear> imap = new HashMap<>(); static { for (BreakClear p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java index 3a6054b011..aea132db97 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java @@ -56,7 +56,7 @@ public enum BreakType { */ TEXT_WRAPPING(3); - private static Map<Integer, BreakType> imap = new HashMap<Integer, BreakType>(); + private static Map<Integer, BreakType> imap = new HashMap<>(); static { for (BreakType p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java index 10a34418f1..836069d0d5 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java @@ -49,7 +49,7 @@ public enum LineSpacingRule { AT_LEAST(3); - private static Map<Integer, LineSpacingRule> imap = new HashMap<Integer, LineSpacingRule>(); + private static Map<Integer, LineSpacingRule> imap = new HashMap<>(); static { for (LineSpacingRule p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java index f39d533508..9f6496d49f 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java @@ -40,7 +40,7 @@ public enum ParagraphAlignment { LOW_KASHIDA(9), THAI_DISTRIBUTE(10); - private static Map<Integer, ParagraphAlignment> imap = new HashMap<Integer, ParagraphAlignment>(); + private static Map<Integer, ParagraphAlignment> imap = new HashMap<>(); static { for (ParagraphAlignment p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextAlignment.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextAlignment.java index b8511a3bbc..6ed8dc00e4 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextAlignment.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextAlignment.java @@ -52,7 +52,7 @@ public enum TextAlignment { */ AUTO(5); - private static Map<Integer, TextAlignment> imap = new HashMap<Integer, TextAlignment>(); + private static Map<Integer, TextAlignment> imap = new HashMap<>(); static { for (TextAlignment p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java index 132444796a..f863d79fbf 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java @@ -135,7 +135,7 @@ public enum UnderlinePatterns { */ NONE(18); - private static Map<Integer, UnderlinePatterns> imap = new HashMap<Integer, UnderlinePatterns>(); + private static Map<Integer, UnderlinePatterns> imap = new HashMap<>(); static { for (UnderlinePatterns p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java index 57b2797165..209e006dca 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java @@ -47,7 +47,7 @@ public enum VerticalAlign { */ SUBSCRIPT(3); - private static Map<Integer, VerticalAlign> imap = new HashMap<Integer, VerticalAlign>(); + private static Map<Integer, VerticalAlign> imap = new HashMap<>(); static { for (VerticalAlign p : values()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java index 7cdfd6f7b0..97c7c76f19 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java @@ -80,17 +80,17 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; public class XWPFDocument extends POIXMLDocument implements Document, IBody { private static final POILogger LOG = POILogFactory.getLogger(XWPFDocument.class); - protected List<XWPFFooter> footers = new ArrayList<XWPFFooter>(); - protected List<XWPFHeader> headers = new ArrayList<XWPFHeader>(); - protected List<XWPFComment> comments = new ArrayList<XWPFComment>(); - protected List<XWPFHyperlink> hyperlinks = new ArrayList<XWPFHyperlink>(); - protected List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>(); - protected List<XWPFTable> tables = new ArrayList<XWPFTable>(); - protected List<XWPFSDT> contentControls = new ArrayList<XWPFSDT>(); - protected List<IBodyElement> bodyElements = new ArrayList<IBodyElement>(); - protected List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>(); - protected Map<Long, List<XWPFPictureData>> packagePictures = new HashMap<Long, List<XWPFPictureData>>(); - protected Map<Integer, XWPFFootnote> endnotes = new HashMap<Integer, XWPFFootnote>(); + protected List<XWPFFooter> footers = new ArrayList<>(); + protected List<XWPFHeader> headers = new ArrayList<>(); + protected List<XWPFComment> comments = new ArrayList<>(); + protected List<XWPFHyperlink> hyperlinks = new ArrayList<>(); + protected List<XWPFParagraph> paragraphs = new ArrayList<>(); + protected List<XWPFTable> tables = new ArrayList<>(); + protected List<XWPFSDT> contentControls = new ArrayList<>(); + protected List<IBodyElement> bodyElements = new ArrayList<>(); + protected List<XWPFPictureData> pictures = new ArrayList<>(); + protected Map<Long, List<XWPFPictureData>> packagePictures = new HashMap<>(); + protected Map<Integer, XWPFFootnote> endnotes = new HashMap<>(); protected XWPFNumbering numbering; protected XWPFStyles styles; protected XWPFFootnotes footnotes; @@ -522,7 +522,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { */ @Override public List<PackagePart> getAllEmbedds() throws OpenXML4JException { - List<PackagePart> embedds = new LinkedList<PackagePart>(); + List<PackagePart> embedds = new LinkedList<>(); // Get the embeddings for the workbook PackagePart part = getPackagePart(); @@ -1312,7 +1312,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { * @return all Pictures in this package */ public List<XWPFPictureData> getAllPackagePictures() { - List<XWPFPictureData> result = new ArrayList<XWPFPictureData>(); + List<XWPFPictureData> result = new ArrayList<>(); Collection<List<XWPFPictureData>> values = packagePictures.values(); for (List<XWPFPictureData> list : values) { result.addAll(list); @@ -1323,7 +1323,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { void registerPackagePictureData(XWPFPictureData picData) { List<XWPFPictureData> list = packagePictures.get(picData.getChecksum()); if (list == null) { - list = new ArrayList<XWPFPictureData>(1); + list = new ArrayList<>(1); packagePictures.put(picData.getChecksum(), list); } if (!list.contains(picData)) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java index e67ed30894..6a9cb65f38 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java @@ -32,10 +32,10 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; public class XWPFFootnote implements Iterable<XWPFParagraph>, IBody { - private List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>(); - private List<XWPFTable> tables = new ArrayList<XWPFTable>(); - private List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>(); - private List<IBodyElement> bodyElements = new ArrayList<IBodyElement>(); + private List<XWPFParagraph> paragraphs = new ArrayList<>(); + private List<XWPFTable> tables = new ArrayList<>(); + private List<XWPFPictureData> pictures = new ArrayList<>(); + private List<IBodyElement> bodyElements = new ArrayList<>(); private CTFtnEdn ctFtnEdn; private XWPFFootnotes footnotes; diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java index c037bd7d4b..d57d7b885b 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java @@ -42,7 +42,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.FootnotesDocument; */ public class XWPFFootnotes extends POIXMLDocumentPart { protected XWPFDocument document; - private List<XWPFFootnote> listFootnote = new ArrayList<XWPFFootnote>(); + private List<XWPFFootnote> listFootnote = new ArrayList<>(); private CTFootnotes ctFootnotes; /** diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java index 62ecfeed5f..24d83925a6 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java @@ -42,10 +42,10 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; * Parent of XWPF headers and footers */ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBody { - List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>(); - List<XWPFTable> tables = new ArrayList<XWPFTable>(); - List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>(); - List<IBodyElement> bodyElements = new ArrayList<IBodyElement>(); + List<XWPFParagraph> paragraphs = new ArrayList<>(); + List<XWPFTable> tables = new ArrayList<>(); + List<XWPFPictureData> pictures = new ArrayList<>(); + List<IBodyElement> bodyElements = new ArrayList<>(); CTHdrFtr headerFooter; XWPFDocument document; @@ -518,9 +518,9 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo } public void readHdrFtr() { - bodyElements = new ArrayList<IBodyElement>(); - paragraphs = new ArrayList<XWPFParagraph>(); - tables = new ArrayList<XWPFTable>(); + bodyElements = new ArrayList<>(); + paragraphs = new ArrayList<>(); + tables = new ArrayList<>(); // parse the document with cursor and add // the XmlObject to its lists XmlCursor cursor = headerFooter.newCursor(); diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java index 1b7162e004..b4b34e5562 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java @@ -42,8 +42,8 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.NumberingDocument; * @author Philipp Epp */ public class XWPFNumbering extends POIXMLDocumentPart { - protected List<XWPFAbstractNum> abstractNums = new ArrayList<XWPFAbstractNum>(); - protected List<XWPFNum> nums = new ArrayList<XWPFNum>(); + protected List<XWPFAbstractNum> abstractNums = new ArrayList<>(); + protected List<XWPFNum> nums = new ArrayList<>(); boolean isNew; private CTNumbering ctNumbering; @@ -61,8 +61,8 @@ public class XWPFNumbering extends POIXMLDocumentPart { * create a new XWPFNumbering object for use in a new document */ public XWPFNumbering() { - abstractNums = new ArrayList<XWPFAbstractNum>(); - nums = new ArrayList<XWPFNum>(); + abstractNums = new ArrayList<>(); + nums = new ArrayList<>(); isNew = true; } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java index b5ecba393b..cb1d089125 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java @@ -58,8 +58,8 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para } // Build up the character runs - runs = new ArrayList<XWPFRun>(); - iruns = new ArrayList<IRunElement>(); + runs = new ArrayList<>(); + iruns = new ArrayList<>(); buildRunsInOrderFromXml(paragraph); // Look for bits associated with the runs diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java index dbd5f37733..9f628845e2 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java @@ -32,7 +32,7 @@ public final class XWPFRelation extends POIXMLRelation { /** * A map to lookup POIXMLRelation by its relation type */ - private static final Map<String, XWPFRelation> _table = new HashMap<String, XWPFRelation>(); + private static final Map<String, XWPFRelation> _table = new HashMap<>(); public static final XWPFRelation DOCUMENT = new XWPFRelation( "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java index 4da3f995b1..8b9c527aae 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java @@ -123,7 +123,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { // Look for any text in any of our pictures or drawings StringBuilder text = new StringBuilder(); - List<XmlObject> pictTextObjs = new ArrayList<XmlObject>(); + List<XmlObject> pictTextObjs = new ArrayList<>(); pictTextObjs.addAll(Arrays.asList(r.getPictArray())); pictTextObjs.addAll(Arrays.asList(r.getDrawingArray())); for (XmlObject o : pictTextObjs) { @@ -143,7 +143,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { // Do we have any embedded pictures? // (They're a different CTPicture, under the drawingml namespace) - pictures = new ArrayList<XWPFPicture>(); + pictures = new ArrayList<>(); for (XmlObject o : pictTextObjs) { for (CTPicture pict : getCTPictures(o)) { XWPFPicture picture = new XWPFPicture(pict, this); @@ -175,7 +175,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { } private List<CTPicture> getCTPictures(XmlObject o) { - List<CTPicture> pics = new ArrayList<CTPicture>(); + List<CTPicture> pics = new ArrayList<>(); XmlObject[] picts = o.selectPath("declare namespace pic='" + CTPicture.type.getName().getNamespaceURI() + "' .//pic:pic"); for (XmlObject pict : picts) { if (pict instanceof XmlAnyTypeImpl) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java index 9950aa35ac..185e453aa0 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java @@ -40,11 +40,11 @@ public class XWPFSDTContent implements ISDTContent { // private final IBody part; // private final XWPFDocument document; - private List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>(); - private List<XWPFTable> tables = new ArrayList<XWPFTable>(); - private List<XWPFRun> runs = new ArrayList<XWPFRun>(); - private List<XWPFSDT> contentControls = new ArrayList<XWPFSDT>(); - private List<ISDTContents> bodyElements = new ArrayList<ISDTContents>(); + private List<XWPFParagraph> paragraphs = new ArrayList<>(); + private List<XWPFTable> tables = new ArrayList<>(); + private List<XWPFRun> runs = new ArrayList<>(); + private List<XWPFSDT> contentControls = new ArrayList<>(); + private List<ISDTContents> bodyElements = new ArrayList<>(); public XWPFSDTContent(CTSdtContentRun sdtRun, IBody part, IRunBody parent) { for (CTR ctr : sdtRun.getRArray()) { diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java index 511c85a6bd..1afc32e279 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java @@ -51,7 +51,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.StylesDocument; */ public class XWPFStyles extends POIXMLDocumentPart { private CTStyles ctStyles; - private List<XWPFStyle> listStyle = new ArrayList<XWPFStyle>(); + private List<XWPFStyle> listStyle = new ArrayList<>(); private XWPFLatentStyles latentStyles; private XWPFDefaultRunStyle defaultRunStyle; @@ -208,7 +208,7 @@ public class XWPFStyles extends POIXMLDocumentPart { * @return a list of all styles which were used by this method */ public List<XWPFStyle> getUsedStyleList(XWPFStyle style) { - List<XWPFStyle> usedStyleList = new ArrayList<XWPFStyle>(); + List<XWPFStyle> usedStyleList = new ArrayList<>(); usedStyleList.add(style); return getUsedStyleList(style, usedStyleList); } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java index cebdcab06d..be8831e8a9 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java @@ -50,7 +50,7 @@ public class XWPFTable implements IBodyElement, ISDTContents { static { // populate enum maps - xwpfBorderTypeMap = new EnumMap<XWPFBorderType, STBorder.Enum>(XWPFBorderType.class); + xwpfBorderTypeMap = new EnumMap<>(XWPFBorderType.class); xwpfBorderTypeMap.put(XWPFBorderType.NIL, STBorder.Enum.forInt(STBorder.INT_NIL)); xwpfBorderTypeMap.put(XWPFBorderType.NONE, STBorder.Enum.forInt(STBorder.INT_NONE)); xwpfBorderTypeMap.put(XWPFBorderType.SINGLE, STBorder.Enum.forInt(STBorder.INT_SINGLE)); @@ -60,7 +60,7 @@ public class XWPFTable implements IBodyElement, ISDTContents { xwpfBorderTypeMap.put(XWPFBorderType.DASHED, STBorder.Enum.forInt(STBorder.INT_DASHED)); xwpfBorderTypeMap.put(XWPFBorderType.DOT_DASH, STBorder.Enum.forInt(STBorder.INT_DOT_DASH)); - stBorderTypeMap = new HashMap<Integer, XWPFBorderType>(); + stBorderTypeMap = new HashMap<>(); stBorderTypeMap.put(STBorder.INT_NIL, XWPFBorderType.NIL); stBorderTypeMap.put(STBorder.INT_NONE, XWPFBorderType.NONE); stBorderTypeMap.put(STBorder.INT_SINGLE, XWPFBorderType.SINGLE); @@ -96,7 +96,7 @@ public class XWPFTable implements IBodyElement, ISDTContents { this.part = part; this.ctTbl = table; - tableRows = new ArrayList<XWPFTableRow>(); + tableRows = new ArrayList<>(); // is an empty table: I add one row and one column as default if (table.sizeOfTrArray() == 0) diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java index e20611c60f..4ce566bc44 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java @@ -49,13 +49,13 @@ public class XWPFTableCell implements IBody, ICell { static { // populate enum maps - alignMap = new EnumMap<XWPFVertAlign, STVerticalJc.Enum>(XWPFVertAlign.class); + alignMap = new EnumMap<>(XWPFVertAlign.class); alignMap.put(XWPFVertAlign.TOP, STVerticalJc.Enum.forInt(STVerticalJc.INT_TOP)); alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.Enum.forInt(STVerticalJc.INT_CENTER)); alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTH)); alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTTOM)); - stVertAlignTypeMap = new HashMap<Integer, XWPFVertAlign>(); + stVertAlignTypeMap = new HashMap<>(); stVertAlignTypeMap.put(STVerticalJc.INT_TOP, XWPFVertAlign.TOP); stVertAlignTypeMap.put(STVerticalJc.INT_CENTER, XWPFVertAlign.CENTER); stVertAlignTypeMap.put(STVerticalJc.INT_BOTH, XWPFVertAlign.BOTH); @@ -81,9 +81,9 @@ public class XWPFTableCell implements IBody, ICell { // NB: If a table cell does not include at least one block-level element, then this document shall be considered corrupt. if (cell.sizeOfPArray() < 1) cell.addNewP(); - bodyElements = new ArrayList<IBodyElement>(); - paragraphs = new ArrayList<XWPFParagraph>(); - tables = new ArrayList<XWPFTable>(); + bodyElements = new ArrayList<>(); + paragraphs = new ArrayList<>(); + tables = new ArrayList<>(); XmlCursor cursor = ctTc.newCursor(); cursor.selectPath("./*"); diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java index 4755a82096..39d2ff71ce 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java @@ -134,7 +134,7 @@ public class XWPFTableRow { */ public List<ICell> getTableICells() { - List<ICell> cells = new ArrayList<ICell>(); + List<ICell> cells = new ArrayList<>(); //Can't use ctRow.getTcList because that only gets table cells //Can't use ctRow.getSdtList because that only gets sdts that are at cell level XmlCursor cursor = ctRow.newCursor(); @@ -159,7 +159,7 @@ public class XWPFTableRow { */ public List<XWPFTableCell> getTableCells() { if (tableCells == null) { - List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>(); + List<XWPFTableCell> cells = new ArrayList<>(); for (CTTc tableCell : ctRow.getTcArray()) { cells.add(new XWPFTableCell(tableCell, this, table.getBody())); } diff --git a/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java b/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java index a636e20fb8..90e13aecd4 100644 --- a/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java +++ b/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java @@ -98,7 +98,7 @@ public final class TestPOIXMLDocument { } private static void traverse(POIXMLDocument doc) throws IOException{ - HashMap<String,POIXMLDocumentPart> context = new HashMap<String,POIXMLDocumentPart>(); + HashMap<String,POIXMLDocumentPart> context = new HashMap<>(); for (RelationPart p : doc.getRelationParts()){ traverse(p, context); } @@ -275,7 +275,7 @@ public final class TestPOIXMLDocument { POIXMLDocumentPart part = new POIXMLDocumentPart(); part.prepareForCommit(); part.commit(); - part.onSave(new HashSet<PackagePart>()); + part.onSave(new HashSet<>()); assertNull(part.getRelationById(null)); assertNull(part.getRelationId(null)); diff --git a/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java b/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java index 86732836ac..db3219f80e 100644 --- a/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java +++ b/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java @@ -187,7 +187,7 @@ public final class TestPOIXMLProperties { Date dateCreated = LocaleUtil.getLocaleCalendar(2010, 6, 15, 10, 0, 0).getTime(); - cp.setCreated(new Nullable<Date>(dateCreated)); + cp.setCreated(new Nullable<>(dateCreated)); assertEquals(dateCreated, cp.getCreated()); XWPFDocument doc2 = XWPFTestDataSamples.writeOutAndReadBack(doc); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java index f22c78790d..8bccffb3ee 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java @@ -39,7 +39,7 @@ public final class TestFileHelper { */ @Test public void testGetDirectory() { - TreeMap<String, String> expectedValue = new TreeMap<String, String>(); + TreeMap<String, String> expectedValue = new TreeMap<>(); expectedValue.put("/dir1/test.doc", "/dir1"); expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2"); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java index 78294e3534..a9776ae89b 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java @@ -37,10 +37,10 @@ public final class TestListParts extends TestCase { @Override protected void setUp() throws Exception { - values = new TreeMap<PackagePartName, String>(); + values = new TreeMap<>(); // Expected values - expectedValues = new TreeMap<PackagePartName, String>(); + expectedValues = new TreeMap<>(); expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"), "application/vnd.openxmlformats-package.relationships+xml"); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java index 44b3c3184f..97149e71a1 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java @@ -440,10 +440,10 @@ public final class TestPackage { TreeMap<PackagePartName, String> expectedValues; TreeMap<PackagePartName, String> values; - values = new TreeMap<PackagePartName, String>(); + values = new TreeMap<>(); // Expected values - expectedValues = new TreeMap<PackagePartName, String>(); + expectedValues = new TreeMap<>(); expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"), "application/vnd.openxmlformats-package.relationships+xml"); @@ -499,10 +499,10 @@ public final class TestPackage { TreeMap<PackagePartName, String> expectedValues; TreeMap<PackagePartName, String> values; - values = new TreeMap<PackagePartName, String>(); + values = new TreeMap<>(); // Expected values - expectedValues = new TreeMap<PackagePartName, String>(); + expectedValues = new TreeMap<>(); expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"), "application/vnd.openxmlformats-package.relationships+xml"); @@ -609,7 +609,7 @@ public final class TestPackage { OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ_WRITE); try { List<PackagePart> rs = pkg.getPartsByName(Pattern.compile("/word/.*?\\.xml")); - HashMap<String, PackagePart> selected = new HashMap<String, PackagePart>(); + HashMap<String, PackagePart> selected = new HashMap<>(); for(PackagePart p : rs) selected.put(p.getPartName().getName(), p); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java index b29d21fc0f..49a4da4422 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java @@ -109,8 +109,8 @@ public final class TestPackageCoreProperties { props.setKeywordsProperty("MyKeywords"); props.setLanguageProperty("MyLanguage"); props.setLastModifiedByProperty("Julien Chable"); - props.setLastPrintedProperty(new Nullable<Date>(dateToInsert)); - props.setModifiedProperty(new Nullable<Date>(dateToInsert)); + props.setLastPrintedProperty(new Nullable<>(dateToInsert)); + props.setModifiedProperty(new Nullable<>(dateToInsert)); props.setRevisionProperty("2"); props.setTitleProperty("MyTitle"); props.setSubjectProperty("MySubject"); @@ -168,10 +168,10 @@ public final class TestPackageCoreProperties { props.setCreatedProperty((String)null); assertEquals("", props.getCreatedPropertyString()); assertNull(props.getCreatedProperty().getValue()); - props.setCreatedProperty(new Nullable<Date>()); + props.setCreatedProperty(new Nullable<>()); assertEquals("", props.getCreatedPropertyString()); assertNull(props.getCreatedProperty().getValue()); - props.setCreatedProperty(new Nullable<Date>(date)); + props.setCreatedProperty(new Nullable<>(date)); assertEquals(strDate, props.getCreatedPropertyString()); assertEquals(date, props.getCreatedProperty().getValue()); props.setCreatedProperty(strDate); @@ -184,10 +184,10 @@ public final class TestPackageCoreProperties { props.setLastPrintedProperty((String)null); assertEquals("", props.getLastPrintedPropertyString()); assertNull(props.getLastPrintedProperty().getValue()); - props.setLastPrintedProperty(new Nullable<Date>()); + props.setLastPrintedProperty(new Nullable<>()); assertEquals("", props.getLastPrintedPropertyString()); assertNull(props.getLastPrintedProperty().getValue()); - props.setLastPrintedProperty(new Nullable<Date>(date)); + props.setLastPrintedProperty(new Nullable<>(date)); assertEquals(strDate, props.getLastPrintedPropertyString()); assertEquals(date, props.getLastPrintedProperty().getValue()); props.setLastPrintedProperty(strDate); @@ -198,9 +198,9 @@ public final class TestPackageCoreProperties { assertNull(props.getModifiedProperty().getValue()); props.setModifiedProperty((String)null); assertNull(props.getModifiedProperty().getValue()); - props.setModifiedProperty(new Nullable<Date>()); + props.setModifiedProperty(new Nullable<>()); assertNull(props.getModifiedProperty().getValue()); - props.setModifiedProperty(new Nullable<Date>(date)); + props.setModifiedProperty(new Nullable<>(date)); assertEquals(strDate, props.getModifiedPropertyString()); assertEquals(date, props.getModifiedProperty().getValue()); props.setModifiedProperty(strDate); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/ZipFileAssert.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/ZipFileAssert.java index a19e52b97a..330720fd30 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/ZipFileAssert.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/ZipFileAssert.java @@ -75,7 +75,7 @@ public class ZipFileAssert { File filename) throws IOException { // store the zip content in memory // let s assume it is not Go ;-) - TreeMap<String, ByteArrayOutputStream> zipContent = new TreeMap<String, ByteArrayOutputStream>(); + TreeMap<String, ByteArrayOutputStream> zipContent = new TreeMap<>(); byte data[] = new byte[BUFFER_SIZE]; /* Open file to decompress */ diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestAgileEncryptionParameters.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestAgileEncryptionParameters.java index 0786ed51d2..28abec4a2e 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestAgileEncryptionParameters.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestAgileEncryptionParameters.java @@ -58,7 +58,7 @@ public class TestAgileEncryptionParameters { HashAlgorithm haList[] = { HashAlgorithm.sha1, HashAlgorithm.sha256, HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.md5 }; ChainingMode cmList[] = { ChainingMode.cbc, ChainingMode.cfb }; - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); for (CipherAlgorithm ca : caList) { for (HashAlgorithm ha : haList) { for (ChainingMode cm : cmList) { diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java index f93e47b7e2..6c0d903c86 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java @@ -248,7 +248,7 @@ public class TestSignatureInfo { sic.setOpcPackage(pkg); SignatureInfo si = new SignatureInfo(); si.setSignatureConfig(sic); - List<X509Certificate> result = new ArrayList<X509Certificate>(); + List<X509Certificate> result = new ArrayList<>(); for (SignaturePart sp : si.getSignatureParts()) { if (sp.validate()) { result.add(sp.getSigner()); @@ -283,7 +283,7 @@ public class TestSignatureInfo { sic.setOpcPackage(pkg); SignatureInfo si = new SignatureInfo(); si.setSignatureConfig(sic); - List<X509Certificate> result = new ArrayList<X509Certificate>(); + List<X509Certificate> result = new ArrayList<>(); for (SignaturePart sp : si.getSignatureParts()) { if (sp.validate()) { result.add(sp.getSigner()); @@ -313,7 +313,7 @@ public class TestSignatureInfo { sic.setOpcPackage(pkg); SignatureInfo si = new SignatureInfo(); si.setSignatureConfig(sic); - List<X509Certificate> result = new ArrayList<X509Certificate>(); + List<X509Certificate> result = new ArrayList<>(); for (SignaturePart sp : si.getSignatureParts()) { if (sp.validate()) { result.add(sp.getSigner()); @@ -384,7 +384,7 @@ public class TestSignatureInfo { si.setSignatureConfig(sic); // hash > sha1 doesn't work in excel viewer ... si.confirmSignature(); - List<X509Certificate> result = new ArrayList<X509Certificate>(); + List<X509Certificate> result = new ArrayList<>(); for (SignaturePart sp : si.getSignatureParts()) { if (sp.validate()) { result.add(sp.getSigner()); @@ -411,7 +411,7 @@ public class TestSignatureInfo { * We need at least 2 certificates for the XAdES-C complete certificate * refs construction. */ - List<X509Certificate> certificateChain = new ArrayList<X509Certificate>(); + List<X509Certificate> certificateChain = new ArrayList<>(); certificateChain.add(x509); certificateChain.add(x509); signatureConfig.setSigningCertificateChain(certificateChain); @@ -600,7 +600,7 @@ public class TestSignatureInfo { Key key = keystore.getKey("poitest", password.toCharArray()); Certificate chainList[] = keystore.getCertificateChain("poitest"); - List<X509Certificate> certChain = new ArrayList<X509Certificate>(); + List<X509Certificate> certChain = new ArrayList<>(); for (Certificate c : chainList) { certChain.add((X509Certificate)c); } @@ -752,7 +752,7 @@ public class TestSignatureInfo { // verify: signature si.getSignatureConfig().setOpcPackage(pkgCopy); - List<X509Certificate> result = new ArrayList<X509Certificate>(); + List<X509Certificate> result = new ArrayList<>(); for (SignaturePart sp : si.getSignatureParts()) { if (sp.validate()) { result.add(sp.getSigner()); diff --git a/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java b/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java index 55630d8663..d6e83130ff 100644 --- a/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java +++ b/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java @@ -123,7 +123,7 @@ public class TestFonts { BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = img.createGraphics(); - Map<String,String> fallbackMap = new HashMap<String,String>(); + Map<String,String> fallbackMap = new HashMap<>(); fallbackMap.put("NoSuchFont", "Mona"); // in XSLF the fonts default to the theme fonts (Calibri), if the font group is not overridden // see XSLFTextRun.XSLFTextInfo.getCTTextFont diff --git a/src/ooxml/testcases/org/apache/poi/ss/extractor/TestEmbeddedExtractor.java b/src/ooxml/testcases/org/apache/poi/ss/extractor/TestEmbeddedExtractor.java index 669fd33813..377e770e2e 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/extractor/TestEmbeddedExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/ss/extractor/TestEmbeddedExtractor.java @@ -49,7 +49,7 @@ public class TestEmbeddedExtractor { fis.close(); EmbeddedExtractor ee = new EmbeddedExtractor(); - List<EmbeddedData> edList = new ArrayList<EmbeddedData>(); + List<EmbeddedData> edList = new ArrayList<>(); for (Sheet s : wb) { edList.addAll(ee.extractAll(s)); } @@ -77,7 +77,7 @@ public class TestEmbeddedExtractor { fis.close(); EmbeddedExtractor ee = new EmbeddedExtractor(); - List<EmbeddedData> edList = new ArrayList<EmbeddedData>(); + List<EmbeddedData> edList = new ArrayList<>(); for (Sheet s : wb) { edList.addAll(ee.extractAll(s)); } diff --git a/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java b/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java index 447684ca90..47d71ff613 100644 --- a/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java +++ b/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java @@ -41,117 +41,117 @@ public class CombinedIteratorTest { @Test public void testNullMaster() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(2L, "B2"); base.put(3L, "B3"); - testIteration(new CombinedIterable<String>(base, null), "B1", "B2", + testIteration(new CombinedIterable<>(base, null), "B1", "B2", "B3"); } @Test public void testNoMatchesBaseFirst() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(2L, "B2"); base.put(3L, "B3"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(4L, "M4"); master.put(5L, "M5"); master.put(6L, "M6"); - testIteration(new CombinedIterable<String>(base, master), "B1", "B2", + testIteration(new CombinedIterable<>(base, master), "B1", "B2", "B3", "M4", "M5", "M6"); } @Test public void testNoMatchesMasterFirst() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(4L, "B4"); base.put(5L, "B5"); base.put(6L, "B6"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(1L, "M1"); master.put(2L, "M2"); master.put(3L, "M3"); - testIteration(new CombinedIterable<String>(base, master), "M1", "M2", + testIteration(new CombinedIterable<>(base, master), "M1", "M2", "M3", "B4", "B5", "B6"); } @Test public void testInterleaved1() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(3L, "B3"); base.put(5L, "B5"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(2L, "M2"); master.put(4L, "M4"); master.put(6L, "M6"); - testIteration(new CombinedIterable<String>(base, master), "B1", "M2", + testIteration(new CombinedIterable<>(base, master), "B1", "M2", "B3", "M4", "B5", "M6"); } @Test public void testInterleaved2() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(2L, "B2"); base.put(5L, "B5"); base.put(6L, "B6"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(3L, "M3"); master.put(4L, "M4"); master.put(7L, "M7"); master.put(8L, "M8"); - testIteration(new CombinedIterable<String>(base, master), "B1", "B2", + testIteration(new CombinedIterable<>(base, master), "B1", "B2", "M3", "M4", "B5", "B6", "M7", "M8"); } @Test public void testAllMatching() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(2L, "B2"); base.put(3L, "B3"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(1L, "M1"); master.put(2L, "M2"); master.put(3L, "M3"); - testIteration(new CombinedIterable<String>(base, master), "B1", "B2", + testIteration(new CombinedIterable<>(base, master), "B1", "B2", "B3"); } @Test public void testAllMatching2() { - SortedMap<Long, String> base = new TreeMap<Long, String>(); + SortedMap<Long, String> base = new TreeMap<>(); base.put(1L, "B1"); base.put(2L, "B2"); base.put(3L, "B3"); - SortedMap<Long, String> master = new TreeMap<Long, String>(); + SortedMap<Long, String> master = new TreeMap<>(); master.put(1L, "M1"); master.put(2L, "M2"); master.put(3L, "M3"); master.put(4L, "M4"); - testIteration(new CombinedIterable<String>(base, master), "B1", "B2", + testIteration(new CombinedIterable<>(base, master), "B1", "B2", "B3", "M4"); } } diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java index b77550f786..94205da144 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java @@ -66,7 +66,7 @@ public class TestPPTX2PNG { @Parameters(name="{0}") public static Collection<String> data() { - final Set<String> data = new TreeSet<String>(); + final Set<String> data = new TreeSet<>(); for (String f : files.split(", ?")) { if (basedir == null) { data.add(f); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java index 39f29fb31e..e5f531dd38 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java @@ -98,7 +98,7 @@ public class TestXSLFChart { strData.setPtArray(null); // unset old axis text numData.setPtArray(null); // unset old values - Map<String, Double> pieModel = new LinkedHashMap<String, Double>(); + Map<String, Double> pieModel = new LinkedHashMap<>(); pieModel.put("First", 1.0); pieModel.put("Second", 3.0); pieModel.put("Third", 4.0); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java index 3ca01733ef..cf54e155db 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java @@ -114,7 +114,7 @@ public class TestXSLFPictureShape { XMLSlideShow ppt2 = XSLFTestDataSamples.writeOutAndReadBack(ppt1); ppt1.close(); // pictures keyed by file name - Map<String, XSLFPictureData> pics = new HashMap<String, XSLFPictureData>(); + Map<String, XSLFPictureData> pics = new HashMap<>(); for(XSLFPictureData p : ppt2.getPictureData()){ pics.put(p.getFileName(), p); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java b/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java index ab84979d09..90de9c5977 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java @@ -45,7 +45,7 @@ public final class SXSSFITestDataProvider implements ITestDataProvider { // an instance of all SXSSFWorkbooks opened by this TestDataProvider, // so that the temporary files created can be disposed up by cleanup() - private final Collection<SXSSFWorkbook> instances = new ArrayList<SXSSFWorkbook>(); + private final Collection<SXSSFWorkbook> instances = new ArrayList<>(); private SXSSFITestDataProvider() { // enforce singleton diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java index 4c12af4708..7052459194 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java @@ -127,7 +127,7 @@ public class TestXSSFBReader { private List<String> getSheets(String testFileName) throws Exception { OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream(testFileName)); - List<String> sheetTexts = new ArrayList<String>(); + List<String> sheetTexts = new ArrayList<>(); XSSFBReader r = new XSSFBReader(pkg); // assertNotNull(r.getWorkbookData()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java index 0221bcca5b..c70a24cebc 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java @@ -287,7 +287,7 @@ public final class TestXSSFReader extends TestCase { OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("61034.xlsx"); XSSFReader reader = new XSSFReader(pkg); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData(); - Set<String> seen = new HashSet<String>(); + Set<String> seen = new HashSet<>(); while (iter.hasNext()) { InputStream stream = iter.next(); String sheetName = iter.getSheetName(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java index f4450c0109..c244d287a6 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java @@ -133,7 +133,7 @@ public class TestXSSFExcelExtractor extends TestCase { ExcelExtractor ole2Extractor = new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls")); - Map<String, POITextExtractor> extractors = new HashMap<String, POITextExtractor>(); + Map<String, POITextExtractor> extractors = new HashMap<>(); extractors.put("SampleSS.xlsx", ooxmlExtractor); extractors.put("SampleSS.xls", ole2Extractor); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java index ef87a9fd06..d1cdfaba08 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java @@ -172,7 +172,7 @@ public final class TestSharedStringsTable extends TestCase { } private List<String> readStrings(String filename) throws IOException { - List<String> strs = new ArrayList<String>(); + List<String> strs = new ArrayList<>(); POIDataSamples samples = POIDataSamples.getSpreadSheetInstance(); BufferedReader br = new BufferedReader( new InputStreamReader(samples.openResourceAsStream(filename), "UTF-8")); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java index c93d8de241..5b48b34584 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java @@ -73,7 +73,7 @@ public class TestThemesTable { simple = XSSFTestDataSamples.openSampleWorkbook(testFileSimple); complex = XSSFTestDataSamples.openSampleWorkbook(testFileComplex); // Files and descriptions - Map<String,XSSFWorkbook> workbooks = new LinkedHashMap<String, XSSFWorkbook>(); + Map<String,XSSFWorkbook> workbooks = new LinkedHashMap<>(); workbooks.put(testFileSimple, simple); workbooks.put("Re-Saved_" + testFileSimple, simpleRS); workbooks.put(testFileComplex, complex); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource.java index cb90efb321..68398310f0 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource.java @@ -28,10 +28,10 @@ import org.apache.poi.poifs.crypt.temp.SheetDataWriterWithDecorator; // afterwards, a test function can check whether these files were encrypted or not public class TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource extends SXSSFWorkbookWithCustomZipEntrySource { - private final List<File> tempFiles = new ArrayList<File>(); + private final List<File> tempFiles = new ArrayList<>(); List<File> getTempFiles() { - return new ArrayList<File>(tempFiles); + return new ArrayList<>(tempFiles); } @Override diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java index a6a2dde5e6..a0d9122309 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java @@ -55,7 +55,7 @@ public class TestAutoSizeColumnTracker { private AutoSizeColumnTracker tracker; private static final SortedSet<Integer> columns; static { - SortedSet<Integer>_columns = new TreeSet<Integer>(); + SortedSet<Integer>_columns = new TreeSet<>(); _columns.add(0); _columns.add(1); _columns.add(3); @@ -85,7 +85,7 @@ public class TestAutoSizeColumnTracker { public void trackAndUntrackColumn() { assumeTrue(tracker.getTrackedColumns().isEmpty()); tracker.trackColumn(0); - Set<Integer> expected = new HashSet<Integer>(); + Set<Integer> expected = new HashSet<>(); expected.add(0); assertEquals(expected, tracker.getTrackedColumns()); tracker.untrackColumn(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java index 15acbfca0b..8a82e8d4c3 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java @@ -68,7 +68,7 @@ public class TestSXSSFSheetAutoSizeColumn { private static final SortedSet<Integer> columns; static { - SortedSet<Integer>_columns = new TreeSet<Integer>(); + SortedSet<Integer>_columns = new TreeSet<>(); _columns.add(0); _columns.add(1); _columns.add(3); @@ -224,7 +224,7 @@ public class TestSXSSFSheetAutoSizeColumn { sheet = workbook.createSheet(); sheet.trackColumnForAutoSizing(0); - SortedSet<Integer> expected = new TreeSet<Integer>(); + SortedSet<Integer> expected = new TreeSet<>(); expected.add(0); assertEquals(expected, sheet.getTrackedColumnsForAutoSizing()); @@ -244,7 +244,7 @@ public class TestSXSSFSheetAutoSizeColumn { sheet = workbook.createSheet(); sheet.trackColumnsForAutoSizing(columns); - SortedSet<Integer> sorted = new TreeSet<Integer>(columns); + SortedSet<Integer> sorted = new TreeSet<>(columns); assertEquals(sorted, sheet.getTrackedColumnsForAutoSizing()); sheet.autoSizeColumn(sorted.first(), useMergedCells); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java index ad8b49028d..c6f3e3cf53 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java @@ -132,7 +132,7 @@ public final class TestFormulaEvaluatorOnXSSF { sheet = workbook.getSheetAt( 0 ); evaluator = new XSSFFormulaEvaluator(workbook); - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); processFunctionGroup(data, SS.START_OPERATORS_ROW_INDEX, null); processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java index b8926a3cf5..bdd85130c8 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java @@ -117,7 +117,7 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF { sheet = workbook.getSheet( SS.TEST_SHEET_NAME ); evaluator = new XSSFFormulaEvaluator(workbook); - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 01e3b92807..2fef668932 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -2463,7 +2463,6 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * .xlsx supports 64000 cell styles, the style indexes after * 32,767 must not be -32,768, then -32,767, -32,766 */ - @SuppressWarnings("resource") @Test public void bug57880() throws IOException { int numStyles = 33000; @@ -2475,7 +2474,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } assertEquals(numStyles, wb.getNumCellStyles()); - // avoid OOM in gump run + // avoid OOM in Gump run File file = XSSFTestDataSamples.writeOutAndClose(wb, "bug57880"); //noinspection UnusedAssignment wb = null; @@ -2513,7 +2512,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertNotNull(sheet); Map<String, Object[]> data; - data = new TreeMap<String, Object[]>(); + data = new TreeMap<>(); data.put("1", new Object[]{"ID", "NAME", "LASTNAME"}); data.put("2", new Object[]{2, "Amit", "Shukla"}); data.put("3", new Object[]{1, "Lokesh", "Gupta"}); @@ -2773,7 +2772,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { public void test51998() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51998.xlsx"); - Set<String> sheetNames = new HashSet<String>(); + Set<String> sheetNames = new HashSet<>(); for (int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) { sheetNames.add(wb.getSheetName(sheetNum)); @@ -2983,7 +2982,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { // Everything is fine at this point, cell is red - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); properties.put(CellUtil.BORDER_BOTTOM, BorderStyle.THIN); CellUtil.setCellStyleProperties(cell, properties); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java index 5afad20672..e92143ca8b 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java @@ -159,7 +159,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { } // Setup the environment - Map<String,FormulaEvaluator> evaluators = new HashMap<String, FormulaEvaluator>(); + Map<String,FormulaEvaluator> evaluators = new HashMap<>(); evaluators.put("ref2-56737.xlsx", evaluator); evaluators.put("56737.xlsx", _testDataProvider.openSampleWorkbook("56737.xlsx").getCreationHelper().createFormulaEvaluator()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java index d1c975d637..4eff222a24 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java @@ -296,9 +296,9 @@ public final class TestXSSFSheet extends BaseTestXSheet { sheet.addMergedRegion(region_3); sheet.addMergedRegion(region_4); // test invalid indexes OOBE - Set<Integer> rmIdx = new HashSet<Integer>(Arrays.asList(5,6)); + Set<Integer> rmIdx = new HashSet<>(Arrays.asList(5, 6)); sheet.removeMergedRegions(rmIdx); - rmIdx = new HashSet<Integer>(Arrays.asList(1,3)); + rmIdx = new HashSet<>(Arrays.asList(1, 3)); sheet.removeMergedRegions(rmIdx); assertEquals("A1:B2", ctWorksheet.getMergeCells().getMergeCellArray(0).getRef()); assertEquals("E5:F6", ctWorksheet.getMergeCells().getMergeCellArray(1).getRef()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java index 06ef68a549..6ff8b8b007 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java @@ -50,7 +50,7 @@ public final class TestXSSFTable { // read the original sheet header order XSSFRow row = wb1.getSheetAt(0).getRow(0); - List<String> headers = new ArrayList<String>(); + List<String> headers = new ArrayList<>(); for (Cell cell : row) { headers.add(cell.getStringCellValue()); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java b/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java index 812a92125e..f13337fa94 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java @@ -151,7 +151,7 @@ public class MemoryUsage extends TestCase { * @see #testXmlAttached() */ public void testXmlDetached(){ - List<CTRow> rows = new ArrayList<CTRow>(); + List<CTRow> rows = new ArrayList<>(); int i = 0; try { for(;;){ @@ -177,7 +177,7 @@ public class MemoryUsage extends TestCase { */ public void testXmlAttached(){ printMemoryUsage("before"); - List<CTRow> rows = new ArrayList<CTRow>(); + List<CTRow> rows = new ArrayList<>(); int i = 0; //top-level element in sheet.xml CTWorksheet sh = CTWorksheet.Factory.newInstance(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java index 2af6cbbc2d..f1ecf560e1 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java @@ -121,7 +121,7 @@ public final class TestXWPFSDT { public void testNewLinesBetweenRuns() throws Exception { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug55142.docx"); List<AbstractXWPFSDT> sdts = extractAllSDTs(doc); - List<String> targs = new ArrayList<String>(); + List<String> targs = new ArrayList<>(); //these test newlines and tabs in paragraphs/body elements targs.add("Rich-text1 abcdefghi"); targs.add("Rich-text2 abcd\t\tefgh"); @@ -152,7 +152,7 @@ public final class TestXWPFSDT { private List<AbstractXWPFSDT> extractAllSDTs(XWPFDocument doc) { - List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>(); + List<AbstractXWPFSDT> sdts = new ArrayList<>(); List<XWPFHeader> headers = doc.getHeaderList(); for (XWPFHeader header : headers) { @@ -175,7 +175,7 @@ public final class TestXWPFSDT { } private List<AbstractXWPFSDT> extractSDTsFromBodyElements(List<IBodyElement> elements) { - List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>(); + List<AbstractXWPFSDT> sdts = new ArrayList<>(); for (IBodyElement e : elements) { if (e instanceof XWPFSDT) { XWPFSDT sdt = (XWPFSDT) e; @@ -199,7 +199,7 @@ public final class TestXWPFSDT { private List<AbstractXWPFSDT> extractSDTsFromTable(XWPFTable table) { - List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>(); + List<AbstractXWPFSDT> sdts = new ArrayList<>(); for (XWPFTableRow r : table.getRows()) { for (ICell c : r.getTableICells()) { if (c instanceof XWPFSDTCell) { diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java index 6210d11781..12dd5db2d4 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java @@ -40,7 +40,7 @@ public final class TestXWPFStyles { @Test public void testGetUsedStyles() throws IOException { XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("Styles.docx"); - List<XWPFStyle> testUsedStyleList = new ArrayList<XWPFStyle>(); + List<XWPFStyle> testUsedStyleList = new ArrayList<>(); XWPFStyles styles = sampleDoc.getStyles(); XWPFStyle style = styles.getStyle("berschrift1"); testUsedStyleList.add(style); diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java index ce92ac8dc9..bb3ef91b38 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java @@ -115,7 +115,7 @@ public final class Chunk { // Loop over the definitions, building the commands // and getting their values - ArrayList<Command> commandList = new ArrayList<Command>(); + ArrayList<Command> commandList = new ArrayList<>(); for(CommandDefinition cdef : commandDefinitions) { int type = cdef.getType(); int offset = cdef.getOffset(); diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java index 642cdf488e..762c2a12a9 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java @@ -43,8 +43,8 @@ public final class ChunkFactory { /** * Key is a Chunk's type, value is an array of its CommandDefinitions */ - private final Map<Integer, CommandDefinition[]> chunkCommandDefinitions = - new HashMap<Integer, CommandDefinition[]>(); + private final Map<Integer, CommandDefinition[]> chunkCommandDefinitions = + new HashMap<>(); /** * What the name is of the chunk table definitions file? * This file comes from the scratchpad resources directory. @@ -87,7 +87,7 @@ public final class ChunkFactory { throw new IllegalStateException("Expecting start xxx, found " + line); } int chunkType = Integer.parseInt(line.substring(6)); - ArrayList<CommandDefinition> defsL = new ArrayList<CommandDefinition>(); + ArrayList<CommandDefinition> defsL = new ArrayList<>(); // Data entries while( (line = inp.readLine()) != null ) { diff --git a/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java b/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java index fae6e3f5c2..90dc298b45 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java @@ -65,7 +65,7 @@ public final class VisioTextExtractor extends POIOLE2TextExtractor { * @return An array of each Text item in the document */ public String[] getAllText() { - ArrayList<String> text = new ArrayList<String>(); + ArrayList<String> text = new ArrayList<>(); for(Stream stream : hdgf.getTopLevelStreams()) { findText(stream, text); } diff --git a/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java b/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java index f58a4c8510..4c0c890f93 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java @@ -47,7 +47,7 @@ public final class ChunkStream extends Stream { * Process the contents of the stream out into chunks */ public void findChunks() { - ArrayList<Chunk> chunksA = new ArrayList<Chunk>(); + ArrayList<Chunk> chunksA = new ArrayList<>(); if(getPointer().getOffset() == 0x64b3) { int i = 0; diff --git a/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFPlus.java b/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFPlus.java index 1129839649..873d42e1ee 100644 --- a/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFPlus.java +++ b/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFPlus.java @@ -53,7 +53,7 @@ public class HemfCommentEMFPlus extends AbstractHemfComment { private static class HemfPlusParser { public static List<HemfPlusRecord> parse(byte[] bytes) { - List<HemfPlusRecord> records = new ArrayList<HemfPlusRecord>(); + List<HemfPlusRecord> records = new ArrayList<>(); int offset = 0; while (offset < bytes.length) { if (offset + 12 > bytes.length) { diff --git a/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentPublic.java b/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentPublic.java index 7674443839..d527ed1c1b 100644 --- a/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentPublic.java +++ b/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentPublic.java @@ -77,12 +77,12 @@ public class HemfCommentPublic { int currentOffset = 4 + 16;//4 public comment identifier, 16 for outputrect long countFormats = LittleEndian.getUInt(rawBytes, currentOffset); currentOffset += LittleEndianConsts.INT_SIZE; - List<EmrFormat> emrFormatList = new ArrayList<EmrFormat>(); + List<EmrFormat> emrFormatList = new ArrayList<>(); for (long i = 0; i < countFormats; i++) { emrFormatList.add(new EmrFormat(rawBytes, currentOffset)); currentOffset += 4 * LittleEndianConsts.INT_SIZE; } - List<HemfMultiFormatsData> list = new ArrayList<HemfMultiFormatsData>(); + List<HemfMultiFormatsData> list = new ArrayList<>(); for (EmrFormat emrFormat : emrFormatList) { byte[] data = IOUtils.safelyAllocate(emrFormat.size, MAX_RECORD_LENGTH); System.arraycopy(rawBytes, emrFormat.offset-4, data, 0, emrFormat.size); diff --git a/src/scratchpad/src/org/apache/poi/hmef/Attachment.java b/src/scratchpad/src/org/apache/poi/hmef/Attachment.java index 59c90a4dc0..1e164dbaae 100644 --- a/src/scratchpad/src/org/apache/poi/hmef/Attachment.java +++ b/src/scratchpad/src/org/apache/poi/hmef/Attachment.java @@ -37,8 +37,8 @@ import org.apache.poi.hsmf.datatypes.MAPIProperty; * and list methods to get all of them. */ public final class Attachment { - private final List<TNEFAttribute> attributes = new ArrayList<TNEFAttribute>(); - private final List<MAPIAttribute> mapiAttributes = new ArrayList<MAPIAttribute>(); + private final List<TNEFAttribute> attributes = new ArrayList<>(); + private final List<MAPIAttribute> mapiAttributes = new ArrayList<>(); protected void addAttribute(TNEFAttribute attr) { attributes.add(attr); diff --git a/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java b/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java index 5dd7a827f5..6997cbf87b 100644 --- a/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java +++ b/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java @@ -44,9 +44,9 @@ public final class HMEFMessage { @SuppressWarnings("unused") private int fileId; - private final List<TNEFAttribute> messageAttributes = new ArrayList<TNEFAttribute>(); - private final List<MAPIAttribute> mapiAttributes = new ArrayList<MAPIAttribute>(); - private final List<Attachment> attachments = new ArrayList<Attachment>(); + private final List<TNEFAttribute> messageAttributes = new ArrayList<>(); + private final List<MAPIAttribute> mapiAttributes = new ArrayList<>(); + private final List<Attachment> attachments = new ArrayList<>(); public HMEFMessage(InputStream inp) throws IOException { try { diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java index 90e4ffed5a..bb077b8f5b 100644 --- a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java +++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java @@ -100,7 +100,7 @@ public class MAPIAttribute { // First up, get the number of attributes int count = LittleEndian.readInt(inp); - List<MAPIAttribute> attrs = new ArrayList<MAPIAttribute>(); + List<MAPIAttribute> attrs = new ArrayList<>(); // Now, read each one in in turn for(int i=0; i<count; i++) { diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFProperty.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFProperty.java index de4d8a5fcb..9fafcf0dce 100644 --- a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFProperty.java +++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFProperty.java @@ -30,7 +30,7 @@ import java.util.Map; * ones, so we can't just re-use the HSMF ones. */ public final class TNEFProperty { - private static Map<Integer, List<TNEFProperty>> properties = new HashMap<Integer, List<TNEFProperty>>(); + private static Map<Integer, List<TNEFProperty>> properties = new HashMap<>(); // Types taken from http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefattributetype%28v=EXCHG.140%29.aspx public static final int TYPE_TRIPLES = 0x0000; @@ -175,7 +175,7 @@ public final class TNEFProperty { // Store it for lookup if(! properties.containsKey(id)) { - properties.put(id, new ArrayList<TNEFProperty>()); + properties.put(id, new ArrayList<>()); } properties.get(id).add(this); } diff --git a/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java b/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java index 47931b8a5b..94b7536d88 100644 --- a/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java +++ b/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java @@ -41,7 +41,7 @@ public abstract class EscherPart extends HPBFPart { DefaultEscherRecordFactory erf = new DefaultEscherRecordFactory(); - ArrayList<EscherRecord> ec = new ArrayList<EscherRecord>(); + ArrayList<EscherRecord> ec = new ArrayList<>(); byte data[] = getData(); int left = data.length; while(left > 0) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java index 247cd8a881..cf5d74b180 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java @@ -195,7 +195,7 @@ public final class PowerPointExtractor extends POIOLE2TextExtractor { } public List<OLEShape> getOLEShapes() { - List<OLEShape> list = new ArrayList<OLEShape>(); + List<OLEShape> list = new ArrayList<>(); for (HSLFSlide slide : _slides) { for (HSLFShape shape : slide.getShapes()) { @@ -298,7 +298,7 @@ public final class PowerPointExtractor extends POIOLE2TextExtractor { // Not currently using _notes, as that can have the notes of // master sheets in. Grab Slide list, then work from there, // but ensure no duplicates - Set<Integer> seenNotes = new HashSet<Integer>(); + Set<Integer> seenNotes = new HashSet<>(); String headerText = ""; String footerText = ""; HeadersFooters hf = _show.getNotesHeadersFooters(); diff --git a/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java b/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java index eda364b66f..5b3ca0ac12 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java @@ -137,7 +137,7 @@ public final class QuickButCruddyTextExtractor { * strings, one per text record */ public List<String> getTextAsVector() { - List<String> textV = new ArrayList<String>(); + List<String> textV = new ArrayList<>(); // Set to the start of the file int walkPos = 0; diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TabStopPropCollection.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TabStopPropCollection.java index 55267eacf0..1934cf8983 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TabStopPropCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TabStopPropCollection.java @@ -79,7 +79,7 @@ public class TabStopPropCollection extends TextProp { } } - private List<TabStop> tabStops = new ArrayList<TabStop>(); + private List<TabStop> tabStops = new ArrayList<>(); public TabStopPropCollection() { super(0, 0x100000, "tabStops"); @@ -113,7 +113,7 @@ public class TabStopPropCollection extends TextProp { @Override public TabStopPropCollection clone() { TabStopPropCollection other = (TabStopPropCollection)super.clone(); - other.tabStops = new ArrayList<TabStop>(); + other.tabStops = new ArrayList<>(); for (TabStop ts : tabStops) { TabStop tso = new TabStop(ts.getPosition(), ts.getType()); other.tabStops.add(tso); diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java index 45ef1b7f90..93a036fd07 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java @@ -94,7 +94,7 @@ public class TextPropCollection { // indentLevel is only valid for paragraph collection // if it's set to -1, it must be omitted - see 2.9.36 TextMasterStyleLevel private short indentLevel; - private final Map<String,TextProp> textProps = new HashMap<String,TextProp>(); + private final Map<String,TextProp> textProps = new HashMap<>(); private int maskSpecial; private final TextPropType textPropType; @@ -119,7 +119,7 @@ public class TextPropCollection { /** Fetch the TextProps that define this styling in the record order */ public List<TextProp> getTextPropList() { - List<TextProp> orderedList = new ArrayList<TextProp>(); + List<TextProp> orderedList = new ArrayList<>(); for (TextProp potProp : getPotentialProperties()) { TextProp textProp = textProps.get(potProp.getName()); if (textProp != null) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Document.java b/src/scratchpad/src/org/apache/poi/hslf/record/Document.java index 0c74ae2b40..5e4019b001 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Document.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Document.java @@ -206,7 +206,7 @@ public final class Document extends PositionDependentRecordContainer } public void removeSlideListWithText(SlideListWithText slwt) { - ArrayList<SlideListWithText> lst = new ArrayList<SlideListWithText>(); + ArrayList<SlideListWithText> lst = new ArrayList<>(); for(SlideListWithText s : slwts) { if(s != slwt) lst.add(s); else { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java index 6c40ecf180..11e48fa1f1 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java @@ -43,7 +43,7 @@ public class ExObjList extends RecordContainer { * Returns all the ExHyperlinks */ public ExHyperlink[] getExHyperlinks() { - ArrayList<ExHyperlink> links = new ArrayList<ExHyperlink>(); + ArrayList<ExHyperlink> links = new ArrayList<>(); for(int i=0; i<_children.length; i++) { if(_children[i] instanceof ExHyperlink) { links.add( (ExHyperlink)_children[i] ); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java b/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java index 6f138fa083..fef1e797d4 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java @@ -33,7 +33,7 @@ import org.apache.poi.util.POILogger; */ public final class FontCollection extends RecordContainer { - private final Map<String,HSLFFontInfo> fonts = new LinkedHashMap<String,HSLFFontInfo>(); + private final Map<String,HSLFFontInfo> fonts = new LinkedHashMap<>(); private byte[] _header; protected FontCollection(byte[] source, int start, int len) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java b/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java index e2975de789..2f82245258 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java @@ -38,7 +38,7 @@ import org.apache.poi.util.LittleEndian; */ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { - private final List<Record> _childRecords = new ArrayList<Record>(); + private final List<Record> _childRecords = new ArrayList<>(); public List<? extends Record> getHSLFChildRecords() { return _childRecords; diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/MainMaster.java b/src/scratchpad/src/org/apache/poi/hslf/record/MainMaster.java index eb1dade780..4dd0f3f033 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/MainMaster.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/MainMaster.java @@ -63,8 +63,8 @@ public final class MainMaster extends SheetContainer { // Find our children _children = Record.findChildRecords(source,start+8,len-8); - ArrayList<TxMasterStyleAtom> tx = new ArrayList<TxMasterStyleAtom>(); - ArrayList<ColorSchemeAtom> clr = new ArrayList<ColorSchemeAtom>(); + ArrayList<TxMasterStyleAtom> tx = new ArrayList<>(); + ArrayList<ColorSchemeAtom> clr = new ArrayList<>(); // Find the interesting ones in there for(int i=0; i<_children.length; i++) { if(_children[i] instanceof SlideAtom) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/MasterTextPropAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/MasterTextPropAtom.java index d38b390af0..7aef5fcdcc 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/MasterTextPropAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/MasterTextPropAtom.java @@ -54,7 +54,7 @@ public final class MasterTextPropAtom extends RecordAtom { LittleEndian.putShort(_header, 2, (short)getRecordType()); LittleEndian.putInt(_header, 4, _data.length); - indents = new ArrayList<IndentProp>(); + indents = new ArrayList<>(); } /** @@ -121,7 +121,7 @@ public final class MasterTextPropAtom extends RecordAtom { */ private void read() { int pos = 0; - indents = new ArrayList<IndentProp>(_data.length/6); + indents = new ArrayList<>(_data.length / 6); while (pos <= _data.length - 6) { int count = LittleEndian.getInt(_data, pos); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java index aec1785c62..6587a6e9d3 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java @@ -55,7 +55,7 @@ public final class PPDrawing extends RecordAtom { private byte[] _header; private long _type; - private final List<EscherRecord> childRecords = new ArrayList<EscherRecord>(); + private final List<EscherRecord> childRecords = new ArrayList<>(); private EscherTextboxWrapper[] textboxWrappers; //cached EscherDgRecord @@ -112,13 +112,13 @@ public final class PPDrawing extends RecordAtom { textboxWrappers = findInDgContainer(dgContainer); } else { // Find and EscherTextboxRecord's, and wrap them up - final List<EscherTextboxWrapper> textboxes = new ArrayList<EscherTextboxWrapper>(); + final List<EscherTextboxWrapper> textboxes = new ArrayList<>(); findEscherTextboxRecord(childRecords, textboxes); this.textboxWrappers = textboxes.toArray(new EscherTextboxWrapper[textboxes.size()]); } } private EscherTextboxWrapper[] findInDgContainer(final EscherContainerRecord dgContainer) { - final List<EscherTextboxWrapper> found = new LinkedList<EscherTextboxWrapper>(); + final List<EscherTextboxWrapper> found = new LinkedList<>(); final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer); final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer); for (EscherContainerRecord spContainer : spContainers) { @@ -397,7 +397,7 @@ public final class PPDrawing extends RecordAtom { protected EscherContainerRecord[] findAllEscherContainerRecordOfType(RecordTypes type, EscherContainerRecord parent) { if (null == parent) { return new EscherContainerRecord[0]; } final List<EscherContainerRecord> children = parent.getChildContainers(); - final List<EscherContainerRecord> result = new LinkedList<EscherContainerRecord>(); + final List<EscherContainerRecord> result = new LinkedList<>(); for (EscherContainerRecord child : children) { if (type.typeID == child.getRecordId()) { result.add(child); @@ -407,7 +407,7 @@ public final class PPDrawing extends RecordAtom { } public StyleTextProp9Atom[] getNumberedListInfo() { - final List<StyleTextProp9Atom> result = new LinkedList<StyleTextProp9Atom>(); + final List<StyleTextProp9Atom> result = new LinkedList<>(); EscherContainerRecord dgContainer = getDgContainer(); final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer); final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java b/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java index 8a1c482696..9f018d3c90 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java @@ -108,7 +108,7 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom // base number for these entries // count * 32 bit offsets // Repeat as many times as you have data - _slideLocations = new HashMap<Integer,Integer>(); + _slideLocations = new HashMap<>(); _ptrData = new byte[len-8]; System.arraycopy(source,start+8,_ptrData,0,_ptrData.length); @@ -180,7 +180,7 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom } private void normalizePersistDirectory() { - TreeMap<Integer,Integer> orderedSlideLocations = new TreeMap<Integer,Integer>(_slideLocations); + TreeMap<Integer,Integer> orderedSlideLocations = new TreeMap<>(_slideLocations); @SuppressWarnings("resource") BufAccessBAOS bos = new BufAccessBAOS(); // NOSONAR diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Record.java b/src/scratchpad/src/org/apache/poi/hslf/record/Record.java index 73017b798d..038ec27f05 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Record.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Record.java @@ -108,7 +108,7 @@ public abstract class Record * Default method for finding child records of a container record */ public static Record[] findChildRecords(byte[] b, int start, int len) { - List<Record> children = new ArrayList<Record>(5); + List<Record> children = new ArrayList<>(5); // Jump our little way along, creating records as we go int pos = start; diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java index c3fc1f1d27..d4bf8ab337 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java @@ -139,7 +139,7 @@ public abstract class RecordContainer extends Record */ public Record removeChild(Record ch) { Record rm = null; - ArrayList<Record> lst = new ArrayList<Record>(); + ArrayList<Record> lst = new ArrayList<>(); for(Record r : _children) { if(r != ch) { lst.add(r); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java index 44595b7473..3fec22b1a0 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java @@ -210,7 +210,7 @@ public enum RecordTypes { private static final Map<Short,RecordTypes> LOOKUP; static { - LOOKUP = new HashMap<Short,RecordTypes>(); + LOOKUP = new HashMap<>(); for(RecordTypes s : values()) { LOOKUP.put(s.typeID, s); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java b/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java index deeee6fe6b..08ed2e8468 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java @@ -83,7 +83,7 @@ public final class SlideListWithText extends RecordContainer { // Group our children together into SlideAtomsSets // That way, model layer code can just grab the sets to use, // without having to try to match the children together - List<SlideAtomsSet> sets = new ArrayList<SlideAtomsSet>(); + List<SlideAtomsSet> sets = new ArrayList<>(); for(int i=0; i<_children.length; i++) { if(_children[i] instanceof SlidePersistAtom) { // Find where the next SlidePersistAtom is diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java index 9a5cc7b487..ea60240518 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java @@ -48,7 +48,7 @@ public final class StyleTextProp9Atom extends RecordAtom { */ protected StyleTextProp9Atom(byte[] source, int start, int len) { // Get the header. - final List<TextPFException9> schemes = new LinkedList<TextPFException9>(); + final List<TextPFException9> schemes = new LinkedList<>(); header = new byte[8]; System.arraycopy(source,start, header,0,8); this.version = LittleEndian.getShort(header, 0); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java index 3940e92229..d81b7beca1 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java @@ -137,8 +137,8 @@ public final class StyleTextPropAtom extends RecordAtom { reserved = new byte[0]; // Set empty lists, ready for when they call setParentTextSize - paragraphStyles = new ArrayList<TextPropCollection>(); - charStyles = new ArrayList<TextPropCollection>(); + paragraphStyles = new ArrayList<>(); + charStyles = new ArrayList<>(); } @@ -156,8 +156,8 @@ public final class StyleTextPropAtom extends RecordAtom { LittleEndian.putInt(_header,4,10); // Set empty paragraph and character styles - paragraphStyles = new ArrayList<TextPropCollection>(); - charStyles = new ArrayList<TextPropCollection>(); + paragraphStyles = new ArrayList<>(); + charStyles = new ArrayList<>(); addParagraphTextPropCollection(parentTextSize); addCharacterTextPropCollection(parentTextSize); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java index 7f87086bfa..dd7076605e 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java @@ -165,7 +165,7 @@ public final class TextSpecInfoAtom extends RecordAtom { public TextSpecInfoRun[] getTextSpecInfoRuns(){ LittleEndianByteArrayInputStream bis = new LittleEndianByteArrayInputStream(_data); // NOSONAR - List<TextSpecInfoRun> lst = new ArrayList<TextSpecInfoRun>(); + List<TextSpecInfoRun> lst = new ArrayList<>(); while (bis.available() > 0) { lst.add(new TextSpecInfoRun(bis)); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/TxMasterStyleAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/TxMasterStyleAtom.java index b4b8e80046..5c9785f21c 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/TxMasterStyleAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/TxMasterStyleAtom.java @@ -144,8 +144,8 @@ public final class TxMasterStyleAtom extends RecordAtom { short levels = LittleEndian.getShort(_data, 0); pos += LittleEndian.SHORT_SIZE; - paragraphStyles = new ArrayList<TextPropCollection>(levels); - charStyles = new ArrayList<TextPropCollection>(levels); + paragraphStyles = new ArrayList<>(levels); + charStyles = new ArrayList<>(levels); for(short i = 0; i < levels; i++) { TextPropCollection prprops = new TextPropCollection(0, TextPropType.paragraph); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java index b7919160f6..63f30bd45b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java @@ -186,8 +186,8 @@ public final class HSLFFreeformShape extends HSLFAutoShape implements FreeformSh Rectangle2D bounds = path.getBounds2D(); PathIterator it = path.getPathIterator(new AffineTransform()); - List<byte[]> segInfo = new ArrayList<byte[]>(); - List<Point2D.Double> pntInfo = new ArrayList<Point2D.Double>(); + List<byte[]> segInfo = new ArrayList<>(); + List<Point2D.Double> pntInfo = new ArrayList<>(); boolean isClosed = false; int numPoints = 0; while (!it.isDone()) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java index 3d4d57fbdb..7efe2539da 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java @@ -274,7 +274,7 @@ implements HSLFShapeContainer, GroupShape<HSLFShape,HSLFTextParagraph> { public List<HSLFShape> getShapes() { // Our escher container record should contain several // SpContainers, the first of which is the group shape itself - List<HSLFShape> shapeList = new ArrayList<HSLFShape>(); + List<HSLFShape> shapeList = new ArrayList<>(); boolean isFirst = true; for (EscherRecord r : getSpContainer()) { if (isFirst) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java index c7750d6084..73d11905fd 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java @@ -328,7 +328,7 @@ public final class HSLFHyperlink implements Hyperlink<HSLFShape,HSLFTextParagrap */ @SuppressWarnings("resource") protected static List<HSLFHyperlink> find(List<HSLFTextParagraph> paragraphs){ - List<HSLFHyperlink> lst = new ArrayList<HSLFHyperlink>(); + List<HSLFHyperlink> lst = new ArrayList<>(); if (paragraphs == null || paragraphs.isEmpty()) return lst; HSLFTextParagraph firstPara = paragraphs.get(0); @@ -358,7 +358,7 @@ public final class HSLFHyperlink implements Hyperlink<HSLFShape,HSLFTextParagrap HSLFEscherClientDataRecord cldata = shape.getClientData(false); if (exobj != null && cldata != null) { - List<HSLFHyperlink> lst = new ArrayList<HSLFHyperlink>(); + List<HSLFHyperlink> lst = new ArrayList<>(); find(cldata.getHSLFChildRecords(), exobj, lst); return lst.isEmpty() ? null : lst.get(0); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java index d64775e117..d922d7a895 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java @@ -35,7 +35,7 @@ import org.apache.poi.util.POILogger; public final class HSLFNotes extends HSLFSheet implements Notes<HSLFShape,HSLFTextParagraph> { protected static final POILogger logger = POILogFactory.getLogger(HSLFNotes.class); - private List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>(); + private List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>(); /** * Constructs a Notes Sheet from the given Notes record. diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSheet.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSheet.java index ce809b5518..c37d47713f 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSheet.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSheet.java @@ -163,7 +163,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H throw new IllegalStateException("spgr not found"); } - List<HSLFShape> shapeList = new ArrayList<HSLFShape>(); + List<HSLFShape> shapeList = new ArrayList<>(); boolean isFirst = true; for (EscherRecord r : spgr) { if (isFirst) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java index 4d63115720..14867a5a46 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java @@ -59,7 +59,7 @@ import org.apache.poi.sl.usermodel.Slide; public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTextParagraph> { private int _slideNo; private SlideAtomsSet _atomSet; - private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>(); + private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>(); private HSLFNotes _notes; // usermodel needs to set this /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java index 7919dc2c06..f6cd41f41d 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java @@ -36,7 +36,7 @@ import org.apache.poi.util.Internal; * @author Yegor Kozlov */ public final class HSLFSlideMaster extends HSLFMasterSheet { - private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>(); + private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>(); /** * all TxMasterStyleAtoms available in this master diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java index 738b6422ec..a71ebf1249 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java @@ -96,7 +96,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap enum LoadSavePhase { INIT, LOADED } - private static final ThreadLocal<LoadSavePhase> loadSavePhase = new ThreadLocal<LoadSavePhase>(); + private static final ThreadLocal<LoadSavePhase> loadSavePhase = new ThreadLocal<>(); // What we're based on private final HSLFSlideShowImpl _hslfSlideShow; @@ -112,10 +112,10 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap private Document _documentRecord; // Friendly objects for people to deal with - private final List<HSLFSlideMaster> _masters = new ArrayList<HSLFSlideMaster>(); - private final List<HSLFTitleMaster> _titleMasters = new ArrayList<HSLFTitleMaster>(); - private final List<HSLFSlide> _slides = new ArrayList<HSLFSlide>(); - private final List<HSLFNotes> _notes = new ArrayList<HSLFNotes>(); + private final List<HSLFSlideMaster> _masters = new ArrayList<>(); + private final List<HSLFTitleMaster> _titleMasters = new ArrayList<>(); + private final List<HSLFSlide> _slides = new ArrayList<>(); + private final List<HSLFNotes> _notes = new ArrayList<>(); private FontCollection _fonts; // For logging @@ -196,7 +196,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap */ private void findMostRecentCoreRecords() { // To start with, find the most recent in the byte offset domain - Map<Integer,Integer> mostRecentByBytes = new HashMap<Integer,Integer>(); + Map<Integer,Integer> mostRecentByBytes = new HashMap<>(); for (Record record : _hslfSlideShow.getRecords()) { if (record instanceof PersistPtrHolder) { PersistPtrHolder pph = (PersistPtrHolder) record; @@ -224,14 +224,14 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap // We'll also want to be able to turn the slide IDs into a position // in this array - _sheetIdToCoreRecordsLookup = new HashMap<Integer,Integer>(); + _sheetIdToCoreRecordsLookup = new HashMap<>(); Integer[] allIDs = mostRecentByBytes.keySet().toArray(new Integer[mostRecentByBytes.size()]); Arrays.sort(allIDs); for (int i = 0; i < allIDs.length; i++) { _sheetIdToCoreRecordsLookup.put(allIDs[i], i); } - Map<Integer,Integer> mostRecentByBytesRev = new HashMap<Integer,Integer>(mostRecentByBytes.size()); + Map<Integer,Integer> mostRecentByBytesRev = new HashMap<>(mostRecentByBytes.size()); for (Map.Entry<Integer,Integer> me : mostRecentByBytes.entrySet()) { mostRecentByBytesRev.put(me.getValue(), me.getKey()); } @@ -340,7 +340,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap findMasterSlides(); // Having sorted out the masters, that leaves the notes and slides - Map<Integer,Integer> slideIdToNotes = new HashMap<Integer,Integer>(); + Map<Integer,Integer> slideIdToNotes = new HashMap<>(); // Start by finding the notes records findNotesSlides(slideIdToNotes); @@ -626,7 +626,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap _slides.get(newSlideNumber - 1).setSlideNumber(newSlideNumber); _slides.get(oldSlideNumber - 1).setSlideNumber(oldSlideNumber); - ArrayList<Record> lst = new ArrayList<Record>(); + ArrayList<Record> lst = new ArrayList<>(); for (SlideAtomsSet s : sas) { lst.add(s.getSlidePersistAtom()); lst.addAll(Arrays.asList(s.getSlideRecords())); @@ -657,8 +657,8 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap SlideListWithText slwt = _documentRecord.getSlideSlideListWithText(); SlideAtomsSet[] sas = slwt.getSlideAtomsSets(); - List<Record> records = new ArrayList<Record>(); - List<SlideAtomsSet> sa = new ArrayList<SlideAtomsSet>(Arrays.asList(sas)); + List<Record> records = new ArrayList<>(); + List<SlideAtomsSet> sa = new ArrayList<>(Arrays.asList(sas)); HSLFSlide removedSlide = _slides.remove(index); _notes.remove(removedSlide.getNotes()); @@ -685,8 +685,8 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap int notesId = removedSlide.getSlideRecord().getSlideAtom().getNotesID(); if (notesId != 0) { SlideListWithText nslwt = _documentRecord.getNotesSlideListWithText(); - records = new ArrayList<Record>(); - ArrayList<SlideAtomsSet> na = new ArrayList<SlideAtomsSet>(); + records = new ArrayList<>(); + ArrayList<SlideAtomsSet> na = new ArrayList<>(); for (SlideAtomsSet ns : nslwt.getSlideAtomsSets()) { if (ns.getSlidePersistAtom().getSlideIdentifier() == notesId) { continue; @@ -1090,7 +1090,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap } protected static Map<String,ClassID> getOleMap() { - Map<String,ClassID> olemap = new HashMap<String,ClassID>(); + Map<String,ClassID> olemap = new HashMap<>(); olemap.put(POWERPOINT_DOCUMENT, ClassID.PPT_SHOW); olemap.put("Workbook", ClassID.EXCEL97); // as per BIFF8 spec olemap.put("WORKBOOK", ClassID.EXCEL97); // Typically from third party programs @@ -1107,7 +1107,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap // As we go along, update, and hand over, to any Position Dependent // records we happen across Map<RecordTypes,PositionDependentRecord> interestingRecords = - new HashMap<RecordTypes,PositionDependentRecord>(); + new HashMap<>(); try { _hslfSlideShow.updateAndWriteDependantRecords(null,interestingRecords); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java index a2b6c3cdb8..f3495407b3 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java @@ -409,9 +409,9 @@ public class HSLFSlideShowEncrypted implements Closeable { UserEditAtom uea = null; PersistPtrHolder pph = null; - TreeMap<Integer,Integer> slideLocations = new TreeMap<Integer,Integer>(); - TreeMap<Integer,Record> recordMap = new TreeMap<Integer,Record>(); - List<Integer> obsoleteOffsets = new ArrayList<Integer>(); + TreeMap<Integer,Integer> slideLocations = new TreeMap<>(); + TreeMap<Integer,Record> recordMap = new TreeMap<>(); + List<Integer> obsoleteOffsets = new ArrayList<>(); int duplicatedCount = 0; for (Record r : records) { assert(r instanceof PositionDependentRecord); @@ -468,7 +468,7 @@ public class HSLFSlideShowEncrypted implements Closeable { int deaOffset = -1; PersistPtrHolder ptr = null; UserEditAtom uea = null; - List<Record> recordList = new ArrayList<Record>(); + List<Record> recordList = new ArrayList<>(); for (Record r : records) { if (r instanceof DocumentEncryptionAtom) { deaOffset = ((DocumentEncryptionAtom)r).getLastOnDiskOffset(); @@ -490,7 +490,7 @@ public class HSLFSlideShowEncrypted implements Closeable { return records; } - TreeMap<Integer,Integer> tm = new TreeMap<Integer,Integer>(ptr.getSlideLocationsLookup()); + TreeMap<Integer,Integer> tm = new TreeMap<>(ptr.getSlideLocationsLookup()); ptr.clear(); int maxSlideId = -1; for (Map.Entry<Integer,Integer> me : tm.entrySet()) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java index 5220a3fd76..1dde0d03d4 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java @@ -250,8 +250,8 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { private Record[] read(byte[] docstream, int usrOffset) throws IOException { //sort found records by offset. //(it is not necessary but SlideShow.findMostRecentCoreRecords() expects them sorted) - NavigableMap<Integer, Record> records = new TreeMap<Integer, Record>(); // offset -> record - Map<Integer, Integer> persistIds = new HashMap<Integer, Integer>(); // offset -> persistId + NavigableMap<Integer, Record> records = new TreeMap<>(); // offset -> record + Map<Integer, Integer> persistIds = new HashMap<>(); // offset -> persistId initRecordOffsets(docstream, usrOffset, records, persistIds); HSLFSlideShowEncrypted decryptData = new HSLFSlideShowEncrypted(docstream, records); @@ -347,7 +347,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { * This is lazily called as and when we want to touch pictures. */ private void readPictures() throws IOException { - _pictures = new ArrayList<HSLFPictureData>(); + _pictures = new ArrayList<>(); // if the presentation doesn't contain pictures - will use a null set instead if (!getDirectory().hasEntry("Pictures")) { @@ -460,7 +460,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { // For position dependent records, hold where they were and now are // As we go along, update, and hand over, to any Position Dependent // records we happen across - Map<Integer, Integer> oldToNewPositions = new HashMap<Integer, Integer>(); + Map<Integer, Integer> oldToNewPositions = new HashMap<>(); // First pass - figure out where all the position dependent // records are going to end up, in the new scheme @@ -505,7 +505,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { throw new HSLFException("UserEditAtom or PersistPtr can't be determined."); } - Map<Integer, Integer> persistIds = new HashMap<Integer, Integer>(); + Map<Integer, Integer> persistIds = new HashMap<>(); for (Map.Entry<Integer, Integer> entry : ptr.getSlideLocationsLookup().entrySet()) { persistIds.put(oldToNewPositions.get(entry.getValue()), entry.getKey()); } @@ -667,7 +667,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { _records = encryptedSS.updateEncryptionRecord(_records); // The list of entries we've written out - List<String> writtenEntries = new ArrayList<String>(1); + List<String> writtenEntries = new ArrayList<>(1); // Write out the Property Streams writeProperties(outFS, writtenEntries); @@ -830,7 +830,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { */ public HSLFObjectData[] getEmbeddedObjects() { if (_objects == null) { - List<HSLFObjectData> objects = new ArrayList<HSLFObjectData>(); + List<HSLFObjectData> objects = new ArrayList<>(); for (Record r : _records) { if (r instanceof ExOleObjStg) { objects.add(new HSLFObjectData((ExOleObjStg) r)); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java index 7750b25f15..51272e917f 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java @@ -75,7 +75,7 @@ public final class HSLFSoundData { * @return the array with the sound data */ public static HSLFSoundData[] find(Document document){ - ArrayList<HSLFSoundData> lst = new ArrayList<HSLFSoundData>(); + ArrayList<HSLFSoundData> lst = new ArrayList<>(); Record[] ch = document.getChildRecords(); for (int i = 0; i < ch.length; i++) { if(ch[i].getRecordType() == RecordTypes.SoundCollection.typeID){ diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java index 586005b570..884902655c 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java @@ -156,7 +156,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { protected void afterInsert(HSLFSheet sh){ super.afterInsert(sh); - Set<HSLFLine> lineSet = new HashSet<HSLFLine>(); + Set<HSLFLine> lineSet = new HashSet<>(); for (HSLFTableCell row[] : cells) { for (HSLFTableCell c : row) { addShape(c); @@ -176,7 +176,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { } private void cellListToArray() { - List<HSLFTableCell> htc = new ArrayList<HSLFTableCell>(); + List<HSLFTableCell> htc = new ArrayList<>(); for (HSLFShape h : getShapes()) { if (h instanceof HSLFTableCell) { htc.add((HSLFTableCell)h); @@ -187,8 +187,8 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { throw new IllegalStateException("HSLFTable without HSLFTableCells"); } - SortedSet<Double> colSet = new TreeSet<Double>(); - SortedSet<Double> rowSet = new TreeSet<Double>(); + SortedSet<Double> colSet = new TreeSet<>(); + SortedSet<Double> rowSet = new TreeSet<>(); // #1 pass - determine cols and rows for (HSLFTableCell sh : htc) { @@ -198,8 +198,8 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { } cells = new HSLFTableCell[rowSet.size()][colSet.size()]; - List<Double> colLst = new ArrayList<Double>(colSet); - List<Double> rowLst = new ArrayList<Double>(rowSet); + List<Double> colLst = new ArrayList<>(colSet); + List<Double> rowLst = new ArrayList<>(rowSet); // #2 pass - assign shape to table cells for (HSLFTableCell sh : htc) { @@ -254,7 +254,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { } private void fitLinesToCells() { - List<LineRect> lines = new ArrayList<LineRect>(); + List<LineRect> lines = new ArrayList<>(); for (HSLFShape h : getShapes()) { if (h instanceof HSLFLine) { lines.add(new LineRect((HSLFLine)h)); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java index 263d45844d..60c1707ecf 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java @@ -96,7 +96,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText private TextPropCollection _masterStyle; protected TextRulerAtom _ruler; - protected final List<HSLFTextRun> _runs = new ArrayList<HSLFTextRun>(); + protected final List<HSLFTextRun> _runs = new ArrayList<>(); protected HSLFTextShape _parentShape; private HSLFSheet _sheet; private int shapeId; @@ -1251,7 +1251,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText * For a given PPDrawing, grab all the TextRuns */ public static List<List<HSLFTextParagraph>> findTextParagraphs(PPDrawing ppdrawing, HSLFSheet sheet) { - List<List<HSLFTextParagraph>> runsV = new ArrayList<List<HSLFTextParagraph>>(); + List<List<HSLFTextParagraph>> runsV = new ArrayList<>(); for (EscherTextboxWrapper wrapper : ppdrawing.getTextboxWrappers()) { List<HSLFTextParagraph> p = findTextParagraphs(wrapper, sheet); if (p != null) { @@ -1299,7 +1299,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText } else { // create a new container // TODO: ... is this case really happening? - rv = new ArrayList<HSLFTextParagraph>(rv); + rv = new ArrayList<>(rv); rv.addAll(r); } } @@ -1352,7 +1352,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText * @param records the records to build from */ protected static List<List<HSLFTextParagraph>> findTextParagraphs(Record[] records) { - List<List<HSLFTextParagraph>> paragraphCollection = new ArrayList<List<HSLFTextParagraph>>(); + List<List<HSLFTextParagraph>> paragraphCollection = new ArrayList<>(); int[] recordIdx = { 0 }; @@ -1397,7 +1397,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText String rawText = (tchars != null) ? tchars.getText() : tbytes.getText(); StyleTextPropAtom styles = findStyleAtomPresent(header, rawText.length()); - List<HSLFTextParagraph> paragraphs = new ArrayList<HSLFTextParagraph>(); + List<HSLFTextParagraph> paragraphs = new ArrayList<>(); paragraphCollection.add(paragraphs); // split, but keep delimiter diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java index 9db4afbd90..6dc8c3b557 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java @@ -133,7 +133,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> { /** * TextRun object which holds actual text and format data */ - private List<HSLFTextParagraph> _paragraphs = new ArrayList<HSLFTextParagraph>(); + private List<HSLFTextParagraph> _paragraphs = new ArrayList<>(); /** * Escher container which holds text attributes such as @@ -934,7 +934,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> { * @return null, if there's no alternative representation, otherwise the text shape */ public TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getMetroShape() { - HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>> mbs = new HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>>(this); + HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>> mbs = new HSLFMetroShape<>(this); return mbs.getShape(); } }
\ No newline at end of file diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTitleMaster.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTitleMaster.java index 2dfd3b05b6..b8e3948ccc 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTitleMaster.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTitleMaster.java @@ -27,7 +27,7 @@ import org.apache.poi.hslf.record.SlideAtom; * Title masters define the design template for slides with a Title Slide layout. */ public final class HSLFTitleMaster extends HSLFMasterSheet { - private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>(); + private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>(); /** * Constructs a TitleMaster diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index 5a5d5dc942..1f4505613d 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -149,8 +149,8 @@ public class MAPIMessage extends POIReadOnlyDocument { ChunkGroup[] chunkGroups = POIFSChunkParser.parse(poifsDir); // Grab interesting bits - ArrayList<AttachmentChunks> attachments = new ArrayList<AttachmentChunks>(); - ArrayList<RecipientChunks> recipients = new ArrayList<RecipientChunks>(); + ArrayList<AttachmentChunks> attachments = new ArrayList<>(); + ArrayList<RecipientChunks> recipients = new ArrayList<>(); for(ChunkGroup group : chunkGroups) { // Should only ever be one of each of these if(group instanceof Chunks) { diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java index 043ef88c28..3989af28f0 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java @@ -62,7 +62,7 @@ public class AttachmentChunks implements ChunkGroup { private String poifsName; /** Holds all the chunks that were found. */ - private List<Chunk> allChunks = new ArrayList<Chunk>(); + private List<Chunk> allChunks = new ArrayList<>(); public AttachmentChunks(String poifsName) { this.poifsName = poifsName; diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Chunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Chunks.java index aee1e88c8f..b3f3cf5c5c 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Chunks.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Chunks.java @@ -44,7 +44,7 @@ public final class Chunks implements ChunkGroupWithProperties { * Normally a property will have zero chunks (fixed sized) or one chunk * (variable size), but in some cases (eg Unknown) you may get more. */ - private Map<MAPIProperty, List<Chunk>> allChunks = new HashMap<MAPIProperty, List<Chunk>>(); + private Map<MAPIProperty, List<Chunk>> allChunks = new HashMap<>(); /** Type of message that the MSG represents (ie. IPM.Note) */ private StringChunk messageClass; @@ -106,7 +106,7 @@ public final class Chunks implements ChunkGroupWithProperties { @Override public Chunk[] getChunks() { - ArrayList<Chunk> chunks = new ArrayList<Chunk>(allChunks.size()); + ArrayList<Chunk> chunks = new ArrayList<>(allChunks.size()); for (List<Chunk> c : allChunks.values()) { chunks.addAll(c); } @@ -240,7 +240,7 @@ public final class Chunks implements ChunkGroupWithProperties { // And add to the main list if (allChunks.get(prop) == null) { - allChunks.put(prop, new ArrayList<Chunk>()); + allChunks.put(prop, new ArrayList<>()); } allChunks.get(prop).add(chunk); } diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/MAPIProperty.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/MAPIProperty.java index 376898b34e..b7a0aed574 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/MAPIProperty.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/MAPIProperty.java @@ -44,7 +44,7 @@ import org.apache.poi.hsmf.datatypes.Types.MAPIType; * http://msdn.microsoft.com/en-us/library/ms526356%28v=exchg.10%29.aspx */ public class MAPIProperty { - private static Map<Integer, MAPIProperty> attributes = new HashMap<Integer, MAPIProperty>(); + private static Map<Integer, MAPIProperty> attributes = new HashMap<>(); public static final MAPIProperty AB_DEFAULT_DIR = new MAPIProperty(0x3d06, BINARY, "AbDefaultDir", "PR_AB_DEFAULT_DIR"); diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/NameIdChunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/NameIdChunks.java index 33f293d1bf..b41bcca83a 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/NameIdChunks.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/NameIdChunks.java @@ -27,7 +27,7 @@ public final class NameIdChunks implements ChunkGroup { public static final String NAME = "__nameid_version1.0"; /** Holds all the chunks that were found. */ - private List<Chunk> allChunks = new ArrayList<Chunk>(); + private List<Chunk> allChunks = new ArrayList<>(); public Chunk[] getAll() { return allChunks.toArray(new Chunk[allChunks.size()]); diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/PropertiesChunk.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/PropertiesChunk.java index 1a8a3305e9..a64726ad96 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/PropertiesChunk.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/PropertiesChunk.java @@ -58,7 +58,7 @@ public abstract class PropertiesChunk extends Chunk { * Holds properties, indexed by type. If a property is multi-valued, or * variable length, it will be held via a {@link ChunkBasedPropertyValue}. */ - private Map<MAPIProperty, PropertyValue> properties = new HashMap<MAPIProperty, PropertyValue>(); + private Map<MAPIProperty, PropertyValue> properties = new HashMap<>(); /** * The ChunkGroup that these properties apply to. Used when matching chunks @@ -95,7 +95,7 @@ public abstract class PropertiesChunk extends Chunk { */ public Map<MAPIProperty, List<PropertyValue>> getProperties() { Map<MAPIProperty, List<PropertyValue>> props = - new HashMap<MAPIProperty, List<PropertyValue>>(properties.size()); + new HashMap<>(properties.size()); for (MAPIProperty prop : properties.keySet()) { props.put(prop, getValues(prop)); } @@ -135,7 +135,7 @@ public abstract class PropertiesChunk extends Chunk { protected void matchVariableSizedPropertiesToChunks() { // Index the Parent Group chunks for easy lookup // TODO Is this the right way? - Map<Integer, Chunk> chunks = new HashMap<Integer, Chunk>(); + Map<Integer, Chunk> chunks = new HashMap<>(); for (Chunk chunk : parentGroup.getChunks()) { chunks.put(chunk.getChunkId(), chunk); } diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java index 382e3ed82e..6680cde922 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java @@ -160,7 +160,7 @@ public final class RecipientChunks implements ChunkGroupWithProperties { } /** Holds all the chunks that were found. */ - private List<Chunk> allChunks = new ArrayList<Chunk>(); + private List<Chunk> allChunks = new ArrayList<>(); @Override public Map<MAPIProperty, List<PropertyValue>> getProperties() { diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Types.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Types.java index 314b788129..19047b59e3 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Types.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/Types.java @@ -26,8 +26,8 @@ import java.util.Map; * http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefpropertytype%28v=EXCHG.140%29.aspx */ public final class Types { - private static Map<Integer, MAPIType> builtInTypes = new HashMap<Integer, MAPIType>(); - private static Map<Integer, MAPIType> customTypes = new HashMap<Integer, Types.MAPIType>(); + private static Map<Integer, MAPIType> builtInTypes = new HashMap<>(); + private static Map<Integer, MAPIType> customTypes = new HashMap<>(); /** Unspecified */ public static final MAPIType UNSPECIFIED = new MAPIType(0x0000, diff --git a/src/scratchpad/src/org/apache/poi/hsmf/dev/TypesLister.java b/src/scratchpad/src/org/apache/poi/hsmf/dev/TypesLister.java index 39b0ebce5a..a3bc793ac8 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/dev/TypesLister.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/dev/TypesLister.java @@ -31,7 +31,7 @@ public class TypesLister { public TypesLister() {} public void listByName(PrintStream out) { - ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll()); + ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll()); Collections.sort(all, new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { return a.name.compareTo(b.name); @@ -40,7 +40,7 @@ public class TypesLister { list(all, out); } public void listById(PrintStream out) { - ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll()); + ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll()); Collections.sort(all, new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { if(a.id < b.id) return -1; diff --git a/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java b/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java index b5d0e26f0b..e65a1216dd 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java @@ -58,7 +58,7 @@ public final class POIFSChunkParser { public static ChunkGroup[] parse(DirectoryNode node) throws IOException { Chunks mainChunks = new Chunks(); - ArrayList<ChunkGroup> groups = new ArrayList<ChunkGroup>(); + ArrayList<ChunkGroup> groups = new ArrayList<>(); groups.add(mainChunks); // Find our top level children diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java index 6865fd5111..2a3a309c03 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java +++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java @@ -528,7 +528,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter return 0; } - final List<Element> emptyCells = new ArrayList<Element>( maxColIx ); + final List<Element> emptyCells = new ArrayList<>(maxColIx); if ( isOutputRowNumbers() ) { @@ -659,8 +659,8 @@ public class ExcelToFoConverter extends AbstractExcelConverter final CellRangeAddress[][] mergedRanges = ExcelToHtmlUtils .buildMergedRangesMap( sheet ); - final List<Element> emptyRowElements = new ArrayList<Element>( - physicalNumberOfRows ); + final List<Element> emptyRowElements = new ArrayList<>( + physicalNumberOfRows); int maxSheetColumns = 1; for ( int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++ ) { diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java index c2769861e6..a7fe782578 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java +++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java @@ -170,7 +170,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter private String cssClassPrefixTable = "t"; - private Map<Short, String> excelStyleToClass = new LinkedHashMap<Short, String>(); + private Map<Short, String> excelStyleToClass = new LinkedHashMap<>(); private final HtmlDocumentFacade htmlDocumentFacade; @@ -542,7 +542,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter if ( maxColIx <= 0 ) return 0; - final List<Element> emptyCells = new ArrayList<Element>( maxColIx ); + final List<Element> emptyCells = new ArrayList<>(maxColIx); if ( isOutputRowNumbers() ) { @@ -667,8 +667,8 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter final CellRangeAddress[][] mergedRanges = ExcelToHtmlUtils .buildMergedRangesMap( sheet ); - final List<Element> emptyRowElements = new ArrayList<Element>( - physicalNumberOfRows ); + final List<Element> emptyRowElements = new ArrayList<>( + physicalNumberOfRows); int maxSheetColumns = 1; for ( int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++ ) { diff --git a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java index 1b67e52ff9..3e20e9e18b 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java +++ b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java @@ -85,11 +85,11 @@ public final class HSSFChart { @SuppressWarnings("unused") private ChartTitleFormatRecord chartTitleFormat; private SeriesTextRecord chartTitleText; - private List<ValueRangeRecord> valueRanges = new ArrayList<ValueRangeRecord>(); + private List<ValueRangeRecord> valueRanges = new ArrayList<>(); private HSSFChartType type = HSSFChartType.Unknown; - private List<HSSFSeries> series = new ArrayList<HSSFSeries>(); + private List<HSSFSeries> series = new ArrayList<>(); public enum HSSFChartType { Area { @@ -146,7 +146,7 @@ public final class HSSFChart { public void createBarChart( HSSFWorkbook workbook, HSSFSheet parentSheet ) { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add( createMSDrawingObjectRecord() ); records.add( createOBJRecord() ); records.add( createBOFRecord() ); @@ -218,7 +218,7 @@ public final class HSSFChart { * these charts yet, as this is very limited support */ public static HSSFChart[] getSheetCharts(HSSFSheet sheet) { - List<HSSFChart> charts = new ArrayList<HSSFChart>(); + List<HSSFChart> charts = new ArrayList<>(); HSSFChart lastChart = null; HSSFSeries lastSeries = null; // Find records of interest @@ -1136,7 +1136,7 @@ public final class HSSFChart { return null; } - List<Ptg> ptgList = new ArrayList<Ptg>(); + List<Ptg> ptgList = new ArrayList<>(); int rowCount = (range.getLastRow() - range.getFirstRow()) + 1; int colCount = (range.getLastColumn() - range.getFirstColumn()) + 1; @@ -1181,7 +1181,7 @@ public final class HSSFChart { } public HSSFSeries createSeries() throws Exception { - ArrayList<RecordBase> seriesTemplate = new ArrayList<RecordBase>(); + ArrayList<RecordBase> seriesTemplate = new ArrayList<>(); boolean seriesTemplateFilled = false; int idx = 0; @@ -1245,7 +1245,7 @@ public final class HSSFChart { HSSFSeries newSeries = null; /* duplicate record of the template series */ - ArrayList<RecordBase> clonedRecords = new ArrayList<RecordBase>(); + ArrayList<RecordBase> clonedRecords = new ArrayList<>(); for(final RecordBase record : seriesTemplate) { Record newRecord = null; diff --git a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java index 0c5950dde2..5eccd5d7a9 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java @@ -54,9 +54,9 @@ public class HwmfGraphics { private static final Charset DEFAULT_CHARSET = LocaleUtil.CHARSET_1252; private final Graphics2D graphicsCtx; - private final List<HwmfDrawProperties> propStack = new LinkedList<HwmfDrawProperties>(); + private final List<HwmfDrawProperties> propStack = new LinkedList<>(); private HwmfDrawProperties prop = new HwmfDrawProperties(); - private List<HwmfObjectTableEntry> objectTable = new ArrayList<HwmfObjectTableEntry>(); + private List<HwmfObjectTableEntry> objectTable = new ArrayList<>(); /** Bounding box from the placeable header */ private final Rectangle2D bbox; private final AffineTransform initialAT; diff --git a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfDraw.java b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfDraw.java index 57888432c1..48bcc60b44 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfDraw.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfDraw.java @@ -293,7 +293,7 @@ public class HwmfDraw { */ public static class WmfPolyPolygon implements HwmfRecord { - private List<Path2D> polyList = new ArrayList<Path2D>(); + private List<Path2D> polyList = new ArrayList<>(); @Override public HwmfRecordType getRecordType() { diff --git a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPalette.java b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPalette.java index c280988ce4..cb80c454ee 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPalette.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPalette.java @@ -102,7 +102,7 @@ public class HwmfPalette { */ private int start; - private List<PaletteEntry> palette = new ArrayList<PaletteEntry>(); + private List<PaletteEntry> palette = new ArrayList<>(); @Override public int init(LittleEndianInputStream leis, long recordSize, int recordFunction) throws IOException { @@ -127,7 +127,7 @@ public class HwmfPalette { } protected List<PaletteEntry> getPaletteCopy() { - List<PaletteEntry> newPalette = new ArrayList<PaletteEntry>(); + List<PaletteEntry> newPalette = new ArrayList<>(); for (PaletteEntry et : palette) { newPalette.add(new PaletteEntry(et)); } @@ -169,7 +169,7 @@ public class HwmfPalette { HwmfDrawProperties props = ctx.getProperties(); List<PaletteEntry> palette = props.getPalette(); if (palette == null) { - palette = new ArrayList<PaletteEntry>(); + palette = new ArrayList<>(); } int start = getPaletteStart(); for (int i=palette.size(); i<start; i++) { @@ -220,7 +220,7 @@ public class HwmfPalette { HwmfDrawProperties props = ctx.getProperties(); List<PaletteEntry> palette = props.getPalette(); if (palette == null) { - palette = new ArrayList<PaletteEntry>(); + palette = new ArrayList<>(); } for (int i=palette.size(); i<numberOfEntries; i++) { palette.add(new PaletteEntry()); @@ -303,7 +303,7 @@ public class HwmfPalette { List<PaletteEntry> src = getPaletteCopy(); int start = getPaletteStart(); if (dest == null) { - dest = new ArrayList<PaletteEntry>(); + dest = new ArrayList<>(); } for (int i=dest.size(); i<start; i++) { dest.add(new PaletteEntry()); diff --git a/src/scratchpad/src/org/apache/poi/hwmf/usermodel/HwmfPicture.java b/src/scratchpad/src/org/apache/poi/hwmf/usermodel/HwmfPicture.java index 17a8568f93..07e7d16cdb 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/usermodel/HwmfPicture.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/usermodel/HwmfPicture.java @@ -45,7 +45,7 @@ import org.apache.poi.util.Units; public class HwmfPicture { private static final POILogger logger = POILogFactory.getLogger(HwmfPicture.class); - final List<HwmfRecord> records = new ArrayList<HwmfRecord>(); + final List<HwmfRecord> records = new ArrayList<>(); final HwmfPlaceableHeader placeableHeader; final HwmfHeader header; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java index 07344c83a0..e265ada37b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -168,7 +168,7 @@ public abstract class AbstractWordConverter structures.add( structure ); } - private final Set<Bookmark> bookmarkStack = new LinkedHashSet<Bookmark>(); + private final Set<Bookmark> bookmarkStack = new LinkedHashSet<>(); private FontReplacer fontReplacer = new DefaultFontReplacer(); @@ -303,7 +303,7 @@ public abstract class AbstractWordConverter * should process char-by-char (slow) or find a correct way to * reconstruct the structure of range -- sergey */ - List<Structure> structures = new LinkedList<Structure>(); + List<Structure> structures = new LinkedList<>(); if ( wordDocument instanceof HWPFDocument ) { final HWPFDocument doc = (HWPFDocument) wordDocument; @@ -366,7 +366,7 @@ public abstract class AbstractWordConverter } } - structures = new ArrayList<Structure>( structures ); + structures = new ArrayList<>(structures); Collections.sort( structures ); int previous = range.getStartOffset(); @@ -389,7 +389,7 @@ public abstract class AbstractWordConverter if ( structure.structure instanceof Bookmark ) { // other bookmarks with same boundaries - List<Bookmark> bookmarks = new LinkedList<Bookmark>(); + List<Bookmark> bookmarks = new LinkedList<>(); for ( Bookmark bookmark : ( (HWPFDocument) wordDocument ) .getBookmarks() .getBookmarksStartedBetween( structure.start, diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java index aff9519f8e..e5b0fac89f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java @@ -67,7 +67,7 @@ public class AbstractWordUtils */ static int[] buildTableCellEdgesArray( Table table ) { - Set<Integer> edges = new TreeSet<Integer>(); + Set<Integer> edges = new TreeSet<>(); for ( int r = 0; r < table.numRows(); r++ ) { @@ -228,7 +228,7 @@ public class AbstractWordUtils public static class NumberingState { - private final Map<String, Integer> levels = new HashMap<String, Integer>(); + private final Map<String, Integer> levels = new HashMap<>(); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java index 67f6ea1cd8..792458165c 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java @@ -35,7 +35,7 @@ public class HtmlDocumentFacade /** * Map from tag name, to map linking known styles and css class names */ - private Map<String, Map<String, String>> stylesheet = new LinkedHashMap<String, Map<String, String>>(); + private Map<String, Map<String, String>> stylesheet = new LinkedHashMap<>(); private Element stylesheetElement; protected Element title; @@ -251,8 +251,8 @@ public class HtmlDocumentFacade public String getOrCreateCssClass( String classNamePrefix, String style ) { if ( !stylesheet.containsKey( classNamePrefix ) ) - stylesheet.put( classNamePrefix, new LinkedHashMap<String, String>( - 1 ) ); + stylesheet.put( classNamePrefix, new LinkedHashMap<>( + 1) ); Map<String, String> styleToClassName = stylesheet.get( classNamePrefix ); String knownClass = styleToClassName.get( style ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java index daf86e7ccc..7ce31b13a5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java @@ -103,7 +103,7 @@ public class WordToFoConverter extends AbstractWordConverter return wordToFoConverter.getDocument(); } - private List<Element> endnotes = new ArrayList<Element>( 0 ); + private List<Element> endnotes = new ArrayList<>(0); protected final FoDocumentFacade foDocumentFacade; @@ -111,7 +111,7 @@ public class WordToFoConverter extends AbstractWordConverter private boolean outputCharactersLanguage; - private Set<String> usedIds = new LinkedHashSet<String>(); + private Set<String> usedIds = new LinkedHashSet<>(); /** * Creates new instance of {@link WordToFoConverter}. Can be used for output diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java index bfacb4b19a..3ea2c596a0 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java @@ -82,7 +82,7 @@ public class WordToHtmlConverter extends AbstractWordConverter private static final POILogger logger = POILogFactory.getLogger( WordToHtmlConverter.class ); - private final Deque<BlockProperies> blocksProperies = new LinkedList<BlockProperies>(); + private final Deque<BlockProperies> blocksProperies = new LinkedList<>(); private final HtmlDocumentFacade htmlDocumentFacade; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java b/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java index 7fe2686165..e859ad5c6c 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java @@ -324,7 +324,7 @@ public final class HWPFLister private void buildParagraphs() { - paragraphs = new LinkedHashMap<Integer, String>(); + paragraphs = new LinkedHashMap<>(); StringBuilder part = new StringBuilder(); String text = _doc.getDocumentText(); @@ -525,7 +525,7 @@ public final class HWPFLister .getFileInformationBlock().getFcPlcfbtePapx(), doc .getFileInformationBlock().getLcbPlcfbtePapx(), 4 ); - List<PAPX> papxs = new ArrayList<PAPX>(); + List<PAPX> papxs = new ArrayList<>(); int length = binTable.length(); for ( int x = 0; x < length; x++ ) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarksTables.java b/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarksTables.java index e860165dff..691273f41a 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarksTables.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarksTables.java @@ -36,7 +36,7 @@ public class BookmarksTables private PlexOfCps descriptorsLim = new PlexOfCps( 0 ); - private List<String> names = new ArrayList<String>( 0 ); + private List<String> names = new ArrayList<>(0); public BookmarksTables( byte[] tableStream, FileInformationBlock fib ) { @@ -118,8 +118,8 @@ public class BookmarksTables int namesLength = fib.getLcbSttbfbkmk(); if ( namesStart != 0 && namesLength != 0 ) - this.names = new ArrayList<String>( Arrays.asList( SttbUtils - .readSttbfBkmk( tableStream, namesStart ) ) ); + this.names = new ArrayList<>(Arrays.asList(SttbUtils + .readSttbfBkmk(tableStream, namesStart))); int firstDescriptorsStart = fib.getFcPlcfbkf(); int firstDescriptorsLength = fib.getLcbPlcfbkf(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java index b211248cec..b5aff30977 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java @@ -53,7 +53,7 @@ public class CHPBinTable .getLogger( CHPBinTable.class ); /** List of character properties.*/ - protected List<CHPX> _textRuns = new ArrayList<CHPX>(); + protected List<CHPX> _textRuns = new ArrayList<>(); public CHPBinTable() { @@ -171,7 +171,7 @@ public class CHPBinTable start = System.currentTimeMillis(); } - List<CHPX> oldChpxSortedByStartPos = new ArrayList<CHPX>( _textRuns ); + List<CHPX> oldChpxSortedByStartPos = new ArrayList<>(_textRuns); Collections.sort( oldChpxSortedByStartPos, PropertyNode.StartComparator.instance ); @@ -179,7 +179,7 @@ public class CHPBinTable Long.valueOf( System.currentTimeMillis() - start ), " ms" ); start = System.currentTimeMillis(); - final Map<CHPX, Integer> chpxToFileOrder = new IdentityHashMap<CHPX, Integer>(); + final Map<CHPX, Integer> chpxToFileOrder = new IdentityHashMap<>(); { int counter = 0; for ( CHPX chpx : _textRuns ) @@ -203,15 +203,15 @@ public class CHPBinTable List<Integer> textRunsBoundariesList; { - Set<Integer> textRunsBoundariesSet = new HashSet<Integer>(); + Set<Integer> textRunsBoundariesSet = new HashSet<>(); for ( CHPX chpx : _textRuns ) { textRunsBoundariesSet.add( Integer.valueOf( chpx.getStart() ) ); textRunsBoundariesSet.add( Integer.valueOf( chpx.getEnd() ) ); } textRunsBoundariesSet.remove( Integer.valueOf( 0 ) ); - textRunsBoundariesList = new ArrayList<Integer>( - textRunsBoundariesSet ); + textRunsBoundariesList = new ArrayList<>( + textRunsBoundariesSet); Collections.sort( textRunsBoundariesList ); } @@ -219,7 +219,7 @@ public class CHPBinTable Long.valueOf( System.currentTimeMillis() - start ), " ms" ); start = System.currentTimeMillis(); - List<CHPX> newChpxs = new LinkedList<CHPX>(); + List<CHPX> newChpxs = new LinkedList<>(); int lastTextRunStart = 0; for ( Integer objBoundary : textRunsBoundariesList ) { @@ -237,7 +237,7 @@ public class CHPBinTable && oldChpxSortedByStartPos.get( startPosition ).getStart() >= boundary ) startPosition--; - List<CHPX> chpxs = new LinkedList<CHPX>(); + List<CHPX> chpxs = new LinkedList<>(); for ( int c = startPosition; c < oldChpxSortedByStartPos.size(); c++ ) { CHPX chpx = oldChpxSortedByStartPos.get( c ); @@ -291,7 +291,7 @@ public class CHPBinTable continue; } - this._textRuns = new ArrayList<CHPX>( newChpxs ); + this._textRuns = new ArrayList<>(newChpxs); logger.log( POILogger.DEBUG, "CHPX rebuilded in ", Long.valueOf( System.currentTimeMillis() - start ), " ms (", diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java index 5d7e929e21..d21e54b8da 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java @@ -47,7 +47,7 @@ public final class CHPFormattedDiskPage extends FormattedDiskPage { private static final int FC_SIZE = 4; - private ArrayList<CHPX> _chpxList = new ArrayList<CHPX>(); + private ArrayList<CHPX> _chpxList = new ArrayList<>(); private ArrayList<CHPX> _overFlow; @@ -193,7 +193,7 @@ public final class CHPFormattedDiskPage extends FormattedDiskPage // see if we couldn't fit some if ( index != size ) { - _overFlow = new ArrayList<CHPX>(); + _overFlow = new ArrayList<>(); _overFlow.addAll( _chpxList.subList( index, size ) ); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java index 36792f41e4..ca7bd0bfd5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java @@ -46,7 +46,7 @@ public class ComplexFileTable { Charset charset) throws IOException { //skips through the prms before we reach the piece table. These contain data //for actual fast saved files - List<SprmBuffer> sprmBuffers = new LinkedList<SprmBuffer>(); + List<SprmBuffer> sprmBuffers = new LinkedList<>(); while (tableStream[offset] == GRPPRL_TYPE) { offset++; int size = LittleEndian.getShort(tableStream, offset); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java b/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java index f5b0dbcf4a..8ab7781464 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java @@ -37,7 +37,7 @@ public final class EscherRecordHolder { private final ArrayList<EscherRecord> escherRecords; public EscherRecordHolder() { - escherRecords = new ArrayList<EscherRecord>(); + escherRecords = new ArrayList<>(); } public EscherRecordHolder(byte[] data, int offset, int size) { @@ -125,8 +125,8 @@ public final class EscherRecordHolder { public List<? extends EscherContainerRecord> getDgContainers() { - List<EscherContainerRecord> dgContainers = new ArrayList<EscherContainerRecord>( - 1 ); + List<EscherContainerRecord> dgContainers = new ArrayList<>( + 1); for ( EscherRecord escherRecord : getEscherRecords() ) { if ( escherRecord.getRecordId() == (short) 0xF002 ) @@ -139,8 +139,8 @@ public final class EscherRecordHolder { public List<? extends EscherContainerRecord> getDggContainers() { - List<EscherContainerRecord> dggContainers = new ArrayList<EscherContainerRecord>( - 1 ); + List<EscherContainerRecord> dggContainers = new ArrayList<>( + 1); for ( EscherRecord escherRecord : getEscherRecords() ) { if ( escherRecord.getRecordId() == (short) 0xF000 ) @@ -153,8 +153,8 @@ public final class EscherRecordHolder { public List<? extends EscherContainerRecord> getBStoreContainers() { - List<EscherContainerRecord> bStoreContainers = new ArrayList<EscherContainerRecord>( - 1 ); + List<EscherContainerRecord> bStoreContainers = new ArrayList<>( + 1); for ( EscherContainerRecord dggContainer : getDggContainers() ) { for ( EscherRecord escherRecord : dggContainer.getChildRecords() ) @@ -170,8 +170,8 @@ public final class EscherRecordHolder { public List<? extends EscherContainerRecord> getSpgrContainers() { - List<EscherContainerRecord> spgrContainers = new ArrayList<EscherContainerRecord>( - 1 ); + List<EscherContainerRecord> spgrContainers = new ArrayList<>( + 1); for ( EscherContainerRecord dgContainer : getDgContainers() ) { for ( EscherRecord escherRecord : dgContainer.getChildRecords() ) @@ -187,8 +187,8 @@ public final class EscherRecordHolder { public List<? extends EscherContainerRecord> getSpContainers() { - List<EscherContainerRecord> spContainers = new ArrayList<EscherContainerRecord>( - 1 ); + List<EscherContainerRecord> spContainers = new ArrayList<>( + 1); for ( EscherContainerRecord spgrContainer : getSpgrContainers() ) { for ( EscherRecord escherRecord : spgrContainer.getChildRecords() ) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java index 18543f5e4a..ab477332cc 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java @@ -148,7 +148,7 @@ public final class FIBFieldHandler private static final int FIELD_SIZE = LittleEndian.INT_SIZE * 2; - private Map<Integer, UnhandledDataStructure> _unknownMap = new HashMap<Integer, UnhandledDataStructure>(); + private Map<Integer, UnhandledDataStructure> _unknownMap = new HashMap<>(); private int[] _fields; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java index 37c12c465e..67a74cea72 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java @@ -33,7 +33,7 @@ import org.apache.poi.util.Internal; public final class FSPATable { - private final Map<Integer, GenericPropertyNode> _byStart = new LinkedHashMap<Integer, GenericPropertyNode>(); + private final Map<Integer, GenericPropertyNode> _byStart = new LinkedHashMap<>(); public FSPATable( byte[] tableStream, FileInformationBlock fib, FSPADocumentPart part ) @@ -79,7 +79,7 @@ public final class FSPATable public FSPA[] getShapes() { - List<FSPA> result = new ArrayList<FSPA>( _byStart.size() ); + List<FSPA> result = new ArrayList<>(_byStart.size()); for ( GenericPropertyNode propertyNode : _byStart.values() ) { result.add( new FSPA( propertyNode.getBytes(), 0 ) ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FieldsTables.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FieldsTables.java index 4cc1be9385..595078e47f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FieldsTables.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FieldsTables.java @@ -79,10 +79,10 @@ public class FieldsTables private static ArrayList<PlexOfField> toArrayList( PlexOfCps plexOfCps ) { if ( plexOfCps == null ) - return new ArrayList<PlexOfField>(); + return new ArrayList<>(); - ArrayList<PlexOfField> fields = new ArrayList<PlexOfField>( - plexOfCps.length() ); + ArrayList<PlexOfField> fields = new ArrayList<>( + plexOfCps.length()); for ( int i = 0; i < plexOfCps.length(); i++ ) { GenericPropertyNode propNode = plexOfCps.getProperty( i ); @@ -97,8 +97,8 @@ public class FieldsTables public FieldsTables( byte[] tableStream, FileInformationBlock fib ) { - _tables = new HashMap<FieldsDocumentPart, PlexOfCps>( - FieldsDocumentPart.values().length ); + _tables = new HashMap<>( + FieldsDocumentPart.values().length); for ( FieldsDocumentPart part : FieldsDocumentPart.values() ) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java index 6f66e9aefc..36a16f9355 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java @@ -234,7 +234,7 @@ public final class FileInformationBlock * fields FIBFieldHandler will load it content into * UnhandledDataStructure and save them on save. */ - HashSet<Integer> knownFieldSet = new HashSet<Integer>(); + HashSet<Integer> knownFieldSet = new HashSet<>(); knownFieldSet.add( Integer.valueOf( FIBFieldHandler.STSHF ) ); knownFieldSet.add( Integer.valueOf( FIBFieldHandler.CLX ) ); knownFieldSet.add( Integer.valueOf( FIBFieldHandler.DOP ) ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java b/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java index 2d28fd0a3d..4b8b4b83bf 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java @@ -38,7 +38,7 @@ public final class ListTables /** * Both PlfLst and the following LVLs */ - private final LinkedHashMap<Integer, ListData> _listMap = new LinkedHashMap<Integer, ListData>(); + private final LinkedHashMap<Integer, ListData> _listMap = new LinkedHashMap<>(); private PlfLfo _plfLfo; public ListTables() diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldFontTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldFontTable.java index dfe1f95e0e..28e6a04303 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldFontTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldFontTable.java @@ -42,7 +42,7 @@ public final class OldFontTable { //and it is recorded in the first short. - List<OldFfn> ffns = new ArrayList<OldFfn>(); + List<OldFfn> ffns = new ArrayList<>(); int fontTableLength = LittleEndian.getShort(buf, offset); int endOfTableOffset = offset + length; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPieceTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPieceTable.java index f141cddbab..60272cad84 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPieceTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPieceTable.java @@ -98,7 +98,7 @@ public class OldTextPieceTable extends TextPieceTable { // In the interest of our sanity, now sort the text pieces // into order, if they're not already Collections.sort(_textPieces); - _textPiecesFCOrder = new ArrayList<TextPiece>(_textPieces); + _textPiecesFCOrder = new ArrayList<>(_textPieces); Collections.sort(_textPiecesFCOrder, new FCComparator()); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java index 231fb9f9f1..5d186f3d55 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java @@ -49,7 +49,7 @@ public class PAPBinTable private static final POILogger logger = POILogFactory .getLogger( PAPBinTable.class ); - protected final ArrayList<PAPX> _paragraphs = new ArrayList<PAPX>(); + protected final ArrayList<PAPX> _paragraphs = new ArrayList<>(); public PAPBinTable() { @@ -158,7 +158,7 @@ public class PAPBinTable start = System.currentTimeMillis(); } - List<PAPX> oldPapxSortedByEndPos = new ArrayList<PAPX>( paragraphs ); + List<PAPX> oldPapxSortedByEndPos = new ArrayList<>(paragraphs); Collections.sort( oldPapxSortedByEndPos, PropertyNode.EndComparator.instance ); @@ -166,7 +166,7 @@ public class PAPBinTable Long.valueOf( System.currentTimeMillis() - start ), " ms" ); start = System.currentTimeMillis(); - final Map<PAPX, Integer> papxToFileOrder = new IdentityHashMap<PAPX, Integer>(); + final Map<PAPX, Integer> papxToFileOrder = new IdentityHashMap<>(); { int counter = 0; for ( PAPX papx : paragraphs ) @@ -188,7 +188,7 @@ public class PAPBinTable Long.valueOf( System.currentTimeMillis() - start ), " ms" ); start = System.currentTimeMillis(); - List<PAPX> newPapxs = new LinkedList<PAPX>(); + List<PAPX> newPapxs = new LinkedList<>(); int lastParStart = 0; int lastPapxIndex = 0; for ( int charIndex = 0; charIndex < docText.length(); charIndex++ ) @@ -201,7 +201,7 @@ public class PAPBinTable final int endExclusive = charIndex + 1; boolean broken = false; - List<PAPX> papxs = new LinkedList<PAPX>(); + List<PAPX> papxs = new LinkedList<>(); for ( int papxIndex = lastPapxIndex; papxIndex < oldPapxSortedByEndPos .size(); papxIndex++ ) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java index 408a33f328..5edf5866b3 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java @@ -48,7 +48,7 @@ public final class PAPFormattedDiskPage extends FormattedDiskPage { private static final int BX_SIZE = 13; private static final int FC_SIZE = 4; - private ArrayList<PAPX> _papxList = new ArrayList<PAPX>(); + private ArrayList<PAPX> _papxList = new ArrayList<>(); private ArrayList<PAPX> _overFlow; /** @@ -246,7 +246,7 @@ public final class PAPFormattedDiskPage extends FormattedDiskPage { // see if we couldn't fit some if ( index != size ) { - _overFlow = new ArrayList<PAPX>(); + _overFlow = new ArrayList<>(); _overFlow.addAll( _papxList.subList( index, size ) ); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java index b17ec44391..c729eb2ee5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java @@ -62,7 +62,7 @@ public class PICFAndOfficeArtData escherRecordFactory ); offset += recordSize; - _blipRecords = new LinkedList<EscherRecord>(); + _blipRecords = new LinkedList<>(); while ( ( offset - startOffset ) < _picf.getLcb() ) { EscherRecord nextRecord = escherRecordFactory.createRecord( diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java index 7cbca8ea4f..214654a064 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java @@ -220,7 +220,7 @@ public final class PicturesTable * @return a list of Picture objects found in current document */ public List<Picture> getAllPictures() { - ArrayList<Picture> pictures = new ArrayList<Picture>(); + ArrayList<Picture> pictures = new ArrayList<>(); Range range = _document.getOverallRange(); for (int i = 0; i < range.numCharacterRuns(); i++) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PlexOfCps.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PlexOfCps.java index 034ea4f700..55e921a427 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PlexOfCps.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PlexOfCps.java @@ -37,7 +37,7 @@ public final class PlexOfCps { private List<GenericPropertyNode> _props; public PlexOfCps(int sizeOfStruct) { - _props = new ArrayList<GenericPropertyNode>(); + _props = new ArrayList<>(); _cbStruct = sizeOfStruct; } @@ -52,7 +52,7 @@ public final class PlexOfCps { _iMac = (cb - 4) / (4 + cbStruct); _cbStruct = cbStruct; - _props = new ArrayList<GenericPropertyNode>(_iMac); + _props = new ArrayList<>(_iMac); for (int x = 0; x < _iMac; x++) { _props.add(getProperty(x, buf, start)); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java index c038d9babf..8a484ab180 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java @@ -38,7 +38,7 @@ public class SectionTable private final static POILogger _logger = POILogFactory.getLogger(SectionTable.class); private static final int SED_SIZE = 12; - protected List<SEPX> _sections = new ArrayList<SEPX>(); + protected List<SEPX> _sections = new ArrayList<>(); protected List<TextPiece> _text; /** So we can know if things are unicode or not */ diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java index 931c3fc887..16c78e6e1a 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java @@ -44,8 +44,8 @@ public class TextPieceTable implements CharIndexTranslator { // int _multiple; int _cpMin; - protected ArrayList<TextPiece> _textPieces = new ArrayList<TextPiece>(); - protected ArrayList<TextPiece> _textPiecesFCOrder = new ArrayList<TextPiece>(); + protected ArrayList<TextPiece> _textPieces = new ArrayList<>(); + protected ArrayList<TextPiece> _textPiecesFCOrder = new ArrayList<>(); public TextPieceTable() { } @@ -110,7 +110,7 @@ public class TextPieceTable implements CharIndexTranslator { // In the interest of our sanity, now sort the text pieces // into order, if they're not already Collections.sort(_textPieces); - _textPiecesFCOrder = new ArrayList<TextPiece>(_textPieces); + _textPiecesFCOrder = new ArrayList<>(_textPieces); Collections.sort(_textPiecesFCOrder, new FCComparator()); } @@ -234,7 +234,7 @@ public class TextPieceTable implements CharIndexTranslator { @Override public int[][] getCharIndexRanges(int startBytePosInclusive, int endBytePosExclusive) { - List<int[]> result = new LinkedList<int[]>(); + List<int[]> result = new LinkedList<>(); for (TextPiece textPiece : _textPiecesFCOrder) { final int tpStart = textPiece.getPieceDescriptor() .getFilePosition(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java index f8aa03a1de..1d1b403439 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java @@ -27,7 +27,7 @@ import org.apache.poi.util.Internal; @Internal public final class HWPFFileSystem { - private Map<String, ByteArrayOutputStream> _streams = new HashMap<String, ByteArrayOutputStream>(); + private Map<String, ByteArrayOutputStream> _streams = new HashMap<>(); public HWPFFileSystem() { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompressor.java index 5e744bbe68..637c629070 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompressor.java @@ -32,7 +32,7 @@ public final class CharacterSprmCompressor } public static byte[] compressCharacterProperty(CharacterProperties newCHP, CharacterProperties oldCHP) { - List<byte[]> sprmList = new ArrayList<byte[]>(); + List<byte[]> sprmList = new ArrayList<>(); int size = 0; if (newCHP.isFRMarkDel() != oldCHP.isFRMarkDel()) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java index 2f60b536fe..65112c748d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java @@ -37,7 +37,7 @@ public final class ParagraphSprmCompressor { // page numbers links to Word97-2007BinaryFileFormat(doc)Specification.pdf, accessible from microsoft.com - List<byte[]> sprmList = new ArrayList<byte[]>(); + List<byte[]> sprmList = new ArrayList<>(); int size = 0; // Page 50 of public specification begins diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java index 6634aa4d0b..43a7c9a47c 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java @@ -439,7 +439,7 @@ public final class ParagraphSprmUncompressor int[] tabPositions = pap.getRgdxaTab(); TabDescriptor[] tabDescriptors = pap.getRgtbd(); - Map<Integer, TabDescriptor> tabMap = new HashMap<Integer, TabDescriptor>(); + Map<Integer, TabDescriptor> tabMap = new HashMap<>(); for (int x = 0; x < tabPositions.length; x++) { tabMap.put(Integer.valueOf(tabPositions[x]), tabDescriptors[x]); @@ -464,7 +464,7 @@ public final class ParagraphSprmUncompressor tabPositions = new int[tabMap.size()]; tabDescriptors = new TabDescriptor[tabPositions.length]; - List<Integer> list = new ArrayList<Integer>(tabMap.keySet()); + List<Integer> list = new ArrayList<>(tabMap.keySet()); Collections.sort(list); for (int x = 0; x < tabPositions.length; x++) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SectionSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SectionSprmCompressor.java index 8d20a7490f..14798c3590 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SectionSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SectionSprmCompressor.java @@ -35,7 +35,7 @@ public final class SectionSprmCompressor public static byte[] compressSectionProperty(SectionProperties newSEP) { int size = 0; - List<byte[]> sprmList = new ArrayList<byte[]>(); + List<byte[]> sprmList = new ArrayList<>(); if (newSEP.getCnsPgn() != DEFAULT_SEP.getCnsPgn()) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java index ec5fe937d4..3773740a34 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java @@ -37,7 +37,7 @@ public final class TableSprmCompressor public static byte[] compressTableProperty(TableProperties newTAP) { int size = 0; - List<byte[]> sprmList = new ArrayList<byte[]>(); + List<byte[]> sprmList = new ArrayList<>(); if (newTAP.getJc() != 0) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java index e692d0c1e7..7f466b4885 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java @@ -165,7 +165,7 @@ public class BookmarksImpl implements Bookmarks if ( nodes == null || nodes.isEmpty() ) return Collections.emptyList(); - List<Bookmark> result = new ArrayList<Bookmark>( nodes.size() ); + List<Bookmark> result = new ArrayList<>(nodes.size()); for ( GenericPropertyNode node : nodes ) { result.add( getBookmark( node ) ); @@ -192,7 +192,7 @@ public class BookmarksImpl implements Bookmarks if ( endLookupIndex < 0 ) endLookupIndex = -( endLookupIndex + 1 ); - Map<Integer, List<Bookmark>> result = new LinkedHashMap<Integer, List<Bookmark>>(); + Map<Integer, List<Bookmark>> result = new LinkedHashMap<>(); for ( int lookupIndex = startLookupIndex; lookupIndex < endLookupIndex; lookupIndex++ ) { int s = sortedStartPositions[lookupIndex]; @@ -225,7 +225,7 @@ public class BookmarksImpl implements Bookmarks if ( sortedDescriptors != null ) return; - Map<Integer, List<GenericPropertyNode>> result = new HashMap<Integer, List<GenericPropertyNode>>(); + Map<Integer, List<GenericPropertyNode>> result = new HashMap<>(); for ( int b = 0; b < bookmarksTables.getDescriptorsFirstCount(); b++ ) { GenericPropertyNode property = bookmarksTables @@ -234,7 +234,7 @@ public class BookmarksImpl implements Bookmarks List<GenericPropertyNode> atPositionList = result.get( positionKey ); if ( atPositionList == null ) { - atPositionList = new LinkedList<GenericPropertyNode>(); + atPositionList = new LinkedList<>(); result.put( positionKey, atPositionList ); } atPositionList.add( property ); @@ -246,8 +246,8 @@ public class BookmarksImpl implements Bookmarks .entrySet() ) { indices[counter++] = entry.getKey().intValue(); - List<GenericPropertyNode> updated = new ArrayList<GenericPropertyNode>( - entry.getValue() ); + List<GenericPropertyNode> updated = new ArrayList<>( + entry.getValue()); Collections.sort( updated, PropertyNode.EndComparator.instance ); entry.setValue( updated ); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/FieldsImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/FieldsImpl.java index 0e2dcdbeb1..d0c98a7fa8 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/FieldsImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/FieldsImpl.java @@ -101,8 +101,8 @@ public class FieldsImpl implements Fields public FieldsImpl( FieldsTables fieldsTables ) { - _fieldsByOffset = new HashMap<FieldsDocumentPart, Map<Integer, FieldImpl>>( - FieldsDocumentPart.values().length ); + _fieldsByOffset = new HashMap<>( + FieldsDocumentPart.values().length); for ( FieldsDocumentPart part : FieldsDocumentPart.values() ) { @@ -134,15 +134,15 @@ public class FieldsImpl implements Fields List<PlexOfField> plexOfFields ) { if ( plexOfFields == null || plexOfFields.isEmpty() ) - return new HashMap<Integer, FieldImpl>(); + return new HashMap<>(); Collections.sort( plexOfFields, comparator ); - List<FieldImpl> fields = new ArrayList<FieldImpl>( - plexOfFields.size() / 3 + 1 ); + List<FieldImpl> fields = new ArrayList<>( + plexOfFields.size() / 3 + 1); parseFieldStructureImpl( plexOfFields, 0, plexOfFields.size(), fields ); - HashMap<Integer, FieldImpl> result = new HashMap<Integer, FieldImpl>( - fields.size() ); + HashMap<Integer, FieldImpl> result = new HashMap<>( + fields.size()); for ( FieldImpl field : fields ) { result.put( Integer.valueOf( field.getFieldStartOffset() ), field ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java index 54a0c95969..16c8ada155 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java @@ -74,7 +74,7 @@ public class NotesImpl implements Notes if ( anchorToIndexMap != null ) return; - Map<Integer, Integer> result = new HashMap<Integer, Integer>(); + Map<Integer, Integer> result = new HashMap<>(); for ( int n = 0; n < notesTables.getDescriptorsCount(); n++ ) { int anchorPosition = notesTables.getDescriptor( n ).getStart(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java index 9e464f7bb1..46b88c16a9 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java @@ -305,7 +305,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings public Collection<OfficeDrawing> getOfficeDrawings() { - List<OfficeDrawing> result = new ArrayList<OfficeDrawing>(); + List<OfficeDrawing> result = new ArrayList<>(); for ( FSPA fspa : _fspaTable.getShapes() ) { result.add( getOfficeDrawing( fspa ) ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java index 6b5a51529e..8f7de73d7c 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java @@ -41,7 +41,7 @@ import org.apache.poi.hwpf.model.PicturesTable; */ public class PictureRunMapper { private PicturesTable picturesTable; - private Set<Picture> claimed = new HashSet<Picture>(); + private Set<Picture> claimed = new HashSet<>(); private Map<Integer, Picture> lookup; private List<Picture> nonU1based; private List<Picture> all; @@ -52,7 +52,7 @@ public class PictureRunMapper { all = picturesTable.getAllPictures(); // Build the Offset-Picture lookup map - lookup = new HashMap<Integer, Picture>(); + lookup = new HashMap<>(); for (Picture p : all) { lookup.put(p.getStartOffset(), p); } @@ -62,7 +62,7 @@ public class PictureRunMapper { // These are \u0008 escher floating ones, ones // found outside the normal text, and who // knows what else... - nonU1based = new ArrayList<Picture>(); + nonU1based = new ArrayList<>(); nonU1based.addAll(all); Range r = doc.getRange(); for (int i = 0; i < r.numCharacterRuns(); i++) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java index 425e8036e8..eae15813c9 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java @@ -167,7 +167,7 @@ public class Range { // TODO -instantiable superclass _paragraphs = _doc.getParagraphTable().getParagraphs(); _characters = _doc.getCharacterTable().getTextRuns(); _text = _doc.getText(); - _parent = new WeakReference<Range>(null); + _parent = new WeakReference<>(null); sanityCheckStartEnd(); } @@ -190,7 +190,7 @@ public class Range { // TODO -instantiable superclass _paragraphs = parent._paragraphs; _characters = parent._characters; _text = parent._text; - _parent = new WeakReference<Range>(parent); + _parent = new WeakReference<>(parent); sanityCheckStartEnd(); sanityCheck(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java index 74921b15b5..40ef0d4219 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java @@ -51,7 +51,7 @@ public final class Table extends Range if ( _rowsFound ) return; - _rows = new ArrayList<TableRow>(); + _rows = new ArrayList<>(); int rowStart = 0; int rowEnd = 0; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java index 4bfac1d4ad..7080addfcf 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java @@ -126,8 +126,8 @@ public final class TableRow extends Range final short expectedCellsCount = _tprops.getItcMac(); int lastCellStart = 0; - List<TableCell> cells = new ArrayList<TableCell>( - expectedCellsCount + 1 ); + List<TableCell> cells = new ArrayList<>( + expectedCellsCount + 1); for ( int p = 0; p < numParagraphs(); p++ ) { Paragraph paragraph = getParagraph( p ); diff --git a/src/scratchpad/testcases/org/apache/poi/hemf/extractor/HemfExtractorTest.java b/src/scratchpad/testcases/org/apache/poi/hemf/extractor/HemfExtractorTest.java index 0cc33fdaa2..8d32b21a5e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hemf/extractor/HemfExtractorTest.java +++ b/src/scratchpad/testcases/org/apache/poi/hemf/extractor/HemfExtractorTest.java @@ -135,7 +135,7 @@ public class HemfExtractorTest { long lastX = -1; long fudgeFactorX = 1000;//derive this from the font or frame/bounds information StringBuilder sb = new StringBuilder(); - Set<String> expectedParts = new HashSet<String>(); + Set<String> expectedParts = new HashSet<>(); expectedParts.add("C:\\Users\\tallison\\"); expectedParts.add("testPDF.pdf"); int foundExpected = 0; diff --git a/src/scratchpad/testcases/org/apache/poi/hemf/hemfplus/extractor/HemfPlusExtractorTest.java b/src/scratchpad/testcases/org/apache/poi/hemf/hemfplus/extractor/HemfPlusExtractorTest.java index c42233ab7e..f3bdbf7b4f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hemf/hemfplus/extractor/HemfPlusExtractorTest.java +++ b/src/scratchpad/testcases/org/apache/poi/hemf/hemfplus/extractor/HemfPlusExtractorTest.java @@ -54,7 +54,7 @@ public class HemfPlusExtractorTest { //test that the HemfCommentEMFPlus record at offset 1 //contains 6 HemfCommentEMFPlus records within it - List<HemfPlusRecordType> expected = new ArrayList<HemfPlusRecordType>(); + List<HemfPlusRecordType> expected = new ArrayList<>(); expected.add(HemfPlusRecordType.setPixelOffsetMode); expected.add(HemfPlusRecordType.setAntiAliasMode); expected.add(HemfPlusRecordType.setCompositingQuality); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java b/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java index f6d18a9816..e9d24f4a1e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java @@ -77,8 +77,8 @@ public final class TestReWriteSanity { // Find the location of the PersistPtrIncrementalBlocks and // UserEditAtoms Record[] r = wss.getRecords(); - Map<Integer,Record> pp = new HashMap<Integer,Record>(); - Map<Integer,Object> ue = new HashMap<Integer,Object>(); + Map<Integer,Record> pp = new HashMap<>(); + Map<Integer,Object> ue = new HashMap<>(); ue.put(Integer.valueOf(0),Integer.valueOf(0)); // Will show 0 if first int pos = 0; int lastUEPos = -1; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestHyperlink.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestHyperlink.java index 7aeb42ccf2..e73b5ad8ae 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestHyperlink.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestHyperlink.java @@ -159,7 +159,7 @@ public final class TestHyperlink { } private static List<HSLFHyperlink> findHyperlinks(List<HSLFTextParagraph> paras) { - List<HSLFHyperlink> links = new ArrayList<HSLFHyperlink>(); + List<HSLFHyperlink> links = new ArrayList<>(); for (HSLFTextParagraph p : paras) { for (HSLFTextRun r : p) { HSLFHyperlink hl = r.getHyperlink(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java index c6a17eaa23..ce4ce48fb5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java @@ -291,7 +291,7 @@ public final class TestShapes { private void textBoxSet(String filename) throws IOException { HSLFSlideShow ss = new HSLFSlideShow(_slTests.openResourceAsStream(filename)); for (HSLFSlide sld : ss.getSlides()) { - ArrayList<String> lst1 = new ArrayList<String>(); + ArrayList<String> lst1 = new ArrayList<>(); for (List<HSLFTextParagraph> txt : sld.getTextParagraphs()) { for (HSLFTextParagraph p : txt) { for (HSLFTextRun r : p) { @@ -300,7 +300,7 @@ public final class TestShapes { } } - ArrayList<String> lst2 = new ArrayList<String>(); + ArrayList<String> lst2 = new ArrayList<>(); for (HSLFShape sh : sld.getShapes()) { if (sh instanceof HSLFTextShape){ HSLFTextShape tbox = (HSLFTextShape)sh; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java index 360bbd5d1a..064ede9f82 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java @@ -77,7 +77,7 @@ public final class TestExHyperlink { assertNotNull(exObjList); // Within that, grab out the Hyperlink atoms - List<ExHyperlink> linksA = new ArrayList<ExHyperlink>(); + List<ExHyperlink> linksA = new ArrayList<>(); for (Record ch : exObjList._children) { if(ch instanceof ExHyperlink) { linksA.add((ExHyperlink) ch); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxMasterStyleAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxMasterStyleAtom.java index a2d4da3295..7e7c9f4d37 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxMasterStyleAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxMasterStyleAtom.java @@ -201,7 +201,7 @@ public final class TestTxMasterStyleAtom extends TestCase { * There must be a TxMasterStyleAtom per each type of text defined in TextHeaderAtom */ protected TxMasterStyleAtom[] getMasterStyles(){ - List<TxMasterStyleAtom> lst = new ArrayList<TxMasterStyleAtom>(); + List<TxMasterStyleAtom> lst = new ArrayList<>(); Record[] coreRecs = _ppt.getMostRecentCoreRecords(); for (final Record coreRec : coreRecs) { diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 4e9c3b012d..1efd586cf0 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -150,7 +150,7 @@ public final class TestBugs { HSLFSlideShow ppt = open("42474-2.ppt"); //map slide number and starting phrase of its notes - Map<Integer, String> notesMap = new HashMap<Integer, String>(); + Map<Integer, String> notesMap = new HashMap<>(); notesMap.put(Integer.valueOf(4), "For decades before calculators"); notesMap.put(Integer.valueOf(5), "Several commercial applications"); notesMap.put(Integer.valueOf(6), "There are three variations of LNS that are discussed here"); @@ -308,7 +308,7 @@ public final class TestBugs { List<List<HSLFTextParagraph>> paras = slide.get(0).getTextParagraphs(); assertEquals(4, paras.size()); - Set<String> expected = new HashSet<String>(); + Set<String> expected = new HashSet<>(); expected.add("\u201CHAPPY BIRTHDAY SCOTT\u201D"); expected.add("Have a HAPPY DAY"); expected.add("PS Nobody is allowed to hassle Scott TODAY\u2026"); @@ -344,7 +344,7 @@ public final class TestBugs { assertEquals("Second run", HSLFTextParagraph.getRawText(slTr.get(2))); // Check the shape based text runs - List<HSLFTextParagraph> lst = new ArrayList<HSLFTextParagraph>(); + List<HSLFTextParagraph> lst = new ArrayList<>(); for (HSLFShape shape : slide.getShapes()) { if (shape instanceof HSLFTextShape){ List<HSLFTextParagraph> textRun = ((HSLFTextShape)shape).getTextParagraphs(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java index 1e5147eb9e..99c40c3f79 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java @@ -67,8 +67,8 @@ public class TestFontRendering { // setup fonts (especially needed, when run under *nix systems) GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); - Map<String,String> fontMap = new HashMap<String,String>(); - Map<String,String> fallbackMap = new HashMap<String,String>(); + Map<String,String> fontMap = new HashMap<>(); + Map<String,String> fallbackMap = new HashMap<>(); for (String fontFile[] : fontFiles) { File f = new File(fontFile[0]); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextShape.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextShape.java index 1cfe61379e..8499ed7b48 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextShape.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextShape.java @@ -74,7 +74,7 @@ public final class TestTextShape { public void read() throws IOException { HSLFSlideShow ppt = HSLFTestDataSamples.getSlideShow("text_shapes.ppt"); - List<String> lst1 = new ArrayList<String>(); + List<String> lst1 = new ArrayList<>(); HSLFSlide slide = ppt.getSlides().get(0); for (HSLFShape shape : slide.getShapes()) { assertTrue("Expected TextShape but found " + shape.getClass().getName(), shape instanceof HSLFTextShape); @@ -112,7 +112,7 @@ public final class TestTextShape { lst1.add(rawText); } - List<String> lst2 = new ArrayList<String>(); + List<String> lst2 = new ArrayList<>(); for (List<HSLFTextParagraph> paras : slide.getTextParagraphs()) { lst2.add(HSLFTextParagraph.getRawText(paras)); } @@ -163,7 +163,7 @@ public final class TestTextShape { HSLFSlide slide = ppt.getSlides().get(0); - Map<String,HSLFTextShape> map = new HashMap<String,HSLFTextShape>(); + Map<String,HSLFTextShape> map = new HashMap<>(); for (HSLFShape shape : slide.getShapes()) { if(shape instanceof HSLFTextShape){ HSLFTextShape tx = (HSLFTextShape)shape; diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestFixedSizedProperties.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestFixedSizedProperties.java index ecedca384a..40266c3272 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestFixedSizedProperties.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestFixedSizedProperties.java @@ -114,8 +114,8 @@ public final class TestFixedSizedProperties { // Ask to have the values looked up Map<MAPIProperty,List<PropertyValue>> props = mainChunks.getProperties(); - HashSet<Class<? extends PropertyValue>> seenTypes = - new HashSet<Class<? extends PropertyValue>>(); + HashSet<Class<? extends PropertyValue>> seenTypes = + new HashSet<>(); for (List<PropertyValue> pvs : props.values()) { for (PropertyValue pv : pvs) { seenTypes.add(pv.getClass()); diff --git a/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java b/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java index 799a44c079..a398e8e024 100644 --- a/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java +++ b/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java @@ -50,7 +50,7 @@ public class TestExcelConverterSuite @Parameterized.Parameters(name="{index}: {0}") public static Iterable<Object[]> files() { - List<Object[]> files = new ArrayList<Object[]>(); + List<Object[]> files = new ArrayList<>(); File directory = POIDataSamples.getDocumentInstance().getFile( "../spreadsheet" ); for ( final File child : directory.listFiles( new FilenameFilter() diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java index 5a3bc6e385..3525ba78b3 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java @@ -52,7 +52,7 @@ public class TestWordToConverterSuite @Parameterized.Parameters(name="{index}: {0}") public static Iterable<Object[]> files() { - List<Object[]> files = new ArrayList<Object[]>(); + List<Object[]> files = new ArrayList<>(); File directory = POIDataSamples.getDocumentInstance().getFile( "../document" ); for ( final File child : directory.listFiles( new FilenameFilter() diff --git a/src/testcases/org/apache/poi/POITestCase.java b/src/testcases/org/apache/poi/POITestCase.java index 88c6eb69ee..4aec492a4c 100644 --- a/src/testcases/org/apache/poi/POITestCase.java +++ b/src/testcases/org/apache/poi/POITestCase.java @@ -176,7 +176,7 @@ public final class POITestCase { @Override @SuppressForbidden("Test only") public List<Field> run() throws Exception { - List<Field> flds = new ArrayList<Field>(); + List<Field> flds = new ArrayList<>(); for (Class<?> c = expected.getClass(); c != null; c = c.getSuperclass()) { Field[] fs = c.getDeclaredFields(); AccessibleObject.setAccessible(fs, true); diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java b/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java index ce3cf6d34d..ad42ee0534 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestReadAllFiles.java @@ -60,7 +60,7 @@ public class TestReadAllFiles { @Parameters(name="{index}: {0} using {1}") public static Iterable<Object[]> files() { - final List<Object[]> files = new ArrayList<Object[]>(); + final List<Object[]> files = new ArrayList<>(); _samples.getFile("").listFiles(new FileFilter() { @Override @@ -112,7 +112,7 @@ public class TestReadAllFiles { @Test public void recreate() throws IOException, HPSFException { /* Read the POI filesystem's property set streams: */ - Map<String,PropertySet> psMap = new HashMap<String,PropertySet>(); + Map<String,PropertySet> psMap = new HashMap<>(); /* Create a new POI filesystem containing the origin file's * property set streams: */ diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java index 911a27b699..278ac9421d 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java @@ -480,7 +480,7 @@ public class TestWrite { final POIFSFileSystem poiFs = new POIFSFileSystem(); final PropertySet ps1 = new PropertySet(); final Section s = ps1.getSections().get(0); - final Map<Long,String> m = new HashMap<Long,String>(3, 1.0f); + final Map<Long,String> m = new HashMap<>(3, 1.0f); m.put(Long.valueOf(1), "String 1"); m.put(Long.valueOf(2), "String 2"); m.put(Long.valueOf(3), "String 3"); @@ -744,7 +744,7 @@ public class TestWrite { final POIFSFileSystem poiFs = new POIFSFileSystem(); final PropertySet ps1 = new PropertySet(); final Section s = ps1.getSections().get(0); - final Map<Long,String> m = new HashMap<Long, String>(3, 1.0f); + final Map<Long,String> m = new HashMap<>(3, 1.0f); m.put(Long.valueOf(1), "String 1"); m.put(Long.valueOf(2), "String 2"); m.put(Long.valueOf(3), "String 3"); diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java index 46cf64b51c..af4674e4d1 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java @@ -550,7 +550,7 @@ public class TestWriteWellKnown { final int ID_2 = 3; final String NAME_1 = "Schl\u00fcssel \u00e4"; final String VALUE_1 = "Wert 1"; - final Map<Long,String> dictionary = new HashMap<Long, String>(); + final Map<Long,String> dictionary = new HashMap<>(); DocumentSummaryInformation dsi = PropertySetFactory.newDocumentSummaryInformation(); CustomProperties cps; diff --git a/src/testcases/org/apache/poi/hpsf/basic/Util.java b/src/testcases/org/apache/poi/hpsf/basic/Util.java index cc489d8533..daa58d789d 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/Util.java +++ b/src/testcases/org/apache/poi/hpsf/basic/Util.java @@ -60,7 +60,7 @@ final class Util { */ public static List<POIFile> readPOIFiles(final File poiFs, final String... poiFiles) throws FileNotFoundException, IOException { - final List<POIFile> files = new ArrayList<POIFile>(); + final List<POIFile> files = new ArrayList<>(); POIFSReader r = new POIFSReader(); POIFSReaderListener pfl = new POIFSReaderListener() { @Override @@ -116,7 +116,7 @@ final class Util { * @exception IOException if an I/O exception occurs */ public static List<POIFile> readPropertySets(final File poiFs) throws IOException { - final List<POIFile> files = new ArrayList<POIFile>(7); + final List<POIFile> files = new ArrayList<>(7); final POIFSReader r = new POIFSReader(); POIFSReaderListener pfl = new POIFSReaderListener() { @Override diff --git a/src/testcases/org/apache/poi/hssf/dev/BaseXLSIteratingTest.java b/src/testcases/org/apache/poi/hssf/dev/BaseXLSIteratingTest.java index e69c700dea..d740a8a37e 100644 --- a/src/testcases/org/apache/poi/hssf/dev/BaseXLSIteratingTest.java +++ b/src/testcases/org/apache/poi/hssf/dev/BaseXLSIteratingTest.java @@ -54,7 +54,7 @@ public abstract class BaseXLSIteratingTest { public ExpectedException thrown = ExpectedException.none(); protected static final Map<String,Class<? extends Throwable>> EXCLUDED = - new HashMap<String,Class<? extends Throwable>>(); + new HashMap<>(); @Parameters(name="{index}: {0}") public static Iterable<Object[]> files() { @@ -63,7 +63,7 @@ public abstract class BaseXLSIteratingTest { dataDirName = "test-data"; } - List<Object[]> files = new ArrayList<Object[]>(); + List<Object[]> files = new ArrayList<>(); findFile(files, dataDirName + "/spreadsheet"); findFile(files, dataDirName + "/hpsf"); diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java index 609640c6dd..296eff6458 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java @@ -150,8 +150,8 @@ public final class TestEventWorkbookBuilder extends TestCase { private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} - private final List<Record> _records = new ArrayList<Record>(); - private final List<Record> _frecs = new ArrayList<Record>(); + private final List<Record> _records = new ArrayList<>(); + private final List<Record> _frecs = new ArrayList<>(); @Override public void processRecord(Record record) { diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java index e617735b6a..89efb527f5 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java @@ -106,7 +106,7 @@ public final class TestFormatTrackingHSSFListener { private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} - private final List<Record> _records = new ArrayList<Record>(); + private final List<Record> _records = new ArrayList<>(); @Override public void processRecord(Record record) { diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java index 040b83cfb0..e57118b835 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java @@ -121,7 +121,7 @@ public final class TestHSSFEventFactory extends TestCase { } private static class MockHSSFListener implements HSSFListener { - private final List<Record> records = new ArrayList<Record>(); + private final List<Record> records = new ArrayList<>(); public MockHSSFListener() {} public Record[] getRecords() { diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java index 0867720f79..5387723b81 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java @@ -364,7 +364,7 @@ public final class TestMissingRecordAwareHSSFListener extends TestCase { private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} - private final List<Record> _records = new ArrayList<Record>(); + private final List<Record> _records = new ArrayList<>(); private final boolean logToStdOut = false; @Override diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java index ddeacd6fb8..f051529b75 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java +++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java @@ -102,7 +102,7 @@ public class TestDrawingAggregate { } } if(info != null){ - info.aggRecords = new ArrayList<RecordBase>( + info.aggRecords = new ArrayList<>( records.subList(info.startRecordIndex, info.endRecordIndex + 1)); } return info; @@ -134,7 +134,7 @@ public class TestDrawingAggregate { */ private static void assertWriteAndReadBack(HSSFWorkbook wb) throws IOException { // map aggregate info by sheet index - Map<Integer, DrawingAggregateInfo> aggs = new HashMap<Integer, DrawingAggregateInfo>(); + Map<Integer, DrawingAggregateInfo> aggs = new HashMap<>(); for(int i = 0; i < wb.getNumberOfSheets(); i++){ HSSFSheet sheet = wb.getSheetAt(i); DrawingAggregateInfo info = DrawingAggregateInfo.get(sheet); @@ -223,7 +223,7 @@ public class TestDrawingAggregate { "+2eqbvLdxQ0ndhy5KJ/lc1ZZK9okY5X/gSbrHZTH1vE/ozagTcwAAAA="; byte[] dgBytes = decompress(data); - List<EscherRecord> records = new ArrayList<EscherRecord>(); + List<EscherRecord> records = new ArrayList<>(); EscherRecordFactory recordFactory = new DefaultEscherRecordFactory(); int pos = 0; while (pos < dgBytes.length) { diff --git a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java index d34de10923..fbd562b444 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java +++ b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java @@ -175,7 +175,7 @@ public final class TestLinkTable extends TestCase { }; final List<Record> recList = Arrays.asList(recs); final WorkbookRecordList wrl = new WorkbookRecordList(); - final Map<String, NameCommentRecord> commentRecords = new LinkedHashMap<String, NameCommentRecord>(); + final Map<String, NameCommentRecord> commentRecords = new LinkedHashMap<>(); final LinkTable lt = new LinkTable(recList, 0, wrl, commentRecords); assertNotNull(lt); diff --git a/src/testcases/org/apache/poi/hssf/model/TestRVA.java b/src/testcases/org/apache/poi/hssf/model/TestRVA.java index ec090bd537..cf5fc4ab36 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestRVA.java +++ b/src/testcases/org/apache/poi/hssf/model/TestRVA.java @@ -72,7 +72,7 @@ public final class TestRVA { workbook = new HSSFWorkbook(poifs); sheet = workbook.getSheetAt(0); - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); for (int rowIdx = 0; true; rowIdx++) { HSSFRow row = sheet.getRow(rowIdx); diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheet.java b/src/testcases/org/apache/poi/hssf/model/TestSheet.java index cbd1200eed..e8e2db0823 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestSheet.java +++ b/src/testcases/org/apache/poi/hssf/model/TestSheet.java @@ -87,7 +87,7 @@ public final class TestSheet { @Test public void testCreateSheet() { // Check we're adding row and cell aggregates - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); records.add( new DimensionsRecord() ); records.add(createWindow2Record()); @@ -205,7 +205,7 @@ public final class TestSheet { */ @Test public void testMovingMergedRegion() { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); CellRangeAddress[] cras = { new CellRangeAddress(0, 1, 0, 2), @@ -244,7 +244,7 @@ public final class TestSheet { */ @Test public void testRowAggregation() { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add(InternalSheet.createBOF()); records.add(new DimensionsRecord()); @@ -479,7 +479,7 @@ public final class TestSheet { @Test public void testUncalcSize_bug45066() { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); records.add(new UncalcedRecord()); records.add(new DimensionsRecord()); @@ -640,7 +640,7 @@ public final class TestSheet { nr.setColumn((short) colIx); nr.setValue(3.0); - List<Record> inRecs = new ArrayList<Record>(); + List<Record> inRecs = new ArrayList<>(); inRecs.add(BOFRecord.createSheetBOF()); inRecs.add(new RowRecord(rowIx)); inRecs.add(nr); @@ -777,7 +777,7 @@ public final class TestSheet { r2.setStr(new HSSFRichTextString("Aggregated")); NoteRecord n2 = new NoteRecord(); - List<Record> recordStream = new ArrayList<Record>(); + List<Record> recordStream = new ArrayList<>(); recordStream.add(InternalSheet.createBOF()); recordStream.add( d1 ); recordStream.add( r1 ); @@ -787,7 +787,7 @@ public final class TestSheet { confirmAggregatedRecords(recordStream); - recordStream = new ArrayList<Record>(); + recordStream = new ArrayList<>(); recordStream.add(InternalSheet.createBOF()); recordStream.add( d1 ); recordStream.add( r1 ); @@ -798,7 +798,7 @@ public final class TestSheet { confirmAggregatedRecords(recordStream); - recordStream = new ArrayList<Record>(); + recordStream = new ArrayList<>(); recordStream.add(InternalSheet.createBOF()); recordStream.add( d1 ); recordStream.add( r1 ); diff --git a/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java b/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java index d50ae9e73a..b231e36781 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java @@ -88,7 +88,7 @@ public final class TestBoundSheetRecord extends TestCase { bs2.setPositionOfBof(33); bs3.setPositionOfBof(22); - List<BoundSheetRecord> l = new ArrayList<BoundSheetRecord>(); + List<BoundSheetRecord> l = new ArrayList<>(); l.add(bs1); l.add(bs2); l.add(bs3); diff --git a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java index 0df5d44f40..0e9a0ba297 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java @@ -70,7 +70,7 @@ public final class TestEscherAggregate extends TestCase { ObjRecord r2 = new ObjRecord(); - List<RecordBase> records = new ArrayList<RecordBase>(); + List<RecordBase> records = new ArrayList<>(); records.add( d1 ); records.add( r1 ); records.add( d2 ); diff --git a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java index d7d05ab459..fdc2fd779e 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java @@ -65,7 +65,7 @@ public final class TestMergeCellsRecord extends TestCase { }; public void testMCTable_bug46009() { MergedCellsTable mct = new MergedCellsTable(); - List<Record> recList = new ArrayList<Record>(); + List<Record> recList = new ArrayList<>(); CellRangeAddress[] cras = new CellRangeAddress[] { new CellRangeAddress(0, 0, 0, 3), }; diff --git a/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java b/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java index c7797115a4..17a5a8852f 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java @@ -59,7 +59,7 @@ public final class TestSSTDeserializer { RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); - IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>(); + IntMapper<UnicodeString> strings = new IntMapper<>(); SSTDeserializer deserializer = new SSTDeserializer( strings ); deserializer.manufactureStrings(1, in ); @@ -72,7 +72,7 @@ public final class TestSSTDeserializer { byte[] continueBytes = readSampleHexData("evencontinuation.txt", "continue1", ContinueRecord.sid); RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); - IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>(); + IntMapper<UnicodeString> strings = new IntMapper<>(); SSTDeserializer deserializer = new SSTDeserializer( strings ); deserializer.manufactureStrings( 2, in); @@ -91,7 +91,7 @@ public final class TestSSTDeserializer { RecordInputStream in = TestcaseRecordInputStream.create(concat(header, concat(continue1, continue2))); - IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>(); + IntMapper<UnicodeString> strings = new IntMapper<>(); SSTDeserializer deserializer = new SSTDeserializer( strings ); deserializer.manufactureStrings( 2, in); @@ -105,7 +105,7 @@ public final class TestSSTDeserializer { byte[] continueBytes = readSampleHexData("extendedtextstrings.txt", "rich-continue1", ContinueRecord.sid); RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); - IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>(); + IntMapper<UnicodeString> strings = new IntMapper<>(); SSTDeserializer deserializer = new SSTDeserializer( strings ); deserializer.manufactureStrings( 1, in); @@ -116,7 +116,7 @@ public final class TestSSTDeserializer { continueBytes = readSampleHexData("extendedtextstrings.txt", "norich-continue1", ContinueRecord.sid); in = TestcaseRecordInputStream.create(concat(header, continueBytes)); - strings = new IntMapper<UnicodeString>(); + strings = new IntMapper<>(); deserializer = new SSTDeserializer( strings ); deserializer.manufactureStrings( 1, in); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java b/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java index 80380ac5e2..e2b2652a43 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java @@ -33,7 +33,7 @@ public final class TestSSTRecordSizeCalculator extends TestCase { private static final int COMPRESSED_PLAIN_STRING_OVERHEAD = 3; private static final int OPTION_FIELD_SIZE = 1; - private final IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>(); + private final IntMapper<UnicodeString> strings = new IntMapper<>(); private void confirmSize(int expectedSize) { ContinuableRecordOutput cro = ContinuableRecordOutput.createForCountingOnly(); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java index ee04ed01a1..26455497b0 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java @@ -49,7 +49,7 @@ public final class TestCFRecordsAggregate extends TestCase { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); - List<Record> recs = new ArrayList<Record>(); + List<Record> recs = new ArrayList<>(); CFHeaderBase header = new CFHeaderRecord(); CFRuleBase rule1 = CFRuleRecord.create(sheet, "7"); CFRuleBase rule2 = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "2", "5"); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java index 28299b8cad..b4e696fe30 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java @@ -64,7 +64,7 @@ public final class TestColumnInfoRecordsAggregate { private static final class CIRCollector implements RecordVisitor { - private final List<Record> _list = new ArrayList<Record>(); + private final List<Record> _list = new ArrayList<>(); @Override public void visitRecord(Record r) { diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java index be9e6a9017..e63e8167bb 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java @@ -52,7 +52,7 @@ public final class TestValueRecordsAggregate { private final ValueRecordsAggregate valueRecord = new ValueRecordsAggregate(); private List<CellValueRecordInterface> getValueRecords() { - List<CellValueRecordInterface> list = new ArrayList<CellValueRecordInterface>(); + List<CellValueRecordInterface> list = new ArrayList<>(); for ( CellValueRecordInterface rec : valueRecord ) { list.add(rec); } @@ -65,7 +65,7 @@ public final class TestValueRecordsAggregate { */ @Test public void testSharedFormula() { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add(new FormulaRecord()); records.add(new SharedFormulaRecord()); records.add(new WindowTwoRecord()); @@ -91,7 +91,7 @@ public final class TestValueRecordsAggregate { } private static List<Record> testData() { - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); FormulaRecord formulaRecord = new FormulaRecord(); BlankRecord blankRecord = new BlankRecord(); formulaRecord.setRow(1); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java index d65c37e702..53d03f4b8b 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java @@ -67,7 +67,7 @@ public final class TestChartTitleFormatRecord { private final List<ChartTitleFormatRecord> chartTitleFormatRecords; public ChartTitleFormatRecordGrabber() { - chartTitleFormatRecords = new ArrayList<ChartTitleFormatRecord>(); + chartTitleFormatRecords = new ArrayList<>(); } @Override diff --git a/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java b/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java index 1784d95aa6..2a49b7d250 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java @@ -39,7 +39,7 @@ public final class RecordInspector { private final List<Record> _list; public RecordCollector() { - _list = new ArrayList<Record>(128); + _list = new ArrayList<>(128); } @Override diff --git a/src/testcases/org/apache/poi/hssf/usermodel/StreamUtility.java b/src/testcases/org/apache/poi/hssf/usermodel/StreamUtility.java index 06aa0b84b8..d467333ffc 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/StreamUtility.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/StreamUtility.java @@ -82,7 +82,7 @@ public final class StreamUtility { private static int[] diffInternal(InputStream isA, InputStream isB, int[] allowableDifferenceRegions) throws IOException { int offset = 0; - List<Integer> temp = new ArrayList<Integer>(); + List<Integer> temp = new ArrayList<>(); while (true) { int b = isA.read(); int b2 = isB.read(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index f249fadf40..244bad98bd 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -2055,7 +2055,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { "Good", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Input", "Linked Cell", "Neutral", "Note", "Output", "Title", "Total", "Warning Text"); - List<String> collecteddStyles = new ArrayList<String>(); + List<String> collecteddStyles = new ArrayList<>(); for (int i = 0; i < numCellStyles; i++) { HSSFCellStyle cellStyle = wb.getCellStyleAt(i); String styleName = cellStyle.getUserStyleName(); @@ -2492,7 +2492,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { @Test public void bug51675() throws Exception { - final List<Short> list = new ArrayList<Short>(); + final List<Short> list = new ArrayList<>(); HSSFWorkbook wb = openSample("51675.xls"); HSSFSheet sh = wb.getSheetAt(0); InternalSheet ish = HSSFTestHelper.getSheetForTest(sh); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java index 55e1d77db6..fdcd8b21a8 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java @@ -225,7 +225,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook { } private static List<Integer> arrayToList(int[] array) { - List<Integer> list = new ArrayList<Integer>(array.length); + List<Integer> list = new ArrayList<>(array.length); for ( Integer element : array ) { list.add(element); } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java index c656248dcf..c8b10d1b39 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java @@ -47,7 +47,7 @@ public final class TestSanityChecker { @Test public void testCheckRecordOrder() { final SanityChecker c = new SanityChecker(); - List<Record> records = new ArrayList<Record>(); + List<Record> records = new ArrayList<>(); records.add(new BOFRecord()); records.add(INTERFACEHDR); records.add(createBoundSheetRec()); diff --git a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java index 7a0e3d6d0c..d920d2ce8c 100644 --- a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java +++ b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java @@ -103,7 +103,7 @@ public final class TestPOIFSReaderRegistry extends TestCase { else { Set<POIFSReaderListener> registeredListeners = - new HashSet<POIFSReaderListener>(); + new HashSet<>(); while (listeners.hasNext()) { @@ -135,7 +135,7 @@ public final class TestPOIFSReaderRegistry extends TestCase { Iterator<POIFSReaderListener> listeners = registry.getListeners(path, name); Set<POIFSReaderListener> registeredListeners = - new HashSet<POIFSReaderListener>(); + new HashSet<>(); while (listeners.hasNext()) { diff --git a/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java b/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java index 2aae3729dc..54257598bf 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java @@ -58,7 +58,7 @@ public class ReaderWriter { this.filesystem = filesystem; root = this.filesystem.getRoot(); - dataMap = new HashMap<DocumentDescriptor, byte[]>(); + dataMap = new HashMap<>(); } /** diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java index da3e383925..502c1fa62e 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java @@ -85,7 +85,7 @@ public class TestEntryUtils { fsD = new POIFSFileSystem(); assertEquals(0, fsD.getRoot().getEntryCount()); - EntryUtils.copyNodes(fs, fsD, new ArrayList<String>()); + EntryUtils.copyNodes(fs, fsD, new ArrayList<>()); assertEquals(3, fsD.getRoot().getEntryCount()); assertNotNull(fsD.getRoot().getEntry(dirA.getName())); assertNotNull(fsD.getRoot().getEntry(dirB.getName())); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java index 2bdcb0052c..6b859d9380 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java @@ -65,7 +65,7 @@ public final class TestFileSystemBugs extends TestCase { } protected DirectoryNode[] openSamples(InputStream[] inps, boolean oldFails) throws Exception { NPOIFSFileSystem nfs = new NPOIFSFileSystem(inps[0]); - if (openedFSs == null) openedFSs = new ArrayList<NPOIFSFileSystem>(); + if (openedFSs == null) openedFSs = new ArrayList<>(); openedFSs.add(nfs); OPOIFSFileSystem ofs = null; @@ -131,7 +131,7 @@ public final class TestFileSystemBugs extends TestCase { public void testHeavilyNestedReWrite() throws Exception { for (DirectoryNode root : openSSSample("ex42570-20305.xls", false)) { // Record the structure - Map<String,Integer> entries = new HashMap<String, Integer>(); + Map<String,Integer> entries = new HashMap<>(); fetchSizes("/", root, entries); // Prepare to copy diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java index bef0281f23..0bf0e54ee5 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java @@ -51,7 +51,7 @@ public final class TestFilteringDirectoryNode extends TestCase { } public void testNoFiltering() throws Exception { - FilteringDirectoryNode d = new FilteringDirectoryNode(fs.getRoot(), new HashSet<String>()); + FilteringDirectoryNode d = new FilteringDirectoryNode(fs.getRoot(), new HashSet<>()); assertEquals(3, d.getEntryCount()); assertEquals(dirA.getName(), d.getEntry(dirA.getName()).getName()); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java b/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java index d63061c389..9bde78ee82 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java @@ -64,7 +64,7 @@ public class TestOle10Native { for (File f : files) { NPOIFSFileSystem fs = new NPOIFSFileSystem(f, true); - List<Entry> entries = new ArrayList<Entry>(); + List<Entry> entries = new ArrayList<>(); findOle10(entries, fs.getRoot(), "/", ""); for (Entry e : entries) { diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java index 09388c233e..fd2c3d3b74 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java @@ -123,7 +123,7 @@ public final class TestPropertySorter extends TestCase { DirectoryNode vba = (DirectoryNode)vba_project.getEntry(VBA); DirectoryProperty p = (DirectoryProperty)vba.getProperty(); - List<Property> lst = new ArrayList<Property>(); + List<Property> lst = new ArrayList<>(); for (Iterator<Property> it = p.getChildren(); it.hasNext();){ Property ch = it.next(); lst.add(ch); diff --git a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java index 12e2f16f02..71a210b8d7 100644 --- a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java +++ b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java @@ -64,7 +64,7 @@ public class TestVBAMacroReader { } static { - final Map<POIDataSamples, String> _expectedMacroContents = new HashMap<POIDataSamples, String>(); + final Map<POIDataSamples, String> _expectedMacroContents = new HashMap<>(); final POIDataSamples[] dataSamples = { POIDataSamples.getSpreadSheetInstance(), POIDataSamples.getSlideShowInstance(), diff --git a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java index 8db101c25d..2d94aba13a 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java +++ b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java @@ -102,7 +102,7 @@ public final class TestDirectoryProperty { private void verifyChildren(int count) { Iterator<Property> iter = _property.getChildren(); - List<Property> children = new ArrayList<Property>(); + List<Property> children = new ArrayList<>(); while (iter.hasNext()) { diff --git a/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java b/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java index 7358f00249..ae9969a398 100644 --- a/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java +++ b/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java @@ -39,7 +39,7 @@ public final class LocalRawDataBlockList extends RawDataBlockList { throws IOException { super(new ByteArrayInputStream(new byte[ 0 ]), POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS); - _list = new ArrayList<RawDataBlock>(); + _list = new ArrayList<>(); _array = null; } diff --git a/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java index 5ee5309264..025425e0b2 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java @@ -337,7 +337,7 @@ public final class TestBATBlock extends TestCase { public void testGetBATBlockAndIndex() throws Exception { HeaderBlock header = new HeaderBlock(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS); - List<BATBlock> blocks = new ArrayList<BATBlock>(); + List<BATBlock> blocks = new ArrayList<>(); int offset; diff --git a/src/testcases/org/apache/poi/poifs/storage/TestBlockListImpl.java b/src/testcases/org/apache/poi/poifs/storage/TestBlockListImpl.java index 344b514853..6666fc8b23 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestBlockListImpl.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestBlockListImpl.java @@ -174,7 +174,7 @@ public final class TestBlockListImpl { // that includes a reserved (XBAT) block, and one that // points off into space somewhere BlockListImpl list = create(); - List<RawDataBlock> raw_blocks = new ArrayList<RawDataBlock>(); + List<RawDataBlock> raw_blocks = new ArrayList<>(); byte[] data = new byte[ 512 ]; int offset = 0; diff --git a/src/testcases/org/apache/poi/poifs/storage/TestPropertyBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestPropertyBlock.java index e4af23a99a..cc9d27cb60 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestPropertyBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestPropertyBlock.java @@ -37,7 +37,7 @@ public final class TestPropertyBlock { public void testCreatePropertyBlocks() throws Exception { // test with 0 properties - List<Property> properties = new ArrayList<Property>(); + List<Property> properties = new ArrayList<>(); BlockWritable[] blocks = PropertyBlock.createPropertyBlockArray(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS,properties); diff --git a/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java b/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java index 9bb4f6a166..dc96174a58 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestSmallBlockTableWriter.java @@ -37,7 +37,7 @@ import org.apache.poi.poifs.property.RootProperty; public final class TestSmallBlockTableWriter extends TestCase { public void testWritingConstructor() throws IOException { - List<OPOIFSDocument> documents = new ArrayList<OPOIFSDocument>(); + List<OPOIFSDocument> documents = new ArrayList<>(); documents.add( new OPOIFSDocument( diff --git a/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java index 2d6ef1845c..c637e79706 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java @@ -52,7 +52,7 @@ public final class TestSmallDocumentBlock extends TestCase { throws IOException { ByteArrayInputStream stream = new ByteArrayInputStream(_testdata); - List<DocumentBlock> documents = new ArrayList<DocumentBlock>(); + List<DocumentBlock> documents = new ArrayList<>(); while (true) { @@ -138,7 +138,7 @@ public final class TestSmallDocumentBlock extends TestCase { { for (int j = 0; j <= 8; j++) { - List<SmallDocumentBlock> blocks = new ArrayList<SmallDocumentBlock>(); + List<SmallDocumentBlock> blocks = new ArrayList<>(); for (int k = 0; k < j; k++) { diff --git a/src/testcases/org/apache/poi/ss/format/CellFormatTestBase.java b/src/testcases/org/apache/poi/ss/format/CellFormatTestBase.java index 1e7ea393aa..df20a3c8e7 100644 --- a/src/testcases/org/apache/poi/ss/format/CellFormatTestBase.java +++ b/src/testcases/org/apache/poi/ss/format/CellFormatTestBase.java @@ -103,7 +103,7 @@ public class CellFormatTestBase { readFlags(workbook); - Set<String> runCategories = new TreeSet<String>( + Set<String> runCategories = new TreeSet<>( String.CASE_INSENSITIVE_ORDER); String runCategoryList = flagString("Categories", ""); if (runCategoryList != null) { @@ -155,7 +155,7 @@ public class CellFormatTestBase { */ private void readFlags(Workbook wb) { Sheet flagSheet = wb.getSheet("Flags"); - testFlags = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); + testFlags = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); if (flagSheet != null) { int end = flagSheet.getLastRowNum(); // Skip the header row, therefore "+ 1" diff --git a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java index 4641c4fdc3..923392a30c 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java +++ b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java @@ -96,9 +96,9 @@ public class TestEvaluationCache extends TestCase { public EvalListener(HSSFWorkbook wb) { _book = wb; - _logList = new ArrayList<String>(); - _formulaCellsByCacheEntry = new HashMap<ICacheEntry,EvaluationCell>(); - _plainCellLocsByCacheEntry = new HashMap<ICacheEntry, Loc>(); + _logList = new ArrayList<>(); + _formulaCellsByCacheEntry = new HashMap<>(); + _plainCellLocsByCacheEntry = new HashMap<>(); } @Override public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) { diff --git a/src/testcases/org/apache/poi/ss/formula/TestMissingWorkbook.java b/src/testcases/org/apache/poi/ss/formula/TestMissingWorkbook.java index 3e467b2bef..b9f09a1318 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestMissingWorkbook.java +++ b/src/testcases/org/apache/poi/ss/formula/TestMissingWorkbook.java @@ -117,7 +117,7 @@ public class TestMissingWorkbook extends TestCase { FormulaEvaluator lMainWorkbookEvaluator = mainWorkbook.getCreationHelper().createFormulaEvaluator(); FormulaEvaluator lSourceEvaluator = sourceWorkbook.getCreationHelper().createFormulaEvaluator(); - Map<String,FormulaEvaluator> workbooks = new HashMap<String, FormulaEvaluator>(); + Map<String,FormulaEvaluator> workbooks = new HashMap<>(); workbooks.put(MAIN_WORKBOOK_FILENAME, lMainWorkbookEvaluator); workbooks.put(SOURCE_DUMMY_WORKBOOK_FILENAME, lSourceEvaluator); lMainWorkbookEvaluator.setupReferencedWorkbooks(workbooks); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java b/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java index f92204d872..678b766fe8 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java @@ -88,7 +88,7 @@ public class TestNetworkdaysFunction extends TestCase { public MockAreaEval(String... holidays) { this(0, 0, 0, holidays.length - 1); - this.holidays = new ArrayList<ValueEval>(); + this.holidays = new ArrayList<>(); for (String holiday : holidays) { this.holidays.add(new StringEval(holiday)); } diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java index bbd6e56aad..365d1352cc 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java @@ -177,7 +177,7 @@ public class TestWorkdayFunction { public MockAreaEval(String... holidays) { this(0, 0, 0, holidays.length - 1); - this.holidays = new ArrayList<ValueEval>(); + this.holidays = new ArrayList<>(); for (String holiday : holidays) { this.holidays.add(new StringEval(holiday)); } diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java index 87b1fed4a4..99f1b8a56e 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java @@ -124,7 +124,7 @@ public final class TestFormulasFromSpreadsheet { sheet = workbook.getSheetAt( 0 ); evaluator = new HSSFFormulaEvaluator(workbook); - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); processFunctionGroup(data, SS.START_OPERATORS_ROW_INDEX, null); processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null); diff --git a/src/testcases/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java b/src/testcases/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java index 2dab84ca7e..8da0aded7e 100644 --- a/src/testcases/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java +++ b/src/testcases/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java @@ -159,10 +159,10 @@ public final class ExcelFileFormatDocFunctionExtractor { public FunctionDataCollector(PrintStream ps) { _ps = ps; - _allFunctionsByIndex = new HashMap<Integer, FunctionData>(); - _allFunctionsByName = new HashMap<String, FunctionData>(); - _groupFunctionIndexes = new HashSet<Integer>(); - _groupFunctionNames = new HashSet<String>(); + _allFunctionsByIndex = new HashMap<>(); + _allFunctionsByName = new HashMap<>(); + _groupFunctionIndexes = new HashSet<>(); + _groupFunctionNames = new HashSet<>(); } public void addFuntion(int funcIx, boolean hasFootnote, String funcName, int minParams, int maxParams, @@ -265,11 +265,11 @@ public final class ExcelFileFormatDocFunctionExtractor { public EFFDocHandler(FunctionDataCollector fdc) { _fdc = fdc; - _elemNameStack = new Stack<String>(); + _elemNameStack = new Stack<>(); _isInsideTable = false; - _rowData = new ArrayList<String>(); + _rowData = new ArrayList<>(); _textNodeBuffer = new StringBuffer(); - _rowNoteFlags = new ArrayList<Boolean>(); + _rowNoteFlags = new ArrayList<>(); } private boolean matchesTargetPath() { diff --git a/src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java b/src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java index 2d589217ed..72ab0b67db 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java @@ -87,7 +87,7 @@ public abstract class BaseTestFunctionsFromSpreadsheet { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook(filename); confirmReadMeSheet(workbook, clazz); - List<Object[]> data = new ArrayList<Object[]>(); + List<Object[]> data = new ArrayList<>(); int nSheets = workbook.getNumberOfSheets(); for(int sheetIdx=1; sheetIdx< nSheets; sheetIdx++) { diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java index 914d2b97fd..5cad19f4d8 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java @@ -936,7 +936,7 @@ public abstract class BaseTestBugzillaIssues { Workbook wb3 = _testDataProvider.createWorkbook(); wb3.createSheet().createRow(1).createCell(0).setCellValue(otherCellText); - Map<String,FormulaEvaluator> evaluators = new HashMap<String, FormulaEvaluator>(); + Map<String,FormulaEvaluator> evaluators = new HashMap<>(); evaluators.put(refLocal, wb3.getCreationHelper().createFormulaEvaluator()); evaluators.put(refHttp, wb3.getCreationHelper().createFormulaEvaluator()); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java index 38192d90f1..1c15804fb7 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java @@ -430,7 +430,7 @@ public abstract class BaseTestSheet { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); - Map<Integer, CellRangeAddress> mergedRegions = new HashMap<Integer, CellRangeAddress>(); + Map<Integer, CellRangeAddress> mergedRegions = new HashMap<>(); for (int r=0; r<10; r++) { CellRangeAddress region = new CellRangeAddress(r, r, 0, 1); mergedRegions.put(r, region); @@ -447,8 +447,8 @@ public abstract class BaseTestSheet { } private static <T> void assertCollectionEquals(Collection<T> expected, Collection<T> actual) { - Set<T> e = new HashSet<T>(expected); - Set<T> a = new HashSet<T>(actual); + Set<T> e = new HashSet<>(expected); + Set<T> a = new HashSet<>(actual); assertEquals(e, a); } diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java index 30764c4cb9..882be57da8 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java @@ -323,7 +323,7 @@ public abstract class BaseTestSheetShiftRows { sheet.shiftRows(4, sheet.getLastRowNum(), 1); // all regions should still start at row 3, and elongate by 1 row - List<CellRangeAddress> expectedMergedRegions = new ArrayList<CellRangeAddress>(); + List<CellRangeAddress> expectedMergedRegions = new ArrayList<>(); CellRangeAddress A4_B8 = CellRangeAddress.valueOf("A4:B8"); //A4:B7 should be elongated by 1 row CellRangeAddress C4_D8 = CellRangeAddress.valueOf("C4:D8"); //C4:B7 should be elongated by 1 row expectedMergedRegions.add(A4_B8); diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java b/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java index af5baf2fb2..e966f8ad22 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java @@ -84,7 +84,7 @@ public class TestExcelStyleDateFormatter { "\u004a", "\u004a", "\u0041", "\u0053", "\u004f", "\u004e", "\u0044"); - Map<Locale, List<String>> testMap = new HashMap<Locale, List<String>>(); + Map<Locale, List<String>> testMap = new HashMap<>(); testMap.put(germanLocale, germanResultList); testMap.put(russianLocale, russianResultList); testMap.put(austrianLocale, austrianResultList); diff --git a/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java b/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java index be653fd91b..215b64a340 100644 --- a/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java +++ b/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java @@ -118,7 +118,7 @@ public class BaseTestCellUtil { // Add multiple border properties to cell should create a single new style int styCnt1 = wb.getNumCellStyles(); - Map<String, Object> props = new HashMap<String, Object>(); + Map<String, Object> props = new HashMap<>(); props.put(CellUtil.BORDER_TOP, BorderStyle.THIN); props.put(CellUtil.BORDER_BOTTOM, BorderStyle.THIN); props.put(CellUtil.BORDER_LEFT, BorderStyle.THIN); @@ -376,7 +376,7 @@ public class BaseTestCellUtil { public void setFillForegroundColorBeforeFillBackgroundColor() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); Cell A1 = wb1.createSheet().createRow(0).createCell(0); - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); properties.put(CellUtil.FILL_PATTERN, FillPatternType.BRICKS); properties.put(CellUtil.FILL_FOREGROUND_COLOR, IndexedColors.BLUE.index); properties.put(CellUtil.FILL_BACKGROUND_COLOR, IndexedColors.RED.index); @@ -396,7 +396,7 @@ public class BaseTestCellUtil { public void setFillForegroundColorBeforeFillBackgroundColorEnum() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); Cell A1 = wb1.createSheet().createRow(0).createCell(0); - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); properties.put(CellUtil.FILL_PATTERN, FillPatternType.BRICKS); properties.put(CellUtil.FILL_FOREGROUND_COLOR, IndexedColors.BLUE.index); properties.put(CellUtil.FILL_BACKGROUND_COLOR, IndexedColors.RED.index); diff --git a/src/testcases/org/apache/poi/ss/util/NumberComparisonExamples.java b/src/testcases/org/apache/poi/ss/util/NumberComparisonExamples.java index 265e40d8c9..79fe64cda7 100644 --- a/src/testcases/org/apache/poi/ss/util/NumberComparisonExamples.java +++ b/src/testcases/org/apache/poi/ss/util/NumberComparisonExamples.java @@ -66,7 +66,7 @@ final class NumberComparisonExamples { private static ComparisonExample[] initExamples() { - List<ComparisonExample> temp = new ArrayList<ComparisonExample>(); + List<ComparisonExample> temp = new ArrayList<>(); addStepTransition(temp, 0x4010000000000005L); addStepTransition(temp, 0x4010000000000010L); diff --git a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java index f810f3093e..35ea428c88 100644 --- a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java +++ b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java @@ -58,7 +58,7 @@ public class NumberRenderingSpreadsheetGenerator { writeHeaderRow(wb, sheet); _sheet = sheet; _rowIndex = 1; - _replacementNaNs = new ArrayList<Long>(); + _replacementNaNs = new ArrayList<>(); } public void addTestRow(long rawBits, String expectedExcelRendering) { diff --git a/src/testcases/org/apache/poi/util/DummyPOILogger.java b/src/testcases/org/apache/poi/util/DummyPOILogger.java index 7da48ce269..ca8b2ca615 100644 --- a/src/testcases/org/apache/poi/util/DummyPOILogger.java +++ b/src/testcases/org/apache/poi/util/DummyPOILogger.java @@ -25,10 +25,10 @@ import java.util.List; */ @Internal public class DummyPOILogger extends POILogger { - public List<String>logged = new ArrayList<String>(); + public List<String>logged = new ArrayList<>(); public void reset() { - logged = new ArrayList<String>(); + logged = new ArrayList<>(); } @Override |