-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Fix bug in FileHandler: it always failed on MacOS #16771
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
Conversation
The `alternatives` list is immutable, so trying to add `"mac/" + name` to it always failed. P.S. I suspect this class is not used anymore, and should be removed.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||
|
@asolntsev Sorry to be a pest, but can you start adding "[java]" to the beginning of your PR titles, so they appear in the commit messages? It also ensures CI for Java gets run: selenium/.github/workflows/ci.yml Lines 69 to 70 in ac59dd8
|
|
No problems, I will add [java] to the title. But I hope this system doesn't hope only on the title, and there is some robust detection of java PRs. Maybe this one? |
It also checks for changes in the bazel |
|
Can you add unit tests for this class? I'm planning to add running unit tests in windows & mac in CI-Java. |
Great! Why do we need this additional complexity? |
Sure, I can add unit-tests. |
You could make changes outside of the Java tree that might affect Java (like a CI workflow or something under ./common) and trigger Java tests by tagging your PR "[java]". I don't think it's extremely useful, but it really doesn't add any additional complexity. |
|
Well, I found out today that |
|
They used to work. Those were created around 3 years ago. Probably GitHub made changes. |
User description
The
alternativeslist is immutable, so trying to add"mac/" + nameto it always failed.P.S. I suspect this class is not used anymore, and should be removed.
🔄 Types of changes
PR Type
Bug fix
Description
Fix immutable list error in FileHandler on macOS
Convert immutable Arrays.asList to mutable ArrayList
Simplify imports and use static constants
Enable dynamic addition of macOS-specific resource paths
Diagram Walkthrough
File Walkthrough
FileHandler.java
Fix macOS resource path handling with mutable listjava/src/org/openqa/selenium/io/FileHandler.java
alternativesfrom immutableArrays.asList()to mutableArrayListto allow adding macOS-specific pathsLocale.ENGLISHwith static import ofLocale.ROOTforconsistency
Objects.requireNonNull()with static import for cleaner codejava.util.*to reduce import clutter