Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlights.ser can be empty after the plugin installation and trigger a fatal error #5

Open
nekto-kotik opened this issue Dec 30, 2022 · 1 comment
Assignees

Comments

@nekto-kotik
Copy link

Greetings,
Just wanted to let you know how I managed to solve a critical fatal error when trying to run Highlight on a fresh install.
(And I find your plugin absolutely essential to be productive, if I could only run 1 plugin in jEdit overall, that would be Highlight.)

I installed and ran jEdit 5.6, installed Highlight 2.5, and kept getting the following error on trying to start the plugin:

Cannot start: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
Try updating to a newer version of the plugin.

Reinstalling jEdit or the plugin didn't help.

After reading the detailed log (bless jEdit for the Activity Log), and reading the source code here on GitHub (bless you for keeping it open source), I discovered that the line String line = lines.get(0); was throwing this error, and empty highlights.ser was the culprit (the file was there, but it was 0 bytes).
I copied that file from my other machine, and the plugin runs like a charm now.

I highly suspect that even having one line like that in said file would be enough:

Highlight file v2

(To those who find this via web-search, the file to edit is /plugins/gatchan.highlight.HighlightPlugin/highlights.ser in your jEdit directory.)

A short trace is, in case you need it:

[error] PluginJAR:  at java.base/java.util.ArrayList.get(ArrayList.java:459)
[error] PluginJAR:  at gatchan.highlight.HighlightManagerTableModel.<init>(HighlightManagerTableModel.java:139)
[error] PluginJAR:  at gatchan.highlight.HighlightManagerTableModel.createInstance(HighlightManagerTableModel.java:101)
[error] PluginJAR:  at gatchan.highlight.HighlightPlugin.start(HighlightPlugin.java:77)
[error] PluginJAR:  at org.gjt.sp.jedit.PluginJAR.startPlugin(PluginJAR.java:1736)
[error] PluginJAR:  at org.gjt.sp.jedit.PluginJAR.activatePlugin(PluginJAR.java:956)
@kpouer kpouer self-assigned this Jan 1, 2023
@kpouer
Copy link
Owner

kpouer commented Jan 1, 2023

Hi,
I did several changes but not yet released, would you try that version http://jedit.kpouer.com/Highlight.jar ?
or if you prefer you can compile the master yourself then confirm me if the problem is solved ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants