JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
344 stars 101 forks source link

Introduce constants for context params #292

Open stokito opened 5 years ago

stokito commented 5 years ago

Across the all code it's a common practice to use Map-like contexts. Usually the contexts are used to store some param via .set(paramName, paramValue) method. For example:

  AmountFormatQueryBuilder.of(Locale.GERMANY)
    .set(AmountFormatParams.PATTERN, "####,####")
    .build()

Here we called .set(AmountFormatParams.PATTERN, "####,####") and the PATTERN constant is just a string "pattern". But sometimes instead of constant it's used a raw string i.e. .set("pattern", "####,####"). It will be little bit better to use constants: we can document them and easily find all usages and avoid typos. You try to search all callings of .set(" in code base and here is short list of my findings:

acelopezco commented 5 years ago

I suppose this should be moved to the issues page of jsr354-api project ?