From 09683ed7df4bc03bfd71a4baddc46f77bcb5abb7 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 3 May 2024 20:17:08 +0200 Subject: [PATCH] Remove obsolete methods (#11272) * Remove obsolete method * Remove obsolete CLI parameter "console" * remove l10n --------- Co-authored-by: Siedlerchr --- src/main/java/org/jabref/cli/JabRefCLI.java | 24 ------------------- src/main/resources/l10n/JabRef_en.properties | 1 - .../java/org/jabref/cli/JabRefCLITest.java | 13 ---------- 3 files changed, 38 deletions(-) diff --git a/src/main/java/org/jabref/cli/JabRefCLI.java b/src/main/java/org/jabref/cli/JabRefCLI.java index 3d613468af5..cf78f1a2da2 100644 --- a/src/main/java/org/jabref/cli/JabRefCLI.java +++ b/src/main/java/org/jabref/cli/JabRefCLI.java @@ -189,9 +189,6 @@ private static Options getOptions() { options.addOption("v", "version", false, Localization.lang("Display version")); options.addOption(null, "debug", false, Localization.lang("Show debug level messages")); - // The "-console" option is handled by the install4j launcher - options.addOption(null, "console", false, Localization.lang("Show console output (only when the launcher is used)")); - options.addOption(Option .builder("i") .longOpt("import") @@ -372,25 +369,4 @@ protected static String alignStringTable(List> table) { return sb.toString(); } - - /** - * Creates and wraps a multi-line and colon-seperated string from a List of Strings. - */ - protected static String wrapStringList(List list, int firstLineIndentation) { - StringBuilder builder = new StringBuilder(); - int lastBreak = -firstLineIndentation; - - for (String line : list) { - if (((builder.length() + 2 + line.length()) - lastBreak) > WIDTH) { - builder.append(",\n"); - lastBreak = builder.length(); - builder.append(WRAPPED_LINE_PREFIX); - } else if (builder.length() > 0) { - builder.append(", "); - } - builder.append(line); - } - - return builder.toString(); - } } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index fdb5076f8c5..b8326bbbe12 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1880,7 +1880,6 @@ Could\ not\ copy\ file=Could not copy file Copied\ %0\ files\ of\ %1\ successfully\ to\ %2=Copied %0 files of %1 successfully to %2 Rename\ failed=Rename failed JabRef\ cannot\ access\ the\ file\ because\ it\ is\ being\ used\ by\ another\ process.=JabRef cannot access the file because it is being used by another process. -Show\ console\ output\ (only\ when\ the\ launcher\ is\ used)=Show console output (only when the launcher is used) Remove\ line\ breaks=Remove line breaks Removes\ all\ line\ breaks\ in\ the\ field\ content.=Removes all line breaks in the field content. diff --git a/src/test/java/org/jabref/cli/JabRefCLITest.java b/src/test/java/org/jabref/cli/JabRefCLITest.java index dfcd8478cd7..8fcbbd01013 100644 --- a/src/test/java/org/jabref/cli/JabRefCLITest.java +++ b/src/test/java/org/jabref/cli/JabRefCLITest.java @@ -133,19 +133,6 @@ void successfulParsingOfBibtexImportLong() throws Exception { assertEquals(bibtex, cli.getBibtexImport()); } - @Test - void wrapStringList() { - List given = List.of("html", "simplehtml", "docbook5", "docbook4", "din1505", "bibordf", "tablerefs", "listrefs", - "tablerefsabsbib", "harvard", "iso690rtf", "iso690txt", "endnote", "oocsv", "ris", "misq", "yaml", "bibtexml", "oocalc", "ods", - "MSBib", "mods", "xmp", "pdf", "bib"); - String expected = """ - Available export formats: html, simplehtml, docbook5, docbook4, din1505, bibordf, tablerefs, - listrefs, tablerefsabsbib, harvard, iso690rtf, iso690txt, endnote, oocsv, ris, misq, yaml, bibtexml, - oocalc, ods, MSBib, mods, xmp, pdf, bib"""; - - assertEquals(expected, "Available export formats: " + JabRefCLI.wrapStringList(given, 26)); - } - @Test void alignStringTable() { List> given = List.of(