diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-01-10 23:13:20 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-01-10 23:13:20 +0000 |
commit | 2797d07486b036e5486f959b4db769b01320afee (patch) | |
tree | ba39b24f0af64287c39eb57307167caa86cb9b13 /src/scratchpad/testcases | |
parent | 12d49035c0d39bd19ac6cfb0d30de545f65a9b7f (diff) | |
download | poi-2797d07486b036e5486f959b4db769b01320afee.tar.gz poi-2797d07486b036e5486f959b4db769b01320afee.zip |
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
Diffstat (limited to 'src/scratchpad/testcases')
8 files changed, 22 insertions, 22 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestRecordContainer.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestRecordContainer.java index 27956dd3d2..01376c17f9 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestRecordContainer.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestRecordContainer.java @@ -47,7 +47,7 @@ public final class TestRecordContainer { is.close(); Record[] r = hss.getRecords(); - for (Record rec : r) { + for ( org.apache.poi.hslf.record.Record rec : r) { if(rec instanceof RecordContainer) { recordContainer = (RecordContainer)rec; return; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSound.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSound.java index 6829d72886..f998ef82e4 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSound.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSound.java @@ -42,7 +42,7 @@ public final class TestSound { Document doc = ppt.getDocumentRecord(); SoundCollection soundCollection = null; Record[] doc_ch = doc.getChildRecords(); - for (Record rec : doc_ch) { + for ( org.apache.poi.hslf.record.Record rec : doc_ch) { if (rec instanceof SoundCollection) { soundCollection = (SoundCollection) rec; break; @@ -53,7 +53,7 @@ public final class TestSound { Sound sound = null; Record[] sound_ch = soundCollection.getChildRecords(); int k = 0; - for (Record rec : sound_ch) { + for ( org.apache.poi.hslf.record.Record rec : sound_ch) { if (rec instanceof Sound) { sound = (Sound) rec; k++; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestAddingSlides.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestAddingSlides.java index 523f6ad7d2..6466ed38e4 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestAddingSlides.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestAddingSlides.java @@ -81,7 +81,7 @@ public final class TestAddingSlides { // grab UserEditAtom UserEditAtom usredit = null; Record[] _records = ss_empty.getSlideShowImpl().getRecords(); - for (Record record : _records) { + for ( org.apache.poi.hslf.record.Record record : _records) { if (record.getRecordType() == RecordTypes.UserEditAtom.typeID) { usredit = (UserEditAtom) record; } @@ -169,7 +169,7 @@ public final class TestAddingSlides { // grab UserEditAtom UserEditAtom usredit = null; Record[] _records = ss_two.getSlideShowImpl().getRecords(); - for (Record record : _records) { + for ( org.apache.poi.hslf.record.Record record : _records) { if (record.getRecordType() == RecordTypes.UserEditAtom.typeID) { usredit = (UserEditAtom) record; } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 43a855c8f7..e23f158703 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -517,7 +517,7 @@ public final class TestBugs { SlideAtomsSet s1 = slidesSLWT.getSlideAtomsSets()[0]; int tha = 0; - for (Record r : s1.getSlideRecords()) { + for ( org.apache.poi.hslf.record.Record r : s1.getSlideRecords()) { if (r instanceof TextHeaderAtom) { tha++; } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java index a952bca5cd..c1a5324612 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java @@ -44,7 +44,7 @@ public final class TestMostRecentRecords { @Test public void testCount() { // Most recent core records - Record[] mrcr = ss.getMostRecentCoreRecords(); + org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); // Master sheet + master notes + 2 slides + 2 notes + document assertEquals(7, mrcr.length); @@ -53,7 +53,7 @@ public final class TestMostRecentRecords { @Test public void testRightRecordTypes() { // Most recent core records - Record[] mrcr = ss.getMostRecentCoreRecords(); + org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); // Document assertEquals(1000, mrcr[0].getRecordType()); @@ -75,10 +75,10 @@ public final class TestMostRecentRecords { @Test public void testCorrectRecords() { // Most recent core records - Record[] mrcr = ss.getMostRecentCoreRecords(); + org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); // All records - Record[] allr = hss.getRecords(); + org.apache.poi.hslf.record.Record[] allr = hss.getRecords(); // Ensure they are the right (latest) version of each diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java index b707df2236..d79f61e411 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java @@ -46,20 +46,20 @@ public final class TestRecordSetup { @Test public void testHandleParentAwareRecords() { - Record[] records = hss.getRecords(); - for (Record record : records) { + org.apache.poi.hslf.record.Record[] records = hss.getRecords(); + for ( org.apache.poi.hslf.record.Record record : records) { ensureParentAware(record,null); } } - private void ensureParentAware(Record r,RecordContainer parent) { + private void ensureParentAware( org.apache.poi.hslf.record.Record r,RecordContainer parent) { if(r instanceof ParentAwareRecord) { ParentAwareRecord pr = (ParentAwareRecord)r; assertEquals(parent, pr.getParentRecord()); } if(r instanceof RecordContainer) { RecordContainer rc = (RecordContainer)r; - Record[] children = rc.getChildRecords(); - for (Record rec : children) { + org.apache.poi.hslf.record.Record[] children = rc.getChildRecords(); + for ( org.apache.poi.hslf.record.Record rec : children) { ensureParentAware(rec, rc); } } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRichTextRun.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRichTextRun.java index d50b2deda9..b697ab10a8 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRichTextRun.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRichTextRun.java @@ -418,7 +418,7 @@ public final class TestRichTextRun { assertArrayEquals(raw_file, raw_ss); } - private byte[] writeRecord(Record r) throws IOException { + private byte[] writeRecord( org.apache.poi.hslf.record.Record r) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); r.writeOut(baos); return baos.toByteArray(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java index 12066f99d4..327720cb85 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java @@ -129,7 +129,7 @@ public final class TestTextRun { TextHeaderAtom tha = null; TextBytesAtom tba = null; TextCharsAtom tca = null; - for (Record r : para.getRecords()) { + for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; @@ -145,7 +145,7 @@ public final class TestTextRun { HSLFTextParagraph.setText(paras, changeBytesOnly); para = paras.get(0); tha = null; tba = null; tca = null; - for (Record r : para.getRecords()) { + for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; @@ -164,7 +164,7 @@ public final class TestTextRun { HSLFTextParagraph.setText(paras, changeByteChar); para = paras.get(0); tha = null; tba = null; tca = null; - for (Record r : para.getRecords()) { + for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; @@ -183,7 +183,7 @@ public final class TestTextRun { HSLFTextParagraph.setText(paras, changeCharChar); para = paras.get(0); tha = null; tba = null; tca = null; - for (Record r : para.getRecords()) { + for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; @@ -525,8 +525,8 @@ public final class TestTextRun { HSLFTextShape tx = (HSLFTextShape)sh; List<HSLFTextParagraph> 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]); |