int comparison = metricValue.compareTo(criteriaValue);
return !(// NOSONAR complexity of this boolean expression is under control
- (alert.isNotEqualsOperator() && comparison == 0) ||
- (alert.isGreaterOperator() && comparison != 1) ||
- (alert.isSmallerOperator() && comparison != -1) ||
- (alert.isEqualsOperator() && comparison != 0)
- );
+ (alert.isNotEqualsOperator() && comparison == 0)
+ || (alert.isGreaterOperator() && comparison != 1)
+ || (alert.isSmallerOperator() && comparison != -1)
+ || (alert.isEqualsOperator() && comparison != 0));
}
-
private static Comparable<?> getValueForComparison(Metric metric, String value) {
if (metric.getType() == Metric.ValueType.FLOAT ||
- metric.getType() == Metric.ValueType.PERCENT) {
+ metric.getType() == Metric.ValueType.PERCENT) {
return Double.parseDouble(value);
}
if (metric.getType() == Metric.ValueType.INT ||
- metric.getType() == Metric.ValueType.MILLISEC) {
+ metric.getType() == Metric.ValueType.MILLISEC) {
return value.contains(".") ? Integer.parseInt(value.substring(0, value.indexOf('.'))) : Integer.parseInt(value);
}
if (metric.getType() == Metric.ValueType.STRING ||
- metric.getType() == Metric.ValueType.LEVEL) {
+ metric.getType() == Metric.ValueType.LEVEL) {
return value;
}
if (metric.getType() == Metric.ValueType.BOOL) {
private static Comparable<?> getMeasureValue(Metric metric, Measure measure) {
if (metric.getType() == Metric.ValueType.FLOAT ||
- metric.getType() == Metric.ValueType.PERCENT) {
+ metric.getType() == Metric.ValueType.PERCENT) {
return measure.getValue();
}
if (metric.getType() == Metric.ValueType.INT ||
- metric.getType() == Metric.ValueType.MILLISEC) {
+ metric.getType() == Metric.ValueType.MILLISEC) {
return measure.getValue().intValue();
}
if (metric.getType() == Metric.ValueType.STRING ||
- metric.getType() == Metric.ValueType.LEVEL) {
+ metric.getType() == Metric.ValueType.LEVEL) {
return measure.getData();
}
if (metric.getType() == Metric.ValueType.BOOL) {
return text.toUpperCase();
}
-
/**
* @param keyword upper-case keyword
*/
return html;
}
-
public boolean filter(String keyword, boolean testFiltered) {
if (testFiltered && "test".equals(usage)) {
setVisible(false);
boolean hasVisibleChild = false;
for (int index = 0; index < getChildCount(); index++) {
- hasVisibleChild |= !((Library) getChild(index)).filter(keyword, testFiltered);
+ hasVisibleChild |= !((Library) getChild(index)).filter(keyword, testFiltered);
}
boolean visible = !filtered || hasVisibleChild;
private static final Set<String> KEYWORDS = new HashSet<String>();
- private static final String[] GROOVY_KEYWORDS = new String[]{"as", "assert", "break", "case", "catch", "class", "continue", "def",
- "default", "do", "else", "extends", "finally", "for", "if", "in", "implements", "import", "instanceof", "interface", "new", "package",
- "property", "return", "switch", "throw", "throws", "try", "while"};
+ private static final String[] GROOVY_KEYWORDS = {
+ "as", "assert", "break", "case", "catch", "class", "continue", "def",
+ "default", "do", "else", "extends", "finally", "for", "if", "in", "implements", "import", "instanceof", "interface", "new", "package",
+ "property", "return", "switch", "throw", "throws", "try", "while"};
static {
Collections.addAll(KEYWORDS, GROOVY_KEYWORDS);
private static final Set<String> KEYWORDS = new HashSet<String>();
- private static final String[] JAVA_KEYWORDS = new String[]{"abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
- "class", "const", "continue", "default",
- "do", "double", "else", "enum", "extends", "false", "final", "finally", "float", "for",
- "goto", "if", "implements", "import", "instanceof",
- "int", "interface", "long", "native", "new", "null", "package", "private",
- "protected", "public", "return", "short", "static", "strictfp",
- "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while"};
+ private static final String[] JAVA_KEYWORDS = {
+ "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
+ "class", "const", "continue", "default",
+ "do", "double", "else", "enum", "extends", "false", "final", "finally", "float", "for",
+ "goto", "if", "implements", "import", "instanceof",
+ "int", "interface", "long", "native", "new", "null", "package", "private",
+ "protected", "public", "return", "short", "static", "strictfp",
+ "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while"};
static {
Collections.addAll(KEYWORDS, JAVA_KEYWORDS);
public class CustomBarRenderer extends BarRenderer {
- public static final Paint[] COLORS = new Paint[]{Color.red, Color.blue, Color.green,
- Color.yellow, Color.orange, Color.cyan,
- Color.magenta, Color.blue};
+ public static final Paint[] COLORS = {
+ Color.red, Color.blue, Color.green,
+ Color.yellow, Color.orange, Color.cyan,
+ Color.magenta, Color.blue};
/**
* The colors.