#959 StringIndexOutOfBoundsException with invalid Preview text

next release
closed
nobody
Easy (17)
5
2014-07-16
2011-03-01
No

The following step will print a java.lang.StringIndexOutOfBoundsException to the terminal

1. Go to Preference window
2. Select Entry Preview
3. Enter ""!\"# to the preview text area
4. Click Test

Exception trace:
java.lang.StringIndexOutOfBoundsException: String index out of
range: 0
at java.lang.String.charAt(Unknown Source)
at net.sf.jabref.export.layout.LayoutHelper.parseField(
LayoutHelper.java:377)
at net.sf.jabref.export.layout.LayoutHelper.parse(Layou
tHelper.java:327)
at net.sf.jabref.export.layout.LayoutHelper.getLayoutFr
omText(LayoutHelper.java:77)
at net.sf.jabref.PreviewPanel.readLayout(PreviewPanel.j
ava:264)
at net.sf.jabref.PreviewPanel.setEntry(PreviewPanel.jav
a:280)
at net.sf.jabref.PreviewPanel.<init>(PreviewPanel.java:
75)
at net.sf.jabref.PreviewPrefsTab$3.actionPerformed(Prev
iewPrefsTab.java:142)
at javax.swing.AbstractButton.fireActionPerformed(Unkno
wn Source)
at javax.swing.AbstractButton$Handler.actionPerformed(U
nknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(U
nknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown So
urce)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.AbstractButton$AccessibleAbstractButton.
doAccessibleAction(Unknown Source)
at edu.umd.cs.guitar.event.JFCActionHandler$1.run(JFCAc
tionHandler.java:78)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Discussion

  • Igor

    Igor - 2014-07-01
    • labels: --> Easy
    • Group: --> next release
     
  • Igor

    Igor - 2014-07-01

    Properly catch and treat the exception without logging it in the console

     
  • Igor

    Igor - 2014-07-16
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks