Skip to content

Commit

Permalink
Apply GJF v1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Oct 5, 2024
1 parent a80d637 commit 814b5c6
Show file tree
Hide file tree
Showing 1,970 changed files with 79,453 additions and 49,156 deletions.
52 changes: 33 additions & 19 deletions src/jmh/java/org/jabref/benchmarks/Benchmarks.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package org.jabref.benchmarks;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.List;
import java.util.Random;
import static org.mockito.Mockito.mock;

import com.airhacks.afterburner.injection.Injector;

import org.jabref.logic.bibtex.FieldPreferences;
import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences;
Expand All @@ -31,16 +29,18 @@
import org.jabref.model.groups.KeywordGroup;
import org.jabref.model.groups.WordKeywordGroup;
import org.jabref.model.metadata.MetaData;

import com.airhacks.afterburner.injection.Injector;
import org.openjdk.jmh.Main;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.runner.RunnerException;

import static org.mockito.Mockito.mock;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.List;
import java.util.Random;

@State(Scope.Thread)
public class Benchmarks {
Expand All @@ -59,7 +59,9 @@ public void init() throws Exception {
BibEntry entry = new BibEntry();
entry.setCitationKey("id" + i);
entry.setField(StandardField.TITLE, "This is my title " + i);
entry.setField(StandardField.AUTHOR, "Firstname Lastname and FirstnameA LastnameA and FirstnameB LastnameB" + i);
entry.setField(
StandardField.AUTHOR,
"Firstname Lastname and FirstnameA LastnameA and FirstnameB LastnameB" + i);
entry.setField(StandardField.JOURNAL, "Journal Title " + i);
entry.setField(StandardField.KEYWORDS, "testkeyword");
entry.setField(StandardField.YEAR, "1" + i);
Expand All @@ -69,21 +71,25 @@ public void init() throws Exception {

bibtexString = getOutputWriter().toString();

latexConversionString = "{A} \\textbf{bold} approach {\\it to} ${{\\Sigma}}{\\Delta}$ modulator \\textsuperscript{2} \\$";
latexConversionString =
"{A} \\textbf{bold} approach {\\it to} ${{\\Sigma}}{\\Delta}$ modulator \\textsuperscript{2} \\$";

htmlConversionString = "<b>&Ouml;sterreich</b> &#8211; &amp; characters &#x2aa2; <i>italic</i>";
htmlConversionString =
"<b>&Ouml;sterreich</b> &#8211; &amp; characters &#x2aa2; <i>italic</i>";
}

private StringWriter getOutputWriter() throws IOException {
StringWriter outputWriter = new StringWriter();
BibWriter bibWriter = new BibWriter(outputWriter, OS.NEWLINE);
BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(
bibWriter,
mock(SelfContainedSaveConfiguration.class),
mock(FieldPreferences.class),
mock(CitationKeyPatternPreferences.class),
new BibEntryTypesManager());
databaseWriter.savePartOfDatabase(new BibDatabaseContext(database, new MetaData()), database.getEntries());
BibtexDatabaseWriter databaseWriter =
new BibtexDatabaseWriter(
bibWriter,
mock(SelfContainedSaveConfiguration.class),
mock(FieldPreferences.class),
mock(CitationKeyPatternPreferences.class),
new BibEntryTypesManager());
databaseWriter.savePartOfDatabase(
new BibDatabaseContext(database, new MetaData()), database.getEntries());
return outputWriter;
}

Expand Down Expand Up @@ -136,7 +142,15 @@ public String htmlToLatexConversion() {

@Benchmark
public boolean keywordGroupContains() {
KeywordGroup group = new WordKeywordGroup("testGroup", GroupHierarchyType.INDEPENDENT, StandardField.KEYWORDS, "testkeyword", false, ',', false);
KeywordGroup group =
new WordKeywordGroup(
"testGroup",
GroupHierarchyType.INDEPENDENT,
StandardField.KEYWORDS,
"testkeyword",
false,
',',
false);
return group.containsAll(database.getEntries());
}

Expand Down
40 changes: 19 additions & 21 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,34 @@
requires javafx.controls;
requires javafx.web;
requires javafx.fxml;

requires afterburner.fx;
provides com.airhacks.afterburner.views.ResourceLocator
with org.jabref.gui.util.JabRefResourceLocator;

provides com.airhacks.afterburner.views.ResourceLocator with
org.jabref.gui.util.JabRefResourceLocator;

requires com.dlsc.gemsfx;

uses com.dlsc.gemsfx.TagsField;

// Provides number input fields for parameters in AI expert settings
requires com.dlsc.unitfx;

requires com.tobiasdiez.easybind;

requires de.saxsys.mvvmfx;
requires de.saxsys.mvvmfx.validation;

requires org.controlsfx.controls;
requires org.fxmisc.flowless;
requires org.fxmisc.richtext;

requires org.kordamp.ikonli.core;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.materialdesign2;

uses org.kordamp.ikonli.IkonHandler;
uses org.kordamp.ikonli.IkonProvider;

provides org.kordamp.ikonli.IkonHandler
with org.jabref.gui.icon.JabRefIkonHandler;
provides org.kordamp.ikonli.IkonProvider
with org.jabref.gui.icon.JabrefIconProvider;
provides org.kordamp.ikonli.IkonHandler with
org.jabref.gui.icon.JabRefIkonHandler;
provides org.kordamp.ikonli.IkonProvider with
org.jabref.gui.icon.JabrefIconProvider;

requires reactfx;
// endregion
Expand All @@ -52,10 +51,11 @@
requires org.tinylog.api;
requires org.tinylog.api.slf4j;
requires org.tinylog.impl;

// endregion

provides org.tinylog.writers.Writer
with org.jabref.gui.logging.GuiWriter;
provides org.tinylog.writers.Writer with
org.jabref.gui.logging.GuiWriter;

// Preferences and XML
requires java.prefs;
Expand Down Expand Up @@ -100,7 +100,9 @@
requires ojdbc10;
requires org.postgresql.jdbc;
requires org.mariadb.jdbc;

uses org.mariadb.jdbc.credential.CredentialPlugin;

// endregion

// region: Apache Commons and other (similar) helper libraries
Expand All @@ -123,23 +125,17 @@

requires jbibtex;
requires citeproc.java;

requires snuggletex.core;

requires org.apache.pdfbox;
requires org.apache.xmpbox;
requires com.ibm.icu;

requires flexmark;
requires flexmark.html2md.converter;
requires flexmark.util.ast;
requires flexmark.util.data;

requires com.h2database.mvstore;

requires java.keyring;
requires org.freedesktop.dbus;

requires org.jooq.jool;

// region AI
Expand All @@ -153,6 +149,7 @@
requires langchain4j.hugging.face;
requires langchain4j.mistral.ai;
requires langchain4j.open.ai;

uses ai.djl.engine.EngineProvider;
uses ai.djl.repository.RepositoryFactory;
uses ai.djl.repository.zoo.ZooProvider;
Expand All @@ -164,6 +161,7 @@
* In case the version is updated, please also increment {@link org.jabref.model.search.SearchFieldConstants#VERSION} to trigger reindexing.
*/
uses org.apache.lucene.codecs.lucene99.Lucene99Codec;

requires org.apache.lucene.analysis.common;
requires org.apache.lucene.core;
requires org.apache.lucene.highlighter;
Expand All @@ -173,8 +171,8 @@
requires net.harawata.appdirs;
requires com.sun.jna;
requires com.sun.jna.platform;

requires org.eclipse.jgit;

uses org.eclipse.jgit.transport.SshSessionFactory;
uses org.eclipse.jgit.lib.Signer;

Expand All @@ -189,5 +187,5 @@
requires mslinks;
requires org.antlr.antlr4.runtime;
requires org.libreoffice.uno;
// endregion
// endregion
}
Loading

0 comments on commit 814b5c6

Please sign in to comment.