Skip to content

Commit 0337872

Browse files
committed
Merge remote-tracking branch 'upstream/main' into addAddContentToImage
* upstream/main: Replacement localization (#10358) Add workaround for IDEA-317606 Fix CHANGELOG.md linting issues (#10351) fix afterburner checkstyle add changelog Fix NPE when adding new aux group Add "--verbose" to MV generator (#10347) Fix dependencies (#10326) Add new openrewrite rules (#10342) New Crowdin updates (#10344) Rework duplicate checker tests (#10341)
2 parents 299032a + 8d4e8d8 commit 0337872

File tree

20 files changed

+484
-212
lines changed

20 files changed

+484
-212
lines changed

CHANGELOG.md

Lines changed: 18 additions & 17 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111

1212
id 'org.javamodularity.moduleplugin' version '1.8.12'
1313

14-
id 'org.openjfx.javafxplugin' version '0.0.14'
14+
id 'org.openjfx.javafxplugin' version '0.1.0'
1515

1616
id 'org.beryx.jlink' version '2.26.0'
1717

@@ -27,7 +27,7 @@ plugins {
2727

2828
id 'idea'
2929

30-
id 'org.openrewrite.rewrite' version '6.3.2'
30+
id 'org.openrewrite.rewrite' version '6.3.3'
3131
}
3232

3333
// Enable following for debugging
@@ -83,7 +83,6 @@ sourceSets {
8383
}
8484

8585
repositories {
86-
mavenLocal()
8786
mavenCentral()
8887
maven { url 'https://oss.sonatype.org/content/groups/public' }
8988
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
@@ -169,13 +168,12 @@ dependencies {
169168
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
170169
implementation 'jakarta.inject:jakarta.inject-api:2.0.1'
171170

172-
173-
implementation 'org.jabref:afterburner.fx:1.1.0-SNAPSHOT'
171+
implementation('org.jabref:afterburner.fx:2.0.0-SNAPSHOT')
174172
implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1'
175173
implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.3.1'
176174
implementation 'com.github.sialcasa.mvvmFX:mvvmfx-validation:f195849ca9' //jitpack
177175
implementation 'de.saxsys:mvvmfx:1.8.0'
178-
implementation 'com.tobiasdiez:easybind:2.2.1-SNAPSHOT'
176+
implementation('com.tobiasdiez:easybind:2.2.1-SNAPSHOT')
179177
implementation 'org.fxmisc.flowless:flowless:0.7.1'
180178
implementation 'org.fxmisc.richtext:richtextfx:0.11.1'
181179
implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.77.0') {
@@ -196,7 +194,9 @@ dependencies {
196194
// route all requests to java.util.logging to SLF4J (which in turn routes to tinylog)
197195
implementation 'org.slf4j:jul-to-slf4j:2.0.7'
198196

199-
implementation 'de.undercouch:citeproc-java:3.0.0-beta.2'
197+
implementation('de.undercouch:citeproc-java:3.0.0-beta.2') {
198+
exclude group: 'org.antlr'
199+
}
200200

201201
// jakarta.activation is already dependency of glassfish
202202
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '3.0.1'
@@ -253,8 +253,10 @@ dependencies {
253253
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'
254254

255255
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.2.1"))
256-
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
257256
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
257+
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
258+
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
259+
rewrite("org.openrewrite.recipe:rewrite-migrate-java")
258260
}
259261

260262
clean {
@@ -712,24 +714,9 @@ if (OperatingSystem.current().isMacOsX()) {
712714
}
713715
}
714716
}
717+
715718
jmh {
716719
warmupIterations = 5
717720
iterations = 10
718721
fork = 2
719722
}
720-
721-
// Source: https://stackoverflow.com/a/44168582/873282
722-
task downloadDependencies {
723-
description "Pre-downloads *most* dependencies"
724-
doLast {
725-
configurations.getAsMap().each { name, config ->
726-
println "Retrieving dependencies for $name"
727-
try {
728-
config.files
729-
} catch (e) {
730-
// some cannot be resolved, just log them
731-
project.logger.info e.message
732-
}
733-
}
734-
}
735-
}

docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In the following, we will use `c:\git-repositories` as base folder:
2525
cd \
2626
mkdir git-repositories
2727
cd git-repositories
28-
git clone --depth=10 https://github.com/JabRef/jabref.git
28+
git clone --depth=10 https://github.com/JabRef/jabref.git JabRef
2929
cd jabref
3030
git remote rename origin upstream
3131
git remote add origin https://github.com/YOUR_USERNAME/jabref.git
@@ -36,6 +36,8 @@ git branch --set-upstream-to=origin/main main
3636
> Note that putting the repo JabRef directly on `C:\` or any other drive letter on Windows causes compile errors (**negative example**: `C:\jabref`).
3737
>
3838
> Further, if you are building on Windows, make sure that the absolute path to the location of the clone does not contain folders starting with '`u`' (**negative example**: `C:\university\jabref`) as this may currently also cause [compile errors](https://github.com/JabRef/jabref/issues/9783).
39+
>
40+
> Please really ensure that you pass `JabRef` as parameter. Otherwise, you will get `java.lang.IllegalStateException: Module entity with name: jabref should be available`. See [IDEA-317606](https://youtrack.jetbrains.com/issue/IDEA-317606/Changing-only-the-case-of-the-Gradle-root-project-name-causes-exception-while-importing-project-java.lang.IllegalStateException) for details.
3941
4042
{: .note-title }
4143
> Background

rewrite.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,18 @@ recipeList:
9999
# We voted against it
100100
# - org.openrewrite.staticanalysis.ExplicitInitialization
101101

102+
- org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose
103+
104+
- org.openrewrite.java.recipes.UseJavaParserBuilderInJavaTemplate
105+
102106
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences
103107

108+
- org.openrewrite.java.testing.junit5.AssertTrueInstanceofToAssertInstanceOf
109+
- org.openrewrite.java.testing.junit5.RemoveTryCatchFailBlocks
110+
111+
# needs another openrewrite dependency
112+
# - org.openrewrite.okhttp.ReorderRequestBodyCreateArguments
113+
104114
- org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet
105115
- org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums
106116
- org.openrewrite.staticanalysis.BooleanChecksNotInverted
@@ -116,6 +126,7 @@ recipeList:
116126
# - org.openrewrite.staticanalysis.DefaultComesLast
117127
- org.openrewrite.staticanalysis.EmptyBlock
118128
- org.openrewrite.staticanalysis.EqualsAvoidsNull
129+
- org.openrewrite.staticanalysis.EqualsToContentEquals
119130
# Needs manual intervention
120131
# - org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes
121132
- org.openrewrite.staticanalysis.ExternalizableHasNoArgsConstructor
@@ -150,7 +161,9 @@ recipeList:
150161
- org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters
151162
- org.openrewrite.staticanalysis.RemoveExtraSemicolons
152163
- org.openrewrite.staticanalysis.RemoveJavaDocAuthorTag
164+
- org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances
153165
- org.openrewrite.staticanalysis.RemoveRedundantTypeCast
166+
- org.openrewrite.staticanalysis.RemoveToStringCallsFromArrayInstances
154167
- org.openrewrite.staticanalysis.RemoveUnneededAssertion
155168
- org.openrewrite.staticanalysis.RemoveUnneededBlock
156169
# - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
@@ -159,12 +172,14 @@ recipeList:
159172
- org.openrewrite.staticanalysis.RenameMethodsNamedHashcodeEqualOrTostring
160173
- org.openrewrite.staticanalysis.ReplaceRedundantFormatWithPrintf
161174
- org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
175+
- org.openrewrite.staticanalysis.ReplaceWeekYearWithYear
162176
# - org.openrewrite.staticanalysis.ShortenFullyQualifiedTypeReferences
163177
# - org.openrewrite.staticanalysis.SimplifyConsecutiveAssignments
164178
# - org.openrewrite.staticanalysis.SimplifyCompoundStatement
165179
- org.openrewrite.staticanalysis.SimplifyBooleanExpression
166180
- org.openrewrite.staticanalysis.SimplifyBooleanReturn
167181
- org.openrewrite.staticanalysis.SimplifyDurationCreationUnits
182+
- org.openrewrite.staticanalysis.SortedSetStreamToLinkedHashSet
168183
- org.openrewrite.staticanalysis.StaticMethodNotFinal
169184
- org.openrewrite.staticanalysis.StringLiteralEquality
170185
- org.openrewrite.staticanalysis.TypecastParenPad

src/main/java/org/jabref/cli/JournalListMvGenerator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
public class JournalListMvGenerator {
2020

2121
public static void main(String[] args) throws IOException {
22+
boolean verbose = (args.length == 1) && ("--verbose".equals(args[0]));
23+
2224
Path abbreviationsDirectory = Path.of("buildres", "abbrv.jabref.org", "journals");
2325
if (!Files.exists(abbreviationsDirectory)) {
2426
System.out.println("Path " + abbreviationsDirectory.toAbsolutePath() + " does not exist");
@@ -66,7 +68,9 @@ public static void main(String[] args) throws IOException {
6668
Abbreviation::getName,
6769
abbreviation -> abbreviation,
6870
(abbreviation1, abbreviation2) -> {
69-
System.out.println("Double entry " + abbreviation1.getName());
71+
if (verbose) {
72+
System.out.println("Double entry " + abbreviation1.getName());
73+
}
7074
return abbreviation2;
7175
}));
7276
fullToAbbreviation.putAll(abbreviationMap);

src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ protected Void call() throws Exception {
164164
skipped++;
165165
} else {
166166
for (Path file : files) {
167-
updateMessage(Localization.lang("Writing metadata to {}", file.getFileName()));
167+
updateMessage(Localization.lang("Writing metadata to %0", file.getFileName()));
168168

169169
if (Files.exists(file)) {
170170
try {

src/main/java/org/jabref/gui/groups/GroupDialogView.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,23 @@ public class GroupDialogView extends BaseDialog<AbstractGroup> {
8888

8989
@FXML private TextField texGroupFilePath;
9090

91-
@Inject private FileUpdateMonitor fileUpdateMonitor;
92-
9391
private final EnumMap<GroupHierarchyType, String> hierarchyText = new EnumMap<>(GroupHierarchyType.class);
9492
private final EnumMap<GroupHierarchyType, String> hierarchyToolTip = new EnumMap<>(GroupHierarchyType.class);
9593

9694
private final ControlsFxVisualizer validationVisualizer = new ControlsFxVisualizer();
97-
private final GroupDialogViewModel viewModel;
9895

99-
public GroupDialogView(DialogService dialogService,
100-
BibDatabaseContext currentDatabase,
101-
PreferencesService preferencesService,
96+
private final BibDatabaseContext currentDatabase;
97+
private final AbstractGroup editedGroup;
98+
private GroupDialogViewModel viewModel;
99+
@Inject private FileUpdateMonitor fileUpdateMonitor;
100+
@Inject private DialogService dialogService;
101+
@Inject private PreferencesService preferencesService;
102+
103+
public GroupDialogView(BibDatabaseContext currentDatabase,
102104
AbstractGroup editedGroup,
103105
GroupDialogHeader groupDialogHeader) {
104-
viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup, fileUpdateMonitor);
106+
this.currentDatabase = currentDatabase;
107+
this.editedGroup = editedGroup;
105108

106109
ViewLoader.view(this)
107110
.load()
@@ -117,7 +120,6 @@ public GroupDialogView(DialogService dialogService,
117120
this.setTitle(Localization.lang("Edit group") + " " + editedGroup.getName());
118121
}
119122

120-
setResultConverter(viewModel::resultConverter);
121123
getDialogPane().getButtonTypes().setAll(ButtonType.OK, ButtonType.CANCEL);
122124

123125
final Button confirmDialogButton = (Button) getDialogPane().lookupButton(ButtonType.OK);
@@ -128,6 +130,10 @@ public GroupDialogView(DialogService dialogService,
128130

129131
@FXML
130132
public void initialize() {
133+
viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup, fileUpdateMonitor);
134+
135+
setResultConverter(viewModel::resultConverter);
136+
131137
hierarchyText.put(GroupHierarchyType.INCLUDING, Localization.lang("Union"));
132138
hierarchyToolTip.put(GroupHierarchyType.INCLUDING, Localization.lang("Include subgroups: When selected, view entries contained in this group or its subgroups"));
133139
hierarchyText.put(GroupHierarchyType.REFINING, Localization.lang("Intersection"));

src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class GroupTreeViewModel extends AbstractViewModel {
5757
private final Comparator<GroupTreeNode> compAlphabetIgnoreCase = (GroupTreeNode v1, GroupTreeNode v2) -> v1
5858
.getName()
5959
.compareToIgnoreCase(v2.getName());
60-
private Optional<BibDatabaseContext> currentDatabase;
60+
private Optional<BibDatabaseContext> currentDatabase = Optional.empty();
6161

6262
public GroupTreeViewModel(StateManager stateManager, DialogService dialogService, PreferencesService preferencesService, TaskExecutor taskExecutor, CustomLocalDragboard localDragboard) {
6363
this.stateManager = Objects.requireNonNull(stateManager);
@@ -159,9 +159,7 @@ private void onActiveDatabaseChanged(Optional<BibDatabaseContext> newDatabase) {
159159
public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDialogHeader) {
160160
currentDatabase.ifPresent(database -> {
161161
Optional<AbstractGroup> newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView(
162-
dialogService,
163162
database,
164-
preferences,
165163
null,
166164
groupDialogHeader));
167165

@@ -245,9 +243,7 @@ boolean onlyMinorChanges(AbstractGroup oldGroup, AbstractGroup newGroup) {
245243
public void editGroup(GroupNodeViewModel oldGroup) {
246244
currentDatabase.ifPresent(database -> {
247245
Optional<AbstractGroup> newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView(
248-
dialogService,
249246
database,
250-
preferences,
251247
oldGroup.getGroupNode().getGroup(),
252248
GroupDialogHeader.SUBGROUP));
253249
newGroup.ifPresent(group -> {

src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public String format(String value) {
5959
}
6060
// If we are in a command body, see if it has ended:
6161
if (inCommand && (c == '}')) {
62-
if ("begin".equals(commandName.toString())) {
62+
if ("begin".contentEquals(commandName)) {
6363
nestedEnvironments++;
6464
}
65-
if ((nestedEnvironments > 0) && "end".equals(commandName.toString())) {
65+
if ((nestedEnvironments > 0) && "end".contentEquals(commandName)) {
6666
nestedEnvironments--;
6767
}
6868

@@ -72,7 +72,7 @@ public String format(String value) {
7272

7373
// We add a backslash before any ampersand characters, with one exception: if
7474
// we are inside an \\url{...} command, we should write it as it is. Maybe.
75-
if ((c == '&') && !escape && !(inCommand && "url".equals(commandName.toString()))
75+
if ((c == '&') && !escape && !(inCommand && "url".contentEquals(commandName))
7676
&& (nestedEnvironments == 0)) {
7777
result.append("\\&");
7878
} else {

src/main/resources/l10n/JabRef_en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2579,4 +2579,4 @@ Failed\ to\ download\ from\ URL=Failed to download from URL
25792579
Finished=Finished
25802580
Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Finished writing metadata for library %0 (%1 succeeded, %2 skipped, %3 errors).
25812581
Processing...=Processing...
2582-
Writing\ metadata\ to\ {}=Writing metadata to {}
2582+
Writing\ metadata\ to\ %0=Writing metadata to %0

0 commit comments

Comments
 (0)