From 6546881559e4bbcfe2b220199a9f3cd4196d1960 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 9 Jun 2015 23:58:41 +1000 Subject: A few changes, as suggested by static analysis --- src/main/java/au/id/zancanaro/javacheck/object/CharType.java | 2 +- .../java/au/id/zancanaro/javacheck/object/GeneratorProvider.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/object') 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) { -- cgit v1.2.3