Repository navigation
Sonar backlog cleanup: clear remaining Maintainability findings (per-rule) - #3398
Conversation
…splay release) BsdPowerSource: the apm path only sources amperage; psPowerUsageRate is never assigned, so the second derive branch (and its == 0 / > 0 guards) was dead. Keep only the live amperage -> power derivation, matching the one-directional data flow (Linux/FreeBSD/Solaris source a rate and keep their bidirectional logic live). MacDisplayJNA: propertySource != null was redundant inside an existing if (propertySource != null) block; gate release on childEntryName != null only, matching the MacDisplayFFM sibling.
…s access The JNA process/memory classes reference constants through oshi's local *Libc / SystemB subtypes (which exist only to add a few extra native methods), but the constants are declared in the JNA supertypes. Replace the subclass-qualified access with static imports of each constant from its true declaring type, preserving platform-specific values: - RLIMIT_NOFILE: from com.sun.jna...Resource (Linux, AIX) and from oshi FreeBsdLibc for DragonFly (inherits FreeBSD's 8, not JNA's 7). - RUSAGE_SELF: from oshi CLibrary (Linux, Mac). - Mac SystemB constants (INT_SIZE, PROC_*, RUSAGE_INFO_V2, HOST_VM_INFO): from com.sun.jna...SystemB. Also drops gratuitous fully-qualified SystemB references in the Mac getrusage block.
JUnit 5 discovers package-private test classes and methods, so the public modifier is unnecessary. Remove it from the flagged test classes (ProcUtilsTest, GlobalMemoryFFMTest, OperatingSystemFFMTest, VirtualMemoryFFMTest, ApplicationInfoTest) and @test methods. The SystemInfoTest classes keep their public modifier (they expose a main demo); only their test methods are de-scoped.
assertThrows lambdas should contain only the single invocation expected to throw. Pull the non-throwing setup calls (createProcessor(), MemorySegment.ofAddress(), CFxxxRef.segment()) into locals before the assertion so each lambda body is the method under test alone.
Replace concatenation passed directly to printf-style/logger calls:
- RegistryUtil, Advapi32UtilFFM, InstalledAppsDataFFM: SLF4J {} placeholders
instead of '+' concatenation in LOG calls.
- SystemInfoHelper, PollGpuStats: the format string is built at runtime
(conditional [%s]/%s, dynamic column width '%-'+nameWidth+'s'), which
S3457 cannot analyze inline; hoist it into a local. PollGpuStats also
DRYs the header/row formats (colFmt/rowFmt) reused at both call sites.
Public static mutable state is exposed to callers. Convert the public static constants to immutable lists instead of Sonar's 'make protected' (meaningless on these final utility classes): - SmcUtil/SmcUtilFFM SMC_KEYS_*_AS: String[] -> unmodifiable List<String>; smcGetFirstFloat now takes List<String> (callers pass these constants). - ComputerID.NON_UNIQUE_UUIDS: wrap Arrays.asList in unmodifiableList (Arrays.asList is fixed-size but element-mutable).
LinuxHWDiskStoreNF (diskType), WindowsPowerSourceJNA/FFM (maxCapacitySafe) nested ternaries replaced with if/else chains. LinuxLibc.SYS_GETTID left as-is and accepted in SonarCloud: it's an interface field initializer (no statements) whose 3-value platform syscall table is documented in the adjacent javadoc and cannot be de-nested without adding a public static helper to a non-API JNA interface.
The three deserialize() overrides implement deprecated MBeanServer interface methods and carry @deprecated; add the matching @deprecated javadoc tag describing them as conformance stubs. (S1133 'remove deprecated code someday' accepted in SonarCloud — these required interface overrides cannot be removed.)
The three locals copying WinNTFFM.OFFSET_* constants used SCREAMING_CASE; rename to offsetEventId/offsetTimeGenerated/offsetLength to match local variable naming (the WinNTFFM constants keep their native-style names).
MockWmiResult ctor (WmiUtilTest) and emptyResult() (WindowsComputerSystemTest) took a Class<T> arg only the diamond/target-type inference already provides; removed it and the redundant TestProp.class arguments. The FFM SystemInfoTest main(String[] args) is accepted in SonarCloud (mandatory main signature).
JMXOshiAgentServer.address was only used within initilizeMbeanServer; make it a local. NetworkMetrics.networkIFs must stay a field — it is a deliberate strong reference keeping NetworkIF objects alive for Micrometer FunctionCounters (which hold them weakly); annotated @SuppressWarnings( "java:S1450") rather than localized, matching the DiskMetrics.diskStores GC-root pattern.
MacPowerSource and LinuxOSProcess are abstract; their constructors are only called via super() from subclasses. Reduce visibility from public to protected.
DOUBLE_QUOTES (?:(?:^")|(?:"$)) -> (?:^"|"$); the inner groups were unnecessary inside the alternation (non-capturing, no backreferences).
WmiNoComInitQueryHandler had two class javadoc blocks; Config had a leftover duplicate field comment. Keep one each.
- S1125: WindowsOperatingSystemJNA — h != null && isWow(h) instead of ?: false - S115: MemoizerTest — numberOfThreads -> NUMBER_OF_THREADS (constant naming) - S1161: WindowsInternetProtocolStatsFFM — add @OverRide on getConnections - S1163: Advapi32UtilFFM — log instead of throwing from finally (would mask the try-body exception); matches the RegistryUtil close-failure pattern - S1171: WindowsCentralProcessor — move instance initializer block into the ctor - S1700: Baseboard MBean — rename field baseboard -> hwBaseboard (shadowed class) - S6213: Advapi32UtilFFM — rename local 'record' (restricted identifier) -> eventRecord - S4030: DisksTest — remove unused partList copy loop (partitions asserted later)
📝 WalkthroughWalkthroughA broad housekeeping PR spanning multiple modules: public SMC temperature key constants changed from ChangesCode Quality and API Housekeeping
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3398 +/- ##
============================================
- Coverage 75.06% 75.05% -0.02%
Complexity 76 76
============================================
Files 579 579
Lines 21351 21353 +2
Branches 3555 3554 -1
============================================
- Hits 16028 16027 -1
- Misses 3301 3304 +3
Partials 2022 2022
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
oshi-core/src/main/java/oshi/util/platform/mac/SmcUtil.java (1)
66-70: ConsiderList.of(...)for consistency with the FFM implementation.The FFM counterpart in
SmcUtilFFM.java(lines 75-77) usesList.of(...)which is more concise. Both approaches achieve immutability, butList.of(...)is the modern idiomatic choice since Java 9 and aligns the two implementations.♻️ Suggested alignment
- public static final List<String> SMC_KEYS_CPU_TEMP_AS = Collections - .unmodifiableList(Arrays.asList("Tp09", "Tp0T", "Tp01", "Tp05", "Tp0D")); + public static final List<String> SMC_KEYS_CPU_TEMP_AS = List.of("Tp09", "Tp0T", "Tp01", "Tp05", "Tp0D"); /** Apple Silicon GPU temperature keys, tried in order until one returns a positive value. */ - public static final List<String> SMC_KEYS_GPU_TEMP_AS = Collections - .unmodifiableList(Arrays.asList("Tg05", "Tg0D", "Tg0f", "Tg0j")); + public static final List<String> SMC_KEYS_GPU_TEMP_AS = List.of("Tg05", "Tg0D", "Tg0f", "Tg0j");🤖 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 `@oshi-core/src/main/java/oshi/util/platform/mac/SmcUtil.java` around lines 66 - 70, Replace the verbose immutable list creation pattern in the SMC_KEYS_CPU_TEMP_AS and SMC_KEYS_GPU_TEMP_AS list definitions with the more concise and modern List.of(...) syntax. Instead of wrapping Arrays.asList(...) with Collections.unmodifiableList(...), use List.of(...) directly which provides immutability by default and aligns with the approach used in SmcUtilFFM.java for consistency across the codebase.oshi-demo/src/main/java/oshi/demo/ComputerID.java (1)
33-35: ConsiderList.of(...)for modern immutable list creation.Similar to the suggestion for
SmcUtil.java,List.of(...)is more concise and idiomatic since Java 9.♻️ Suggested simplification
- public static final List<String> NON_UNIQUE_UUIDS = Collections - .unmodifiableList(Arrays.asList("03000200-0400-0500-0006-000700080009", - "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF", "00000000-0000-0000-0000-000000000000")); + public static final List<String> NON_UNIQUE_UUIDS = List.of( + "03000200-0400-0500-0006-000700080009", + "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF", + "00000000-0000-0000-0000-000000000000");🤖 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 `@oshi-demo/src/main/java/oshi/demo/ComputerID.java` around lines 33 - 35, Replace the verbose immutable list creation pattern in the NON_UNIQUE_UUIDS field definition. Instead of using Collections.unmodifiableList(Arrays.asList(...)), use the more concise and idiomatic List.of(...) method which is available since Java 9. Simply replace the entire Collections.unmodifiableList(Arrays.asList(...)) wrapper with List.of(...) containing the same UUID strings, and remove any now-unused imports for Collections and Arrays if they are not used elsewhere in the file.
🤖 Prompt for all review comments with 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.
Nitpick comments:
In `@oshi-core/src/main/java/oshi/util/platform/mac/SmcUtil.java`:
- Around line 66-70: Replace the verbose immutable list creation pattern in the
SMC_KEYS_CPU_TEMP_AS and SMC_KEYS_GPU_TEMP_AS list definitions with the more
concise and modern List.of(...) syntax. Instead of wrapping Arrays.asList(...)
with Collections.unmodifiableList(...), use List.of(...) directly which provides
immutability by default and aligns with the approach used in SmcUtilFFM.java for
consistency across the codebase.
In `@oshi-demo/src/main/java/oshi/demo/ComputerID.java`:
- Around line 33-35: Replace the verbose immutable list creation pattern in the
NON_UNIQUE_UUIDS field definition. Instead of using
Collections.unmodifiableList(Arrays.asList(...)), use the more concise and
idiomatic List.of(...) method which is available since Java 9. Simply replace
the entire Collections.unmodifiableList(Arrays.asList(...)) wrapper with
List.of(...) containing the same UUID strings, and remove any now-unused imports
for Collections and Arrays if they are not used elsewhere in the file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5d019104-7fac-426c-8b42-8bc4e5f1a840
📒 Files selected for processing (44)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.javaoshi-common/src/main/java/oshi/hardware/common/platform/mac/MacPowerSource.javaoshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdPowerSource.javaoshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsCentralProcessor.javaoshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.javaoshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.javaoshi-common/src/main/java/oshi/util/SystemInfoHelper.javaoshi-common/src/test/java/oshi/driver/common/windows/wmi/WmiUtilTest.javaoshi-common/src/test/java/oshi/hardware/common/AbstractCentralProcessorTest.javaoshi-common/src/test/java/oshi/hardware/common/platform/windows/WindowsComputerSystemTest.javaoshi-common/src/test/java/oshi/nativefree/SystemInfoTest.javaoshi-common/src/test/java/oshi/util/MemoizerTest.javaoshi-common/src/test/java/oshi/util/ProcUtilsTest.javaoshi-core-ffm/src/main/java/oshi/driver/windows/registry/InstalledAppsDataFFM.javaoshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.javaoshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.javaoshi-core-ffm/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.javaoshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsInternetProtocolStatsFFM.javaoshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.javaoshi-core-ffm/src/test/java/oshi/ffm/NativeHandleTest.javaoshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.javaoshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.javaoshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.javaoshi-core-ffm/src/test/java/oshi/ffm/platform/mac/CoreFoundationTest.javaoshi-core/src/main/java/oshi/hardware/platform/mac/MacDisplayJNA.javaoshi-core/src/main/java/oshi/hardware/platform/mac/MacVirtualMemoryJNA.javaoshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.javaoshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/unix/aix/AixOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/unix/dragonflybsd/DragonFlyBsdOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/windows/WindowsOperatingSystemJNA.javaoshi-core/src/main/java/oshi/util/platform/mac/SmcUtil.javaoshi-core/src/main/java/oshi/util/platform/windows/RegistryUtil.javaoshi-core/src/test/java/oshi/SystemInfoTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.javaoshi-demo/src/main/java/oshi/demo/ComputerID.javaoshi-demo/src/main/java/oshi/demo/PollGpuStats.javaoshi-demo/src/main/java/oshi/demo/WmiNoComInitQueryHandler.javaoshi-demo/src/main/java/oshi/demo/gui/Config.javaoshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.javaoshi-demo/src/main/java/oshi/demo/jmx/mbeans/Baseboard.javaoshi-metrics/src/main/java/oshi/metrics/NetworkMetrics.java
💤 Files with no reviewable changes (3)
- oshi-demo/src/main/java/oshi/demo/WmiNoComInitQueryHandler.java
- oshi-demo/src/main/java/oshi/demo/gui/Config.java
- oshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, windows-latest
- GitHub Check: Test JDK 26, windows-latest
- GitHub Check: Test JDK 26, macos-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
- GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.javaoshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.javaoshi-common/src/main/java/oshi/hardware/common/platform/mac/MacPowerSource.javaoshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.javaoshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdPowerSource.javaoshi-common/src/main/java/oshi/util/SystemInfoHelper.javaoshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsCentralProcessor.java
📚 Learning: 2026-04-08T00:58:07.212Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3125
File: oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.java:131-133
Timestamp: 2026-04-08T00:58:07.212Z
Learning: Do not flag `getPowerSources()` as incorrect when it returns a singleton list that wraps `getPowerSource("System Battery")` and/or short-circuits the enumeration after the first eligible battery pack in the Windows power source JNA/FFM implementations. This is intentional for longstanding JNA behavior; a refactor to support zero-or-more batteries is planned later, so the current single-battery behavior should be treated as by-design rather than a bug.
Applied to files:
oshi-core-ffm/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.javaoshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).
Applied to files:
oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.javaoshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/unix/aix/AixOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.javaoshi-core/src/main/java/oshi/software/os/windows/WindowsOperatingSystemJNA.javaoshi-core/src/main/java/oshi/hardware/platform/mac/MacVirtualMemoryJNA.javaoshi-core/src/main/java/oshi/software/os/unix/dragonflybsd/DragonFlyBsdOSProcessJNA.javaoshi-core/src/main/java/oshi/hardware/platform/mac/MacDisplayJNA.java
📚 Learning: 2026-04-12T19:34:56.879Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:34:56.879Z
Learning: In OSHI’s Java platform implementations, `PhysicalProcessor.getEfficiency()` / `EfficiencyClass` follow the same convention as Windows `PROCESSOR_RELATIONSHIP.EfficiencyClass`: a *higher* numeric efficiency class value represents *greater performance* and *less efficiency* (typically P-cores higher than E-cores). When reviewing, do not treat cases where P-cores are assigned higher efficiency/class values as a bug—this is intentional cross-platform consistency.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsCentralProcessor.java
🔇 Additional comments (44)
oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsInternetProtocolStatsFFM.java (1)
28-29: LGTM!oshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdPowerSource.java (1)
108-111: LGTM!oshi-core-ffm/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.java (1)
210-217: LGTM!oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java (1)
171-177: LGTM!oshi-core/src/main/java/oshi/util/platform/windows/RegistryUtil.java (1)
68-68: LGTM!oshi-core-ffm/src/main/java/oshi/driver/windows/registry/InstalledAppsDataFFM.java (1)
154-154: LGTM!oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java (3)
172-174: LGTM!
245-245: LGTM!
406-435: LGTM!oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.java (1)
59-59: LGTM!oshi-common/src/main/java/oshi/util/SystemInfoHelper.java (1)
398-406: LGTM!oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.java (1)
63-68: LGTM!oshi-core/src/main/java/oshi/hardware/platform/mac/MacDisplayJNA.java (1)
92-94: LGTM!oshi-core/src/main/java/oshi/software/os/windows/WindowsOperatingSystemJNA.java (1)
546-546: LGTM!oshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.java (1)
7-8: LGTM!Also applies to: 37-37, 65-65, 74-74
oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java (1)
7-12: LGTM!Also applies to: 119-119, 190-191, 195-196, 235-236, 253-253, 261-261
oshi-core/src/main/java/oshi/software/os/unix/aix/AixOSProcessJNA.java (1)
7-7: LGTM!Also applies to: 71-71, 82-82
oshi-core/src/main/java/oshi/hardware/platform/mac/MacVirtualMemoryJNA.java (1)
7-8: LGTM!Also applies to: 49-50
oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java (1)
60-60: LGTM!Also applies to: 66-66
oshi-core-ffm/src/test/java/oshi/ffm/VirtualMemoryFFMTest.java (1)
24-24: LGTM!oshi-core/src/test/java/oshi/SystemInfoTest.java (1)
61-61: LGTM!oshi-common/src/test/java/oshi/driver/common/windows/wmi/WmiUtilTest.java (1)
33-33: LGTM!Also applies to: 39-39, 45-45, 51-51, 57-57, 63-63, 69-69, 75-75, 91-95
oshi-common/src/test/java/oshi/hardware/common/platform/windows/WindowsComputerSystemTest.java (1)
26-26: LGTM!Also applies to: 34-34
oshi-common/src/test/java/oshi/hardware/common/AbstractCentralProcessorTest.java (1)
107-108: LGTM!Also applies to: 325-325, 328-328, 331-331
oshi-core-ffm/src/test/java/oshi/ffm/GlobalMemoryFFMTest.java (1)
33-33: LGTM!oshi-core-ffm/src/test/java/oshi/ffm/OperatingSystemFFMTest.java (1)
31-31: LGTM!oshi-core/src/main/java/oshi/software/os/unix/dragonflybsd/DragonFlyBsdOSProcessJNA.java (1)
7-7: No change needed; this code is correct as-is.DragonFlyBsdLibc extends FreeBsdLibc without defining its own
RLIMIT_NOFILEconstant. Both FreeBSD and DragonFly BSD use the same constant value (8) in their respectivesys/resource.hheaders. The current import fromFreeBsdLibc.RLIMIT_NOFILEprovides the correct constant for both platforms, and usingDragonFlyBsdLibc.INSTANCE.getrlimit()correctly applies the inherited constant value. The premise that "DragonFly's constant differs" is not supported by evidence.oshi-core-ffm/src/test/java/oshi/ffm/platform/mac/CoreFoundationTest.java (1)
154-155: LGTM!Also applies to: 454-455, 462-463, 470-471, 478-479, 486-487
oshi-core-ffm/src/test/java/oshi/ffm/NativeHandleTest.java (1)
76-77: LGTM!oshi-common/src/test/java/oshi/util/MemoizerTest.java (1)
37-37: LGTM!Also applies to: 43-43, 111-111, 187-187
oshi-common/src/test/java/oshi/util/ProcUtilsTest.java (1)
20-20: LGTM!oshi-common/src/test/java/oshi/nativefree/SystemInfoTest.java (1)
57-57: LGTM!oshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.java (1)
25-25: LGTM!Also applies to: 82-82, 89-89, 96-96, 112-112, 122-122
oshi-core/src/main/java/oshi/util/platform/mac/SmcUtil.java (1)
155-163: LGTM!oshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.java (2)
75-77: LGTM!
173-181: LGTM!oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacPowerSource.java (1)
51-61: LGTM!oshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsCentralProcessor.java (1)
33-37: LGTM!oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java (1)
100-100: LGTM!oshi-demo/src/main/java/oshi/demo/PollGpuStats.java (1)
52-55: LGTM!Also applies to: 92-92
oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java (2)
101-102: LGTM!
315-349: LGTM!oshi-demo/src/main/java/oshi/demo/jmx/mbeans/Baseboard.java (1)
32-32: LGTM!Also applies to: 39-39, 49-49, 62-62, 72-78
oshi-metrics/src/main/java/oshi/metrics/NetworkMetrics.java (1)
61-63: LGTM!
Clears the remaining open SonarCloud findings (all Maintainability; 0 Reliability / 0 Security throughout). Each rule is its own commit; tiny one-off rules are grouped into a final singleton sweep.
Fixed in code
RLIMIT_NOFILEvalues)publicon JUnit5 test classes/methodsassertThrowslambdas{}placeholders / hoist runtime-built format stringspublic staticcollections immutable (SMC_KEYS_*,NON_UNIQUE_UUIDS)if/else@deprecatedjavadoc to JMXMBeanServerconformance stubsClass<T>params in WMI test mocksaddress; keepNetworkMetrics.networkIFsas a GC-root field (@SuppressWarnings)protectedTriaged as not-a-code-change (handled in SonarCloud)
junit.jupiter.params), S5785 (equals()-branch tests), S1133 (JMX deprecated-interface stubs), S3400, S1135, S1479, S1871, plus partials of S3358/S1172/S3358.forEach…Untilearly return is contractual, not redundant).Notable
A few were more than mechanical: S2386 was genuine
public staticmutable-state exposure;NetworkMetrics.networkIFs/DiskMetrics.diskStoresare deliberate Micrometer GC roots (kept, not localized); only DragonFly'sRLIMIT_NOFILEwas S3252-flagged because FreeBSD/OpenBSD/Solaris redefine it locally.Verification
Clean full-reactor
mvnw clean install: BUILD SUCCESS, 1321 tests, 0 failures / 0 errors (platform-conditional skips on macOS).Summary by CodeRabbit
Refactoring
New Features
WmiNoComInitQueryHandlerfor COM initialization control in demo applications.REFRESH_SLOWERtiming constant for GUI refresh configuration.Bug Fixes