-
Notifications
You must be signed in to change notification settings - Fork 4
Consolidate more XML parsing, FileLike usages #929
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates XML parsing and FileLike usage across the LabKey platform by standardizing XML document builder creation and migrating from File to FileLike objects for better virtual file system support.
- Replace custom DocumentBuilderFactory instantiation with centralized XmlBeansUtil.DOCUMENT_BUILDER_FACTORY
- Migrate File-based operations to FileLike for improved virtual file system compatibility
- Update zip extraction and file handling to use FileLike APIs consistently
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| protein/src/org/labkey/protein/ProteinServiceImpl.java | Replaces local DocumentBuilderFactory with XmlBeansUtil.DOCUMENT_BUILDER_FACTORY |
| flow/src/org/labkey/flow/controllers/WorkspaceData.java | Migrates File to FileLike for temporary directory handling |
| flow/enginesrc/org/labkey/flow/persist/AnalysisSerializer.java | Updates extractArchive method to use FileLike for zip extraction operations |
| flow/enginesrc/org/labkey/flow/analysis/model/CompensationMatrix.java | Consolidates XML document builder creation using XmlBeansUtil |
| flow/enginesrc/org/labkey/flow/Main.java | Migrates zip extraction logic from File to FileLike |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // TODO: with `setNamespaceAware(true)`, is the following still needed? | ||
| // DocumentBuilderFactory.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true) |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment should be properly formatted as a Javadoc comment or regular comment block, and the question should be resolved or tracked in a proper issue tracker rather than left as inline code comments.
| // TODO: with `setNamespaceAware(true)`, is the following still needed? | |
| // DocumentBuilderFactory.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true) | |
| /* | |
| * The following line was previously used to enable namespace awareness: | |
| * DocumentBuilderFactory.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true) | |
| * If you need to revisit namespace handling, see the relevant documentation or issue tracker. | |
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my quick analysis, seems like setNamespaceAware() is sufficient and will stomp over the setFeature() value anyway
| } | ||
|
|
||
| public static File extractArchive(File file, File tempDir) | ||
| public static File extractArchive(File file, FileLike tempDir) |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method signature is inconsistent - it accepts a File parameter but returns a File while using FileLike for tempDir. Consider updating the return type to FileLike or the input parameter to FileLike for API consistency.
| // TODO: with `setNamespaceAware(true)`, is the following still needed? | ||
| // DocumentBuilderFactory.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my quick analysis, seems like setNamespaceAware() is sufficient and will stomp over the setFeature() value anyway
Rationale
Related Pull Requests
Changes