Skip to content

Conversation

@srl295
Copy link
Member

@srl295 srl295 commented Dec 20, 2025

CLDR-18927

  • This PR completes the ticket. (though, are there doc changes we should make?)

ALLOW_MANY_COMMITS=true

- non-TC orgs count the number of voters, not the time
- add tests
- improve (reduce) test noise
- fix some cases where VoteResolver getters haven't updated votes
- un-deprecate getOrgVote() - it is used by the vorting machinery! Added javadoc notes for clarity.
@srl295 srl295 marked this pull request as draft December 20, 2025 19:37
@srl295 srl295 marked this pull request as ready for review December 20, 2025 21:09
Copy link
Member

@btangmu btangmu left a comment

Choose a reason for hiding this comment

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

Some follow-up to fix the TODOs, comments and naming would be ideal. The Counter object seems to have been intended for more generic usage, while "participants" seems to belong in a more specific class.

}

/** return the number of times participate() was counted */
public final int getParticipants() {
Copy link
Member

Choose a reason for hiding this comment

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

It's a little unclear what this means, just from the function name and description. It could be the number of people who participated, or the number of times a particular person participated, or the sum of the latter for all people...

Copy link
Member Author

Choose a reason for hiding this comment

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

this is the raw counter. So participants is meant to be a generic term here, per the javadoc.

return participants;
}

/** add one to the participant coutn */
Copy link
Member

Choose a reason for hiding this comment

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

typo here: coutn -> count

*/

// temporarily make the top voted value this org's value.
// TODO: may not be needed, see below
Copy link
Member

Choose a reason for hiding this comment

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

"TODO" comment should have a ticket number; this PR completes this ticket

considerTime = items.getTime(considerItem);
} else if ((time > maxtime) && (count == maxCount)) {
considerCount = items.getCount(considerItem); // TODO: == maxCount == count?
considerTime = items.getTime(considerItem); // TODO: == maxtime == time?
Copy link
Member

Choose a reason for hiding this comment

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

more TODO without ticket

annotateTranscript(
"--- %s vote is for '%s' with strength %d",
org.getDisplayName(), considerItem, considerCount);
// TODO: is this ever not reached if there is a value?
Copy link
Member

Choose a reason for hiding this comment

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

TODO without ticket

public class TestVoteResolver {

@Test
void testNonTcOrgByCountNotTime() {
Copy link
Member

Choose a reason for hiding this comment

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

Hurray for unit testing!

public long value;
private final int forceUnique;
public long time;
public int participants;
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be public?

Copy link
Member Author

Choose a reason for hiding this comment

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

possibly not, all of the other data fields are public though.

@srl295 srl295 merged commit e41d18e into unicode-org:main Dec 23, 2025
15 checks passed
@srl295 srl295 deleted the cldr-18927/nontc-votes-by-count branch December 23, 2025 19:32
@srl295
Copy link
Member Author

srl295 commented Dec 24, 2025

Some follow-up to fix the TODOs, comments and naming would be ideal. The Counter object seems to have been intended for more generic usage, while "participants" seems to belong in a more specific class.

#5250

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.

2 participants