[424131] JSDT Parser doesn't respect "Enable Semantic Validation" preference value

Problem reported is made to respect Enable Semantic Validation preference value for the preferences, so the problems market as
ProblemSeverities.Optional (configurable problems) aren't reported in case of Semantic Validation is disabled.
With this fix the build validation and as-you-type validation (errpr/warning annotations) are showing the same results,
not configurable error/warning messages do not depend on the value of "Enable JavaScript semantic validation" preference value.
All the JUnit Test cases of DualParseSyntaxErrorTest and SyntaxErrorTest passed successfully.

Signed-off-by: vrubezhny <vrubezhny@exadel.com>
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
index c780b34..baaf07f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
@@ -616,7 +616,10 @@
 	if (irritant != 0) {
 		if ((problemID & IProblem.Javadoc) != 0 && !this.options.docCommentSupport)
 			return ProblemSeverities.Ignore;
-		return this.options.getSeverity(irritant);
+		int severity = this.options.getSeverity(irritant);
+		return (!options.enableSemanticValidation && ((severity & ProblemSeverities.Optional) != 0) ?
+					ProblemSeverities.Ignore : 
+						severity);
 	}
 	return ProblemSeverities.Error | ProblemSeverities.Fatal;
 }