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

Fix 2.6 NoSuchElementException in AA code. #11734

Merged
merged 1 commit into from
Jul 5, 2023

Commits on Jul 5, 2023

  1. Fix 2.6 NoSuchElementException in AA code.

    This would happen if a unit has special chars in its aaType, causing it to be evaluated as a regex instead of an exact match.
    This specifically broke the code pattern (e.g. in FiringGroupSplitterAa):
    
        final List<String> typeAas = UnitAttachment.getAllOfTypeAas(aaUnits);
        for (final String typeAa : typeAas) {
          final Collection<Unit> firingUnits =
              CollectionUtils.getMatches(aaUnits, Matches.unitIsAaOfTypeAa(typeAa));
    
    Causing an empty `firingUnits` due to typeAa being evaluated as a regex.
    I checked all the callsites and verified none of them actually require the regex behavior.
    
    Fixes: triplea-game#11458
    asvitkine committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    cd55bef View commit details
    Browse the repository at this point in the history