Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using System.Buffers;
using System.Buffers.Binary;
using System.ComponentModel;
using System.Diagnostics;

namespace GameFrameX.Foundation.Hash;

Expand Down Expand Up @@ -675,7 +676,7 @@
public override int GetHashCode()
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
{
throw new NotSupportedException();
throw new UnreachableException();

Check failure on line 679 in GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this 'throw' statement.

See more on https://sonarcloud.io/project/issues?id=GameFrameX_GameFrameX.Foundation&issues=AZ-utrwI2NhhPqB0iIY4&open=AZ-utrwI2NhhPqB0iIY4&pullRequest=109

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

同步 XML 文档中的异常类型。

当前实现抛出 UnreachableException,但上方 Line 671-672 仍声明会抛出 NotSupportedException。请同步更新 <returns><exception cref> 文档,避免生成的 API 文档与实际行为不一致。

建议修改
-        /// <returns>此方法将始终抛出 <see cref="NotSupportedException"/> / This method will always throw a <see cref="NotSupportedException" /></returns>
-        /// <exception cref="NotSupportedException">在所有情况下抛出 / In all cases</exception>
+        /// <returns>此方法将始终抛出 <see cref="UnreachableException"/> / This method will always throw a <see cref="UnreachableException" /></returns>
+        /// <exception cref="UnreachableException">在所有情况下抛出 / In all cases</exception>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@GameFrameX.Foundation.Hash/CrcHelper.Crc64.cs` at line 679, 同步更新相关方法的 XML
文档,将异常声明从 NotSupportedException 改为实际抛出的 UnreachableException,并确保 returns
文档与该方法当前行为保持一致。

}
}
}