簡體   English   中英

SonarQube-“可序列化”類中的規則字段應該是瞬態的或可序列化的

[英]SonarQube - Rule Fields in a “Serializable” class should either be transient or serializable

它可能看起來像是重復的問題,但是我已經發布了聲納規則兼容建議的代碼示例。 當使用SonarQube評估下面突出顯示的代碼時,將導致squid:S1948規則違反。

在此處輸入圖片說明

結果,

在此處輸入圖片說明

plz闡明了為什么仍顯示其違反合規代碼仍是一個謎。

更新

即使使用sonar.java.binaries也無法解決瞬時或可序列化問題

聲納掃描成功,但引發類加載器警告:

08:26:44.984 INFO - Java bytecode scan... 08:26:44.992 WARN - Class 'dummyserial/Address' is not accessible through the C lassLoader. 08:26:44.993 WARN - Class 'dummyserial/Person' is not accessible through the Cl assLoader. 08:26:44.993 WARN - Class 'dummyserial/Address' is not accessible through the C lassLoader. 08:26:44.994 WARN - Class 'dummyserial/Person' is not accessible through the Cl assLoader. 08:26:44.994 WARN - Class 'dummyserial/Address' is not accessible through the C lassLoader. 08:26:44.997 WARN - Class 'dummyserial/Person' is not accessible through the Cl assLoader. 08:26:44.998 INFO - Java bytecode scan done: 14 ms

如前所述,您應該填充sonar.java.binaries屬性,以便進行字節碼分析和符號解析。 擁有此屬性后,分析不會對該案件造成任何問題。

現在,當我們無法解析字段的符號類型時,我們提出了一個問題,這確實很煩人。 我創建了以下票證來解決此問題: SONARJAVA-1266

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM