From 2797d07486b036e5486f959b4db769b01320afee Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 10 Jan 2020 23:13:20 +0000 Subject: [PATCH] try to fix some jdk 14 build issues due to java.lang.Record causing existing POI Record classes to be ambiguous git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1872610 13f79535-47bb-0310-9956-ffa450edef68 --- .../eventusermodel/examples/XLS2CSVmra.java | 2 +- .../hssf/usermodel/examples/EventExample.java | 2 +- .../poi/hssf/usermodel/RecordsStresser.java | 4 +- .../apache/poi/stress/HSLFFileHandler.java | 4 +- .../org/apache/poi/hssf/dev/BiffViewer.java | 4 +- .../apache/poi/hssf/dev/FormulaViewer.java | 4 +- .../poi/hssf/eventmodel/ERFListener.java | 2 +- .../hssf/eventmodel/EventRecordFactory.java | 6 +-- .../eventusermodel/AbortableHSSFListener.java | 6 +-- .../eventusermodel/EventWorkbookBuilder.java | 6 +-- .../FormatTrackingHSSFListener.java | 4 +- .../hssf/eventusermodel/HSSFEventFactory.java | 2 +- .../poi/hssf/eventusermodel/HSSFListener.java | 2 +- .../poi/hssf/eventusermodel/HSSFRequest.java | 2 +- .../MissingRecordAwareHSSFListener.java | 4 +- .../extractor/EventBasedExcelExtractor.java | 2 +- .../apache/poi/hssf/model/InternalSheet.java | 29 ++++++-------- .../poi/hssf/model/InternalWorkbook.java | 38 +++++++++--------- .../org/apache/poi/hssf/model/LinkTable.java | 6 +-- .../apache/poi/hssf/model/RecordOrderer.java | 16 ++++---- .../apache/poi/hssf/model/RecordStream.java | 6 +-- .../poi/hssf/model/RowBlocksReader.java | 14 +++---- .../poi/hssf/model/WorkbookRecordList.java | 8 ++-- .../poi/hssf/record/EscherAggregate.java | 6 +-- .../poi/hssf/record/InterfaceEndRecord.java | 2 +- .../apache/poi/hssf/record/RecordFactory.java | 10 ++--- .../hssf/record/RecordFactoryInputStream.java | 4 +- .../ChartSubstreamRecordAggregate.java | 4 +- .../CustomViewSettingsRecordAggregate.java | 6 +-- .../record/aggregates/PageSettingsBlock.java | 12 +++--- .../record/aggregates/RecordAggregate.java | 8 ++-- .../aggregates/RowRecordsAggregate.java | 4 +- .../aggregates/ValueRecordsAggregate.java | 2 +- .../aggregates/WorksheetProtectionBlock.java | 4 +- .../apache/poi/hssf/usermodel/HSSFChart.java | 8 ++-- .../apache/poi/hssf/usermodel/HSSFSheet.java | 6 +-- .../poi/hssf/usermodel/HSSFWorkbook.java | 12 +++--- .../apache/poi/hslf/dev/SlideIdListing.java | 6 +-- .../poi/hslf/dev/SlideShowRecordDumper.java | 6 +-- .../apache/poi/hslf/dev/TextStyleListing.java | 2 +- .../hslf/dev/UserEditAndPersistListing.java | 6 +-- .../apache/poi/hslf/record/AnimationInfo.java | 2 +- .../apache/poi/hslf/record/Comment2000.java | 6 +-- .../poi/hslf/record/DocInfoListContainer.java | 2 +- .../poi/hslf/record/EscherTextboxWrapper.java | 6 +-- .../org/apache/poi/hslf/record/ExEmbed.java | 6 +-- .../apache/poi/hslf/record/ExHyperlink.java | 2 +- .../apache/poi/hslf/record/ExMCIMovie.java | 2 +- .../org/apache/poi/hslf/record/ExObjList.java | 2 +- .../poi/hslf/record/ExVideoContainer.java | 2 +- .../poi/hslf/record/FontCollection.java | 2 +- .../record/HSLFEscherClientDataRecord.java | 6 +-- .../hslf/record/HeadersFootersContainer.java | 6 +-- .../poi/hslf/record/InteractiveInfo.java | 2 +- .../org/apache/poi/hslf/record/PPDrawing.java | 6 +-- .../poi/hslf/record/PPDrawingGroup.java | 2 +- .../poi/hslf/record/ParentAwareRecord.java | 2 +- .../org/apache/poi/hslf/record/Record.java | 10 ++--- .../apache/poi/hslf/record/RecordAtom.java | 2 +- .../poi/hslf/record/RecordContainer.java | 24 +++++------ .../src/org/apache/poi/hslf/record/Slide.java | 2 +- .../poi/hslf/record/SlideListWithText.java | 12 +++--- .../poi/hslf/record/TextHeaderAtom.java | 4 +- .../hslf/record/UnknownRecordPlaceholder.java | 2 +- .../poi/hslf/record/VBAInfoContainer.java | 2 +- .../poi/hslf/usermodel/HSLFHyperlink.java | 4 +- .../poi/hslf/usermodel/HSLFObjectShape.java | 2 +- .../apache/poi/hslf/usermodel/HSLFShape.java | 2 +- .../poi/hslf/usermodel/HSLFShapeFactory.java | 2 +- .../HSLFShapePlaceholderDetails.java | 2 +- .../apache/poi/hslf/usermodel/HSLFSlide.java | 2 +- .../poi/hslf/usermodel/HSLFSlideShow.java | 38 +++++++++--------- .../usermodel/HSLFSlideShowEncrypted.java | 28 ++++++------- .../poi/hslf/usermodel/HSLFSlideShowImpl.java | 20 +++++----- .../poi/hslf/usermodel/HSLFSoundData.java | 4 +- .../poi/hslf/usermodel/HSLFTextParagraph.java | 32 +++++++-------- .../poi/hslf/record/TestRecordContainer.java | 2 +- .../org/apache/poi/hslf/record/TestSound.java | 4 +- .../poi/hslf/usermodel/TestAddingSlides.java | 4 +- .../apache/poi/hslf/usermodel/TestBugs.java | 2 +- .../hslf/usermodel/TestMostRecentRecords.java | 8 ++-- .../poi/hslf/usermodel/TestRecordSetup.java | 10 ++--- .../poi/hslf/usermodel/TestRichTextRun.java | 2 +- .../poi/hslf/usermodel/TestTextRun.java | 12 +++--- .../eventmodel/TestAbortableListener.java | 2 +- .../TestEventWorkbookBuilder.java | 2 +- .../TestFormatTrackingHSSFListener.java | 6 +-- .../eventusermodel/TestHSSFEventFactory.java | 4 +- .../TestMissingRecordAwareHSSFListener.java | 12 +++--- .../poi/hssf/model/TestDrawingAggregate.java | 20 +++++----- .../hssf/model/TestEscherRecordFactory.java | 2 +- .../apache/poi/hssf/model/TestLinkTable.java | 4 +- .../org/apache/poi/hssf/model/TestSheet.java | 40 +++++++++---------- .../poi/hssf/record/TestDrawingRecord.java | 2 +- .../poi/hssf/record/TestFeatRecord.java | 8 ++-- .../hssf/record/TestInterfaceEndRecord.java | 2 +- .../poi/hssf/record/TestMergeCellsRecord.java | 2 +- .../poi/hssf/record/TestRecordFactory.java | 8 ++-- .../aggregates/TestCFRecordsAggregate.java | 2 +- .../TestColumnInfoRecordsAggregate.java | 6 +-- .../TestFormulaRecordAggregate.java | 2 +- .../aggregates/TestPageSettingsBlock.java | 28 ++++++------- .../aggregates/TestRowRecordsAggregate.java | 8 ++-- .../aggregates/TestValueRecordsAggregate.java | 12 +++--- .../chart/TestChartTitleFormatRecord.java | 2 +- .../poi/hssf/usermodel/SanityChecker.java | 4 +- .../apache/poi/hssf/usermodel/TestBugs.java | 2 +- .../poi/hssf/usermodel/TestHSSFCell.java | 6 +-- .../poi/hssf/usermodel/TestHSSFSheet.java | 2 +- .../TestHSSFSheetUpdateArrayFormulas.java | 4 +- .../poi/hssf/usermodel/TestSanityChecker.java | 4 +- .../poi/hssf/usermodel/TestWorkbook.java | 2 +- 112 files changed, 385 insertions(+), 388 deletions(-) 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 88e2ae95d8..a4897d18f0 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 @@ -132,7 +132,7 @@ public class XLS2CSVmra implements HSSFListener { * CSV as the file is processed. */ @Override - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { int thisRow = -1; int thisColumn = -1; String thisStr = null; diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java index 857e1baea6..5f6945b3f2 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java @@ -39,7 +39,7 @@ public class EventExample implements HSSFListener { * @param record The record that was found while reading. */ @Override - public void processRecord(Record record) + public void processRecord(org.apache.poi.hssf.record.Record record) { switch (record.getSid()) { diff --git a/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java b/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java index 740068fd9e..d277d40e8a 100644 --- a/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java +++ b/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java @@ -33,8 +33,8 @@ import org.junit.Test; */ public class RecordsStresser { public static void handleWorkbook(HSSFWorkbook wb) { - List records = wb.getWorkbook().getRecords(); - for(Record record : records) { + List records = wb.getWorkbook().getRecords(); + for(org.apache.poi.hssf.record.Record record : records) { // some Records do not implement clone ?! // equals instead of instanceof is on purpose here to only skip exactly this class and not any derived ones // if(record.getClass().equals(InterfaceHdrRecord.class) || diff --git a/src/integrationtest/org/apache/poi/stress/HSLFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HSLFFileHandler.java index 15209d3d76..3adbcd0a08 100644 --- a/src/integrationtest/org/apache/poi/stress/HSLFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HSLFFileHandler.java @@ -36,9 +36,9 @@ public class HSLFFileHandler extends SlideShowHandler { assertNotNull(slide.getEmbeddedObjects()); assertNotNull(slide.getUnderlyingBytes()); assertNotNull(slide.getPictureData()); - Record[] records = slide.getRecords(); + org.apache.poi.hssf.record.Record[] records = slide.getRecords(); assertNotNull(records); - for(Record record : records) { + for(org.apache.poi.hssf.record.Record record : records) { assertNotNull("Found a record which was null", record); assertTrue(record.getRecordType() >= 0); } diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java index 7234cde5f6..e260967ba2 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java +++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java @@ -91,7 +91,7 @@ public final class BiffViewer { if (recStream.getSid() == 0) { continue; } - Record record; + org.apache.poi.hssf.record.Record record; if (dumpInterpretedRecords) { record = createRecord (recStream); if (record.getSid() == ContinueRecord.sid) { @@ -115,7 +115,7 @@ public final class BiffViewer { * up non-debug operations. * */ - private static Record createRecord(RecordInputStream in) { + private static org.apache.poi.hssf.record.Record createRecord(RecordInputStream in) { switch (in.getSid()) { case AreaFormatRecord.sid: return new AreaFormatRecord(in); case AreaRecord.sid: return new AreaRecord(in); diff --git a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java index 90a3015166..d53d37aa67 100644 --- a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java +++ b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java @@ -57,9 +57,9 @@ public class FormulaViewer public void run() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem(new File(file), true)) { try (InputStream is = BiffViewer.getPOIFSInputStream(fs)) { - List records = RecordFactory.createRecords(is); + List records = RecordFactory.createRecords(is); - for (Record record : records) { + for (org.apache.poi.hssf.record.Record record : records) { if (record.getSid() == FormulaRecord.sid) { if (list) { listFormula((FormulaRecord) record); diff --git a/src/java/org/apache/poi/hssf/eventmodel/ERFListener.java b/src/java/org/apache/poi/hssf/eventmodel/ERFListener.java index 91276490b5..1924b476ba 100644 --- a/src/java/org/apache/poi/hssf/eventmodel/ERFListener.java +++ b/src/java/org/apache/poi/hssf/eventmodel/ERFListener.java @@ -36,5 +36,5 @@ public interface ERFListener * * @return boolean specifying whether the effort was a success. */ - public boolean processRecord(Record rec); + public boolean processRecord(org.apache.poi.hssf.record.Record rec); } diff --git a/src/java/org/apache/poi/hssf/eventmodel/EventRecordFactory.java b/src/java/org/apache/poi/hssf/eventmodel/EventRecordFactory.java index 12ac473396..9cc6791c5f 100644 --- a/src/java/org/apache/poi/hssf/eventmodel/EventRecordFactory.java +++ b/src/java/org/apache/poi/hssf/eventmodel/EventRecordFactory.java @@ -28,7 +28,7 @@ import org.apache.poi.util.RecordFormatException; /** * Event-based record factory. As opposed to RecordFactory - * this version sends {@link ERFListener#processRecord(Record) } messages to + * this version sends {@link ERFListener#processRecord(org.apache.poi.hssf.record.Record) } messages to * the supplied listener. Record notifications are sent one record behind * to ensure that {@link ContinueRecord}s are processed first. */ @@ -68,7 +68,7 @@ public final class EventRecordFactory { * @return false to abort. This aborts * out of the event loop should the listener return false */ - private boolean processRecord(Record record) { + private boolean processRecord(org.apache.poi.hssf.record.Record record) { if (!isSidIncluded(record.getSid())) { return true; } @@ -93,7 +93,7 @@ public final class EventRecordFactory { recStream.nextRecord(); Record[] recs = RecordFactory.createRecord(recStream); // handle MulRK records if (recs.length > 1) { - for (Record rec : recs) { + for (org.apache.poi.hssf.record.Record rec : recs) { if ( last_record != null ) { if (!processRecord(last_record)) { return; diff --git a/src/java/org/apache/poi/hssf/eventusermodel/AbortableHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/AbortableHSSFListener.java index 7ba390c343..08e9c4f72a 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/AbortableHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/AbortableHSSFListener.java @@ -24,7 +24,7 @@ import org.apache.poi.hssf.record.Record; * Abstract class for use with the HSSFRequest and HSSFEventFactory, which * allows for the halting of processing. * Users should create subclass of this (which implements the usual - * HSSFListener), and then override the #abortableProcessRecord(Record) + * HSSFListener), and then override the #abortableProcessRecord(org.apache.poi.hssf.record.Record) * method to do their processing. * This should then be registered with the HSSFRequest (associating * it with Record SID's) as usual. @@ -42,7 +42,7 @@ public abstract class AbortableHSSFListener implements HSSFListener * You should implement #abortableProcessRecord instead */ @Override - public void processRecord(Record record) + public void processRecord(org.apache.poi.hssf.record.Record record) { } @@ -67,5 +67,5 @@ public abstract class AbortableHSSFListener implements HSSFListener * @throws HSSFUserException User code can throw this to abort * file processing by HSSFEventFactory and return diagnostic information. */ - public abstract short abortableProcessRecord(Record record) throws HSSFUserException; + public abstract short abortableProcessRecord(org.apache.poi.hssf.record.Record record) throws HSSFUserException; } diff --git a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java index 165db0e8fd..0ef80530c0 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java @@ -66,7 +66,7 @@ public class EventWorkbookBuilder { */ public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst) { - List wbRecords = new ArrayList<>(); + List wbRecords = new ArrayList<>(); // Core Workbook records go first if(bounds != null) { @@ -157,7 +157,7 @@ public class EventWorkbookBuilder { * pass it on to our child listener */ @Override - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { // Handle it ourselves processRecordInternally(record); @@ -171,7 +171,7 @@ public class EventWorkbookBuilder { * * @param record the record to be processed */ - public void processRecordInternally(Record record) { + public void processRecordInternally(org.apache.poi.hssf.record.Record record) { if(record instanceof BoundSheetRecord) { boundSheetRecords.add((BoundSheetRecord)record); } diff --git a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java index 3fef4d1e7e..ebeba4f21d 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java @@ -84,7 +84,7 @@ public class FormatTrackingHSSFListener implements HSSFListener { * Process this record ourselves, and then pass it on to our child listener */ @Override - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { // Handle it ourselves processRecordInternally(record); @@ -98,7 +98,7 @@ public class FormatTrackingHSSFListener implements HSSFListener { * * @param record the record to be processed */ - public void processRecordInternally(Record record) { + public void processRecordInternally(org.apache.poi.hssf.record.Record record) { if (record instanceof FormatRecord) { FormatRecord fr = (FormatRecord) record; _customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr); diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java index 1283ae517b..65c0c83115 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java @@ -165,7 +165,7 @@ public class HSSFEventFactory { // Process each record as they come in while(true) { - Record r = recordStream.nextRecord(); + org.apache.poi.hssf.record.Record r = recordStream.nextRecord(); if(r == null) { break; } diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFListener.java index 8932b10cdd..cc47e416b0 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFListener.java @@ -37,5 +37,5 @@ public interface HSSFListener * * @param record the record to be processed */ - public void processRecord(Record record); + public void processRecord(org.apache.poi.hssf.record.Record record); } diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java index 1aca412806..50cc728e95 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java @@ -88,7 +88,7 @@ public class HSSFRequest { * @return numeric user-specified result code. If zero continue processing. * @throws HSSFUserException User exception condition */ - protected short processRecord(Record rec) throws HSSFUserException { + protected short processRecord(org.apache.poi.hssf.record.Record rec) throws HSSFUserException { List listeners = _records.get(Short.valueOf(rec.getSid())); short userCode = 0; diff --git a/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java index f154a1f86c..83c7a18cac 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java @@ -63,7 +63,7 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener { childListener = listener; } - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { int thisRow; int thisColumn; CellValueRecordInterface[] expandedRecords = null; @@ -195,7 +195,7 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener { // Pass along the record(s) if(expandedRecords != null && expandedRecords.length > 0) { for(CellValueRecordInterface r : expandedRecords) { - childListener.processRecord((Record)r); + childListener.processRecord((org.apache.poi.hssf.record.Record)r); } } else { childListener.processRecord(record); diff --git a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java index 11f2d46369..122eddf109 100644 --- a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java +++ b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java @@ -172,7 +172,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or public TextListener() { sheetNames = new ArrayList<>(); } - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { String thisText = null; int thisRow = -1; diff --git a/src/java/org/apache/poi/hssf/model/InternalSheet.java b/src/java/org/apache/poi/hssf/model/InternalSheet.java index ea1addabdb..1240ae7b19 100644 --- a/src/java/org/apache/poi/hssf/model/InternalSheet.java +++ b/src/java/org/apache/poi/hssf/model/InternalSheet.java @@ -144,7 +144,7 @@ public final class InternalSheet { // Not a supported type // Skip onto the EOF, then complain while (rs.hasNext()) { - Record rec = rs.getNext(); + org.apache.poi.hssf.record.Record rec = rs.getNext(); if (rec instanceof EOFRecord) { break; } @@ -229,7 +229,7 @@ public final class InternalSheet { continue; } - Record rec = rs.getNext(); + org.apache.poi.hssf.record.Record rec = rs.getNext(); if ( recSid == IndexRecord.sid ) { // ignore INDEX record because it is only needed by Excel, // and POI always re-calculates its contents @@ -334,10 +334,7 @@ public final class InternalSheet { log.log(POILogger.DEBUG, "sheet createSheet (existing file) exited"); } private static void spillAggregate(RecordAggregate ra, final List recs) { - ra.visitContainedRecords(new RecordVisitor() { - public void visitRecord(Record r) { - recs.add(r); - }}); + ra.visitContainedRecords(r -> recs.add(r)); } public static class UnsupportedBOFType extends RecordFormatException { @@ -354,12 +351,12 @@ public final class InternalSheet { private static final class RecordCloner implements RecordVisitor { - private final List _destList; + private final List _destList; - public RecordCloner(List destList) { + public RecordCloner(List destList) { _destList = destList; } - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { _destList.add(r.copy()); } } @@ -374,7 +371,7 @@ public final class InternalSheet { * @return the cloned sheet */ public InternalSheet cloneSheet() { - List clonedRecords = new ArrayList<>(_records.size()); + List clonedRecords = new ArrayList<>(_records.size()); for (int i = 0; i < _records.size(); i++) { RecordBase rb = _records.get(i); if (rb instanceof RecordAggregate) { @@ -387,7 +384,7 @@ public final class InternalSheet { */ rb = new DrawingRecord(); } - Record rec = ((Record) rb).copy(); + org.apache.poi.hssf.record.Record rec = ((org.apache.poi.hssf.record.Record) rb).copy(); clonedRecords.add(rec); } return createSheet(new RecordStream(clonedRecords, 0)); @@ -571,7 +568,7 @@ public final class InternalSheet { RecordAggregate agg = (RecordAggregate) record; agg.visitContainedRecords(ptv); } else { - ptv.visitRecord((Record) record); + ptv.visitRecord((org.apache.poi.hssf.record.Record) record); } // If the BOF record was just serialized then add the IndexRecord @@ -1254,12 +1251,12 @@ public final class InternalSheet { * * @return the matching record or {@code null} if it wasn't found */ - public Record findFirstRecordBySid(short sid) { + public org.apache.poi.hssf.record.Record findFirstRecordBySid(short sid) { int ix = findFirstRecordLocBySid(sid); if (ix < 0) { return null; } - return (Record) _records.get(ix); + return (org.apache.poi.hssf.record.Record) _records.get(ix); } /** @@ -1290,10 +1287,10 @@ public final class InternalSheet { int max = _records.size(); for (int i=0; i< max; i++) { Object rb = _records.get(i); - if (!(rb instanceof Record)) { + if (!(rb instanceof org.apache.poi.hssf.record.Record)) { continue; } - Record record = (Record) rb; + org.apache.poi.hssf.record.Record record = (org.apache.poi.hssf.record.Record) rb; if (record.getSid() == sid) { return i; } diff --git a/src/java/org/apache/poi/hssf/model/InternalWorkbook.java b/src/java/org/apache/poi/hssf/model/InternalWorkbook.java index 8b0ac7569e..c608a1d6d9 100644 --- a/src/java/org/apache/poi/hssf/model/InternalWorkbook.java +++ b/src/java/org/apache/poi/hssf/model/InternalWorkbook.java @@ -179,15 +179,15 @@ public final class InternalWorkbook { * @param recs an array of Record objects * @return Workbook object */ - public static InternalWorkbook createWorkbook(List recs) { + public static InternalWorkbook createWorkbook(List recs) { LOG.log(DEBUG, "Workbook (readfile) created with reclen=", recs.size()); InternalWorkbook retval = new InternalWorkbook(); - List records = new ArrayList<>(recs.size() / 3); + List records = new ArrayList<>(recs.size() / 3); retval.records.setRecords(records); boolean eofPassed = false; for (int k = 0; k < recs.size(); k++) { - Record rec = recs.get(k); + org.apache.poi.hssf.record.Record rec = recs.get(k); String logObj; switch (rec.getSid()) { @@ -328,7 +328,7 @@ public final class InternalWorkbook { LOG.log( DEBUG, "creating new workbook from scratch" ); InternalWorkbook retval = new InternalWorkbook(); - List records = new ArrayList<>(30); + List records = new ArrayList<>(30); retval.records.setRecords(records); List formats = retval.formats; @@ -604,7 +604,7 @@ public final class InternalWorkbook { // also adjust order of Records, calculate the position of the Boundsheets via getBspos()... int initialBspos = records.getBspos(); int pos0 = initialBspos - (boundsheets.size() - 1); - Record removed = records.get(pos0 + sheetNumber); + org.apache.poi.hssf.record.Record removed = records.get(pos0 + sheetNumber); records.remove(pos0 + sheetNumber); records.add(pos0 + pos, removed); records.setBspos(initialBspos); @@ -774,7 +774,7 @@ public final class InternalWorkbook { * make the tabid record look like the current situation. */ private void fixTabIdRecord() { - Record rec = records.get(records.getTabpos()); + org.apache.poi.hssf.record.Record rec = records.get(records.getTabpos()); // see bug 55982, quite a number of documents do not have a TabIdRecord and // thus there is no way to do the fixup here, @@ -885,7 +885,7 @@ public final class InternalWorkbook { // Style records always follow after // the ExtendedFormat records for(int i=records.getXfpos(); i getRecords() { + public List getRecords() { return records.getRecords(); } @@ -1805,7 +1805,7 @@ public final class InternalWorkbook { PaletteRecord palette; int palettePos = records.getPalettepos(); if (palettePos != -1) { - Record rec = records.get(palettePos); + org.apache.poi.hssf.record.Record rec = records.get(palettePos); if (rec instanceof PaletteRecord) { palette = (PaletteRecord) rec; } else { @@ -1832,7 +1832,7 @@ public final class InternalWorkbook { } // Need to find a DrawingGroupRecord that contains a EscherDggRecord - for(Record r : records.getRecords() ) { + for(org.apache.poi.hssf.record.Record r : records.getRecords() ) { if (!(r instanceof DrawingGroupRecord)) { continue; } diff --git a/src/java/org/apache/poi/hssf/model/LinkTable.java b/src/java/org/apache/poi/hssf/model/LinkTable.java index 53ef5d6e96..7184ccc98d 100644 --- a/src/java/org/apache/poi/hssf/model/LinkTable.java +++ b/src/java/org/apache/poi/hssf/model/LinkTable.java @@ -188,7 +188,7 @@ final class LinkTable { private final int _recordCount; private final WorkbookRecordList _workbookRecordList; // TODO - would be nice to remove this - public LinkTable(List inputList, int startIndex, WorkbookRecordList workbookRecordList, Map commentRecords) { + public LinkTable(List inputList, int startIndex, WorkbookRecordList workbookRecordList, Map commentRecords) { _workbookRecordList = workbookRecordList; RecordStream rs = new RecordStream(inputList, startIndex); @@ -524,7 +524,7 @@ final class LinkTable { */ private int findFirstRecordLocBySid(short sid) { int index = 0; - for (Record record : _workbookRecordList.getRecords()) { + for (org.apache.poi.hssf.record.Record record : _workbookRecordList.getRecords()) { if (record.getSid() == sid) { return index; } @@ -641,7 +641,7 @@ final class LinkTable { int supLinkIndex = 0; // find the posistion of the Add-In SupBookRecord in the workbook stream, // the created ExternalNameRecord will be appended to it - for (Record record : _workbookRecordList.getRecords()) { + for (org.apache.poi.hssf.record.Record record : _workbookRecordList.getRecords()) { if (record instanceof SupBookRecord && ((SupBookRecord) record).isAddInFunctions()) { break; } diff --git a/src/java/org/apache/poi/hssf/model/RecordOrderer.java b/src/java/org/apache/poi/hssf/model/RecordOrderer.java index 10d2eb03ea..f1dd369a91 100644 --- a/src/java/org/apache/poi/hssf/model/RecordOrderer.java +++ b/src/java/org/apache/poi/hssf/model/RecordOrderer.java @@ -162,7 +162,7 @@ final class RecordOrderer { return true; // oo COLINFO } if (rb instanceof Record) { - Record record = (Record) rb; + Record record = (org.apache.poi.hssf.record.Record) rb; switch (record.getSid()) { case DefaultColWidthRecord.sid: case UnknownRecord.SORT_0090: @@ -186,7 +186,7 @@ final class RecordOrderer { } private static boolean isPageBreakPriorRecord(Object rb) { if (rb instanceof Record) { - Record record = (Record) rb; + Record record = (org.apache.poi.hssf.record.Record) rb; switch (record.getSid()) { case BOFRecord.sid: case IndexRecord.sid: @@ -226,7 +226,7 @@ final class RecordOrderer { continue; } - Record rec = (Record) rb; + Record rec = (org.apache.poi.hssf.record.Record) rb; switch (rec.getSid()) { case WindowTwoRecord.sid: case SCLRecord.sid: @@ -253,7 +253,7 @@ final class RecordOrderer { // even PageSettingsBlock (which doesn't normally appear after 'View Settings') continue; } - Record rec = (Record) rb; + Record rec = (org.apache.poi.hssf.record.Record) rb; switch (rec.getSid()) { // 'View Settings' (4 records) case WindowTwoRecord.sid: @@ -298,14 +298,14 @@ final class RecordOrderer { i--; RecordBase rb = records.get(i); if (isDVTPriorRecord(rb)) { - Record nextRec = (Record) records.get(i + 1); + Record nextRec = (org.apache.poi.hssf.record.Record) records.get(i + 1); if (!isDVTSubsequentRecord(nextRec.getSid())) { throw new IllegalStateException("Unexpected (" + nextRec.getClass().getName() + ") found after (" + rb.getClass().getName() + ")"); } return i+1; } - Record rec = (Record) rb; + Record rec = (org.apache.poi.hssf.record.Record) rb; if (!isDVTSubsequentRecord(rec.getSid())) { throw new IllegalStateException("Unexpected (" + rec.getClass().getName() + ") while looking for DV Table insert pos"); @@ -319,7 +319,7 @@ final class RecordOrderer { if (rb instanceof MergedCellsTable || rb instanceof ConditionalFormattingTable) { return true; } - short sid = ((Record)rb).getSid(); + short sid = ((org.apache.poi.hssf.record.Record)rb).getSid(); switch(sid) { case WindowTwoRecord.sid: case UnknownRecord.SCL_00A0: @@ -379,7 +379,7 @@ final class RecordOrderer { private static boolean isGutsPriorRecord(RecordBase rb) { if (rb instanceof Record) { - Record record = (Record) rb; + Record record = (org.apache.poi.hssf.record.Record) rb; switch (record.getSid()) { case BOFRecord.sid: case IndexRecord.sid: diff --git a/src/java/org/apache/poi/hssf/model/RecordStream.java b/src/java/org/apache/poi/hssf/model/RecordStream.java index 7e1f82d380..02d85fda6a 100644 --- a/src/java/org/apache/poi/hssf/model/RecordStream.java +++ b/src/java/org/apache/poi/hssf/model/RecordStream.java @@ -25,7 +25,7 @@ import org.apache.poi.hssf.record.Record; */ public final class RecordStream { - private final List _list; + private final List _list; private int _nextIndex; private int _countRead; private final int _endIx; @@ -37,14 +37,14 @@ public final class RecordStream { * @param startIndex the start index within the list * @param endIx the end index within the list, which is the index of the end element + 1 */ - public RecordStream(List inputList, int startIndex, int endIx) { + public RecordStream(List inputList, int startIndex, int endIx) { _list = inputList; _nextIndex = startIndex; _endIx = endIx; _countRead = 0; } - public RecordStream(List records, int startIx) { + public RecordStream(List records, int startIx) { this(records, startIx, records.size()); } diff --git a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java index cf8becadc5..efad9d5a86 100644 --- a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java +++ b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java @@ -36,7 +36,7 @@ import org.apache.poi.ss.util.CellReference; */ public final class RowBlocksReader { - private final List _plainRecords; + private final List _plainRecords; private final SharedValueManager _sfm; private final MergeCellsRecord[] _mergedCellsRecords; @@ -47,12 +47,12 @@ public final class RowBlocksReader { * @param rs the record stream */ public RowBlocksReader(RecordStream rs) { - List plainRecords = new ArrayList<>(); - List shFrmRecords = new ArrayList<>(); + List plainRecords = new ArrayList<>(); + List shFrmRecords = new ArrayList<>(); List firstCellRefs = new ArrayList<>(); - List arrayRecords = new ArrayList<>(); - List tableRecords = new ArrayList<>(); - List mergeCellRecords = new ArrayList<>(); + List arrayRecords = new ArrayList<>(); + List tableRecords = new ArrayList<>(); + List mergeCellRecords = new ArrayList<>(); Record prevRec = null; while(!RecordOrderer.isEndOfRowBlock(rs.peekNextSid())) { @@ -65,7 +65,7 @@ public final class RowBlocksReader { } Record rec = rs.getNext(); - List dest; + List dest; switch (rec.getSid()) { case MergeCellsRecord.sid: dest = mergeCellRecords; break; case SharedFormulaRecord.sid: dest = shFrmRecords; diff --git a/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java b/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java index 9171dba68b..c86a865598 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 records = new ArrayList<>(); + private List records = new ArrayList<>(); /** holds the position of the protect record */ private int protpos; @@ -47,7 +47,7 @@ public final class WorkbookRecordList { private int palettepos = -1; - public void setRecords(List records) { + public void setRecords(List records) { this.records = records; } @@ -64,7 +64,7 @@ public final class WorkbookRecordList { updateRecordPos(pos, true); } - public List getRecords() { + public List getRecords() { return records; } @@ -76,7 +76,7 @@ public final class WorkbookRecordList { public void remove( Object record ) { // can't use List.indexOf here because it checks the records for equality and not identity int i = 0; - for (Record r : records) { + for (org.apache.poi.hssf.record.Record r : records) { if (r == record) { remove(i); break; diff --git a/src/java/org/apache/poi/hssf/record/EscherAggregate.java b/src/java/org/apache/poi/hssf/record/EscherAggregate.java index 309057cae1..fbd96a2e24 100644 --- a/src/java/org/apache/poi/hssf/record/EscherAggregate.java +++ b/src/java/org/apache/poi/hssf/record/EscherAggregate.java @@ -439,7 +439,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { loc++; continue; } - Record objRecord = (Record) records.get(loc); + Record objRecord = (org.apache.poi.hssf.record.Record) records.get(loc); agg.shapeToObj.put(shapeRecords.get(shapeIndex++), objRecord); loc++; } @@ -635,7 +635,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { continueRecordsHeadersSize += 4; } int objRecordSize = 0; - for (Record r : shapeToObj.values()) { + for (org.apache.poi.hssf.record.Record r : shapeToObj.values()) { objRecordSize += r.getRecordSize(); } int tailRecordSize = 0; @@ -771,7 +771,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { private static short sid(List records, int loc) { RecordBase record = records.get(loc); if (record instanceof Record) { - return ((Record)record).getSid(); + return ((org.apache.poi.hssf.record.Record)record).getSid(); } else { // Aggregates don't have a sid // We could step into them, but for these needs we don't care diff --git a/src/java/org/apache/poi/hssf/record/InterfaceEndRecord.java b/src/java/org/apache/poi/hssf/record/InterfaceEndRecord.java index 472f7d76df..47c66f284a 100644 --- a/src/java/org/apache/poi/hssf/record/InterfaceEndRecord.java +++ b/src/java/org/apache/poi/hssf/record/InterfaceEndRecord.java @@ -32,7 +32,7 @@ public final class InterfaceEndRecord extends StandardRecord { // enforce singleton } - public static Record create(RecordInputStream in) { + public static org.apache.poi.hssf.record.Record create(RecordInputStream in) { switch (in.remaining()) { case 0: return instance; diff --git a/src/java/org/apache/poi/hssf/record/RecordFactory.java b/src/java/org/apache/poi/hssf/record/RecordFactory.java index 4bc14d68d3..e28ac46bc3 100644 --- a/src/java/org/apache/poi/hssf/record/RecordFactory.java +++ b/src/java/org/apache/poi/hssf/record/RecordFactory.java @@ -113,7 +113,7 @@ public final class RecordFactory { public Record create(RecordInputStream in) { Object[] args = { in, }; try { - return (Record) _m.invoke(null, args); + return (org.apache.poi.hssf.record.Record) _m.invoke(null, args); } catch (IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { @@ -314,7 +314,7 @@ public final class RecordFactory { * @param in the RecordInputStream to read from * @return the extracted records */ - public static Record [] createRecord(RecordInputStream in) { + public static org.apache.poi.hssf.record.Record [] createRecord(RecordInputStream in) { Record record = createSingleRecord(in); if (record instanceof DBCellRecord) { // Not needed by POI. Regenerated from scratch by POI when spreadsheet is written @@ -329,7 +329,7 @@ public final class RecordFactory { return new Record[] { record, }; } - public static Record createSingleRecord(RecordInputStream in) { + public static org.apache.poi.hssf.record.Record createSingleRecord(RecordInputStream in) { I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { @@ -478,9 +478,9 @@ public final class RecordFactory { * * @exception org.apache.poi.util.RecordFormatException on error processing the InputStream */ - public static List createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException { + public static List createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException { - List records = new ArrayList<>(NUM_RECORDS); + List 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 d7882c600f..a475269562 100644 --- a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java +++ b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java @@ -52,7 +52,7 @@ public final class RecordFactoryInputStream { private final Record _lastRecord; private final boolean _hasBOFRecord; - public StreamEncryptionInfo(RecordInputStream rs, List outputRecs) { + public StreamEncryptionInfo(RecordInputStream rs, List outputRecs) { Record rec; rs.nextRecord(); int recSize = 4 + rs.remaining(); @@ -183,7 +183,7 @@ public final class RecordFactoryInputStream { */ public RecordFactoryInputStream(InputStream in, boolean shouldIncludeContinueRecords) { RecordInputStream rs = new RecordInputStream(in); - List records = new ArrayList<>(); + List 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/aggregates/ChartSubstreamRecordAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java index 2196c89d4b..795a66389e 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java @@ -57,7 +57,7 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { temp.add(rs.getNext()); } _recs = temp; - Record eof = rs.getNext(); // no need to save EOF in field + org.apache.poi.hssf.record.Record eof = rs.getNext(); // no need to save EOF in field if (!(eof instanceof EOFRecord)) { throw new IllegalStateException("Bad chart EOF"); } @@ -73,7 +73,7 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { if (rb instanceof RecordAggregate) { ((RecordAggregate) rb).visitContainedRecords(rv); } else { - rv.visitRecord((Record) rb); + rv.visitRecord((org.apache.poi.hssf.record.Record) rb); } } rv.visitRecord(EOFRecord.instance); 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 85758fc845..40fe4dfc17 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java @@ -29,8 +29,8 @@ import org.apache.poi.hssf.record.*; */ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { - private final Record _begin; - private final Record _end; + private final org.apache.poi.hssf.record.Record _begin; + private final org.apache.poi.hssf.record.Record _end; /** * All the records between BOF and EOF */ @@ -77,7 +77,7 @@ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { if (rb instanceof RecordAggregate) { ((RecordAggregate) rb).visitContainedRecords(rv); } else { - rv.visitRecord((Record) rb); + rv.visitRecord((org.apache.poi.hssf.record.Record) rb); } } rv.visitRecord(_end); 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 0c4d5b4214..752e7e1a8b 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/PageSettingsBlock.java @@ -40,7 +40,7 @@ public final class PageSettingsBlock extends RecordAggregate { */ private static final class PLSAggregate extends RecordAggregate { private static final ContinueRecord[] EMPTY_CONTINUE_RECORD_ARRAY = { }; - private final Record _pls; + private final org.apache.poi.hssf.record.Record _pls; /** * holds any continue records found after the PLS record.
* This would not be required if PLS was properly interpreted. @@ -86,7 +86,7 @@ public final class PageSettingsBlock extends RecordAggregate { private BottomMarginRecord _bottomMargin; private final List _plsRecords; private PrintSetupRecord _printSetup; - private Record _bitmap; + private org.apache.poi.hssf.record.Record _bitmap; private HeaderFooterRecord _headerFooter; /** * HeaderFooterRecord records belonging to preceding CustomViewSettingsRecordAggregates. @@ -94,7 +94,7 @@ public final class PageSettingsBlock extends RecordAggregate { * see {@link org.apache.poi.hssf.record.HeaderFooterRecord#getGuid()} */ private final List _sviewHeaderFooters = new ArrayList<>(); - private Record _printSize; + private org.apache.poi.hssf.record.Record _printSize; public PageSettingsBlock(RecordStream rs) { _plsRecords = new ArrayList<>(); @@ -220,7 +220,7 @@ public final class PageSettingsBlock extends RecordAggregate { return true; } - private void checkNotPresent(Record rec) { + private void checkNotPresent(org.apache.poi.hssf.record.Record rec) { if (rec != null) { throw new org.apache.poi.util.RecordFormatException("Duplicate PageSettingsBlock record (sid=0x" + Integer.toHexString(rec.getSid()) + ")"); @@ -296,7 +296,7 @@ public final class PageSettingsBlock extends RecordAggregate { visitIfPresent(_headerFooter, rv); visitIfPresent(_bitmap, rv); } - private static void visitIfPresent(Record r, RecordVisitor rv) { + private static void visitIfPresent(org.apache.poi.hssf.record.Record r, RecordVisitor rv) { if (r != null) { rv.visitRecord(r); } @@ -687,7 +687,7 @@ public final class PageSettingsBlock extends RecordAggregate { final CustomViewSettingsRecordAggregate cv = (CustomViewSettingsRecordAggregate) rb; cv.visitContainedRecords(new RecordVisitor() { @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { if (r.getSid() == UserSViewBegin.sid) { String guid = HexDump.toHex(((UserSViewBegin) r).getGuid()); HeaderFooterRecord hf = hfGuidMap.get(guid); diff --git a/src/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java index 8336dcaefe..c8103501ed 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java @@ -53,7 +53,7 @@ public abstract class RecordAggregate extends RecordBase { * Implementors may call non-mutating methods on Record r. * @param r must not be null */ - void visitRecord(Record r); + void visitRecord(org.apache.poi.hssf.record.Record r); } private static final class SerializingRecordVisitor implements RecordVisitor { @@ -70,7 +70,7 @@ public abstract class RecordAggregate extends RecordBase { public int countBytesWritten() { return _countBytesWritten; } - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { int currentOffset = _startOffset + _countBytesWritten; _countBytesWritten += r.serialize(currentOffset, _data); } @@ -85,7 +85,7 @@ public abstract class RecordAggregate extends RecordBase { public int getTotalSize() { return _totalSize; } - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { _totalSize += r.getRecordSize(); } } @@ -101,7 +101,7 @@ public abstract class RecordAggregate extends RecordBase { _rv = rv; _position = initialPosition; } - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { _position += r.getRecordSize(); _rv.visitRecord(r); } 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 21c9ad8436..738d1d9b13 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java @@ -52,7 +52,7 @@ public final class RowRecordsAggregate extends RecordAggregate { private int _lastrow = -1; private final Map _rowRecords; private final ValueRecordsAggregate _valuesAgg; - private final List _unknownRecords; + private final List _unknownRecords; private final SharedValueManager _sharedValueManager; // Cache values to speed up performance of @@ -116,7 +116,7 @@ public final class RowRecordsAggregate extends RecordAggregate { /** * Handles UnknownRecords which appear within the row/cell records */ - private void addUnknownRecord(Record rec) { + private void addUnknownRecord(org.apache.poi.hssf.record.Record rec) { // ony a few distinct record IDs are encountered by the existing POI test cases: // 0x1065 // many // 0x01C2 // several diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java index c54b4f0c74..8a416cdb7b 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java @@ -251,7 +251,7 @@ public final class ValueRecordsAggregate implements Iterable records = new ArrayList<>(); + List records = new ArrayList<>(); records.add( createMSDrawingObjectRecord() ); records.add( createOBJRecord() ); records.add( createBOFRecord() ); @@ -227,7 +227,7 @@ public final class HSSFChart { } else if(r instanceof ValueRangeRecord){ lastChart.valueRanges.add((ValueRangeRecord)r); } else if (r instanceof Record) { - Record record = (Record) r; + Record record = (org.apache.poi.hssf.record.Record) r; for (HSSFChartType type : HSSFChartType.values()) { if (type == HSSFChartType.Unknown) { continue; @@ -440,7 +440,7 @@ public final class HSSFChart { return new UnknownRecord((short)0x00EC, data); } - private void createAxisRecords( List records ) + private void createAxisRecords( List records ) { records.add( createAxisParentRecord() ); records.add( createBeginRecord() ); @@ -1244,7 +1244,7 @@ public final class HSSFChart { } newRecord = seriesTextRecord; } else if (record instanceof Record) { - newRecord = (Record) ((Record)record).copy(); + newRecord = (org.apache.poi.hssf.record.Record) ((org.apache.poi.hssf.record.Record)record).copy(); } if (newRecord != null) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 49ba575466..b570a68c47 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -231,7 +231,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { } if (log.check( POILogger.DEBUG )) { if (cval instanceof Record) { - log.log( DEBUG, "record id = " + Integer.toHexString( ( (Record) cval ).getSid() ) ); + log.log( DEBUG, "record id = " + Integer.toHexString( ( (org.apache.poi.hssf.record.Record) cval ).getSid() ) ); } else { log.log( DEBUG, "record = " + cval ); } @@ -438,7 +438,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { private HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(getWorkbook()); @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { if (!(r instanceof DVRecord)) { return; } @@ -1773,7 +1773,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { // add logic for hyperlinks etc, like in shiftRows() } - protected void insertChartRecords(List records) { + protected void insertChartRecords(List records) { int window2Loc = _sheet.findFirstRecordLocBySid(WindowTwoRecord.sid); _sheet.getRecords().addAll(window2Loc, records); } diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 78a4e4fd9e..44a1615f63 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -340,7 +340,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss // it happens to be spelled. InputStream stream = directory.createDocumentInputStream(workbookName); - List records = RecordFactory.createRecords(stream); + List records = RecordFactory.createRecords(stream); workbook = InternalWorkbook.createWorkbook(records); setPropertiesFromWorkbook(workbook); @@ -428,7 +428,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss * @see org.apache.poi.hssf.record.SSTRecord */ - private void convertLabelRecords(List records, int offset) + private void convertLabelRecords(List records, int offset) { if (log.check( POILogger.DEBUG )) { log.log(POILogger.DEBUG, "convertLabelRecords called"); @@ -1419,7 +1419,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss */ private static final class SheetRecordCollector implements RecordVisitor { - private List _list; + private List _list; private int _totalSize; public SheetRecordCollector() { @@ -1430,14 +1430,14 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss return _totalSize; } @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { _list.add(r); _totalSize+=r.getRecordSize(); } public int serialize(int offset, byte[] data) { int result = 0; - for (Record rec : _list) { + for (org.apache.poi.hssf.record.Record rec : _list) { result += rec.serialize(offset + result, data); } return result; @@ -1952,7 +1952,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss { // The drawing group record always exists at the top level, so we won't need to do this recursively. List pictures = new ArrayList<>(); - for (Record r : workbook.getRecords()) { + for (org.apache.poi.hssf.record.Record r : workbook.getRecords()) { if (r instanceof AbstractEscherHolderRecord) { ((AbstractEscherHolderRecord) r).decode(); List escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords(); diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java index 7e5f3e26bc..e80cbc18ec 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java @@ -75,7 +75,7 @@ public final class SlideIdListing { SlideListWithText[] slwts = document.getSlideListWithTexts(); for (SlideListWithText slwt : slwts) { Record[] cr = slwt.getChildRecords(); - for (Record record : cr) { + for (org.apache.poi.hslf.record.Record record : cr) { if (record instanceof SlidePersistAtom) { SlidePersistAtom spa = (SlidePersistAtom) record; System.out.println("SlidePersistAtom knows about slide:"); @@ -117,7 +117,7 @@ public final class SlideIdListing { // Find any persist ones first int pos = 0; - for (Record r : records) { + for (org.apache.poi.hslf.record.Record r : records) { if (r.getRecordType() == 6001L) { // PersistPtrFullBlock System.out.println("Found PersistPtrFullBlock at " + pos + " (" + Integer.toHexString(pos) + ")"); @@ -159,7 +159,7 @@ public final class SlideIdListing { // Finds the record at a given position - public static Record findRecordAtPos(int pos) { + public static org.apache.poi.hslf.record.Record findRecordAtPos(int pos) { long type = LittleEndian.getUShort(fileContents, pos+2); long rlen = LittleEndian.getUInt(fileContents, pos+4); diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java index 86c2335146..d1699779f0 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java @@ -146,7 +146,7 @@ public final class SlideShowRecordDumper { return ret.toString(); } - public int getDiskLen(Record r) throws IOException { + public int getDiskLen(org.apache.poi.hslf.record.Record r) throws IOException { int diskLen = 0; if (r != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -156,7 +156,7 @@ public final class SlideShowRecordDumper { return diskLen; } - public String getPrintableRecordContents(Record r) throws IOException { + public String getPrintableRecordContents(org.apache.poi.hslf.record.Record r) throws IOException { if (r == null) { return "<>"; } @@ -228,7 +228,7 @@ public final class SlideShowRecordDumper { public void walkTree(int depth, int pos, Record[] records, int indent) throws IOException { String ind = tabs.substring(0, indent); - for (Record r : records) { + for (org.apache.poi.hslf.record.Record r : records) { if (r == null) { ps.println(ind + "At position " + pos + " (" + makeHex(pos, 6) + "):"); ps.println(ind + "Warning! Null record found."); diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/TextStyleListing.java b/src/scratchpad/src/org/apache/poi/hslf/dev/TextStyleListing.java index c040499b0d..8df3ef0f01 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/TextStyleListing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/TextStyleListing.java @@ -44,7 +44,7 @@ public final class TextStyleListing { try (HSLFSlideShowImpl ss = new HSLFSlideShowImpl(args[0])) { // Find the documents, and then their SLWT Record[] records = ss.getRecords(); - for (Record record : records) { + for (org.apache.poi.hslf.record.Record record : records) { if (record.getRecordType() == 1000L) { Record[] docChildren = record.getChildRecords(); for (Record docChild : docChildren) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java b/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java index e50a23aac9..116582e7f3 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java @@ -50,7 +50,7 @@ public final class UserEditAndPersistListing { // Find any persist ones first int pos = 0; - for (Record r : ss.getRecords()) { + for (org.apache.poi.hslf.record.Record r : ss.getRecords()) { if (r.getRecordType() == 6001L) { // PersistPtrFullBlock System.out.println("Found PersistPtrFullBlock at " + pos + " (" + Integer.toHexString(pos) + ")"); @@ -88,7 +88,7 @@ public final class UserEditAndPersistListing { pos = 0; // Now look for UserEditAtoms - for (Record r : ss.getRecords()) { + for (org.apache.poi.hslf.record.Record r : ss.getRecords()) { if (r instanceof UserEditAtom) { UserEditAtom uea = (UserEditAtom) r; System.out.println("Found UserEditAtom at " + pos + " (" + Integer.toHexString(pos) + ")"); @@ -118,7 +118,7 @@ public final class UserEditAndPersistListing { // Finds the record at a given position - public static Record findRecordAtPos(int pos) { + public static org.apache.poi.hslf.record.Record findRecordAtPos(int pos) { long type = LittleEndian.getUShort(fileContents, pos+2); long rlen = LittleEndian.getUInt(fileContents, pos+4); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java b/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java index e9dc5cd955..01f641d303 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java @@ -71,7 +71,7 @@ public final class AnimationInfo extends RecordContainer { _header[0] = 0x0f; // We are a container record LittleEndian.putShort(_header, 2, (short)getRecordType()); - _children = new Record[1]; + _children = new org.apache.poi.hslf.record.Record[1]; _children[0] = animationAtom = new AnimationInfoAtom(); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Comment2000.java b/src/scratchpad/src/org/apache/poi/hslf/record/Comment2000.java index 9dc836bf53..ed8237b38f 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Comment2000.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Comment2000.java @@ -105,7 +105,7 @@ public final class Comment2000 extends RecordContainer { System.arraycopy(source,start,_header,0,8); // Find our children - _children = Record.findChildRecords(source,start+8,len-8); + _children = org.apache.poi.hslf.record.Record.findChildRecords(source,start+8,len-8); findInterestingChildren(); } @@ -116,7 +116,7 @@ public final class Comment2000 extends RecordContainer { */ private void findInterestingChildren() { - for(Record r : _children){ + for(org.apache.poi.hslf.record.Record r : _children){ if (r instanceof CString){ CString cs = (CString)r; int recInstance = cs.getOptions() >> 4; @@ -140,7 +140,7 @@ public final class Comment2000 extends RecordContainer { */ public Comment2000() { _header = new byte[8]; - _children = new Record[4]; + _children = new org.apache.poi.hslf.record.Record[4]; // Setup our header block _header[0] = 0x0f; // We are a container record diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/DocInfoListContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/DocInfoListContainer.java index e046161f41..e10e864724 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/DocInfoListContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/DocInfoListContainer.java @@ -60,7 +60,7 @@ public final class DocInfoListContainer extends RecordContainer { */ private DocInfoListContainer() { _header = new byte[8]; - _children = new Record[0]; + _children = new org.apache.poi.hslf.record.Record[0]; // Setup our header block _header[0] = 0x0f; // We are a container record diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/EscherTextboxWrapper.java b/src/scratchpad/src/org/apache/poi/hslf/record/EscherTextboxWrapper.java index 783c59e496..7cfe763f98 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/EscherTextboxWrapper.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/EscherTextboxWrapper.java @@ -57,7 +57,7 @@ public final class EscherTextboxWrapper extends RecordContainer { // Find the child records in the escher data byte[] data = _escherRecord.getData(); _children = Record.findChildRecords(data,0,data.length); - for (Record r : this._children) { + for (org.apache.poi.hslf.record.Record r : this._children) { if (r instanceof StyleTextPropAtom) { this.styleTextPropAtom = (StyleTextPropAtom) r; } } } @@ -70,7 +70,7 @@ public final class EscherTextboxWrapper extends RecordContainer { _escherRecord.setRecordId(EscherTextboxRecord.RECORD_ID); _escherRecord.setOptions((short)15); - _children = new Record[0]; + _children = new org.apache.poi.hslf.record.Record[0]; } @@ -90,7 +90,7 @@ public final class EscherTextboxWrapper extends RecordContainer { // Grab the children's data ByteArrayOutputStream baos = new ByteArrayOutputStream(); - for (Record r : _children) r.writeOut(baos); + for (org.apache.poi.hslf.record.Record r : _children) r.writeOut(baos); byte[] data = baos.toByteArray(); // Save in the escher layer diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java index 2449adb6c9..099aeb854b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java @@ -34,7 +34,7 @@ public class ExEmbed extends RecordContainer { private final byte[] _header; // Links to our more interesting children - private RecordAtom embedAtom; + public org.apache.poi.hslf.record.RecordAtom embedAtom; private ExOleObjAtom oleObjAtom; private CString menuName; private CString progId; @@ -74,7 +74,7 @@ public class ExEmbed extends RecordContainer { */ public ExEmbed() { _header = new byte[8]; - _children = new Record[5]; + _children = new org.apache.poi.hslf.record.Record[5]; // Setup our header block _header[0] = 0x0f; // We are a container record @@ -222,7 +222,7 @@ public class ExEmbed extends RecordContainer { } boolean found = false; - for (final Record r : _children) { + for (final org.apache.poi.hslf.record.Record r : _children) { // for simplicity just check for object identity if (r == newStr) { found = true; diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java index da25e248bf..37c47824e4 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java @@ -137,7 +137,7 @@ public class ExHyperlink extends RecordContainer { */ public ExHyperlink() { _header = new byte[8]; - _children = new Record[3]; + _children = new org.apache.poi.hslf.record.Record[3]; // Setup our header block _header[0] = 0x0f; // We are a container record diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExMCIMovie.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExMCIMovie.java index 7d24175879..b83e0f8184 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExMCIMovie.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExMCIMovie.java @@ -57,7 +57,7 @@ public class ExMCIMovie extends RecordContainer { // TODO - instantiable supercl LittleEndian.putShort(_header, 2, (short) getRecordType()); exVideo = new ExVideoContainer(); - _children = new Record[]{exVideo}; + _children = new org.apache.poi.hslf.record.Record[]{exVideo}; } 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 1c5fb4c4c4..f57461cf18 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java @@ -85,7 +85,7 @@ public class ExObjList extends RecordContainer { */ public ExObjList() { _header = new byte[8]; - _children = new Record[1]; + _children = new org.apache.poi.hslf.record.Record[1]; // Setup our header block _header[0] = 0x0f; // We are a container record diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java index 473201f26c..1e9031cba2 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java @@ -78,7 +78,7 @@ public final class ExVideoContainer extends RecordContainer { _header[0] = 0x0f; // We are a container record LittleEndian.putShort(_header, 2, (short)getRecordType()); - _children = new Record[2]; + _children = new org.apache.poi.hslf.record.Record[2]; _children[0] = mediaAtom = new ExMediaAtom(); _children[1] = pathAtom = new CString(); } 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 c712753800..4bd0b0547c 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java @@ -52,7 +52,7 @@ public final class FontCollection extends RecordContainer { _children = Record.findChildRecords(source,start+8,len-8); - for (Record r : _children){ + for (org.apache.poi.hslf.record.Record r : _children){ if(r instanceof FontEntityAtom) { HSLFFontInfo fi = new HSLFFontInfo((FontEntityAtom) r); fonts.put(fi.getIndex(), fi); 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 28043ce281..3f1b0fbe3d 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java @@ -41,7 +41,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { //arbitrarily selected; may need to increase private static final int MAX_RECORD_LENGTH = 1_000_000; - private final List _childRecords = new ArrayList<>(); + private final List _childRecords = new ArrayList<>(); public HSLFEscherClientDataRecord() {} @@ -99,7 +99,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { public byte[] getRemainingData() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { - for (Record r : _childRecords) { + for (org.apache.poi.hslf.record.Record r : _childRecords) { r.writeOut(bos); } } catch (IOException e) { @@ -113,7 +113,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { _childRecords.clear(); int offset = 0; while (offset < remainingData.length) { - final Record r = Record.buildRecordAtOffset(remainingData, offset); + final org.apache.poi.hslf.record.Record r = Record.buildRecordAtOffset(remainingData, offset); if (r != null) { _childRecords.add(r); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/HeadersFootersContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/HeadersFootersContainer.java index c7aa32876b..b974bb35bb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/HeadersFootersContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/HeadersFootersContainer.java @@ -104,7 +104,7 @@ public final class HeadersFootersContainer extends RecordContainer { LittleEndian.putShort(_header, 2, (short)getRecordType()); hdAtom = new HeadersFootersAtom(); - _children = new Record[]{ + _children = new org.apache.poi.hslf.record.Record[]{ hdAtom }; csDate = csHeader = csFooter = null; @@ -198,7 +198,7 @@ public final class HeadersFootersContainer extends RecordContainer { csHeader = new CString(); csHeader.setOptions(HEADERATOM << 4); - Record r = hdAtom; + org.apache.poi.hslf.record.Record r = hdAtom; if(csDate != null) r = hdAtom; addChildAfter(csHeader, r); @@ -216,7 +216,7 @@ public final class HeadersFootersContainer extends RecordContainer { csFooter = new CString(); csFooter.setOptions(FOOTERATOM << 4); - Record r = hdAtom; + org.apache.poi.hslf.record.Record r = hdAtom; if(csHeader != null) r = csHeader; else if(csDate != null) r = csDate; addChildAfter(csFooter, r); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java b/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java index 9c0962c644..440005b479 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java @@ -73,7 +73,7 @@ public class InteractiveInfo extends RecordContainer { */ public InteractiveInfo() { _header = new byte[8]; - _children = new Record[1]; + _children = new org.apache.poi.hslf.record.Record[1]; // Setup our header block _header[0] = 0x0f; // We are a container record 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 01bb78eb7e..2bb40a812a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java @@ -168,7 +168,7 @@ public final class PPDrawing extends RecordAtom implements Iterable findInProgBinaryTag(Record r) { + private static Stream findInProgBinaryTag(org.apache.poi.hslf.record.Record r) { Record[] ch = r.getChildRecords(); if (ch != null && ch.length == 2 && @@ -253,7 +253,7 @@ public final class PPDrawing extends RecordAtom implements Iterable sameHSLF(RecordTypes type) { + private static Predicate sameHSLF(RecordTypes type) { return (p) -> p.getRecordType() == type.typeID; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java index 8f244607b0..672be6c0cf 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java @@ -73,7 +73,7 @@ public final class PPDrawingGroup extends RecordAtom { /** * We're pretending to be an atom, so return null */ - public Record[] getChildRecords() { + public org.apache.poi.hslf.record.Record[] getChildRecords() { return null; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ParentAwareRecord.java b/src/scratchpad/src/org/apache/poi/hslf/record/ParentAwareRecord.java index c71699f35b..b2d84373cb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ParentAwareRecord.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ParentAwareRecord.java @@ -24,6 +24,6 @@ package org.apache.poi.hslf.record; * @author Nick Burch (nick at torchbox dot com) */ public interface ParentAwareRecord { - public RecordContainer getParentRecord(); + public org.apache.poi.hslf.record.RecordContainer getParentRecord(); public void setParentRecord(RecordContainer parentRecord); } 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 fb241568fb..cf6b738ddb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Record.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Record.java @@ -79,7 +79,7 @@ public abstract class Record implements GenericRecord } @Override - public List getGenericChildren() { + public List getGenericChildren() { Record[] recs = getChildRecords(); return (recs == null) ? null : Arrays.asList(recs); } @@ -107,7 +107,7 @@ public abstract class Record implements GenericRecord * @param b The byte array to build from * @param offset The offset to build at */ - public static Record buildRecordAtOffset(byte[] b, int offset) { + public static org.apache.poi.hslf.record.Record buildRecordAtOffset(byte[] b, int offset) { long type = LittleEndian.getUShort(b,offset+2); long rlen = LittleEndian.getUInt(b,offset+4); @@ -122,7 +122,7 @@ public abstract class Record implements GenericRecord * Default method for finding child records of a container record */ public static Record[] findChildRecords(byte[] b, int start, int len) { - List children = new ArrayList<>(5); + List children = new ArrayList<>(5); // Jump our little way along, creating records as we go int pos = start; @@ -149,7 +149,7 @@ public abstract class Record implements GenericRecord } // Turn the vector into an array, and return - return children.toArray(new Record[0]); + return children.toArray(new org.apache.poi.hslf.record.Record[0]); } /** @@ -161,7 +161,7 @@ public abstract class Record implements GenericRecord * (not including the size of the header), this code assumes you're * passing in corrected lengths */ - public static Record createRecordForType(long type, byte[] b, int start, int len) { + public static org.apache.poi.hslf.record.Record createRecordForType(long type, byte[] b, int start, int len) { // We use the RecordTypes class to provide us with the right // class to use for a given type // A spot of reflection gets us the (byte[],int,int) constructor diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/RecordAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/RecordAtom.java index 964d3d1c45..4de227a2c2 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordAtom.java @@ -33,5 +33,5 @@ public abstract class RecordAtom extends Record /** * We're an atom, returns null */ - public Record[] getChildRecords() { return null; } + public org.apache.poi.hslf.record.Record[] getChildRecords() { return null; } } 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 546c07691b..271bb9631d 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java @@ -42,7 +42,7 @@ public abstract class RecordContainer extends Record * Return any children */ @Override - public Record[] getChildRecords() { return _children; } + public org.apache.poi.hslf.record.Record[] getChildRecords() { return _children; } /** * We're not an atom @@ -61,7 +61,7 @@ public abstract class RecordContainer extends Record */ private int findChildLocation(Record child) { int i=0; - for(Record r : _children) { + for(org.apache.poi.hslf.record.Record r : _children) { if (r.equals(child)) { return i; } @@ -77,7 +77,7 @@ public abstract class RecordContainer extends Record */ private int appendChild(Record newChild) { // Copy over, and pop the child in at the end - Record[] nc = new Record[(_children.length + 1)]; + Record[] nc = new org.apache.poi.hslf.record.Record[(_children.length + 1)]; System.arraycopy(_children, 0, nc, 0, _children.length); // Switch the arrays nc[_children.length] = newChild; @@ -125,8 +125,8 @@ public abstract class RecordContainer extends Record * or null if none of the child records are of the * given type. Does not descend. */ - public Record findFirstOfType(long type) { - for (Record r : _children) { + public org.apache.poi.hslf.record.Record findFirstOfType(long type) { + for (org.apache.poi.hslf.record.Record r : _children) { if (r.getRecordType() == type) { return r; } @@ -140,17 +140,17 @@ public abstract class RecordContainer extends Record * @param ch the child to remove * @return the removed record */ - public Record removeChild(Record ch) { - Record rm = null; - ArrayList lst = new ArrayList<>(); - for(Record r : _children) { + public org.apache.poi.hslf.record.Record removeChild(Record ch) { + org.apache.poi.hslf.record.Record rm = null; + ArrayList lst = new ArrayList<>(); + for(org.apache.poi.hslf.record.Record r : _children) { if(r != ch) { lst.add(r); } else { rm = r; } } - _children = lst.toArray(new Record[0]); + _children = lst.toArray(new org.apache.poi.hslf.record.Record[0]); return rm; } @@ -278,7 +278,7 @@ public abstract class RecordContainer extends Record * * @param records the new child records */ - public void setChildRecord(Record[] records) { + public void setChildRecord(org.apache.poi.hslf.record.Record[] records) { this._children = records.clone(); } @@ -360,7 +360,7 @@ public abstract class RecordContainer extends Record */ public static void handleParentAwareRecords(RecordContainer br) { // Loop over child records, looking for interesting ones - for (Record record : br.getChildRecords()) { + for (org.apache.poi.hslf.record.Record record : br.getChildRecords()) { // Tell parent aware records of their parent if (record instanceof ParentAwareRecord) { ((ParentAwareRecord) record).setParentRecord(br); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Slide.java b/src/scratchpad/src/org/apache/poi/hslf/record/Slide.java index a833c4016a..4534de034a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Slide.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Slide.java @@ -92,7 +92,7 @@ public final class Slide extends SheetContainer ColorSchemeAtom colorAtom = new ColorSchemeAtom(); - _children = new Record[] { + _children = new org.apache.poi.hslf.record.Record[] { slideAtom, ppDrawing, colorAtom 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 268145d31c..516bbda7b0 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java @@ -96,7 +96,7 @@ public final class SlideListWithText extends RecordContainer { // Create a SlideAtomsSets, not caring if they're empty //if(emptySet) { continue; } - Record[] spaChildren = new Record[clen]; + org.apache.poi.hslf.record.Record[] spaChildren = new org.apache.poi.hslf.record.Record[clen]; System.arraycopy(_children,i+1,spaChildren,0,clen); SlideAtomsSet set = new SlideAtomsSet((SlidePersistAtom)_children[i],spaChildren); sets.add(set); @@ -120,7 +120,7 @@ public final class SlideListWithText extends RecordContainer { LittleEndian.putInt(_header, 4, 0); // We have no children to start with - _children = new Record[0]; + _children = new org.apache.poi.hslf.record.Record[0]; slideAtomsSets = new SlideAtomsSet[0]; } @@ -133,7 +133,7 @@ public final class SlideListWithText extends RecordContainer { // Add the new SlidePersistAtom at the end appendChildRecord(spa); - SlideAtomsSet newSAS = new SlideAtomsSet(spa, new Record[0]); + SlideAtomsSet newSAS = new SlideAtomsSet(spa, new org.apache.poi.hslf.record.Record[0]); // Update our SlideAtomsSets with this SlideAtomsSet[] sas = new SlideAtomsSet[slideAtomsSets.length+1]; @@ -186,15 +186,15 @@ public final class SlideListWithText extends RecordContainer { */ public static class SlideAtomsSet { private SlidePersistAtom slidePersistAtom; - private Record[] slideRecords; + private org.apache.poi.hslf.record.Record[] slideRecords; /** Get the SlidePersistAtom, which gives details on the Slide this text is associated with */ public SlidePersistAtom getSlidePersistAtom() { return slidePersistAtom; } /** Get the Text related records for this slide */ - public Record[] getSlideRecords() { return slideRecords; } + public org.apache.poi.hslf.record.Record[] getSlideRecords() { return slideRecords; } /** Create one to hold the Records for one Slide's text */ - public SlideAtomsSet(SlidePersistAtom s, Record[] r) { + public SlideAtomsSet(SlidePersistAtom s, org.apache.poi.hslf.record.Record[] r) { slidePersistAtom = s; slideRecords = r.clone(); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/TextHeaderAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/TextHeaderAtom.java index 3264b78793..3a2d01adfb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/TextHeaderAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/TextHeaderAtom.java @@ -36,7 +36,7 @@ import org.apache.poi.util.LittleEndian; public final class TextHeaderAtom extends RecordAtom implements ParentAwareRecord { public static final long _type = RecordTypes.TextHeaderAtom.typeID; private byte[] _header; - private RecordContainer parentRecord; + public org.apache.poi.hslf.record.RecordContainer parentRecord; /** The kind of text it is */ private int textType; @@ -65,7 +65,7 @@ public final class TextHeaderAtom extends RecordAtom implements ParentAwareRecor public void setIndex(int index) { this.index = index; } @Override - public RecordContainer getParentRecord() { return parentRecord; } + public org.apache.poi.hslf.record.RecordContainer getParentRecord() { return parentRecord; } @Override public void setParentRecord(RecordContainer record) { this.parentRecord = record; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java b/src/scratchpad/src/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java index 237027b088..e483ce7424 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java @@ -68,7 +68,7 @@ public final class UnknownRecordPlaceholder extends RecordAtom /** * Return the value as enum we were given at creation */ - public RecordTypes getRecordTypeEnum() { + public org.apache.poi.hslf.record.RecordTypes getRecordTypeEnum() { return RecordTypes.forTypeID((int)_type); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/VBAInfoContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/VBAInfoContainer.java index 013ace9fed..cf9f6159cc 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/VBAInfoContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/VBAInfoContainer.java @@ -59,7 +59,7 @@ public final class VBAInfoContainer extends RecordContainer { */ private VBAInfoContainer() { _header = new byte[8]; - _children = new Record[0]; + _children = new org.apache.poi.hslf.record.Record[0]; // Setup our header block _header[0] = 0x0f; // We are a container record 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 2385a00c4e..0df60a215e 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFHyperlink.java @@ -340,7 +340,7 @@ public final class HSLFHyperlink implements Hyperlink records, ExObjList exobj, List out){ ListIterator iter = records.listIterator(); while (iter.hasNext()) { - Record r = iter.next(); + org.apache.poi.hslf.record.Record r = iter.next(); // see if we have InteractiveInfo in the textrun's records if (!(r instanceof InteractiveInfo)) { continue; diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java index 306da5fd41..af850ecd83 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java @@ -104,7 +104,7 @@ public final class HSLFObjectShape extends HSLFPictureShape implements ObjectSha HSLFEscherClientDataRecord cldata = getClientData(true); ExObjRefAtom uer = null; - for (Record r : cldata.getHSLFChildRecords()) { + for (org.apache.poi.hslf.record.Record r : cldata.getHSLFChildRecords()) { if (r.getRecordType() == RecordTypes.ExObjRefAtom.typeID) { uer = (ExObjRefAtom)r; break; diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java index 03458c4b2a..24011cc9aa 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java @@ -715,7 +715,7 @@ public abstract class HSLFShape implements Shape { public T getClientDataRecord(int recordType) { List records = getClientRecords(); - if (records != null) for (Record r : records) { + if (records != null) for (org.apache.poi.hslf.record.Record r : records) { if (r.getRecordType() == recordType){ return (T)r; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java index 9bd016187f..15273ddb05 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java @@ -162,7 +162,7 @@ public final class HSLFShapeFactory { @SuppressWarnings("unchecked") protected static T getClientDataRecord(EscherContainerRecord spContainer, int recordType) { HSLFEscherClientDataRecord cldata = spContainer.getChildById(EscherClientDataRecord.RECORD_ID); - if (cldata != null) for (Record r : cldata.getHSLFChildRecords()) { + if (cldata != null) for (org.apache.poi.hslf.record.Record r : cldata.getHSLFChildRecords()) { if (r.getRecordType() == recordType) { return (T)r; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java index 519bb3ac76..dc32a2d109 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java @@ -212,7 +212,7 @@ public class HSLFShapePlaceholderDetails extends HSLFPlaceholderDetails { throw new HSLFException("Placeholder aren't allowed for shape type: " + shape.getClass().getSimpleName()); } - for (Record r : clientData.getHSLFChildRecords()) { + for (org.apache.poi.hslf.record.Record r : clientData.getHSLFChildRecords()) { if (r instanceof OEPlaceholderAtom) { oePlaceholderAtom = (OEPlaceholderAtom)r; } else if (r instanceof RoundTripHFPlaceholder12) { 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 14d85b56f8..7d1b6711ee 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java @@ -412,7 +412,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide _sheetIdToCoreRecordsLookup; @@ -117,7 +117,7 @@ public final class HSLFSlideShow implements SlideShow mostRecentByBytes = new HashMap<>(); - for (Record record : _hslfSlideShow.getRecords()) { + for (org.apache.poi.hslf.record.Record record : _hslfSlideShow.getRecords()) { if (record instanceof PersistPtrHolder) { PersistPtrHolder pph = (PersistPtrHolder) record; @@ -200,7 +200,7 @@ public final class HSLFSlideShow implements SlideShow lst = new ArrayList<>(); + ArrayList lst = new ArrayList<>(); for (SlideAtomsSet s : sas) { lst.add(s.getSlidePersistAtom()); lst.addAll(Arrays.asList(s.getSlideRecords())); } - Record[] r = lst.toArray(new Record[0]); + org.apache.poi.hslf.record.Record[] r = lst.toArray(new org.apache.poi.hslf.record.Record[0]); slwt.setChildRecord(r); } @@ -646,7 +646,7 @@ public final class HSLFSlideShow implements SlideShow records = new ArrayList<>(); + List records = new ArrayList<>(); List sa = new ArrayList<>(Arrays.asList(sas)); HSLFSlide removedSlide = _slides.remove(index); @@ -666,7 +666,7 @@ public final class HSLFSlideShow implements SlideShow me : recordMap.descendingMap().entrySet()) { - Record r = me.getValue(); + org.apache.poi.hslf.record.Record r = me.getValue(); if (!(r instanceof UserEditAtom)) { continue; } @@ -99,7 +99,7 @@ public class HSLFSlideShowEncrypted implements Closeable { return; } - Record r = recordMap.get(userEditAtomWithEncryption.getPersistPointersOffset()); + org.apache.poi.hslf.record.Record r = recordMap.get(userEditAtomWithEncryption.getPersistPointersOffset()); assert(r instanceof PersistPtrHolder); PersistPtrHolder ptr = (PersistPtrHolder)r; @@ -138,7 +138,7 @@ public class HSLFSlideShowEncrypted implements Closeable { return (dea != null) ? dea.getEncryptionInfo() : null; } - protected OutputStream encryptRecord(OutputStream plainStream, int persistId, Record record) { + protected OutputStream encryptRecord(OutputStream plainStream, int persistId, org.apache.poi.hslf.record.Record record) { boolean isPlain = (dea == null || record instanceof UserEditAtom || record instanceof PersistPtrHolder @@ -359,7 +359,7 @@ public class HSLFSlideShowEncrypted implements Closeable { } } - protected Record[] updateEncryptionRecord(Record[] records) { + protected org.apache.poi.hslf.record.Record[] updateEncryptionRecord(org.apache.poi.hslf.record.Record[] records) { String password = Biff8EncryptionKey.getCurrentUserPassword(); if (password == null) { if (dea == null) { @@ -396,7 +396,7 @@ public class HSLFSlideShowEncrypted implements Closeable { * Before this method is called, make sure that the offsets are correct, * i.e. call {@link HSLFSlideShowImpl#updateAndWriteDependantRecords(OutputStream, Map)} */ - protected static Record[] normalizeRecords(Record[] records) { + protected static org.apache.poi.hslf.record.Record[] normalizeRecords(org.apache.poi.hslf.record.Record[] records) { // http://msdn.microsoft.com/en-us/library/office/gg615594(v=office.14).aspx // repeated slideIds can be overwritten, i.e. ignored @@ -406,7 +406,7 @@ public class HSLFSlideShowEncrypted implements Closeable { TreeMap recordMap = new TreeMap<>(); List obsoleteOffsets = new ArrayList<>(); int duplicatedCount = 0; - for (Record r : records) { + for (org.apache.poi.hslf.record.Record r : records) { assert(r instanceof PositionDependentRecord); PositionDependentRecord pdr = (PositionDependentRecord)r; if (pdr instanceof UserEditAtom) { @@ -452,17 +452,17 @@ public class HSLFSlideShowEncrypted implements Closeable { recordMap.remove(oldOffset); } - return recordMap.values().toArray(new Record[0]); + return recordMap.values().toArray(new org.apache.poi.hslf.record.Record[0]); } - protected static Record[] removeEncryptionRecord(Record[] records) { + protected static org.apache.poi.hslf.record.Record[] removeEncryptionRecord(org.apache.poi.hslf.record.Record[] records) { int deaSlideId = -1; int deaOffset = -1; PersistPtrHolder ptr = null; UserEditAtom uea = null; - List recordList = new ArrayList<>(); - for (Record r : records) { + List recordList = new ArrayList<>(); + for (org.apache.poi.hslf.record.Record r : records) { if (r instanceof DocumentEncryptionAtom) { deaOffset = ((DocumentEncryptionAtom)r).getLastOnDiskOffset(); continue; @@ -496,16 +496,16 @@ public class HSLFSlideShowEncrypted implements Closeable { uea.setMaxPersistWritten(maxSlideId); - records = recordList.toArray(new Record[0]); + records = recordList.toArray(new org.apache.poi.hslf.record.Record[0]); return records; } - protected static Record[] addEncryptionRecord(Record[] records, DocumentEncryptionAtom dea) { + protected static org.apache.poi.hslf.record.Record[] addEncryptionRecord(org.apache.poi.hslf.record.Record[] records, DocumentEncryptionAtom dea) { assert(dea != null); int ueaIdx = -1, ptrIdx = -1, deaIdx = -1, idx = -1; - for (Record r : records) { + for (org.apache.poi.hslf.record.Record r : records) { idx++; if (r instanceof UserEditAtom) { ueaIdx = idx; @@ -530,7 +530,7 @@ public class HSLFSlideShowEncrypted implements Closeable { uea.setEncryptSessionPersistIdRef(nextSlideId); uea.setMaxPersistWritten(nextSlideId); - Record[] newRecords = new Record[records.length + 1]; + org.apache.poi.hslf.record.Record[] newRecords = new org.apache.poi.hslf.record.Record[records.length + 1]; if (ptrIdx > 0) { System.arraycopy(records, 0, newRecords, 0, ptrIdx); } 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 7e0860573b..9ad2c7ccde 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java @@ -82,7 +82,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { private byte[] _docstream; // Low level contents - private Record[] _records; + private org.apache.poi.hslf.record.Record[] _records; // Raw Pictures contained in the pictures stream private List _pictures; @@ -251,7 +251,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { _records = read(_docstream, (int) currentUser.getCurrentEditOffset()); } - private Record[] read(byte[] docstream, int usrOffset) throws IOException { + private org.apache.poi.hslf.record.Record[] read(byte[] docstream, int usrOffset) throws IOException { //sort found records by offset. //(it is not necessary but SlideShow.findMostRecentCoreRecords() expects them sorted) NavigableMap records = new TreeMap<>(); // offset -> record @@ -261,7 +261,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { for (Map.Entry entry : records.entrySet()) { Integer offset = entry.getKey(); - Record record = entry.getValue(); + org.apache.poi.hslf.record.Record record = entry.getValue(); Integer persistId = persistIds.get(offset); if (record == null) { // all plain records have been already added, @@ -277,7 +277,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { } decryptData.close(); - return records.values().toArray(new Record[0]); + return records.values().toArray(new org.apache.poi.hslf.record.Record[0]); } private void initRecordOffsets(byte[] docstream, int usrOffset, NavigableMap recordMap, Map offset2id) { @@ -318,7 +318,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { } public DocumentEncryptionAtom getDocumentEncryptionAtom() { - for (Record r : _records) { + for (org.apache.poi.hslf.record.Record r : _records) { if (r instanceof DocumentEncryptionAtom) { return (DocumentEncryptionAtom) r; } @@ -470,7 +470,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { UserEditAtom usr = null; PersistPtrHolder ptr = null; CountingOS cos = new CountingOS(); - for (Record record : _records) { + for (org.apache.poi.hslf.record.Record record : _records) { // all top level records are position dependent assert (record instanceof PositionDependentRecord); PositionDependentRecord pdr = (PositionDependentRecord) record; @@ -512,7 +512,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { } try (HSLFSlideShowEncrypted encData = new HSLFSlideShowEncrypted(getDocumentEncryptionAtom())) { - for (Record record : _records) { + for (org.apache.poi.hslf.record.Record record : _records) { assert (record instanceof PositionDependentRecord); // We've already figured out their new location, and // told them that @@ -727,7 +727,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public synchronized int appendRootLevelRecord(Record newRecord) { int addedAt = -1; - Record[] r = new Record[_records.length + 1]; + org.apache.poi.hslf.record.Record[] r = new org.apache.poi.hslf.record.Record[_records.length + 1]; boolean added = false; for (int i = (_records.length - 1); i >= 0; i--) { if (added) { @@ -779,7 +779,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { /** * Returns an array of all the records found in the slideshow */ - public Record[] getRecords() { + public org.apache.poi.hslf.record.Record[] getRecords() { return _records; } @@ -824,7 +824,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { public HSLFObjectData[] getEmbeddedObjects() { if (_objects == null) { List objects = new ArrayList<>(); - for (Record r : _records) { + for (org.apache.poi.hslf.record.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 ad0762de7a..dda143735a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSoundData.java @@ -76,11 +76,11 @@ public final class HSLFSoundData { */ public static HSLFSoundData[] find(Document document){ ArrayList lst = new ArrayList<>(); - Record[] ch = document.getChildRecords(); + org.apache.poi.hslf.record.Record[] ch = document.getChildRecords(); for (int i = 0; i < ch.length; i++) { if(ch[i].getRecordType() == RecordTypes.SoundCollection.typeID){ RecordContainer col = (RecordContainer)ch[i]; - Record[] sr = col.getChildRecords(); + org.apache.poi.hslf.record.Record[] sr = col.getChildRecords(); for (int j = 0; j < sr.length; j++) { if(sr[j] instanceof Sound){ lst.add(new HSLFSoundData((Sound)sr[j])); 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 b6e6298cd7..7923ced34a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java @@ -267,7 +267,7 @@ public final class HSLFTextParagraph implements TextParagraph= records.length) { logger.log(POILogger.INFO, "header atom wasn't found - container might contain only an OutlineTextRefAtom"); - return new Record[0]; + return new org.apache.poi.hslf.record.Record[0]; } int length; for (length = 1; startIdx[0] + length < records.length; length++) { - Record r = records[startIdx[0]+length]; + org.apache.poi.hslf.record.Record r = records[startIdx[0]+length]; if (r instanceof TextHeaderAtom || r instanceof SlidePersistAtom) { break; } } - Record[] result = new Record[length]; + org.apache.poi.hslf.record.Record[] result = new org.apache.poi.hslf.record.Record[length]; System.arraycopy(records, startIdx[0], result, 0, length); startIdx[0] += length; @@ -932,7 +932,7 @@ public final class HSLFTextParagraph implements TextParagraph> findTextParagraphs(Record[] records) { + protected static List> findTextParagraphs(org.apache.poi.hslf.record.Record[] records) { List> paragraphCollection = new ArrayList<>(); int[] recordIdx = { 0 }; @@ -1415,7 +1415,7 @@ public final class HSLFTextParagraph implements TextParagraph paras = tx.getTextParagraphs(); //verify that records cached in TextRun and EscherTextboxWrapper are the same - Record[] runChildren = paras.get(0).getRecords(); - Record[] txboxChildren = tx.getEscherTextboxWrapper().getChildRecords(); + org.apache.poi.hslf.record.Record[] runChildren = paras.get(0).getRecords(); + org.apache.poi.hslf.record.Record[] txboxChildren = tx.getEscherTextboxWrapper().getChildRecords(); assertEquals(runChildren.length, txboxChildren.length); for(int i=0; i < txboxChildren.length; i++){ assertSame(txboxChildren[i], runChildren[i]); diff --git a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java index f47104c225..8a80b78393 100644 --- a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java +++ b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java @@ -95,7 +95,7 @@ public final class TestAbortableListener { lastRecordSeen = null; } @Override - public short abortableProcessRecord(Record record) { + public short abortableProcessRecord(org.apache.poi.hssf.record.Record record) { countSeen++; lastRecordSeen = record; diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java index ca45d61501..d639c2c3f8 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java @@ -61,7 +61,7 @@ public final class TestEventWorkbookBuilder { } } - private void addFormulaRecord(Record r) { + private void addFormulaRecord(org.apache.poi.hssf.record.Record r) { if (r instanceof FormulaRecord) { fRecs.add((FormulaRecord)r); } diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java index 89efb527f5..ad9640647d 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java @@ -82,7 +82,7 @@ public final class TestFormatTrackingHSSFListener { // Now check we can turn all the numeric // cells into strings without error - for(Record r : mockListen._records) { + for(org.apache.poi.hssf.record.Record r : mockListen._records) { CellValueRecordInterface cvr = null; if(r instanceof NumberRecord) { @@ -106,10 +106,10 @@ public final class TestFormatTrackingHSSFListener { private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} - private final List _records = new ArrayList<>(); + private final List _records = new ArrayList<>(); @Override - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { _records.add(record); } } diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java index 6ad37f618e..f3d4569963 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java @@ -47,7 +47,7 @@ import org.junit.Test; * Testing for {@link HSSFEventFactory} */ public final class TestHSSFEventFactory { - private final List records = new ArrayList<>(); + private final List records = new ArrayList<>(); private void openSample(String sampleFileName) throws IOException { records.clear(); @@ -132,7 +132,7 @@ public final class TestHSSFEventFactory { // Has one sheet, with values 1,2,3 in column A rows 1-3 boolean hasSheet = false, hasA1 = false, hasA2 = false, hasA3 = false; - for (Record r : records) { + for (org.apache.poi.hssf.record.Record r : records) { if (r instanceof BoundSheetRecord) { BoundSheetRecord bsr = (BoundSheetRecord) r; assertEquals("Sheet1", bsr.getSheetname()); diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java index 0b1fff72bf..29be9baab2 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java @@ -48,7 +48,7 @@ import org.junit.Test; */ public final class TestMissingRecordAwareHSSFListener { - private final List _records = new ArrayList<>(); + private final List _records = new ArrayList<>(); private void readRecords(String sampleFileName) throws IOException { _records.clear(); @@ -103,7 +103,7 @@ public final class TestMissingRecordAwareHSSFListener { readRecords("MRExtraLines.xls"); int rowCount=0; - for (Record rec : _records) { + for (org.apache.poi.hssf.record.Record rec : _records) { if (rec instanceof LastCellOfRowDummyRecord) { LastCellOfRowDummyRecord eor = (LastCellOfRowDummyRecord) rec; assertEquals(rowCount, eor.getRow()); @@ -158,10 +158,10 @@ public final class TestMissingRecordAwareHSSFListener { assertEquals(exp, act); } - private int lastIndexOf(Predicate pre) { + private int lastIndexOf(Predicate pre) { int found = -1; int i = 0; - for (Record r : _records) { + for (org.apache.poi.hssf.record.Record r : _records) { if (pre.test(r)) { found = i; } @@ -173,7 +173,7 @@ public final class TestMissingRecordAwareHSSFListener { private String digest(int start, int len) { StringBuilder sb = new StringBuilder(len*10); int lastRow = -1; - for (Record r : _records.subList(start, start+len+1)) { + for (org.apache.poi.hssf.record.Record r : _records.subList(start, start+len+1)) { String dig = null; int row = -1; if (r instanceof RowRecord) { @@ -221,7 +221,7 @@ public final class TestMissingRecordAwareHSSFListener { return sb.toString(); } - private long matches(Predicate r) { + private long matches(Predicate r) { return _records.stream().filter(r).count(); } } diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java index abc58d3f7d..f655e953ab 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java +++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java @@ -113,7 +113,7 @@ public class TestDrawingAggregate { byte[] getRawBytes(){ ByteArrayOutputStream out = new ByteArrayOutputStream(); for (RecordBase rb : aggRecords) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; try { out.write(r.serialize()); } catch (IOException e) { @@ -255,7 +255,7 @@ public class TestDrawingAggregate { private static byte[] toByteArray(List records) { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (RecordBase rb : records) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; try { out.write(r.serialize()); } catch (IOException e) { @@ -370,7 +370,7 @@ public class TestDrawingAggregate { byte[] dgBytes = toByteArray(dgRecords); for (RecordBase rb : dgRecords) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; short sid = r.getSid(); // we expect that drawing block consists of either // DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord @@ -435,7 +435,7 @@ public class TestDrawingAggregate { // records to be aggregated List dgRecords = records.subList(19, 26); for (RecordBase rb : dgRecords) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; short sid = r.getSid(); // we expect that drawing block consists of either // DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord @@ -493,8 +493,8 @@ public class TestDrawingAggregate { assertSame(r1.getClass(), r2.getClass()); assertEquals(r1.getRecordSize(), r2.getRecordSize()); if (r1 instanceof Record) { - assertEquals(((Record) r1).getSid(), ((Record) r2).getSid()); - assertArrayEquals(((Record) r1).serialize(), ((Record) r2).serialize()); + assertEquals(((org.apache.poi.hssf.record.Record) r1).getSid(), ((org.apache.poi.hssf.record.Record) r2).getSid()); + assertArrayEquals(((org.apache.poi.hssf.record.Record) r1).serialize(), ((org.apache.poi.hssf.record.Record) r2).serialize()); } } } @@ -520,7 +520,7 @@ public class TestDrawingAggregate { // records to be aggregated List dgRecords = records.subList(19, 39); for (RecordBase rb : dgRecords) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; short sid = r.getSid(); // we expect that drawing block consists of either // DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord @@ -581,7 +581,7 @@ public class TestDrawingAggregate { // records to be aggregated List dgRecords = records.subList(22, 300); for (RecordBase rb : dgRecords) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; short sid = r.getSid(); // we expect that drawing block consists of either // DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord @@ -723,7 +723,7 @@ public class TestDrawingAggregate { "fvcr1v8aFU6POn+OCqfj4ffS/e+pcOEMKhABrCdUAAPhwB+pQHYGFcT/BBUEz6LC/wGpc+eRNSkAAA=="; byte[] dgBytes = decompress(data); - List dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); + List dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); assertEquals(20, dgRecords.size()); short[] expectedSids = { @@ -901,7 +901,7 @@ public class TestDrawingAggregate { "BPza/oPKABD5z4SARKQEELP1WQsFMc+QwP8ATkmhK404AAA="; byte[] dgBytes = decompress(data); - List dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); + List dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); assertEquals(14, dgRecords.size()); short[] expectedSids = { diff --git a/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java b/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java index c0b00c2c64..a3776e5bdc 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java @@ -44,7 +44,7 @@ public class TestEscherRecordFactory { private static byte[] toByteArray(List records) { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (RecordBase rb : records) { - Record r = (Record) rb; + Record r = (org.apache.poi.hssf.record.Record) rb; try { out.write(r.serialize()); } catch (IOException e) { diff --git a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java index c43c0fd843..3ff44152ac 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java +++ b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java @@ -127,7 +127,7 @@ public final class TestLinkTable { SupBookRecord.createAddInFunctions(), new SSTRecord(), }; - List recList = Arrays.asList(recs); + List recList = Arrays.asList(recs); WorkbookRecordList wrl = new WorkbookRecordList(); // Bug 47001b: Expected an EXTERNSHEET record but got (org.apache.poi.hssf.record.SSTRecord) @@ -145,7 +145,7 @@ public final class TestLinkTable { new NameCommentRecord("name2", "comment2"), }; - final List recList = Arrays.asList(recs); + final List recList = Arrays.asList(recs); final WorkbookRecordList wrl = new WorkbookRecordList(); final Map commentRecords = new LinkedHashMap<>(); diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheet.java b/src/testcases/org/apache/poi/hssf/model/TestSheet.java index 9bd9f1eb4c..8042be6e0e 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestSheet.java +++ b/src/testcases/org/apache/poi/hssf/model/TestSheet.java @@ -50,24 +50,24 @@ import org.junit.Test; * Unit test for the {@link InternalSheet} class. */ public final class TestSheet { - private static InternalSheet createSheet(List inRecs) { + private static InternalSheet createSheet(List inRecs) { return InternalSheet.createSheet(new RecordStream(inRecs, 0)); } @Test public void testCreateSheet() { // Check we're adding row and cell aggregates - List records = new ArrayList<>(); + List records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); records.add( new DimensionsRecord() ); records.add(createWindow2Record()); records.add(EOFRecord.instance); InternalSheet sheet = createSheet(records); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, 0); - Iterator iter = outRecs.iterator(); + Iterator iter = outRecs.iterator(); assertTrue(iter.next() instanceof BOFRecord ); assertTrue(iter.next() instanceof IndexRecord); assertTrue(iter.next() instanceof DimensionsRecord); @@ -75,7 +75,7 @@ public final class TestSheet { assertTrue(iter.next() instanceof EOFRecord); } - private static Record createWindow2Record() { + private static org.apache.poi.hssf.record.Record createWindow2Record() { WindowTwoRecord result = new WindowTwoRecord(); result.setOptions(( short ) 0x6b6); result.setTopRow(( short ) 0); @@ -93,7 +93,7 @@ public final class TestSheet { _count = 0; } @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { if (r instanceof MergeCellsRecord) { _count++; } @@ -179,7 +179,7 @@ public final class TestSheet { */ @Test public void testMovingMergedRegion() { - List records = new ArrayList<>(); + List records = new ArrayList<>(); CellRangeAddress[] cras = { new CellRangeAddress(0, 1, 0, 2), @@ -218,7 +218,7 @@ public final class TestSheet { */ @Test public void testRowAggregation() { - List records = new ArrayList<>(); + List records = new ArrayList<>(); records.add(InternalSheet.createBOF()); records.add(new DimensionsRecord()); @@ -430,7 +430,7 @@ public final class TestSheet { @Test public void testUncalcSize_bug45066() { - List records = new ArrayList<>(); + List records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); records.add(new UncalcedRecord()); records.add(new DimensionsRecord()); @@ -510,7 +510,7 @@ public final class TestSheet { return _indexRecord; } @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { if (r instanceof IndexRecord) { if (_indexRecord != null) { throw new RuntimeException("too many index records"); @@ -588,7 +588,7 @@ public final class TestSheet { nr.setColumn((short) colIx); nr.setValue(3.0); - List inRecs = new ArrayList<>(); + List inRecs = new ArrayList<>(); inRecs.add(BOFRecord.createSheetBOF()); inRecs.add(new RowRecord(rowIx)); inRecs.add(nr); @@ -596,7 +596,7 @@ public final class TestSheet { inRecs.add(EOFRecord.instance); InternalSheet sheet = createSheet(inRecs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, rowIx); assertEquals(8, outRecs.size()); DimensionsRecord dims = (DimensionsRecord) outRecs.get(5); @@ -643,7 +643,7 @@ public final class TestSheet { @Test public void testCloneMulBlank_bug46776() { - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { InternalSheet.createBOF(), new DimensionsRecord(), new RowRecord(1), @@ -657,7 +657,7 @@ public final class TestSheet { InternalSheet sheet2 = sheet.cloneSheet(); - List clonedRecs = new ArrayList<>(); + List clonedRecs = new ArrayList<>(); sheet2.visitContainedRecords(clonedRecs::add, 0); // +2 for INDEX and DBCELL assertEquals(recs.length+2, clonedRecs.size()); @@ -700,7 +700,7 @@ public final class TestSheet { r2.setStr(new HSSFRichTextString("Aggregated")); NoteRecord n2 = new NoteRecord(); - List recordStream = new ArrayList<>(); + List recordStream = new ArrayList<>(); recordStream.add(InternalSheet.createBOF()); recordStream.add( d1 ); recordStream.add( r1 ); @@ -734,7 +734,7 @@ public final class TestSheet { confirmAggregatedRecords(recordStream); } - private void confirmAggregatedRecords(List recordStream){ + private void confirmAggregatedRecords(List recordStream){ InternalSheet sheet = InternalSheet.createSheet(); sheet.getRecords().clear(); sheet.getRecords().addAll(recordStream); @@ -745,10 +745,10 @@ public final class TestSheet { sheet.aggregateDrawingRecords(drawingManager, false); assertEquals(4, sheetRecords.size()); - assertEquals(BOFRecord.sid, ((Record)sheetRecords.get(0)).getSid()); - assertEquals(EscherAggregate.sid, ((Record)sheetRecords.get(1)).getSid()); - assertEquals(WindowTwoRecord.sid, ((Record)sheetRecords.get(2)).getSid()); - assertEquals(EOFRecord.sid, ((Record)sheetRecords.get(3)).getSid()); + assertEquals(BOFRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(0)).getSid()); + assertEquals(EscherAggregate.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(1)).getSid()); + assertEquals(WindowTwoRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(2)).getSid()); + assertEquals(EOFRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(3)).getSid()); } @Test diff --git a/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java b/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java index 10491b080c..9b2c650c42 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java @@ -53,7 +53,7 @@ public final class TestDrawingRecord { ContinueRecord cn = new ContinueRecord(data2); out.write(cn.serialize()); - List rec = RecordFactory.createRecords(new ByteArrayInputStream(out.toByteArray())); + List rec = RecordFactory.createRecords(new ByteArrayInputStream(out.toByteArray())); assertEquals(2, rec.size()); assertTrue(rec.get(0) instanceof DrawingRecord); assertTrue(rec.get(1) instanceof ContinueRecord); diff --git a/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java index 5cde3d1734..b2e75a642b 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java @@ -48,7 +48,7 @@ public final class TestFeatRecord { int countFRH = 0; // Check on the workbook, but shouldn't be there! - for(Record r : wb.getRecords()) { + for(org.apache.poi.hssf.record.Record r : wb.getRecords()) { if(r instanceof FeatRecord) { countFR++; } else if (r.getSid() == FeatRecord.sid) { @@ -70,7 +70,7 @@ public final class TestFeatRecord { for(RecordBase rb : sheet.getRecords()) { if(rb instanceof Record) { - Record r = (Record)rb; + Record r = (org.apache.poi.hssf.record.Record)rb; if(r instanceof FeatRecord) { countFR++; } else if (r.getSid() == FeatRecord.sid) { @@ -102,7 +102,7 @@ public final class TestFeatRecord { // First check it isn't on the Workbook int countFR = 0; int countFRH = 0; - for(Record r : wb.getRecords()) { + for(org.apache.poi.hssf.record.Record r : wb.getRecords()) { if(r instanceof FeatRecord) { fr = (FeatRecord)r; countFR++; @@ -125,7 +125,7 @@ public final class TestFeatRecord { for(RecordBase rb : sheet.getRecords()) { if(rb instanceof Record) { - Record r = (Record)rb; + Record r = (org.apache.poi.hssf.record.Record)rb; if(r instanceof FeatRecord) { fr = (FeatRecord)r; countFR++; diff --git a/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java b/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java index 84d4bd6efd..f085cf15c8 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java @@ -52,7 +52,7 @@ public final class TestInterfaceEndRecord { "E2 00 02 00 B0 04 " + //INTERFACEEND with extra two bytes "0A 00 00 00"; // EOF byte[] data = HexRead.readFromString(hex); - List records = RecordFactory.createRecords(new ByteArrayInputStream(data)); + List records = RecordFactory.createRecords(new ByteArrayInputStream(data)); assertEquals(3, records.size()); Record rec1 = records.get(1); assertEquals(InterfaceHdrRecord.class, rec1.getClass()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java index b100238c1d..fa4dc0b1e5 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java @@ -59,7 +59,7 @@ public final class TestMergeCellsRecord { @Test public void testMCTable_bug46009() { MergedCellsTable mct = new MergedCellsTable(); - List recList = new ArrayList<>(); + List recList = new ArrayList<>(); CellRangeAddress[] cras = new CellRangeAddress[] { new CellRangeAddress(0, 0, 0, 3), }; diff --git a/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java b/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java index 5b46346bd4..2e67f25b7d 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java @@ -182,7 +182,7 @@ public final class TestRecordFactory { "00 00 00 00 00 00 00"; byte[] data = HexRead.readFromString(dump); - List records = RecordFactory.createRecords(new ByteArrayInputStream(data)); + List records = RecordFactory.createRecords(new ByteArrayInputStream(data)); assertEquals(5, records.size()); assertTrue(records.get(0) instanceof ObjRecord); assertTrue(records.get(1) instanceof DrawingRecord); @@ -192,7 +192,7 @@ public final class TestRecordFactory { //serialize and verify that the serialized data is the same as the original ByteArrayOutputStream out = new ByteArrayOutputStream(); - for(Record rec : records){ + for(org.apache.poi.hssf.record.Record rec : records){ out.write(rec.serialize()); } @@ -211,7 +211,7 @@ public final class TestRecordFactory { EOFRecord.instance, }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); - for (Record rec : recs) { + for (org.apache.poi.hssf.record.Record rec : recs) { try { baos.write(rec.serialize()); } catch (IOException e) { @@ -232,7 +232,7 @@ public final class TestRecordFactory { fs.createDocument(new ByteArrayInputStream(baos.toByteArray()), "dummy"); InputStream is = fs.getRoot().createDocumentInputStream("dummy"); - List outRecs = RecordFactory.createRecords(is); + List outRecs = RecordFactory.createRecords(is); // Buffer underrun - requested 512 bytes but 192 was available assertEquals(5, outRecs.size()); fs.close(); 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 7bef9df51d..e5fb8e769d 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java @@ -55,7 +55,7 @@ public final class TestCFRecordsAggregate { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); - List recs = new ArrayList<>(); + List 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 6b9e1e62ed..569ffbc8fc 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java @@ -69,7 +69,7 @@ public final class TestColumnInfoRecordsAggregate { // bug 45639 - ArrayIndexOutOfBoundsException agg.groupColumnRange( 1, 15, true); - List cirs = new ArrayList<>(); + List cirs = new ArrayList<>(); agg.visitContainedRecords(cirs::add); assertEquals(5, cirs.size()); @@ -89,7 +89,7 @@ public final class TestColumnInfoRecordsAggregate { agg.groupColumnRange(1, 15, true); agg.groupColumnRange(4, 12, true); - List cirs = new ArrayList<>(); + List cirs = new ArrayList<>(); // collapse both inner and outer groups agg.collapseColumn(6); @@ -116,7 +116,7 @@ public final class TestColumnInfoRecordsAggregate { confirmCIR(cirs, 3, 16, 16, 0, false, true); } - private static void confirmCIR(List cirs, int ix, int startColIx, int endColIx, int level, boolean isHidden, boolean isCollapsed) { + private static void confirmCIR(List cirs, int ix, int startColIx, int endColIx, int level, boolean isHidden, boolean isCollapsed) { assertTrue(cirs.get(ix) instanceof ColumnInfoRecord); ColumnInfoRecord cir = (ColumnInfoRecord)cirs.get(ix); assertEquals("startColIx", startColIx, cir.getFirstColumn()); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java index a7f851d9dd..798fa54b5a 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java @@ -65,7 +65,7 @@ public final class TestFormulaRecordAggregate { SharedValueManager svm = SharedValueManager.createEmpty(); // bug 46213 -> String record was supplied but formula record flag is not set FormulaRecordAggregate fra = new FormulaRecordAggregate(fr, sr, svm); - List vraRecs = new ArrayList<>(); + List vraRecs = new ArrayList<>(); fra.visitContainedRecords(vraRecs::add); assertEquals(1, vraRecs.size()); assertEquals(fr, vraRecs.get(0)); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java index 0252a14206..1862efeb6a 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java @@ -92,7 +92,7 @@ public final class TestPageSettingsBlock { nr.setColumn((short) colIx); nr.setValue(3.0); - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { BOFRecord.createSheetBOF(), new HeaderRecord("&LSales Figures"), new FooterRecord("&LJanuary"), @@ -111,7 +111,7 @@ public final class TestPageSettingsBlock { // bug 46480- two Page Settings Blocks found in the same sheet InternalSheet sheet = InternalSheet.createSheet(rs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, rowIx); assertEquals(13, outRecs.size()); } @@ -129,7 +129,7 @@ public final class TestPageSettingsBlock { nr.setColumn((short) colIx); nr.setValue(3.0); - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { BOFRecord.createSheetBOF(), new HeaderRecord("&LSales Figures"), new FooterRecord("&LJanuary"), @@ -141,7 +141,7 @@ public final class TestPageSettingsBlock { RecordStream rs = new RecordStream(Arrays.asList(recs), 0); InternalSheet sheet = InternalSheet.createSheet(rs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, 0); // Identified bug 46953 - EOF incorrectly appended to PSB assertNotEquals(EOFRecord.instance, outRecs.get(4)); @@ -170,7 +170,7 @@ public final class TestPageSettingsBlock { BottomMarginRecord bottomMargin = new BottomMarginRecord(); bottomMargin.setMargin(0.787F); - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { BOFRecord.createSheetBOF(), new HeaderRecord("&LSales Figures"), new FooterRecord("&LJanuary"), @@ -184,7 +184,7 @@ public final class TestPageSettingsBlock { // bug 47199a - failed to process late margins records InternalSheet sheet = InternalSheet.createSheet(rs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, 0); assertEquals(recs.length+1, outRecs.size()); // +1 for index record @@ -201,7 +201,7 @@ public final class TestPageSettingsBlock { @Test public void testDuplicatePSBRecord_bug47199() { // Hypothetical setup of PSB records which should cause POI to crash - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { new HeaderRecord("&LSales Figures"), new HeaderRecord("&LInventory"), }; @@ -220,7 +220,7 @@ public final class TestPageSettingsBlock { @Test public void testMissingHeaderFooter() { // initialise PSB with some records, but not the header / footer - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { new HCenterRecord(), new VCenterRecord(), }; @@ -228,7 +228,7 @@ public final class TestPageSettingsBlock { PageSettingsBlock psb = new PageSettingsBlock(rs); // serialize the PSB to see what records come out - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); psb.visitContainedRecords(outRecs::add); assertNotEquals("PageSettingsBlock didn't add missing header/footer records", 2, outRecs.size()); @@ -259,7 +259,7 @@ public final class TestPageSettingsBlock { Record plsB = new UnknownRecord(UnknownRecord.PLS_004D, HexRead.readFromString("DE AD BE EF")); Record contB1 = new ContinueRecord(HexRead.readFromString("FE ED")); Record contB2 = new ContinueRecord(HexRead.readFromString("FA CE")); - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { new HeaderRecord("&LSales Figures"), new FooterRecord("&LInventory"), new HCenterRecord(), @@ -272,7 +272,7 @@ public final class TestPageSettingsBlock { PageSettingsBlock psb = new PageSettingsBlock(rs); // serialize the PSB to see what records come out - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); psb.visitContainedRecords(outRecs::add); // records were assembled in standard order, so this simple check is OK @@ -282,7 +282,7 @@ public final class TestPageSettingsBlock { @Test public void testDuplicateHeaderFooter_bug48026() { - Record[] recs = { + org.apache.poi.hssf.record.Record[] recs = { BOFRecord.createSheetBOF(), new IndexRecord(), @@ -309,7 +309,7 @@ public final class TestPageSettingsBlock { // bug 48026 - Duplicate PageSettingsBlock record (sid=0x89c) InternalSheet sheet = InternalSheet.createSheet(rs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, 0); assertEquals(recs.length, outRecs.size()); @@ -382,7 +382,7 @@ public final class TestPageSettingsBlock { // Bug 48026 : Duplicate PageSettingsBlock record (sid=0x89c) InternalSheet sheet = InternalSheet.createSheet(rs); - List outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); sheet.visitContainedRecords(outRecs::add, 0); assertEquals(recs.length+1, outRecs.size()); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java index a5fe0f0ea6..c6b44be8f4 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java @@ -71,7 +71,7 @@ public final class TestRowRecordsAggregate { @Test public void testArraysAndTables() throws Exception { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("testArraysAndTables.xls")) { - final List sheetRecs = new ArrayList<>(); + final List sheetRecs = new ArrayList<>(); wb.getSheetAt(0).getSheet().visitContainedRecords(sheetRecs::add, 0); int countArrayFormulas = verifySharedValues(sheetRecs, ArrayRecord.class); @@ -100,7 +100,7 @@ public final class TestRowRecordsAggregate { } } - private static int verifySharedValues(List recs, Class shfClass) { + private static int verifySharedValues(List recs, Class shfClass) { int result =0; for(int i=0; i outRecs = new ArrayList<>(); + List outRecs = new ArrayList<>(); rra.visitContainedRecords(outRecs::add); assertEquals(5, outRecs.size()); } 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 61984e1295..477affdbf0 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java @@ -67,7 +67,7 @@ public final class TestValueRecordsAggregate { */ @Test public void testSharedFormula() { - List records = new ArrayList<>(); + List records = new ArrayList<>(); records.add(new FormulaRecord()); records.add(new SharedFormulaRecord()); records.add(new WindowTwoRecord()); @@ -82,7 +82,7 @@ public final class TestValueRecordsAggregate { assertTrue( "First record is a FormulaRecordsAggregate", ( record instanceof FormulaRecordAggregate ) ); } - private void constructValueRecord(List records) { + private void constructValueRecord(List records) { RowBlocksReader rbr = new RowBlocksReader(new RecordStream(records, 0)); SharedValueManager sfrh = rbr.getSharedFormulaManager(); RecordStream rs = rbr.getPlainRecordStream(); @@ -92,8 +92,8 @@ public final class TestValueRecordsAggregate { } } - private static List testData() { - List records = new ArrayList<>(); + private static List testData() { + List records = new ArrayList<>(); FormulaRecord formulaRecord = new FormulaRecord(); BlankRecord blankRecord = new BlankRecord(); formulaRecord.setRow(1); @@ -174,7 +174,7 @@ public final class TestValueRecordsAggregate { } @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { r.serialize(_writeIndex, _buf); _writeIndex += r.getRecordSize(); } @@ -191,7 +191,7 @@ public final class TestValueRecordsAggregate { + "01 02 06 00 " // Blank + "02 00 02 00 00 00"); byte[] actualArray = new byte[expectedArray.length]; - List records = testData(); + List records = testData(); constructValueRecord(records); SerializerVisitor sv = new SerializerVisitor(actualArray); 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 b345c89b3d..53774be9ac 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java @@ -71,7 +71,7 @@ public final class TestChartTitleFormatRecord { } @Override - public void processRecord(Record record) { + public void processRecord(org.apache.poi.hssf.record.Record record) { if(record instanceof ChartTitleFormatRecord) { chartTitleFormatRecords.add((ChartTitleFormatRecord)record); } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java b/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java index 5f90b7285f..04ac448d25 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java @@ -258,7 +258,7 @@ public class SanityChecker { private void checkWorkbookRecords(InternalWorkbook workbook) { - List records = workbook.getRecords(); + List records = workbook.getRecords(); assertTrue(records.get(0) instanceof BOFRecord); assertTrue(records.get(records.size() - 1) instanceof EOFRecord); @@ -338,7 +338,7 @@ public class SanityChecker { int checkIndex = 0; for (int recordIndex = 0; recordIndex < records.size(); recordIndex++) { - Record record = (Record) records.get(recordIndex); + Record record = (org.apache.poi.hssf.record.Record) records.get(recordIndex); if (check[checkIndex].getRecord().isInstance(record)) { if (check[checkIndex].getOccurance() == 'M') diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 811633f689..00828e4305 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1641,7 +1641,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { try (HSSFWorkbook wb2 = writeOutAndReadBack(wb1)) { // Ensure the tab index TabIdRecord tr = null; - for (Record r : wb2.getWorkbook().getRecords()) { + for (org.apache.poi.hssf.record.Record r : wb2.getWorkbook().getRecords()) { if (r instanceof TabIdRecord) { tr = (TabIdRecord) r; } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java index 95cbdb7992..e3372c629b 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java @@ -327,7 +327,7 @@ public final class TestHSSFCell extends BaseTestCell { confirmStringRecord(sheet, true); cell.setCellValue(123); - final List recs = new ArrayList<>(); + final List recs = new ArrayList<>(); sheet.getSheet().visitContainedRecords(recs::add, 0); assertFalse("Identified bug - leftover StringRecord", recs.size() == 28 && recs.get(23) instanceof StringRecord); confirmStringRecord(sheet, false); @@ -347,11 +347,11 @@ public final class TestHSSFCell extends BaseTestCell { } private static void confirmStringRecord(HSSFSheet sheet, boolean isPresent) { - List recs = new ArrayList<>(); + List recs = new ArrayList<>(); sheet.getSheet().visitContainedRecords(recs::add, 0); assertEquals(isPresent ? 28 : 27, recs.size()); - ListIterator iter = recs.listIterator(22); + ListIterator iter = recs.listIterator(22); assertEquals(FormulaRecord.class, iter.next().getClass()); if (isPresent) { assertEquals(StringRecord.class, iter.next().getClass()); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java index 78d6756cb4..821a14b9ef 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java @@ -414,7 +414,7 @@ public final class TestHSSFSheet extends BaseTestSheet { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); s.protectSheet("secret"); - List recs = new ArrayList<>(); + List recs = new ArrayList<>(); s.getSheet().visitContainedRecords(recs::add, 0); int nRecs = recs.size(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java index ac8df385cf..cc06e8fca6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java @@ -86,11 +86,11 @@ public final class TestHSSFSheetUpdateArrayFormulas extends BaseTestSheetUpdateA HSSFSheet s = wb.createSheet("Sheet1"); CellRange cr = s.setArrayFormula("123", CellRangeAddress.valueOf("B5:C6")); - List recs = new ArrayList<>(); + List recs = new ArrayList<>(); s.getSheet().visitContainedRecords(recs::add, 0); int ix = 0; - for (Record r : recs) { + for (org.apache.poi.hssf.record.Record r : recs) { if (r instanceof ArrayRecord) break; ix++; } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java index c8b10d1b39..0293348636 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 records = new ArrayList<>(); + List records = new ArrayList<>(); records.add(new BOFRecord()); records.add(INTERFACEHDR); records.add(createBoundSheetRec()); @@ -121,7 +121,7 @@ public final class TestSanityChecker { } private static void confirmBadRecordOrder(final SanityChecker.CheckRecord[] check, Record[] recs) { final SanityChecker c = new SanityChecker(); - final List records = Arrays.asList(recs); + final List records = Arrays.asList(recs); try { new Runnable() { @Override diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java index 04d85130fd..79d9553eca 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java @@ -456,7 +456,7 @@ public final class TestWorkbook { return _count; } @Override - public void visitRecord(Record r) { + public void visitRecord(org.apache.poi.hssf.record.Record r) { if (r instanceof LabelSSTRecord) { _count++; } -- 2.39.5