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

CLDR-18217 Make CLDRFile Iterable interface include extra paths by default #4371

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Feb 12, 2025

-Private boolean CLDRFile.DEFAULT_ITERATION_INCLUDES_EXTRAS determines whether to skip extras; either way they skip paths with null values

-Rename old iterator iteratorWithoutExtras

-Iterable and iterator are distinct, as in iterableWithoutExtras versus iteratorWithoutExtras

-Call iteratorWithoutExtras/iterableWithoutExtras directly where tests would otherwise fail with DEFAULT_ITERATION_INCLUDES_EXTRAS true

CLDR-18217

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

…fault

-Private boolean CLDRFile.DEFAULT_ITERATION_INCLUDES_EXTRAS determines whether to skip extras; either way they skip paths with null values

-Rename old iterator iteratorWithoutExtras

-Iterable and iterator are distinct, as in iterableWithoutExtras versus iteratorWithoutExtras

-Call iteratorWithoutExtras/iterableWithoutExtras directly where tests would otherwise fail with DEFAULT_ITERATION_INCLUDES_EXTRAS true
@btangmu
Copy link
Member Author

btangmu commented Feb 12, 2025

I'm not sure whether this should go into v47 or wait for v48. Another option would be to make DEFAULT_ITERATION_INCLUDES_EXTRAS false for v47 (preserving current behavior), and change it to true for v48. There are risks either way. Changing a lot of paths to extra paths (without code-fallback values) has increased the risk that some unknown bugs exist due to skipping extra paths. Including extra paths in iteration could also introduce bugs. Either way, the bugs in question aren't covered yet by unit tests, and they could be tools that are run infrequently.

@macchiati
Copy link
Member

Let's not change behavior from v46.1 this late in the game.

@btangmu
Copy link
Member Author

btangmu commented Feb 12, 2025

Let's not change behavior from v46.1 this late in the game.

Understood. What do you think about making DEFAULT_ITERATION_INCLUDES_EXTRAS false, and merging it that way?

@macchiati
Copy link
Member

macchiati commented Feb 12, 2025 via email

private Iterator<String> extraPaths;

FullIterable(CLDRFile file) {
this.file = file;
this.fileIterator = file.iterator();
this.fileIterator = file.dataSource.iterator(); // file.iteratorWithoutExtras();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.fileIterator = file.dataSource.iterator(); // file.iteratorWithoutExtras();
this.fileIterator = file.iteratorWithoutExtras();

would it be better to use the function for documentation?

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.

3 participants