Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Advapi32Util.registryGetStringValue Javadoc says only REG_SZ values are allowed, but implementation also allows REG_EXPAND_SZ

Open
#1,513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Read contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java around registryGetStringValue(), registrySetStringValue(), and registryGetExpandableStringValue(). Determine whether REG_EXPAND_SZ is intended to be accepted, then align the Javadoc or implementation with that contract. Done means the documented behavior and the registry value handling agree.

Written by the indexing model from the issue text.

Description

The Javadoc of Advapi32Util.registryGetStringValue()
https://github.com/java-native-access/jna/blob/e96f30192e9455e7cc4117cce06fc3fa80bead55/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java#LL754C32-L754C32
says

Get a registry REG_SZ value.,

however the implementation
https://github.com/java-native-access/jna/blob/e96f30192e9455e7cc4117cce06fc3fa80bead55/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java#LL772C52-L772C52
also returns the value if its type is

REG_EXPAND_SZ.

My expectation was that REG_EXPAND_SZ would be rejected for symmetry reasons:

  • #registrySetStringValue() <- REG_SZ
  • #registryGetStringValue() -> REG_SZ / REG_EXPAND_SZ
  • #registrySetExpandableStringValue() <- REG_EXPAND_SZ
  • #registryGetExpandableStringValue() -> REG_EXPAND_SZ

Is the implementation incorrect or is this the expected behavior and the Javadoc should be adjusted?

Dominant language
Java
Stars
8.9k
Forks
1.7k
Avg merge
1d 13h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from java-native-access/jna

All issues in java-native-access/jna

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.