code formatting

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-07-11 21:32:55 +00:00
parent 61a25d079b
commit 20dc9dc714
4 changed files with 26 additions and 34 deletions

View File

@ -66,7 +66,7 @@ public class SXSSFSheet implements Sheet
{
/*package*/ final XSSFSheet _sh;
private final SXSSFWorkbook _workbook;
private final TreeMap<Integer,SXSSFRow> _rows= new TreeMap<>();
private final TreeMap<Integer,SXSSFRow> _rows = new TreeMap<>();
private final SheetDataWriter _writer;
private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE;
private final AutoSizeColumnTracker _autoSizeColumnTracker;
@ -138,17 +138,13 @@ public class SXSSFSheet implements Sheet
"in the range [0," + _sh.getLastRowNum() + "] that is already written to disk.");
}
SXSSFRow newRow=new SXSSFRow(this);
_rows.put(rownum,newRow);
SXSSFRow newRow = new SXSSFRow(this);
_rows.put(rownum, newRow);
allFlushed = false;
if(_randomAccessWindowSize>=0&&_rows.size()>_randomAccessWindowSize)
{
try
{
if(_randomAccessWindowSize >= 0 && _rows.size() > _randomAccessWindowSize) {
try {
flushRows(_randomAccessWindowSize);
}
catch (IOException ioe)
{
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
@ -167,11 +163,9 @@ public class SXSSFSheet implements Sheet
throw new IllegalArgumentException("Specified row does not belong to this sheet");
}
for(Iterator<Map.Entry<Integer,SXSSFRow>> iter=_rows.entrySet().iterator();iter.hasNext();)
{
Map.Entry<Integer,SXSSFRow> entry=iter.next();
if(entry.getValue()==row)
{
for(Iterator<Map.Entry<Integer, SXSSFRow>> iter = _rows.entrySet().iterator(); iter.hasNext();) {
Map.Entry<Integer, SXSSFRow> entry = iter.next();
if(entry.getValue() == row) {
iter.remove();
return;
}
@ -199,7 +193,7 @@ public class SXSSFSheet implements Sheet
@Override
public int getPhysicalNumberOfRows()
{
return _rows.size()+_writer.getNumberOfFlushedRows();
return _rows.size() + _writer.getNumberOfFlushedRows();
}
/**
@ -208,8 +202,7 @@ public class SXSSFSheet implements Sheet
* @return the number of the first logical row on the sheet (0-based)
*/
@Override
public int getFirstRowNum()
{
public int getFirstRowNum() {
if(_writer.getNumberOfFlushedRows() > 0) {
return _writer.getLowestIndexOfFlushedRows();
}
@ -971,7 +964,7 @@ public class SXSSFSheet implements Sheet
@NotImplemented
@Override
public void shiftRows(int startRow, int endRow, int n) {
throw new RuntimeException("NotImplemented");
throw new RuntimeException("Not Implemented");
}
/**
@ -996,7 +989,7 @@ public class SXSSFSheet implements Sheet
@Override
public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
{
throw new RuntimeException("NotImplemented");
throw new RuntimeException("Not Implemented");
}
/**
@ -1734,7 +1727,7 @@ public class SXSSFSheet implements Sheet
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
// return _sh.setArrayFormula(formula, range);
throw new RuntimeException("NotImplemented");
throw new RuntimeException("Not Implemented");
}
/**
@ -1749,7 +1742,7 @@ public class SXSSFSheet implements Sheet
// corrupted .xlsx files as rows appear multiple times in the resulting sheetX.xml files
// return _sh.removeArrayFormula(cell);
throw new RuntimeException("NotImplemented");
throw new RuntimeException("Not Implemented");
}
@Override
@ -1831,7 +1824,7 @@ public class SXSSFSheet implements Sheet
if(value == 0 || value < -1) {
throw new IllegalArgumentException("RandomAccessWindowSize must be either -1 or a positive integer");
}
_randomAccessWindowSize=value;
_randomAccessWindowSize = value;
}
/**
@ -2123,6 +2116,6 @@ public class SXSSFSheet implements Sheet
@NotImplemented
@Override
public void shiftColumns(int startColumn, int endColumn, int n){
throw new UnsupportedOperationException("NotImplemented");
throw new UnsupportedOperationException("Not Implemented");
}
}

View File

@ -691,9 +691,8 @@ public class SXSSFWorkbook implements Workbook {
*/
@Override
@NotImplemented
public Sheet cloneSheet(int sheetNum)
{
throw new RuntimeException("NotImplemented");
public Sheet cloneSheet(int sheetNum) {
throw new RuntimeException("Not Implemented");
}
@ -1291,7 +1290,7 @@ public class SXSSFWorkbook implements Workbook {
@Override
@NotImplemented
public int linkExternalWorkbook(String name, Workbook workbook) {
throw new RuntimeException("NotImplemented");
throw new RuntimeException("Not Implemented");
}
/**

View File

@ -59,7 +59,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
@Test
public void cloneSheet() throws IOException {
thrown.expect(RuntimeException.class);
thrown.expectMessage("NotImplemented");
thrown.expectMessage("Not Implemented");
super.cloneSheet();
}
@ -67,7 +67,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
@Test
public void cloneSheetMultipleTimes() throws IOException {
thrown.expect(RuntimeException.class);
thrown.expectMessage("NotImplemented");
thrown.expectMessage("Not Implemented");
super.cloneSheetMultipleTimes();
}
@ -78,7 +78,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
@Test
public void shiftMerged() throws IOException {
thrown.expect(RuntimeException.class);
thrown.expectMessage("NotImplemented");
thrown.expectMessage("Not Implemented");
super.shiftMerged();
}
@ -91,7 +91,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
@Test
public void bug35084() throws IOException {
thrown.expect(RuntimeException.class);
thrown.expectMessage("NotImplemented");
thrown.expectMessage("Not Implemented");
super.bug35084();
}

View File

@ -80,7 +80,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
super.cloneSheet();
fail("expected exception");
} catch (RuntimeException e){
assertEquals("NotImplemented", e.getMessage());
assertEquals("Not Implemented", e.getMessage());
}
}
@ -94,7 +94,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
super.sheetClone();
fail("expected exception");
} catch (RuntimeException e){
assertEquals("NotImplemented", e.getMessage());
assertEquals("Not Implemented", e.getMessage());
}
}