[英]Why Eclipse null analysis ignore null-checking statement: if (someObject != null) {…}, when someObject is a field-scope variable?
[英]Why does Eclipse JDT Null-Checking respect Apache Commons Validate
我在Eclipse-JDT上使用@ NonNull-Checking,很高興看到它理解並尊重Apache Commons Validate的使用。 在代碼中意味着:
Validate.notNull(someInput);
@NonNull String a = someInput;
沒有第一行,第二行在Eclipse中產生警告。 我只能配置是否應尊重“斷言”。 但也沒有任何其他通知,它也遵循Validate#notNull和Objects#requireNonNull。 這很棒,但我想知道:
該列表是硬編碼的,不能擴展(除非通過修改源代碼)。
org.eclipse.jdt.internal.compiler.lookup
和org.eclipse.jdt.internal.compiler.ast
涉及的一些主要類包括TypeConstants
和TypeIds
接口以及ReferenceBinding
和MessageSend
類。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.