Skip to content

Commit 1122a9d

Browse files
HeikoKlareclaude
andcommitted
[Win32] Fix swapped arguments in readRegistryDwords null checks
Objects.requireNonNull(T obj, String message) takes the object to check as the first argument. The two calls in readRegistryDwords had the arguments reversed, causing the non-null string literals "key" and "valueName" to be checked instead of the actual key and valueName variables, making both null guards complete no-ops. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 60e822c commit 1122a9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32

bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,8 +2139,8 @@ public static final boolean OpenPrinter (TCHAR pPrinterName, long [] phPrinter,
21392139

21402140
public static final int[] readRegistryDwords(int hkeyLocation, String key, String valueName) {
21412141
final int ERROR_MORE_DATA = 234;
2142-
Objects.requireNonNull("key", key);
2143-
Objects.requireNonNull("valueName", valueName);
2142+
Objects.requireNonNull(key, "key");
2143+
Objects.requireNonNull(valueName, "valueName");
21442144
long[] phkResult = new long[1];
21452145
TCHAR regKey = new TCHAR(0, key, true);
21462146
TCHAR lpValueName = new TCHAR(0, valueName, true);

0 commit comments

Comments
 (0)