Skip to content

Commit e2e7df9

Browse files
committed
Fixed compatibility issues between bp and Java 8 API.
1 parent 7ffa99e commit e2e7df9

File tree

8 files changed

+38
-4
lines changed

8 files changed

+38
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public enum ExchangeRateType implements ExchangeRateProviderSupplier {
6969
"IDENT",
7070
"Exchange rate rate with factor one for identical base/term currencies");
7171

72+
private static final long serialVersionUID = 7769702054407198263L;
73+
7274
private final String type;
7375

7476
private final String description;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public String toString() {
560560
* @throws NullPointerException If the number is null
561561
* @throws java.lang.ArithmeticException If the number exceeds the capabilities of this class.
562562
*/
563-
private void checkNumber(Number number) {
563+
protected void checkNumber(Number number) {
564564
Objects.requireNonNull(number, "Number is required.");
565565
// numeric check for overflow...
566566
if (number.longValue() > MAX_BD.longValue()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public final class RoundedMoney implements MonetaryAmount, Comparable<MonetaryAm
4848
/**
4949
* serialVersionUID.
5050
*/
51-
private static final long serialVersionUID = 366517590511294389L;
51+
private static final long serialVersionUID = -6716367273185192901L;
5252
/**
5353
* The default {@link MonetaryContext} applied.
5454
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ MonetaryAmount to(ParserMonetaryAmount amount) {
139139
}
140140
};
141141

142+
private static final long serialVersionUID = 6606016328162974467L;
142143
abstract MonetaryAmount to(ParserMonetaryAmount amount);
143144
}
144145

src/main/java/org/javamoney/moneta/function/MonetaryRoundedFactoryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @see {@link MonetaryRoundedFactoryBuilder#withPrecision(int)}
2727
* @since 1.0.1
2828
*/
29-
final class MonetaryRoundedFactoryBuilder {
29+
public final class MonetaryRoundedFactoryBuilder {
3030

3131
private final RoundingMode roundingMode;
3232

src/main/java/org/javamoney/moneta/spi/AbstractAmountBuilder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,18 @@ public MonetaryAmountFactory<T> setAmount(MonetaryAmount smount) {
182182
return this;
183183
}
184184

185+
/**
186+
* Creates a {@link BigDecimal} from the given {@link Number} doing the valid conversion
187+
* depending the type given.
188+
*
189+
* @param num the number type
190+
* @return the corresponding {@link BigDecimal}
191+
* @Deprecated will be removed in next release
192+
*/
193+
@Deprecated
194+
protected static BigDecimal getBigDecimal(Number num) {
195+
return ConvertBigDecimal.of(num);
196+
}
197+
198+
185199
}

src/main/java/org/javamoney/moneta/spi/CompoundRateProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ public class CompoundRateProvider extends AbstractRateProvider {
4141
/**
4242
* Key used to store a list of child {@link javax.money.convert.ProviderContext} instances of the providers
4343
* contained within this instance.
44+
* @deprecated Will be private in next major release.
4445
*/
45-
private static final String CHILD_PROVIDER_CONTEXTS_KEY = "childProviderContexts";
46+
@Deprecated
47+
public static final String CHILD_PROVIDER_CONTEXTS_KEY = "childProviderContexts";
4648
/**
4749
* The {@link ExchangeRateProvider} instances.
4850
*/

src/main/java/org/javamoney/moneta/spi/DefaultNumberValue.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ public <T extends Number> T numberValueExact(Class<T> numberType) {
207207
return ConvertNumberValue.ofExact(numberType, number);
208208
}
209209

210+
/**
211+
* Creates a {@link BigDecimal} from the given {@link Number} doing the valid conversion
212+
* depending the type given.
213+
*
214+
* @param num
215+
* the number type
216+
* @return the corresponding {@link BigDecimal}
217+
* @deprecated will be removed.
218+
*/
219+
@Deprecated
220+
protected static BigDecimal getBigDecimal(Number num) {
221+
return ConvertBigDecimal.of(num);
222+
}
223+
224+
210225
/*
211226
* (non-Javadoc)
212227
* @see java.lang.Object#toString()

0 commit comments

Comments
 (0)