[fix][IVerifierWriter][v0.1.0] make updatePTCTrustRoot default to allow BBCService version detection #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修改内容
com.alipay.antchain.bridge.plugins.spi.bbc.core.write.IVerifierWriter的updatePTCTrustRoot抽象接口,在其定义前新增default关键字修改原因
com.alipay.antchain.bridge.plugins.spi.utils.pf4j.Utils中的getBBCVersion方法,是通过反射检查某个IBBCService实现类(即插件中)是否override了updatePTCTrustRoot方法,从而判断该BBCService属于V0还是V1版本。但由于IBBCService是声明的抽象类,在语法限制下,BBCService作为实现类,必须要对IBBCService中的所有方法(包括updatePTCTrustRoot)进行override,从而导致getBBCVersion的判断结果会固定为V1。修改结果
在
updatePTCTrustRoot抽象接口中新增default关键字后,BBCService实现类中就能选择是否对updatePTCTrustRoot方法进行override,从而让getBBCVersion方法能够正确判断BBCService属于V0还是V1版本。