Skip to content

Conversation

@Muhanned-Anwar
Copy link

@Muhanned-Anwar Muhanned-Anwar commented Apr 2, 2023

Changes made:

Added a Objects.requireNonNull check for the path parameter to ensure it's not null.
Used Files.createTempFile to create a temporary file instead of manually creating a directory and file. This ensures that the file is created securely and with a unique name.
Removed the unnecessary null check for temporaryDir, as it's now unnecessary with the use of Files.createTempFile.
Simplified the exception handling by catching IOException and NullPointerException separately, and removing the duplicate temp.delete() code.
Used method chaining to simplify the code and reduce nesting.

@CLAassistant
Copy link

CLAassistant commented Apr 2, 2023

CLA assistant check
All committers have signed the CLA.

@Muhanned-Anwar Muhanned-Anwar changed the title Update NativeUtils.java Refactor Function unpackLibraryFromJarInternal in NativeUtils.java Apr 2, 2023
@shailrshah
Copy link

shailrshah commented Apr 2, 2023

@Muhanned-Anwar, could you give me write permission to your fork? I'd like to make a commit.

I think you need to check the box that says "Allow edits by maintainers" on the right side of this page.

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

Successfully merging this pull request may close these issues.

3 participants