Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile issues with JDK 17 #9

Merged
merged 2 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
strategy:
matrix:
java: [1.8, 11]
java: [1.8, 11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/loci/poi/hssf/dev/BiffViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void run() {
*@exception RecordFormatException on error processing the InputStream
*/

public static Record[] createRecords(InputStream in, boolean dump)
public static loci.poi.hssf.record.Record[] createRecords(InputStream in, boolean dump)
throws RecordFormatException {
ArrayList records = new ArrayList();
RecordDetails activeRecord = null;
Expand All @@ -122,7 +122,7 @@ public static Record[] createRecords(InputStream in, boolean dump)
while (recStream.hasNextRecord()) {
recStream.nextRecord();
if (recStream.getSid() != 0) {
Record record = createRecord (recStream);
loci.poi.hssf.record.Record record = createRecord (recStream);
if (record.getSid() != ContinueRecord.sid)
{
records.add(record);
Expand All @@ -139,13 +139,13 @@ public static Record[] createRecords(InputStream in, boolean dump)
} catch (IOException e) {
throw new RecordFormatException("Error reading bytes", e);
}
Record[] retval = new Record[records.size()];
loci.poi.hssf.record.Record[] retval = new loci.poi.hssf.record.Record[records.size()];

retval = (Record[]) records.toArray(retval);
retval = (loci.poi.hssf.record.Record[]) records.toArray(retval);
return retval;
}

private static void dumpNormal(Record record, int startloc, short rectype, short recsize)
private static void dumpNormal(loci.poi.hssf.record.Record record, int startloc, short rectype, short recsize)
{
System.out.println("Offset 0x" + Integer.toHexString(startloc) + " (" + startloc + ")");
System.out.println( "recordid = 0x" + Integer.toHexString( rectype ) + ", size = " + recsize );
Expand All @@ -158,9 +158,9 @@ private static void dumpNormal(Record record, int startloc, short rectype, short
* up non-debug operations.
*
*/
private static Record createRecord( RecordInputStream in )
private static loci.poi.hssf.record.Record createRecord( RecordInputStream in )
{
Record retval = null;
loci.poi.hssf.record.Record retval = null;

switch ( in.getSid() )
{
Expand Down Expand Up @@ -613,9 +613,9 @@ static class RecordDetails
{
short rectype, recsize;
int startloc;
Record record;
loci.poi.hssf.record.Record record;

public RecordDetails( short rectype, short recsize, int startloc, Record record )
public RecordDetails( short rectype, short recsize, int startloc, loci.poi.hssf.record.Record record )
{
this.rectype = rectype;
this.recsize = recsize;
Expand All @@ -633,7 +633,7 @@ public short getRecsize()
return recsize;
}

public Record getRecord()
public loci.poi.hssf.record.Record getRecord()
{
return record;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/loci/poi/hssf/dev/FormulaViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void run()

for (int k = 0; k < records.size(); k++)
{
Record record = ( Record ) records.get(k);
loci.poi.hssf.record.Record record = ( loci.poi.hssf.record.Record ) records.get(k);

if (record.getSid() == FormulaRecord.sid)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ protected short genericProcessEvents(HSSFRequest req, RecordInputStream in)
process:
{

Record rec = null;
Record lastRec = null;
loci.poi.hssf.record.Record rec = null;
loci.poi.hssf.record.Record lastRec = null;
DrawingRecord lastDrawingRecord = new DrawingRecord();

while (in.hasNextRecord())
Expand Down Expand Up @@ -191,7 +191,7 @@ protected short genericProcessEvents(HSSFRequest req, RecordInputStream in)
if (sid != ContinueRecord.sid)
{
//System.out.println("creating "+sid);
Record[] recs = RecordFactory.createRecord(in);
loci.poi.hssf.record.Record[] recs = RecordFactory.createRecord(in);

if (recs.length > 1)
{ // we know that the multiple
Expand All @@ -214,7 +214,7 @@ protected short genericProcessEvents(HSSFRequest req, RecordInputStream in)
// However, in a few cases, there is a gap between a record at
// its Continue, so we have to handle them specially
// This logic is much like in RecordFactory.createRecords()
Record[] recs = RecordFactory.createRecord(in);
loci.poi.hssf.record.Record[] recs = RecordFactory.createRecord(in);
ContinueRecord crec = (ContinueRecord)recs[0];
if((lastRec instanceof ObjRecord) || (lastRec instanceof TextObjectRecord)) {
// You can have Obj records between a DrawingRecord
Expand Down
Loading