Browse Source

调整代码满足pmd编码规范

pull/3019/head
supalle 2 years ago
parent
commit
bebbb1515f
  1. 1
      easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java
  2. 16
      easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java

1
easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java

@ -66,7 +66,6 @@ public class BomBufferedInputStream extends BufferedInputStream {
reset(); reset();
if (byteOrderMark != null) { if (byteOrderMark != null) {
// read(new byte[byteOrderMark.length()]);
skip(byteOrderMark.length()); skip(byteOrderMark.length());
} }
initialized = true; initialized = true;

16
easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java

@ -46,14 +46,6 @@ public class ByteOrderMark implements Comparable<ByteOrderMark> {
*/ */
public static final ByteOrderMark UTF_32LE = new ByteOrderMark(Charset.forName("UTF-32LE"), 0xFF, 0xFE, 0x00, 0x00); public static final ByteOrderMark UTF_32LE = new ByteOrderMark(Charset.forName("UTF-32LE"), 0xFF, 0xFE, 0x00, 0x00);
/**
* Unicode BOM character; external form depends on the encoding.
*
* @see <a href="http://unicode.org/faq/utf_bom.html#BOM">Byte Order Mark (BOM) FAQ</a>
* @since 2.5
*/
public static final char UTF_BOM = '\uFEFF';
private final Charset charset; private final Charset charset;
private final int[] bytes; private final int[] bytes;
@ -79,8 +71,12 @@ public class ByteOrderMark implements Comparable<ByteOrderMark> {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ByteOrderMark that = (ByteOrderMark) o; ByteOrderMark that = (ByteOrderMark) o;
return Objects.equals(charset, that.charset) && Arrays.equals(bytes, that.bytes); return Objects.equals(charset, that.charset) && Arrays.equals(bytes, that.bytes);
} }

Loading…
Cancel
Save