[jedit:bugs] #4117 jEdit 5.6 cannot handle Unicode characers in mode files

Florian Rabe via jEdit-devel <[email protected]>
Newsgroups gmane.editors.jedit.devel
Message-ID <[email protected]>


---

** [bugs:#4117] jEdit 5.6 cannot handle Unicode characers in mode files**

**Status:** open
**Group:** minor bug
**Created:** Wed Mar 30, 2022 12:45 PM UTC by Florian Rabe
**Last Updated:** Wed Mar 30, 2022 12:45 PM UTC
**Owner:** nobody


In 5.6 (worked fine in 5.5), I get an error when loading a mode that contains Unicode symbols, e.g., <SEQ  TYPE="OPERATOR">⊦</SEQ>. Pretty much any high Unicode character triggers the bug.

Inspecting the source code, I guess it should be Math.max instead of Math.min when increasing the size of the array.
(The array might get pretty big though.)
At the very least, parsing a single rule could fall back to ignoring the rule. Currently, loading the mode is aborted entirely, and no rules are loaded.

java.lang.ArrayIndexOutOfBoundsException: Index 8870 out of bounds for length 332
	at org.gjt.sp.jedit.syntax.ParserRuleSet.addRule(ParserRuleSet.java:168)
	at org.gjt.sp.jedit.syntax.ParserRuleSet.addRule(ParserRuleSet.java:144)
	at org.gjt.sp.jedit.syntax.XModeHandler.endElement(XModeHandler.java:180)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.gjt.sp.jedit.syntax.ModeProvider.loadMode(ModeProvider.java:399)
	at org.gjt.sp.jedit.jEdit.loadMode(jEdit.java:3143)



---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

-- 
-----------------------------------------------
jEdit Developers' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.