mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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));
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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++;
|
||||
|
Reference in New Issue
Block a user