Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Validates the file path of a TexGroup and fixes Texgroup's "Library has been modified by another program" #6586
Validates the file path of a TexGroup and fixes Texgroup's "Library has been modified by another program" #6586
Changes from 10 commits
23557f9
2eac649
01c36a3
44b8896
f36ece6
f554c95
53cd9ad
ad11243
d20388f
8b7063d
7b65150
5b7d80e
fe895cf
db60939
f593b13
586d55b
6a82156
f092108
74f05ea
ba367ad
c120c45
ec8933e
01cdb44
e7a3c3f
49c3a2b
26342ab
aac9ffc
f98466a
3f2f46f
5a3548a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefan-kolb Would review here: "Fail fast". Not endless nested if/else statements, but just exit early.
Therefore, I proposed:
Think, I will start another PR with this and the other code style thing and we can have the discussion there --> we need to get this fix in soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the
switch (entry.getKey)
somehow? Maybe nested in anelse
branch?You can use the new Java14 switch: https://openjdk.java.net/jeps/361
(File needs to be added to
jabref/config/checkstyle/checkstyle.xml
Line 15 in ca06b71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still a huge p.i.t.a.
Checkstyle really needs to keep up, people start getting tired of these workarounds.
Some background information, if you are interested: checkstyle/checkstyle#6615
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key problem is here that switch cases are not executed in order. That's the reason for the if else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the concrete case here, it is always checked for
entry.getKey()
. Please check the diff:The wrong order was at that diff - completely unrelated to my proposal!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the
switch
statement could be reintroduced (and simplified). Before this fix, the code was structured really confusing and looked error-prone. So I decided to create this consistent and simplified version, which I find quite acceptable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant only for the lower part; not with the xxxx continue statements. Just for the endless chain of
else if (entry.getKey().equeals(MetaData.X))
chains, where onlyX
is different from the checks.There is ALWAYS
entry.getKey()
compared from line 75 to line 92 (or did I see something wrong?).This is just a matter of taste. Maybe, I'll just do it and open another PR to have the discussions there. Should not be a show stopper for us now.