From 6b0935930c429eeef0c9657cc7fb702de80cf052 Mon Sep 17 00:00:00 2001 From: RBRi Date: Mon, 4 Mar 2024 08:03:48 +0100 Subject: [PATCH] add @Override and some try-with-resources (#1449) * add @Override and some try-with-resource s * add another try-with-resource to fix missing close introduced in last commit * more try-with-resources --- .../benchmarks/BuiltinBenchmark.java | 3 ++ examples/DynamicScopes.java | 1 + src/org/mozilla/javascript/Hashtable.java | 1 + .../mozilla/javascript/NativeJavaList.java | 1 + .../tests/scriptengine/BuiltinsTest.java | 34 ++++++++++--------- .../javascript/tools/ToolErrorReporter.java | 3 ++ .../javascript/tools/debugger/Dim.java | 10 ++++++ .../javascript/tools/debugger/Main.java | 2 ++ .../treetable/AbstractCellEditor.java | 7 ++++ .../tools/debugger/treetable/JTreeTable.java | 3 ++ .../treetable/TreeTableModelAdapter.java | 10 ++++++ .../mozilla/javascript/tools/jsc/Main.java | 5 +-- .../tools/shell/ConsoleTextArea.java | 7 ++++ .../javascript/tools/shell/Global.java | 33 +++++++++--------- .../javascript/tools/shell/JSConsole.java | 1 + .../tools/shell/JavaPolicySecurity.java | 7 ++++ .../mozilla/javascript/xmlimpl/XMLList.java | 2 ++ .../mozilla/javascript/xmlimpl/XmlNode.java | 1 + .../javascript/xmlimpl/XmlProcessor.java | 3 ++ 19 files changed, 98 insertions(+), 36 deletions(-) diff --git a/benchmarks/org/mozilla/javascript/benchmarks/BuiltinBenchmark.java b/benchmarks/org/mozilla/javascript/benchmarks/BuiltinBenchmark.java index f1e81d25e..cd866dc2a 100644 --- a/benchmarks/org/mozilla/javascript/benchmarks/BuiltinBenchmark.java +++ b/benchmarks/org/mozilla/javascript/benchmarks/BuiltinBenchmark.java @@ -59,6 +59,7 @@ public class BuiltinBenchmark { @State(Scope.Thread) public static class AnnotatedClassState extends AbstractClassState { + @Override @Setup(Level.Trial) public void init() throws IllegalAccessException, InvocationTargetException, InstantiationException { @@ -122,6 +123,7 @@ public class BuiltinBenchmark { @State(Scope.Thread) public static class IdClassState extends AbstractClassState { + @Override @Setup(Level.Trial) public void init() throws IllegalAccessException, InvocationTargetException, InstantiationException { @@ -314,6 +316,7 @@ public class BuiltinBenchmark { @State(Scope.Thread) public static class DumbLambdaState extends AbstractClassState { + @Override @Setup(Level.Trial) public void init() throws IllegalAccessException, InvocationTargetException, InstantiationException { diff --git a/examples/DynamicScopes.java b/examples/DynamicScopes.java index ac80a74a7..0ba24ac88 100644 --- a/examples/DynamicScopes.java +++ b/examples/DynamicScopes.java @@ -139,6 +139,7 @@ public class DynamicScopes { this.x = x; } + @Override public void run() { // We need a new Context for this thread. Context cx = Context.enter(); diff --git a/src/org/mozilla/javascript/Hashtable.java b/src/org/mozilla/javascript/Hashtable.java index 25cffc83b..53052d6c9 100644 --- a/src/org/mozilla/javascript/Hashtable.java +++ b/src/org/mozilla/javascript/Hashtable.java @@ -273,6 +273,7 @@ public class Hashtable implements Serializable, Iterable { map.clear(); } + @Override public Iterator iterator() { return new Iter(first); } diff --git a/src/org/mozilla/javascript/NativeJavaList.java b/src/org/mozilla/javascript/NativeJavaList.java index 0fb3b6996..f292a6f8d 100644 --- a/src/org/mozilla/javascript/NativeJavaList.java +++ b/src/org/mozilla/javascript/NativeJavaList.java @@ -77,6 +77,7 @@ public class NativeJavaList extends NativeJavaObject { return super.has(index, start); } + @Override public void delete(int index) { if (isWithValidIndex(index)) { list.set(index, null); diff --git a/testsrc/org/mozilla/javascript/tests/scriptengine/BuiltinsTest.java b/testsrc/org/mozilla/javascript/tests/scriptengine/BuiltinsTest.java index a2bc1a070..8fa671fff 100644 --- a/testsrc/org/mozilla/javascript/tests/scriptengine/BuiltinsTest.java +++ b/testsrc/org/mozilla/javascript/tests/scriptengine/BuiltinsTest.java @@ -37,22 +37,24 @@ public class BuiltinsTest { @Test public void printStdoutAndCheckItPrints() throws Exception { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream original = System.out; - PrintStream modified = new PrintStream(bos, false); - System.setOut(modified); - // Now Get A SimpleContext - ScriptContext sc = new SimpleScriptContext(); - try { - // this was a broken test - engine.eval("print('Hello, World!');", sc); - // this has been hard work https://github.com/mozilla/rhino/issues/1356 - Assert.assertEquals("Hello, World!\n", bos.toString()); - } finally { - // revert the sys out - System.setOut(original); - modified.close(); - bos.close(); + try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { + PrintStream original = System.out; + try (PrintStream modified = new PrintStream(bos, false)) { + System.setOut(modified); + try { + // Now Get A SimpleContext + ScriptContext sc = new SimpleScriptContext(); + + // this was a broken test + engine.eval("print('Hello, World!');", sc); + + // this has been hard work https://github.com/mozilla/rhino/issues/1356 + Assert.assertEquals("Hello, World!\n", bos.toString()); + } finally { + // revert the sys out + System.setOut(original); + } + } } } diff --git a/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java b/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java index 7cdd10880..2c9fa7554 100644 --- a/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java +++ b/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java @@ -92,18 +92,21 @@ public class ToolErrorReporter implements ErrorReporter { return msg; } + @Override public void warning( String message, String sourceName, int line, String lineSource, int lineOffset) { if (!reportWarnings) return; reportErrorMessage(message, sourceName, line, lineSource, lineOffset, true); } + @Override public void error( String message, String sourceName, int line, String lineSource, int lineOffset) { hasReportedErrorFlag = true; reportErrorMessage(message, sourceName, line, lineSource, lineOffset, false); } + @Override public EvaluatorException runtimeError( String message, String sourceName, int line, String lineSource, int lineOffset) { return new EvaluatorException(message, sourceName, line, lineSource, lineOffset); diff --git a/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java b/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java index 433797ac5..c4385c77f 100644 --- a/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java +++ b/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java @@ -805,6 +805,7 @@ public class Dim { // ContextAction /** Performs the action given by {@link #type}. */ + @Override public Object run(Context cx) { switch (type) { case IPROXY_COMPILE_SCRIPT: @@ -863,6 +864,7 @@ public class Dim { // ContextFactory.Listener /** Called when a Context is created. */ + @Override public void contextCreated(Context cx) { if (type != IPROXY_LISTEN) Kit.codeBug(); ContextData contextData = new ContextData(); @@ -873,6 +875,7 @@ public class Dim { } /** Called when a Context is destroyed. */ + @Override public void contextReleased(Context cx) { if (type != IPROXY_LISTEN) Kit.codeBug(); } @@ -880,6 +883,7 @@ public class Dim { // Debugger /** Returns a StackFrame for the given function or script. */ + @Override public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript) { if (type != IPROXY_DEBUG) Kit.codeBug(); @@ -892,6 +896,7 @@ public class Dim { } /** Called when compilation is finished. */ + @Override public void handleCompilationDone(Context cx, DebuggableScript fnOrScript, String source) { if (type != IPROXY_DEBUG) Kit.codeBug(); @@ -984,6 +989,7 @@ public class Dim { } /** Called when the stack frame is entered. */ + @Override public void onEnter(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { contextData.pushFrame(this); this.scope = scope; @@ -994,6 +1000,7 @@ public class Dim { } /** Called when the current position has changed. */ + @Override public void onLineChange(Context cx, int lineno) { this.lineNumber = lineno; @@ -1013,11 +1020,13 @@ public class Dim { } /** Called when an exception has been thrown. */ + @Override public void onExceptionThrown(Context cx, Throwable exception) { dim.handleExceptionThrown(cx, exception, this); } /** Called when the stack frame has been left. */ + @Override public void onExit(Context cx, boolean byThrow, Object resultOrException) { if (dim.breakOnReturn && !byThrow) { dim.handleBreakpointHit(this, cx); @@ -1026,6 +1035,7 @@ public class Dim { } /** Called when a 'debugger' statement is executed. */ + @Override public void onDebuggerStatement(Context cx) { dim.handleBreakpointHit(this, cx); } diff --git a/toolsrc/org/mozilla/javascript/tools/debugger/Main.java b/toolsrc/org/mozilla/javascript/tools/debugger/Main.java index 85f3315e1..3b57add10 100644 --- a/toolsrc/org/mozilla/javascript/tools/debugger/Main.java +++ b/toolsrc/org/mozilla/javascript/tools/debugger/Main.java @@ -307,6 +307,7 @@ public class Main { // ContextAction /** Exit action. */ + @Override public void run() { if (type != EXIT_ACTION) Kit.codeBug(); System.exit(0); @@ -315,6 +316,7 @@ public class Main { // ScopeProvider /** Returns the scope for script evaluations. */ + @Override public Scriptable getScope() { if (type != SCOPE_PROVIDER) Kit.codeBug(); if (scope == null) Kit.codeBug(); diff --git a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java index 161220842..7db9e8cae 100644 --- a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java +++ b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java @@ -41,28 +41,35 @@ public class AbstractCellEditor implements CellEditor { protected EventListenerList listenerList = new EventListenerList(); + @Override public Object getCellEditorValue() { return null; } + @Override public boolean isCellEditable(EventObject e) { return true; } + @Override public boolean shouldSelectCell(EventObject anEvent) { return false; } + @Override public boolean stopCellEditing() { return true; } + @Override public void cancelCellEditing() {} + @Override public void addCellEditorListener(CellEditorListener l) { listenerList.add(CellEditorListener.class, l); } + @Override public void removeCellEditorListener(CellEditorListener l) { listenerList.remove(CellEditorListener.class, l); } diff --git a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/JTreeTable.java b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/JTreeTable.java index 52a735fce..4a285d926 100644 --- a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/JTreeTable.java +++ b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/JTreeTable.java @@ -201,6 +201,7 @@ public class JTreeTable extends JTable { } /** TreeCellRenderer method. Overridden to update the visible row. */ + @Override public Component getTableCellRendererComponent( JTable table, Object value, @@ -218,6 +219,7 @@ public class JTreeTable extends JTable { /** TreeTableCellEditor implementation. Component returned is the JTree. */ public class TreeTableCellEditor extends AbstractCellEditor implements TableCellEditor { + @Override public Component getTableCellEditorComponent( JTable table, Object value, boolean isSelected, int r, int c) { return tree; @@ -351,6 +353,7 @@ public class JTreeTable extends JTable { * the list changse. */ class ListSelectionHandler implements ListSelectionListener { + @Override public void valueChanged(ListSelectionEvent e) { updateSelectedPathsFromSelectedRows(); } diff --git a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/TreeTableModelAdapter.java b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/TreeTableModelAdapter.java index ba38b6819..422be21fb 100644 --- a/toolsrc/org/mozilla/javascript/tools/debugger/treetable/TreeTableModelAdapter.java +++ b/toolsrc/org/mozilla/javascript/tools/debugger/treetable/TreeTableModelAdapter.java @@ -64,10 +64,12 @@ public class TreeTableModelAdapter extends AbstractTableModel { new TreeExpansionListener() { // Don't use fireTableRowsInserted() here; the selection model // would get updated twice. + @Override public void treeExpanded(TreeExpansionEvent event) { fireTableDataChanged(); } + @Override public void treeCollapsed(TreeExpansionEvent event) { fireTableDataChanged(); } @@ -79,18 +81,22 @@ public class TreeTableModelAdapter extends AbstractTableModel { // the event before us. treeTableModel.addTreeModelListener( new TreeModelListener() { + @Override public void treeNodesChanged(TreeModelEvent e) { delayedFireTableDataChanged(); } + @Override public void treeNodesInserted(TreeModelEvent e) { delayedFireTableDataChanged(); } + @Override public void treeNodesRemoved(TreeModelEvent e) { delayedFireTableDataChanged(); } + @Override public void treeStructureChanged(TreeModelEvent e) { delayedFireTableDataChanged(); } @@ -99,6 +105,7 @@ public class TreeTableModelAdapter extends AbstractTableModel { // Wrappers, implementing TableModel interface. + @Override public int getColumnCount() { return treeTableModel.getColumnCount(); } @@ -113,6 +120,7 @@ public class TreeTableModelAdapter extends AbstractTableModel { return treeTableModel.getColumnClass(column); } + @Override public int getRowCount() { return tree.getRowCount(); } @@ -122,6 +130,7 @@ public class TreeTableModelAdapter extends AbstractTableModel { return treePath.getLastPathComponent(); } + @Override public Object getValueAt(int row, int column) { return treeTableModel.getValueAt(nodeForRow(row), column); } @@ -143,6 +152,7 @@ public class TreeTableModelAdapter extends AbstractTableModel { protected void delayedFireTableDataChanged() { SwingUtilities.invokeLater( new Runnable() { + @Override public void run() { fireTableDataChanged(); } diff --git a/toolsrc/org/mozilla/javascript/tools/jsc/Main.java b/toolsrc/org/mozilla/javascript/tools/jsc/Main.java index 9a11a63f6..eccd7a0c4 100644 --- a/toolsrc/org/mozilla/javascript/tools/jsc/Main.java +++ b/toolsrc/org/mozilla/javascript/tools/jsc/Main.java @@ -240,11 +240,8 @@ public class Main { byte[] bytes = (byte[]) compiled[j + 1]; try { File outfile = getOutputFile(targetTopDir, className); - FileOutputStream os = new FileOutputStream(outfile); - try { + try (FileOutputStream os = new FileOutputStream(outfile)) { os.write(bytes); - } finally { - os.close(); } } catch (IOException ioe) { addFormatedError(ioe.toString()); diff --git a/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java b/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java index 6f726bcf6..0ef70bdf7 100644 --- a/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java +++ b/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java @@ -30,6 +30,7 @@ class ConsoleWrite implements Runnable { this.str = str; } + @Override public void run() { textArea.write(str); } @@ -149,6 +150,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL console1.flush(); } + @Override public void keyPressed(KeyEvent e) { int code = e.getKeyCode(); if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) { @@ -213,6 +215,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL } } + @Override public void keyTyped(KeyEvent e) { int keyChar = e.getKeyChar(); if (keyChar == 0x8 /* KeyEvent.VK_BACK_SPACE */) { @@ -224,6 +227,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL } } + @Override public synchronized void keyReleased(KeyEvent e) {} public synchronized void write(String str) { @@ -233,6 +237,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL select(outputMark, outputMark); } + @Override public synchronized void insertUpdate(DocumentEvent e) { int len = e.getLength(); int off = e.getOffset(); @@ -241,6 +246,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL } } + @Override public synchronized void removeUpdate(DocumentEvent e) { int len = e.getLength(); int off = e.getOffset(); @@ -260,6 +266,7 @@ public class ConsoleTextArea extends JTextArea implements KeyListener, DocumentL select(outputMark, outputMark); } + @Override public synchronized void changedUpdate(DocumentEvent e) {} public InputStream getIn() { diff --git a/toolsrc/org/mozilla/javascript/tools/shell/Global.java b/toolsrc/org/mozilla/javascript/tools/shell/Global.java index d61b79185..a5031376a 100644 --- a/toolsrc/org/mozilla/javascript/tools/shell/Global.java +++ b/toolsrc/org/mozilla/javascript/tools/shell/Global.java @@ -340,9 +340,9 @@ public class Global extends ImporterTopLevel { String filename = Context.toString(args[1]); FileOutputStream fos = new FileOutputStream(filename); Scriptable scope = ScriptableObject.getTopLevelScope(thisObj); - ScriptableOutputStream out = new ScriptableOutputStream(fos, scope); - out.writeObject(obj); - out.close(); + try (ScriptableOutputStream out = new ScriptableOutputStream(fos, scope)) { + out.writeObject(obj); + } } public static Object deserialize(Context cx, Scriptable thisObj, Object[] args, Function funObj) @@ -351,12 +351,13 @@ public class Global extends ImporterTopLevel { throw Context.reportRuntimeError("Expected a filename to read the serialization from"); } String filename = Context.toString(args[0]); - FileInputStream fis = new FileInputStream(filename); - Scriptable scope = ScriptableObject.getTopLevelScope(thisObj); - ObjectInputStream in = new ScriptableInputStream(fis, scope); - Object deserialized = in.readObject(); - in.close(); - return Context.toObject(deserialized, scope); + try (FileInputStream fis = new FileInputStream(filename)) { + Scriptable scope = ScriptableObject.getTopLevelScope(thisObj); + try (ObjectInputStream in = new ScriptableInputStream(fis, scope)) { + Object deserialized = in.readObject(); + return Context.toObject(deserialized, scope); + } + } } public String[] getPrompts(Context cx) { @@ -1033,14 +1034,12 @@ public class Global extends ImporterTopLevel { is = new FileInputStream(f); } - Reader r; - if (charCoding == null) { - r = new InputStreamReader(is); - } else { - r = new InputStreamReader(is, charCoding); + try (Reader r = + new InputStreamReader( + is, + charCoding == null ? Charset.defaultCharset().name() : charCoding)) { + return readReader(r, chunkLength); } - return readReader(r, chunkLength); - } finally { if (is != null) is.close(); } @@ -1144,10 +1143,12 @@ class Runner implements Runnable, ContextAction { s = script; } + @Override public void run() { factory.call(this); } + @Override public Object run(Context cx) { if (f != null) return f.call(cx, scope, scope, args); else return s.exec(cx, scope); diff --git a/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java b/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java index 7db655762..e4c4a9f98 100644 --- a/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java +++ b/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java @@ -144,6 +144,7 @@ public class JSConsole extends JFrame implements ActionListener { Main.main(args); } + @Override public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); String plaf_name = null; diff --git a/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java b/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java index 1e027d2cb..98bc6e452 100644 --- a/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java +++ b/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java @@ -39,10 +39,12 @@ public class JavaPolicySecurity extends SecurityProxy { this.domain = domain; } + @Override public Class defineClass(String name, byte[] data) { return super.defineClass(name, data, 0, data.length, domain); } + @Override public void linkClass(Class cl) { resolveClass(cl); } @@ -85,10 +87,12 @@ public class JavaPolicySecurity extends SecurityProxy { @Override public Enumeration elements() { return new Enumeration() { + @Override public boolean hasMoreElements() { return false; } + @Override public Permission nextElement() { return null; } @@ -123,6 +127,7 @@ public class JavaPolicySecurity extends SecurityProxy { final Context cx, final Scriptable scope, final String filename) { AccessController.doPrivileged( new PrivilegedAction() { + @Override public Object run() { URL url = getUrlObj(filename); ProtectionDomain staticDomain = getUrlDomain(url); @@ -172,6 +177,7 @@ public class JavaPolicySecurity extends SecurityProxy { final ProtectionDomain domain = (ProtectionDomain) securityDomain; return AccessController.doPrivileged( new PrivilegedAction() { + @Override public Loader run() { return new Loader(parentLoader, domain); } @@ -220,6 +226,7 @@ public class JavaPolicySecurity extends SecurityProxy { PrivilegedAction action = new PrivilegedAction() { + @Override public Object run() { return callable.call(cx, scope, thisObj, args); } diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java index 0a3220729..0470a0cd6 100644 --- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java +++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java @@ -744,6 +744,7 @@ class XMLList extends XMLObjectImpl implements Function { return null; } + @Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { // This XMLList is being called as a Function. // Let's find the real Function object. @@ -782,6 +783,7 @@ class XMLList extends XMLObjectImpl implements Function { return ((Callable) func).call(cx, scope, thisObj, args); } + @Override public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw ScriptRuntime.typeErrorById("msg.not.ctor", "XMLList"); } diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java index 551343491..fb2b24eaf 100644 --- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java +++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java @@ -312,6 +312,7 @@ class XmlNode implements Serializable { static class XmlNodeUserDataHandler implements UserDataHandler, Serializable { private static final long serialVersionUID = 4666895518900769588L; + @Override public void handle(short operation, String key, Object data, Node src, Node dest) {} } diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java index d899bceca..0d0bf2d66 100644 --- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java +++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java @@ -133,14 +133,17 @@ class XmlProcessor implements Serializable { throw ScriptRuntime.constructError("TypeError", e.getMessage(), e.getLineNumber() - 1); } + @Override public void error(SAXParseException e) { throwError(e); } + @Override public void fatalError(SAXParseException e) { throwError(e); } + @Override public void warning(SAXParseException e) { Context.reportWarning(e.getMessage()); }