Closed PluieM closed 6 days ago
The recent updates focus on enhancing null-safety within the codebase by adding @NotNull
and @Nullable
annotations. This improves the overall robustness and clarity of the parameters and return types across multiple classes. Several constructor and method parameters are now explicitly non-null, ensuring better data integrity and reducing the likelihood of NullPointerException
occurrences.
File Path | Change Summary |
---|---|
src/main/java/com/ghostchu/peerbanhelper/BuildMeta.java |
Added @NotNull to loadBuildMeta method parameter. |
src/main/java/com/ghostchu/peerbanhelper/Main.java |
Removed libraryDirectory variable declaration. |
src/.../PeerBanHelperServer.java |
Added @NotNull and @Nullable annotations to various methods and parameters. Changed return types of some methods to use thread-safe collections. |
src/.../alert/Alert.java |
Added @NotNull annotations to fields in Alert record. |
src/.../alert/AlertManager.java |
Added @NotNull annotations to method parameters, improving non-null safety. |
src/.../btn/BtnNetwork.java |
Added @NotNull annotations to constructor parameters. |
src/.../btn/BtnRuleParsed.java |
Added @NotNull annotations to method parameters and updated constructor logic. |
src/.../config/MainConfigUpdateScript.java |
Added @NotNull annotation to constructor parameter. |
src/.../config/PBHConfigUpdater.java |
Added @NotNull annotations to constructor parameters. |
src/.../database/BanLog.java |
Added @NotNull and @Nullable annotations to fields for better nullability specification. |
src/.../database/DatabaseHelper.java |
Added @NotNull and @Nullable annotations to method parameters. |
src/.../database/DatabaseManager.java |
Added @NotNull annotation to method parameter in setupDatabase . |
src/.../database/RuleSubInfo.java |
Added @NotNull annotations to fields in RuleSubInfo . |
src/.../database/RuleSubLog.java |
Added @NotNull annotations to fields in RuleSubLog . |
src/.../downloader/Downloader.java |
Added @NotNull and @Nullable annotations to method parameters and return types. |
src/.../downloader/DownloaderBasicAuth.java |
Added @NotNull annotations to fields in DownloaderBasicAuth record. |
src/.../downloader/DownloaderInfo.java |
Added @NotNull annotations to constructor parameters. |
src/.../downloader/impl/biglybt/BiglyBT.java |
Added @NotNull annotations to method parameters and return types. |
src/.../downloader/impl/qbittorrent/QBittorrent.java |
Added @NotNull annotations to method parameters and return types. |
src/.../downloader/impl/qbittorrent/SingleTorrentPeer.java |
Added @NotNull annotation to return type of getPeerAddress method. |
src/.../downloader/impl/transmission/TRPeer.java |
Added @NotNull annotation to return type of getPeerAddress method. |
src/.../downloader/impl/transmission/TRTorrent.java |
Added @NotNull annotations to return types of methods. |
In files of code, clarity's realm did rise,
With@NotNull
and@Nullable
in their guise.
Robust and safe, our paths now trace,
A dance of data, a safer place.
FromPeerBanHelper
toDownloader's
grind,
We’ve banished the nulls, now peace we find.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
感觉有点奇怪,空安全注解那个 commit 我应该 force push 覆盖掉了
感觉有点奇怪,空安全注解那个 commit 我应该 force push 覆盖掉了
不奇怪,我merge的时候应该还没有覆盖,那我先关了重新提
使用bloom filter提高btn网络下发的ip规则匹配性能
Summary by CodeRabbit
Enhancements
@NotNull
and@Nullable
annotations.Removed
Main
class by removing thelibraryDirectory
variable.These changes collectively enhance the application's stability and reliability by ensuring better handling of null values and clarifying method contracts.