Skip to content

Commit 07716c6

Browse files
committed
Start using @VisibleFot testing and ImmutableMap.of
1 parent 08f1b96 commit 07716c6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/model/TmcProjectInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class TmcProjectInfo {
2222

2323
private Project project;
2424

25-
/*package*/ TmcProjectInfo(Project project) {
25+
@VisibleForTesting TmcProjectInfo(Project project) {
2626
this.project = project;
2727
}
2828

tmc-plugin/src/fi/helsinki/cs/tmc/utilities/Inflector.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package fi.helsinki.cs.tmc.utilities;
22

3-
import java.util.HashMap;
3+
import com.google.common.collect.ImmutableMap;
4+
import java.util.Map;
45

56
public class Inflector {
6-
private static final HashMap<String, String> specialPlurals;
7-
static {
8-
specialPlurals = new HashMap<String, String>();
9-
specialPlurals.put("is", "are");
10-
}
11-
7+
8+
private static final Map<String, String> specialPlurals = ImmutableMap.of("is", "are");
9+
1210
/**
1311
* pluralize(1, "foo") -> "foo"; pluralize(3, "foo") -> "foos" plus some special cases.
1412
*/

0 commit comments

Comments
 (0)