-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Refactor: IProject: add getter and setter of Segmenter and removal of static fileds of the objects in Core class #1194
base: master
Are you sure you want to change the base?
Refactor: IProject: add getter and setter of Segmenter and removal of static fileds of the objects in Core class #1194
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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.
There are space to improve an order of arguments.
This comment was marked as outdated.
This comment was marked as outdated.
refactoring FilterMaster does not work well. I want to revert it. |
70dbe22
to
05f4c8d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There are unrelated refactorings. I want to skip it. |
…ject - Add getSegmenter/setSegmenter to IProject - Update Core.getSegmenter/setSegmenter to use currentProject.getSegmenter/setSegmenter Signed-off-by: Hiroshi Miura <[email protected]>
05f4c8d
to
2bffaf0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
The test failure is happened because an aligner test uses |
- Allow Aligner to have segmenter object without depending Core.getSegmenter() - Aligner should works without loading project, so it should have its own object - Aligner also have a feature to call SegmentationCustomizer, so when user customize the segmenter, Aligner uses new one. - SegmentetionCustomizer saves customized SRX as user preference and store it in the project, so Aligner do not need to call Core.setSegmenter() Signed-off-by: Hiroshi Miura <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
…egmenter Signed-off-by: Hiroshi Miura <[email protected]> # Conflicts: # aligner/src/main/java/org/omegat/gui/align/AlignPanelController.java # aligner/src/main/java/org/omegat/gui/align/Aligner.java
The issue in Aligner is dealt with #1190. Now merge it. |
…project Signed-off-by: Hiroshi Miura <[email protected]>
❌ Acceptance Tests failed. Please look a Gradle Scan page for details: |
Move segmenter object to be hold by RealProject object.
There are Preferences and configurations of SRX in User preferences and project-specific custom segmentation rules.
There is a segmenter object which is for the current live project, which is runtime property of the live project.
Current implementation hold the segmenter in the Core class as static field.
Here propose it to move into RealProject class, and extend IProject interface to have getter and setter of the segmenter.
Pull request type
refactoring
Which ticket is resolved?
Discussed on DEV-ML thread
What does this PR change?
* removal of static fileds of segmenter
* removal of initialization of these fields in initilizeGuiImpl method
* Update getters to return value from
currentProject#getSegmenter
* Update setters as well
* We don't need to reset Core static fields value when closing project.
* Removal of
Core.setSegmenter
. We define private filed of the test class for these objects.* We extend mock project class with these private fields
* These changes make the test case does not depend on the static context, so there will be no interference among test cases.
AlignFilesCallback
ctor to take segmenter object.* the callback object does not depend on static context of the OmegaT project.
* We can test
ExternalTMFactory
without Core static context.Other information