-
-
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
Fix for Issue #4306 - Disable Rename when Filename is the same #4350
Conversation
Checking the current File Link VS the suggested File Link. Waiting on feedback from project leads before proceeding further.
Method - performNameConflictCheck() Checks whether the current filename is the same as the suggested one and disables the menu items according to the boolean result.
Name Check scenario added to LinkedFileViewModel Test Class.
Mokito Implementation
If you can't get the test working it is not a problem. In such cases it is sufficient if you have manually tested the things. e.g. without a file with two files etc. |
@Siedlerchr Awesome! I will amend my Pull Request with a new commit that will remove the test case code later tonight and also fix what was flagged by the Codacy PR Check! |
-Edited if statement flagged by Codacy -Removed Test Case in the LinkedFileViewModelTest class
-Removed unnecessary conditional statement -Removed unused import for LinkedFileHandler in LinkedFileViewModelTest class
@tobiasdiez @Siedlerchr Is there something I should do to pass the codecov/project check? I'm not sure I understand the whole overall project coverage concept. |
@Arbalest007 The codacy are usually helpful, it outlines some potential issues. However, it also produces false positives (e.g. unused methods for Most of the GUI code is manually tested and that is mostly sufficient. While the ViewModel functionality can be tested sometimes it often requires substantial amount of mocking around with objects which often adds a new level of complexity |
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.
Thanks for your PR! The check needs to be adapted for the "move files" option but apart from that the code looks good to me!
|
||
MenuItem moveFile = new MenuItem(Localization.lang("Move file to file directory")); | ||
moveFile.setOnAction(event -> linkedFile.moveToDefaultDirectory()); | ||
moveFile.setDisable(linkedFile.getFile().isOnlineLink()); | ||
moveFile.setDisable(linkedFile.performNameConflictCheck()); |
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.
For the rename file
functionality, the check is ok. However, for move file
and rename and move file
the check needs o be adapted: We only want to disable the "move file" option if the file is already in the right place (i.e. the moveToDefaultDirectory
method would do nothing). In other words, this check should not compare the file name but the directory with the suggested directory.
This was probably my fault for not being clear enough in the issue description.
@@ -255,14 +255,17 @@ private ContextMenu createContextMenuForFile(LinkedFileViewModel linkedFile) { | |||
MenuItem renameFile = new MenuItem(Localization.lang("Rename file")); | |||
renameFile.setOnAction(event -> linkedFile.rename()); | |||
renameFile.setDisable(linkedFile.getFile().isOnlineLink()); | |||
renameFile.setDisable(linkedFile.performNameConflictCheck()); |
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 overwrites the previous disable state coming from the line before. Suggestion:
renameFile.setDisable(linkedFile.getFile().isOnlineLink() || linkedFile.performNameConflictCheck());
@@ -23,8 +23,7 @@ | |||
|
|||
import static org.junit.jupiter.api.Assertions.assertFalse; | |||
import static org.junit.jupiter.api.Assertions.assertTrue; | |||
import static org.mockito.ArgumentMatchers.any; | |||
import static org.mockito.ArgumentMatchers.anyString; | |||
import static org.mockito.ArgumentMatchers.*; |
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.
please leave the imports as they were before (we have the convention not to use the *
import matcher). You can also import our code style into IntelliJ: https://github.com/JabRef/jabref/tree/master/config
…dded imports in LinkedFileViewModelTest
@tobiasdiez As requested I added a new method |
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.
Looks Good to me!
Thanks for your contribution!
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.
Sorry that it took so long for me to have a look at the code. It looks good now, except one minor point where sometimes a NPE would have been thrown (see below for details).
|
||
public boolean performDirectoryConflictCheck() { | ||
/* | ||
Get the suggested filepath for current linkedFile and compare it to the existing filepath. |
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 kind of code documentation is somewhat contrary to the usual style used in the rest of the code. Either move these comments before the method as JavaDoc comments, or use normal inline comments as done below.
*/ | ||
//Get the new path for the file | ||
Optional<Path> newDir = databaseContext.getFirstExistingFileDir(filePreferences); | ||
Path newDirectory = newDir.get(); |
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 get
method throws an exception if the optional is empty. I would propose to rewrite the code as return OptionalUtil.equals(newDir, currentDirectory, Files::isSameFile);
and add the following method to OptionalUtil
public <T,U> boolean equals(Optional<T> left, Optional<U> right, BiPredicate<T,U> equality) {
if(!left.isPresent()) {
return !right.isPresent();
} else {
if (right.isPresent()) {
return equality.test(left.get(), right.get());
} else {
return false;
}
}
}
(there might be syntax errors in the above code)
Happy new year to you, It would be really nice if you could address the few issues raised here and finish the PR so we can finally merge it. |
Superseeded by #4727 |
b2fbe15 APA 7th edition (#4419) c236ade Create BFCN.csl (#4481) 25d40cd Update iso690-full-note-cs.csl (#4480) 5de3904 Update budownictwo-i-architektura-pl.csl (#4479) 9d9c1da Add files via upload (#4478) 96200b0 Create instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-… (#4476) 8aa9cb0 Update APA journal styles (#4475) 8549afa Update in-text citation for legal_case for BJPS (#4470) 71c9e4d Update surgical-neurology-international.csl (#4472) a9dac17 Create FUNDING.yml 633e864 Create helsingin-yliopisto-teologinen-tiedekunta-teologian-tyyli.csl (#4303) 8797c01 Create romanian-iso-690-full-note-with-ibid-romanian.csl (#4465) c1519e1 Create assosiation-of-firearms-and-toolmark-examiners.csl (#4468) c974e30 Update ieee.csl (#4467) a1b7386 Update stale.yml (#4466) db549dd Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (#4462) 2822437 Update .travis.yml (#4463) 3d72c62 WIP: Adding deprecation notice to DIN1505-2 saying it has been superseded by ISO 690 (#4454) 1928c2b Fix links after KI update fad65b7 Turn Kidney International into AMA dependent 6357af5 Update association-for-computing-machinery.csl (#4459) eab02ea Create berlin-school-of-economics-and-law-international-marketing-man… (#3774) a3e3d97 One more metadata fix e7d5071 Some Sheldon metadata fixes 3ad4260 Create jurnal-sains-farmasi-dan-klinis.csl (#4455) 46370dc Add "AIMS Press" journals (#4458) 57fca07 Update association-for-computing-machinery.csl (#4456) 6fa90ed Add "Muséum national d'Histoire naturelle" journal styles (#4457) 7faf0b0 Bundle update e3c1f85 Create cryptogamie, bryologie (#4350) 525bba5 Create iso690-full-note-cs.csl (#4414) 932fad5 Create iso690-author-date-de.csl (#4344) ab23108 Create mbts-fullnote-bibliography.csl (#4363) c163008 Create associacao-brasileira-de-normas-tecnicas-ibict-full.csl (#4202) 5586bbc Create associacao-brasileira-de-normas-tecnicas-ibict-initials.csl (#4203) 483efcb Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl (#4442) 92f437d Create independent style for molecular-nutrition-and-food-research.csl… (#4342) 0d7f481 Update taylor-and-francis-council-of-science-editors-author-date.csl (#4385) 2b2786b Create ritid-timarit-hugvisindastofnunnar.csl (#4315) 9534999 Create jsbm.csl (#4371) b390657 Changed term on access macro, added rules for bill (#4407) 95c24f9 Create ecausp-abnt.csl (#4420) 66ca962 Reindent/reorder 91fefee Create materials-express.csl (#4445) ea5d50b Create institut-catholique-de-paris.csl (#4450) a4c07e2 Create institut-catholique-de-paris.csl (#4374) 8a17ae0 Update canadian-geotechnical-journal.csl (#4447) 7165db0 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (#4448) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: b2fbe15
b2fbe15 APA 7th edition (#4419) c236ade Create BFCN.csl (#4481) 25d40cd Update iso690-full-note-cs.csl (#4480) 5de3904 Update budownictwo-i-architektura-pl.csl (#4479) 9d9c1da Add files via upload (#4478) 96200b0 Create instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-… (#4476) 8aa9cb0 Update APA journal styles (#4475) 8549afa Update in-text citation for legal_case for BJPS (#4470) 71c9e4d Update surgical-neurology-international.csl (#4472) a9dac17 Create FUNDING.yml 633e864 Create helsingin-yliopisto-teologinen-tiedekunta-teologian-tyyli.csl (#4303) 8797c01 Create romanian-iso-690-full-note-with-ibid-romanian.csl (#4465) c1519e1 Create assosiation-of-firearms-and-toolmark-examiners.csl (#4468) c974e30 Update ieee.csl (#4467) a1b7386 Update stale.yml (#4466) db549dd Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (#4462) 2822437 Update .travis.yml (#4463) 3d72c62 WIP: Adding deprecation notice to DIN1505-2 saying it has been superseded by ISO 690 (#4454) 1928c2b Fix links after KI update fad65b7 Turn Kidney International into AMA dependent 6357af5 Update association-for-computing-machinery.csl (#4459) eab02ea Create berlin-school-of-economics-and-law-international-marketing-man… (#3774) a3e3d97 One more metadata fix e7d5071 Some Sheldon metadata fixes 3ad4260 Create jurnal-sains-farmasi-dan-klinis.csl (#4455) 46370dc Add "AIMS Press" journals (#4458) 57fca07 Update association-for-computing-machinery.csl (#4456) 6fa90ed Add "Muséum national d'Histoire naturelle" journal styles (#4457) 7faf0b0 Bundle update e3c1f85 Create cryptogamie, bryologie (#4350) 525bba5 Create iso690-full-note-cs.csl (#4414) 932fad5 Create iso690-author-date-de.csl (#4344) ab23108 Create mbts-fullnote-bibliography.csl (#4363) c163008 Create associacao-brasileira-de-normas-tecnicas-ibict-full.csl (#4202) 5586bbc Create associacao-brasileira-de-normas-tecnicas-ibict-initials.csl (#4203) 483efcb Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl (#4442) 92f437d Create independent style for molecular-nutrition-and-food-research.csl… (#4342) 0d7f481 Update taylor-and-francis-council-of-science-editors-author-date.csl (#4385) 2b2786b Create ritid-timarit-hugvisindastofnunnar.csl (#4315) 9534999 Create jsbm.csl (#4371) b390657 Changed term on access macro, added rules for bill (#4407) 95c24f9 Create ecausp-abnt.csl (#4420) 66ca962 Reindent/reorder 91fefee Create materials-express.csl (#4445) ea5d50b Create institut-catholique-de-paris.csl (#4450) a4c07e2 Create institut-catholique-de-paris.csl (#4374) 8a17ae0 Update canadian-geotechnical-journal.csl (#4447) 7165db0 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (#4448) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: b2fbe15
bfffaed APA: Fix sort order for in-text citations (JabRef#4495) c48d08b Add "Blood Cancer Discovery" for AACR (JabRef#4492) f628cb2 Medizinische Fakultät Mannheim - Numerisch (JabRef#4490) 77876a4 Improve legal cites for british-journal-of-political-science (JabRef#4488) 3c0c4ee Create apa-with-abstract.csl (JabRef#4487) a26fa95 Update afte-journal.csl (JabRef#4489) a7bf678 Create agriculturae-conspectus-scientificus.csl (JabRef#4491) bb01625 Make ET&C dependent of CSE (JabRef#4483) b4418ef Create ahmad-ibrahim-kulliyyah-of-laws-international-islamic-universi… (JabRef#4482) 22872d2 APA: Use "et al." in Dutch (JabRef#4484) 5f6c080 Update weed-research.csl (JabRef#4485) b2fbe15 APA 7th edition (JabRef#4419) c236ade Create BFCN.csl (JabRef#4481) 25d40cd Update iso690-full-note-cs.csl (JabRef#4480) 5de3904 Update budownictwo-i-architektura-pl.csl (JabRef#4479) 9d9c1da Add files via upload (JabRef#4478) 96200b0 Create instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-… (JabRef#4476) 8aa9cb0 Update APA journal styles (JabRef#4475) 8549afa Update in-text citation for legal_case for BJPS (JabRef#4470) 71c9e4d Update surgical-neurology-international.csl (JabRef#4472) a9dac17 Create FUNDING.yml 633e864 Create helsingin-yliopisto-teologinen-tiedekunta-teologian-tyyli.csl (JabRef#4303) 8797c01 Create romanian-iso-690-full-note-with-ibid-romanian.csl (JabRef#4465) c1519e1 Create assosiation-of-firearms-and-toolmark-examiners.csl (JabRef#4468) c974e30 Update ieee.csl (JabRef#4467) a1b7386 Update stale.yml (JabRef#4466) db549dd Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (JabRef#4462) 2822437 Update .travis.yml (JabRef#4463) 3d72c62 WIP: Adding deprecation notice to DIN1505-2 saying it has been superseded by ISO 690 (JabRef#4454) 1928c2b Fix links after KI update fad65b7 Turn Kidney International into AMA dependent 6357af5 Update association-for-computing-machinery.csl (JabRef#4459) eab02ea Create berlin-school-of-economics-and-law-international-marketing-man… (JabRef#3774) a3e3d97 One more metadata fix e7d5071 Some Sheldon metadata fixes 3ad4260 Create jurnal-sains-farmasi-dan-klinis.csl (JabRef#4455) 46370dc Add "AIMS Press" journals (JabRef#4458) 57fca07 Update association-for-computing-machinery.csl (JabRef#4456) 6fa90ed Add "Muséum national d'Histoire naturelle" journal styles (JabRef#4457) 7faf0b0 Bundle update e3c1f85 Create cryptogamie, bryologie (JabRef#4350) 525bba5 Create iso690-full-note-cs.csl (JabRef#4414) 932fad5 Create iso690-author-date-de.csl (JabRef#4344) ab23108 Create mbts-fullnote-bibliography.csl (JabRef#4363) c163008 Create associacao-brasileira-de-normas-tecnicas-ibict-full.csl (JabRef#4202) 5586bbc Create associacao-brasileira-de-normas-tecnicas-ibict-initials.csl (JabRef#4203) 483efcb Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl (JabRef#4442) 92f437d Create independent style for molecular-nutrition-and-food-research.csl… (JabRef#4342) 0d7f481 Update taylor-and-francis-council-of-science-editors-author-date.csl (JabRef#4385) 2b2786b Create ritid-timarit-hugvisindastofnunnar.csl (JabRef#4315) 9534999 Create jsbm.csl (JabRef#4371) b390657 Changed term on access macro, added rules for bill (JabRef#4407) 95c24f9 Create ecausp-abnt.csl (JabRef#4420) 66ca962 Reindent/reorder 91fefee Create materials-express.csl (JabRef#4445) ea5d50b Create institut-catholique-de-paris.csl (JabRef#4450) a4c07e2 Create institut-catholique-de-paris.csl (JabRef#4374) 8a17ae0 Update canadian-geotechnical-journal.csl (JabRef#4447) 7165db0 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (JabRef#4448) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: bfffaed
e2416fa Update clinical-and-experimental-optometry.csl (JabRef#4538) e71363e Create geriatrie-et-psychologie-neuropsychiatrie-du-vieillissement.csl (JabRef#4543) cdd973e APA: Add "personal communication" localization (JabRef#4539) 77bdb6f Create eksploatacja-i-niezawodnosc (JabRef#4531) 7858966 Ready: Update psychological-medicine.csl (JabRef#4536) 264141a Create south-african-actuarial-journal.csl (JabRef#4534) 1fde301 Create pakistan-journal-of-agricultural-sciences.csl (JabRef#4535) 3020eb3 Update hochschule-fur-soziale-arbeit-fhnw.csl (JabRef#4533) 57c8122 Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4530) 17c178f Update zeitschrift-fur-internationale-beziehungen.csl (JabRef#4527) 14cf589 Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4528) ca60d6e Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4524) 74c5ae9 Update groupe-danthropologie-et-darcheologie-funeraire.csl (JabRef#4526) 999e124 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#4521) caabe36 Fix psychiatric services f50e6f0 Add files via upload (JabRef#4519) c728658 Create harvard-lancaster-university.csl (JabRef#4520) 11e9ac9 Update instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abn… (JabRef#4511) 101b81c Update agriculturae-conspectus-scientificus.csl (JabRef#4510) 615377e Create international-journal-of-population-data-science.csl (JabRef#4517) fe7cb69 Update university-of-york-apa.csl f0c7374 Fix AGLC Subsequents 6a8ec90 More Uni Gottingen fixes 9c0f5c6 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#4460) 22ef83d Update Universitatsmedizin Gottingen d2f90c9 Create drying-technology.csl (JabRef#4515) 01e339b Create terrorism-and-political-violence.csl (JabRef#4514) 6414c15 Create international-journal-of-hyperthermia.csl (JabRef#4513) f80b38c Create Sciences Po - Ecole doctorale (note, French) (JabRef#4486) 6a22929 Update instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abn… (JabRef#4508) 19c89f5 Create citation-compass-apa-note.csl (JabRef#4500) fe72590 Chicago fixes & add no-ibid variant (JabRef#4503) d602477 Update agriculturae-conspectus-scientificus.csl (JabRef#4505) 8a8911b Create mediterranean-journal-of-chemistry.csl (JabRef#4506) ce77b28 Create conservation-and-society.csl (JabRef#4507) 25a5092 Add IMS journals (JabRef#4496) a39430e Create rmit-university-harvard.csl (JabRef#4504) 830aa7b Update john-benjamins-publishing-company-collective-volumes.csl (JabRef#4444) 43e9216 Create PHBern IVP (JabRef#4427) a052fd6 Create Publications du Groupe d'anthropologie et d'archéologie funéra… (JabRef#4499) a7e12e1 Further improve legal cites for BJPS (JabRef#4497) 744a507 Update agriculturae-conspectus-scientificus.csl (JabRef#4498) bfffaed APA: Fix sort order for in-text citations (JabRef#4495) c48d08b Add "Blood Cancer Discovery" for AACR (JabRef#4492) f628cb2 Medizinische Fakultät Mannheim - Numerisch (JabRef#4490) 77876a4 Improve legal cites for british-journal-of-political-science (JabRef#4488) 3c0c4ee Create apa-with-abstract.csl (JabRef#4487) a26fa95 Update afte-journal.csl (JabRef#4489) a7bf678 Create agriculturae-conspectus-scientificus.csl (JabRef#4491) bb01625 Make ET&C dependent of CSE (JabRef#4483) b4418ef Create ahmad-ibrahim-kulliyyah-of-laws-international-islamic-universi… (JabRef#4482) 22872d2 APA: Use "et al." in Dutch (JabRef#4484) 5f6c080 Update weed-research.csl (JabRef#4485) b2fbe15 APA 7th edition (JabRef#4419) c236ade Create BFCN.csl (JabRef#4481) 25d40cd Update iso690-full-note-cs.csl (JabRef#4480) 5de3904 Update budownictwo-i-architektura-pl.csl (JabRef#4479) 9d9c1da Add files via upload (JabRef#4478) 96200b0 Create instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-… (JabRef#4476) 8aa9cb0 Update APA journal styles (JabRef#4475) 8549afa Update in-text citation for legal_case for BJPS (JabRef#4470) 71c9e4d Update surgical-neurology-international.csl (JabRef#4472) a9dac17 Create FUNDING.yml 633e864 Create helsingin-yliopisto-teologinen-tiedekunta-teologian-tyyli.csl (JabRef#4303) 8797c01 Create romanian-iso-690-full-note-with-ibid-romanian.csl (JabRef#4465) c1519e1 Create assosiation-of-firearms-and-toolmark-examiners.csl (JabRef#4468) c974e30 Update ieee.csl (JabRef#4467) a1b7386 Update stale.yml (JabRef#4466) db549dd Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (JabRef#4462) 2822437 Update .travis.yml (JabRef#4463) 3d72c62 WIP: Adding deprecation notice to DIN1505-2 saying it has been superseded by ISO 690 (JabRef#4454) 1928c2b Fix links after KI update fad65b7 Turn Kidney International into AMA dependent 6357af5 Update association-for-computing-machinery.csl (JabRef#4459) eab02ea Create berlin-school-of-economics-and-law-international-marketing-man… (JabRef#3774) a3e3d97 One more metadata fix e7d5071 Some Sheldon metadata fixes 3ad4260 Create jurnal-sains-farmasi-dan-klinis.csl (JabRef#4455) 46370dc Add "AIMS Press" journals (JabRef#4458) 57fca07 Update association-for-computing-machinery.csl (JabRef#4456) 6fa90ed Add "Muséum national d'Histoire naturelle" journal styles (JabRef#4457) 7faf0b0 Bundle update e3c1f85 Create cryptogamie, bryologie (JabRef#4350) 525bba5 Create iso690-full-note-cs.csl (JabRef#4414) 932fad5 Create iso690-author-date-de.csl (JabRef#4344) ab23108 Create mbts-fullnote-bibliography.csl (JabRef#4363) c163008 Create associacao-brasileira-de-normas-tecnicas-ibict-full.csl (JabRef#4202) 5586bbc Create associacao-brasileira-de-normas-tecnicas-ibict-initials.csl (JabRef#4203) 483efcb Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl (JabRef#4442) 92f437d Create independent style for molecular-nutrition-and-food-research.csl… (JabRef#4342) 0d7f481 Update taylor-and-francis-council-of-science-editors-author-date.csl (JabRef#4385) 2b2786b Create ritid-timarit-hugvisindastofnunnar.csl (JabRef#4315) 9534999 Create jsbm.csl (JabRef#4371) b390657 Changed term on access macro, added rules for bill (JabRef#4407) 95c24f9 Create ecausp-abnt.csl (JabRef#4420) 66ca962 Reindent/reorder 91fefee Create materials-express.csl (JabRef#4445) ea5d50b Create institut-catholique-de-paris.csl (JabRef#4450) a4c07e2 Create institut-catholique-de-paris.csl (JabRef#4374) 8a17ae0 Update canadian-geotechnical-journal.csl (JabRef#4447) 7165db0 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (JabRef#4448) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: e2416fa
e106215 Create annales-de-demographie-historique.csl (JabRef#4512) 4dd974e Create lauterbornia.csl (JabRef#4525) e5277ae Update sciences-po-ecole-doctorale-note-french.csl (JabRef#4551) f9cfe40 Add new IOP dependents (JabRef#4549) daff985 Create brazilian-journal-of-veterinary-research-and-animal-science.csl (JabRef#4544) 10c6fa8 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (JabRef#4545) c531528 create mcgill9-en.csl, Canadian McGill legal style (JabRef#4532) e2416fa Update clinical-and-experimental-optometry.csl (JabRef#4538) e71363e Create geriatrie-et-psychologie-neuropsychiatrie-du-vieillissement.csl (JabRef#4543) cdd973e APA: Add "personal communication" localization (JabRef#4539) 77bdb6f Create eksploatacja-i-niezawodnosc (JabRef#4531) 7858966 Ready: Update psychological-medicine.csl (JabRef#4536) 264141a Create south-african-actuarial-journal.csl (JabRef#4534) 1fde301 Create pakistan-journal-of-agricultural-sciences.csl (JabRef#4535) 3020eb3 Update hochschule-fur-soziale-arbeit-fhnw.csl (JabRef#4533) 57c8122 Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4530) 17c178f Update zeitschrift-fur-internationale-beziehungen.csl (JabRef#4527) 14cf589 Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4528) ca60d6e Update john-benjamins-publishing-company-linguistik-aktuell-linguistics-today.csl (JabRef#4524) 74c5ae9 Update groupe-danthropologie-et-darcheologie-funeraire.csl (JabRef#4526) 999e124 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#4521) caabe36 Fix psychiatric services f50e6f0 Add files via upload (JabRef#4519) c728658 Create harvard-lancaster-university.csl (JabRef#4520) 11e9ac9 Update instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abn… (JabRef#4511) 101b81c Update agriculturae-conspectus-scientificus.csl (JabRef#4510) 615377e Create international-journal-of-population-data-science.csl (JabRef#4517) fe7cb69 Update university-of-york-apa.csl f0c7374 Fix AGLC Subsequents 6a8ec90 More Uni Gottingen fixes 9c0f5c6 Update associacao-brasileira-de-normas-tecnicas-ufrgs.csl (JabRef#4460) 22ef83d Update Universitatsmedizin Gottingen d2f90c9 Create drying-technology.csl (JabRef#4515) 01e339b Create terrorism-and-political-violence.csl (JabRef#4514) 6414c15 Create international-journal-of-hyperthermia.csl (JabRef#4513) f80b38c Create Sciences Po - Ecole doctorale (note, French) (JabRef#4486) 6a22929 Update instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abn… (JabRef#4508) 19c89f5 Create citation-compass-apa-note.csl (JabRef#4500) fe72590 Chicago fixes & add no-ibid variant (JabRef#4503) d602477 Update agriculturae-conspectus-scientificus.csl (JabRef#4505) 8a8911b Create mediterranean-journal-of-chemistry.csl (JabRef#4506) ce77b28 Create conservation-and-society.csl (JabRef#4507) 25a5092 Add IMS journals (JabRef#4496) a39430e Create rmit-university-harvard.csl (JabRef#4504) 830aa7b Update john-benjamins-publishing-company-collective-volumes.csl (JabRef#4444) 43e9216 Create PHBern IVP (JabRef#4427) a052fd6 Create Publications du Groupe d'anthropologie et d'archéologie funéra… (JabRef#4499) a7e12e1 Further improve legal cites for BJPS (JabRef#4497) 744a507 Update agriculturae-conspectus-scientificus.csl (JabRef#4498) bfffaed APA: Fix sort order for in-text citations (JabRef#4495) c48d08b Add "Blood Cancer Discovery" for AACR (JabRef#4492) f628cb2 Medizinische Fakultät Mannheim - Numerisch (JabRef#4490) 77876a4 Improve legal cites for british-journal-of-political-science (JabRef#4488) 3c0c4ee Create apa-with-abstract.csl (JabRef#4487) a26fa95 Update afte-journal.csl (JabRef#4489) a7bf678 Create agriculturae-conspectus-scientificus.csl (JabRef#4491) bb01625 Make ET&C dependent of CSE (JabRef#4483) b4418ef Create ahmad-ibrahim-kulliyyah-of-laws-international-islamic-universi… (JabRef#4482) 22872d2 APA: Use "et al." in Dutch (JabRef#4484) 5f6c080 Update weed-research.csl (JabRef#4485) b2fbe15 APA 7th edition (JabRef#4419) c236ade Create BFCN.csl (JabRef#4481) 25d40cd Update iso690-full-note-cs.csl (JabRef#4480) 5de3904 Update budownictwo-i-architektura-pl.csl (JabRef#4479) 9d9c1da Add files via upload (JabRef#4478) 96200b0 Create instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-… (JabRef#4476) 8aa9cb0 Update APA journal styles (JabRef#4475) 8549afa Update in-text citation for legal_case for BJPS (JabRef#4470) 71c9e4d Update surgical-neurology-international.csl (JabRef#4472) a9dac17 Create FUNDING.yml 633e864 Create helsingin-yliopisto-teologinen-tiedekunta-teologian-tyyli.csl (JabRef#4303) 8797c01 Create romanian-iso-690-full-note-with-ibid-romanian.csl (JabRef#4465) c1519e1 Create assosiation-of-firearms-and-toolmark-examiners.csl (JabRef#4468) c974e30 Update ieee.csl (JabRef#4467) a1b7386 Update stale.yml (JabRef#4466) db549dd Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (JabRef#4462) 2822437 Update .travis.yml (JabRef#4463) 3d72c62 WIP: Adding deprecation notice to DIN1505-2 saying it has been superseded by ISO 690 (JabRef#4454) 1928c2b Fix links after KI update fad65b7 Turn Kidney International into AMA dependent 6357af5 Update association-for-computing-machinery.csl (JabRef#4459) eab02ea Create berlin-school-of-economics-and-law-international-marketing-man… (JabRef#3774) a3e3d97 One more metadata fix e7d5071 Some Sheldon metadata fixes 3ad4260 Create jurnal-sains-farmasi-dan-klinis.csl (JabRef#4455) 46370dc Add "AIMS Press" journals (JabRef#4458) 57fca07 Update association-for-computing-machinery.csl (JabRef#4456) 6fa90ed Add "Muséum national d'Histoire naturelle" journal styles (JabRef#4457) 7faf0b0 Bundle update e3c1f85 Create cryptogamie, bryologie (JabRef#4350) 525bba5 Create iso690-full-note-cs.csl (JabRef#4414) 932fad5 Create iso690-author-date-de.csl (JabRef#4344) ab23108 Create mbts-fullnote-bibliography.csl (JabRef#4363) c163008 Create associacao-brasileira-de-normas-tecnicas-ibict-full.csl (JabRef#4202) 5586bbc Create associacao-brasileira-de-normas-tecnicas-ibict-initials.csl (JabRef#4203) 483efcb Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl (JabRef#4442) 92f437d Create independent style for molecular-nutrition-and-food-research.csl… (JabRef#4342) 0d7f481 Update taylor-and-francis-council-of-science-editors-author-date.csl (JabRef#4385) 2b2786b Create ritid-timarit-hugvisindastofnunnar.csl (JabRef#4315) 9534999 Create jsbm.csl (JabRef#4371) b390657 Changed term on access macro, added rules for bill (JabRef#4407) 95c24f9 Create ecausp-abnt.csl (JabRef#4420) 66ca962 Reindent/reorder 91fefee Create materials-express.csl (JabRef#4445) ea5d50b Create institut-catholique-de-paris.csl (JabRef#4450) a4c07e2 Create institut-catholique-de-paris.csl (JabRef#4374) 8a17ae0 Update canadian-geotechnical-journal.csl (JabRef#4447) 7165db0 Update ens-de-lyon-centre-d-ingenierie-documentaire.csl (JabRef#4448) git-subtree-dir: src/main/resources/csl-styles git-subtree-split: e106215
Potential fix for #4306.
The method
performNameConflictCheck
added inLinkedFileViewModel
helps check whether or not the filename is already equal to the suggested filename. If so, it returns true, otherwise, it returns false. This method is then called inLinkedFilesEditor
duringcreateContextMenuForFile()
to decide whether or not the Rename, Move, or Rename and Move menu options are to be disabled.The method itself works as I tested it by running the code live with the JVM. Having the filename == suggested filename indeed disabled those three menu options in the context menu. The issue however, is that I'm having trouble writing my test case for it. I'm running into a couple of nullpointers being thrown when I try to run my test case
checkNameConflict()
inLinkedFileViewModelTest
. Specifically, it reports that there are nullpointers when accessing thegetSuggestedFilename()
called in withincheckNameConflict
in theLinkedFileViewModel
class.