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

P #487

Merged
merged 26 commits into from
Oct 19, 2024
Merged

P #487

merged 26 commits into from
Oct 19, 2024

Conversation

caring-coder
Copy link
Member

@caring-coder caring-coder commented Oct 5, 2024

Lots of refactorings

Copy link

github-actions bot commented Oct 5, 2024

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@caring-coder caring-coder force-pushed the p branch 3 times, most recently from ff5d7e6 to 3a57acc Compare October 19, 2024 14:08
A bug exists when looking for a commented run if the run has ProofErr issues. Added a TODO comment to highlight this issue for further investigation and resolution.
Add a TODO comment to find a way to avoid calling replaceWordWith when not on a run. This is intended to improve code robustness and prevent unnecessary log entries.
Simplify the logic for determining the target content based on the expression's presence. Replaced the multiline if-else block with a more concise ternary operator.
Update test method names to provide clearer descriptions of their functionality. Also, add missing `DisplayName` annotations for improved readability in test reports. This improves code readability and helps better understand each test's purpose.
Updated test cases to use streamlined configuration methods from OfficeStamperConfigurations by replacing verbose factory method calls with concise imports. Introduced logging for better test output management.
Improve the string representation of Word documents to resemble AsciiDoc, enabling clearer differentiation of styles in tests. Simplify word template representations to reduce verbosity and enhance readability in test outputs.
Implemented the remove method in StandardParagraph and PowerpointParagraph classes to encapsulate paragraph deletion logic. Updated DisplayIfProcessor to use the new method, replacing direct calls to ObjectDeleter.
Implement a replace method in Paragraph API for handling insertion and removal of multiple paragraphs at specified positions. This change standardizes the way paragraphs are manipulated across different implementations.
Replaced getP() method calls with a new apply(Consumer<P> pConsumer) method to simplify paragraph processing and improve code readability. This change affects the CustomCommentProcessor, PowerpointParagraph, Paragraph interface, and related classes.
Add a new generic method `elements` to the Paragraphs class to filter and cast elements by type. Simplified the `ParagraphRepeatProcessor` replace logic by using this method, improving readability and maintainability.
Added a comment to note that the current Paragraph to Paragraphs mapping should be changed to a Paragraph to List<Object> mapping for better reflectivity. This note will help guide future improvements in handling paragraph repetitions more efficiently.
Standardize the "// TODO:" comments by removing the "_LATER" suffix. This improves readability and maintains a consistent style across the codebase. No functional changes were made.
Introduce a static method `throwing(String message)` to provide a `Supplier` of `OfficeStamperException` with a specified message. This enhancement simplifies exception handling by enabling deferred exception creation.
Extracted MergeSameStyleRuns and RemoveProofErrors into their own packages. This improves code organization and encourages separation of concerns, making the codebase easier to maintain and extend in the future.
Introduce a new preprocessor to handle and remove malformed comments in DOCX files. This change includes tests for the new functionality and integration into the standard configuration.
Enhance documentation by adding Javadoc comments to the ProcessorContext record. This provides clear descriptions of the parameters, improving code readability and maintainability.
Annotated method parameters with @nullable in CommentProcessorFactory to indicate they can accept null values. This enhances method contracts and improves code readability and stability by explicitly handling potential null inputs.
Replaced repetitive table row and cell assertion logic with streamlined parent retrieval methods. This change reduces redundancy and improves code maintainability by using a more consistent approach to traversing and validating parent elements.
Updated methods in StandardParagraph and related classes to pass the source document context. This enhances traceability and ensures that each paragraph retains its originating context for more accurate document processing.
Added @nullable annotations to DisplayIfProcessor methods to handle null conditions safely. Introduced toString method in StandardPlaceholder for improved string representation. Minor refactoring and import adjustments in RepeatProcessor and RepeatParagraphProcessor.
Replaced for-each loops with method references to enhance readability and reduce verbosity in the removeParagraphs, removeTables, and removeTableRows methods. Also updated import statement to use OfficeStamperException for consistent exception handling.
Removed commented-out legacy code from the asString() method for better readability and maintainability. The method now correctly uses the stream API to concatenate text from runs.
Condensed multiple line statements into single lines to enhance code clarity and consistency. Adjusted line breaks and formatting to follow a more streamlined style.
Simplify streamRun method by using DocumentUtil to streamline object elements. This change enhances readability and maintains the filtering and mapping functionality.
Added several new methods to the Paragraph interface for improved handling of comments and parent retrieval. Refactored related classes to remove exposed dependencies and deprecated unnecessary methods, ensuring a cleaner, more efficient API.
Deleted the unnecessary import of CommentsPart in the DocxDocument class. This cleanup helps reduce clutter and can improve the maintainability of the code.
Copy link

@caring-coder caring-coder merged commit 24a1cfc into main Oct 19, 2024
7 checks passed
@caring-coder caring-coder deleted the p branch October 19, 2024 14:25
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.

1 participant