Skip to content

Conversation

@asolntsev
Copy link
Collaborator

No description provided.

@what-the-diff
Copy link

what-the-diff bot commented Aug 22, 2024

PR Summary

  • Enhancement in FakeValuesGrouping.java
    Adding a more efficient way of handling files which are part of the 'EnFile'. This is achieved by using a lambda expression to iterate each file and add it to ENGLISH_FAKE_VALUE_GROUPING. This will simplify the procedure and enhance the execution speed.

  • Various changes in EnFile.java

    • Safety and Encapsulation Improvement: The attribute 'YML' has been changed from public to private. This means that it can only be directly accessed within the EnFile.java now, making it safer and less prone to potential errors.
    • Method Update: The getFiles() method was changed to return a Stream of EnFile objects instead of a List. This provides a potentially more efficient way to handle large data sets.
    • Initialization Change: The initialization of FILES_WITH_A_DIFFERENT_PATH updated to use asList() instead of Arrays.asList(). This update makes the code more readable and consistent.

@codecov
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (b5b1bdc) to head (7dbe3e1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1332      +/-   ##
============================================
+ Coverage     91.80%   91.82%   +0.02%     
  Complexity     3157     3157              
============================================
  Files           316      316              
  Lines          6232     6229       -3     
  Branches        634      633       -1     
============================================
- Hits           5721     5720       -1     
+ Misses          353      351       -2     
  Partials        158      158              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asolntsev asolntsev changed the title [refactoring] simplify EnFile: don't collect a static list that is needed only once simplify EnFile: don't collect a static list that is needed only once Aug 22, 2024

// files where the search path can't be derived from the filename
private static final List<EnFile> FILES_WITH_A_DIFFERENT_PATH = Arrays.asList(
private static final List<EnFile> FILES_WITH_A_DIFFERENT_PATH = asList(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be immutable can't it? Being a CONSTANT certainly implies that's the case.
If so why not use List.of and not import anything from the Arrays package?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kingthorin Good point. Done.

@asolntsev asolntsev force-pushed the refactoring/simplify-en-file branch from 6b8c2a7 to 9021bc8 Compare August 22, 2024 20:24
@kingthorin kingthorin merged commit 74e02a8 into main Aug 22, 2024
@kingthorin kingthorin deleted the refactoring/simplify-en-file branch August 22, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants