From bbfa3ce0a9d08f5d507c25648835d80a19a27a22 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 6 Feb 2014 12:55:17 +0100 Subject: [PATCH] don't highlight the entire expression --- .../src/com/siyeh/InspectionGadgetsBundle.properties | 2 +- .../siyeh/ig/performance/BooleanConstructorInspection.java | 4 ++-- .../siyeh/igtest/performance/boolean_constructor/expected.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties index 159cf16beb4f..98a4c8270127 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties @@ -1053,7 +1053,7 @@ string.replaceable.by.string.buffer.problem.descriptor=Non-constant String collections.must.have.initial.capacity.problem.descriptor=#ref without initial capacity #loc string.concatenation.in.loops.problem.descriptor=String concatenation #ref in loop #loc string.concatenation.inside.string.buffer.append.problem.descriptor=String concatenation as argument to {0}.#ref() call #loc -boolean.constructor.problem.descriptor=Boolean constructor call #ref #loc +boolean.constructor.problem.descriptor=Boolean constructor call #loc string.to.string.problem.descriptor=#ref is redundant #loc substring.zero.problem.descriptor=#ref is redundant #loc string.buffer.to.string.in.concatenation.problem.descriptor=Calls to StringBuffer.#ref() in concatenation #loc diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BooleanConstructorInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BooleanConstructorInspection.java index eeb5e4751f9b..1a560a01b1db 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BooleanConstructorInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BooleanConstructorInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -173,7 +173,7 @@ public class BooleanConstructorInspection extends BaseInspection { if (expressions.length != 1) { return; } - registerError(expression); + registerNewExpressionError(expression); } } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/performance/boolean_constructor/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/performance/boolean_constructor/expected.xml index d7cc45f68716..f7bc79d46bc1 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/performance/boolean_constructor/expected.xml +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/performance/boolean_constructor/expected.xml @@ -4,14 +4,14 @@ BooleanConstructor.java 7 Boolean constructor call - Boolean constructor call <code>new Boolean(b)</code> #loc + Boolean constructor call #loc BooleanConstructor.java 8 Boolean constructor call - Boolean constructor call <code>new Boolean(true)</code> #loc + Boolean constructor call #loc \ No newline at end of file