This commit is contained in:
Looly
2023-04-12 01:22:54 +08:00
parent d2e5155ac5
commit a96a95c988
216 changed files with 480 additions and 480 deletions

View File

@@ -132,7 +132,7 @@ public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, S
public CsvRow nextRow() throws IORuntimeException {
List<String> currentFields;
int fieldCount;
while (! finished) {
while (!finished) {
currentFields = readLine();
fieldCount = currentFields.size();
if (fieldCount < 1) {
@@ -196,7 +196,7 @@ public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, S
// 自定义别名
field = ObjUtil.defaultIfNull(this.config.headerAlias.get(field), field);
}
if (StrUtil.isNotEmpty(field) && ! localHeaderMap.containsKey(field)) {
if (StrUtil.isNotEmpty(field) && !localHeaderMap.containsKey(field)) {
localHeaderMap.put(field, i);
}
}
@@ -232,7 +232,7 @@ public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, S
boolean inComment = false;
while (true) {
if (! buf.hasRemaining()) {
if (!buf.hasRemaining()) {
// 此Buffer读取结束开始读取下一段
if (copyLen > 0) {
buf.appendTo(currentField, copyLen);

View File

@@ -416,7 +416,7 @@ public final class CsvWriter implements Closeable, Flushable, Serializable {
final char textDelimiter = config.textDelimiter;
final char fieldSeparator = config.fieldSeparator;
if (! newline) {
if (!newline) {
writer.write(fieldSeparator);
} else {
newline = false;

View File

@@ -173,7 +173,7 @@ public class BigExcelWriter extends ExcelWriter {
@Override
public ExcelWriter flush(final OutputStream out, final boolean isCloseOut) throws IORuntimeException {
if (! isFlushed) {
if (!isFlushed) {
isFlushed = true;
return super.flush(out, isCloseOut);
}
@@ -182,7 +182,7 @@ public class BigExcelWriter extends ExcelWriter {
@Override
public void close() {
if (null != this.destFile && ! isFlushed) {
if (null != this.destFile && !isFlushed) {
flush();
}

View File

@@ -1382,7 +1382,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
if (null != aliasName) {
// 别名键值对加入
filteredTable.put(key, aliasName, value);
} else if (! this.onlyAlias) {
} else if (!this.onlyAlias) {
// 保留无别名设置的键值对
filteredTable.put(key, key, value);
}

View File

@@ -214,7 +214,7 @@ public class StyleSet implements Serializable {
* @since 4.1.0
*/
public StyleSet setFont(final Font font, final boolean ignoreHead) {
if (! ignoreHead) {
if (!ignoreHead) {
this.headCellStyle.setFont(font);
}
this.cellStyle.setFont(font);

View File

@@ -46,7 +46,7 @@ public class EscapeStrCellSetter extends CharSequenceCellSetter {
* @return 转义后的字符串
*/
private static String escape(final String value) {
if (value == null || ! value.contains("_x")) {
if (value == null || !value.contains("_x")) {
return value;
}

View File

@@ -50,7 +50,7 @@ public class ColumnSheetReader extends AbstractSheetReader<List<Object>> {
Object value;
for (int i = startRowIndex; i <= endRowIndex; i++) {
value = CellUtil.getCellValue(CellUtil.getCell(sheet.getRow(i), columnIndex), cellEditor);
if(null != value || ! ignoreEmptyRow){
if(null != value || !ignoreEmptyRow){
resultList.add(value);
}
}

View File

@@ -51,7 +51,7 @@ public class ListSheetReader extends AbstractSheetReader<List<List<Object>>> {
List<Object> rowList;
for (int i = startRowIndex; i <= endRowIndex; i++) {
rowList = readRow(sheet, i);
if (CollUtil.isNotEmpty(rowList) || ! ignoreEmptyRow) {
if (CollUtil.isNotEmpty(rowList) || !ignoreEmptyRow) {
if (aliasFirstLine && i == startRowIndex) {
// 第一行作为标题行,替换别名
rowList = Convert.toList(Object.class, aliasHeader(rowList));

View File

@@ -73,7 +73,7 @@ public class MapSheetReader extends AbstractSheetReader<List<Map<String, Object>
// 跳过标题行
if (i != headerRowIndex) {
rowList = readRow(sheet, i);
if (CollUtil.isNotEmpty(rowList) || ! ignoreEmptyRow) {
if (CollUtil.isNotEmpty(rowList) || !ignoreEmptyRow) {
result.add(IterUtil.toMap(headerList, rowList, true));
}
}

View File

@@ -290,7 +290,7 @@ public class ExcelSaxUtil {
*/
private static Number getNumberValue(final double numValue, final String numFmtString) {
// 普通数字
if (null != numFmtString && ! StrUtil.contains(numFmtString, CharUtil.DOT)) {
if (null != numFmtString && !StrUtil.contains(numFmtString, CharUtil.DOT)) {
final long longPart = (long) numValue;
//noinspection RedundantIfStatement
if (longPart == numValue) {

View File

@@ -107,7 +107,7 @@ public class SheetDataSaxHandler extends DefaultHandler {
return;
}
if (! this.isInSheetData) {
if (!this.isInSheetData) {
// 非sheetData标签忽略解析
return;
}
@@ -140,7 +140,7 @@ public class SheetDataSaxHandler extends DefaultHandler {
return;
}
if (! this.isInSheetData) {
if (!this.isInSheetData) {
// 非sheetData标签忽略解析
return;
}
@@ -156,7 +156,7 @@ public class SheetDataSaxHandler extends DefaultHandler {
@Override
public void characters(final char[] ch, final int start, final int length) {
if (! this.isInSheetData) {
if (!this.isInSheetData) {
// 非sheetData标签忽略解析
return;
}
@@ -281,7 +281,7 @@ public class SheetDataSaxHandler extends DefaultHandler {
* @param isEnd 是否为最后一个单元格
*/
private void fillBlankCell(final String preCoordinate, final String curCoordinate, final boolean isEnd) {
if (! curCoordinate.equals(preCoordinate)) {
if (!curCoordinate.equals(preCoordinate)) {
int len = ExcelSaxUtil.countNullCell(preCoordinate, curCoordinate);
if (isEnd) {
len++;