DraqueT / PolyGlot

PolyGlot is a conlang construction toolkit.
MIT License
389 stars 44 forks source link

[BETA] Error: Lexicon: elelement must be follow by specific attribute specifications #1198

Closed TrapinchO closed 2 years ago

TrapinchO commented 2 years ago

Polyglot version: Windows BETA from 18th May 2022 (latest as of writing this)

After filling a word's definition with (HEADCANON) brain and heart of doguns and attempting to save it, the following two modal appeared. img3

Steps to reproduce: Unknown, possibly related to special characters (()) in the definition. however, after reopening the file and using the exact same text it saved correctly.

error log:

java.version : 17
java.vendor : Oracle Corporation
java.vendor.url : https://java.oracle.com/
java.vm.specification.version : 17
java.vm.specification.name : Java Virtual Machine Specification
java.vm.version : 17+35-2724
java.vm.vendor : Oracle Corporation
java.vm.name : OpenJDK 64-Bit Server VM
java.specification.version : 17
java.specification.vendor : Oracle Corporation
java.specification.name : Java Platform API Specification
java.class.version : 61.0
java.ext.dirs : null
os.name : Windows 10
os.arch : amd64
os.version : 10.0

-=-=-=-=-=-=-
2022/07/26 12:35:30-java.io.IOException: Element type "thesNameoNodeHeadtthesNameoNodeHeadttoGuadtPhoNam" must be followed by either attribute specifications, ">" or "/>".-java.io.IOException
org.xml.sax.SAXParseException; lineNumber: 169; columnNumber: 3967; Element type "thesNameoNodeHeadtthesNameoNodeHeadttoGuadtPhoNam" must be followed by either attribute specifications, ">" or "/>".
    at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:262)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:342)
    at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.CustHandlerFactory.getCustHandler(CustHandlerFactory.java:78)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.Desktop.DesktopIOHandler.getHandlerFromFile(DesktopIOHandler.java:242)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.DictCore.readFile(DictCore.java:355)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.DictCore.readFile(DictCore.java:310)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.Desktop.DesktopIOHandler.writeFile(DesktopIOHandler.java:445)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.DictCore.writeFile(DictCore.java:494)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.Screens.ScrMainMenu.doWrite(ScrMainMenu.java:549)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.Screens.ScrMainMenu.saveFile(ScrMainMenu.java:530)
    at org.darisadesigns.polyglotlina.polyglot@3.6/org.darisadesigns.polyglotlina.Screens.ScrMainMenu.lambda$setupAccelerators$19(ScrMainMenu.java:1308)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
    at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:354)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(BasicMenuItemUI.java:983)
    at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
    at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2947)
    at java.desktop/javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:311)
    at java.desktop/javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:253)
    at java.desktop/javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:3040)
    at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:3032)
    at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2909)
    at java.desktop/java.awt.Component.processEvent(Component.java:6403)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
DraqueT commented 2 years ago

Wow, this is a WEIRD one. Something absolutely bonkers had to have happened there. "thesName" is the label given to thesaurus entries.... and that tool is super buried in PolyGlot as it is kind of trash. I only leave it in for the handful of users who still want it (but don't think it's valuable enough to really work on much).

I have tried a million things to make this error pop, but found nothing. I am going to tentatively close it as I feel like this is a bizarre one off (or a more fundamental bug that's being deceptive here).

I also recently implemented an XML recovery tool, which I do believe would be able to recover from this sort of thing.