Skip to content
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 @@ -32,6 +32,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed unreadable linked-file paths and indistinguishable selection backgrounds in the entry editor when using dark mode. [#17364](https://github.com/JabRef/jabref/issues/17364)
- We fixed an issue where back navigation selected a deleted entry instead of skipping it. [#17353](https://github.com/JabRef/jabref/issues/17353)
- We fixed the linked file tooltip showing the old file name after renaming or moving the file. [#9277](https://github.com/JabRef/jabref/issues/9277)
- We fixed an issue where citationcount, day, and dayfiled columns were sorted alphabetically instead of numerically. [#17459](https://github.com/JabRef/jabref/issues/17459)

## [6.0-beta.1] - 2026-09-21

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref.gui.util.comparator;

import java.util.List;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -43,6 +45,13 @@ void compareIntegerWithString() {
assertEquals(1, comparator.compare("4", "hi"));
}

@Test
void sortMixedTextAndNumericValues() {
List<String> values = List.of("Wednesday", "10", "Tuesday", "2");

assertEquals(List.of("Tuesday", "Wednesday", "2", "10"), values.stream().sorted(comparator).toList());
}

@Test
void compareNegativeInteger() {
assertEquals(1, comparator.compare("-4", "-5"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public enum FieldProperty {
MONTH,

MULTILINE_TEXT,

/// Enables numeric-aware sorting and causes JabRef to treat the field as non-LaTeX content.
/// This is a JabRef property, not a BibLaTeX datatype: `edition` accepts integers or
/// literal values, and `number` and `pagetotal` are literal fields. See the [BibLaTeX
/// manual, section 2.2.2](https://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf).
NUMERIC,
PAGINATION,
PERSON_NAMES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public enum StandardField implements Field {
CROSSREF("crossref", FieldProperty.SINGLE_ENTRY_LINK),
CITES("cites", FieldProperty.MULTIPLE_ENTRY_LINK),
DATE("date", FieldProperty.DATE),
DAY("day"),
DAYFILED("dayfiled"),
DAY("day", FieldProperty.NUMERIC),
DAYFILED("dayfiled", FieldProperty.NUMERIC),
DOI("doi", FieldProperty.VERBATIM, FieldProperty.IDENTIFIER),
EDITION("edition", FieldProperty.NUMERIC),
EDITOR("editor", FieldProperty.PERSON_NAMES),
Expand Down Expand Up @@ -144,7 +144,7 @@ public enum StandardField implements Field {

// region: JabRef-specific fields

CITATIONCOUNT("citationcount"),
CITATIONCOUNT("citationcount", FieldProperty.NUMERIC),
GROUPS("groups"),
ICORERANKING("icore"),
OWNER("owner"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

class StandardFieldTest {

@Test
void fieldsConsideredEqualIfSame() {
assertEquals(StandardField.TITLE, StandardField.TITLE);
}

@Test
void numericFieldsHaveNumericProperty() {
assertTrue(StandardField.CITATIONCOUNT.isNumeric());
assertTrue(StandardField.DAY.isNumeric());
assertTrue(StandardField.DAYFILED.isNumeric());
}

@Test
void nonNumericFieldsDoNotHaveNumericProperty() {
assertFalse(StandardField.CHAPTER.isNumeric());
assertFalse(StandardField.PART.isNumeric());
}
}
Loading