diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java')
-rw-r--r-- | plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java index bc4161c380c..2a24b8348b6 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java +++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/text/rules/HushHtmlScriptErrors.java @@ -25,47 +25,47 @@ import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet; */ public class HushHtmlScriptErrors extends Rule { - // This is the code that must be entered in to the HTML to hush script errors - private final static String HUSH = - "\nfunction handleError() {\n" + "return true;\n" + "}\n\n" + "window.onerror = handleError;\n"; + // This is the code that must be entered in to the HTML to hush script errors + private final static String HUSH = + "\nfunction handleError() {\n" + "return true;\n" + "}\n\n" + "window.onerror = handleError;\n"; - public HushHtmlScriptErrors() { - super(null); - setFileNamePattern(".*\\.html"); - } + public HushHtmlScriptErrors() { + super(null); + setFileNamePattern(".*\\.html"); + } - @Override - public ChangeSet computeChanges(CharSequence seq) { - Pattern detectHusherInPlace = Pattern.compile("function handleError"); - Pattern findJavaScriptArea = Pattern.compile("<SCRIPT type=\"text/javascript\">"); - ChangeSet changeSet = new ChangeSet(seq); + @Override + public ChangeSet computeChanges(CharSequence seq) { + Pattern detectHusherInPlace = Pattern.compile("function handleError"); + Pattern findJavaScriptArea = Pattern.compile("<SCRIPT type=\"text/javascript\">"); + ChangeSet changeSet = new ChangeSet(seq); - // Only add in hushing if it is not in place - Matcher matchHusher = detectHusherInPlace.matcher(seq); - if (!matchHusher.find()) { + // Only add in hushing if it is not in place + Matcher matchHusher = detectHusherInPlace.matcher(seq); + if (!matchHusher.find()) { - Matcher matcher = findJavaScriptArea.matcher(seq); - if (matcher.find()) { - ruleWasApplicable = true; + Matcher matcher = findJavaScriptArea.matcher(seq); + if (matcher.find()) { + ruleWasApplicable = true; - changeSet.insertBefore(matcher.end() + 1, HUSH); - } - } + changeSet.insertBefore(matcher.end() + 1, HUSH); + } + } - return changeSet; - } + return changeSet; + } - public static void main(String[] args) { - HushHtmlScriptErrors hushRule = new HushHtmlScriptErrors(); - for (int i = 0; i < args.length; i++) { - try { - System.out.print("File " + (i + 1) + "/" + (args.length) + ":"); - hushRule.process(new File(args[i])); - } catch (Exception ex) { - System.out.println("Exception in Rule!!! " + hushRule.getCurrentOutfileName() + ": " + ex.getMessage()); - ex.printStackTrace(); - } - } - System.out.println("Finished"); - } + public static void main(String[] args) { + HushHtmlScriptErrors hushRule = new HushHtmlScriptErrors(); + for (int i = 0; i < args.length; i++) { + try { + System.out.print("File " + (i + 1) + "/" + args.length + ":"); + hushRule.process(new File(args[i])); + } catch (Exception ex) { + System.out.println("Exception in Rule!!! " + hushRule.getCurrentOutfileName() + ": " + ex.getMessage()); + ex.printStackTrace(); + } + } + System.out.println("Finished"); + } }
\ No newline at end of file |