poidasmith / winrun4j

WinRun4J Java Application Launcher
http://winrun4j.sourceforge.net
212 stars 63 forks source link

RegistryKey.getType() returning unexpected values #94

Open joelcarranza opened 5 years ago

joelcarranza commented 5 years ago

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