summaryrefslogtreecommitdiff
path: root/src/main/java/au/id/zancanaro/javacheck/object
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2015-06-09 23:58:41 +1000
committerCarlo Zancanaro <carlo@zancanaro.id.au>2015-06-09 23:58:41 +1000
commit6546881559e4bbcfe2b220199a9f3cd4196d1960 (patch)
tree16244beed46eff76b65d1e5304cae4591b7db7ee /src/main/java/au/id/zancanaro/javacheck/object
parent40961d4950c40643d5d71721a7e024e3951323ce (diff)
A few changes, as suggested by static analysis
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/object')
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/object/CharType.java2
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/object/GeneratorProvider.java5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/object/CharType.java b/src/main/java/au/id/zancanaro/javacheck/object/CharType.java
index aa3049e..b53d211 100644
--- a/src/main/java/au/id/zancanaro/javacheck/object/CharType.java
+++ b/src/main/java/au/id/zancanaro/javacheck/object/CharType.java
@@ -10,6 +10,6 @@ import java.lang.annotation.Target;
public @interface CharType {
public static enum TYPE {
ALL, ASCII, ALPHA, ALPHA_NUMERIC
- };
+ }
TYPE value();
}
diff --git a/src/main/java/au/id/zancanaro/javacheck/object/GeneratorProvider.java b/src/main/java/au/id/zancanaro/javacheck/object/GeneratorProvider.java
index 67769b6..24b73d5 100644
--- a/src/main/java/au/id/zancanaro/javacheck/object/GeneratorProvider.java
+++ b/src/main/java/au/id/zancanaro/javacheck/object/GeneratorProvider.java
@@ -83,9 +83,10 @@ public interface GeneratorProvider {
provider));
} else if (type == Map.class) {
TypeVariable<?>[] params = Map.class.getTypeParameters();
+ TypeVariable<?> keyType = params[0], valueType = params[1];
return mapOf(
- provider.getGenerator(params[0], new Annotation[0], provider),
- provider.getGenerator(params[1], new Annotation[0], provider));
+ provider.getGenerator(keyType, new Annotation[0], provider),
+ provider.getGenerator(valueType, new Annotation[0], provider));
} else if (type instanceof Class) {
return ofType((Class<?>) type, provider);
} else if (type instanceof ParameterizedType) {