mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-18 06:00:25 +08:00
fix: encoding code review
This commit is contained in:
@@ -254,6 +254,8 @@ public class Block {
|
||||
try {
|
||||
tlvType = TLV.readType(this.value, new VlInt(start));
|
||||
} catch (TLVException e) {
|
||||
// go 版本 先清空再抛出异常 这里是否需要清空?
|
||||
this.clearElements();
|
||||
throw new BlockException("parseSubElements" + e.getMessage());
|
||||
}
|
||||
if (tlvType == null) {
|
||||
@@ -267,6 +269,8 @@ public class Block {
|
||||
try {
|
||||
tlvLength = TLV.readVarNumber(this.value, new VlInt(start));
|
||||
} catch (TLVException e) {
|
||||
// go 版本 先清空再抛出异常 这里是否需要清空?
|
||||
this.clearElements();
|
||||
throw new BlockException("parseSubElements" + e.getMessage());
|
||||
}
|
||||
if (tlvType == null) {
|
||||
@@ -290,6 +294,8 @@ public class Block {
|
||||
try {
|
||||
block = createBlockByTypeLengthBuffer(tlvType, tlvLength, subBlockValue, true);
|
||||
} catch (BlockException e) {
|
||||
// go 版本 先清空再抛出异常 这里是否需要清空?
|
||||
this.clearElements();
|
||||
return false;
|
||||
}
|
||||
if (block == null) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import static minsecurity.crypto.TestSM4.SRC_DATA_16B;
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@State(Scope.Thread)
|
||||
@Fork(4)
|
||||
@Fork(1)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Warmup(iterations = 3)
|
||||
@Measurement(iterations = 5)
|
||||
|
||||
Reference in New Issue
Block a user