Skip to content

Commit a6bfb09

Browse files
committed
JAVAMONEY-83: Changed context key type from Object to String, removed methods containing defaults.
1 parent c1f8796 commit a6bfb09

27 files changed

+488
-473
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
<parent>
2020
<groupId>org.javamoney</groupId>
2121
<artifactId>javamoney-parent</artifactId>
22-
<version>0.5</version>
22+
<version>1.0-SNAPSHOT</version>
2323
</parent>
2424

2525
<artifactId>moneta</artifactId>
2626
<packaging>jar</packaging>
27+
<version>1.0-SNAPSHOT</version>
2728

2829
<name>Moneta (JSR 354 RI)</name>
2930
<url>http://javamoney.org</url>
@@ -629,5 +630,4 @@
629630
</plugins>
630631
</reporting>
631632

632-
<version>1.0-RC1</version>
633633
</project>

src/main/java/org/javamoney/moneta/CurrencyUnitBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private CurrencyUnitBuilder(String currencyCode, javax.money.CurrencyContext cur
8383
}
8484

8585
/**
86-
* Allows to setTyped the currency code, for creating multiple instances, using one Builder.
86+
* Allows to set the currency code, for creating multiple instances, using one Builder.
8787
*
8888
* @param currencyCode the (unique) and identifying currency code, not null.
8989
* @return the Builder, for chaining.

src/main/java/org/javamoney/moneta/DefaultExchangeRate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* This class models an exchange rate, which defines the factor the numeric value of a base amount in some currency
2525
* 'A' must be multiplied
26-
* to getTyped the corresponding amount in the terminating currency 'B'. Hereby
26+
* to get the corresponding amount in the terminating currency 'B'. Hereby
2727
* <ul>
2828
* <li>an exchange rate always models one rate from a base (source) to a term
2929
* (target) {@link javax.money.CurrencyUnit}.</li>
@@ -129,10 +129,10 @@ class DefaultExchangeRate implements ExchangeRate, Serializable, Comparable<Exch
129129
}
130130

131131
/**
132-
* Internal method to setTyped the rate chain, which also ensure that the chain
132+
* Internal method to set the rate chain, which also ensure that the chain
133133
* passed, when not null, contains valid elements.
134134
*
135-
* @param chain the chain to setTyped.
135+
* @param chain the chain to set.
136136
*/
137137
private void setExchangeRateChain(List<ExchangeRate> chain) {
138138
this.chain.clear();

src/main/java/org/javamoney/moneta/DefaultMonetaryContextFactory.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public MonetaryContext getContext() {
4545
} catch (Exception e) {
4646
Logger.getLogger(DefaultMonetaryContextFactory.class.getName())
4747
.log(Level.SEVERE, "Error evaluating default NumericContext, using default (NumericContext.NUM64).", e);
48-
return MonetaryContextBuilder.of(Money.class).setTyped(MathContext.DECIMAL64).build();
48+
return MonetaryContextBuilder.of(Money.class).set(MathContext.DECIMAL64).build();
4949
}
5050
}
5151

@@ -57,32 +57,32 @@ private MonetaryContext createContextWithConfig(Map<String, String> config) {
5757
case "DECIMAL32":
5858
Logger.getLogger(Money.class.getName()).info(
5959
"Using MathContext.DECIMAL32");
60-
builder.setTyped(MathContext.DECIMAL32);
60+
builder.set(MathContext.DECIMAL32);
6161
break;
6262
case "DECIMAL64":
6363
Logger.getLogger(Money.class.getName()).info(
6464
"Using MathContext.DECIMAL64");
65-
builder.setTyped(MathContext.DECIMAL64);
65+
builder.set(MathContext.DECIMAL64);
6666
break;
6767
case "DECIMAL128":
6868
Logger.getLogger(Money.class.getName()).info(
6969
"Using MathContext.DECIMAL128");
70-
builder.setTyped(MathContext.DECIMAL128);
70+
builder.set(MathContext.DECIMAL128);
7171
break;
7272
case "UNLIMITED":
7373
Logger.getLogger(Money.class.getName()).info(
7474
"Using MathContext.UNLIMITED");
75-
builder.setTyped(MathContext.UNLIMITED);
75+
builder.set(MathContext.UNLIMITED);
7676
break;
7777
default:
7878
Logger.getLogger(Money.class.getName()).warning(
7979
"Found invalid MathContext: " + value + ", using default MathContext.DECIMAL64");
80-
builder.setTyped(MathContext.DECIMAL64);
80+
builder.set(MathContext.DECIMAL64);
8181
}
8282
} else {
8383
Logger.getLogger(Money.class.getName()).info(
8484
"Using default MathContext.DECIMAL64");
85-
builder.setTyped(MathContext.DECIMAL64);
85+
builder.set(MathContext.DECIMAL64);
8686
}
8787
return builder.build();
8888
}
@@ -91,7 +91,7 @@ private MonetaryContext createMonetaryContextNonNullConfig(Map<String, String> c
9191
String value = config.get("org.javamoney.moneta.Money.defaults.roundingMode");
9292
RoundingMode rm = Objects.nonNull(value) ? RoundingMode.valueOf(value
9393
.toUpperCase(Locale.ENGLISH)) : RoundingMode.HALF_UP;
94-
MonetaryContext mc = MonetaryContextBuilder.of(Money.class).setPrecision(prec).setTyped(rm).setTyped(Money.class).build();
94+
MonetaryContext mc = MonetaryContextBuilder.of(Money.class).setPrecision(prec).set(rm).set(Money.class).build();
9595
Logger.getLogger(DefaultMonetaryContextFactory.class.getName()).info("Using custom MathContext: precision=" + prec
9696
+ ", roundingMode=" + rm);
9797
return mc;

0 commit comments

Comments
 (0)