poidasmith/winrun4j

RegistryKey.getType() returning unexpected values

Opened this issue · 0 comments

I'm leveraging RegistryKey class to access registry. When calling RegistryKey.getType() (which returns a long) the value is sometimes one of TYPE_SZ, TYPE_DWORD, etc.... and sometimes a large number

7710218834719801345
8026079139213606913
etc...

What is returned for any particular registry key seems to vary randomly.

However, I found that by casting this long to an integer the correct value is always obtained.

I suspect that RegistryKey.getType() should return an int and the type coercion should happen somewhere internally