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

Remove obsolete methods #11272

Merged
merged 3 commits into from
May 3, 2024
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
24 changes: 0 additions & 24 deletions src/main/java/org/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -372,25 +369,4 @@ protected static String alignStringTable(List<Pair<String, String>> table) {

return sb.toString();
}

/**
* Creates and wraps a multi-line and colon-seperated string from a List of Strings.
*/
protected static String wrapStringList(List<String> 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();
}
}
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/org/jabref/cli/JabRefCLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,6 @@ void successfulParsingOfBibtexImportLong() throws Exception {
assertEquals(bibtex, cli.getBibtexImport());
}

@Test
void wrapStringList() {
List<String> 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<Pair<String, String>> given = List.of(
Expand Down
Loading