diff --git a/sonar-html-plugin/src/main/java/org/sonar/plugins/html/checks/coding/InternationalizationCheck.java b/sonar-html-plugin/src/main/java/org/sonar/plugins/html/checks/coding/InternationalizationCheck.java index 0f5511c41..02bea111a 100644 --- a/sonar-html-plugin/src/main/java/org/sonar/plugins/html/checks/coding/InternationalizationCheck.java +++ b/sonar-html-plugin/src/main/java/org/sonar/plugins/html/checks/coding/InternationalizationCheck.java @@ -57,7 +57,7 @@ public void startDocument(List nodes) { public void characters(TextNode textNode) { String textNodeCode = textNode.getCode(); if (isValidText(textNodeCode)) { - createViolation(textNode.getStartLinePosition(), "Define this label in the resource bundle."); + createViolation(textNode, "Define this label in the resource bundle."); } } @@ -76,7 +76,7 @@ private boolean notValid(TagNode element, QualifiedAttribute attribute) { if (value != null) { value = value.trim(); if (value.length() > 0 && isValidText(value)) { - createViolation(element.getStartLinePosition(), "Define this label in the resource bundle."); + createViolation(element, "Define this label in the resource bundle."); return true; } } diff --git a/sonar-html-plugin/src/test/java/org/sonar/plugins/html/checks/coding/InternationalizationCheckTest.java b/sonar-html-plugin/src/test/java/org/sonar/plugins/html/checks/coding/InternationalizationCheckTest.java index ed88b94be..3e56a2fdc 100644 --- a/sonar-html-plugin/src/test/java/org/sonar/plugins/html/checks/coding/InternationalizationCheckTest.java +++ b/sonar-html-plugin/src/test/java/org/sonar/plugins/html/checks/coding/InternationalizationCheckTest.java @@ -44,8 +44,8 @@ public void custom() { HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/InternationalizationCheck.html"), check); checkMessagesVerifier.verify(sourceCode.getIssues()) - .next().atLine(1).withMessage("Define this label in the resource bundle.") - .next().atLine(2).withMessage("Define this label in the resource bundle.") + .next().atLocation(1, 13, 1, 16).withMessage("Define this label in the resource bundle.") + .next().atLocation(2, 0, 2, 25).withMessage("Define this label in the resource bundle.") .next().atLine(9).withMessage("Define this label in the resource bundle.") .next().atLine(10).withMessage("Define this label in the resource bundle.") .next().atLine(11).withMessage("Define this label in the resource bundle.");