|
@@ -52,7 +52,7 @@ final class ParamFlowChecker { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Get parameter value. If value is null, then pass. |
|
|
// Get parameter value. If value is null, then pass. |
|
|
Object value = args[paramIdx]; |
|
|
|
|
|
|
|
|
Object value = valueAt(args, paramIdx); |
|
|
if (value == null) { |
|
|
if (value == null) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
@@ -64,6 +64,18 @@ final class ParamFlowChecker { |
|
|
return passLocalCheck(resourceWrapper, rule, count, value); |
|
|
return passLocalCheck(resourceWrapper, rule, count, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Object valueAt(Object[] args, int paramIdx) { |
|
|
|
|
|
Object value = null; |
|
|
|
|
|
if (paramIdx < 0) { |
|
|
|
|
|
if (-paramIdx <= args.length) { |
|
|
|
|
|
return args[args.length + paramIdx]; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
value = args[paramIdx]; |
|
|
|
|
|
} |
|
|
|
|
|
return value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private static boolean passLocalCheck(ResourceWrapper resourceWrapper, ParamFlowRule rule, int count, |
|
|
private static boolean passLocalCheck(ResourceWrapper resourceWrapper, ParamFlowRule rule, int count, |
|
|
Object value) { |
|
|
Object value) { |
|
|
try { |
|
|
try { |
|
@@ -112,7 +124,7 @@ final class ParamFlowChecker { |
|
|
int itemThreshold = rule.getParsedHotItems().get(value); |
|
|
int itemThreshold = rule.getParsedHotItems().get(value); |
|
|
return ++threadCount <= itemThreshold; |
|
|
return ++threadCount <= itemThreshold; |
|
|
} |
|
|
} |
|
|
long threshold = (long) rule.getCount(); |
|
|
|
|
|
|
|
|
long threshold = (long)rule.getCount(); |
|
|
return ++threadCount <= threshold; |
|
|
return ++threadCount <= threshold; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|