Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSnjezana Peco2016-04-12 16:07:08 +0000
committerVictor Rubezhny2016-04-13 22:53:18 +0000
commita476fdb50bc99fc0df2a5e4ef498489bc6fea9d4 (patch)
tree8e2d980c0dbaf93a71952bcdcf2d9d3b86bf4f12
parentad6201934e4cdc208477b0156ac2d20ae988ed1c (diff)
downloadwebtools.sourceediting-a476fdb50bc99fc0df2a5e4ef498489bc6fea9d4.tar.gz
webtools.sourceediting-a476fdb50bc99fc0df2a5e4ef498489bc6fea9d4.tar.xz
webtools.sourceediting-a476fdb50bc99fc0df2a5e4ef498489bc6fea9d4.zip
Bug 490325 - Errors detected are not shown in Problems view
Change-Id: I4e5c3fed24c846fda9e50f9a5f8a52d0017712cc Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com> Signed-off-by: Victor Rubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.json.core/src/org/eclipse/wst/json/core/internal/validation/core/AbstractNestedValidator.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.json.core/src/org/eclipse/wst/json/core/internal/validation/core/AbstractNestedValidator.java b/bundles/org.eclipse.wst.json.core/src/org/eclipse/wst/json/core/internal/validation/core/AbstractNestedValidator.java
index 1460846f08..843ba3b66b 100644
--- a/bundles/org.eclipse.wst.json.core/src/org/eclipse/wst/json/core/internal/validation/core/AbstractNestedValidator.java
+++ b/bundles/org.eclipse.wst.json.core/src/org/eclipse/wst/json/core/internal/validation/core/AbstractNestedValidator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.wst.json.core.internal.validation.core;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
@@ -25,6 +26,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.wst.json.core.internal.Logger;
import org.eclipse.wst.json.core.validation.AnnotationMsg;
import org.eclipse.wst.validation.AbstractValidator;
import org.eclipse.wst.validation.ValidationResult;
@@ -92,7 +94,27 @@ public abstract class AbstractNestedValidator extends AbstractValidator
} else {
nestedcontext.setProject(file.getProject());
}
- validate(file, null, result, reporter, nestedcontext);
+ InputStream inputStream = null;
+ try {
+ inputStream = file.getContents();
+ validate(file, inputStream, result, reporter, nestedcontext);
+ List messages = reporter.getMessages();
+ for (Object object : messages) {
+ if (object instanceof IMessage) {
+ IMessage message = (IMessage) object;
+ message.setLineNo(message.getLineNumber() + 1);
+ }
+ }
+ } catch (CoreException e) {
+ Logger.logException(e);
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ }
+ }
+ }
if (teardownRequired)
teardownValidation(nestedcontext);

Back to the top