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

Fix for exception thrown if no delimiters were specified #6642

Merged
merged 5 commits into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Added

- We added default values for delimiters in Add Subgroup window [#6624](https://github.com/JabRef/jabref/issues/6624)
- We improved responsiveness of general fields specification dialog window. [#6643](https://github.com/JabRef/jabref/issues/6604)
- We added support for importing ris file and load DOI [#6530](https://github.com/JabRef/jabref/issues/6530)
- We added the Library properties to a context menu on the library tabs [#6485](https://github.com/JabRef/jabref/issues/6485)
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,22 @@ public AbstractGroup resultConverter(ButtonType button) {
searchGroupRegexProperty.getValue());
} else if (typeAutoProperty.getValue()) {
if (autoGroupKeywordsOptionProperty.getValue()) {
// Set default value for delimiters: ',' for base and '>' for hierarchical
char delimiter = ',';
char hierarDelimiter = Keyword.DEFAULT_HIERARCHICAL_DELIMITER;
// Modify values for delimiters if user provided customized values
if (!autoGroupKeywordsDelimiterProperty.getValue().isEmpty()) {
delimiter = autoGroupKeywordsDelimiterProperty.getValue().charAt(0);
}
if (!autoGroupKeywordsHierarchicalDelimiterProperty.getValue().isEmpty()) {
hierarDelimiter = autoGroupKeywordsHierarchicalDelimiterProperty.getValue().charAt(0);
}
resultingGroup = new AutomaticKeywordGroup(
groupName,
groupHierarchySelectedProperty.getValue(),
FieldFactory.parseField(autoGroupKeywordsFieldProperty.getValue().trim()),
autoGroupKeywordsDelimiterProperty.getValue().charAt(0),
autoGroupKeywordsHierarchicalDelimiterProperty.getValue().charAt(0));
delimiter,
hierarDelimiter);
} else {
resultingGroup = new AutomaticPersonsGroup(
groupName,
Expand Down