- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Closed
Copy link
Labels
good first issueAn issue intended for project-newcomers. Varies in difficulty.An issue intended for project-newcomers. Varies in difficulty.📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)🔔 reminder-sent
Description
The if condition at org.jabref.logic.externalfiles.LinkedFileHandler#getSuggestedFileName(java.lang.String) checks for -. The reason is that [bibtexkey] - [title] is the default pattern (see org.jabref.logic.FilePreferences#DEFAULT_FILENAME_PATTERNS).
The return of
Task:
- The return type of org.jabref.logic.util.io.FileUtil#createFileNameFromPatternshould be Optional. If the empty string (or "-" or "default") would be returned, return an empty optinal. Note that test cases need to be adapted. Especially instead of "default", there will be Optional.empty().
- Adapt org.jabref.logic.util.io.FileUtil#createFileNameFromPatternto return an empty Optional if no brackets could be replaced.
Hint:
- ´org.jabref.logic.citationkeypattern.BracketedPattern#expandBrackets(java.lang.String, java.util.function.Function<java.lang.String,java.lang.String>)can be used with a function returning "" for each input string. Then, one retrieves all non-bracktet characters from the input stirng. Example:[AUTHOR] - [YEAR]will result in- `.
- Add with a JUnit test for expandBrackets to ensure the claim is current.
- If the claim is correct, task 2 should be "easy" to do by "just" calling expandBrackets with the empty string function and checking if targetNameequals that name.
Background: Risen by #13295.
Metadata
Metadata
Assignees
Labels
good first issueAn issue intended for project-newcomers. Varies in difficulty.An issue intended for project-newcomers. Varies in difficulty.📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)🔔 reminder-sent
Type
Projects
Status
Done