688 |
|
*/ |
689 |
|
static Class<?> comparableClassFor(Object x) { |
690 |
|
if (x instanceof Comparable) { |
691 |
< |
Class<?> c; Type[] ts, as; Type t; ParameterizedType p; |
691 |
> |
Class<?> c; Type[] ts, as; ParameterizedType p; |
692 |
|
if ((c = x.getClass()) == String.class) // bypass checks |
693 |
|
return c; |
694 |
|
if ((ts = c.getGenericInterfaces()) != null) { |
695 |
< |
for (int i = 0; i < ts.length; ++i) { |
696 |
< |
if (((t = ts[i]) instanceof ParameterizedType) && |
695 |
> |
for (Type t : ts) { |
696 |
> |
if ((t instanceof ParameterizedType) && |
697 |
|
((p = (ParameterizedType)t).getRawType() == |
698 |
|
Comparable.class) && |
699 |
|
(as = p.getActualTypeArguments()) != null && |
2545 |
|
} |
2546 |
|
|
2547 |
|
final long sumCount() { |
2548 |
< |
CounterCell[] as = counterCells; CounterCell a; |
2548 |
> |
CounterCell[] as = counterCells; |
2549 |
|
long sum = baseCount; |
2550 |
|
if (as != null) { |
2551 |
< |
for (int i = 0; i < as.length; ++i) { |
2552 |
< |
if ((a = as[i]) != null) |
2551 |
> |
for (CounterCell a : as) |
2552 |
> |
if (a != null) |
2553 |
|
sum += a.value; |
2554 |
– |
} |
2554 |
|
} |
2555 |
|
return sum; |
2556 |
|
} |