PreviousNextTracker indexSee it online !

(123/231) 3396545 - NumberFormatException on startup for recent.xml

I'm getting this error on startup:

11:16:12 AM [main] [error] main: Exception in thread "main"
11:16:12 AM [main] [error] main: java.lang.NumberFormatException: For input string: "
11:16:12 AM [main] [error] main: 212"
11:16:12 AM [main] [error] main: at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
11:16:12 AM [main] [error] main: at java.lang.Integer.parseInt(Integer.java:470)
11:16:12 AM [main] [error] main: at java.lang.Integer.parseInt(Integer.java:514)
11:16:12 AM [main] [error] main: at org.gjt.sp.jedit.BufferHistory$RecentHandler.endElement(BufferHistory.java:436)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:604)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator.endNamespaceScope(XMLNSDTDValidator.java:266)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2053)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:927)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1759)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2915)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:821)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:750)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
11:16:12 AM [main] [error] main: at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
11:16:12 AM [main] [error] main: at org.gjt.sp.util.XMLUtilities.parseXML(XMLUtilities.java:139)
11:16:12 AM [main] [error] main: at org.gjt.sp.jedit.SettingsXML.load(SettingsXML.java:155)
11:16:12 AM [main] [error] main: at org.gjt.sp.jedit.BufferHistory.load(BufferHistory.java:175)
11:16:12 AM [main] [error] main: at org.gjt.sp.jedit.jEdit.main(jEdit.java:461)
^C

jEdit version 4.3.2

Submitted spestov - 2011-08-22 - 18:21:06z Assigned nobody
Priority 5 Category editor core
Status Open Group None
Resolution None Visibility No

Comments

2011-08-25 - 11:54:55z
kpouer
Hi, do you still have the recent.xml file that created the bug ?
It is strange it seems that there was something like this
<CARET>
212</CARET>

I don't see a reason why there would be a \n here since the code to write this file is
out.write("<CARET>");
out.write(String.valueOf(entry.caret));
out.write("</CARET>");

Anyway I'll add a check here in case of corrupted file
2011-08-25 - 12:02:30z
kpouer
fixed in rev 19833
2011-08-29 - 21:39:34z
vampire0
This still happens with 4.4.1: https://sourceforge.net/tracker/?func=detail&aid=3400091&group_id=588&atid=100588

[11:45:47] <ensonic> Vampire0, it happens every time here
[11:55:04] <ensonic> Vampire0, -noplugin is not changing anything, -settings obviously helps for the first time (as then there is no recent.xml there), but fails the 2nd time the same way

Having a work-around is fine, but how can this happen with 4.4.1?
2011-12-07 - 21:48:05z
kpouer
unassigning myself
2011-12-07 - 21:59:10z
ezust
Please attach the offending recent.xml as an attachment. We need more information to reproduce.

Attachments