-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Storing selected preview throws java.lang.IllegalArgumentException: Value too long: #6198
Comments
Hi, we want to work on this bug, but it seems difficult to fix it. Firstly, we have reproduced the bug successfully. Secondly, we tried to solve it by only store the name instead of style in method JabRefPreferences.storePreviewPreferences(PreviewPreferences previewPreferences)
As a result, we are stucking at this bug without a good solution. It is OK for late reply, we might working on other works recently, please forgive our late reply. |
Hi, Feel free to tackle another bug in the meantime. |
I fear the source of the bug is somewhat different... Can you please check if the problem persists if you follow these steps?
The name of the syle in the editor tab is now problaby IEEE (in default config). But it shouldn't be. If you click save, the bug appears. If you click on the refresh icon in the upper left of the editor ("Reset to default style") the editor contents should be completly different. Saving now should work. |
The text of preview layout always becomes the text of the last CitationStyleLayout in the list, if another style is pushed upwards in the list around the 2nd last one. Be careful. JabRefPreferences is some sort of logic-model mixture. It's not yet untangled. There should not be a Property in JabRefPreferences, as this class should only provide preferences objects (like PreviewPreferences) and store them. Also, if you save only the name of the style, you also have to provide some mechanism to store the TextBasedPreviewLayout (The "Preview" style) |
But on the other hand, it also happens if you drag-n-drop an item. So maybe it's somewhere in an implementation both methods Have fun bug-hunting! This is a tricky one to catch, but should be an easy one to fix. 😉 |
Wow, how deep insight you have provided. Many thanks for your instructions. I will try again as soon as possible. Yeah, I think the JabRef needs more comments on source code. I have taken a long time on understanding what is the function of some method and field, which also easily make more mistakes. Fortunately, the JabRef main contributors are so kind and active, who have the ability to provide the comments and deep insight for newcomers. Thank you very much. |
Hi, I have tried to fix the bug. Following is something I have found: I found the source of the bug is the chosenListProperty.remove() method. I cannot understand why, but it happens. jabref/src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java Lines 253 to 258 in bc57d22
modify line 256 & 278 to Collections.swap(chosenListProperty, newIndex, oldIndex); BUT I think there are three solutions:
When I test with this bug, some other bugs also happened. (Preview run away when I drag other chosen cells to avail) |
Hi @leitianjian , thanks for debugging this code. What different API did you think of? |
Yeah, The Collections.swap only can solve the button of up/down. Immutable TextBasedPreviewLayout I think can solve the issue. From my view, the remove()'s bug coming from unexpected modify. Every cell except Preview is the read-only. And Preview is the unexpected modified cell. I just list the solution that may work. From my view (I'm not very familiar with JFX) there are not other APIs that can solve this bug. |
Ok, go ahead, give it a shot and maybe push your branch as a draft PR, so we can take a look at it together. 👍 |
Thanks, I will try it. It's my pleasure to hear your advice. If you have any idea about this bug, please tell it to me. :D |
Hi, I think I have fixed this issue successfully, waiting for your review :D |
201e022 Update trends-journals.csl (#6224) 46e6eed Update nottingham-trent-university-library-harvard.csl (#6220) 684bb48 Update politix.csl (#6199) c484b0b Update mcgill-fr.csl (#6198) cbcf2f2 Update mary-ann-liebert-vancouver.csl (#6218) 47174f0 Create journal-of-dairy-research.csl (#6195) fdd1eac Update harvard-anglia-ruskin-university.csl (#6196) 9e384d6 Create estonian-journal-of-earth-sciences.csl (#6194) afba9b7 Delete moore-theological-college.csl as per university (#6197) 644549f Create acta-medica-philippina.csl (#6192) 6566114 Update rassegna-degli-archivi-di-stato.csl (#6186) 3509a2f Update universidade-federal-de-sergipe-departamento-de-engenharia-de-… (#6187) de4845f Update mary-ann-liebert-vancouver.csl (#6213) 16828b6 Update ucl-university-college-apa.csl (#6172) c08613b Update ucl-university-college-harvard.csl (#6173) 028bad4 Create sociologia-ruralis.csl (#6170) 77d428c Update journal-of-plankton-research.csl (#6169) 92e1022 Update and rename dependent/journal-of-the-national-cancer-institute.… (#6168) 120efb1 Update journal of hearing science e503477 Create new-harts-rules-the-oxford-style-guide-author-date.csl (#6163) 49ab318 Create the-depositional-record.csl (#6159) f4f6920 Update and rename laser-and-photonics-reviews.csl to dependent/laser-… (#6165) d8ca4bc Update united-states-international-trade-commission.csl (#6162) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 201e022
Current dev version
The problem is that the maximum allowed value for the Preferences Value is:
8192 characters (MAX_VALUE_LENGTH)
Solution: I think the solution would be to store the name of the style
The text was updated successfully, but these errors were encountered: