Skip to content

Bug with StreamWrappedIfToFilter #841

Open
@blacelle

Description

	private static Map<String, String> loadCountryToCcy() {
		Map<String, String> countryToCcy = new TreeMap<>();

        Stream.of(Locale.getISOCountries()).forEach(countryCode -> {
            // BEWARE we may prefer ISO3. Through, we're consistent here with LocaleHelpers
            if (!Strings.isNullOrEmpty(countryCode)) {
                Currency ccy = Currency.getInstance(Locale.of("fr", countryCode));

                if (ccy != null) {
                    String currencyCode = ccy.getCurrencyCode();
                    countryToCcy.put(countryCode, currencyCode);
                }
            }
        });

		return ImmutableMap.copyOf(countryToCcy);
	}

leads to improper code like .filter(countryCode -> !Strings.isNullOrEmpty(countryCode)).filter(countryCode -> !Strings.isNullOrEmpty(countryCode)).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions