@@ -37,7 +37,7 @@ public class RangeFactory
37
37
private static void initLegacyRangeFactoryMethods ()
38
38
{
39
39
try {
40
- Class rangesClass = Class .forName (LEGACY_RANGES_CLASS_NAME );
40
+ Class <?> rangesClass = Class .forName (LEGACY_RANGES_CLASS_NAME );
41
41
legacyRangeMethod = findMethod (rangesClass , LEGACY_RANGE_METHOD_NAME , Comparable .class , BoundType .class ,
42
42
Comparable .class , BoundType .class );
43
43
legacyDownToMethod = findMethod (rangesClass , LEGACY_DOWN_TO_METHOD_NAME , Comparable .class , BoundType .class );
@@ -49,7 +49,7 @@ private static void initLegacyRangeFactoryMethods()
49
49
}
50
50
51
51
// returns null if the method is not found
52
- private static Method findMethod (Class <?> clazz , String methodName , Class ... paramTypes )
52
+ private static Method findMethod (Class <?> clazz , String methodName , Class <?> ... paramTypes )
53
53
{
54
54
try {
55
55
return clazz .getMethod (methodName , paramTypes );
@@ -82,6 +82,7 @@ public static <C extends Comparable<?>> Range<C> range(final C lowerEndpoint, fi
82
82
final C upperEndpoint , final BoundType upperBoundType )
83
83
{
84
84
return createRange (new Callable <Range <C >>() {
85
+ @ Override
85
86
public Range <C > call () throws Exception {
86
87
return Range .range (lowerEndpoint , lowerBoundType , upperEndpoint , upperBoundType );
87
88
}
@@ -101,6 +102,7 @@ public static <C extends Comparable<?>> Range<C> atLeast(C lowerEndpoint)
101
102
public static <C extends Comparable <?>> Range <C > downTo (final C lowerEndpoint , final BoundType lowerBoundType )
102
103
{
103
104
return createRange (new Callable <Range <C >>() {
105
+ @ Override
104
106
public Range <C > call () throws Exception {
105
107
return Range .downTo (lowerEndpoint , lowerBoundType );
106
108
}
@@ -120,6 +122,7 @@ public static <C extends Comparable<?>> Range<C> atMost(C upperEndpoint)
120
122
public static <C extends Comparable <?>> Range <C > upTo (final C upperEndpoint , final BoundType upperBoundType )
121
123
{
122
124
return createRange (new Callable <Range <C >>() {
125
+ @ Override
123
126
public Range <C > call () throws Exception {
124
127
return Range .upTo (upperEndpoint , upperBoundType );
125
128
}
@@ -129,6 +132,7 @@ public Range<C> call() throws Exception {
129
132
public static <C extends Comparable <?>> Range <C > all ()
130
133
{
131
134
return createRange (new Callable <Range <C >>() {
135
+ @ Override
132
136
public Range <C > call () throws Exception {
133
137
return Range .all ();
134
138
}
@@ -138,6 +142,7 @@ public Range<C> call() throws Exception {
138
142
public static <C extends Comparable <?>> Range <C > singleton (final C value )
139
143
{
140
144
return createRange (new Callable <Range <C >>() {
145
+ @ Override
141
146
public Range <C > call () throws Exception {
142
147
return Range .singleton (value );
143
148
}
@@ -159,6 +164,7 @@ private static <C extends Comparable<?>> Range<C> createRange(Callable<Range<C>>
159
164
}
160
165
}
161
166
167
+ @ SuppressWarnings ("unchecked" )
162
168
private static <C extends Comparable <?>> Range <C > invokeLegacyRangeFactoryMethod (Method method , Object ... params )
163
169
{
164
170
try {
@@ -171,7 +177,5 @@ private static <C extends Comparable<?>> Range<C> invokeLegacyRangeFactoryMethod
171
177
}
172
178
173
179
// prevent instantiation
174
- private RangeFactory ()
175
- {
176
- }
180
+ private RangeFactory () { }
177
181
}
0 commit comments