Skip to content

Commit 165a6fa

Browse files
committed
7: Fix wrongly named getInstance()
Task-Url: http://github.com/JavaMoney/javamoney-lib/issues/issue/7
1 parent 6579446 commit 165a6fa

File tree

9 files changed

+52
-11
lines changed

9 files changed

+52
-11
lines changed

bundles/java-se-cdi/src/main/java/org/javamoney/cdi/impl/CDIAmountProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import javax.money.MonetaryAmount;
1010
import javax.money.MonetaryAmountFactory;
1111
import javax.money.MonetaryContext;
12-
import javax.money.spi.MonetaryAmountsSpi;
12+
import javax.money.spi.MonetaryAmountsSingletonSpi;
1313

1414
@Singleton
15-
public class CDIAmountProvider implements MonetaryAmountsSpi {
15+
public class CDIAmountProvider implements MonetaryAmountsSingletonSpi {
1616

1717
@Inject
1818
private Instance<MonetaryAmountFactory<?>> factories;
@@ -48,7 +48,6 @@ public Class<? extends MonetaryAmount> getDefaultAmountType() {
4848
return null;
4949
}
5050

51-
@Override
5251
public Class<? extends MonetaryAmount> queryAmountType(
5352
MonetaryContext requiredContext) {
5453
// TODO Auto-generated method stub

calc/src/main/java/org/javamoney/calc/common/CompoundInterest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class CompoundInterest extends AbstractPeriodicalFunction {
3535
private CompoundInterest() {
3636
}
3737

38-
public static final CompoundInterest of() {
38+
public static final CompoundInterest getInstance() {
3939
return INSTANCE;
4040
}
4141

calc/src/main/java/org/javamoney/calc/common/ContinuousCompoundInterest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public final class ContinuousCompoundInterest extends AbstractPeriodicalFunction
3636
private ContinuousCompoundInterest() {
3737
}
3838

39-
public static final ContinuousCompoundInterest of() {
39+
public static final ContinuousCompoundInterest getInstance() {
4040
return INSTANCE;
4141
}
4242

calc/src/main/java/org/javamoney/calc/common/DiscountFactor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/**
1515
*
1616
* @author Anatole
17+
* @author Werner
1718
*
1819
*/
1920
public final class DiscountFactor {
@@ -23,7 +24,7 @@ public final class DiscountFactor {
2324
private DiscountFactor() {
2425
}
2526

26-
public static final DiscountFactor of() {
27+
public static final DiscountFactor getInstance() {
2728
return INSTANCE;
2829
}
2930

calc/src/main/java/org/javamoney/calc/function/AverageWeighted.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class AverageWeighted implements
2626

2727
/**
2828
* Private constructor, there is only one instance of this class, accessible calling
29-
* {@link #of()}.
29+
* {@link #getInstance()}.
3030
*/
3131
AverageWeighted() {
3232
}

calc/src/main/java/org/javamoney/calc/function/Composition.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Credit Suisse (Anatole Tresch), Werner Keil.
2+
* Copyright (c) 2012, 2014, Credit Suisse (Anatole Tresch), Werner Keil.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,8 +26,11 @@
2626
* A composition is an operator that contains multiple other operators that are applied as
2727
* a chain of functions to a MonetaryAmount. This allows to easily encapsulate a chain of operations
2828
* to a higher valued operation programmatically.
29+
*
30+
* @author Anatole
31+
* @author Werner
2932
*/
30-
public class Composition implements MonetaryOperator {
33+
public class Composition implements MonetaryOperator, Nameable {
3134

3235
private List<MonetaryOperator> functions = new ArrayList<>();
3336

calc/src/main/java/org/javamoney/calc/function/CompoundType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
* objects or input parameters as they are common in financial applications.
3131
*
3232
* @author Anatole Tresch
33+
* @author Werner Keil
3334
*/
34-
public final class CompoundType implements Serializable {
35+
public final class CompoundType implements Serializable, Nameable {
3536
/**
3637
* serialVersionUID.
3738
*/
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2012, 2014, Credit Suisse (Anatole Tresch), Werner Keil.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.javamoney.calc.function;
17+
18+
/**
19+
* Provides String name to implementations
20+
* <p>
21+
* There is no requirement that a distinct result be returned each time the
22+
* supplier is invoked.
23+
*
24+
* <p>
25+
* This is a <b>functional interface</b> whose
26+
* functional method is {@link #getName()}.
27+
*
28+
* @author Werner Keil
29+
* @since 0.4
30+
*/
31+
public interface Nameable {
32+
33+
/**
34+
* @return a name
35+
*/
36+
public String getName();
37+
}

data/src/main/resources/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Bundle-DocURL: http://javamoney.org
77
Bundle-License: LICENSE.txt
88
Bundle-ManifestVersion: 2
99
Bundle-Name: Money and Currency - JavaMoney common parts
10-
Bundle-SymbolicName: org.javamoney.lib.javamoney-common
10+
Bundle-SymbolicName: org.javamoney.lib.javamoney-data
1111
Bundle-Vendor: JavaMoney
1212
Bundle-Version: 0.4.0.SNAPSHOT
1313
Created-By: Apache Maven Bundle Plugin

0 commit comments

Comments
 (0)