Bug 532551 - Unreferenced nature warning off by 1

Both matcher.end() and IMarker.CHAR_END are zero based and _exclusive_,
therefore we don't need to adjust the offset.

Change-Id: I0747dcce492f8a4a8f82522ee32c738d62fe6229
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Bug: 532551
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CheckMissingNaturesListener.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CheckMissingNaturesListener.java
index d507c02..ecb2ac6 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CheckMissingNaturesListener.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CheckMissingNaturesListener.java
@@ -211,7 +211,7 @@
 			Matcher matcher = pattern.matcher(content);
 			if (matcher.matches() && matcher.groupCount() > 0) {
 				marker.setAttribute(IMarker.CHAR_START, matcher.start(1));
-				marker.setAttribute(IMarker.CHAR_END, matcher.end(1) - 1);
+				marker.setAttribute(IMarker.CHAR_END, matcher.end(1));
 			}
 		} catch (IOException e) {
 			ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, e.getMessage(), e));
diff --git a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NatureTest.java b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NatureTest.java
index 6a8024d..d13423c 100644
--- a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NatureTest.java
+++ b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/NatureTest.java
@@ -437,7 +437,7 @@
 		Assert.assertNotEquals(-42, marker.getAttribute(IMarker.CHAR_END, -42));
 		try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); InputStream input = ((IFile) marker.getResource()).getContents()) {
 			FileUtil.transferStreams(input, bos, "whatever", getMonitor());
-			String marked = bos.toString().substring(marker.getAttribute(IMarker.CHAR_START, -42), marker.getAttribute(IMarker.CHAR_END, -42) + 1);
+			String marked = bos.toString().substring(marker.getAttribute(IMarker.CHAR_START, -42), marker.getAttribute(IMarker.CHAR_END, -42));
 			Assert.assertEquals(NATURE_MISSING, marked);
 		}
 	}
@@ -459,7 +459,8 @@
 		Assert.assertNotEquals(-42, marker.getAttribute(IMarker.CHAR_END, -42));
 		try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); InputStream input = ((IFile) marker.getResource()).getContents()) {
 			FileUtil.transferStreams(input, bos, "whatever", getMonitor());
-			String marked = bos.toString().substring(marker.getAttribute(IMarker.CHAR_START, -42), marker.getAttribute(IMarker.CHAR_END, -42) + 1);
+			String marked = bos.toString().substring(marker.getAttribute(IMarker.CHAR_START, -42),
+					marker.getAttribute(IMarker.CHAR_END, -42));
 			Assert.assertEquals(NATURE_MISSING, marked);
 		}
 	}