Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Win32Exception.addSuppressedReflected() still needed? #1543

Closed
dEajL3kA opened this issue Aug 7, 2023 · 3 comments
Closed

Is Win32Exception.addSuppressedReflected() still needed? #1543

dEajL3kA opened this issue Aug 7, 2023 · 3 comments

Comments

@dEajL3kA
Copy link
Contributor

dEajL3kA commented Aug 7, 2023

As far as I can tell, Win32Exception.addSuppressedReflected() is a "hack" to support old JDK versions that did not have Throwable.addSuppressed(). However, as far as I can tell, Throwable.addSuppressed() was introduced in JDK 1.7 (Java 7) and therefore the "hack" is only required to support JDK 1.6 (Java 6) or older. But do we still care about JDK 1.6 (Java 6)? I think the oldest JDK that is still maintained is JDK 1.8 (Java 8), which means that JDK 1.7 (Java 7) is obsolete, let alone JDK 1.6 (Java 6).

So, unless JNA still aims to support JDK 1.6 (Java 6), I would like to suggest to just remove Win32Exception.addSuppressedReflected() and use Throwable.addSuppressed() directly, which is a big simplification.

@matthiasblaesing
Copy link
Member

Yes, the production builds target JDK 6.

@dEajL3kA
Copy link
Contributor Author

dEajL3kA commented Aug 8, 2023

Then I don't understand why addSuppressedReflected() and addSuppressed() are mixed in the code 🤔

See here for an example where addSuppressed() is called directly:

@matthiasblaesing
Copy link
Member

"are mixed in the code" is a slight exaggeration. There is exactly one such instance. While being picky, there is also a usage of StandardCharsets in DBT.java. Whether I think this was worth the few hours this took is another matter. #1545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants