diff --git a/.gitignore b/.gitignore index eef074f6e45..0e84fabc8b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # no generated files in version control -src/main/gen/ +**/src/main/gen/ # private data /buildres/jabref-cert-2016.p12 @@ -348,3 +348,6 @@ gradle-app.setting # do not distribute Oracle's JDBC driver lib/ojdbc.jar + +# do not ignore the source of the build +!/buildSrc/src/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a8805404d5..eac14594f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We changed the default keyboard shortcuts for moving between entries when the entry editor is active to ̀alt + up/down. - Opening a new file now prompts the directory of the currently selected file, instead of the directory of the last opened file. - Window state is saved on close and restored on start. +- Files without a defined external file type are now directly opened with the default aplication of the operating system - We streamlined the process to rename and move files by removing the confirmation dialogs. @@ -32,6 +33,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# + ### Fixed - We fixed an issue where custom exports could not be selected in the 'Export (selected) entries' dialog [#4013](https://github.com/JabRef/jabref/issues/4013) - Italic text is now rendered correctly. https://github.com/JabRef/jabref/issues/3356 @@ -58,7 +60,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the "Convert to BibTeX-Cleanup" moved the content of the `file` field to the `pdf` field [#4120](https://github.com/JabRef/jabref/issues/4120) - We fixed an issue where the preview pane in entry preview in preferences wasn't showing the citation style selected [#3849](https://github.com/JabRef/jabref/issues/3849) - We fixed an issue where the default entry preview style still contained the field `review`. The field `review` in the style is now replaced with comment to be consistent with the entry editor [#4098](https://github.com/JabRef/jabref/issues/4098) - +- We fixed an issue where users were vulnerable to XXE attacks during parsing [#4229](https://github.com/JabRef/jabref/issues/4229) +- We fixed an issue where files added via the "Attach file" contextmenu of an entry were not made relative. [#4201](https://github.com/JabRef/jabref/issues/4201) diff --git a/build.gradle b/build.gradle index d7b2784ec86..56ca20655f1 100644 --- a/build.gradle +++ b/build.gradle @@ -19,10 +19,10 @@ plugins { id 'com.install4j.gradle' version '7.0.6' id 'com.github.johnrengelman.shadow' version '2.0.4' id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1" - id "com.simonharrer.modernizer" version '1.6.0-1' +// id "com.simonharrer.modernizer" version '1.6.0-1' id 'me.champeau.gradle.jmh' version '0.4.7' id 'com.zyxist.chainsaw' version '0.3.1' - //id 'net.ltgt.errorprone' version '0.0.14' + //id 'net.ltgt.errorprone' version '0.0.15' id 'com.github.ben-manes.versions' version '0.20.0' } @@ -38,20 +38,36 @@ apply plugin: 'project-report' apply plugin: 'jacoco' apply plugin: 'install4j' apply plugin: 'me.champeau.gradle.jmh' -apply plugin: 'checkstyle' +//apply plugin: 'checkstyle' +apply plugin: org.jabref.build.antlr.AntlrPlugin apply from: 'eclipse.gradle' apply from: 'localization.gradle' -apply from: 'xjc.gradle' -group = "org.jabref" -version = "5.0-dev" -project.ext.threeDotVersion = "5.0.0.0" project.ext.install4jDir = hasProperty("install4jDir") ? getProperty("install4jDir") : (OperatingSystem.current().isWindows() ? 'C:/Program Files/install4j7' : 'install4j7') -sourceCompatibility = 9 -targetCompatibility = 9 mainClassName = "org.jabref.JabRefMain" +allprojects { + group = "org.jabref" + version = "5.0-dev" + project.ext.threeDotVersion = "5.0.0.0" + + sourceCompatibility = 9 + targetCompatibility = 9 + + repositories { + mavenLocal() + jcenter() + maven { + url 'https://oss.sonatype.org/content/groups/public' + } + } + + tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + } +} + javaModule { name = "org.jabref" hacks { @@ -69,36 +85,25 @@ ext.allowJava9 = true sourceSets { main { - java { - srcDirs = ["src/main/java", "src/main/gen"] - } - resources { srcDirs = ["src/main/java", "src/main/resources"] } } } -repositories { - mavenLocal() - jcenter() - maven { - url 'https://oss.sonatype.org/content/groups/public' - } -} - configurations { - antlr3 - antlr4 - compile { exclude group: 'com.google.code.findbugs', module: 'jsr305' } } +// FIXME: bug in chainsaw does not build multi module projects in right order +compileJava.dependsOn ":jabref-model:assemble" +compileJava.dependsOn ":jabref-logic:assemble" + dependencies { - // Include all jar-files in the 'lib' folder as dependencies - compile fileTree(dir: 'lib', includes: ['*.jar']) + compile project(':jabref-model') + compile project(':jabref-logic') compile 'com.jgoodies:jgoodies-common:1.8.1' compile 'com.jgoodies:jgoodies-forms:1.9.0' @@ -118,20 +123,6 @@ dependencies { compile "org.libreoffice:ridl:5.4.2" compile "org.libreoffice:unoil:5.4.2"*/ - compile 'io.github.java-diff-utils:java-diff-utils:2.2.0' - compile 'info.debatty:java-string-similarity:1.1.0' - - antlr3 'org.antlr:antlr:3.5.2' - compile 'org.antlr:antlr-runtime:3.5.2' - - antlr4 'org.antlr:antlr4:4.7.1' - compile 'org.antlr:antlr4-runtime:4.7.1' - - // VersionEye states that 6.0.5 is the most recent version, but http://dev.mysql.com/downloads/connector/j/ shows that as "Development Release" - compile 'mysql:mysql-connector-java:5.1.46' - - compile 'org.postgresql:postgresql:42.2.4' - compile 'net.java.dev.glazedlists:glazedlists_java15:1.9.1' compile 'com.google.guava:guava:25.1-jre' @@ -139,22 +130,17 @@ dependencies { compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' // JavaFX stuff - compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4' - compile 'de.jensd:fontawesomefx-commons:9.1.2' compile 'de.saxsys:mvvmfx-validation:1.7.0' compile 'de.saxsys:mvvmfx:1.7.0' compile 'org.fxmisc.easybind:easybind:1.0.3' compile 'org.fxmisc.flowless:flowless:0.6.1' - compile 'org.fxmisc.richtext:richtextfx:0.9.0' + compile 'org.fxmisc.richtext:richtextfx:0.9.1' // compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1' compile 'javax.inject:javax.inject:1' // Cannot be updated to 9.*.* until Jabref works with Java 9 compile 'org.controlsfx:controlsfx:9.0.0' - compile 'org.jsoup:jsoup:1.11.3' - compile 'com.mashape.unirest:unirest-java:1.4.9' - // >1.8.0-beta is required for java 9 compatibility compile 'org.slf4j:slf4j-api:1.8.0-beta2' compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.0' @@ -165,11 +151,6 @@ dependencies { // need to use snapshots as the stable version is from 2013 and doesn't support v1.0.1 CitationStyles compile 'org.citationstyles:styles:1.0.1-SNAPSHOT' compile 'org.citationstyles:locales:1.0.1-SNAPSHOT' - compile 'de.undercouch:citeproc-java:1.0.1' - - // JAX-B is considered JavaEE API and is no longer part of JavaSE (JDK 9) - compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0' - compile group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0' // TODO: recognized as 'latex2unicode.2.12', which is an invalid module name, temporarily removed // compile 'com.github.tomtung:latex2unicode_2.12:0.2.2' @@ -186,17 +167,17 @@ dependencies { testCompile 'org.junit-pioneer:junit-pioneer:0.1.2' testRuntime 'org.apache.logging.log4j:log4j-core:2.11.0' testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.0' - testCompile 'org.mockito:mockito-core:2.19.1' + testCompile 'org.mockito:mockito-core:2.20.0' testCompile 'com.github.tomakehurst:wiremock:2.18.0' testCompile 'org.assertj:assertj-swing-junit:3.8.0' testCompile 'org.reflections:reflections:0.9.11' testCompile 'org.xmlunit:xmlunit-core:2.6.0' testCompile 'org.xmlunit:xmlunit-matchers:2.6.0' - testCompile 'com.tngtech.archunit:archunit-junit:0.8.2' + testCompile 'com.tngtech.archunit:archunit-junit:0.8.3' testCompile "org.testfx:testfx-core:4.0.+" testCompile "org.testfx:testfx-junit5:4.0.+" - checkstyle 'com.puppycrawl.tools:checkstyle:8.11' +// checkstyle 'com.puppycrawl.tools:checkstyle:8.11' } jacoco { @@ -256,80 +237,18 @@ clean { processResources { filteringCharset = 'UTF-8' - filesMatching("build.properties") { - expand(version: project.version, - "year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)), - "authors": new File('AUTHORS').readLines().findAll { !it.startsWith("#") }.join(", "), - "developers": new File('DEVELOPERS').readLines().findAll { !it.startsWith("#") }.join(", "), - "azureInstrumentationKey": System.getenv('AzureInstrumentationKey'), - "minRequiredJavaVersion": minRequiredJavaVersion, - "allowJava9": allowJava9 - - ) - filteringCharset = 'UTF-8' - } - filesMatching("resource/**/meta.xml") { expand version: project.version } } - -task generateSource(dependsOn: ["generateBstGrammarSource", "generateSearchGrammarSource"]) { - group = 'JabRef' - description 'Generates all Java source files.' -} - -task generateBstGrammarSource(type: JavaExec) { - group 'JabRef' - description 'Generates BstLexer.java and BstParser.java from the Bst.g grammar file using antlr3.' - - File antlrSource = file('src/main/antlr3/org/jabref/bst/Bst.g') - - inputs.file antlrSource - outputs.file file('src/main/gen/org/jabref/logic/bst/BstLexer.java') - outputs.file file('src/main/gen/org/jabref/logic/bst/BstParser.java') - - main = 'org.antlr.Tool' - classpath = configurations.antlr3 - args = ["-o", file('src/main/gen/org/jabref/logic/bst/'), antlrSource] -} - -task generateSearchGrammarSource(type: JavaExec) { - String grammarFile = "Search" - - group 'JabRef' - description "Generates java files for ${grammarFile}.g antlr4." - - String packagePath = "org/jabref/search" - File antlrPath = file("src/main/antlr4") - File genPath = file("src/main/gen") - - File antlrSource = file("$antlrPath/$packagePath/${grammarFile}.g4") - File destinationDir = file("$genPath/$packagePath") - - inputs.file antlrSource - outputs.file file("$destinationDir/${grammarFile}Parser.java") - outputs.file file("$destinationDir/${grammarFile}Lexer.java") - outputs.file file("$destinationDir/${grammarFile}Visitor.java") - outputs.file file("$destinationDir/${grammarFile}BaseVisitor.java") - outputs.file file("$destinationDir/${grammarFile}.tokens") - outputs.file file("$destinationDir/${grammarFile}Lexer.tokens") - - main = 'org.antlr.v4.Tool' - classpath = configurations.antlr4 - args = ["-o", destinationDir, "-visitor", "-no-listener", "-package", "org.jabref.search", antlrSource] +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' // use UTF-8 for regular and test compilation } compileJava { - options.encoding = 'UTF-8' options.compilerArgs << "-Xlint:none" } -compileJava.dependsOn "generateSource" - -compileTestJava { - options.encoding = 'UTF-8' -} javadoc { options { @@ -401,20 +320,20 @@ jacocoTestReport { } // Code quality tasks -checkstyle { - // do not use other packages for checkstyle, excluding gen(erated) sources - checkstyleMain.source = "src/main/java" - toolVersion = '8.5' - - // do not perform checkstyle checks by default - sourceSets = [] -} - -modernizer { - // We have more than 20 issues, which are not fixed yet. Nevertheless, we produce the modernizer output. - // See https://github.com/andrewgaul/modernizer-maven-plugin for more information on modernizer - failOnViolations = false -} +//checkstyle { +// // do not use other packages for checkstyle, excluding gen(erated) sources +// checkstyleMain.source = "src/main/java" +// toolVersion = '8.5' +// +// // do not perform checkstyle checks by default +// sourceSets = [] +//} +// +//modernizer { +// // We have more than 20 issues, which are not fixed yet. Nevertheless, we produce the modernizer output. +// // See https://github.com/andrewgaul/modernizer-maven-plugin for more information on modernizer +// failOnViolations = false +//} // Release tasks shadowJar { diff --git a/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr3CommandLine.groovy b/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr3CommandLine.groovy new file mode 100644 index 00000000000..48213e8f07e --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr3CommandLine.groovy @@ -0,0 +1,27 @@ +package org.jabref.build.antlr + +import org.gradle.api.file.FileCollection + +class Antlr3CommandLine implements AntlrCommandLine { + + private final task + + Antlr3CommandLine(AntlrTask task) { + this.task = task + } + + @Override + String getMain() { + return "org.antlr.Tool" + } + + @Override + FileCollection getClasspath() { + return task.project.configurations.antlr3 + } + + @Override + List getArguments() { + return ["-o", task.project.file(task.outputDir).toString(), task.project.file(task.inputFile).toString()] + } +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr4CommandLine.groovy b/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr4CommandLine.groovy new file mode 100644 index 00000000000..6c74a04ad88 --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr4CommandLine.groovy @@ -0,0 +1,31 @@ +package org.jabref.build.antlr + +import org.gradle.api.file.FileCollection + +class Antlr4CommandLine implements AntlrCommandLine { + + private final AntlrTask task + + Antlr4CommandLine(AntlrTask task) { + this.task = task + } + + @Override + String getMain() { + return "org.antlr.v4.Tool" + } + + @Override + FileCollection getClasspath() { + return task.project.configurations.antlr4 + } + + @Override + List getArguments() { + return ["-o", file(task.outputDir), "-visitor", "-no-listener", "-package", task.javaPackage, file(task.inputFile)] + } + + private String file(String path) { + return task.project.file(path).toString() + } +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrCommandLine.groovy b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrCommandLine.groovy new file mode 100644 index 00000000000..bcfe0ecc371 --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrCommandLine.groovy @@ -0,0 +1,16 @@ +package org.jabref.build.antlr + +import org.gradle.api.file.FileCollection + +/** + * Encapsulates a command line call to an version of the ANTLR tools. + */ +interface AntlrCommandLine { + + String getMain() + + FileCollection getClasspath() + + List getArguments() + +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrPlugin.groovy b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrPlugin.groovy new file mode 100644 index 00000000000..ce9a7301445 --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrPlugin.groovy @@ -0,0 +1,23 @@ +package org.jabref.build.antlr + +import org.gradle.api.Plugin +import org.gradle.api.Project + +/** + * Configures the project for use with ANTLR 3 or 4. + */ +class AntlrPlugin implements Plugin { + + public static final def ANTLR3_CONFIGURATION_NAME = "antlr3" + public static final def ANTLR4_CONFIGURATION_NAME = "antlr4" + + @Override + void apply(Project target) { + def antlr3Cfg = target.configurations.create(ANTLR3_CONFIGURATION_NAME) + antlr3Cfg.description = "Dependencies required to run the ANTLR3 tool." + + def antlr4Cfg = target.configurations.create(ANTLR4_CONFIGURATION_NAME) + antlr4Cfg.description = "Dependencies required to run the ANTLR4 tool." + } + +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrTask.groovy b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrTask.groovy new file mode 100644 index 00000000000..6ff19a1a02f --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrTask.groovy @@ -0,0 +1,68 @@ +package org.jabref.build.antlr + +import org.gradle.api.tasks.JavaExec +import org.gradle.api.tasks.TaskAction + +class AntlrTask extends JavaExec { + + static def ANTLR3 = Antlr3CommandLine + static def ANTLR4 = Antlr4CommandLine + + private Class antlr = ANTLR3 + private String inputFile = "" + private String outputDir = "" + private String javaPackage = "" + + public AntlrTask() { + project.configurations { + antlr3 + antlr4 + } + } + + @TaskAction + @Override + void exec() { + AntlrCommandLine commandLine = antlr.newInstance(this) + + main = commandLine.main + classpath = commandLine.classpath + args = commandLine.arguments + + super.exec() + } + + Class getAntlr() { + return antlr + } + + void setAntlr(Class antlr) { + this.antlr = antlr + } + + String getInputFile() { + return inputFile + } + + void setInputFile(String inputFile) { + this.inputFile = inputFile + inputs.file(inputFile) + } + + String getOutputDir() { + return outputDir + } + + void setOutputDir(String outputDir) { + this.outputDir = outputDir + outputs.dir(outputDir) + } + + String getJavaPackage() { + return javaPackage + } + + void setJavaPackage(String javaPackage) { + this.javaPackage = javaPackage + } +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcPlugin.groovy b/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcPlugin.groovy new file mode 100644 index 00000000000..72e2c3644a7 --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcPlugin.groovy @@ -0,0 +1,20 @@ +package org.jabref.build.xjc + +import org.gradle.api.Plugin +import org.gradle.api.Project + +class XjcPlugin implements Plugin { + + static final def CONFIGURATION_NAME = "xjc" + + @Override + void apply(Project target) { + def configuration = target.configurations.create(CONFIGURATION_NAME) + configuration.description = "Dependencies needed to run the XJC tool." + + target.afterEvaluate { evaluated -> + evaluated.logger.info(evaluated.configurations.xjc.asPath) + evaluated.ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: evaluated.configurations.getByName(CONFIGURATION_NAME).asPath) + } + } +} diff --git a/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcTask.groovy b/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcTask.groovy new file mode 100644 index 00000000000..bb859ea10c1 --- /dev/null +++ b/buildSrc/src/main/groovy/org/jabref/build/xjc/XjcTask.groovy @@ -0,0 +1,93 @@ +package org.jabref.build.xjc + +import org.gradle.api.DefaultTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.TaskAction + +class XjcTask extends DefaultTask { + + private def schemaFile + @Optional + private def bindingFile + private def outputDirectory + private String javaPackage + @Optional + private String arguments + + @TaskAction + def generateClasses() { + project.mkdir(outputDirectory) + project.ant.xjc(destdir: outputDirectory, package: javaPackage) { + schema(dir: schemaFile.getParent(), includes: schemaFile.getName()) + if (bindingFile != null) { + binding(dir: bindingFile.getParent(), includes: bindingFile.getName()) + } + if (arguments != null) { + arg(value: arguments) + } + } + } + + @Input + File getSchemaFile() { + if (schemaFile == null) { + return null + } + return project.file(schemaFile) + } + + void setSchemaFile(Object schemaFile) { + this.schemaFile = schemaFile + } + + File getOutputDirectory() { + if (outputDirectory == null) { + return null + } + return project.file(outputDirectory) + } + + void setOutputDirectory(Object outputDirectory) { + this.outputDirectory = outputDirectory + updateOutput() + } + + String getJavaPackage() { + return javaPackage + } + + void setJavaPackage(String javaPackage) { + this.javaPackage = javaPackage + updateOutput() + } + + String getArguments() { + return arguments + } + + void setArguments(String args) { + this.arguments = args + } + + @Input + File getBindingFile() { + if (bindingFile == null) { + return null + } + return project.file(bindingFile) + } + + void setBindingFile(Object binding) { + this.bindingFile = binding + } + + private void updateOutput() { + if (outputDirectory != null && javaPackage != null) + outputs.dir(new File(getOutputDirectory(), packageAsPath(javaPackage))) + } + + private static String packageAsPath(String pkg) { + return pkg.replace((char) '.', File.separatorChar) + } +} diff --git a/jabref-logic/build.gradle b/jabref-logic/build.gradle new file mode 100644 index 00000000000..e6a86082dad --- /dev/null +++ b/jabref-logic/build.gradle @@ -0,0 +1,154 @@ +import org.jabref.build.xjc.XjcPlugin +import org.jabref.build.xjc.XjcTask + +plugins { + id 'com.zyxist.chainsaw' +} + +apply plugin: 'java' +apply plugin: org.jabref.build.antlr.AntlrPlugin +apply plugin: XjcPlugin + +sourceSets.main.java.srcDirs += "src/main/gen" +sourceSets.main.resources.srcDirs += "src/main/java" + +repositories { + mavenLocal() + jcenter() + maven { + url 'https://oss.sonatype.org/content/groups/public' + } +} + +// FIXME: bug in chainsaw does not build multi module projects in right order +compileJava.dependsOn ":jabref-model:assemble" +compileTestJava.dependsOn ":jabref-testutils:assemble" + +dependencies { + compile project(':jabref-model') + + // Include all jar-files in the 'lib' folder as dependencies + compile fileTree(dir: '../lib', includes: ['*.jar']) + + compile 'io.github.java-diff-utils:java-diff-utils:2.2.0' + compile 'info.debatty:java-string-similarity:1.1.0' + + antlr3 'org.antlr:antlr:3.5.2' + compile 'org.antlr:antlr-runtime:3.5.2' + + // VersionEye states that 6.0.5 is the most recent version, but http://dev.mysql.com/downloads/connector/j/ shows that as "Development Release" + compile 'mysql:mysql-connector-java:5.1.46' + + compile 'org.postgresql:postgresql:42.2.4' + + // JavaFX stuff + compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4' + compile 'de.jensd:fontawesomefx-commons:9.1.2' + + // >1.8.0-beta is required for java 9 compatibility + compile 'org.slf4j:slf4j-api:1.8.0-beta2' + compile 'org.apache.logging.log4j:log4j-api:2.11.0' + compile 'org.apache.logging.log4j:log4j-core:2.11.0' + + compile 'org.jsoup:jsoup:1.11.3' + compile 'com.mashape.unirest:unirest-java:1.4.9' + + compile 'de.undercouch:citeproc-java:1.0.1' + + // JAX-B is considered JavaEE API and is no longer part of JavaSE (JDK 9) + compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0' + compile group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0' + + xjc "com.sun.xml.bind:jaxb-xjc:2.2.4-1" + + + testCompile project(':jabref-testutils') + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0' + testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.2.0' + testCompile 'org.junit.platform:junit-platform-launcher:1.2.0' + testCompile 'org.junit-pioneer:junit-pioneer:0.1.2' + testRuntime 'org.apache.logging.log4j:log4j-core:2.11.0' + testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.0' + testCompile 'org.mockito:mockito-core:2.20.0' + testCompile 'com.github.tomakehurst:wiremock:2.18.0' + testCompile 'org.assertj:assertj-swing-junit:3.8.0' + testCompile 'org.reflections:reflections:0.9.11' + testCompile 'org.xmlunit:xmlunit-core:2.6.0' + testCompile 'org.xmlunit:xmlunit-matchers:2.6.0' + testCompile 'com.tngtech.archunit:archunit-junit:0.8.3' + testCompile "org.testfx:testfx-core:4.0.+" + testCompile "org.testfx:testfx-junit5:4.0.+" +} + +processResources { + filteringCharset = 'UTF-8' + + filesMatching("build.properties") { + expand(version: project.version, + "year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)), + "authors": new File('AUTHORS').readLines().findAll { !it.startsWith("#") }.join(", "), + "developers": new File('DEVELOPERS').readLines().findAll { !it.startsWith("#") }.join(", "), + "azureInstrumentationKey": System.getenv('AzureInstrumentationKey'), + "minRequiredJavaVersion": minRequiredJavaVersion, + "allowJava9": allowJava9 + ) + filteringCharset = 'UTF-8' + } +} + +compileJava.dependsOn "generateSource" + +task generateSource(dependsOn: ["generateBstGrammarSource", + "generateMedlineSource", + "generateBibtexmlSource", + "generateEndnoteSource", + "generateModsSource"]) { + group = 'JabRef' + description 'Generates all Java source files.' +} + +task generateBstGrammarSource(type: org.jabref.build.antlr.AntlrTask) { + group = "JabRef" + description = 'Generates BstLexer.java and BstParser.java from the Bst.g grammar file using antlr3.' + antlr = ANTLR3 + inputFile = 'src/main/antlr3/org/jabref/bst/Bst.g' + outputDir = 'src/main/gen/org/jabref/logic/bst/' +} + +task generateMedlineSource(type: XjcTask) { + group = 'JabRef' + description = "Generates java files for the medline importer." + schemaFile = "src/main/resources/xjc/medline/medline.xsd" + outputDirectory = "src/main/gen/" + javaPackage = "org.jabref.logic.importer.fileformat.medline" +} + +task generateBibtexmlSource(type: XjcTask) { + group = 'JabRef' + description = "Generates java files for the bibtexml importer." + schemaFile = "src/main/resources/xjc/bibtexml/bibtexml.xsd" + outputDirectory = "src/main/gen" + javaPackage = "org.jabref.logic.importer.fileformat.bibtexml" +} + +task generateEndnoteSource(type: XjcTask) { + group = 'JabRef' + description = "Generates java files for the endnote importer." + schemaFile = "src/main/resources/xjc/endnote/RSXML.dtd" + outputDirectory = "src/main/gen/" + javaPackage = "org.jabref.logic.importer.fileformat.endnote" + arguments = '-dtd' +} + +task generateModsSource(type: XjcTask) { + group = 'JabRef' + description = "Generates java files for the mods importer." + schemaFile = "src/main/resources/xjc/mods/mods-3-7.xsd" + bindingFile = "src/main/resources/xjc/mods/mods-binding.xjb" + outputDirectory = "src/main/gen/" + javaPackage = "org.jabref.logic.importer.fileformat.mods" + arguments = '-npa' +} + diff --git a/src/main/antlr3/org/jabref/bst/Bst.g b/jabref-logic/src/main/antlr3/org/jabref/bst/Bst.g similarity index 100% rename from src/main/antlr3/org/jabref/bst/Bst.g rename to jabref-logic/src/main/antlr3/org/jabref/bst/Bst.g diff --git a/jabref-logic/src/main/java/module-info.java b/jabref-logic/src/main/java/module-info.java new file mode 100644 index 00000000000..e1ba762a708 --- /dev/null +++ b/jabref-logic/src/main/java/module-info.java @@ -0,0 +1,77 @@ +open module org.jabref.logic { + + exports org.jabref.logic; + exports org.jabref.logic.auxparser; + exports org.jabref.logic.bibtex; + exports org.jabref.logic.bibtex.comparator; + exports org.jabref.logic.bibtexkeypattern; + exports org.jabref.logic.bst; + exports org.jabref.logic.citationstyle; + exports org.jabref.logic.cleanup; + exports org.jabref.logic.exporter; + exports org.jabref.logic.formatter; + exports org.jabref.logic.formatter.bibtexfields; + exports org.jabref.logic.formatter.casechanger; + exports org.jabref.logic.formatter.minifier; + exports org.jabref.logic.groups; + exports org.jabref.logic.help; + exports org.jabref.logic.importer; + exports org.jabref.logic.importer.fetcher; + exports org.jabref.logic.importer.fileformat; + exports org.jabref.logic.importer.fileformat.bibtexml; + exports org.jabref.logic.importer.fileformat.endnote; + exports org.jabref.logic.importer.fileformat.medline; + exports org.jabref.logic.importer.fileformat.mods; + exports org.jabref.logic.importer.util; + exports org.jabref.logic.integrity; + exports org.jabref.logic.journals; + exports org.jabref.logic.l10n; + exports org.jabref.logic.layout; + exports org.jabref.logic.layout.format; + exports org.jabref.logic.logging; + exports org.jabref.logic.migrations; + exports org.jabref.logic.msbib; + exports org.jabref.logic.net; + exports org.jabref.logic.openoffice; + exports org.jabref.logic.pdf; + exports org.jabref.logic.preferences; + exports org.jabref.logic.protectedterms; + exports org.jabref.logic.remote; + exports org.jabref.logic.remote.client; + exports org.jabref.logic.remote.server; + exports org.jabref.logic.remote.shared; + exports org.jabref.logic.search; + exports org.jabref.logic.shared; + exports org.jabref.logic.shared.exception; + exports org.jabref.logic.shared.event; + exports org.jabref.logic.shared.listener; + exports org.jabref.logic.shared.prefs; + exports org.jabref.logic.shared.security; + exports org.jabref.logic.specialfields; + exports org.jabref.logic.undo; + exports org.jabref.logic.util; + exports org.jabref.logic.util.io; + exports org.jabref.logic.util.strings; + exports org.jabref.logic.xmp; + + requires org.jabref.model; + + // automatic modules + + requires de.jensd.fx.glyphs.commons; + + requires org.slf4j; + requires org.apache.logging.log4j; + + requires com.google.common; + + requires java.desktop; + requires java.prefs; + requires java.sql; + requires java.xml; + requires java.xml.bind; + + requires javafx.base; + requires javafx.graphics; + +} diff --git a/src/main/java/oracle/jdbc/OracleConnection.java b/jabref-logic/src/main/java/oracle/jdbc/OracleConnection.java similarity index 100% rename from src/main/java/oracle/jdbc/OracleConnection.java rename to jabref-logic/src/main/java/oracle/jdbc/OracleConnection.java diff --git a/src/main/java/oracle/jdbc/OracleStatement.java b/jabref-logic/src/main/java/oracle/jdbc/OracleStatement.java similarity index 100% rename from src/main/java/oracle/jdbc/OracleStatement.java rename to jabref-logic/src/main/java/oracle/jdbc/OracleStatement.java diff --git a/src/main/java/oracle/jdbc/dcn/DatabaseChangeEvent.java b/jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeEvent.java similarity index 100% rename from src/main/java/oracle/jdbc/dcn/DatabaseChangeEvent.java rename to jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeEvent.java diff --git a/src/main/java/oracle/jdbc/dcn/DatabaseChangeListener.java b/jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeListener.java similarity index 100% rename from src/main/java/oracle/jdbc/dcn/DatabaseChangeListener.java rename to jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeListener.java diff --git a/src/main/java/oracle/jdbc/dcn/DatabaseChangeRegistration.java b/jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeRegistration.java similarity index 100% rename from src/main/java/oracle/jdbc/dcn/DatabaseChangeRegistration.java rename to jabref-logic/src/main/java/oracle/jdbc/dcn/DatabaseChangeRegistration.java diff --git a/src/main/java/oracle/jdbc/driver/OracleDriver.java b/jabref-logic/src/main/java/oracle/jdbc/driver/OracleDriver.java similarity index 100% rename from src/main/java/oracle/jdbc/driver/OracleDriver.java rename to jabref-logic/src/main/java/oracle/jdbc/driver/OracleDriver.java diff --git a/src/main/java/oracle/jdbc/package-info.java b/jabref-logic/src/main/java/oracle/jdbc/package-info.java similarity index 100% rename from src/main/java/oracle/jdbc/package-info.java rename to jabref-logic/src/main/java/oracle/jdbc/package-info.java diff --git a/src/main/java/org/jabref/FallbackExceptionHandler.java b/jabref-logic/src/main/java/org/jabref/logic/FallbackExceptionHandler.java similarity index 95% rename from src/main/java/org/jabref/FallbackExceptionHandler.java rename to jabref-logic/src/main/java/org/jabref/logic/FallbackExceptionHandler.java index ef65037ee54..a588c956bdf 100644 --- a/src/main/java/org/jabref/FallbackExceptionHandler.java +++ b/jabref-logic/src/main/java/org/jabref/logic/FallbackExceptionHandler.java @@ -1,4 +1,4 @@ -package org.jabref; +package org.jabref.logic; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/JabRefException.java b/jabref-logic/src/main/java/org/jabref/logic/JabRefException.java similarity index 97% rename from src/main/java/org/jabref/JabRefException.java rename to jabref-logic/src/main/java/org/jabref/logic/JabRefException.java index 0c312fc10df..1c465accd5c 100644 --- a/src/main/java/org/jabref/JabRefException.java +++ b/jabref-logic/src/main/java/org/jabref/logic/JabRefException.java @@ -1,4 +1,4 @@ -package org.jabref; +package org.jabref.logic; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/JabRefExecutorService.java b/jabref-logic/src/main/java/org/jabref/logic/JabRefExecutorService.java similarity index 99% rename from src/main/java/org/jabref/JabRefExecutorService.java rename to jabref-logic/src/main/java/org/jabref/logic/JabRefExecutorService.java index df127df89f6..9be4c5a099b 100644 --- a/src/main/java/org/jabref/JabRefExecutorService.java +++ b/jabref-logic/src/main/java/org/jabref/logic/JabRefExecutorService.java @@ -1,4 +1,4 @@ -package org.jabref; +package org.jabref.logic; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/org/jabref/logic/TypedBibEntry.java b/jabref-logic/src/main/java/org/jabref/logic/TypedBibEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/TypedBibEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/TypedBibEntry.java diff --git a/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java b/jabref-logic/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java similarity index 100% rename from src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java rename to jabref-logic/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java diff --git a/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java diff --git a/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java diff --git a/src/main/java/org/jabref/logic/bibtex/FieldContentParser.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/FieldContentParser.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/FieldContentParser.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/FieldContentParser.java diff --git a/src/main/java/org/jabref/logic/bibtex/FieldContentParserPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/FieldContentParserPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/FieldContentParserPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/FieldContentParserPreferences.java diff --git a/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java diff --git a/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java diff --git a/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatterPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatterPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/LatexFieldFormatterPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatterPreferences.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibEntryDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibEntryDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/BibEntryDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibEntryDiff.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java b/jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java b/jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternPreferences.java diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java b/jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java similarity index 100% rename from src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java rename to jabref-logic/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java diff --git a/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java b/jabref-logic/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java diff --git a/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java diff --git a/src/main/java/org/jabref/logic/bst/BibtexPurify.java b/jabref-logic/src/main/java/org/jabref/logic/bst/BibtexPurify.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/BibtexPurify.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/BibtexPurify.java diff --git a/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java b/jabref-logic/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java diff --git a/src/main/java/org/jabref/logic/bst/BibtexWidth.java b/jabref-logic/src/main/java/org/jabref/logic/bst/BibtexWidth.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/BibtexWidth.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/BibtexWidth.java diff --git a/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java b/jabref-logic/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java diff --git a/src/main/java/org/jabref/logic/bst/FormatNameFunction.java b/jabref-logic/src/main/java/org/jabref/logic/bst/FormatNameFunction.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/FormatNameFunction.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/FormatNameFunction.java diff --git a/src/main/java/org/jabref/logic/bst/PurifyFunction.java b/jabref-logic/src/main/java/org/jabref/logic/bst/PurifyFunction.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/PurifyFunction.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/PurifyFunction.java diff --git a/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java b/jabref-logic/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/TextPrefixFunction.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java diff --git a/src/main/java/org/jabref/logic/bst/VM.java b/jabref-logic/src/main/java/org/jabref/logic/bst/VM.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/VM.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/VM.java diff --git a/src/main/java/org/jabref/logic/bst/VMException.java b/jabref-logic/src/main/java/org/jabref/logic/bst/VMException.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/VMException.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/VMException.java diff --git a/src/main/java/org/jabref/logic/bst/Warn.java b/jabref-logic/src/main/java/org/jabref/logic/bst/Warn.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/Warn.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/Warn.java diff --git a/src/main/java/org/jabref/logic/bst/WidthFunction.java b/jabref-logic/src/main/java/org/jabref/logic/bst/WidthFunction.java similarity index 100% rename from src/main/java/org/jabref/logic/bst/WidthFunction.java rename to jabref-logic/src/main/java/org/jabref/logic/bst/WidthFunction.java diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/jabref-logic/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java similarity index 100% rename from src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java rename to jabref-logic/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java b/jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java similarity index 100% rename from src/main/java/org/jabref/logic/citationstyle/CitationStyle.java rename to jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java b/jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java similarity index 100% rename from src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java rename to jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java b/jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java similarity index 100% rename from src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java rename to jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleOutputFormat.java b/jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleOutputFormat.java similarity index 100% rename from src/main/java/org/jabref/logic/citationstyle/CitationStyleOutputFormat.java rename to jabref-logic/src/main/java/org/jabref/logic/citationstyle/CitationStyleOutputFormat.java diff --git a/src/main/java/org/jabref/logic/cleanup/CleanupPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/CleanupPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupPreferences.java diff --git a/src/main/java/org/jabref/logic/cleanup/CleanupPreset.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupPreset.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/CleanupPreset.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupPreset.java diff --git a/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/CleanupWorker.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java diff --git a/src/main/java/org/jabref/logic/cleanup/Cleanups.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/Cleanups.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/Cleanups.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/Cleanups.java diff --git a/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/DoiCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java diff --git a/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java b/jabref-logic/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java similarity index 100% rename from src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java rename to jabref-logic/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java diff --git a/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java diff --git a/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java diff --git a/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java diff --git a/src/main/java/org/jabref/logic/exporter/Exporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/Exporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/Exporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/Exporter.java diff --git a/src/main/java/org/jabref/logic/exporter/ExporterFactory.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/ExporterFactory.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/ExporterFactory.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/ExporterFactory.java diff --git a/src/main/java/org/jabref/logic/exporter/FileSaveSession.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/FileSaveSession.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/FileSaveSession.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/FileSaveSession.java diff --git a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/GroupSerializer.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/GroupSerializer.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/GroupSerializer.java diff --git a/src/main/java/org/jabref/logic/exporter/MSBibExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/MSBibExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/MSBibExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/MSBibExporter.java diff --git a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java diff --git a/src/main/java/org/jabref/logic/exporter/ModsExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/ModsExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/ModsExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/ModsExporter.java diff --git a/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java diff --git a/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java diff --git a/src/main/java/org/jabref/logic/exporter/SaveException.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/SaveException.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/SaveException.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/SaveException.java diff --git a/src/main/java/org/jabref/logic/exporter/SavePreferences.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/SavePreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/SavePreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/SavePreferences.java diff --git a/src/main/java/org/jabref/logic/exporter/SaveSession.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/SaveSession.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/SaveSession.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/SaveSession.java diff --git a/src/main/java/org/jabref/logic/exporter/StringSaveSession.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/StringSaveSession.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/StringSaveSession.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/StringSaveSession.java diff --git a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/TemplateExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/TemplateExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/TemplateExporter.java diff --git a/src/main/java/org/jabref/logic/exporter/VerifyingWriter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/VerifyingWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/VerifyingWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/VerifyingWriter.java diff --git a/src/main/java/org/jabref/logic/exporter/XmpExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/XmpExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/XmpExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/XmpExporter.java diff --git a/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java b/jabref-logic/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java similarity index 100% rename from src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java rename to jabref-logic/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java diff --git a/src/main/java/org/jabref/logic/formatter/Formatters.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/Formatters.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/Formatters.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/Formatters.java diff --git a/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/IdentityFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/Title.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/Title.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/Title.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/Title.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatter.java diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/Word.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/Word.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/casechanger/Word.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/casechanger/Word.java diff --git a/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java diff --git a/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java b/jabref-logic/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java similarity index 100% rename from src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java rename to jabref-logic/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java diff --git a/src/main/java/org/jabref/logic/help/HelpFile.java b/jabref-logic/src/main/java/org/jabref/logic/help/HelpFile.java similarity index 100% rename from src/main/java/org/jabref/logic/help/HelpFile.java rename to jabref-logic/src/main/java/org/jabref/logic/help/HelpFile.java diff --git a/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/FetcherException.java b/jabref-logic/src/main/java/org/jabref/logic/importer/FetcherException.java similarity index 91% rename from src/main/java/org/jabref/logic/importer/FetcherException.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/FetcherException.java index 23bd9fc6826..1dd697ef8ab 100644 --- a/src/main/java/org/jabref/logic/importer/FetcherException.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/FetcherException.java @@ -1,6 +1,6 @@ package org.jabref.logic.importer; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; public class FetcherException extends JabRefException { diff --git a/src/main/java/org/jabref/logic/importer/FetcherResult.java b/jabref-logic/src/main/java/org/jabref/logic/importer/FetcherResult.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/FetcherResult.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/FetcherResult.java diff --git a/src/main/java/org/jabref/logic/importer/FulltextFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/FulltextFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/FulltextFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/FulltextFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java b/jabref-logic/src/main/java/org/jabref/logic/importer/FulltextFetchers.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/FulltextFetchers.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/FulltextFetchers.java index 99f0693db2b..43e346311b5 100644 --- a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/FulltextFetchers.java @@ -16,7 +16,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.logic.net.URLDownload; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; diff --git a/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/IdBasedFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/IdFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/IdFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/IdFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/IdFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/IdParserFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/IdParserFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/IdParserFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/IdParserFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/ImportException.java b/jabref-logic/src/main/java/org/jabref/logic/importer/ImportException.java similarity index 89% rename from src/main/java/org/jabref/logic/importer/ImportException.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/ImportException.java index 061d74442a0..cecee2afa36 100644 --- a/src/main/java/org/jabref/logic/importer/ImportException.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/ImportException.java @@ -1,6 +1,6 @@ package org.jabref.logic.importer; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; public class ImportException extends JabRefException { diff --git a/src/main/java/org/jabref/logic/importer/ImportFormatPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/importer/ImportFormatPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/ImportFormatPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/ImportFormatPreferences.java diff --git a/src/main/java/org/jabref/logic/importer/ImportFormatReader.java b/jabref-logic/src/main/java/org/jabref/logic/importer/ImportFormatReader.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/ImportFormatReader.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/ImportFormatReader.java diff --git a/src/main/java/org/jabref/logic/importer/Importer.java b/jabref-logic/src/main/java/org/jabref/logic/importer/Importer.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/Importer.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/Importer.java diff --git a/src/main/java/org/jabref/logic/importer/OpenDatabase.java b/jabref-logic/src/main/java/org/jabref/logic/importer/OpenDatabase.java similarity index 95% rename from src/main/java/org/jabref/logic/importer/OpenDatabase.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/OpenDatabase.java index f8c04f8d870..62503b73e4d 100644 --- a/src/main/java/org/jabref/logic/importer/OpenDatabase.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/OpenDatabase.java @@ -9,9 +9,9 @@ import org.jabref.logic.l10n.Localization; import org.jabref.logic.specialfields.SpecialFieldsUtils; import org.jabref.logic.util.io.FileBasedLock; -import org.jabref.migrations.ConvertLegacyExplicitGroups; -import org.jabref.migrations.ConvertMarkingToGroups; -import org.jabref.migrations.PostOpenMigration; +import org.jabref.logic.migrations.ConvertLegacyExplicitGroups; +import org.jabref.logic.migrations.ConvertMarkingToGroups; +import org.jabref.logic.migrations.PostOpenMigration; import org.jabref.model.entry.BibEntry; import org.jabref.model.util.FileUpdateMonitor; diff --git a/src/main/java/org/jabref/logic/importer/OutputPrinter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/OutputPrinter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/OutputPrinter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/OutputPrinter.java diff --git a/src/main/java/org/jabref/logic/importer/ParseException.java b/jabref-logic/src/main/java/org/jabref/logic/importer/ParseException.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/ParseException.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/ParseException.java diff --git a/src/main/java/org/jabref/logic/importer/Parser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/Parser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/Parser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/Parser.java diff --git a/src/main/java/org/jabref/logic/importer/ParserResult.java b/jabref-logic/src/main/java/org/jabref/logic/importer/ParserResult.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/ParserResult.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/ParserResult.java diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/WebFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/WebFetcher.java similarity index 79% rename from src/main/java/org/jabref/logic/importer/WebFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/WebFetcher.java index c33531ac5eb..6f300d67df2 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/WebFetcher.java @@ -1,5 +1,7 @@ package org.jabref.logic.importer; +import java.util.Optional; + import org.jabref.logic.help.HelpFile; /** @@ -20,7 +22,7 @@ public interface WebFetcher { * * @return the {@link HelpFile} enum constant for the help page */ - default HelpFile getHelpPage() { - return null; // no help page by default + default Optional getHelpPage() { + return Optional.empty(); // no help page by default } } diff --git a/src/main/java/org/jabref/logic/importer/WebFetchers.java b/jabref-logic/src/main/java/org/jabref/logic/importer/WebFetchers.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/WebFetchers.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/WebFetchers.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java similarity index 94% rename from src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java index 059fcbaff21..e36f730366b 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java @@ -4,6 +4,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Objects; +import java.util.Optional; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; @@ -31,8 +32,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_ACM; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_ACM); } private static String createQueryString(String query) { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ACS.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ACS.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/ACS.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ACS.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java similarity index 90% rename from src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java index 52a252f69e2..c70a9e1b34f 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java @@ -1,5 +1,7 @@ package org.jabref.logic.importer.fetcher; +import java.util.Optional; + import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; @@ -19,8 +21,8 @@ public AbstractIsbnFetcher(ImportFormatPreferences importFormatPreferences) { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_ISBN; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_ISBN); } protected void ensureThatIsbnIsValid(String identifier) throws FetcherException { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java similarity index 90% rename from src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java index 7f7edf703ca..bab25ab4aa7 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java @@ -10,6 +10,8 @@ import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import javax.xml.parsers.DocumentBuilder; @@ -53,9 +55,12 @@ * dspace-portalmec */ public class ArXiv implements FulltextFetcher, SearchBasedFetcher, IdBasedFetcher, IdFetcher { + private static final Logger LOGGER = LoggerFactory.getLogger(ArXiv.class); private static final String API_URL = "https://export.arxiv.org/api/query"; + private static final String ARXIV_URL_PREFIX_FOR_ID = "(https?://arxiv.org/abs/)"; + private static final Pattern URL_PATTERN = Pattern.compile(ARXIV_URL_PREFIX_FOR_ID); private final ImportFormatPreferences importFormatPreferences; @@ -69,10 +74,10 @@ public Optional findFullText(BibEntry entry) throws IOException { try { Optional pdfUrl = searchForEntries(entry).stream() - .map(ArXivEntry::getPdfUrl) - .filter(Optional::isPresent) - .map(Optional::get) - .findFirst(); + .map(ArXivEntry::getPdfUrl) + .filter(Optional::isPresent) + .map(Optional::get) + .findFirst(); if (pdfUrl.isPresent()) { LOGGER.info("Fulltext PDF found @ arXiv."); @@ -159,7 +164,7 @@ private List searchForEntries(String searchQuery) throws FetcherExce } private List queryApi(String searchQuery, List ids, int start, int maxResults) - throws FetcherException { + throws FetcherException { Document result = callApi(searchQuery, ids, start, maxResults); List entries = XMLUtil.asList(result.getElementsByTagName("entry")); @@ -195,7 +200,7 @@ private Document callApi(String searchQuery, List ids, int star } if (!ids.isEmpty()) { uriBuilder.addParameter("id_list", - ids.stream().map(ArXivIdentifier::getNormalized).collect(Collectors.joining(","))); + ids.stream().map(ArXivIdentifier::getNormalized).collect(Collectors.joining(","))); } uriBuilder.addParameter("start", String.valueOf(start)); uriBuilder.addParameter("max_results", String.valueOf(maxResults)); @@ -245,14 +250,15 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_OAI2_ARXIV; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_OAI2_ARXIV); } @Override public List performSearch(String query) throws FetcherException { return searchForEntries(query).stream().map( - (arXivEntry) -> arXivEntry.toBibEntry(importFormatPreferences.getKeywordSeparator())).collect(Collectors.toList()); + (arXivEntry) -> arXivEntry.toBibEntry(importFormatPreferences.getKeywordSeparator())) + .collect(Collectors.toList()); } @Override @@ -266,10 +272,10 @@ public Optional performSearchById(String identifier) throws FetcherExc @Override public Optional findIdentifier(BibEntry entry) throws FetcherException { return searchForEntries(entry).stream() - .map(ArXivEntry::getId) - .filter(Optional::isPresent) - .map(Optional::get) - .findFirst(); + .map(ArXivEntry::getId) + .filter(Optional::isPresent) + .map(Optional::get) + .findFirst(); } @Override @@ -290,7 +296,6 @@ private static class ArXivEntry { private final Optional journalReferenceText; private final Optional primaryCategory; - public ArXivEntry(Node item) { // see https://arxiv.org/help/api/user-manual#_details_of_atom_results_returned @@ -347,7 +352,7 @@ public ArXivEntry(Node item) { // Primary category // Ex: primaryCategory = XMLUtil.getNode(item, "arxiv:primary_category") - .flatMap(node -> XMLUtil.getAttributeContent(node, "term")); + .flatMap(node -> XMLUtil.getAttributeContent(node, "term")); } public static String correctLineBreaks(String s) { @@ -367,14 +372,16 @@ public Optional getPdfUrl() { * Returns the arXiv identifier */ public Optional getIdString() { - // remove leading https://arxiv.org/abs/ from abstract url to get arXiv ID - String prefix = "https://arxiv.org/abs/"; + return urlAbstractPage.map(abstractUrl -> { - if (abstractUrl.startsWith(prefix)) { - return abstractUrl.substring(prefix.length()); + Matcher matcher = URL_PATTERN.matcher(abstractUrl); + if (matcher.find()) { + // remove leading http(s)://arxiv.org/abs/ from abstract url to get arXiv ID + return abstractUrl.substring(matcher.group(1).length()); } else { return abstractUrl; } + }); } @@ -409,8 +416,7 @@ public BibEntry toBibEntry(Character keywordDelimiter) { getDate().ifPresent(date -> bibEntry.setField(FieldName.DATE, date)); primaryCategory.ifPresent(category -> bibEntry.setField(FieldName.EPRINTCLASS, category)); journalReferenceText.ifPresent(journal -> bibEntry.setField(FieldName.JOURNALTITLE, journal)); - getPdfUrl().ifPresent(url -> bibEntry - .setFiles(Collections.singletonList(new LinkedFile(url, "PDF")))); + getPdfUrl().ifPresent(url -> bibEntry.setFiles(Collections.singletonList(new LinkedFile(url, "PDF")))); return bibEntry; } } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java index 1ff7a6d7c89..6b99f420526 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -9,6 +9,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; +import java.util.Optional; import org.jabref.logic.cleanup.MoveFieldCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; @@ -115,8 +116,8 @@ public URL getURLForID(String identifier) throws URISyntaxException, MalformedUR } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_ADS; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_ADS); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java similarity index 96% rename from src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java index 8d244b101f8..56777a8809c 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java @@ -7,6 +7,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -37,8 +38,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_CITESEERX; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_CITESEERX); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java similarity index 95% rename from src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java index c422a9c28ca..57937051561 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java @@ -4,6 +4,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Objects; +import java.util.Optional; import org.jabref.logic.cleanup.DoiCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; @@ -71,8 +72,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_DBLP; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_DBLP); } } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java index 981ab58ea52..67bc0dc97ac 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import org.jabref.logic.help.HelpFile; @@ -157,8 +158,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_DOAJ; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_DOAJ); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java similarity index 93% rename from src/main/java/org/jabref/logic/importer/fetcher/DiVA.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java index d3c56712371..5a876fd9ff8 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java @@ -3,6 +3,7 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; +import java.util.Optional; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; @@ -32,8 +33,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_DIVA; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_DIVA); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java similarity index 96% rename from src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java index 766f2570164..0deb118292e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java @@ -38,8 +38,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_DOI; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_DOI); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java index 466d0259f29..24a061a26b5 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java @@ -117,8 +117,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_GOOGLE_SCHOLAR; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_GOOGLE_SCHOLAR); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java similarity index 95% rename from src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java index 963ff5ab5e4..67b9879ec35 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java @@ -8,6 +8,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import org.jabref.logic.help.HelpFile; @@ -34,8 +35,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_GVK; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_GVK); } private String getSearchQueryStringForComplexQuery(List queryList) { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/IEEE.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java index dd9a00ceab2..ac8192a2360 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java @@ -228,7 +228,7 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_IEEEXPLORE; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_IEEEXPLORE); } } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java similarity index 96% rename from src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java index 761a59e72ef..2229d752d66 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java @@ -7,6 +7,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -48,8 +49,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_INSPIRE; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_INSPIRE); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java index 11e8420955c..0b8ace85d7d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java @@ -12,6 +12,7 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; +import java.util.Optional; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; @@ -127,8 +128,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_MEDLINE; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_MEDLINE); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java similarity index 93% rename from src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java index 5840c25cc15..19f6128e708 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java @@ -3,6 +3,7 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; +import java.util.Optional; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; @@ -33,8 +34,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_RFC; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_RFC); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java similarity index 98% rename from src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java index 58471c00305..213fe7c79ac 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java @@ -147,8 +147,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_SPRINGER; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_SPRINGER); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java similarity index 92% rename from src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java index 881b738edde..5fea61c0e8f 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java @@ -25,8 +25,8 @@ public String getName() { } @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_TITLE; + public Optional getHelpPage() { + return Optional.of(HelpFile.FETCHER_TITLE); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fetcher/TrustLevel.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/TrustLevel.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/TrustLevel.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/TrustLevel.java diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java similarity index 99% rename from src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java index ffc3469a567..19f4f52b636 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java @@ -416,7 +416,7 @@ private void putDate(Map fields, String elementName, DateDefinit private void putIfListIsNotEmpty(Map fields, List list, String key, String separator) { if (!list.isEmpty()) { - fields.put(key, Joiner.on(separator).join(list)); + fields.put(key, list.stream().collect(Collectors.joining(separator))); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java similarity index 59% rename from src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java index 500cec32b63..db68e7958b7 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java +++ b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java @@ -6,12 +6,15 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.msbib.MSBibDatabase; import org.jabref.logic.util.StandardFileType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; @@ -20,24 +23,27 @@ /** * Importer for the MS Office 2007 XML bibliography format - * By S. M. Mahbub Murshed * * ... */ public class MsBibImporter extends Importer { + private static final Logger LOGGER = LoggerFactory.getLogger(MsBibImporter.class); + private static final String DISABLEDTD = "http://apache.org/xml/features/disallow-doctype-decl"; + private static final String DISABLEEXTERNALDTD = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; + @Override public boolean isRecognizedFormat(BufferedReader reader) throws IOException { Objects.requireNonNull(reader); /* - The correct behaviour is to return false if it is certain that the file is + The correct behavior is to return false if it is certain that the file is not of the MsBib type, and true otherwise. Returning true is the safe choice if not certain. */ Document docin; try { - DocumentBuilder dbuild = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DocumentBuilder dbuild = makeSafeDocBuilderFactory(DocumentBuilderFactory.newInstance()).newDocumentBuilder(); dbuild.setErrorHandler(new ErrorHandler() { @Override @@ -55,6 +61,7 @@ public void error(SAXParseException exception) throws SAXException { throw exception; } }); + docin = dbuild.parse(new InputSource(reader)); } catch (Exception e) { return false; @@ -85,4 +92,29 @@ public String getDescription() { return "Importer for the MS Office 2007 XML bibliography format."; } + /** + * DocumentBuilderFactory makes a XXE safe Builder factory from dBuild. If not supported by current + * XML then returns original builder given and logs error. + * @param dBuild | DocumentBuilderFactory to be made XXE safe. + * @return If supported, XXE safe DocumentBuilderFactory. Else, returns original builder given + */ + private DocumentBuilderFactory makeSafeDocBuilderFactory(DocumentBuilderFactory dBuild) { + String feature = null; + + try { + feature = DISABLEDTD; + dBuild.setFeature(feature, true); + + feature = DISABLEEXTERNALDTD; + dBuild.setFeature(feature, false); + + dBuild.setXIncludeAware(false); + dBuild.setExpandEntityReferences(false); + + } catch (ParserConfigurationException e) { + LOGGER.warn("Builder not fully configured. Feature:'{}' is probably not supported by current XML processor. {}", feature, e); + } + + return dBuild; + } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java diff --git a/src/main/java/org/jabref/logic/importer/fileformat/mods/package-info.java b/jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/mods/package-info.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/fileformat/mods/package-info.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/fileformat/mods/package-info.java diff --git a/src/main/java/org/jabref/logic/importer/util/GroupsParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/util/GroupsParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/util/GroupsParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/util/GroupsParser.java diff --git a/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java b/jabref-logic/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java diff --git a/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/util/IdentifierParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java diff --git a/src/main/java/org/jabref/logic/importer/util/JsonReader.java b/jabref-logic/src/main/java/org/jabref/logic/importer/util/JsonReader.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/util/JsonReader.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/util/JsonReader.java diff --git a/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java b/jabref-logic/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java similarity index 100% rename from src/main/java/org/jabref/logic/importer/util/MetaDataParser.java rename to jabref-logic/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java diff --git a/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BibStringChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BibStringChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BibStringChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BibStringChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BibtexKeyChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexKeyChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BibtexKeyChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexKeyChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BibtexKeyDuplicationChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexKeyDuplicationChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BibtexKeyDuplicationChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexKeyDuplicationChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BibtexkeyDeviationChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexkeyDeviationChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BibtexkeyDeviationChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BibtexkeyDeviationChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BooktitleChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/BracesCorrector.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BracesCorrector.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BracesCorrector.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BracesCorrector.java diff --git a/src/main/java/org/jabref/logic/integrity/BracketChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/BracketChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/BracketChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/BracketChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/DOIValidityChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/DOIValidityChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/DOIValidityChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/DOIValidityChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/DateChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/DateChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/DateChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/DateChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/EditionChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/EditionChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/EditionChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/EditionChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/FieldChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/FieldChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/FieldChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/FieldChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/FieldCheckers.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/FieldCheckers.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/FieldCheckers.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/FieldCheckers.java diff --git a/src/main/java/org/jabref/logic/integrity/FileChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/FileChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/FileChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/FileChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/ISBNChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/ISBNChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/ISBNChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/ISBNChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/ISSNChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/ISSNChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/ISSNChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/ISSNChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/IntegrityCheck.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java diff --git a/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/IntegrityMessage.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java diff --git a/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/MonthChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/MonthChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/MonthChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/MonthChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/NoteChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/NoteChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/NoteChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/NoteChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/PagesChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/PagesChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/PagesChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/PagesChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/TitleChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/TitleChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/TitleChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/TitleChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/TypeChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/TypeChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/TypeChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/TypeChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/UrlChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/UrlChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/UrlChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/UrlChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/ValidBibtexKeyChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/ValidBibtexKeyChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/ValidBibtexKeyChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/ValidBibtexKeyChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/ValueChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/ValueChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/ValueChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/ValueChecker.java diff --git a/src/main/java/org/jabref/logic/integrity/YearChecker.java b/jabref-logic/src/main/java/org/jabref/logic/integrity/YearChecker.java similarity index 100% rename from src/main/java/org/jabref/logic/integrity/YearChecker.java rename to jabref-logic/src/main/java/org/jabref/logic/integrity/YearChecker.java diff --git a/src/main/java/org/jabref/logic/journals/Abbreviation.java b/jabref-logic/src/main/java/org/jabref/logic/journals/Abbreviation.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/Abbreviation.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/Abbreviation.java diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationParser.java b/jabref-logic/src/main/java/org/jabref/logic/journals/AbbreviationParser.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/AbbreviationParser.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/AbbreviationParser.java diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java b/jabref-logic/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/AbbreviationWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java b/jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java b/jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java similarity index 100% rename from src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java rename to jabref-logic/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java diff --git a/src/main/java/org/jabref/logic/l10n/EncodingControl.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/EncodingControl.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/EncodingControl.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/EncodingControl.java diff --git a/src/main/java/org/jabref/logic/l10n/Encodings.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/Encodings.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/Encodings.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/Encodings.java diff --git a/src/main/java/org/jabref/logic/l10n/Languages.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/Languages.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/Languages.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/Languages.java diff --git a/src/main/java/org/jabref/logic/l10n/Localization.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/Localization.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/Localization.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/Localization.java diff --git a/src/main/java/org/jabref/logic/l10n/LocalizationKey.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationKey.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/LocalizationKey.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationKey.java diff --git a/src/main/java/org/jabref/logic/l10n/LocalizationKeyParams.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationKeyParams.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/LocalizationKeyParams.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationKeyParams.java diff --git a/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java b/jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java similarity index 100% rename from src/main/java/org/jabref/logic/l10n/LocalizationLocator.java rename to jabref-logic/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java diff --git a/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/Layout.java b/jabref-logic/src/main/java/org/jabref/logic/layout/Layout.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/Layout.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/Layout.java diff --git a/src/main/java/org/jabref/logic/layout/LayoutEntry.java b/jabref-logic/src/main/java/org/jabref/logic/layout/LayoutEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/LayoutEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/LayoutEntry.java diff --git a/src/main/java/org/jabref/logic/layout/LayoutFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/LayoutFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/LayoutFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/LayoutFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java diff --git a/src/main/java/org/jabref/logic/layout/LayoutHelper.java b/jabref-logic/src/main/java/org/jabref/logic/layout/LayoutHelper.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/LayoutHelper.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/LayoutHelper.java diff --git a/src/main/java/org/jabref/logic/layout/ParamLayoutFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/ParamLayoutFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/ParamLayoutFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/ParamLayoutFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/StringInt.java b/jabref-logic/src/main/java/org/jabref/logic/layout/StringInt.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/StringInt.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/StringInt.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAbbreviator.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAbbreviator.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorAbbreviator.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAbbreviator.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacer.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacer.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacer.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacer.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirst.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirst.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstFirst.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirst.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirstCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirstCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstFirstCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstFirstCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstLastCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLF_FF.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLF_FF.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLF_FF.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLF_FF.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLF_FFAbbr.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLF_FFAbbr.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLF_FFAbbr.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLF_FFAbbr.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirst.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirst.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirst.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirst.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviator.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviator.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviator.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviator.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirstCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorNatBib.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorNatBib.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorNatBib.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorNatBib.java diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorOrgSci.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorOrgSci.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/AuthorOrgSci.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/AuthorOrgSci.java diff --git a/src/main/java/org/jabref/logic/layout/format/Authors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Authors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Authors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Authors.java diff --git a/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/CompositeFormat.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java diff --git a/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java diff --git a/src/main/java/org/jabref/logic/layout/format/CreateDocBookAuthors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateDocBookAuthors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/CreateDocBookAuthors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateDocBookAuthors.java diff --git a/src/main/java/org/jabref/logic/layout/format/CreateDocBookEditors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateDocBookEditors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/CreateDocBookEditors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/CreateDocBookEditors.java diff --git a/src/main/java/org/jabref/logic/layout/format/CurrentDate.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/CurrentDate.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/CurrentDate.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/CurrentDate.java diff --git a/src/main/java/org/jabref/logic/layout/format/DOICheck.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/DOICheck.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/DOICheck.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/DOICheck.java diff --git a/src/main/java/org/jabref/logic/layout/format/DOIStrip.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/DOIStrip.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/DOIStrip.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/DOIStrip.java diff --git a/src/main/java/org/jabref/logic/layout/format/DateFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/DateFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/DateFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/DateFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/Default.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Default.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Default.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Default.java diff --git a/src/main/java/org/jabref/logic/layout/format/EntryTypeFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/EntryTypeFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/EntryTypeFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/EntryTypeFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/FileLink.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/FileLink.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/FileLink.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/FileLink.java diff --git a/src/main/java/org/jabref/logic/layout/format/FileLinkPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/FileLinkPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/FileLinkPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/FileLinkPreferences.java diff --git a/src/main/java/org/jabref/logic/layout/format/FirstPage.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/FirstPage.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/FirstPage.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/FirstPage.java diff --git a/src/main/java/org/jabref/logic/layout/format/FormatPagesForHTML.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/FormatPagesForHTML.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/FormatPagesForHTML.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/FormatPagesForHTML.java diff --git a/src/main/java/org/jabref/logic/layout/format/FormatPagesForXML.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/FormatPagesForXML.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/FormatPagesForXML.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/FormatPagesForXML.java diff --git a/src/main/java/org/jabref/logic/layout/format/GetOpenOfficeType.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/GetOpenOfficeType.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/GetOpenOfficeType.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/GetOpenOfficeType.java diff --git a/src/main/java/org/jabref/logic/layout/format/HTMLChars.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/HTMLChars.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/HTMLChars.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/HTMLChars.java diff --git a/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java diff --git a/src/main/java/org/jabref/logic/layout/format/IfPlural.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/IfPlural.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/IfPlural.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/IfPlural.java diff --git a/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java diff --git a/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java diff --git a/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java diff --git a/src/main/java/org/jabref/logic/layout/format/LastPage.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/LastPage.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/LastPage.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/LastPage.java diff --git a/src/main/java/org/jabref/logic/layout/format/LatexToUnicodeFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/LatexToUnicodeFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/LatexToUnicodeFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/LatexToUnicodeFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/NameFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/NameFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/NameFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java diff --git a/src/main/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviations.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviations.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviations.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviations.java diff --git a/src/main/java/org/jabref/logic/layout/format/NotFoundFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/NotFoundFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/NotFoundFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/NotFoundFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/Number.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Number.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Number.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Number.java diff --git a/src/main/java/org/jabref/logic/layout/format/Ordinal.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Ordinal.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Ordinal.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Ordinal.java diff --git a/src/main/java/org/jabref/logic/layout/format/RTFChars.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RTFChars.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RTFChars.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RTFChars.java diff --git a/src/main/java/org/jabref/logic/layout/format/RemoveBrackets.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveBrackets.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RemoveBrackets.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveBrackets.java diff --git a/src/main/java/org/jabref/logic/layout/format/RemoveBracketsAddComma.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveBracketsAddComma.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RemoveBracketsAddComma.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveBracketsAddComma.java diff --git a/src/main/java/org/jabref/logic/layout/format/RemoveLatexCommandsFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveLatexCommandsFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RemoveLatexCommandsFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveLatexCommandsFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/RemoveTilde.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveTilde.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RemoveTilde.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveTilde.java diff --git a/src/main/java/org/jabref/logic/layout/format/RemoveWhitespace.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveWhitespace.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RemoveWhitespace.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RemoveWhitespace.java diff --git a/src/main/java/org/jabref/logic/layout/format/Replace.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/Replace.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/Replace.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/Replace.java diff --git a/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java diff --git a/src/main/java/org/jabref/logic/layout/format/RisAuthors.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RisAuthors.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RisAuthors.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RisAuthors.java diff --git a/src/main/java/org/jabref/logic/layout/format/RisKeywords.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RisKeywords.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RisKeywords.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RisKeywords.java diff --git a/src/main/java/org/jabref/logic/layout/format/RisMonth.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/RisMonth.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/RisMonth.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/RisMonth.java diff --git a/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/ToLowerCase.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java diff --git a/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/ToUpperCase.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java diff --git a/src/main/java/org/jabref/logic/layout/format/WrapContent.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/WrapContent.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/WrapContent.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/WrapContent.java diff --git a/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java diff --git a/src/main/java/org/jabref/logic/layout/format/XMLChars.java b/jabref-logic/src/main/java/org/jabref/logic/layout/format/XMLChars.java similarity index 100% rename from src/main/java/org/jabref/logic/layout/format/XMLChars.java rename to jabref-logic/src/main/java/org/jabref/logic/layout/format/XMLChars.java diff --git a/src/main/java/org/jabref/logic/logging/JabRefLogger.java b/jabref-logic/src/main/java/org/jabref/logic/logging/JabRefLogger.java similarity index 100% rename from src/main/java/org/jabref/logic/logging/JabRefLogger.java rename to jabref-logic/src/main/java/org/jabref/logic/logging/JabRefLogger.java diff --git a/src/main/java/org/jabref/logic/logging/LogMessages.java b/jabref-logic/src/main/java/org/jabref/logic/logging/LogMessages.java similarity index 100% rename from src/main/java/org/jabref/logic/logging/LogMessages.java rename to jabref-logic/src/main/java/org/jabref/logic/logging/LogMessages.java diff --git a/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java b/jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroups.java similarity index 97% rename from src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java rename to jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroups.java index d0f5ced7bfc..11a8f6dc019 100644 --- a/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java +++ b/jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroups.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java b/jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertMarkingToGroups.java similarity index 98% rename from src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java rename to jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertMarkingToGroups.java index aaf2b10a583..60f129cbe0e 100644 --- a/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java +++ b/jabref-logic/src/main/java/org/jabref/logic/migrations/ConvertMarkingToGroups.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.Collection; import java.util.List; diff --git a/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java b/jabref-logic/src/main/java/org/jabref/logic/migrations/MergeReviewIntoCommentMigration.java similarity index 98% rename from src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java rename to jabref-logic/src/main/java/org/jabref/logic/migrations/MergeReviewIntoCommentMigration.java index ed3bcee7b45..770abb26ffc 100644 --- a/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java +++ b/jabref-logic/src/main/java/org/jabref/logic/migrations/MergeReviewIntoCommentMigration.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.List; import java.util.Objects; diff --git a/src/main/java/org/jabref/migrations/PostOpenMigration.java b/jabref-logic/src/main/java/org/jabref/logic/migrations/PostOpenMigration.java similarity index 79% rename from src/main/java/org/jabref/migrations/PostOpenMigration.java rename to jabref-logic/src/main/java/org/jabref/logic/migrations/PostOpenMigration.java index b259ee12cb3..42bb6e40139 100644 --- a/src/main/java/org/jabref/migrations/PostOpenMigration.java +++ b/jabref-logic/src/main/java/org/jabref/logic/migrations/PostOpenMigration.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import org.jabref.logic.importer.ParserResult; diff --git a/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/BibTeXConverter.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibConverter.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MSBibConverter.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibConverter.java diff --git a/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MSBibDatabase.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java diff --git a/src/main/java/org/jabref/logic/msbib/MSBibEntry.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MSBibEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibEntry.java diff --git a/src/main/java/org/jabref/logic/msbib/MSBibEntryType.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibEntryType.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MSBibEntryType.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibEntryType.java diff --git a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibMapping.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MSBibMapping.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MSBibMapping.java diff --git a/src/main/java/org/jabref/logic/msbib/MsBibAuthor.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/MsBibAuthor.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/MsBibAuthor.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/MsBibAuthor.java diff --git a/src/main/java/org/jabref/logic/msbib/PageNumbers.java b/jabref-logic/src/main/java/org/jabref/logic/msbib/PageNumbers.java similarity index 100% rename from src/main/java/org/jabref/logic/msbib/PageNumbers.java rename to jabref-logic/src/main/java/org/jabref/logic/msbib/PageNumbers.java diff --git a/src/main/java/org/jabref/logic/net/ProgressInputStream.java b/jabref-logic/src/main/java/org/jabref/logic/net/ProgressInputStream.java similarity index 93% rename from src/main/java/org/jabref/logic/net/ProgressInputStream.java rename to jabref-logic/src/main/java/org/jabref/logic/net/ProgressInputStream.java index 57d23907ff4..d114cbbe6cb 100644 --- a/src/main/java/org/jabref/logic/net/ProgressInputStream.java +++ b/jabref-logic/src/main/java/org/jabref/logic/net/ProgressInputStream.java @@ -12,16 +12,18 @@ * Code based on http://stackoverflow.com/a/1339589/873661, but converted to use JavaFX properties instead of listeners */ public class ProgressInputStream extends FilterInputStream { + private final long maxNumBytes; private final LongProperty totalNumBytesRead; private final LongProperty progress; public ProgressInputStream(InputStream in, long maxNumBytes) { super(in); - this.maxNumBytes = maxNumBytes; this.totalNumBytesRead = new SimpleLongProperty(0); this.progress = new SimpleLongProperty(0); - this.progress.bind(totalNumBytesRead.divide(maxNumBytes)); + + this.maxNumBytes = maxNumBytes <= 0 ? 1 : maxNumBytes; + this.progress.bind(totalNumBytesRead.divide(this.maxNumBytes)); } public long getTotalNumBytesRead() { diff --git a/src/main/java/org/jabref/logic/net/ProxyAuthenticator.java b/jabref-logic/src/main/java/org/jabref/logic/net/ProxyAuthenticator.java similarity index 100% rename from src/main/java/org/jabref/logic/net/ProxyAuthenticator.java rename to jabref-logic/src/main/java/org/jabref/logic/net/ProxyAuthenticator.java diff --git a/src/main/java/org/jabref/logic/net/ProxyPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/net/ProxyPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/net/ProxyPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/net/ProxyPreferences.java diff --git a/src/main/java/org/jabref/logic/net/ProxyRegisterer.java b/jabref-logic/src/main/java/org/jabref/logic/net/ProxyRegisterer.java similarity index 100% rename from src/main/java/org/jabref/logic/net/ProxyRegisterer.java rename to jabref-logic/src/main/java/org/jabref/logic/net/ProxyRegisterer.java diff --git a/src/main/java/org/jabref/logic/net/URLDownload.java b/jabref-logic/src/main/java/org/jabref/logic/net/URLDownload.java similarity index 94% rename from src/main/java/org/jabref/logic/net/URLDownload.java rename to jabref-logic/src/main/java/org/jabref/logic/net/URLDownload.java index 8219f0ebe0a..5ae3f915c02 100644 --- a/src/main/java/org/jabref/logic/net/URLDownload.java +++ b/jabref-logic/src/main/java/org/jabref/logic/net/URLDownload.java @@ -2,6 +2,7 @@ import java.io.BufferedInputStream; import java.io.BufferedReader; +import java.io.ByteArrayInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; @@ -96,6 +97,7 @@ public static void bypassSSLVerification() { // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = {new X509TrustManager() { + @Override public void checkClientTrusted(X509Certificate[] chain, String authType) { } @@ -249,8 +251,14 @@ public void toFile(Path destination) throws IOException { * Takes the web resource as the source for a monitored input stream. */ public ProgressInputStream asInputStream() throws IOException { - URLConnection urlConnection = this.openConnection(); - long fileSize = urlConnection.getContentLength(); + HttpURLConnection urlConnection = (HttpURLConnection) this.openConnection(); + + if ((urlConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) || (urlConnection.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST)) + { + LOGGER.error("Response message {} returned for url {}", urlConnection.getResponseMessage(), urlConnection.getURL()); + return new ProgressInputStream(new ByteArrayInputStream(new byte[0]), 0); + } + long fileSize = urlConnection.getContentLengthLong(); return new ProgressInputStream(new BufferedInputStream(urlConnection.getInputStream()), fileSize); } @@ -311,8 +319,8 @@ private URLConnection openConnection() throws IOException { int status = ((HttpURLConnection) connection).getResponseCode(); if (status != HttpURLConnection.HTTP_OK) { if ((status == HttpURLConnection.HTTP_MOVED_TEMP) - || (status == HttpURLConnection.HTTP_MOVED_PERM) - || (status == HttpURLConnection.HTTP_SEE_OTHER)) { + || (status == HttpURLConnection.HTTP_MOVED_PERM) + || (status == HttpURLConnection.HTTP_SEE_OTHER)) { // get redirect url from "location" header field String newUrl = connection.getHeaderField("Location"); // open the new connnection again diff --git a/src/main/java/org/jabref/logic/net/URLUtil.java b/jabref-logic/src/main/java/org/jabref/logic/net/URLUtil.java similarity index 100% rename from src/main/java/org/jabref/logic/net/URLUtil.java rename to jabref-logic/src/main/java/org/jabref/logic/net/URLUtil.java diff --git a/src/main/java/org/jabref/logic/openoffice/CitationEntry.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/CitationEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/CitationEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/CitationEntry.java diff --git a/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/OOBibStyle.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java diff --git a/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java diff --git a/src/main/java/org/jabref/logic/openoffice/OOUtil.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/OOUtil.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/OOUtil.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/OOUtil.java diff --git a/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java diff --git a/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java diff --git a/src/main/java/org/jabref/logic/openoffice/StyleLoader.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/StyleLoader.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/StyleLoader.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/StyleLoader.java diff --git a/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java diff --git a/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java b/jabref-logic/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java similarity index 100% rename from src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java rename to jabref-logic/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java diff --git a/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java b/jabref-logic/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/pdf/AnnotationImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java diff --git a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java b/jabref-logic/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java diff --git a/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java b/jabref-logic/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java similarity index 100% rename from src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java rename to jabref-logic/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java diff --git a/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java b/jabref-logic/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java similarity index 100% rename from src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java rename to jabref-logic/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java diff --git a/src/main/java/org/jabref/logic/pdf/TextExtractor.java b/jabref-logic/src/main/java/org/jabref/logic/pdf/TextExtractor.java similarity index 100% rename from src/main/java/org/jabref/logic/pdf/TextExtractor.java rename to jabref-logic/src/main/java/org/jabref/logic/pdf/TextExtractor.java diff --git a/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/preferences/TimestampPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java b/jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java similarity index 100% rename from src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java rename to jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java b/jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java similarity index 100% rename from src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java rename to jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java b/jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java similarity index 100% rename from src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java rename to jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java diff --git a/src/main/java/org/jabref/logic/remote/RemotePreferences.java b/jabref-logic/src/main/java/org/jabref/logic/remote/RemotePreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/RemotePreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/RemotePreferences.java diff --git a/src/main/java/org/jabref/logic/remote/RemoteUtil.java b/jabref-logic/src/main/java/org/jabref/logic/remote/RemoteUtil.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/RemoteUtil.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/RemoteUtil.java diff --git a/src/main/java/org/jabref/logic/remote/client/RemoteClient.java b/jabref-logic/src/main/java/org/jabref/logic/remote/client/RemoteClient.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/client/RemoteClient.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/client/RemoteClient.java diff --git a/src/main/java/org/jabref/logic/remote/server/MessageHandler.java b/jabref-logic/src/main/java/org/jabref/logic/remote/server/MessageHandler.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/server/MessageHandler.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/server/MessageHandler.java diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java b/jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java b/jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java similarity index 97% rename from src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java index 7ccbfb0572b..ffd1f3c5ccb 100644 --- a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java +++ b/jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerLifecycle.java @@ -3,7 +3,7 @@ import java.io.IOException; import java.net.BindException; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java b/jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java diff --git a/src/main/java/org/jabref/logic/remote/shared/Protocol.java b/jabref-logic/src/main/java/org/jabref/logic/remote/shared/Protocol.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/shared/Protocol.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/shared/Protocol.java diff --git a/src/main/java/org/jabref/logic/remote/shared/RemoteMessage.java b/jabref-logic/src/main/java/org/jabref/logic/remote/shared/RemoteMessage.java similarity index 100% rename from src/main/java/org/jabref/logic/remote/shared/RemoteMessage.java rename to jabref-logic/src/main/java/org/jabref/logic/remote/shared/RemoteMessage.java diff --git a/src/main/java/org/jabref/logic/search/DatabaseSearcher.java b/jabref-logic/src/main/java/org/jabref/logic/search/DatabaseSearcher.java similarity index 100% rename from src/main/java/org/jabref/logic/search/DatabaseSearcher.java rename to jabref-logic/src/main/java/org/jabref/logic/search/DatabaseSearcher.java diff --git a/src/main/java/org/jabref/logic/search/SearchQuery.java b/jabref-logic/src/main/java/org/jabref/logic/search/SearchQuery.java similarity index 100% rename from src/main/java/org/jabref/logic/search/SearchQuery.java rename to jabref-logic/src/main/java/org/jabref/logic/search/SearchQuery.java diff --git a/src/main/java/org/jabref/logic/search/SearchQueryHighlightListener.java b/jabref-logic/src/main/java/org/jabref/logic/search/SearchQueryHighlightListener.java similarity index 100% rename from src/main/java/org/jabref/logic/search/SearchQueryHighlightListener.java rename to jabref-logic/src/main/java/org/jabref/logic/search/SearchQueryHighlightListener.java diff --git a/src/main/java/org/jabref/logic/search/SearchQueryHighlightObservable.java b/jabref-logic/src/main/java/org/jabref/logic/search/SearchQueryHighlightObservable.java similarity index 100% rename from src/main/java/org/jabref/logic/search/SearchQueryHighlightObservable.java rename to jabref-logic/src/main/java/org/jabref/logic/search/SearchQueryHighlightObservable.java diff --git a/src/main/java/org/jabref/logic/shared/DBMSConnection.java b/jabref-logic/src/main/java/org/jabref/logic/shared/DBMSConnection.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/DBMSConnection.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/DBMSConnection.java diff --git a/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java b/jabref-logic/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java diff --git a/src/main/java/org/jabref/logic/shared/DBMSProcessor.java b/jabref-logic/src/main/java/org/jabref/logic/shared/DBMSProcessor.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/DBMSProcessor.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/DBMSProcessor.java diff --git a/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java b/jabref-logic/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java diff --git a/src/main/java/org/jabref/logic/shared/MySQLProcessor.java b/jabref-logic/src/main/java/org/jabref/logic/shared/MySQLProcessor.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/MySQLProcessor.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/MySQLProcessor.java diff --git a/src/main/java/org/jabref/logic/shared/OracleProcessor.java b/jabref-logic/src/main/java/org/jabref/logic/shared/OracleProcessor.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/OracleProcessor.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/OracleProcessor.java diff --git a/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java b/jabref-logic/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java diff --git a/src/main/java/org/jabref/logic/shared/event/ConnectionLostEvent.java b/jabref-logic/src/main/java/org/jabref/logic/shared/event/ConnectionLostEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/event/ConnectionLostEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/event/ConnectionLostEvent.java diff --git a/src/main/java/org/jabref/logic/shared/event/SharedEntryNotPresentEvent.java b/jabref-logic/src/main/java/org/jabref/logic/shared/event/SharedEntryNotPresentEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/event/SharedEntryNotPresentEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/event/SharedEntryNotPresentEvent.java diff --git a/src/main/java/org/jabref/logic/shared/event/UpdateRefusedEvent.java b/jabref-logic/src/main/java/org/jabref/logic/shared/event/UpdateRefusedEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/event/UpdateRefusedEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/event/UpdateRefusedEvent.java diff --git a/src/main/java/org/jabref/logic/shared/exception/InvalidDBMSConnectionPropertiesException.java b/jabref-logic/src/main/java/org/jabref/logic/shared/exception/InvalidDBMSConnectionPropertiesException.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/exception/InvalidDBMSConnectionPropertiesException.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/exception/InvalidDBMSConnectionPropertiesException.java diff --git a/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java b/jabref-logic/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java diff --git a/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java b/jabref-logic/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java diff --git a/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java b/jabref-logic/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java diff --git a/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java b/jabref-logic/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java diff --git a/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java b/jabref-logic/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java diff --git a/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java b/jabref-logic/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java similarity index 93% rename from src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java index 6ae59105a7b..94f9c6d6950 100644 --- a/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java +++ b/jabref-logic/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java @@ -6,7 +6,6 @@ import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; -import org.jabref.JabRefMain; import org.jabref.logic.shared.security.Password; import org.jabref.model.database.shared.DatabaseConnectionProperties; @@ -21,7 +20,7 @@ public class SharedDatabasePreferences { private static final Logger LOGGER = LoggerFactory.getLogger(SharedDatabasePreferences.class); private static final String DEFAULT_NODE = "default"; - private static final String PARENT_NODE = "jabref-shared"; + private static final String PARENT_NODE = "org.jabref-shared"; private static final String SHARED_DATABASE_TYPE = "sharedDatabaseType"; private static final String SHARED_DATABASE_HOST = "sharedDatabaseHost"; @@ -40,7 +39,7 @@ public SharedDatabasePreferences() { } public SharedDatabasePreferences(String sharedDatabaseID) { - internalPrefs = Preferences.userNodeForPackage(JabRefMain.class).parent().node(PARENT_NODE).node(sharedDatabaseID); + internalPrefs = Preferences.userRoot().node(PARENT_NODE).node(sharedDatabaseID); } public Optional getType() { @@ -112,7 +111,7 @@ private Optional getOptionalValue(String key) { } public static void clearAll() throws BackingStoreException { - Preferences.userNodeForPackage(JabRefMain.class).parent().node(PARENT_NODE).clear(); + Preferences.userRoot().node(PARENT_NODE).clear(); } public void putAllDBMSConnectionProperties(DatabaseConnectionProperties properties) { diff --git a/src/main/java/org/jabref/logic/shared/security/Password.java b/jabref-logic/src/main/java/org/jabref/logic/shared/security/Password.java similarity index 100% rename from src/main/java/org/jabref/logic/shared/security/Password.java rename to jabref-logic/src/main/java/org/jabref/logic/shared/security/Password.java diff --git a/src/main/java/org/jabref/logic/specialfields/SpecialFieldsUtils.java b/jabref-logic/src/main/java/org/jabref/logic/specialfields/SpecialFieldsUtils.java similarity index 100% rename from src/main/java/org/jabref/logic/specialfields/SpecialFieldsUtils.java rename to jabref-logic/src/main/java/org/jabref/logic/specialfields/SpecialFieldsUtils.java diff --git a/src/main/java/org/jabref/logic/undo/AddUndoableActionEvent.java b/jabref-logic/src/main/java/org/jabref/logic/undo/AddUndoableActionEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/undo/AddUndoableActionEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/undo/AddUndoableActionEvent.java diff --git a/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java b/jabref-logic/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/undo/UndoChangeEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java diff --git a/src/main/java/org/jabref/logic/undo/UndoRedoEvent.java b/jabref-logic/src/main/java/org/jabref/logic/undo/UndoRedoEvent.java similarity index 100% rename from src/main/java/org/jabref/logic/undo/UndoRedoEvent.java rename to jabref-logic/src/main/java/org/jabref/logic/undo/UndoRedoEvent.java diff --git a/src/main/java/org/jabref/logic/util/BuildInfo.java b/jabref-logic/src/main/java/org/jabref/logic/util/BuildInfo.java similarity index 100% rename from src/main/java/org/jabref/logic/util/BuildInfo.java rename to jabref-logic/src/main/java/org/jabref/logic/util/BuildInfo.java diff --git a/src/main/java/org/jabref/logic/util/FileType.java b/jabref-logic/src/main/java/org/jabref/logic/util/FileType.java similarity index 100% rename from src/main/java/org/jabref/logic/util/FileType.java rename to jabref-logic/src/main/java/org/jabref/logic/util/FileType.java diff --git a/src/main/java/org/jabref/logic/util/JavaVersion.java b/jabref-logic/src/main/java/org/jabref/logic/util/JavaVersion.java similarity index 100% rename from src/main/java/org/jabref/logic/util/JavaVersion.java rename to jabref-logic/src/main/java/org/jabref/logic/util/JavaVersion.java diff --git a/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java b/jabref-logic/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java similarity index 100% rename from src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java rename to jabref-logic/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java diff --git a/src/main/java/org/jabref/logic/util/OS.java b/jabref-logic/src/main/java/org/jabref/logic/util/OS.java similarity index 100% rename from src/main/java/org/jabref/logic/util/OS.java rename to jabref-logic/src/main/java/org/jabref/logic/util/OS.java diff --git a/src/main/java/org/jabref/logic/util/StandardFileType.java b/jabref-logic/src/main/java/org/jabref/logic/util/StandardFileType.java similarity index 100% rename from src/main/java/org/jabref/logic/util/StandardFileType.java rename to jabref-logic/src/main/java/org/jabref/logic/util/StandardFileType.java diff --git a/src/main/java/org/jabref/logic/util/TestEntry.java b/jabref-logic/src/main/java/org/jabref/logic/util/TestEntry.java similarity index 100% rename from src/main/java/org/jabref/logic/util/TestEntry.java rename to jabref-logic/src/main/java/org/jabref/logic/util/TestEntry.java diff --git a/src/main/java/org/jabref/logic/util/UpdateField.java b/jabref-logic/src/main/java/org/jabref/logic/util/UpdateField.java similarity index 100% rename from src/main/java/org/jabref/logic/util/UpdateField.java rename to jabref-logic/src/main/java/org/jabref/logic/util/UpdateField.java diff --git a/src/main/java/org/jabref/logic/util/UpdateFieldPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/util/UpdateFieldPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/util/UpdateFieldPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/util/UpdateFieldPreferences.java diff --git a/src/main/java/org/jabref/logic/util/Version.java b/jabref-logic/src/main/java/org/jabref/logic/util/Version.java similarity index 100% rename from src/main/java/org/jabref/logic/util/Version.java rename to jabref-logic/src/main/java/org/jabref/logic/util/Version.java diff --git a/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java diff --git a/src/main/java/org/jabref/logic/util/io/CiteKeyBasedFileFinder.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/CiteKeyBasedFileFinder.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/CiteKeyBasedFileFinder.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/CiteKeyBasedFileFinder.java diff --git a/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java diff --git a/src/main/java/org/jabref/logic/util/io/FileBasedLock.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileBasedLock.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileBasedLock.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileBasedLock.java diff --git a/src/main/java/org/jabref/logic/util/io/FileFinder.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileFinder.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileFinder.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileFinder.java diff --git a/src/main/java/org/jabref/logic/util/io/FileFinders.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileFinders.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileFinders.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileFinders.java diff --git a/src/main/java/org/jabref/logic/util/io/FileHistory.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileHistory.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileHistory.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileHistory.java diff --git a/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileNameCleaner.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java diff --git a/src/main/java/org/jabref/logic/util/io/FileUtil.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/FileUtil.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/FileUtil.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/FileUtil.java diff --git a/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java diff --git a/src/main/java/org/jabref/logic/util/io/XMLUtil.java b/jabref-logic/src/main/java/org/jabref/logic/util/io/XMLUtil.java similarity index 100% rename from src/main/java/org/jabref/logic/util/io/XMLUtil.java rename to jabref-logic/src/main/java/org/jabref/logic/util/io/XMLUtil.java diff --git a/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java diff --git a/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java diff --git a/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java diff --git a/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/RtfCharMap.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java diff --git a/src/main/java/org/jabref/logic/util/strings/StringLengthComparator.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/StringLengthComparator.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/StringLengthComparator.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/StringLengthComparator.java diff --git a/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/StringSimilarity.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java diff --git a/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java diff --git a/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java b/jabref-logic/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java similarity index 100% rename from src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java rename to jabref-logic/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java diff --git a/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java diff --git a/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java diff --git a/src/main/java/org/jabref/logic/xmp/EncryptedPdfsNotSupportedException.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/EncryptedPdfsNotSupportedException.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/EncryptedPdfsNotSupportedException.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/EncryptedPdfsNotSupportedException.java diff --git a/src/main/java/org/jabref/logic/xmp/XmpPreferences.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/XmpPreferences.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/XmpPreferences.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/XmpPreferences.java diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/XmpUtilReader.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/XmpUtilShared.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java b/jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java similarity index 100% rename from src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java rename to jabref-logic/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java diff --git a/src/main/resources/build.properties b/jabref-logic/src/main/resources/build.properties similarity index 100% rename from src/main/resources/build.properties rename to jabref-logic/src/main/resources/build.properties diff --git a/src/main/resources/protectedterms/countries_territories.terms b/jabref-logic/src/main/resources/protectedterms/countries_territories.terms similarity index 100% rename from src/main/resources/protectedterms/countries_territories.terms rename to jabref-logic/src/main/resources/protectedterms/countries_territories.terms diff --git a/src/main/resources/protectedterms/electrical_engineering.terms b/jabref-logic/src/main/resources/protectedterms/electrical_engineering.terms similarity index 100% rename from src/main/resources/protectedterms/electrical_engineering.terms rename to jabref-logic/src/main/resources/protectedterms/electrical_engineering.terms diff --git a/src/main/resources/protectedterms/months_weekdays.terms b/jabref-logic/src/main/resources/protectedterms/months_weekdays.terms similarity index 100% rename from src/main/resources/protectedterms/months_weekdays.terms rename to jabref-logic/src/main/resources/protectedterms/months_weekdays.terms diff --git a/src/main/resources/xjc/bibtexml/bibtexml.xsd b/jabref-logic/src/main/resources/xjc/bibtexml/bibtexml.xsd similarity index 100% rename from src/main/resources/xjc/bibtexml/bibtexml.xsd rename to jabref-logic/src/main/resources/xjc/bibtexml/bibtexml.xsd diff --git a/src/main/resources/xjc/endnote/RSXML.dtd b/jabref-logic/src/main/resources/xjc/endnote/RSXML.dtd similarity index 100% rename from src/main/resources/xjc/endnote/RSXML.dtd rename to jabref-logic/src/main/resources/xjc/endnote/RSXML.dtd diff --git a/src/main/resources/xjc/medline/bookdoc_160101.xsd b/jabref-logic/src/main/resources/xjc/medline/bookdoc_160101.xsd similarity index 100% rename from src/main/resources/xjc/medline/bookdoc_160101.xsd rename to jabref-logic/src/main/resources/xjc/medline/bookdoc_160101.xsd diff --git a/src/main/resources/xjc/medline/medline.xsd b/jabref-logic/src/main/resources/xjc/medline/medline.xsd similarity index 100% rename from src/main/resources/xjc/medline/medline.xsd rename to jabref-logic/src/main/resources/xjc/medline/medline.xsd diff --git a/src/main/resources/xjc/medline/nlmmedlinecitationset_160101.xsd b/jabref-logic/src/main/resources/xjc/medline/nlmmedlinecitationset_160101.xsd similarity index 100% rename from src/main/resources/xjc/medline/nlmmedlinecitationset_160101.xsd rename to jabref-logic/src/main/resources/xjc/medline/nlmmedlinecitationset_160101.xsd diff --git a/src/main/resources/xjc/mods/mods-3-7.xsd b/jabref-logic/src/main/resources/xjc/mods/mods-3-7.xsd similarity index 100% rename from src/main/resources/xjc/mods/mods-3-7.xsd rename to jabref-logic/src/main/resources/xjc/mods/mods-3-7.xsd diff --git a/src/main/resources/xjc/mods/mods-binding.xjb b/jabref-logic/src/main/resources/xjc/mods/mods-binding.xjb similarity index 100% rename from src/main/resources/xjc/mods/mods-binding.xjb rename to jabref-logic/src/main/resources/xjc/mods/mods-binding.xjb diff --git a/src/main/resources/xjc/mods/xlink.xsd b/jabref-logic/src/main/resources/xjc/mods/xlink.xsd similarity index 100% rename from src/main/resources/xjc/mods/xlink.xsd rename to jabref-logic/src/main/resources/xjc/mods/xlink.xsd diff --git a/src/main/resources/xjc/mods/xml.xsd b/jabref-logic/src/main/resources/xjc/mods/xml.xsd similarity index 100% rename from src/main/resources/xjc/mods/xml.xsd rename to jabref-logic/src/main/resources/xjc/mods/xml.xsd diff --git a/src/test/java/org/jabref/CatchExceptionsFromThread.java b/jabref-logic/src/test/java/org/jabref/logic/CatchExceptionsFromThread.java similarity index 90% rename from src/test/java/org/jabref/CatchExceptionsFromThread.java rename to jabref-logic/src/test/java/org/jabref/logic/CatchExceptionsFromThread.java index 16cb2c6845c..5142a1811cc 100644 --- a/src/test/java/org/jabref/CatchExceptionsFromThread.java +++ b/jabref-logic/src/test/java/org/jabref/logic/CatchExceptionsFromThread.java @@ -1,4 +1,6 @@ -package org.jabref; +package org.jabref.logic; + +import org.jabref.logic.FallbackExceptionHandler; import org.junit.rules.ExternalResource; diff --git a/src/test/java/org/jabref/logic/TypedBibEntryTest.java b/jabref-logic/src/test/java/org/jabref/logic/TypedBibEntryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/TypedBibEntryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/TypedBibEntryTest.java diff --git a/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/auxparser/AuxParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/FieldContentParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/FieldContentParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/FieldContentParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/FieldContentParserTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/LatexFieldFormatterTests.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/LatexFieldFormatterTests.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/LatexFieldFormatterTests.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/LatexFieldFormatterTests.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java diff --git a/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java diff --git a/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithDatabaseTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithDatabaseTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithDatabaseTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithDatabaseTest.java diff --git a/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithoutDatabaseTest.java b/jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithoutDatabaseTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithoutDatabaseTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithoutDatabaseTest.java diff --git a/src/test/java/org/jabref/logic/bst/BibtexCaseChangersTest.java b/jabref-logic/src/test/java/org/jabref/logic/bst/BibtexCaseChangersTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/BibtexCaseChangersTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/BibtexCaseChangersTest.java diff --git a/src/test/java/org/jabref/logic/bst/BibtexNameFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/bst/BibtexNameFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/BibtexNameFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/BibtexNameFormatterTest.java diff --git a/src/test/java/org/jabref/logic/bst/BibtexPurifyTest.java b/jabref-logic/src/test/java/org/jabref/logic/bst/BibtexPurifyTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/BibtexPurifyTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/BibtexPurifyTest.java diff --git a/src/test/java/org/jabref/logic/bst/BibtexWidthTest.java b/jabref-logic/src/test/java/org/jabref/logic/bst/BibtexWidthTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/BibtexWidthTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/BibtexWidthTest.java diff --git a/src/test/java/org/jabref/logic/bst/TestVM.java b/jabref-logic/src/test/java/org/jabref/logic/bst/TestVM.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/TestVM.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/TestVM.java diff --git a/src/test/java/org/jabref/logic/bst/TextPrefixFunctionTest.java b/jabref-logic/src/test/java/org/jabref/logic/bst/TextPrefixFunctionTest.java similarity index 100% rename from src/test/java/org/jabref/logic/bst/TextPrefixFunctionTest.java rename to jabref-logic/src/test/java/org/jabref/logic/bst/TextPrefixFunctionTest.java diff --git a/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java b/jabref-logic/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java diff --git a/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java b/jabref-logic/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java similarity index 100% rename from src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java rename to jabref-logic/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java diff --git a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java b/jabref-logic/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java diff --git a/jabref-logic/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java new file mode 100644 index 00000000000..939cabf50dd --- /dev/null +++ b/jabref-logic/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java @@ -0,0 +1,92 @@ +// TODO: incompatible with Java 9 (XMLUnit) +//package org.jabref.logic.exporter; +// +//import java.io.File; +//import java.io.IOException; +//import java.net.URISyntaxException; +//import java.nio.charset.Charset; +//import java.nio.charset.StandardCharsets; +//import java.nio.file.Files; +//import java.nio.file.Path; +//import java.nio.file.Paths; +//import java.util.Collection; +//import java.util.List; +//import java.util.stream.Collectors; +//import java.util.stream.Stream; +// +//import org.jabref.logic.importer.ImportFormatPreferences; +//import org.jabref.logic.importer.fileformat.BibtexImporter; +//import org.jabref.model.database.BibDatabaseContext; +//import org.jabref.model.entry.BibEntry; +//import org.jabref.model.util.DummyFileUpdateMonitor; +// +//import org.junit.Assert; +//import org.junit.Before; +//import org.junit.Rule; +//import org.junit.Test; +//import org.junit.rules.TemporaryFolder; +//import org.junit.runner.RunWith; +//import org.junit.runners.Parameterized; +//import org.junit.runners.Parameterized.Parameter; +//import org.junit.runners.Parameterized.Parameters; +//import org.mockito.Answers; +//import org.xmlunit.builder.Input; +//import org.xmlunit.builder.Input.Builder; +//import org.xmlunit.diff.DefaultNodeMatcher; +//import org.xmlunit.diff.ElementSelectors; +//import org.xmlunit.matchers.CompareMatcher; +// +//import static org.mockito.Mockito.mock; +// +//@RunWith(Parameterized.class) +//public class BibTeXMLExporterTestFiles { +// +// public BibDatabaseContext databaseContext; +// public Charset charset; +// public File tempFile; +// public BibTeXMLExporter bibtexmlExportFormat; +// public BibtexImporter testImporter; +// +// @Parameter +// public String filename; +// public Path resourceDir; +// +// @Rule +// public TemporaryFolder testFolder = new TemporaryFolder(); +// +// @Parameters(name = "{0}") +// public static Collection fileNames() throws IOException, URISyntaxException { +// try (Stream stream = Files.list(Paths.get(BibTeXMLExporterTestFiles.class.getResource("").toURI()))) { +// return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) +// .filter(n -> n.startsWith("BibTeXML")).collect(Collectors.toList()); +// } +// } +// +// @Before +// public void setUp() throws Exception { +// resourceDir = Paths.get(BibTeXMLExporterTestFiles.class.getResource("").toURI()); +// databaseContext = new BibDatabaseContext(); +// charset = StandardCharsets.UTF_8; +// bibtexmlExportFormat = new BibTeXMLExporter(); +// tempFile = testFolder.newFile(); +// testImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); +// } +// +// @Test +// public final void testPerformExport() throws IOException, SaveException { +// String xmlFileName = filename.replace(".bib", ".xml"); +// Path importFile = resourceDir.resolve(filename); +// String tempFilename = tempFile.getCanonicalPath(); +// +// List entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase() +// .getEntries(); +// +// bibtexmlExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); +// +// Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName))); +// Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); +// +// Assert.assertThat(test, CompareMatcher.isSimilarTo(control) +// .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); +// } +//} diff --git a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java diff --git a/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java diff --git a/src/test/java/org/jabref/logic/exporter/ExporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/ExporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/ExporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/ExporterTest.java diff --git a/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java diff --git a/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java similarity index 67% rename from src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java index 92549163859..32a88bb8a4d 100644 --- a/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java @@ -9,6 +9,7 @@ import org.jabref.logic.auxparser.DefaultAuxParser; import org.jabref.model.database.BibDatabase; +import org.jabref.model.groups.AbstractGroup; import org.jabref.model.groups.AllEntriesGroup; import org.jabref.model.groups.AutomaticGroup; import org.jabref.model.groups.AutomaticKeywordGroup; @@ -16,7 +17,6 @@ import org.jabref.model.groups.ExplicitGroup; import org.jabref.model.groups.GroupHierarchyType; import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.GroupTreeNodeTest; import org.jabref.model.groups.KeywordGroup; import org.jabref.model.groups.RegexKeywordGroup; import org.jabref.model.groups.SearchGroup; @@ -122,8 +122,8 @@ public void serializeSingleTexGroup() throws Exception { @Test public void getTreeAsStringInSimpleTree() throws Exception { - GroupTreeNode root = GroupTreeNodeTest.getRoot(); - GroupTreeNodeTest.getNodeInSimpleTree(root); + GroupTreeNode root = getRoot(); + getNodeInSimpleTree(root); List expected = Arrays.asList( "0 AllEntriesGroup:", @@ -136,8 +136,8 @@ public void getTreeAsStringInSimpleTree() throws Exception { @Test public void getTreeAsStringInComplexTree() throws Exception { - GroupTreeNode root = GroupTreeNodeTest.getRoot(); - GroupTreeNodeTest.getNodeInComplexTree(root); + GroupTreeNode root = getRoot(); + getNodeInComplexTree(root); List expected = Arrays.asList( "0 AllEntriesGroup:", @@ -158,4 +158,91 @@ public void getTreeAsStringInComplexTree() throws Exception { assertEquals(expected, groupSerializer.serializeTree(root)); } + // TODO: Java 9: following code is duplicated from GroupTreeNodeTest in the test sources of jabref-model, which became inaccessible + + /** + * Gets the marked node in the following tree of explicit groups: + * Root + * A ExplicitA, Including + * A ExplicitParent, Independent (= parent) + * B ExplicitNode, Refining (<-- this) + */ + public static GroupTreeNode getNodeInSimpleTree(GroupTreeNode root) { + root.addSubgroup(new ExplicitGroup("ExplicitA", GroupHierarchyType.INCLUDING, ',')); + GroupTreeNode parent = root + .addSubgroup(new ExplicitGroup("ExplicitParent", GroupHierarchyType.INDEPENDENT, ',')); + return parent.addSubgroup(new ExplicitGroup("ExplicitNode", GroupHierarchyType.REFINING, ',')); + } + + /** + * Gets the marked node in the following tree: + * Root + * A SearchA + * A ExplicitA, Including + * A ExplicitGrandParent (= grand parent) + * B ExplicitB + * B KeywordParent (= parent) + * C KeywordNode (<-- this) + * D ExplicitChild (= child) + * C SearchC + * C ExplicitC + * C KeywordC + * B SearchB + * B KeywordB + * A KeywordA + */ + public static GroupTreeNode getNodeInComplexTree(GroupTreeNode root) { + root.addSubgroup(getSearchGroup("SearchA")); + root.addSubgroup(new ExplicitGroup("ExplicitA", GroupHierarchyType.INCLUDING, ',')); + GroupTreeNode grandParent = root + .addSubgroup(new ExplicitGroup("ExplicitGrandParent", GroupHierarchyType.INDEPENDENT, ',')); + root.addSubgroup(getKeywordGroup("KeywordA")); + + grandParent.addSubgroup(getExplict("ExplicitB")); + GroupTreeNode parent = grandParent.addSubgroup(getKeywordGroup("KeywordParent")); + grandParent.addSubgroup(getSearchGroup("SearchB")); + grandParent.addSubgroup(getKeywordGroup("KeywordB")); + + GroupTreeNode node = parent.addSubgroup(getKeywordGroup("KeywordNode")); + parent.addSubgroup(getSearchGroup("SearchC")); + parent.addSubgroup(getExplict("ExplicitC")); + parent.addSubgroup(getKeywordGroup("KeywordC")); + + node.addSubgroup(getExplict("ExplicitChild")); + return node; + } + + private static AbstractGroup getKeywordGroup(String name) { + return new WordKeywordGroup(name, GroupHierarchyType.INDEPENDENT, "searchField", "searchExpression", true,',', false); + } + + private static AbstractGroup getSearchGroup(String name) { + return new SearchGroup(name, GroupHierarchyType.INCLUDING, "searchExpression", true, false); + } + + private static AbstractGroup getExplict(String name) { + return new ExplicitGroup(name, GroupHierarchyType.REFINING, ','); + } + + /** + * Gets the marked in the following tree: + * Root + * A + * A + * A (<- this) + * A + */ + /* + public GroupTreeNode getNodeAsChild(TreeNodeMock root) { + root.addChild(new TreeNodeMock()); + root.addChild(new TreeNodeMock()); + TreeNodeMock node = new TreeNodeMock(); + root.addChild(node); + root.addChild(new TreeNodeMock()); + return node; + } + */ + public static GroupTreeNode getRoot() { + return GroupTreeNode.fromGroup(new AllEntriesGroup("All entries")); + } } diff --git a/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java diff --git a/jabref-logic/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java new file mode 100644 index 00000000000..014aae22dd2 --- /dev/null +++ b/jabref-logic/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java @@ -0,0 +1,91 @@ +// TODO: Java 9: XMLUnit +//package org.jabref.logic.exporter; +// +//import java.io.IOException; +//import java.net.URISyntaxException; +//import java.nio.charset.Charset; +//import java.nio.charset.StandardCharsets; +//import java.nio.file.Files; +//import java.nio.file.Path; +//import java.nio.file.Paths; +//import java.util.Collection; +//import java.util.List; +//import java.util.stream.Collectors; +//import java.util.stream.Stream; +// +//import org.jabref.logic.importer.ImportFormatPreferences; +//import org.jabref.logic.importer.fileformat.BibtexImporter; +//import org.jabref.model.database.BibDatabaseContext; +//import org.jabref.model.entry.BibEntry; +//import org.jabref.model.util.DummyFileUpdateMonitor; +// +//import org.junit.Before; +//import org.junit.Rule; +//import org.junit.Test; +//import org.junit.rules.TemporaryFolder; +//import org.junit.runner.RunWith; +//import org.junit.runners.Parameterized; +//import org.junit.runners.Parameterized.Parameter; +//import org.junit.runners.Parameterized.Parameters; +//import org.mockito.Answers; +//import org.xmlunit.builder.Input; +//import org.xmlunit.builder.Input.Builder; +//import org.xmlunit.diff.DefaultNodeMatcher; +//import org.xmlunit.diff.ElementSelectors; +//import org.xmlunit.matchers.CompareMatcher; +// +//import static org.junit.Assert.assertThat; +//import static org.mockito.Mockito.mock; +// +//@RunWith(Parameterized.class) +//public class MSBibExportFormatTestFiles { +// +// public BibDatabaseContext databaseContext; +// public Charset charset; +// public Path tempFile; +// public MSBibExporter msBibExportFormat; +// public BibtexImporter testImporter; +// +// @Parameter +// public String filename; +// public Path resourceDir; +// +// @Rule +// public TemporaryFolder testFolder = new TemporaryFolder(); +// +// +// @Parameters(name = "{0}") +// public static Collection fileNames() throws IOException, URISyntaxException { +// try (Stream stream = Files.list(Paths.get(MSBibExportFormatTestFiles.class.getResource("").toURI()))) { +// return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) +// .filter(n -> n.startsWith("MsBib")).collect(Collectors.toList()); +// } +// } +// +// @Before +// public void setUp() throws Exception { +// resourceDir = Paths.get(MSBibExportFormatTestFiles.class.getResource("").toURI()); +// databaseContext = new BibDatabaseContext(); +// charset = StandardCharsets.UTF_8; +// msBibExportFormat = new MSBibExporter(); +// tempFile = testFolder.newFile().toPath(); +// testImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); +// } +// +// @Test +// public final void testPerformExport() throws IOException, SaveException { +// String xmlFileName = filename.replace(".bib", ".xml"); +// Path importFile = resourceDir.resolve(filename); +// +// List entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase() +// .getEntries(); +// +// msBibExportFormat.export(databaseContext, tempFile, charset, entries); +// +// Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName))); +// Builder test = Input.from(Files.newInputStream(tempFile)); +// +// assertThat(test, CompareMatcher.isSimilarTo(control) +// .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); +// } +//} diff --git a/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java diff --git a/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java diff --git a/jabref-logic/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java new file mode 100644 index 00000000000..b85b0e9f839 --- /dev/null +++ b/jabref-logic/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java @@ -0,0 +1,121 @@ +// TODO: Java 9: XMLUnit +//package org.jabref.logic.exporter; +// +//import java.io.File; +//import java.nio.charset.Charset; +//import java.nio.charset.StandardCharsets; +//import java.nio.file.Files; +//import java.nio.file.Path; +//import java.nio.file.Paths; +//import java.util.Collection; +//import java.util.List; +//import java.util.stream.Collectors; +//import java.util.stream.Stream; +// +//import org.jabref.logic.bibtex.BibEntryAssert; +//import org.jabref.logic.importer.ImportFormatPreferences; +//import org.jabref.logic.importer.fileformat.BibtexImporter; +//import org.jabref.logic.importer.fileformat.ModsImporter; +//import org.jabref.model.database.BibDatabaseContext; +//import org.jabref.model.entry.BibEntry; +//import org.jabref.model.util.DummyFileUpdateMonitor; +// +//import org.junit.Assert; +//import org.junit.Before; +//import org.junit.Rule; +//import org.junit.Test; +//import org.junit.rules.TemporaryFolder; +//import org.junit.runner.RunWith; +//import org.junit.runners.Parameterized; +//import org.junit.runners.Parameterized.Parameter; +//import org.junit.runners.Parameterized.Parameters; +//import org.mockito.Answers; +//import org.xmlunit.builder.Input; +//import org.xmlunit.builder.Input.Builder; +//import org.xmlunit.diff.DefaultNodeMatcher; +//import org.xmlunit.diff.ElementSelectors; +//import org.xmlunit.matchers.CompareMatcher; +// +//import static org.mockito.Mockito.mock; +// +//@RunWith(Parameterized.class) +//public class ModsExportFormatTestFiles { +// +// public Charset charset; +// private BibDatabaseContext databaseContext; +// private File tempFile; +// private ModsExporter modsExportFormat; +// private BibtexImporter bibtexImporter; +// private ModsImporter modsImporter; +// private Path importFile; +// +// +// @Parameter +// public String filename; +// +// @Rule +// public TemporaryFolder testFolder = new TemporaryFolder(); +// +// +// @Parameters(name = "{0}") +// public static Collection fileNames() throws Exception { +// try (Stream stream = Files.list(Paths.get(ModsExportFormatTestFiles.class.getResource("").toURI()))) { +// // stream.forEach(n -> System.out.println(n)); +// return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) +// .filter(n -> n.startsWith("Mods")).collect(Collectors.toList()); +// } +// } +// +// @Before +// public void setUp() throws Exception { +// databaseContext = new BibDatabaseContext(); +// importFile = Paths.get(ModsExportFormatTestFiles.class.getResource(filename).toURI()); +// charset = StandardCharsets.UTF_8; +// modsExportFormat = new ModsExporter(); +// tempFile = testFolder.newFile(); +// bibtexImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); +// modsImporter = new ModsImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); +// } +// +// @Test +// public final void testPerformExport() throws Exception { +// String xmlFileName = filename.replace(".bib", ".xml"); +// String tempFilename = tempFile.getCanonicalPath(); +// List entries = bibtexImporter.importDatabase(importFile, charset).getDatabase().getEntries(); +// Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI()); +// +// modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); +// +// Builder control = Input.from(Files.newInputStream(xmlFile)); +// Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); +// +// Assert.assertThat(test, CompareMatcher.isSimilarTo(control) +// .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); +// } +// +// @Test +// public final void testExportAsModsAndThenImportAsMods() throws Exception { +// List entries = bibtexImporter.importDatabase(importFile, charset).getDatabase().getEntries(); +// +// modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); +// BibEntryAssert.assertEquals(entries, Paths.get(tempFile.getPath()), modsImporter); +// } +// +// @Test +// public final void testImportAsModsAndExportAsMods() throws Exception { +// String xmlFileName = filename.replace(".bib", ".xml"); +// String tempFilename = tempFile.getCanonicalPath(); +// Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI()); +// +// List entries = modsImporter.importDatabase(xmlFile, charset).getDatabase().getEntries(); +// +// modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); +// +// Builder control = Input.from(Files.newInputStream(xmlFile)); +// Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); +// +// Assert.assertThat(test, CompareMatcher.isSimilarTo(control) +// .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); +// } +// +//} diff --git a/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java diff --git a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/exporter/XmpExporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/FormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/FormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/FormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/FormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/IdentityFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/IdentityFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/IdentityFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/IdentityFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/ClearFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/ClearFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/ClearFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/ClearFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeEnDashesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/RegexFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RegexFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/RegexFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RegexFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java diff --git a/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java diff --git a/src/test/java/org/jabref/logic/help/HelpFileTest.java b/jabref-logic/src/test/java/org/jabref/logic/help/HelpFileTest.java similarity index 100% rename from src/test/java/org/jabref/logic/help/HelpFileTest.java rename to jabref-logic/src/test/java/org/jabref/logic/help/HelpFileTest.java diff --git a/src/test/java/org/jabref/logic/importer/BibDatabaseTestsWithFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/BibDatabaseTestsWithFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/BibDatabaseTestsWithFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/BibDatabaseTestsWithFiles.java diff --git a/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java diff --git a/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java diff --git a/src/test/java/org/jabref/logic/importer/ImportDataTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/ImportDataTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/ImportDataTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/ImportDataTest.java diff --git a/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java diff --git a/src/test/java/org/jabref/logic/importer/ImportFormatReaderTestParameterless.java b/jabref-logic/src/test/java/org/jabref/logic/importer/ImportFormatReaderTestParameterless.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/ImportFormatReaderTestParameterless.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/ImportFormatReaderTestParameterless.java diff --git a/src/test/java/org/jabref/logic/importer/ImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/ImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/ImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/ImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java diff --git a/src/test/java/org/jabref/logic/importer/WebFetchersTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/WebFetchersTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/WebFetchersTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/WebFetchersTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java similarity index 91% rename from src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java index 01d1f31bb77..c11b94cb2bb 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java @@ -31,7 +31,7 @@ void findByDOI() throws IOException { entry.setField("doi", "10.1021/bk-2006-STYG.ch014"); assertEquals( - Optional.of(new URL("http://pubs.acs.org/doi/pdf/10.1021/bk-2006-STYG.ch014")), + Optional.of(new URL("https://pubs.acs.org/doi/pdf/10.1021/bk-2006-STYG.ch014")), finder.findFullText(entry) ); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java similarity index 98% rename from src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java index 3a438659b31..4c3fd88b745 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java @@ -191,5 +191,8 @@ public void searchIdentifierForSlicePaper() throws Exception { assertEquals(ArXivIdentifier.parse("1405.2249v1"), finder.findIdentifier(sliceTheoremPaper)); } - + @Test + public void searchEmptyId() throws Exception { + assertEquals(Optional.empty(), finder.performSearchById("")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java similarity index 98% rename from src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 5afe8a6c208..2aedc5c0473 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -136,7 +136,7 @@ public void setUp() throws Exception { @Test public void testHelpPage() { - assertEquals("ADS", fetcher.getHelpPage().getPageName()); + assertEquals("ADS", fetcher.getHelpPage().get().getPageName()); } @Test @@ -176,8 +176,7 @@ public void testPerformSearchByIdEmptyDOI() throws Exception { @Test public void testPerformSearchByIdInvalidDoi() throws Exception { - Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); - assertEquals(Optional.empty(), fetchedEntry); + assertEquals(Optional.empty(), fetcher.performSearchById("this.doi.will.fail")); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java similarity index 92% rename from src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java index cb98379e242..6c9406e6e71 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java @@ -1,9 +1,11 @@ package org.jabref.logic.importer.fetcher; +import java.util.Collections; import java.util.Locale; import java.util.Optional; import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.BibtexEntryTypes; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -115,7 +117,7 @@ public void findByEntry() throws Exception { @Test public void performSearchByIdFindsPaperWithoutTitle() throws Exception { - BibEntry entry = new BibEntry("article"); + BibEntry entry = new BibEntry(BibtexEntryTypes.ARTICLE); entry.setField("author", "Dominik Wujastyk"); entry.setField("doi", "10.1023/a:1003473214310"); entry.setField("issn", "0019-7246"); @@ -125,4 +127,14 @@ public void performSearchByIdFindsPaperWithoutTitle() throws Exception { assertEquals(Optional.of(entry), fetcher.performSearchById("10.1023/a:1003473214310")); } + + @Test + public void performSearchByEmptyId() throws Exception { + assertEquals(Optional.empty(), fetcher.performSearchById("")); + } + + @Test + public void performSearchByEmptyQuery() throws Exception { + assertEquals(Collections.emptyList(), fetcher.performSearch("")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java similarity index 83% rename from src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java index 1bbdb7eb249..51e1ba7ad97 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java @@ -28,21 +28,21 @@ public class DBLPFetcherTest { public void setUp() { ImportFormatPreferences importFormatPreferences = mock(ImportFormatPreferences.class); when(importFormatPreferences.getFieldContentParserPreferences()) - .thenReturn(mock(FieldContentParserPreferences.class)); + .thenReturn(mock(FieldContentParserPreferences.class)); dblpFetcher = new DBLPFetcher(importFormatPreferences); entry = new BibEntry(); entry.setType(BibtexEntryTypes.ARTICLE.getName()); entry.setCiteKey("DBLP:journals/stt/GeigerHL16"); entry.setField(FieldName.TITLE, - "Process Engine Benchmarking with Betsy in the Context of {ISO/IEC} Quality Standards"); + "Process Engine Benchmarking with Betsy in the Context of {ISO/IEC} Quality Standards"); entry.setField(FieldName.AUTHOR, "Matthias Geiger and Simon Harrer and J{\\\"{o}}rg Lenhard"); entry.setField(FieldName.JOURNAL, "Softwaretechnik-Trends"); entry.setField(FieldName.VOLUME, "36"); entry.setField(FieldName.NUMBER, "2"); entry.setField(FieldName.YEAR, "2016"); entry.setField(FieldName.URL, - "http://pi.informatik.uni-siegen.de/stt/36_2/./03_Technische_Beitraege/ZEUS2016/beitrag_2.pdf"); + "http://pi.informatik.uni-siegen.de/stt/36_2/./03_Technische_Beitraege/ZEUS2016/beitrag_2.pdf"); entry.setField("biburl", "https://dblp.org/rec/bib/journals/stt/GeigerHL16"); entry.setField("bibsource", "dblp computer science bibliography, https://dblp.org"); @@ -64,4 +64,9 @@ public void findSingleEntryUsingComplexOperators() throws FetcherException { assertEquals(Collections.singletonList(entry), result); } + @Test + public void findNothing() throws Exception { + assertEquals(Collections.emptyList(), dblpFetcher.performSearch("")); + } + } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java similarity index 93% rename from src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java index 4fc62ebec0f..77a0a20b925 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java @@ -31,7 +31,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryTypes.ARTICLE.getName()); + BibEntry expected = new BibEntry(BibtexEntryTypes.ARTICLE); expected.setField("author", "Wei Wang and Yun He and Tong Li and Jiajun Zhu and Jinzhuo Liu"); expected.setField("doi", "10.1155/2018/5913634"); expected.setField("issn", "1875-919X"); @@ -65,10 +65,12 @@ void testBibJSONConverter() { assertEquals(Optional.of("VLSI Design"), bibEntry.getField("journal")); assertEquals(Optional.of("10.1155/2014/217495"), bibEntry.getField("doi")); assertEquals(Optional.of("Syed Asad Alam and Oscar Gustafsson"), bibEntry.getField("author")); - assertEquals( - Optional.of( - "Design of Finite Word Length Linear-Phase FIR Filters in the Logarithmic Number System Domain"), - bibEntry.getField("title")); + assertEquals(Optional.of("Design of Finite Word Length Linear-Phase FIR Filters in the Logarithmic Number System Domain"), bibEntry.getField("title")); assertEquals(Optional.of("2014"), bibEntry.getField("year")); } + + @Test + public void searchByEmptyQuery() throws Exception { + assertEquals(Collections.emptyList(), fetcher.performSearch("")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java similarity index 90% rename from src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java index 9b7b6d2d86e..fa76e65b9b4 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java @@ -44,7 +44,7 @@ public void testPerformSearchById() throws Exception { entry.setField("institution", "Linköping University, The Institute of Technology"); entry.setCiteKey("Gustafsson260746"); entry.setField("journal", - "IEEE transactions on circuits and systems. 2, Analog and digital signal processing (Print)"); + "IEEE transactions on circuits and systems. 2, Analog and digital signal processing (Print)"); entry.setField("number", "11"); entry.setField("pages", "974--978"); entry.setField("title", "Lower bounds for constant multiplication problems"); @@ -65,4 +65,9 @@ public void testValidIdentifier() { public void testInvalidIdentifier() { assertFalse(fetcher.isValidId("banana")); } + + @Test + public void testEmptyId() throws Exception { + assertEquals(Optional.empty(), fetcher.performSearchById("")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java similarity index 97% rename from src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java index 177d48b7123..d6411540e39 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java @@ -56,7 +56,7 @@ public void testGetName() { @Test public void testGetHelpPage() { - assertEquals("DOItoBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("DOItoBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java similarity index 98% rename from src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java index 7701d92504d..fc8f1c7e12d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java @@ -63,7 +63,7 @@ public void testGetName() { @Test public void testGetHelpPage() { - assertEquals("GVK", fetcher.getHelpPage().getPageName()); + assertEquals("GVK", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GvkParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/GvkParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/GvkParserTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java similarity index 97% rename from src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java index 6567c692f96..a8a6f0fd40a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java @@ -48,7 +48,7 @@ public void testName() { @Test public void testHelpPage() { - assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java similarity index 85% rename from src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java index 658099683a7..7371043febc 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java @@ -30,7 +30,7 @@ public void setUp() { bibEntry.setField("author", "Joshua Bloch"); bibEntry.setField("isbn", "978-0321356680"); bibEntry.setField("url", - "https://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683?SubscriptionId=0JYN1NVW651KCA56C102&tag=techkie-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=0321356683"); + "https://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683?SubscriptionId=AKIAIOBINVZYXZQZ2U3A&tag=chimbori05-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=0321356683"); fetcher = new IsbnViaChimboriFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); } @@ -44,7 +44,7 @@ public void testName() { @Test @Override public void testHelpPage() { - assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test @@ -77,7 +77,7 @@ public void authorsAreCorrectlyFormatted() throws Exception { bibEntry.setField("author", "Marlon Dumas and Marcello La Rosa and Jan Mendling and Hajo A. Reijers"); bibEntry.setField("isbn", "3642434738"); bibEntry.setField("url", - "https://www.amazon.com/Fundamentals-Business-Process-Management-Marlon/dp/3642434738?SubscriptionId=0JYN1NVW651KCA56C102&tag=techkie-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=3642434738"); + "https://www.amazon.com/Fundamentals-Business-Process-Management-Marlon/dp/3642434738?SubscriptionId=AKIAIOBINVZYXZQZ2U3A&tag=chimbori05-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=3642434738"); Optional fetchedEntry = fetcher.performSearchById("3642434738"); assertEquals(Optional.of(bibEntry), fetchedEntry); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java similarity index 87% rename from src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java index cd88c970e6b..a20318709b1 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java @@ -44,7 +44,7 @@ public void testName() { @Test @Override public void testHelpPage() { - assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test @@ -66,18 +66,16 @@ public void searchByIdSuccessfulWithLongISBN() throws FetcherException { public void authorsAreCorrectlyFormatted() throws Exception { BibEntry bibEntry = new BibEntry(); bibEntry.setType(BiblatexEntryTypes.BOOK); - bibEntry.setField("bibtexkey", "9783642434730"); + bibEntry.setField("bibtexkey", "9783662565094"); bibEntry.setField("title", "Fundamentals of Business Process Management"); bibEntry.setField("publisher", "Springer Berlin Heidelberg"); - bibEntry.setField("year", "2015"); + bibEntry.setField("year", "2018"); bibEntry.setField("author", "Dumas, Marlon and Rosa, Marcello La and Mendling, Jan and Reijers, Hajo A."); - bibEntry.setField("date", "2015-04-12"); - bibEntry.setField("ean", "9783642434730"); - bibEntry.setField("isbn", "3642434738"); - bibEntry.setField("pagetotal", "428"); - bibEntry.setField("url", "https://www.ebook.de/de/product/23955263/marlon_dumas_marcello_la_rosa_jan_mendling_hajo_a_reijers_fundamentals_of_business_process_management.html"); + bibEntry.setField("date", "2018-03-23"); + bibEntry.setField("ean", "9783662565094"); + bibEntry.setField("url", "https://www.ebook.de/de/product/33399253/marlon_dumas_marcello_la_rosa_jan_mendling_hajo_a_reijers_fundamentals_of_business_process_management.html"); - Optional fetchedEntry = fetcher.performSearchById("3642434738"); + Optional fetchedEntry = fetcher.performSearchById("978-3-662-56509-4"); assertEquals(Optional.of(bibEntry), fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java similarity index 62% rename from src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java index 59f23a88b72..837e7607f6c 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java @@ -6,16 +6,24 @@ import org.jabref.model.entry.BibEntry; import org.jabref.testutils.category.FetcherTest; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.Answers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; @FetcherTest public class LibraryOfCongressTest { - private final LibraryOfCongress fetcher = new LibraryOfCongress(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); + private LibraryOfCongress fetcher; + + @BeforeEach + public void setUp() { + ImportFormatPreferences prefs = mock(ImportFormatPreferences.class); + when(prefs.getKeywordSeparator()).thenReturn(','); + fetcher = new LibraryOfCongress(prefs); + } @Test public void performSearchById() throws Exception { @@ -24,7 +32,7 @@ public void performSearchById() throws Exception { expected.setField("author", "West, Matthew"); expected.setField("isbn", "0123751063 (pbk.)"); expected.setField("issuance", "monographic"); - expected.setField("keywords", "Database design Data structures (Computer science)"); + expected.setField("keywords", "Database design, Data structures (Computer science)"); expected.setField("language", "eng"); expected.setField("lccn", "2010045158"); expected.setField("note", "Matthew West., Includes index."); @@ -36,4 +44,14 @@ public void performSearchById() throws Exception { assertEquals(Optional.of(expected), fetcher.performSearchById("2010045158")); } + + @Test + public void performSearchByEmptyId() throws Exception { + assertEquals(Optional.empty(), fetcher.performSearchById("")); + } + + @Test + public void performSearchByInvalidId() throws Exception { + assertEquals(Optional.empty(), fetcher.performSearchById("xxx")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java similarity index 96% rename from src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java index e66d81f0948..5c2f2787854 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java @@ -28,7 +28,7 @@ class MathSciNetTest { void setUp() throws Exception { ImportFormatPreferences importFormatPreferences = mock(ImportFormatPreferences.class); when(importFormatPreferences.getFieldContentParserPreferences()).thenReturn( - mock(FieldContentParserPreferences.class)); + mock(FieldContentParserPreferences.class)); fetcher = new MathSciNet(importFormatPreferences); ratiuEntry = new BibEntry(); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java similarity index 99% rename from src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java index 289aeecf698..54e7ac3944a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -128,7 +128,7 @@ public void testGetName() { @Test public void testGetHelpPage() { - assertEquals("Medline", fetcher.getHelpPage().getPageName()); + assertEquals("Medline", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java similarity index 80% rename from src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java index 9bb675fb340..0e060cc825a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java @@ -28,10 +28,7 @@ void setUp() { void findByDOI() throws IOException { entry.setField("doi", "10.1038/nature12373"); - assertEquals( - Optional.of(new URL("https://dash.harvard.edu/bitstream/handle/1/12285462/Nanometer-Scale%20Thermometry.pdf?sequence=1")), - finder.findFullText(entry) - ); + assertEquals(Optional.of(new URL("https://dash.harvard.edu/bitstream/handle/1/12285462/Nanometer-Scale%20Thermometry.pdf?sequence=1")), finder.findFullText(entry)); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java similarity index 95% rename from src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java index dbb02f25610..146be5a7e35 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java @@ -1,16 +1,17 @@ package org.jabref.logic.importer.fetcher; +import java.util.Optional; + import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BiblatexEntryTypes; import org.jabref.testutils.category.FetcherTest; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; @FetcherTest @@ -47,7 +48,7 @@ public void getNameReturnsEqualIdName() { @Test public void getHelpPageReturnsEqualHelpPage() { - assertEquals("RFCtoBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("RFCtoBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java similarity index 96% rename from src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java index 7123d5c3e50..9c250666750 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java @@ -26,7 +26,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryTypes.ARTICLE.getName()); + BibEntry expected = new BibEntry(BibtexEntryTypes.ARTICLE); expected.setField("author", "Steinmacher, Igor and Gerosa, Marco and Conte, Tayana U. and Redmiles, David F."); expected.setField("date", "2018-06-14"); expected.setField("doi", "10.1007/s10606-018-9335-z"); @@ -66,4 +66,9 @@ void testSpringerJSONToBibtex() { assertEquals(Optional.of("Springer"), bibEntry.getField("publisher")); assertEquals(Optional.of("1992-09-01"), bibEntry.getField("date")); } + + @Test + void searchByEmptyQueryFindsNothing() throws Exception { + assertEquals(Collections.emptyList(), fetcher.performSearch("")); + } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java diff --git a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java similarity index 96% rename from src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java index d4b37535b8f..728ef5de1b9 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java @@ -43,7 +43,7 @@ public void testGetName() { @Test public void testGetHelpPage() { - assertEquals("TitleToBibTeX", fetcher.getHelpPage().getPageName()); + assertEquals("TitleToBibTeX", fetcher.getHelpPage().get().getPageName()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/FreeCiteImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/FreeCiteImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/FreeCiteImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/FreeCiteImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/ModsImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTestFiles.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTestFiles.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/RISImporterTestFiles.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTestFiles.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java diff --git a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java diff --git a/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java diff --git a/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java diff --git a/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/DateCheckerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java diff --git a/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java diff --git a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java diff --git a/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java diff --git a/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java b/jabref-logic/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationTest.java b/jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationTest.java similarity index 100% rename from src/test/java/org/jabref/logic/journals/AbbreviationTest.java rename to jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationTest.java diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationsTest.java b/jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/journals/AbbreviationsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/journals/AbbreviationsTest.java diff --git a/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java b/jabref-logic/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java diff --git a/src/test/java/org/jabref/logic/journals/ShippedJournalAbbreviationDuplicateTest.java b/jabref-logic/src/test/java/org/jabref/logic/journals/ShippedJournalAbbreviationDuplicateTest.java similarity index 100% rename from src/test/java/org/jabref/logic/journals/ShippedJournalAbbreviationDuplicateTest.java rename to jabref-logic/src/test/java/org/jabref/logic/journals/ShippedJournalAbbreviationDuplicateTest.java diff --git a/src/test/java/org/jabref/logic/l10n/EncodingsTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/EncodingsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/EncodingsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/EncodingsTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LanguagesTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LanguagesTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LanguagesTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LanguagesTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationBundleForTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationBundleForTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationBundleForTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationBundleForTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationEntry.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationEntry.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationEntry.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationEntry.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationParser.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationParser.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationParser.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationParser.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationParserTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationParserTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationParserTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationParserTest.java diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/LocalizationTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/LocalizationTest.java diff --git a/src/test/java/org/jabref/logic/l10n/PropertiesLocaleCompletenessTest.java b/jabref-logic/src/test/java/org/jabref/logic/l10n/PropertiesLocaleCompletenessTest.java similarity index 100% rename from src/test/java/org/jabref/logic/l10n/PropertiesLocaleCompletenessTest.java rename to jabref-logic/src/test/java/org/jabref/logic/l10n/PropertiesLocaleCompletenessTest.java diff --git a/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/LayoutEntryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java diff --git a/src/test/java/org/jabref/logic/layout/LayoutTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/LayoutTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/LayoutTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/LayoutTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTester.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTester.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTester.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTester.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/AuthorsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/DOICheckTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/DOIStripTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/DefaultTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/DefaultTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/DefaultTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/DefaultTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/FileLinkTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/FirstPageTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/IfPluralTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/LastPageTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/LastPageTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/LastPageTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/LastPageTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/OrdinalTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/ReplaceTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/RisMonthTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/WrapContentTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java diff --git a/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java b/jabref-logic/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java similarity index 100% rename from src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java rename to jabref-logic/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java diff --git a/src/test/java/org/jabref/migrations/ConvertLegacyExplicitGroupsTest.java b/jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroupsTest.java similarity index 93% rename from src/test/java/org/jabref/migrations/ConvertLegacyExplicitGroupsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroupsTest.java index 2d46cf37ed3..c9c8d8a6663 100644 --- a/src/test/java/org/jabref/migrations/ConvertLegacyExplicitGroupsTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertLegacyExplicitGroupsTest.java @@ -1,9 +1,11 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.Collections; import java.util.Optional; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.migrations.ConvertLegacyExplicitGroups; +import org.jabref.logic.migrations.PostOpenMigration; import org.jabref.model.entry.BibEntry; import org.jabref.model.groups.AllEntriesGroup; import org.jabref.model.groups.ExplicitGroup; diff --git a/src/test/java/org/jabref/migrations/ConvertMarkingToGroupsTest.java b/jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertMarkingToGroupsTest.java similarity index 93% rename from src/test/java/org/jabref/migrations/ConvertMarkingToGroupsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertMarkingToGroupsTest.java index bf05d02903b..35052d5b0da 100644 --- a/src/test/java/org/jabref/migrations/ConvertMarkingToGroupsTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/migrations/ConvertMarkingToGroupsTest.java @@ -1,10 +1,11 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.Collections; import java.util.Optional; import org.jabref.logic.groups.DefaultGroupsFactory; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.migrations.ConvertMarkingToGroups; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; import org.jabref.model.groups.ExplicitGroup; diff --git a/src/test/java/org/jabref/migrations/MergeReviewIntoCommentActionMigrationTest.java b/jabref-logic/src/test/java/org/jabref/logic/migrations/MergeReviewIntoCommentActionMigrationTest.java similarity index 97% rename from src/test/java/org/jabref/migrations/MergeReviewIntoCommentActionMigrationTest.java rename to jabref-logic/src/test/java/org/jabref/logic/migrations/MergeReviewIntoCommentActionMigrationTest.java index 7090a14c539..9dcf0d7bceb 100644 --- a/src/test/java/org/jabref/migrations/MergeReviewIntoCommentActionMigrationTest.java +++ b/jabref-logic/src/test/java/org/jabref/logic/migrations/MergeReviewIntoCommentActionMigrationTest.java @@ -1,9 +1,10 @@ -package org.jabref.migrations; +package org.jabref.logic.migrations; import java.util.Collections; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; +import org.jabref.logic.migrations.MergeReviewIntoCommentMigration; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; diff --git a/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java b/jabref-logic/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java diff --git a/jabref-logic/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java b/jabref-logic/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java new file mode 100644 index 00000000000..a226e028ec3 --- /dev/null +++ b/jabref-logic/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java @@ -0,0 +1,100 @@ +// TODO: Java 9: Wiremock +//package org.jabref.logic.net; +// +//import java.io.IOException; +//import java.net.URISyntaxException; +// +//import com.github.tomakehurst.wiremock.junit.WireMockRule; +//import org.junit.Rule; +//import org.junit.Test; +// +//import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +//import static com.github.tomakehurst.wiremock.client.WireMock.any; +//import static com.github.tomakehurst.wiremock.client.WireMock.get; +//import static com.github.tomakehurst.wiremock.client.WireMock.head; +//import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +//import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +//import static org.junit.Assert.assertFalse; +//import static org.junit.Assert.assertTrue; +// +//public class MimeTypeDetectorTest { +// +// @Rule public WireMockRule wireMockRule = new WireMockRule(); +// +// @Test +// public void handlePermanentRedirections() throws IOException { +// String redirectedUrl = "http://localhost:8080/redirection"; +// +// stubFor(any(urlEqualTo("/redirection")) +// .willReturn( +// aResponse() +// .withStatus(301) +// .withHeader("Location", "http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.pdf") +// ) +// ); +// +// assertTrue(new URLDownload(redirectedUrl).isMimeType("application/pdf")); +// } +// +// @Test +// public void beFalseForUnreachableUrl() throws IOException { +// String invalidUrl = "http://idontknowthisurlforsure.de"; +// assertFalse(new URLDownload(invalidUrl).isMimeType("application/pdf")); +// } +// +// @Test +// public void beTrueForPdfMimeType() throws IOException { +// String pdfUrl = "http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.pdf"; +// assertTrue(new URLDownload(pdfUrl).isMimeType("application/pdf")); +// } +// +// @Test +// public void beTrueForLocalPdfUri() throws URISyntaxException, IOException { +// String localPath = MimeTypeDetectorTest.class.getResource("empty.pdf").toURI().toASCIIString(); +// assertTrue(new URLDownload(localPath).isMimeType("application/pdf")); +// } +// +// @Test +// public void beTrueForPDFMimeTypeVariations() throws IOException { +// String mimeTypeVariation = "http://localhost:8080/mimevariation"; +// +// stubFor(any(urlEqualTo("/mimevariation")) +// .willReturn( +// aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") +// ) +// ); +// +// assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); +// } +// +// @Test +// public void beAbleToUseHeadRequest() throws IOException { +// String mimeTypeVariation = "http://localhost:8080/mimevariation"; +// +// stubFor(head(urlEqualTo("/mimevariation")) +// .willReturn( +// aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") +// ) +// ); +// +// assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); +// } +// +// @Test +// public void beAbleToUseGetRequest() throws IOException { +// String mimeTypeVariation = "http://localhost:8080/mimevariation"; +// +// stubFor(head(urlEqualTo("/mimevariation")) +// .willReturn( +// aResponse().withStatus(404) +// ) +// ); +// stubFor(get(urlEqualTo("/mimevariation")) +// .willReturn( +// aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") +// ) +// ); +// +// assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); +// } +//} diff --git a/src/test/java/org/jabref/logic/net/URLDownloadTest.java b/jabref-logic/src/test/java/org/jabref/logic/net/URLDownloadTest.java similarity index 100% rename from src/test/java/org/jabref/logic/net/URLDownloadTest.java rename to jabref-logic/src/test/java/org/jabref/logic/net/URLDownloadTest.java diff --git a/src/test/java/org/jabref/logic/net/URLUtilTest.java b/jabref-logic/src/test/java/org/jabref/logic/net/URLUtilTest.java similarity index 100% rename from src/test/java/org/jabref/logic/net/URLUtilTest.java rename to jabref-logic/src/test/java/org/jabref/logic/net/URLUtilTest.java diff --git a/src/test/java/org/jabref/logic/openoffice/CitationEntryTest.java b/jabref-logic/src/test/java/org/jabref/logic/openoffice/CitationEntryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/openoffice/CitationEntryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/openoffice/CitationEntryTest.java diff --git a/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java b/jabref-logic/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java similarity index 100% rename from src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java rename to jabref-logic/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java diff --git a/src/test/java/org/jabref/logic/openoffice/OOPreFormatterTest.java b/jabref-logic/src/test/java/org/jabref/logic/openoffice/OOPreFormatterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/openoffice/OOPreFormatterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/openoffice/OOPreFormatterTest.java diff --git a/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java b/jabref-logic/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java similarity index 100% rename from src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java rename to jabref-logic/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java diff --git a/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java diff --git a/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java b/jabref-logic/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java diff --git a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java b/jabref-logic/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java similarity index 100% rename from src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java rename to jabref-logic/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java diff --git a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java b/jabref-logic/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java similarity index 100% rename from src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java rename to jabref-logic/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java diff --git a/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java b/jabref-logic/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java similarity index 100% rename from src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java rename to jabref-logic/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java diff --git a/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java b/jabref-logic/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java similarity index 100% rename from src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java rename to jabref-logic/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java diff --git a/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java b/jabref-logic/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java similarity index 100% rename from src/test/java/org/jabref/logic/remote/RemoteSetupTest.java rename to jabref-logic/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java diff --git a/src/test/java/org/jabref/logic/remote/RemoteUtilTest.java b/jabref-logic/src/test/java/org/jabref/logic/remote/RemoteUtilTest.java similarity index 100% rename from src/test/java/org/jabref/logic/remote/RemoteUtilTest.java rename to jabref-logic/src/test/java/org/jabref/logic/remote/RemoteUtilTest.java diff --git a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java b/jabref-logic/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java similarity index 100% rename from src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java rename to jabref-logic/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java diff --git a/src/test/java/org/jabref/logic/search/SearchQueryHighlightObservableTest.java b/jabref-logic/src/test/java/org/jabref/logic/search/SearchQueryHighlightObservableTest.java similarity index 100% rename from src/test/java/org/jabref/logic/search/SearchQueryHighlightObservableTest.java rename to jabref-logic/src/test/java/org/jabref/logic/search/SearchQueryHighlightObservableTest.java diff --git a/src/test/java/org/jabref/logic/search/SearchQueryTest.java b/jabref-logic/src/test/java/org/jabref/logic/search/SearchQueryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/search/SearchQueryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/search/SearchQueryTest.java diff --git a/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java b/jabref-logic/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/jabref-logic/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java diff --git a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java b/jabref-logic/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java diff --git a/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java b/jabref-logic/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/DBMSTypeTest.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationTestEventListener.java b/jabref-logic/src/test/java/org/jabref/logic/shared/SynchronizationTestEventListener.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/SynchronizationTestEventListener.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/SynchronizationTestEventListener.java diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java b/jabref-logic/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java diff --git a/src/test/java/org/jabref/logic/shared/TestConnector.java b/jabref-logic/src/test/java/org/jabref/logic/shared/TestConnector.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/TestConnector.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/TestConnector.java diff --git a/src/test/java/org/jabref/logic/shared/TestManager.java b/jabref-logic/src/test/java/org/jabref/logic/shared/TestManager.java similarity index 100% rename from src/test/java/org/jabref/logic/shared/TestManager.java rename to jabref-logic/src/test/java/org/jabref/logic/shared/TestManager.java diff --git a/src/test/java/org/jabref/logic/specialfields/SpecialFieldsUtilsTest.java b/jabref-logic/src/test/java/org/jabref/logic/specialfields/SpecialFieldsUtilsTest.java similarity index 100% rename from src/test/java/org/jabref/logic/specialfields/SpecialFieldsUtilsTest.java rename to jabref-logic/src/test/java/org/jabref/logic/specialfields/SpecialFieldsUtilsTest.java diff --git a/src/test/java/org/jabref/logic/util/BracketedPatternTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/BracketedPatternTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/BracketedPatternTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/BracketedPatternTest.java diff --git a/src/test/java/org/jabref/logic/util/BuildInfoTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/BuildInfoTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/BuildInfoTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/BuildInfoTest.java diff --git a/src/test/java/org/jabref/logic/util/DevelopmentStageTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/DevelopmentStageTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/DevelopmentStageTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/DevelopmentStageTest.java diff --git a/src/test/java/org/jabref/logic/util/JavaVersionTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/JavaVersionTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/JavaVersionTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/JavaVersionTest.java diff --git a/src/test/java/org/jabref/logic/util/UpdateFieldTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/UpdateFieldTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/UpdateFieldTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/UpdateFieldTest.java diff --git a/src/test/java/org/jabref/logic/util/VersionTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/VersionTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/VersionTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/VersionTest.java diff --git a/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java diff --git a/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/io/FileHistoryTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java diff --git a/src/test/java/org/jabref/logic/util/io/FileNameCleanerTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/io/FileNameCleanerTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/io/FileNameCleanerTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/io/FileNameCleanerTest.java diff --git a/src/test/java/org/jabref/logic/util/io/FileUtilTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/io/FileUtilTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/io/FileUtilTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/io/FileUtilTest.java diff --git a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java b/jabref-logic/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java similarity index 100% rename from src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java rename to jabref-logic/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java diff --git a/src/test/java/org/jabref/logic/util/strings/DiffHighlightingTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/strings/DiffHighlightingTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/strings/DiffHighlightingTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/strings/DiffHighlightingTest.java diff --git a/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java b/jabref-logic/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java similarity index 100% rename from src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java rename to jabref-logic/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java b/jabref-logic/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java similarity index 100% rename from src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java rename to jabref-logic/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java b/jabref-logic/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java similarity index 100% rename from src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java rename to jabref-logic/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java diff --git a/jabref-model/build.gradle b/jabref-model/build.gradle new file mode 100644 index 00000000000..cc0a4314ac1 --- /dev/null +++ b/jabref-model/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'com.zyxist.chainsaw' +} + +apply plugin: 'java' +apply plugin: org.jabref.build.antlr.AntlrPlugin + +sourceSets.main.java.srcDirs += "src/main/gen" + +repositories { + mavenLocal() + jcenter() + maven { + url 'https://oss.sonatype.org/content/groups/public' + } +} + +dependencies { + antlr4 'org.antlr:antlr4:4.7.1' + compile 'org.antlr:antlr4-runtime:4.7.1' + + compile 'com.google.guava:guava:25.1-jre' + + compile 'org.apache.pdfbox:pdfbox:2.0.11' + compile 'org.apache.pdfbox:fontbox:2.0.11' + compile 'org.apache.pdfbox:xmpbox:2.0.11' + + // >1.8.0-beta is required for java 9 compatibility + compile 'org.slf4j:slf4j-api:1.8.0-beta2' + + compile 'org.apache.commons:commons-lang3:3.7' + + + testCompile group: 'junit', name: 'junit', version: '4.12' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0' + testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.2.0' + testCompile 'org.junit.platform:junit-platform-launcher:1.2.0' + testCompile 'org.junit-pioneer:junit-pioneer:0.1.2' + testRuntime 'org.apache.logging.log4j:log4j-core:2.11.0' + testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.0' + + testCompile 'org.mockito:mockito-core:2.19.1' +} + +clean { + delete "src/main/gen" +} + +compileJava.dependsOn "generateSearchGrammarSource" + +task generateSearchGrammarSource(type: org.jabref.build.antlr.AntlrTask) { + group = 'JabRef' + description = "Generates java files for Search.g antlr4." + + antlr = ANTLR4 + inputFile = "src/main/antlr4/org/jabref/search/Search.g4" + outputDir = "src/main/gen/org/jabref/search" + javaPackage = "org.jabref.search" +} + diff --git a/src/main/antlr4/org/jabref/search/Search.g4 b/jabref-model/src/main/antlr4/org/jabref/search/Search.g4 similarity index 100% rename from src/main/antlr4/org/jabref/search/Search.g4 rename to jabref-model/src/main/antlr4/org/jabref/search/Search.g4 diff --git a/jabref-model/src/main/java/module-info.java b/jabref-model/src/main/java/module-info.java new file mode 100644 index 00000000000..716309d6e71 --- /dev/null +++ b/jabref-model/src/main/java/module-info.java @@ -0,0 +1,35 @@ +open module org.jabref.model { + + exports org.jabref.architecture; + exports org.jabref.model; + exports org.jabref.model.auxparser; + exports org.jabref.model.bibtexkeypattern; + exports org.jabref.model.cleanup; + exports org.jabref.model.database; + exports org.jabref.model.database.event; + exports org.jabref.model.database.shared; + exports org.jabref.model.entry; + exports org.jabref.model.entry.event; + exports org.jabref.model.entry.identifier; + exports org.jabref.model.entry.specialfields; + exports org.jabref.model.groups; + exports org.jabref.model.groups.event; + exports org.jabref.model.metadata; + exports org.jabref.model.metadata.event; + exports org.jabref.model.pdf; + exports org.jabref.model.search; + exports org.jabref.model.search.matchers; + exports org.jabref.model.search.rules; + exports org.jabref.model.strings; + exports org.jabref.model.util; + exports org.jabref.search; + + requires javafx.base; + requires javafx.graphics; + + requires java.sql; + + requires com.google.common; + requires org.slf4j; + +} diff --git a/src/main/java/org/jabref/architecture/ApacheCommonsLang3Allowed.java b/jabref-model/src/main/java/org/jabref/architecture/ApacheCommonsLang3Allowed.java similarity index 100% rename from src/main/java/org/jabref/architecture/ApacheCommonsLang3Allowed.java rename to jabref-model/src/main/java/org/jabref/architecture/ApacheCommonsLang3Allowed.java diff --git a/src/main/java/org/jabref/model/ChainNode.java b/jabref-model/src/main/java/org/jabref/model/ChainNode.java similarity index 100% rename from src/main/java/org/jabref/model/ChainNode.java rename to jabref-model/src/main/java/org/jabref/model/ChainNode.java diff --git a/src/main/java/org/jabref/model/Defaults.java b/jabref-model/src/main/java/org/jabref/model/Defaults.java similarity index 100% rename from src/main/java/org/jabref/model/Defaults.java rename to jabref-model/src/main/java/org/jabref/model/Defaults.java diff --git a/src/main/java/org/jabref/model/EntryTypes.java b/jabref-model/src/main/java/org/jabref/model/EntryTypes.java similarity index 100% rename from src/main/java/org/jabref/model/EntryTypes.java rename to jabref-model/src/main/java/org/jabref/model/EntryTypes.java diff --git a/src/main/java/org/jabref/model/FieldChange.java b/jabref-model/src/main/java/org/jabref/model/FieldChange.java similarity index 100% rename from src/main/java/org/jabref/model/FieldChange.java rename to jabref-model/src/main/java/org/jabref/model/FieldChange.java diff --git a/src/main/java/org/jabref/model/TreeNode.java b/jabref-model/src/main/java/org/jabref/model/TreeNode.java similarity index 100% rename from src/main/java/org/jabref/model/TreeNode.java rename to jabref-model/src/main/java/org/jabref/model/TreeNode.java diff --git a/src/main/java/org/jabref/model/auxparser/AuxParser.java b/jabref-model/src/main/java/org/jabref/model/auxparser/AuxParser.java similarity index 100% rename from src/main/java/org/jabref/model/auxparser/AuxParser.java rename to jabref-model/src/main/java/org/jabref/model/auxparser/AuxParser.java diff --git a/src/main/java/org/jabref/model/auxparser/AuxParserResult.java b/jabref-model/src/main/java/org/jabref/model/auxparser/AuxParserResult.java similarity index 100% rename from src/main/java/org/jabref/model/auxparser/AuxParserResult.java rename to jabref-model/src/main/java/org/jabref/model/auxparser/AuxParserResult.java diff --git a/src/main/java/org/jabref/model/bibtexkeypattern/AbstractBibtexKeyPattern.java b/jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/AbstractBibtexKeyPattern.java similarity index 100% rename from src/main/java/org/jabref/model/bibtexkeypattern/AbstractBibtexKeyPattern.java rename to jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/AbstractBibtexKeyPattern.java diff --git a/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java b/jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java similarity index 100% rename from src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java rename to jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java diff --git a/src/main/java/org/jabref/model/bibtexkeypattern/GlobalBibtexKeyPattern.java b/jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/GlobalBibtexKeyPattern.java similarity index 100% rename from src/main/java/org/jabref/model/bibtexkeypattern/GlobalBibtexKeyPattern.java rename to jabref-model/src/main/java/org/jabref/model/bibtexkeypattern/GlobalBibtexKeyPattern.java diff --git a/src/main/java/org/jabref/model/cleanup/CleanupJob.java b/jabref-model/src/main/java/org/jabref/model/cleanup/CleanupJob.java similarity index 100% rename from src/main/java/org/jabref/model/cleanup/CleanupJob.java rename to jabref-model/src/main/java/org/jabref/model/cleanup/CleanupJob.java diff --git a/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanup.java b/jabref-model/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanup.java similarity index 100% rename from src/main/java/org/jabref/model/cleanup/FieldFormatterCleanup.java rename to jabref-model/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanup.java diff --git a/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java b/jabref-model/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java similarity index 100% rename from src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java rename to jabref-model/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java diff --git a/src/main/java/org/jabref/model/cleanup/Formatter.java b/jabref-model/src/main/java/org/jabref/model/cleanup/Formatter.java similarity index 100% rename from src/main/java/org/jabref/model/cleanup/Formatter.java rename to jabref-model/src/main/java/org/jabref/model/cleanup/Formatter.java diff --git a/src/main/java/org/jabref/model/database/BibDatabase.java b/jabref-model/src/main/java/org/jabref/model/database/BibDatabase.java similarity index 100% rename from src/main/java/org/jabref/model/database/BibDatabase.java rename to jabref-model/src/main/java/org/jabref/model/database/BibDatabase.java diff --git a/src/main/java/org/jabref/model/database/BibDatabaseContext.java b/jabref-model/src/main/java/org/jabref/model/database/BibDatabaseContext.java similarity index 100% rename from src/main/java/org/jabref/model/database/BibDatabaseContext.java rename to jabref-model/src/main/java/org/jabref/model/database/BibDatabaseContext.java diff --git a/src/main/java/org/jabref/model/database/BibDatabaseMode.java b/jabref-model/src/main/java/org/jabref/model/database/BibDatabaseMode.java similarity index 100% rename from src/main/java/org/jabref/model/database/BibDatabaseMode.java rename to jabref-model/src/main/java/org/jabref/model/database/BibDatabaseMode.java diff --git a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java b/jabref-model/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java similarity index 100% rename from src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java rename to jabref-model/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java diff --git a/src/main/java/org/jabref/model/database/BibDatabases.java b/jabref-model/src/main/java/org/jabref/model/database/BibDatabases.java similarity index 100% rename from src/main/java/org/jabref/model/database/BibDatabases.java rename to jabref-model/src/main/java/org/jabref/model/database/BibDatabases.java diff --git a/src/main/java/org/jabref/model/database/DuplicationChecker.java b/jabref-model/src/main/java/org/jabref/model/database/DuplicationChecker.java similarity index 100% rename from src/main/java/org/jabref/model/database/DuplicationChecker.java rename to jabref-model/src/main/java/org/jabref/model/database/DuplicationChecker.java diff --git a/src/main/java/org/jabref/model/database/KeyChangeListener.java b/jabref-model/src/main/java/org/jabref/model/database/KeyChangeListener.java similarity index 100% rename from src/main/java/org/jabref/model/database/KeyChangeListener.java rename to jabref-model/src/main/java/org/jabref/model/database/KeyChangeListener.java diff --git a/src/main/java/org/jabref/model/database/KeyCollisionException.java b/jabref-model/src/main/java/org/jabref/model/database/KeyCollisionException.java similarity index 100% rename from src/main/java/org/jabref/model/database/KeyCollisionException.java rename to jabref-model/src/main/java/org/jabref/model/database/KeyCollisionException.java diff --git a/src/main/java/org/jabref/model/database/event/AutosaveEvent.java b/jabref-model/src/main/java/org/jabref/model/database/event/AutosaveEvent.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/AutosaveEvent.java rename to jabref-model/src/main/java/org/jabref/model/database/event/AutosaveEvent.java diff --git a/src/main/java/org/jabref/model/database/event/BibDatabaseContextChangedEvent.java b/jabref-model/src/main/java/org/jabref/model/database/event/BibDatabaseContextChangedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/BibDatabaseContextChangedEvent.java rename to jabref-model/src/main/java/org/jabref/model/database/event/BibDatabaseContextChangedEvent.java diff --git a/src/main/java/org/jabref/model/database/event/ChangePropagation.java b/jabref-model/src/main/java/org/jabref/model/database/event/ChangePropagation.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/ChangePropagation.java rename to jabref-model/src/main/java/org/jabref/model/database/event/ChangePropagation.java diff --git a/src/main/java/org/jabref/model/database/event/CoarseChangeFilter.java b/jabref-model/src/main/java/org/jabref/model/database/event/CoarseChangeFilter.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/CoarseChangeFilter.java rename to jabref-model/src/main/java/org/jabref/model/database/event/CoarseChangeFilter.java diff --git a/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java b/jabref-model/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/EntryAddedEvent.java rename to jabref-model/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java diff --git a/src/main/java/org/jabref/model/database/event/EntryRemovedEvent.java b/jabref-model/src/main/java/org/jabref/model/database/event/EntryRemovedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/database/event/EntryRemovedEvent.java rename to jabref-model/src/main/java/org/jabref/model/database/event/EntryRemovedEvent.java diff --git a/src/main/java/org/jabref/model/database/shared/DBMSType.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DBMSType.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DBMSType.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DBMSType.java diff --git a/src/main/java/org/jabref/model/database/shared/DatabaseConnection.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseConnection.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DatabaseConnection.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseConnection.java diff --git a/src/main/java/org/jabref/model/database/shared/DatabaseConnectionProperties.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseConnectionProperties.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DatabaseConnectionProperties.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseConnectionProperties.java diff --git a/src/main/java/org/jabref/model/database/shared/DatabaseLocation.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseLocation.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DatabaseLocation.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseLocation.java diff --git a/src/main/java/org/jabref/model/database/shared/DatabaseNotSupportedException.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseNotSupportedException.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DatabaseNotSupportedException.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseNotSupportedException.java diff --git a/src/main/java/org/jabref/model/database/shared/DatabaseSynchronizer.java b/jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseSynchronizer.java similarity index 100% rename from src/main/java/org/jabref/model/database/shared/DatabaseSynchronizer.java rename to jabref-model/src/main/java/org/jabref/model/database/shared/DatabaseSynchronizer.java diff --git a/src/main/java/org/jabref/model/entry/Author.java b/jabref-model/src/main/java/org/jabref/model/entry/Author.java similarity index 100% rename from src/main/java/org/jabref/model/entry/Author.java rename to jabref-model/src/main/java/org/jabref/model/entry/Author.java diff --git a/src/main/java/org/jabref/model/entry/AuthorList.java b/jabref-model/src/main/java/org/jabref/model/entry/AuthorList.java similarity index 100% rename from src/main/java/org/jabref/model/entry/AuthorList.java rename to jabref-model/src/main/java/org/jabref/model/entry/AuthorList.java diff --git a/src/main/java/org/jabref/model/entry/AuthorListParser.java b/jabref-model/src/main/java/org/jabref/model/entry/AuthorListParser.java similarity index 100% rename from src/main/java/org/jabref/model/entry/AuthorListParser.java rename to jabref-model/src/main/java/org/jabref/model/entry/AuthorListParser.java diff --git a/src/main/java/org/jabref/model/entry/BibEntry.java b/jabref-model/src/main/java/org/jabref/model/entry/BibEntry.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BibEntry.java rename to jabref-model/src/main/java/org/jabref/model/entry/BibEntry.java diff --git a/src/main/java/org/jabref/model/entry/BiblatexEntryType.java b/jabref-model/src/main/java/org/jabref/model/entry/BiblatexEntryType.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BiblatexEntryType.java rename to jabref-model/src/main/java/org/jabref/model/entry/BiblatexEntryType.java diff --git a/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java b/jabref-model/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java rename to jabref-model/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java diff --git a/src/main/java/org/jabref/model/entry/BibtexEntryType.java b/jabref-model/src/main/java/org/jabref/model/entry/BibtexEntryType.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BibtexEntryType.java rename to jabref-model/src/main/java/org/jabref/model/entry/BibtexEntryType.java diff --git a/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java b/jabref-model/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BibtexEntryTypes.java rename to jabref-model/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java diff --git a/src/main/java/org/jabref/model/entry/BibtexSingleField.java b/jabref-model/src/main/java/org/jabref/model/entry/BibtexSingleField.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BibtexSingleField.java rename to jabref-model/src/main/java/org/jabref/model/entry/BibtexSingleField.java diff --git a/src/main/java/org/jabref/model/entry/BibtexString.java b/jabref-model/src/main/java/org/jabref/model/entry/BibtexString.java similarity index 100% rename from src/main/java/org/jabref/model/entry/BibtexString.java rename to jabref-model/src/main/java/org/jabref/model/entry/BibtexString.java diff --git a/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java b/jabref-model/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java similarity index 100% rename from src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java rename to jabref-model/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java diff --git a/src/main/java/org/jabref/model/entry/CustomEntryType.java b/jabref-model/src/main/java/org/jabref/model/entry/CustomEntryType.java similarity index 100% rename from src/main/java/org/jabref/model/entry/CustomEntryType.java rename to jabref-model/src/main/java/org/jabref/model/entry/CustomEntryType.java diff --git a/src/main/java/org/jabref/model/entry/Date.java b/jabref-model/src/main/java/org/jabref/model/entry/Date.java similarity index 100% rename from src/main/java/org/jabref/model/entry/Date.java rename to jabref-model/src/main/java/org/jabref/model/entry/Date.java diff --git a/src/main/java/org/jabref/model/entry/EntryConverter.java b/jabref-model/src/main/java/org/jabref/model/entry/EntryConverter.java similarity index 100% rename from src/main/java/org/jabref/model/entry/EntryConverter.java rename to jabref-model/src/main/java/org/jabref/model/entry/EntryConverter.java diff --git a/src/main/java/org/jabref/model/entry/EntryLinkList.java b/jabref-model/src/main/java/org/jabref/model/entry/EntryLinkList.java similarity index 100% rename from src/main/java/org/jabref/model/entry/EntryLinkList.java rename to jabref-model/src/main/java/org/jabref/model/entry/EntryLinkList.java diff --git a/src/main/java/org/jabref/model/entry/EntryType.java b/jabref-model/src/main/java/org/jabref/model/entry/EntryType.java similarity index 100% rename from src/main/java/org/jabref/model/entry/EntryType.java rename to jabref-model/src/main/java/org/jabref/model/entry/EntryType.java diff --git a/src/main/java/org/jabref/model/entry/FieldName.java b/jabref-model/src/main/java/org/jabref/model/entry/FieldName.java similarity index 100% rename from src/main/java/org/jabref/model/entry/FieldName.java rename to jabref-model/src/main/java/org/jabref/model/entry/FieldName.java diff --git a/src/main/java/org/jabref/model/entry/FieldProperty.java b/jabref-model/src/main/java/org/jabref/model/entry/FieldProperty.java similarity index 100% rename from src/main/java/org/jabref/model/entry/FieldProperty.java rename to jabref-model/src/main/java/org/jabref/model/entry/FieldProperty.java diff --git a/src/main/java/org/jabref/model/entry/FileFieldParser.java b/jabref-model/src/main/java/org/jabref/model/entry/FileFieldParser.java similarity index 100% rename from src/main/java/org/jabref/model/entry/FileFieldParser.java rename to jabref-model/src/main/java/org/jabref/model/entry/FileFieldParser.java diff --git a/src/main/java/org/jabref/model/entry/FileFieldWriter.java b/jabref-model/src/main/java/org/jabref/model/entry/FileFieldWriter.java similarity index 100% rename from src/main/java/org/jabref/model/entry/FileFieldWriter.java rename to jabref-model/src/main/java/org/jabref/model/entry/FileFieldWriter.java diff --git a/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java b/jabref-model/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java similarity index 100% rename from src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java rename to jabref-model/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java diff --git a/src/main/java/org/jabref/model/entry/IdGenerator.java b/jabref-model/src/main/java/org/jabref/model/entry/IdGenerator.java similarity index 100% rename from src/main/java/org/jabref/model/entry/IdGenerator.java rename to jabref-model/src/main/java/org/jabref/model/entry/IdGenerator.java diff --git a/src/main/java/org/jabref/model/entry/InternalBibtexFields.java b/jabref-model/src/main/java/org/jabref/model/entry/InternalBibtexFields.java similarity index 100% rename from src/main/java/org/jabref/model/entry/InternalBibtexFields.java rename to jabref-model/src/main/java/org/jabref/model/entry/InternalBibtexFields.java diff --git a/src/main/java/org/jabref/model/entry/Keyword.java b/jabref-model/src/main/java/org/jabref/model/entry/Keyword.java similarity index 100% rename from src/main/java/org/jabref/model/entry/Keyword.java rename to jabref-model/src/main/java/org/jabref/model/entry/Keyword.java diff --git a/src/main/java/org/jabref/model/entry/KeywordList.java b/jabref-model/src/main/java/org/jabref/model/entry/KeywordList.java similarity index 100% rename from src/main/java/org/jabref/model/entry/KeywordList.java rename to jabref-model/src/main/java/org/jabref/model/entry/KeywordList.java diff --git a/src/main/java/org/jabref/model/entry/LinkedFile.java b/jabref-model/src/main/java/org/jabref/model/entry/LinkedFile.java similarity index 100% rename from src/main/java/org/jabref/model/entry/LinkedFile.java rename to jabref-model/src/main/java/org/jabref/model/entry/LinkedFile.java diff --git a/src/main/java/org/jabref/model/entry/Month.java b/jabref-model/src/main/java/org/jabref/model/entry/Month.java similarity index 100% rename from src/main/java/org/jabref/model/entry/Month.java rename to jabref-model/src/main/java/org/jabref/model/entry/Month.java diff --git a/src/main/java/org/jabref/model/entry/ParsedEntryLink.java b/jabref-model/src/main/java/org/jabref/model/entry/ParsedEntryLink.java similarity index 100% rename from src/main/java/org/jabref/model/entry/ParsedEntryLink.java rename to jabref-model/src/main/java/org/jabref/model/entry/ParsedEntryLink.java diff --git a/src/main/java/org/jabref/model/entry/SharedBibEntryData.java b/jabref-model/src/main/java/org/jabref/model/entry/SharedBibEntryData.java similarity index 100% rename from src/main/java/org/jabref/model/entry/SharedBibEntryData.java rename to jabref-model/src/main/java/org/jabref/model/entry/SharedBibEntryData.java diff --git a/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java b/jabref-model/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java rename to jabref-model/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java diff --git a/src/main/java/org/jabref/model/entry/event/EntryEvent.java b/jabref-model/src/main/java/org/jabref/model/entry/event/EntryEvent.java similarity index 100% rename from src/main/java/org/jabref/model/entry/event/EntryEvent.java rename to jabref-model/src/main/java/org/jabref/model/entry/event/EntryEvent.java diff --git a/src/main/java/org/jabref/model/entry/event/EntryEventSource.java b/jabref-model/src/main/java/org/jabref/model/entry/event/EntryEventSource.java similarity index 100% rename from src/main/java/org/jabref/model/entry/event/EntryEventSource.java rename to jabref-model/src/main/java/org/jabref/model/entry/event/EntryEventSource.java diff --git a/src/main/java/org/jabref/model/entry/event/FieldAddedOrRemovedEvent.java b/jabref-model/src/main/java/org/jabref/model/entry/event/FieldAddedOrRemovedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/entry/event/FieldAddedOrRemovedEvent.java rename to jabref-model/src/main/java/org/jabref/model/entry/event/FieldAddedOrRemovedEvent.java diff --git a/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java b/jabref-model/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java rename to jabref-model/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java diff --git a/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java similarity index 82% rename from src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java index ba3e428f9ca..8b9287d3e2b 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java +++ b/jabref-model/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java @@ -22,8 +22,12 @@ public static Optional parse(String value) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if ((o == null) || (getClass() != o.getClass())) { + return false; + } ArXivIdentifier that = (ArXivIdentifier) o; @@ -45,6 +49,11 @@ public String getNormalized() { return identifier; } + @Override + public String toString() { + return "ArXivIdentifier [identifier=" + identifier + "]"; + } + @Override public Optional getExternalURI() { try { diff --git a/src/main/java/org/jabref/model/entry/identifier/DOI.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/DOI.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/DOI.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/DOI.java diff --git a/src/main/java/org/jabref/model/entry/identifier/Eprint.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/Eprint.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/Eprint.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/Eprint.java diff --git a/src/main/java/org/jabref/model/entry/identifier/ISBN.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/ISBN.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/ISBN.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/ISBN.java diff --git a/src/main/java/org/jabref/model/entry/identifier/ISSN.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/ISSN.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/ISSN.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/ISSN.java diff --git a/src/main/java/org/jabref/model/entry/identifier/Identifier.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/Identifier.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/Identifier.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/Identifier.java diff --git a/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java b/jabref-model/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java similarity index 100% rename from src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java rename to jabref-model/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java diff --git a/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java b/jabref-model/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java similarity index 100% rename from src/main/java/org/jabref/model/entry/specialfields/SpecialField.java rename to jabref-model/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java diff --git a/src/main/java/org/jabref/model/entry/specialfields/SpecialFieldValue.java b/jabref-model/src/main/java/org/jabref/model/entry/specialfields/SpecialFieldValue.java similarity index 100% rename from src/main/java/org/jabref/model/entry/specialfields/SpecialFieldValue.java rename to jabref-model/src/main/java/org/jabref/model/entry/specialfields/SpecialFieldValue.java diff --git a/src/main/java/org/jabref/model/groups/AbstractGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/AbstractGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/AbstractGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/AbstractGroup.java diff --git a/src/main/java/org/jabref/model/groups/AllEntriesGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/AllEntriesGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/AllEntriesGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/AllEntriesGroup.java diff --git a/src/main/java/org/jabref/model/groups/AutomaticGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/AutomaticGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/AutomaticGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/AutomaticGroup.java diff --git a/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java diff --git a/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java diff --git a/src/main/java/org/jabref/model/groups/ExplicitGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/ExplicitGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/ExplicitGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/ExplicitGroup.java diff --git a/src/main/java/org/jabref/model/groups/GroupEntryChanger.java b/jabref-model/src/main/java/org/jabref/model/groups/GroupEntryChanger.java similarity index 100% rename from src/main/java/org/jabref/model/groups/GroupEntryChanger.java rename to jabref-model/src/main/java/org/jabref/model/groups/GroupEntryChanger.java diff --git a/src/main/java/org/jabref/model/groups/GroupHierarchyType.java b/jabref-model/src/main/java/org/jabref/model/groups/GroupHierarchyType.java similarity index 100% rename from src/main/java/org/jabref/model/groups/GroupHierarchyType.java rename to jabref-model/src/main/java/org/jabref/model/groups/GroupHierarchyType.java diff --git a/src/main/java/org/jabref/model/groups/GroupTreeNode.java b/jabref-model/src/main/java/org/jabref/model/groups/GroupTreeNode.java similarity index 100% rename from src/main/java/org/jabref/model/groups/GroupTreeNode.java rename to jabref-model/src/main/java/org/jabref/model/groups/GroupTreeNode.java diff --git a/src/main/java/org/jabref/model/groups/KeywordGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/KeywordGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/KeywordGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/KeywordGroup.java diff --git a/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/RegexKeywordGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java diff --git a/src/main/java/org/jabref/model/groups/SearchGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/SearchGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/SearchGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/SearchGroup.java diff --git a/src/main/java/org/jabref/model/groups/TexGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/TexGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/TexGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/TexGroup.java diff --git a/src/main/java/org/jabref/model/groups/WordKeywordGroup.java b/jabref-model/src/main/java/org/jabref/model/groups/WordKeywordGroup.java similarity index 100% rename from src/main/java/org/jabref/model/groups/WordKeywordGroup.java rename to jabref-model/src/main/java/org/jabref/model/groups/WordKeywordGroup.java diff --git a/src/main/java/org/jabref/model/groups/event/GroupUpdatedEvent.java b/jabref-model/src/main/java/org/jabref/model/groups/event/GroupUpdatedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/groups/event/GroupUpdatedEvent.java rename to jabref-model/src/main/java/org/jabref/model/groups/event/GroupUpdatedEvent.java diff --git a/src/main/java/org/jabref/model/metadata/ContentSelector.java b/jabref-model/src/main/java/org/jabref/model/metadata/ContentSelector.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/ContentSelector.java rename to jabref-model/src/main/java/org/jabref/model/metadata/ContentSelector.java diff --git a/src/main/java/org/jabref/model/metadata/ContentSelectors.java b/jabref-model/src/main/java/org/jabref/model/metadata/ContentSelectors.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/ContentSelectors.java rename to jabref-model/src/main/java/org/jabref/model/metadata/ContentSelectors.java diff --git a/src/main/java/org/jabref/model/metadata/FileDirectoryPreferences.java b/jabref-model/src/main/java/org/jabref/model/metadata/FileDirectoryPreferences.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/FileDirectoryPreferences.java rename to jabref-model/src/main/java/org/jabref/model/metadata/FileDirectoryPreferences.java diff --git a/src/main/java/org/jabref/model/metadata/MetaData.java b/jabref-model/src/main/java/org/jabref/model/metadata/MetaData.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/MetaData.java rename to jabref-model/src/main/java/org/jabref/model/metadata/MetaData.java diff --git a/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java b/jabref-model/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/SaveOrderConfig.java rename to jabref-model/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java diff --git a/src/main/java/org/jabref/model/metadata/event/MetaDataChangedEvent.java b/jabref-model/src/main/java/org/jabref/model/metadata/event/MetaDataChangedEvent.java similarity index 100% rename from src/main/java/org/jabref/model/metadata/event/MetaDataChangedEvent.java rename to jabref-model/src/main/java/org/jabref/model/metadata/event/MetaDataChangedEvent.java diff --git a/src/main/java/org/jabref/model/pdf/FileAnnotation.java b/jabref-model/src/main/java/org/jabref/model/pdf/FileAnnotation.java similarity index 100% rename from src/main/java/org/jabref/model/pdf/FileAnnotation.java rename to jabref-model/src/main/java/org/jabref/model/pdf/FileAnnotation.java diff --git a/src/main/java/org/jabref/model/pdf/FileAnnotationType.java b/jabref-model/src/main/java/org/jabref/model/pdf/FileAnnotationType.java similarity index 100% rename from src/main/java/org/jabref/model/pdf/FileAnnotationType.java rename to jabref-model/src/main/java/org/jabref/model/pdf/FileAnnotationType.java diff --git a/src/main/java/org/jabref/model/search/GroupSearchQuery.java b/jabref-model/src/main/java/org/jabref/model/search/GroupSearchQuery.java similarity index 100% rename from src/main/java/org/jabref/model/search/GroupSearchQuery.java rename to jabref-model/src/main/java/org/jabref/model/search/GroupSearchQuery.java diff --git a/src/main/java/org/jabref/model/search/SearchMatcher.java b/jabref-model/src/main/java/org/jabref/model/search/SearchMatcher.java similarity index 100% rename from src/main/java/org/jabref/model/search/SearchMatcher.java rename to jabref-model/src/main/java/org/jabref/model/search/SearchMatcher.java diff --git a/src/main/java/org/jabref/model/search/matchers/AndMatcher.java b/jabref-model/src/main/java/org/jabref/model/search/matchers/AndMatcher.java similarity index 100% rename from src/main/java/org/jabref/model/search/matchers/AndMatcher.java rename to jabref-model/src/main/java/org/jabref/model/search/matchers/AndMatcher.java diff --git a/src/main/java/org/jabref/model/search/matchers/MatcherSet.java b/jabref-model/src/main/java/org/jabref/model/search/matchers/MatcherSet.java similarity index 100% rename from src/main/java/org/jabref/model/search/matchers/MatcherSet.java rename to jabref-model/src/main/java/org/jabref/model/search/matchers/MatcherSet.java diff --git a/src/main/java/org/jabref/model/search/matchers/MatcherSets.java b/jabref-model/src/main/java/org/jabref/model/search/matchers/MatcherSets.java similarity index 100% rename from src/main/java/org/jabref/model/search/matchers/MatcherSets.java rename to jabref-model/src/main/java/org/jabref/model/search/matchers/MatcherSets.java diff --git a/src/main/java/org/jabref/model/search/matchers/NotMatcher.java b/jabref-model/src/main/java/org/jabref/model/search/matchers/NotMatcher.java similarity index 100% rename from src/main/java/org/jabref/model/search/matchers/NotMatcher.java rename to jabref-model/src/main/java/org/jabref/model/search/matchers/NotMatcher.java diff --git a/src/main/java/org/jabref/model/search/matchers/OrMatcher.java b/jabref-model/src/main/java/org/jabref/model/search/matchers/OrMatcher.java similarity index 100% rename from src/main/java/org/jabref/model/search/matchers/OrMatcher.java rename to jabref-model/src/main/java/org/jabref/model/search/matchers/OrMatcher.java diff --git a/src/main/java/org/jabref/model/search/rules/ContainBasedSearchRule.java b/jabref-model/src/main/java/org/jabref/model/search/rules/ContainBasedSearchRule.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/ContainBasedSearchRule.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/ContainBasedSearchRule.java diff --git a/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java b/jabref-model/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java diff --git a/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java b/jabref-model/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java diff --git a/src/main/java/org/jabref/model/search/rules/SearchRule.java b/jabref-model/src/main/java/org/jabref/model/search/rules/SearchRule.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/SearchRule.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/SearchRule.java diff --git a/src/main/java/org/jabref/model/search/rules/SearchRules.java b/jabref-model/src/main/java/org/jabref/model/search/rules/SearchRules.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/SearchRules.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/SearchRules.java diff --git a/src/main/java/org/jabref/model/search/rules/SentenceAnalyzer.java b/jabref-model/src/main/java/org/jabref/model/search/rules/SentenceAnalyzer.java similarity index 100% rename from src/main/java/org/jabref/model/search/rules/SentenceAnalyzer.java rename to jabref-model/src/main/java/org/jabref/model/search/rules/SentenceAnalyzer.java diff --git a/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java b/jabref-model/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java similarity index 96% rename from src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java rename to jabref-model/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java index c6021570f78..d3c650005a8 100644 --- a/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java +++ b/jabref-model/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java @@ -1,6 +1,6 @@ package org.jabref.model.strings; -import java.text.Normalizer; +//import java.text.Normalizer; import java.util.Objects; import java.util.regex.Pattern; diff --git a/src/main/java/org/jabref/model/strings/StringUtil.java b/jabref-model/src/main/java/org/jabref/model/strings/StringUtil.java similarity index 100% rename from src/main/java/org/jabref/model/strings/StringUtil.java rename to jabref-model/src/main/java/org/jabref/model/strings/StringUtil.java diff --git a/src/main/java/org/jabref/model/strings/UnicodeToReadableCharMap.java b/jabref-model/src/main/java/org/jabref/model/strings/UnicodeToReadableCharMap.java similarity index 100% rename from src/main/java/org/jabref/model/strings/UnicodeToReadableCharMap.java rename to jabref-model/src/main/java/org/jabref/model/strings/UnicodeToReadableCharMap.java diff --git a/src/main/java/org/jabref/model/util/DummyFileUpdateMonitor.java b/jabref-model/src/main/java/org/jabref/model/util/DummyFileUpdateMonitor.java similarity index 100% rename from src/main/java/org/jabref/model/util/DummyFileUpdateMonitor.java rename to jabref-model/src/main/java/org/jabref/model/util/DummyFileUpdateMonitor.java diff --git a/src/main/java/org/jabref/model/util/FileHelper.java b/jabref-model/src/main/java/org/jabref/model/util/FileHelper.java similarity index 100% rename from src/main/java/org/jabref/model/util/FileHelper.java rename to jabref-model/src/main/java/org/jabref/model/util/FileHelper.java diff --git a/src/main/java/org/jabref/model/util/FileUpdateListener.java b/jabref-model/src/main/java/org/jabref/model/util/FileUpdateListener.java similarity index 100% rename from src/main/java/org/jabref/model/util/FileUpdateListener.java rename to jabref-model/src/main/java/org/jabref/model/util/FileUpdateListener.java diff --git a/src/main/java/org/jabref/model/util/FileUpdateMonitor.java b/jabref-model/src/main/java/org/jabref/model/util/FileUpdateMonitor.java similarity index 100% rename from src/main/java/org/jabref/model/util/FileUpdateMonitor.java rename to jabref-model/src/main/java/org/jabref/model/util/FileUpdateMonitor.java diff --git a/src/main/java/org/jabref/model/util/OptionalUtil.java b/jabref-model/src/main/java/org/jabref/model/util/OptionalUtil.java similarity index 100% rename from src/main/java/org/jabref/model/util/OptionalUtil.java rename to jabref-model/src/main/java/org/jabref/model/util/OptionalUtil.java diff --git a/src/main/java/org/jabref/model/util/TreeCollector.java b/jabref-model/src/main/java/org/jabref/model/util/TreeCollector.java similarity index 100% rename from src/main/java/org/jabref/model/util/TreeCollector.java rename to jabref-model/src/main/java/org/jabref/model/util/TreeCollector.java diff --git a/src/test/java/org/jabref/model/BibDatabaseContextTest.java b/jabref-model/src/test/java/org/jabref/model/BibDatabaseContextTest.java similarity index 100% rename from src/test/java/org/jabref/model/BibDatabaseContextTest.java rename to jabref-model/src/test/java/org/jabref/model/BibDatabaseContextTest.java diff --git a/src/test/java/org/jabref/model/EntryTypesTest.java b/jabref-model/src/test/java/org/jabref/model/EntryTypesTest.java similarity index 100% rename from src/test/java/org/jabref/model/EntryTypesTest.java rename to jabref-model/src/test/java/org/jabref/model/EntryTypesTest.java diff --git a/src/test/java/org/jabref/model/TreeNodeTest.java b/jabref-model/src/test/java/org/jabref/model/TreeNodeTest.java similarity index 100% rename from src/test/java/org/jabref/model/TreeNodeTest.java rename to jabref-model/src/test/java/org/jabref/model/TreeNodeTest.java diff --git a/src/test/java/org/jabref/model/TreeNodeTestData.java b/jabref-model/src/test/java/org/jabref/model/TreeNodeTestData.java similarity index 100% rename from src/test/java/org/jabref/model/TreeNodeTestData.java rename to jabref-model/src/test/java/org/jabref/model/TreeNodeTestData.java diff --git a/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java b/jabref-model/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/BibDatabaseContextTest.java rename to jabref-model/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java diff --git a/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java b/jabref-model/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java rename to jabref-model/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java diff --git a/src/test/java/org/jabref/model/database/BibDatabaseTest.java b/jabref-model/src/test/java/org/jabref/model/database/BibDatabaseTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/BibDatabaseTest.java rename to jabref-model/src/test/java/org/jabref/model/database/BibDatabaseTest.java diff --git a/src/test/java/org/jabref/model/database/DuplicationCheckerTest.java b/jabref-model/src/test/java/org/jabref/model/database/DuplicationCheckerTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/DuplicationCheckerTest.java rename to jabref-model/src/test/java/org/jabref/model/database/DuplicationCheckerTest.java diff --git a/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java b/jabref-model/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/KeyChangeListenerTest.java rename to jabref-model/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java diff --git a/src/test/java/org/jabref/model/database/event/AutosaveEventTest.java b/jabref-model/src/test/java/org/jabref/model/database/event/AutosaveEventTest.java similarity index 100% rename from src/test/java/org/jabref/model/database/event/AutosaveEventTest.java rename to jabref-model/src/test/java/org/jabref/model/database/event/AutosaveEventTest.java diff --git a/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java b/jabref-model/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/AuthorListParameterTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java diff --git a/src/test/java/org/jabref/model/entry/AuthorListTest.java b/jabref-model/src/test/java/org/jabref/model/entry/AuthorListTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/AuthorListTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/AuthorListTest.java diff --git a/src/test/java/org/jabref/model/entry/AuthorTest.java b/jabref-model/src/test/java/org/jabref/model/entry/AuthorTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/AuthorTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/AuthorTest.java diff --git a/src/test/java/org/jabref/model/entry/BibEntryEqualityTest.java b/jabref-model/src/test/java/org/jabref/model/entry/BibEntryEqualityTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/BibEntryEqualityTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/BibEntryEqualityTest.java diff --git a/src/test/java/org/jabref/model/entry/BibEntryTest.java b/jabref-model/src/test/java/org/jabref/model/entry/BibEntryTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/BibEntryTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/BibEntryTest.java diff --git a/src/test/java/org/jabref/model/entry/BibEntryTests.java b/jabref-model/src/test/java/org/jabref/model/entry/BibEntryTests.java similarity index 100% rename from src/test/java/org/jabref/model/entry/BibEntryTests.java rename to jabref-model/src/test/java/org/jabref/model/entry/BibEntryTests.java diff --git a/src/test/java/org/jabref/model/entry/BibtexStringTest.java b/jabref-model/src/test/java/org/jabref/model/entry/BibtexStringTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/BibtexStringTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/BibtexStringTest.java diff --git a/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java b/jabref-model/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java diff --git a/src/test/java/org/jabref/model/entry/DateTest.java b/jabref-model/src/test/java/org/jabref/model/entry/DateTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/DateTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/DateTest.java diff --git a/src/test/java/org/jabref/model/entry/EntryLinkListTest.java b/jabref-model/src/test/java/org/jabref/model/entry/EntryLinkListTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/EntryLinkListTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/EntryLinkListTest.java diff --git a/src/test/java/org/jabref/model/entry/FieldNameTest.java b/jabref-model/src/test/java/org/jabref/model/entry/FieldNameTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/FieldNameTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/FieldNameTest.java diff --git a/src/test/java/org/jabref/model/entry/FileFieldWriterTest.java b/jabref-model/src/test/java/org/jabref/model/entry/FileFieldWriterTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/FileFieldWriterTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/FileFieldWriterTest.java diff --git a/src/test/java/org/jabref/model/entry/IEEETranEntryTypesTest.java b/jabref-model/src/test/java/org/jabref/model/entry/IEEETranEntryTypesTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/IEEETranEntryTypesTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/IEEETranEntryTypesTest.java diff --git a/src/test/java/org/jabref/model/entry/IdGeneratorTest.java b/jabref-model/src/test/java/org/jabref/model/entry/IdGeneratorTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/IdGeneratorTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/IdGeneratorTest.java diff --git a/src/test/java/org/jabref/model/entry/KeywordListTest.java b/jabref-model/src/test/java/org/jabref/model/entry/KeywordListTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/KeywordListTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/KeywordListTest.java diff --git a/src/test/java/org/jabref/model/entry/KeywordTest.java b/jabref-model/src/test/java/org/jabref/model/entry/KeywordTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/KeywordTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/KeywordTest.java diff --git a/src/test/java/org/jabref/model/entry/MonthTest.java b/jabref-model/src/test/java/org/jabref/model/entry/MonthTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/MonthTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/MonthTest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/ArXivIdentifierTest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/ArXivIdentifierTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/ArXivIdentifierTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/ArXivIdentifierTest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/DOITest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/DOITest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/DOITest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/DOITest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/EprintTest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/EprintTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/EprintTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/EprintTest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/ISBNTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/ISSNTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java diff --git a/src/test/java/org/jabref/model/entry/identifier/MathSciNetIdTest.java b/jabref-model/src/test/java/org/jabref/model/entry/identifier/MathSciNetIdTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/identifier/MathSciNetIdTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/identifier/MathSciNetIdTest.java diff --git a/src/test/java/org/jabref/model/entry/specialfields/SpecialFieldTest.java b/jabref-model/src/test/java/org/jabref/model/entry/specialfields/SpecialFieldTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/specialfields/SpecialFieldTest.java rename to jabref-model/src/test/java/org/jabref/model/entry/specialfields/SpecialFieldTest.java diff --git a/src/test/java/org/jabref/model/event/TestEventListener.java b/jabref-model/src/test/java/org/jabref/model/event/TestEventListener.java similarity index 100% rename from src/test/java/org/jabref/model/event/TestEventListener.java rename to jabref-model/src/test/java/org/jabref/model/event/TestEventListener.java diff --git a/src/test/java/org/jabref/model/groups/AutomaticKeywordGroupTest.java b/jabref-model/src/test/java/org/jabref/model/groups/AutomaticKeywordGroupTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/AutomaticKeywordGroupTest.java rename to jabref-model/src/test/java/org/jabref/model/groups/AutomaticKeywordGroupTest.java diff --git a/src/test/java/org/jabref/model/groups/ExplicitGroupTest.java b/jabref-model/src/test/java/org/jabref/model/groups/ExplicitGroupTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/ExplicitGroupTest.java rename to jabref-model/src/test/java/org/jabref/model/groups/ExplicitGroupTest.java diff --git a/src/test/java/org/jabref/model/groups/GroupTreeNodeTest.java b/jabref-model/src/test/java/org/jabref/model/groups/GroupTreeNodeTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/GroupTreeNodeTest.java rename to jabref-model/src/test/java/org/jabref/model/groups/GroupTreeNodeTest.java diff --git a/src/test/java/org/jabref/model/groups/SearchGroupTest.java b/jabref-model/src/test/java/org/jabref/model/groups/SearchGroupTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/SearchGroupTest.java rename to jabref-model/src/test/java/org/jabref/model/groups/SearchGroupTest.java diff --git a/src/test/java/org/jabref/model/groups/WordKeywordGroupTest.java b/jabref-model/src/test/java/org/jabref/model/groups/WordKeywordGroupTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/WordKeywordGroupTest.java rename to jabref-model/src/test/java/org/jabref/model/groups/WordKeywordGroupTest.java diff --git a/src/test/java/org/jabref/model/metadata/MetaDataTest.java b/jabref-model/src/test/java/org/jabref/model/metadata/MetaDataTest.java similarity index 100% rename from src/test/java/org/jabref/model/metadata/MetaDataTest.java rename to jabref-model/src/test/java/org/jabref/model/metadata/MetaDataTest.java diff --git a/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java b/jabref-model/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java similarity index 100% rename from src/test/java/org/jabref/model/pdf/FileAnnotationTest.java rename to jabref-model/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java diff --git a/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java b/jabref-model/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java similarity index 100% rename from src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java rename to jabref-model/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java diff --git a/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java b/jabref-model/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java similarity index 100% rename from src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java rename to jabref-model/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java diff --git a/src/test/java/org/jabref/model/search/rules/MockSearchMatcher.java b/jabref-model/src/test/java/org/jabref/model/search/rules/MockSearchMatcher.java similarity index 100% rename from src/test/java/org/jabref/model/search/rules/MockSearchMatcher.java rename to jabref-model/src/test/java/org/jabref/model/search/rules/MockSearchMatcher.java diff --git a/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java b/jabref-model/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java similarity index 100% rename from src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java rename to jabref-model/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java diff --git a/src/test/java/org/jabref/model/strings/StringUtilTest.java b/jabref-model/src/test/java/org/jabref/model/strings/StringUtilTest.java similarity index 100% rename from src/test/java/org/jabref/model/strings/StringUtilTest.java rename to jabref-model/src/test/java/org/jabref/model/strings/StringUtilTest.java diff --git a/src/test/resources/log4j2.xml b/jabref-model/src/test/resources/log4j2-test.xml similarity index 95% rename from src/test/resources/log4j2.xml rename to jabref-model/src/test/resources/log4j2-test.xml index 8c6a336420a..0422d0bd80d 100644 --- a/src/test/resources/log4j2.xml +++ b/jabref-model/src/test/resources/log4j2-test.xml @@ -4,7 +4,7 @@ - + diff --git a/jabref-testutils/build.gradle b/jabref-testutils/build.gradle new file mode 100644 index 00000000000..10273fdeb25 --- /dev/null +++ b/jabref-testutils/build.gradle @@ -0,0 +1,15 @@ +apply plugin: 'java' + +repositories { + mavenLocal() + jcenter() + maven { + url 'https://oss.sonatype.org/content/groups/public' + } +} + +dependencies { + compile project(':jabref-model') + + compile 'org.junit.jupiter:junit-jupiter-api:5.2.0' +} diff --git a/src/test/java/org/jabref/support/CIServerCondition.java b/jabref-testutils/src/main/java/org/jabref/support/CIServerCondition.java similarity index 100% rename from src/test/java/org/jabref/support/CIServerCondition.java rename to jabref-testutils/src/main/java/org/jabref/support/CIServerCondition.java diff --git a/src/test/java/org/jabref/support/DisabledOnCIServer.java b/jabref-testutils/src/main/java/org/jabref/support/DisabledOnCIServer.java similarity index 100% rename from src/test/java/org/jabref/support/DisabledOnCIServer.java rename to jabref-testutils/src/main/java/org/jabref/support/DisabledOnCIServer.java diff --git a/src/test/java/org/jabref/testutils/category/DatabaseTest.java b/jabref-testutils/src/main/java/org/jabref/testutils/category/DatabaseTest.java similarity index 100% rename from src/test/java/org/jabref/testutils/category/DatabaseTest.java rename to jabref-testutils/src/main/java/org/jabref/testutils/category/DatabaseTest.java diff --git a/src/test/java/org/jabref/testutils/category/FetcherTest.java b/jabref-testutils/src/main/java/org/jabref/testutils/category/FetcherTest.java similarity index 100% rename from src/test/java/org/jabref/testutils/category/FetcherTest.java rename to jabref-testutils/src/main/java/org/jabref/testutils/category/FetcherTest.java diff --git a/src/test/java/org/jabref/testutils/category/GUITest.java b/jabref-testutils/src/main/java/org/jabref/testutils/category/GUITest.java similarity index 100% rename from src/test/java/org/jabref/testutils/category/GUITest.java rename to jabref-testutils/src/main/java/org/jabref/testutils/category/GUITest.java diff --git a/settings.gradle b/settings.gradle index ee77a0edcfa..3407fc9e597 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,5 @@ rootProject.name = "JabRef" +include 'jabref-model' +include 'jabref-logic' +include 'jabref-testutils' + diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index a4d68d1c993..cd3ad6cbec7 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,20 +1,8 @@ open module org.jabref { exports org.jabref; - exports org.jabref.gui; - exports org.jabref.gui.logging; - exports org.jabref.gui.maintable; - exports org.jabref.gui.specialfields; - - exports org.jabref.model.database; - - exports org.jabref.logic; - exports org.jabref.logic.citationstyle; - exports org.jabref.logic.search; - -// opens org.jabref.gui to com.google.common; -// opens org.jabref.model.database to com.google.common; -// opens org.jabref.logic.citationstyle to com.google.common; + requires org.jabref.model; + requires org.jabref.logic; // Swing requires java.desktop; diff --git a/src/main/java/org/jabref/Globals.java b/src/main/java/org/jabref/Globals.java index a5f74b68bb5..3766dcbf376 100644 --- a/src/main/java/org/jabref/Globals.java +++ b/src/main/java/org/jabref/Globals.java @@ -14,6 +14,7 @@ import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.gui.util.TaskExecutor; import org.jabref.gui.util.ThemeLoader; +import org.jabref.logic.JabRefExecutorService; import org.jabref.logic.exporter.ExporterFactory; import org.jabref.logic.importer.ImportFormatReader; import org.jabref.logic.journals.JournalAbbreviationLoader; @@ -26,7 +27,6 @@ import com.google.common.base.StandardSystemProperty; import com.microsoft.applicationinsights.TelemetryClient; import com.microsoft.applicationinsights.TelemetryConfiguration; -import com.microsoft.applicationinsights.internal.shutdown.SDKShutdownActivity; import com.microsoft.applicationinsights.telemetry.SessionState; public class Globals { diff --git a/src/main/java/org/jabref/JabRefMain.java b/src/main/java/org/jabref/JabRefMain.java index 249c97f8251..66c3761e6a1 100644 --- a/src/main/java/org/jabref/JabRefMain.java +++ b/src/main/java/org/jabref/JabRefMain.java @@ -11,6 +11,7 @@ import org.jabref.cli.ArgumentProcessor; import org.jabref.gui.remote.JabRefMessageHandler; +import org.jabref.logic.FallbackExceptionHandler; import org.jabref.logic.journals.JournalAbbreviationLoader; import org.jabref.logic.l10n.Localization; import org.jabref.logic.net.ProxyAuthenticator; @@ -22,7 +23,7 @@ import org.jabref.logic.util.BuildInfo; import org.jabref.logic.util.JavaVersion; import org.jabref.logic.util.OS; -import org.jabref.migrations.PreferencesMigrations; +import org.jabref.gui.migrations.PreferencesMigrations; import org.jabref.model.EntryTypes; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.InternalBibtexFields; @@ -79,13 +80,13 @@ public void start(Stage mainStage) throws Exception { LOGGER.error("Unexpected exception", ex); } } - + @Override public void stop() { Globals.stopBackgroundTasks(); Globals.shutdownThreadPools(); } - + /** * Tests if we are running an acceptable Java and terminates JabRef when we are sure the version is not supported. * This test uses the requirements for the Java version as specified in gradle.build. It is possible to diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index 7df241a209d..a052080c4e5 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -5,7 +5,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Locale; @@ -14,10 +13,8 @@ import java.util.prefs.BackingStoreException; import org.jabref.Globals; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; import org.jabref.gui.externalfiles.AutoSetLinks; -import org.jabref.gui.importer.fetcher.EntryFetcher; -import org.jabref.gui.importer.fetcher.EntryFetchers; import org.jabref.logic.bibtexkeypattern.BibtexKeyGenerator; import org.jabref.logic.exporter.BibDatabaseWriter; import org.jabref.logic.exporter.BibtexDatabaseWriter; @@ -28,12 +25,15 @@ import org.jabref.logic.exporter.SavePreferences; import org.jabref.logic.exporter.SaveSession; import org.jabref.logic.exporter.TemplateExporter; +import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportException; import org.jabref.logic.importer.ImportFormatReader; import org.jabref.logic.importer.OpenDatabase; import org.jabref.logic.importer.OutputPrinter; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.importer.WebFetchers; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatterPreferences; @@ -538,15 +538,12 @@ private void regenerateBibtexKeys(List loaded) { /** * Run an entry fetcher from the command line. - *

- * Note that this only works headlessly if the EntryFetcher does not show any GUI. * - * @param fetchCommand A string containing both the fetcher to use (id of EntryFetcherExtension minus Fetcher) and + * @param fetchCommand A string containing both the name of the fetcher to use and * the search query, separated by a : * @return A parser result containing the entries fetched or null if an error occurred. */ private Optional fetch(String fetchCommand) { - if ((fetchCommand == null) || !fetchCommand.contains(":") || (fetchCommand.split(":").length != 2)) { System.out.println(Localization.lang("Expected syntax for --fetch=':'")); System.out.println(Localization.lang("The following fetchers are available:")); @@ -555,38 +552,36 @@ private Optional fetch(String fetchCommand) { String[] split = fetchCommand.split(":"); String engine = split[0]; + String query = split[1]; - EntryFetchers fetchers = new EntryFetchers(Globals.journalAbbreviationLoader); - EntryFetcher fetcher = null; - for (EntryFetcher e : fetchers.getEntryFetchers()) { - if (engine.equalsIgnoreCase(e.getClass().getSimpleName().replace("Fetcher", ""))) { - fetcher = e; - } - } - - if (fetcher == null) { + List fetchers = WebFetchers.getSearchBasedFetchers(Globals.prefs.getImportFormatPreferences()); + Optional selectedFetcher = fetchers.stream() + .filter(fetcher -> fetcher.getName().equalsIgnoreCase(engine)) + .findFirst(); + if (!selectedFetcher.isPresent()) { System.out.println(Localization.lang("Could not find fetcher '%0'", engine)); - System.out.println(Localization.lang("The following fetchers are available:")); - - for (EntryFetcher e : fetchers.getEntryFetchers()) { - System.out.println( - " " + e.getClass().getSimpleName().replace("Fetcher", "").toLowerCase(Locale.ENGLISH)); - } - return Optional.empty(); - } - String query = split[1]; - System.out.println(Localization.lang("Running query '%0' with fetcher '%1'.", query, engine) + " " - + Localization.lang("Please wait...")); - Collection result = new ImportInspectionCommandLine().query(query, fetcher); + System.out.println(Localization.lang("The following fetchers are available:")); + fetchers.forEach(fetcher -> System.out.println(" " + fetcher.getName())); - if (result.isEmpty()) { - System.out.println( - Localization.lang("Query '%0' with fetcher '%1' did not return any results.", query, engine)); return Optional.empty(); + } else { + System.out.println(Localization.lang("Running query '%0' with fetcher '%1'.", query, engine)); + System.out.print(Localization.lang("Please wait...")); + try { + List matches = selectedFetcher.get().performSearch(query); + if (matches.isEmpty()) { + System.out.println("\r" + Localization.lang("No results found.")); + return Optional.empty(); + } else { + System.out.println("\r" + Localization.lang("Found %0 results.", String.valueOf(matches.size()))); + return Optional.of(new ParserResult(matches)); + } + } catch (FetcherException e) { + LOGGER.error("Error while fetching", e); + return Optional.empty(); + } } - - return Optional.of(new ParserResult(result)); } public boolean isBlank() { diff --git a/src/main/java/org/jabref/cli/ImportInspectionCommandLine.java b/src/main/java/org/jabref/cli/ImportInspectionCommandLine.java deleted file mode 100644 index bf3d66ba544..00000000000 --- a/src/main/java/org/jabref/cli/ImportInspectionCommandLine.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.jabref.cli; - -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import org.jabref.gui.importer.fetcher.EntryFetcher; -import org.jabref.logic.importer.ImportInspector; -import org.jabref.logic.importer.OutputPrinter; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.BibEntry; - -public class ImportInspectionCommandLine implements ImportInspector { - - private final List entries = new LinkedList<>(); - - private final OutputPrinter status = new SystemOutputPrinter(); - - @Override - public void addEntry(BibEntry entry) { - entries.add(entry); - } - - @Override - public void setProgress(int current, int max) { - status.setStatus(Localization.lang("Progress: %0 of %1", String.valueOf(current), String - .valueOf(max))); - } - - public Collection query(String query, EntryFetcher fetcher) { - entries.clear(); - if (fetcher.processQuery(query, ImportInspectionCommandLine.this, status)) { - return entries; - } - return Collections.emptyList(); - } -} diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index 54938361525..5fee5ee992c 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -36,7 +36,7 @@ import javafx.scene.layout.StackPane; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.actions.Actions; import org.jabref.gui.actions.BaseAction; import org.jabref.gui.actions.CleanupAction; @@ -62,6 +62,7 @@ import org.jabref.gui.filelist.FileListEntry; import org.jabref.gui.filelist.FileListTableModel; import org.jabref.gui.groups.GroupAddRemoveDialog; +import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.importer.actions.AppendDatabaseAction; import org.jabref.gui.journals.AbbreviateAction; import org.jabref.gui.journals.UnabbreviateAction; @@ -674,7 +675,7 @@ private void openExternalFile() { return; } FileListEntry flEntry = fileListTableModel.getEntry(0); - ExternalFileMenuItem item = new ExternalFileMenuItem(frame(), "", flEntry.getLink(), flEntry.getType().get().getIcon().getSmallIcon(), bibDatabaseContext, flEntry.getType()); + ExternalFileMenuItem item = new ExternalFileMenuItem(frame(), "", flEntry.getLink(), flEntry.getType().map(ExternalFileType::getIcon).map(JabRefIcon::getSmallIcon).orElse(null), bibDatabaseContext, flEntry.getType()); item.doClick(); }); } diff --git a/src/main/java/org/jabref/gui/DuplicateSearch.java b/src/main/java/org/jabref/gui/DuplicateSearch.java index 8331483d01f..83c433a3959 100644 --- a/src/main/java/org/jabref/gui/DuplicateSearch.java +++ b/src/main/java/org/jabref/gui/DuplicateSearch.java @@ -15,7 +15,7 @@ import javax.swing.SwingUtilities; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.DuplicateResolverDialog.DuplicateResolverResult; import org.jabref.gui.DuplicateResolverDialog.DuplicateResolverType; import org.jabref.gui.actions.SimpleCommand; diff --git a/src/main/java/org/jabref/gui/EntryTypeDialog.java b/src/main/java/org/jabref/gui/EntryTypeDialog.java index b4cdc9a0abc..93cc5a73a3d 100644 --- a/src/main/java/org/jabref/gui/EntryTypeDialog.java +++ b/src/main/java/org/jabref/gui/EntryTypeDialog.java @@ -9,6 +9,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.concurrent.ExecutionException; @@ -316,7 +317,7 @@ protected void done() { final BasePanel panel = frame.getCurrentBasePanel(); ImportInspectionDialog diag = new ImportInspectionDialog(frame, panel, Localization.lang("Import"), false); - diag.addEntry(bibEntry); + diag.addEntries(Collections.singletonList(bibEntry)); diag.entryListComplete(); diag.setVisible(true); diag.toFront(); diff --git a/src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java b/src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java index b51c89b1a27..c5f52ac19f2 100644 --- a/src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java +++ b/src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java @@ -66,7 +66,7 @@ import javax.swing.tree.TreePath; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.JabRefGUI; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.externalfiletype.ExternalFileTypes; diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 17e74927d22..206a61528dd 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -49,7 +49,7 @@ import javafx.stage.Stage; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.Actions; import org.jabref.gui.actions.AutoLinkFilesAction; @@ -252,7 +252,7 @@ private void init() { // groupSidePane.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(GroupSidePane.class)); //previewToggle.setSelected(Globals.prefs.getPreviewPreferences().isPreviewPanelEnabled()); - //generalFetcher.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(GeneralFetcher.class)); + //generalFetcher.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(WebSearchPane.class)); //openOfficePanel.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(OpenOfficeSidePanel.class)); // TODO: Can't notify focus listener since it is expecting a swing component //Globals.getFocusListener().setFocused(currentBasePanel.getMainTable()); @@ -395,7 +395,7 @@ public void openAction(String filePath) { * The MacAdapter calls this method when "About" is selected from the application menu. */ public void about() { - HelpAction.getCommand().execute(); + HelpAction.getMainHelpPageCommand().execute(); } public JabRefPreferences prefs() { @@ -922,7 +922,7 @@ private MenuBar createMenu() { ); help.getItems().addAll( - factory.createMenuItem(StandardActions.HELP, HelpAction.getCommand()), + factory.createMenuItem(StandardActions.HELP, HelpAction.getMainHelpPageCommand()), factory.createMenuItem(StandardActions.OPEN_FORUM, new OpenBrowserAction("http://discourse.jabref.org/")), new SeparatorMenuItem(), diff --git a/src/main/java/org/jabref/gui/SidePaneManager.java b/src/main/java/org/jabref/gui/SidePaneManager.java index ca122c86a71..5a09bdcd1ab 100644 --- a/src/main/java/org/jabref/gui/SidePaneManager.java +++ b/src/main/java/org/jabref/gui/SidePaneManager.java @@ -10,7 +10,7 @@ import org.jabref.Globals; import org.jabref.gui.collab.FileUpdatePanel; import org.jabref.gui.groups.GroupSidePane; -import org.jabref.gui.importer.fetcher.GeneralFetcher; +import org.jabref.gui.importer.fetcher.WebSearchPane; import org.jabref.gui.openoffice.OpenOfficeSidePanel; import org.jabref.logic.openoffice.OpenOfficePreferences; import org.jabref.preferences.JabRefPreferences; @@ -33,7 +33,7 @@ public SidePaneManager(JabRefPreferences preferences, JabRefFrame frame) { Stream.of( new FileUpdatePanel(this), new GroupSidePane(this, preferences, frame.getDialogService()), - new GeneralFetcher(this, preferences, frame), + new WebSearchPane(this, preferences, frame), new OpenOfficeSidePanel(this, openOfficePreferences, frame)) .forEach(pane -> components.put(pane.getType(), pane)); @@ -45,6 +45,10 @@ public SidePaneManager(JabRefPreferences preferences, JabRefFrame frame) { show(SidePaneType.OPEN_OFFICE); } + if (preferences.getBoolean(JabRefPreferences.WEB_SEARCH_VISIBLE)) { + show(SidePaneType.WEB_SEARCH); + } + updateView(); } diff --git a/src/main/java/org/jabref/gui/actions/AutoLinkFilesAction.java b/src/main/java/org/jabref/gui/actions/AutoLinkFilesAction.java index 7b77c9f59b4..42cf89fdae7 100644 --- a/src/main/java/org/jabref/gui/actions/AutoLinkFilesAction.java +++ b/src/main/java/org/jabref/gui/actions/AutoLinkFilesAction.java @@ -5,7 +5,7 @@ import javax.swing.JDialog; import javax.swing.JFrame; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.JabRefGUI; import org.jabref.gui.externalfiles.AutoSetLinks; import org.jabref.gui.undo.NamedCompound; diff --git a/src/main/java/org/jabref/gui/collab/ChangeScanner.java b/src/main/java/org/jabref/gui/collab/ChangeScanner.java index 553d17cb3a2..28cea93ce2c 100644 --- a/src/main/java/org/jabref/gui/collab/ChangeScanner.java +++ b/src/main/java/org/jabref/gui/collab/ChangeScanner.java @@ -11,7 +11,7 @@ import javax.swing.tree.DefaultMutableTreeNode; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.JabRefFrame; import org.jabref.logic.bibtex.DuplicateCheck; diff --git a/src/main/java/org/jabref/gui/collab/DatabaseChangeMonitor.java b/src/main/java/org/jabref/gui/collab/DatabaseChangeMonitor.java index 8b4424e870b..4dca126e9f2 100644 --- a/src/main/java/org/jabref/gui/collab/DatabaseChangeMonitor.java +++ b/src/main/java/org/jabref/gui/collab/DatabaseChangeMonitor.java @@ -7,7 +7,7 @@ import javax.swing.SwingUtilities; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.SidePaneManager; import org.jabref.gui.SidePaneType; diff --git a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java index cfff8fb441c..c9c1a515aa4 100644 --- a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java @@ -129,20 +129,15 @@ public static boolean openExternalFileAnyFormat(final BibDatabaseContext databas } Optional file = FileHelper.expandFilename(databaseContext, link, Globals.prefs.getFileDirectoryPreferences()); - if (file.isPresent() && Files.exists(file.get()) && (type.isPresent())) { + if (file.isPresent() && Files.exists(file.get())) { // Open the file: String filePath = file.get().toString(); openExternalFilePlatformIndependent(type, filePath); return true; } else { // No file matched the name, try to open it directly using the given app - if (type.isPresent()) { - openExternalFilePlatformIndependent(type, link); - return true; - } - - // Run out of ideas what to do... - return false; + openExternalFilePlatformIndependent(type, link); + return true; } } @@ -160,6 +155,10 @@ private static void openExternalFilePlatformIndependent(Optional { - LinkedFile newLinkedFile = new LinkedFile("", newFile.toString(), ""); - LinkedFileEditDialogView dialog = new LinkedFileEditDialogView(newLinkedFile); + LinkedFile linkedFile = LinkedFilesEditorViewModel.fromFile(newFile, panel.getBibDatabaseContext().getFileDirectoriesAsPaths(Globals.prefs.getFileDirectoryPreferences())); + + LinkedFileEditDialogView dialog = new LinkedFileEditDialogView(linkedFile); dialog.showAndWait() .ifPresent(editedLinkedFile -> { diff --git a/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java b/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java index 5a24ba38822..492cda62592 100644 --- a/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java @@ -26,6 +26,9 @@ import org.jabref.model.util.FileHelper; import org.jabref.preferences.PreferencesService; +import org.fxmisc.easybind.EasyBind; +import org.fxmisc.easybind.monadic.MonadicObservableValue; + public class LinkedFilesEditDialogViewModel extends AbstractViewModel { private static final Pattern REMOTE_LINK_PATTERN = Pattern.compile("[a-z]+://.*"); @@ -33,6 +36,7 @@ public class LinkedFilesEditDialogViewModel extends AbstractViewModel { private final StringProperty description = new SimpleStringProperty(""); private final ListProperty allExternalFileTypes = new SimpleListProperty<>(FXCollections.emptyObservableList()); private final ObjectProperty selectedExternalFileType = new SimpleObjectProperty<>(); + private final MonadicObservableValue monadicSelectedExternalFileType; private final BibDatabaseContext database; private final DialogService dialogService; private final PreferencesService preferences; @@ -44,6 +48,8 @@ public LinkedFilesEditDialogViewModel(LinkedFile linkedFile, BibDatabaseContext this.preferences = preferences; this.externalFileTypes = externalFileTypes; allExternalFileTypes.set(FXCollections.observableArrayList(externalFileTypes.getExternalFileTypeSelection())); + + monadicSelectedExternalFileType = EasyBind.monadic(selectedExternalFileType); setValues(linkedFile); } @@ -119,8 +125,7 @@ public ObjectProperty selectedExternalFileTypeProperty() { } public LinkedFile getNewLinkedFile() { - return new LinkedFile(description.getValue(), link.getValue(), selectedExternalFileType.getValue().toString()); - + return new LinkedFile(description.getValue(), link.getValue(), monadicSelectedExternalFileType.map(ExternalFileType::toString).getOrElse("")); } } diff --git a/src/main/java/org/jabref/gui/groups/EntryTableTransferHandler.java b/src/main/java/org/jabref/gui/groups/EntryTableTransferHandler.java index 70c0bfaec3d..e715e004e5f 100644 --- a/src/main/java/org/jabref/gui/groups/EntryTableTransferHandler.java +++ b/src/main/java/org/jabref/gui/groups/EntryTableTransferHandler.java @@ -24,7 +24,7 @@ import javax.swing.JTable; import javax.swing.TransferHandler; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.JabRefFrame; import org.jabref.gui.externalfiles.DroppedFileHandler; diff --git a/src/main/java/org/jabref/gui/help/HelpAction.java b/src/main/java/org/jabref/gui/help/HelpAction.java index 402d8900a13..ab7ae84e027 100644 --- a/src/main/java/org/jabref/gui/help/HelpAction.java +++ b/src/main/java/org/jabref/gui/help/HelpAction.java @@ -110,7 +110,7 @@ public void actionPerformed(ActionEvent e) { openHelpPage(helpPage); } - public static SimpleCommand getCommand() { + public static SimpleCommand getMainHelpPageCommand() { return new SimpleCommand() { @Override public void execute() { @@ -118,4 +118,13 @@ public void execute() { } }; } + + public SimpleCommand getCommand() { + return new SimpleCommand() { + @Override + public void execute() { + openHelpPage(helpPage); + } + }; + } } diff --git a/src/main/java/org/jabref/gui/importer/ImportInspectionDialog.java b/src/main/java/org/jabref/gui/importer/ImportInspectionDialog.java index 8b53cfd793b..903e116e533 100644 --- a/src/main/java/org/jabref/gui/importer/ImportInspectionDialog.java +++ b/src/main/java/org/jabref/gui/importer/ImportInspectionDialog.java @@ -51,7 +51,7 @@ import javafx.scene.Scene; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.BasePanelPreferences; import org.jabref.gui.DuplicateResolverDialog; @@ -84,7 +84,6 @@ import org.jabref.logic.bibtex.comparator.FieldComparator; import org.jabref.logic.bibtexkeypattern.BibtexKeyGenerator; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.ImportInspector; import org.jabref.logic.importer.OutputPrinter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.UpdateField; @@ -144,7 +143,7 @@ * receiving this call). */ -public class ImportInspectionDialog extends JabRefDialog implements ImportInspector, OutputPrinter { +public class ImportInspectionDialog extends JabRefDialog implements OutputPrinter { private static final Logger LOGGER = LoggerFactory.getLogger(ImportInspectionDialog.class); private static final List INSPECTION_FIELDS = Arrays.asList(FieldName.AUTHOR, FieldName.TITLE, FieldName.YEAR, BibEntry.KEY_FIELD); @@ -168,7 +167,6 @@ public class ImportInspectionDialog extends JabRefDialog implements ImportInspec */ private final List entriesToDelete = new ArrayList<>(); private final String undoName; - private final List callBacks = new ArrayList<>(); private final boolean newDatabase; private final JPopupMenu popup = new JPopupMenu(); private final JButton deselectAllDuplicates = new JButton(Localization.lang("Deselect all duplicates")); @@ -286,7 +284,6 @@ public ImportInspectionDialog(JabRefFrame frame, BasePanel panel, String undoNam generate.setEnabled(false); ok.addActionListener(new OkListener()); cancel.addActionListener(e -> { - signalStopFetching(); dispose(); frame.output(Localization.lang("Import canceled by user")); }); @@ -297,7 +294,6 @@ public ImportInspectionDialog(JabRefFrame frame, BasePanel panel, String undoNam generateKeys(); // Generate the keys. }); stop.addActionListener(e -> { - signalStopFetching(); entryListComplete(); }); selectAll.addActionListener(new SelectionButton(true)); @@ -345,29 +341,6 @@ public void actionPerformed(ActionEvent e) { } - /* (non-Javadoc) - * @see package org.jabref.logic.importer.ImportInspector#setProgress(int, int) - */ - @Override - public void setProgress(int current, int max) { - SwingUtilities.invokeLater(() -> { - progressBar.setIndeterminate(false); - progressBar.setMinimum(0); - progressBar.setMaximum(max); - progressBar.setValue(current); - }); - } - - /* (non-Javadoc) - * @see package org.jabref.logic.importer.ImportInspector#addEntry(org.jabref.model.entry.BibEntry) - */ - @Override - public void addEntry(BibEntry entry) { - List list = new ArrayList<>(); - list.add(entry); - addEntries(list); - } - public void addEntries(Collection entriesToAdd) { for (BibEntry entry : entriesToAdd) { @@ -559,14 +532,6 @@ private AbstractAction getAction(GroupTreeNode node) { return action; } - public void addCallBack(CallBack cb) { - callBacks.add(cb); - } - - private void signalStopFetching() { - callBacks.forEach(CallBack::stopFetching); - } - private void setWidths() { TableColumnModel cm = glTable.getColumnModel(); cm.getColumn(0).setPreferredWidth(55); diff --git a/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java b/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java index 03834a8e1ed..96c789b6dbf 100644 --- a/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java @@ -8,7 +8,7 @@ import javax.swing.undo.CompoundEdit; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; diff --git a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java index 2a76c406f62..c1aa6a96b74 100644 --- a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java @@ -4,7 +4,7 @@ import org.jabref.gui.BasePanel; import org.jabref.logic.importer.ParserResult; -import org.jabref.migrations.MergeReviewIntoCommentMigration; +import org.jabref.logic.migrations.MergeReviewIntoCommentMigration; import org.jabref.model.entry.BibEntry; public class MergeReviewIntoCommentAction implements GUIPostOpenAction { diff --git a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java index ef98593fc5a..25f2bcbffec 100644 --- a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java @@ -17,7 +17,7 @@ import javax.swing.SwingUtilities; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.BasePanelPreferences; import org.jabref.gui.DialogService; @@ -37,7 +37,7 @@ import org.jabref.logic.shared.exception.NotASharedDatabaseException; import org.jabref.logic.util.StandardFileType; import org.jabref.logic.util.io.FileBasedLock; -import org.jabref.migrations.FileLinksUpgradeWarning; +import org.jabref.gui.migrations.FileLinksUpgradeWarning; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.shared.DatabaseNotSupportedException; import org.jabref.preferences.JabRefPreferences; diff --git a/src/main/java/org/jabref/gui/importer/fetcher/EntryFetcher.java b/src/main/java/org/jabref/gui/importer/fetcher/EntryFetcher.java deleted file mode 100644 index f2470d68fb3..00000000000 --- a/src/main/java/org/jabref/gui/importer/fetcher/EntryFetcher.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.jabref.gui.importer.fetcher; - -import javax.swing.JPanel; - -import org.jabref.gui.importer.ImportInspectionDialog; -import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.ImportInspector; -import org.jabref.logic.importer.OutputPrinter; - -/** - * @Deprecated - * Use {@link SearchBasedEntryFetcher} instead
- * Implement this interface to add another activeFetcher (something that grabs records - * from the Web for JabRef). Have a look at the existing implemenations - * IEEEXploreFetcher, JStorFetcher and - * CiteSeerEntryFetcher. - * - * Note: You also need to implement the method stopFetching from - * ImportInspectionDialog.Callback - * - * A Fetcher should not execute any GUI Operations, because it might be run in - * headless mode, but rather use the OutputPrinter for talking to the user. - */ -@Deprecated -public interface EntryFetcher extends ImportInspectionDialog.CallBack { - - /** - * Handle a query entered by the user. - * - * The method is expected to block the caller until all entries have been - * reported to the inspector. - * - * @param query - * The query text. - * @param inspector - * The dialog to add imported entries to. - * @param status - * An OutputPrinter passed to the activeFetcher for reporting about the - * status of the fetching. - * - * @return True if the query was completed successfully, false if an error - * occurred. - */ - boolean processQuery(String query, ImportInspector inspector, OutputPrinter status); - - /** - * The title for this activeFetcher, displayed in the menu and in the side pane. - * - * @return The title - */ - String getTitle(); - - /** - * Get the name of the help page for this activeFetcher. - * - * If given, a question mark is displayed in the side pane which leads to - * the help page. - * - * @return The {@link HelpFile} enum constant for the help page - */ - HelpFile getHelpPage(); - - /** - * If this activeFetcher requires additional options, a panel for setting up these - * should be returned in a JPanel by this method. This JPanel will be added - * to the side pane component automatically. - * - * @return Options panel for this activeFetcher or null if this activeFetcher does not - * have any options. - */ - JPanel getOptionsPanel(); -} diff --git a/src/main/java/org/jabref/gui/importer/fetcher/EntryFetchers.java b/src/main/java/org/jabref/gui/importer/fetcher/EntryFetchers.java deleted file mode 100644 index 353eddde4ae..00000000000 --- a/src/main/java/org/jabref/gui/importer/fetcher/EntryFetchers.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.jabref.gui.importer.fetcher; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import org.jabref.Globals; -import org.jabref.logic.importer.WebFetchers; -import org.jabref.logic.journals.JournalAbbreviationLoader; - -public class EntryFetchers { - - private final List entryFetchers = new LinkedList<>(); - - public EntryFetchers(JournalAbbreviationLoader abbreviationLoader) { - WebFetchers.getSearchBasedFetchers(Globals.prefs.getImportFormatPreferences()).stream() - .map(SearchBasedEntryFetcher::new) - .forEach(entryFetchers::add); - } - - public List getEntryFetchers() { - return Collections.unmodifiableList(this.entryFetchers); - } -} diff --git a/src/main/java/org/jabref/gui/importer/fetcher/GeneralFetcher.java b/src/main/java/org/jabref/gui/importer/fetcher/GeneralFetcher.java deleted file mode 100644 index a5bdd0696e3..00000000000 --- a/src/main/java/org/jabref/gui/importer/fetcher/GeneralFetcher.java +++ /dev/null @@ -1,216 +0,0 @@ -package org.jabref.gui.importer.fetcher; - -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.SwingUtilities; - -import javafx.embed.swing.SwingNode; -import javafx.scene.Node; -import javafx.scene.layout.Priority; - -import org.jabref.Globals; -import org.jabref.JabRefExecutorService; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.SidePaneComponent; -import org.jabref.gui.SidePaneManager; -import org.jabref.gui.SidePaneType; -import org.jabref.gui.actions.Action; -import org.jabref.gui.actions.StandardActions; -import org.jabref.gui.help.HelpAction; -import org.jabref.gui.icon.IconTheme; -import org.jabref.gui.importer.ImportInspectionDialog; -import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.OS; -import org.jabref.preferences.JabRefPreferences; - -public class GeneralFetcher extends SidePaneComponent implements ActionListener { - - private final JTextField tf = new JTextField(); - - private final CardLayout optionsCards = new CardLayout(); - private final JPanel optionsPanel = new JPanel(optionsCards); - private final JPanel optPanel = new JPanel(new BorderLayout()); - - private final JabRefFrame frame; - private final JabRefPreferences preferences; - private EntryFetcher activeFetcher; - - public GeneralFetcher(SidePaneManager sidePaneManager, JabRefPreferences preferences, JabRefFrame frame) { - super(sidePaneManager, IconTheme.JabRefIcons.WWW, Localization.lang("Web search")); - this.frame = frame; - this.preferences = preferences; - } - - @Override - public Action getToggleAction() { - return StandardActions.TOGGLE_WEB_SEARCH; - } - - @Override - protected Node createContentPane() { - List fetchers = new EntryFetchers(Globals.journalAbbreviationLoader).getEntryFetchers(); - EntryFetcher[] fetcherArray = fetchers.toArray(new EntryFetcher[fetchers.size()]); - Arrays.sort(fetcherArray, new EntryFetcherComparator()); - String[] choices = new String[fetcherArray.length]; - for (int i = 0; i < fetcherArray.length; i++) { - choices[i] = fetcherArray[i].getTitle(); - } - JComboBox fetcherChoice = new JComboBox<>(choices); - int defaultFetcher = preferences.getInt(JabRefPreferences.SELECTED_FETCHER_INDEX); - if (defaultFetcher >= fetcherArray.length) { - defaultFetcher = 0; - } - this.activeFetcher = fetcherArray[defaultFetcher]; - fetcherChoice.setSelectedIndex(defaultFetcher); - if (this.activeFetcher.getOptionsPanel() != null) { - optPanel.add(this.activeFetcher.getOptionsPanel(), BorderLayout.CENTER); - } - HelpAction help = new HelpAction(activeFetcher.getHelpPage()); - JButton helpBut = help.getHelpButton(); - helpBut.setEnabled(activeFetcher.getHelpPage() != null); - - fetcherChoice.addActionListener(actionEvent -> { - activeFetcher = fetcherArray[fetcherChoice.getSelectedIndex()]; - preferences.putInt(JabRefPreferences.SELECTED_FETCHER_INDEX, fetcherChoice.getSelectedIndex()); - if (activeFetcher.getHelpPage() == null) { - helpBut.setEnabled(false); - } else { - help.setHelpFile(activeFetcher.getHelpPage()); - helpBut.setEnabled(true); - } - optionsCards.show(optionsPanel, String.valueOf(fetcherChoice.getSelectedIndex())); - optPanel.removeAll(); - if (activeFetcher.getOptionsPanel() != null) { - optPanel.add(activeFetcher.getOptionsPanel(), BorderLayout.CENTER); - } - }); - - helpBut.setMargin(new Insets(0, 0, 0, 0)); - tf.setPreferredSize(new Dimension(1, tf.getPreferredSize().height)); - if (OS.OS_X) { - tf.putClientProperty("JTextField.variant", "search"); - } - - tf.setName("tf"); - // add action to reset-button. resets tf and requests focus - JButton reset = new JButton(Localization.lang("Reset")); - reset.addActionListener(event -> { - tf.setText(""); - tf.requestFocus(); - }); - - JPanel main = new JPanel(); - GridBagLayout gbl = new GridBagLayout(); - main.setLayout(gbl); - GridBagConstraints con = new GridBagConstraints(); - con.fill = GridBagConstraints.BOTH; - con.insets = new Insets(0, 0, 2, 0); - con.gridwidth = GridBagConstraints.REMAINDER; - con.weightx = 1; - con.weighty = 1; - con.insets = new Insets(1, 0, 1, 0); - con.fill = GridBagConstraints.BOTH; - gbl.setConstraints(fetcherChoice, con); - main.add(fetcherChoice); - con.insets = new Insets(0, 0, 0, 0); - gbl.setConstraints(tf, con); - main.add(tf); - - // Go Button - con.weighty = 0; - con.gridwidth = 1; - JButton go = new JButton(Localization.lang("Fetch")); - gbl.setConstraints(go, con); - main.add(go); - - // Reset Button - reset.setName("reset"); - gbl.setConstraints(reset, con); - main.add(reset); - - // Help Button - con.gridwidth = GridBagConstraints.REMAINDER; - gbl.setConstraints(helpBut, con); - main.add(helpBut); - - gbl.setConstraints(optPanel, con); - main.add(optPanel); - - main.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); - go.addActionListener(this); - tf.addActionListener(this); - - SwingNode swingNode = new SwingNode(); - SwingUtilities.invokeLater(() -> swingNode.setContent(main)); - return swingNode; - } - - @Override - public SidePaneType getType() { - return SidePaneType.WEB_SEARCH; - } - - @Override - public void actionPerformed(ActionEvent e) { - if (tf.getText().trim().isEmpty()) { - frame.output(Localization.lang("Please enter a search string")); - return; - } - - if (frame.getCurrentBasePanel() == null) { - frame.output(Localization.lang("Please open or start a new library before searching")); - return; - } - - final ImportInspectionDialog dialog = new ImportInspectionDialog(frame, frame.getCurrentBasePanel(), - activeFetcher.getTitle(), false); - dialog.addCallBack(activeFetcher); - dialog.setVisible(true); - - JabRefExecutorService.INSTANCE.execute(() -> { - if (activeFetcher.processQuery(tf.getText().trim(), dialog, dialog)) { - dialog.entryListComplete(); - } else { - dialog.dispose(); - } - }); - } - - @Override - public void beforeClosing() { - preferences.putBoolean(JabRefPreferences.WEB_SEARCH_VISIBLE, Boolean.FALSE); - } - - @Override - public void afterOpening() { - preferences.putBoolean(JabRefPreferences.WEB_SEARCH_VISIBLE, Boolean.TRUE); - } - - @Override - public Priority getResizePolicy() { - return Priority.NEVER; - } - - private static class EntryFetcherComparator implements Comparator { - - @Override - public int compare(EntryFetcher entryFetcher, EntryFetcher entryFetcher1) { - return entryFetcher.getTitle().compareTo(entryFetcher1.getTitle()); - } - } -} diff --git a/src/main/java/org/jabref/gui/importer/fetcher/SearchBasedEntryFetcher.java b/src/main/java/org/jabref/gui/importer/fetcher/SearchBasedEntryFetcher.java deleted file mode 100644 index b5d3f398a28..00000000000 --- a/src/main/java/org/jabref/gui/importer/fetcher/SearchBasedEntryFetcher.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.jabref.gui.importer.fetcher; - -import java.util.List; -import java.util.Objects; - -import javax.swing.JPanel; - -import org.jabref.gui.importer.ImportInspectionDialog; -import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportInspector; -import org.jabref.logic.importer.OutputPrinter; -import org.jabref.logic.importer.SearchBasedFetcher; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.BibEntry; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Wrapper around {@link SearchBasedFetcher} which implements the old {@link EntryFetcher} interface. - */ -public class SearchBasedEntryFetcher implements EntryFetcher { - - private static final Logger LOGGER = LoggerFactory.getLogger(SearchBasedEntryFetcher.class); - private final SearchBasedFetcher fetcher; - - public SearchBasedEntryFetcher(SearchBasedFetcher fetcher) { - this.fetcher = Objects.requireNonNull(fetcher); - } - - @Override - public boolean processQuery(String query, ImportInspector inspector, OutputPrinter status) { - status.setStatus(Localization.lang("Processing %0", query)); - try { - List matches = fetcher.performSearch(query); - matches.forEach(inspector::addEntry); - return !matches.isEmpty(); - } catch (FetcherException e) { - LOGGER.error("Error while fetching from " + getTitle(), e); - ((ImportInspectionDialog)inspector).showErrorMessage(this.getTitle(), e.getLocalizedMessage()); - } - - return false; - } - - @Override - public String getTitle() { - return fetcher.getName(); - } - - @Override - public HelpFile getHelpPage() { - return fetcher.getHelpPage(); - } - - @Override - public JPanel getOptionsPanel() { - // not supported - return null; - } - - @Override - public void stopFetching() { - // not supported - } -} diff --git a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPane.java b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPane.java new file mode 100644 index 00000000000..1f9c0d637d6 --- /dev/null +++ b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPane.java @@ -0,0 +1,107 @@ +package org.jabref.gui.importer.fetcher; + +import javafx.geometry.Pos; +import javafx.scene.Node; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.TextField; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; + +import org.jabref.gui.JabRefFrame; +import org.jabref.gui.SidePaneComponent; +import org.jabref.gui.SidePaneManager; +import org.jabref.gui.SidePaneType; +import org.jabref.gui.actions.Action; +import org.jabref.gui.actions.ActionFactory; +import org.jabref.gui.actions.StandardActions; +import org.jabref.gui.help.HelpAction; +import org.jabref.gui.icon.IconTheme; +import org.jabref.gui.search.SearchTextField; +import org.jabref.gui.util.ViewModelListCellFactory; +import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.l10n.Localization; +import org.jabref.preferences.JabRefPreferences; + +import org.fxmisc.easybind.EasyBind; + +public class WebSearchPane extends SidePaneComponent { + + private final JabRefPreferences preferences; + private final WebSearchPaneViewModel viewModel; + + public WebSearchPane(SidePaneManager sidePaneManager, JabRefPreferences preferences, JabRefFrame frame) { + super(sidePaneManager, IconTheme.JabRefIcons.WWW, Localization.lang("Web search")); + this.preferences = preferences; + this.viewModel = new WebSearchPaneViewModel(preferences.getImportFormatPreferences(), frame, preferences); + } + + @Override + public Action getToggleAction() { + return StandardActions.TOGGLE_WEB_SEARCH; + } + + @Override + protected Node createContentPane() { + // Setup combo box for fetchers + ComboBox fetchers = new ComboBox<>(); + new ViewModelListCellFactory() + .withText(SearchBasedFetcher::getName) + .install(fetchers); + fetchers.itemsProperty().bind(viewModel.fetchersProperty()); + fetchers.valueProperty().bindBidirectional(viewModel.selectedFetcherProperty()); + fetchers.setMaxWidth(Double.POSITIVE_INFINITY); + + // Create help button for currently selected fetcher + StackPane helpButtonContainer = new StackPane(); + ActionFactory factory = new ActionFactory(preferences.getKeyBindingRepository()); + EasyBind.subscribe(viewModel.selectedFetcherProperty(), fetcher -> { + if ((fetcher != null) && fetcher.getHelpPage().isPresent()) { + HelpAction helpCommand = new HelpAction(fetcher.getHelpPage().get()); + Button helpButton = factory.createIconButton(StandardActions.HELP, helpCommand.getCommand()); + helpButtonContainer.getChildren().setAll(helpButton); + } else { + helpButtonContainer.getChildren().clear(); + } + }); + HBox fetcherContainer = new HBox(fetchers, helpButtonContainer); + HBox.setHgrow(fetchers, Priority.ALWAYS); + + // Create text field for query input + TextField query = SearchTextField.create(); + viewModel.queryProperty().bind(query.textProperty()); + + // Create button that triggers search + Button search = new Button(Localization.lang("Search")); + search.setDefaultButton(true); + search.setOnAction(event -> viewModel.search()); + + // Put everything together + VBox container = new VBox(); + container.setAlignment(Pos.CENTER); + container.getChildren().addAll(fetcherContainer, query, search); + return container; + } + + @Override + public SidePaneType getType() { + return SidePaneType.WEB_SEARCH; + } + + @Override + public void beforeClosing() { + preferences.putBoolean(JabRefPreferences.WEB_SEARCH_VISIBLE, Boolean.FALSE); + } + + @Override + public void afterOpening() { + preferences.putBoolean(JabRefPreferences.WEB_SEARCH_VISIBLE, Boolean.TRUE); + } + + @Override + public Priority getResizePolicy() { + return Priority.NEVER; + } +} diff --git a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java new file mode 100644 index 00000000000..87fc803a95a --- /dev/null +++ b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java @@ -0,0 +1,117 @@ +package org.jabref.gui.importer.fetcher; + +import java.util.Comparator; +import java.util.List; + +import javax.swing.SwingUtilities; + +import javafx.beans.property.ListProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleListProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + +import org.jabref.logic.JabRefExecutorService; +import org.jabref.gui.JabRefFrame; +import org.jabref.gui.importer.ImportInspectionDialog; +import org.jabref.logic.importer.FetcherException; +import org.jabref.logic.importer.ImportFormatPreferences; +import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.importer.WebFetcher; +import org.jabref.logic.importer.WebFetchers; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; +import org.jabref.preferences.JabRefPreferences; + +import org.fxmisc.easybind.EasyBind; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class WebSearchPaneViewModel { + + private static final Logger LOGGER = LoggerFactory.getLogger(WebSearchPaneViewModel.class); + + private final ObjectProperty selectedFetcher = new SimpleObjectProperty<>(); + private final ListProperty fetchers = new SimpleListProperty<>(FXCollections.observableArrayList()); + private final StringProperty query = new SimpleStringProperty(); + private final JabRefFrame frame; + + public WebSearchPaneViewModel(ImportFormatPreferences importPreferences, JabRefFrame frame, JabRefPreferences preferences) { + // TODO: Rework so that we don't rely on JabRefFrame and not the complete preferences + this.frame = frame; + + List allFetchers = WebFetchers.getSearchBasedFetchers(importPreferences); + allFetchers.sort(Comparator.comparing(WebFetcher::getName)); + fetchers.setAll(allFetchers); + + // Choose last-selected fetcher as default + int defaultFetcherIndex = preferences.getInt(JabRefPreferences.SELECTED_FETCHER_INDEX); + if ((defaultFetcherIndex <= 0) || (defaultFetcherIndex >= fetchers.size())) { + selectedFetcherProperty().setValue(fetchers.get(0)); + } else { + selectedFetcherProperty().setValue(fetchers.get(defaultFetcherIndex)); + } + EasyBind.subscribe(selectedFetcherProperty(), newFetcher -> { + int newIndex = fetchers.indexOf(newFetcher); + preferences.putInt(JabRefPreferences.SELECTED_FETCHER_INDEX, newIndex); + }); + } + + public ObservableList getFetchers() { + return fetchers.get(); + } + + public ListProperty fetchersProperty() { + return fetchers; + } + + public SearchBasedFetcher getSelectedFetcher() { + return selectedFetcher.get(); + } + + public ObjectProperty selectedFetcherProperty() { + return selectedFetcher; + } + + public String getQuery() { + return query.get(); + } + + public StringProperty queryProperty() { + return query; + } + + public void search() { + if (StringUtil.isBlank(getQuery())) { + frame.output(Localization.lang("Please enter a search string")); + return; + } + + if (frame.getCurrentBasePanel() == null) { + frame.output(Localization.lang("Please open or start a new library before searching")); + return; + } + + SearchBasedFetcher activeFetcher = getSelectedFetcher(); + final ImportInspectionDialog dialog = new ImportInspectionDialog(frame, frame.getCurrentBasePanel(), + activeFetcher.getName(), false); + + SwingUtilities.invokeLater(() -> dialog.setVisible(true)); + + JabRefExecutorService.INSTANCE.execute(() -> { + dialog.setStatus(Localization.lang("Processing %0", getQuery())); + try { + List matches = activeFetcher.performSearch(getQuery().trim()); + dialog.addEntries(matches); + dialog.entryListComplete(); + } catch (FetcherException e) { + LOGGER.error("Error while fetching from " + activeFetcher.getName(), e); + dialog.showErrorMessage(activeFetcher.getName(), e.getLocalizedMessage()); + } + }); + } +} diff --git a/src/main/java/org/jabref/gui/journals/AbbreviateAction.java b/src/main/java/org/jabref/gui/journals/AbbreviateAction.java index 283905fb435..7ae99570098 100644 --- a/src/main/java/org/jabref/gui/journals/AbbreviateAction.java +++ b/src/main/java/org/jabref/gui/journals/AbbreviateAction.java @@ -8,7 +8,7 @@ import java.util.concurrent.Future; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.actions.BaseAction; import org.jabref.gui.undo.NamedCompound; diff --git a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java index 83cd9613807..6356f501ba5 100644 --- a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java +++ b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java @@ -7,7 +7,7 @@ import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java b/src/main/java/org/jabref/gui/migrations/CustomEntryTypePreferenceMigration.java similarity index 98% rename from src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java rename to src/main/java/org/jabref/gui/migrations/CustomEntryTypePreferenceMigration.java index f4573c62236..5d85e19691d 100644 --- a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java +++ b/src/main/java/org/jabref/gui/migrations/CustomEntryTypePreferenceMigration.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.gui.migrations; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/jabref/migrations/FileLinksUpgradeWarning.java b/src/main/java/org/jabref/gui/migrations/FileLinksUpgradeWarning.java similarity index 99% rename from src/main/java/org/jabref/migrations/FileLinksUpgradeWarning.java rename to src/main/java/org/jabref/gui/migrations/FileLinksUpgradeWarning.java index 8668bc30843..cf645fbbf6d 100644 --- a/src/main/java/org/jabref/migrations/FileLinksUpgradeWarning.java +++ b/src/main/java/org/jabref/gui/migrations/FileLinksUpgradeWarning.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.gui.migrations; import java.util.List; diff --git a/src/main/java/org/jabref/migrations/PreferencesMigrations.java b/src/main/java/org/jabref/gui/migrations/PreferencesMigrations.java similarity index 99% rename from src/main/java/org/jabref/migrations/PreferencesMigrations.java rename to src/main/java/org/jabref/gui/migrations/PreferencesMigrations.java index f0923915177..37699a9157b 100644 --- a/src/main/java/org/jabref/migrations/PreferencesMigrations.java +++ b/src/main/java/org/jabref/gui/migrations/PreferencesMigrations.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.gui.migrations; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/org/jabref/gui/preftabs/PreferencesDialog.java b/src/main/java/org/jabref/gui/preftabs/PreferencesDialog.java index 61b497f8c8d..03f978153e5 100644 --- a/src/main/java/org/jabref/gui/preftabs/PreferencesDialog.java +++ b/src/main/java/org/jabref/gui/preftabs/PreferencesDialog.java @@ -26,7 +26,7 @@ import javafx.scene.layout.Region; import org.jabref.Globals; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; import org.jabref.gui.DialogService; import org.jabref.gui.GUIGlobals; import org.jabref.gui.JabRefFrame; diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationAction.java b/src/main/java/org/jabref/gui/push/PushToApplicationAction.java index 468fb8b57dc..c07a8f20104 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationAction.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationAction.java @@ -8,7 +8,7 @@ import javax.swing.Action; import javax.swing.SwingUtilities; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.JabRefFrame; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/push/PushToEmacs.java b/src/main/java/org/jabref/gui/push/PushToEmacs.java index 3603bd646cb..ee2369b5267 100644 --- a/src/main/java/org/jabref/gui/push/PushToEmacs.java +++ b/src/main/java/org/jabref/gui/push/PushToEmacs.java @@ -5,7 +5,7 @@ import java.util.List; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index 265d9f0fbbe..1514c4604d9 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -7,7 +7,7 @@ import java.util.List; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; diff --git a/src/main/java/org/jabref/gui/push/PushToVim.java b/src/main/java/org/jabref/gui/push/PushToVim.java index 46af5b2556d..54d576abc19 100644 --- a/src/main/java/org/jabref/gui/push/PushToVim.java +++ b/src/main/java/org/jabref/gui/push/PushToVim.java @@ -5,7 +5,7 @@ import java.util.List; import org.jabref.Globals; -import org.jabref.JabRefExecutorService; +import org.jabref.logic.JabRefExecutorService; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; diff --git a/src/main/java/org/jabref/gui/search/SearchTextField.java b/src/main/java/org/jabref/gui/search/SearchTextField.java index b752b744ccf..cbb8ef0e650 100644 --- a/src/main/java/org/jabref/gui/search/SearchTextField.java +++ b/src/main/java/org/jabref/gui/search/SearchTextField.java @@ -1,7 +1,5 @@ package org.jabref.gui.search; -import javafx.scene.control.TextField; - import org.jabref.gui.icon.IconTheme; import org.jabref.logic.l10n.Localization; @@ -10,7 +8,7 @@ public class SearchTextField { - public static TextField create() { + public static CustomTextField create() { CustomTextField textField = (CustomTextField) TextFields.createClearableTextField(); textField.setPromptText(Localization.lang("Search") + "..."); textField.setLeft(IconTheme.JabRefIcons.SEARCH.getGraphicNode()); diff --git a/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseDialog.java b/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseDialog.java index 9dd594d2418..a42586827d7 100644 --- a/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseDialog.java +++ b/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseDialog.java @@ -31,7 +31,7 @@ import javax.swing.KeyStroke; import org.jabref.Globals; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; import org.jabref.JabRefGUI; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; diff --git a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java index e33bd4cbccc..e628e1c371e 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java @@ -3,6 +3,7 @@ import java.util.function.BiConsumer; import javafx.scene.Node; +import javafx.scene.control.ComboBox; import javafx.scene.control.ContextMenu; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; @@ -107,6 +108,11 @@ public ViewModelListCellFactory setOnDragOver(BiConsumer comboBox) { + comboBox.setButtonCell(this.call(null)); + comboBox.setCellFactory(this); + } + @Override public ListCell call(ListView param) { diff --git a/src/main/java/org/jabref/logic/importer/ImportInspector.java b/src/main/java/org/jabref/logic/importer/ImportInspector.java deleted file mode 100644 index 80ec91e9bb5..00000000000 --- a/src/main/java/org/jabref/logic/importer/ImportInspector.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.jabref.logic.importer; - -import org.jabref.model.entry.BibEntry; - -/** - * An ImportInspector can be passed to a EntryFetcher and will receive entries - * as they are fetched from somewhere. - * - * Currently there are two implementations: ImportInspectionDialog and - * ImportInspectionCommandLine - * - */ -public interface ImportInspector { - - /** - * Notify the ImportInspector about the progress of the operation. - * - * The Inspector for instance could display a progress bar with the given - * values. - * - * @param current - * A number that is related to the work already done. - * - * @param max - * A current estimate for the total amount of work to be done. - */ - void setProgress(int current, int max); - - /** - * Add the given entry to the list of entries managed by the inspector. - * - * @param entry - * The entry to add. - */ - void addEntry(BibEntry entry); -} diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 6270350cc84..4a0a4b19466 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -35,7 +35,7 @@ import java.util.stream.Collectors; import org.jabref.Globals; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; import org.jabref.JabRefMain; import org.jabref.gui.SidePaneType; import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode; @@ -702,8 +702,8 @@ private JabRefPreferences() { defaults.put(EMAIL_SUBJECT, Localization.lang("References")); defaults.put(OPEN_FOLDERS_OF_ATTACHED_FILES, Boolean.FALSE); defaults.put(ALLOW_FILE_AUTO_OPEN_BROWSE, Boolean.TRUE); - defaults.put(WEB_SEARCH_VISIBLE, Boolean.FALSE); - defaults.put(GROUP_SIDEPANE_VISIBLE, Boolean.FALSE); + defaults.put(WEB_SEARCH_VISIBLE, Boolean.TRUE); + defaults.put(GROUP_SIDEPANE_VISIBLE, Boolean.TRUE); defaults.put(SELECTED_FETCHER_INDEX, 0); defaults.put(BIB_LOC_AS_PRIMARY_DIR, Boolean.FALSE); defaults.put(DB_CONNECT_SERVER_TYPE, "MySQL"); @@ -1035,6 +1035,10 @@ public void putInt(String key, int value) { prefs.putInt(key, value); } + public void putInt(String key, Number value) { + prefs.putInt(key, value.intValue()); + } + public void putDouble(String key, double value) { prefs.putDouble(key, value); } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 55b6f2209de..d2de9afd87d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -416,8 +416,6 @@ External\ programs=External programs External\ viewer\ called=External viewer called -Fetch=Fetch - Field=Field field=field @@ -1180,7 +1178,6 @@ Your\ new\ key\ bindings\ have\ been\ stored.=Your new key bindings have been st The\ following\ fetchers\ are\ available\:=The following fetchers are available: Could\ not\ find\ fetcher\ '%0'=Could not find fetcher '%0' Running\ query\ '%0'\ with\ fetcher\ '%1'.=Running query '%0' with fetcher '%1'. -Query\ '%0'\ with\ fetcher\ '%1'\ did\ not\ return\ any\ results.=Query '%0' with fetcher '%1' did not return any results. Move\ file=Move file Rename\ file=Rename file @@ -1192,7 +1189,6 @@ Could\ not\ move\ file\ '%0'.=Could not move file '%0'. Could\ not\ find\ file\ '%0'.=Could not find file '%0'. Number\ of\ entries\ successfully\ imported=Number of entries successfully imported Import\ canceled\ by\ user=Import canceled by user -Progress\:\ %0\ of\ %1=Progress: %0 of %1 Error\ while\ fetching\ from\ %0=Error while fetching from %0 Show\ search\ results\ in\ a\ window=Show search results in a window diff --git a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelTest.java b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelTest.java index 5c47dec695e..ea4ad6f637b 100644 --- a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelTest.java +++ b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelTest.java @@ -12,7 +12,7 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import org.jabref.JabRefException; +import org.jabref.logic.JabRefException; import org.jabref.gui.DialogService; import org.jabref.gui.util.CurrentThreadTaskExecutor; import org.jabref.gui.util.TaskExecutor; diff --git a/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java b/src/test/java/org/jabref/gui/migrations/PreferencesMigrationsTest.java similarity index 99% rename from src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java rename to src/test/java/org/jabref/gui/migrations/PreferencesMigrationsTest.java index be1d34e8f39..b00d6332170 100644 --- a/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java +++ b/src/test/java/org/jabref/gui/migrations/PreferencesMigrationsTest.java @@ -1,4 +1,4 @@ -package org.jabref.migrations; +package org.jabref.gui.migrations; import java.util.prefs.Preferences; diff --git a/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java b/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java deleted file mode 100644 index 6be9c501a00..00000000000 --- a/src/test/java/org/jabref/logic/exporter/BibTeXMLExporterTestFiles.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.jabref.logic.exporter; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.fileformat.BibtexImporter; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.util.DummyFileUpdateMonitor; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; -import org.mockito.Answers; -import org.xmlunit.builder.Input; -import org.xmlunit.builder.Input.Builder; -import org.xmlunit.diff.DefaultNodeMatcher; -import org.xmlunit.diff.ElementSelectors; -import org.xmlunit.matchers.CompareMatcher; - -import static org.mockito.Mockito.mock; - -@RunWith(Parameterized.class) -public class BibTeXMLExporterTestFiles { - - public BibDatabaseContext databaseContext; - public Charset charset; - public File tempFile; - public BibTeXMLExporter bibtexmlExportFormat; - public BibtexImporter testImporter; - - @Parameter - public String filename; - public Path resourceDir; - - @Rule - public TemporaryFolder testFolder = new TemporaryFolder(); - - @Parameters(name = "{0}") - public static Collection fileNames() throws IOException, URISyntaxException { - try (Stream stream = Files.list(Paths.get(BibTeXMLExporterTestFiles.class.getResource("").toURI()))) { - return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) - .filter(n -> n.startsWith("BibTeXML")).collect(Collectors.toList()); - } - } - - @Before - public void setUp() throws Exception { - resourceDir = Paths.get(BibTeXMLExporterTestFiles.class.getResource("").toURI()); - databaseContext = new BibDatabaseContext(); - charset = StandardCharsets.UTF_8; - bibtexmlExportFormat = new BibTeXMLExporter(); - tempFile = testFolder.newFile(); - testImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); - } - - @Test - public final void testPerformExport() throws IOException, SaveException { - String xmlFileName = filename.replace(".bib", ".xml"); - Path importFile = resourceDir.resolve(filename); - String tempFilename = tempFile.getCanonicalPath(); - - List entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase() - .getEntries(); - - bibtexmlExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); - - Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName))); - Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); - - Assert.assertThat(test, CompareMatcher.isSimilarTo(control) - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); - } -} diff --git a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java b/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java deleted file mode 100644 index c078e3e4b2b..00000000000 --- a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatTestFiles.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.jabref.logic.exporter; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.fileformat.BibtexImporter; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.util.DummyFileUpdateMonitor; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; -import org.mockito.Answers; -import org.xmlunit.builder.Input; -import org.xmlunit.builder.Input.Builder; -import org.xmlunit.diff.DefaultNodeMatcher; -import org.xmlunit.diff.ElementSelectors; -import org.xmlunit.matchers.CompareMatcher; - -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.mock; - -@RunWith(Parameterized.class) -public class MSBibExportFormatTestFiles { - - public BibDatabaseContext databaseContext; - public Charset charset; - public Path tempFile; - public MSBibExporter msBibExportFormat; - public BibtexImporter testImporter; - - @Parameter - public String filename; - public Path resourceDir; - - @Rule - public TemporaryFolder testFolder = new TemporaryFolder(); - - - @Parameters(name = "{0}") - public static Collection fileNames() throws IOException, URISyntaxException { - try (Stream stream = Files.list(Paths.get(MSBibExportFormatTestFiles.class.getResource("").toURI()))) { - return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) - .filter(n -> n.startsWith("MsBib")).collect(Collectors.toList()); - } - } - - @Before - public void setUp() throws Exception { - resourceDir = Paths.get(MSBibExportFormatTestFiles.class.getResource("").toURI()); - databaseContext = new BibDatabaseContext(); - charset = StandardCharsets.UTF_8; - msBibExportFormat = new MSBibExporter(); - tempFile = testFolder.newFile().toPath(); - testImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); - } - - @Test - public final void testPerformExport() throws IOException, SaveException { - String xmlFileName = filename.replace(".bib", ".xml"); - Path importFile = resourceDir.resolve(filename); - - List entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase() - .getEntries(); - - msBibExportFormat.export(databaseContext, tempFile, charset, entries); - - Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName))); - Builder test = Input.from(Files.newInputStream(tempFile)); - - assertThat(test, CompareMatcher.isSimilarTo(control) - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); - } -} diff --git a/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java b/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java deleted file mode 100644 index 3faf73dd291..00000000000 --- a/src/test/java/org/jabref/logic/exporter/ModsExportFormatTestFiles.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.jabref.logic.exporter; - -import java.io.File; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.jabref.logic.bibtex.BibEntryAssert; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.fileformat.BibtexImporter; -import org.jabref.logic.importer.fileformat.ModsImporter; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.util.DummyFileUpdateMonitor; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; -import org.mockito.Answers; -import org.xmlunit.builder.Input; -import org.xmlunit.builder.Input.Builder; -import org.xmlunit.diff.DefaultNodeMatcher; -import org.xmlunit.diff.ElementSelectors; -import org.xmlunit.matchers.CompareMatcher; - -import static org.mockito.Mockito.mock; - -@RunWith(Parameterized.class) -public class ModsExportFormatTestFiles { - - public Charset charset; - private BibDatabaseContext databaseContext; - private File tempFile; - private ModsExporter modsExportFormat; - private BibtexImporter bibtexImporter; - private ModsImporter modsImporter; - private Path importFile; - - - @Parameter - public String filename; - - @Rule - public TemporaryFolder testFolder = new TemporaryFolder(); - - - @Parameters(name = "{0}") - public static Collection fileNames() throws Exception { - try (Stream stream = Files.list(Paths.get(ModsExportFormatTestFiles.class.getResource("").toURI()))) { - // stream.forEach(n -> System.out.println(n)); - return stream.map(n -> n.getFileName().toString()).filter(n -> n.endsWith(".bib")) - .filter(n -> n.startsWith("Mods")).collect(Collectors.toList()); - } - } - - @Before - public void setUp() throws Exception { - databaseContext = new BibDatabaseContext(); - importFile = Paths.get(ModsExportFormatTestFiles.class.getResource(filename).toURI()); - charset = StandardCharsets.UTF_8; - modsExportFormat = new ModsExporter(); - tempFile = testFolder.newFile(); - bibtexImporter = new BibtexImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS), new DummyFileUpdateMonitor()); - modsImporter = new ModsImporter(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); - } - - @Test - public final void testPerformExport() throws Exception { - String xmlFileName = filename.replace(".bib", ".xml"); - String tempFilename = tempFile.getCanonicalPath(); - List entries = bibtexImporter.importDatabase(importFile, charset).getDatabase().getEntries(); - Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI()); - - modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); - - Builder control = Input.from(Files.newInputStream(xmlFile)); - Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); - - Assert.assertThat(test, CompareMatcher.isSimilarTo(control) - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); - } - - @Test - public final void testExportAsModsAndThenImportAsMods() throws Exception { - List entries = bibtexImporter.importDatabase(importFile, charset).getDatabase().getEntries(); - - modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); - BibEntryAssert.assertEquals(entries, Paths.get(tempFile.getPath()), modsImporter); - } - - @Test - public final void testImportAsModsAndExportAsMods() throws Exception { - String xmlFileName = filename.replace(".bib", ".xml"); - String tempFilename = tempFile.getCanonicalPath(); - Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI()); - - List entries = modsImporter.importDatabase(xmlFile, charset).getDatabase().getEntries(); - - modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries); - - Builder control = Input.from(Files.newInputStream(xmlFile)); - Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename))); - - Assert.assertThat(test, CompareMatcher.isSimilarTo(control) - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); - } - -} diff --git a/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java b/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java deleted file mode 100644 index 225808a91ee..00000000000 --- a/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.jabref.logic.net; - -import java.io.IOException; -import java.net.URISyntaxException; - -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Rule; -import org.junit.Test; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.any; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.head; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class MimeTypeDetectorTest { - - @Rule public WireMockRule wireMockRule = new WireMockRule(); - - @Test - public void handlePermanentRedirections() throws IOException { - String redirectedUrl = "http://localhost:8080/redirection"; - - stubFor(any(urlEqualTo("/redirection")) - .willReturn( - aResponse() - .withStatus(301) - .withHeader("Location", "http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.pdf") - ) - ); - - assertTrue(new URLDownload(redirectedUrl).isMimeType("application/pdf")); - } - - @Test - public void beFalseForUnreachableUrl() throws IOException { - String invalidUrl = "http://idontknowthisurlforsure.de"; - assertFalse(new URLDownload(invalidUrl).isMimeType("application/pdf")); - } - - @Test - public void beTrueForPdfMimeType() throws IOException { - String pdfUrl = "http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.pdf"; - assertTrue(new URLDownload(pdfUrl).isMimeType("application/pdf")); - } - - @Test - public void beTrueForLocalPdfUri() throws URISyntaxException, IOException { - String localPath = MimeTypeDetectorTest.class.getResource("empty.pdf").toURI().toASCIIString(); - assertTrue(new URLDownload(localPath).isMimeType("application/pdf")); - } - - @Test - public void beTrueForPDFMimeTypeVariations() throws IOException { - String mimeTypeVariation = "http://localhost:8080/mimevariation"; - - stubFor(any(urlEqualTo("/mimevariation")) - .willReturn( - aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") - ) - ); - - assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); - } - - @Test - public void beAbleToUseHeadRequest() throws IOException { - String mimeTypeVariation = "http://localhost:8080/mimevariation"; - - stubFor(head(urlEqualTo("/mimevariation")) - .willReturn( - aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") - ) - ); - - assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); - } - - @Test - public void beAbleToUseGetRequest() throws IOException { - String mimeTypeVariation = "http://localhost:8080/mimevariation"; - - stubFor(head(urlEqualTo("/mimevariation")) - .willReturn( - aResponse().withStatus(404) - ) - ); - stubFor(get(urlEqualTo("/mimevariation")) - .willReturn( - aResponse().withHeader("Content-Type", "application/pdf;charset=ISO-8859-1") - ) - ); - - assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); - } -} diff --git a/src/test/java/org/jabref/testutils/TestUtils.java b/src/test/java/org/jabref/testutils/TestUtils.java deleted file mode 100644 index 83120f4c62c..00000000000 --- a/src/test/java/org/jabref/testutils/TestUtils.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.jabref.testutils; - -import org.jabref.JabRefGUI; -import org.jabref.JabRefMain; - -public class TestUtils { - - private static final String PATH_TO_TEST_BIBTEX = "src/test/resources/org/jabref/bibtexFiles/test.bib"; - - /** - * Initialize JabRef. Can be cleaned up with - * {@link TestUtils#closeJabRef()} - * - * @see TestUtils#closeJabRef() - */ - public static void initJabRef() { - String[] args = {"-p", " ", TestUtils.PATH_TO_TEST_BIBTEX}; - JabRefMain.main(args); - } - - /** - * Closes the current instance of JabRef. - */ - public static void closeJabRef() { - if (JabRefGUI.getMainFrame() != null) { - } - } - -} diff --git a/src/test/resources/log4j2-test.xml b/src/test/resources/log4j2-test.xml new file mode 100644 index 00000000000..0422d0bd80d --- /dev/null +++ b/src/test/resources/log4j2-test.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/java/org/jabref/model/entry/FileFieldBibEntryTest.java b/src/test/resources/org/jabref/model/entry/FileFieldBibEntryTest.java similarity index 100% rename from src/test/java/org/jabref/model/entry/FileFieldBibEntryTest.java rename to src/test/resources/org/jabref/model/entry/FileFieldBibEntryTest.java diff --git a/src/test/java/org/jabref/model/groups/TexGroupTest.java b/src/test/resources/org/jabref/model/groups/TexGroupTest.java similarity index 100% rename from src/test/java/org/jabref/model/groups/TexGroupTest.java rename to src/test/resources/org/jabref/model/groups/TexGroupTest.java diff --git a/xjc.gradle b/xjc.gradle deleted file mode 100644 index ea33b543a03..00000000000 --- a/xjc.gradle +++ /dev/null @@ -1,41 +0,0 @@ -configurations { - xjc -} - -dependencies { - // Cannot be updated. - xjc 'com.sun.xml.bind:jaxb-xjc:2.2.4-1' -} - -task xjc { - inputs.dir "src/main/resources/xjc/medline/" - inputs.dir "src/main/resources/xjc/bibtexml/" - inputs.dir "src/main/resources/xjc/endnote/" - inputs.dir "src/main/resources/xjc/mods/" - outputs.dir "src/main/gen/org/jabref/logic/importer/fileformat/medline" - outputs.dir "src/main/gen/org/jabref/logic/importer/fileformat/bibtexml" - outputs.dir "src/main/gen/org/jabref/logic/importer/fileformat/endnote" - outputs.dir "src/main/gen/org/jabref/logic/importer/fileformat/mods" - - ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xjc.asPath) - - doLast { - ant.xjc(destdir: 'src/main/gen/', package: 'org.jabref.logic.importer.fileformat.medline') { - schema(dir: 'src/main/resources/xjc/medline', includes: 'medline.xsd') - } - ant.xjc(destdir: 'src/main/gen/', package: 'org.jabref.logic.importer.fileformat.bibtexml') { - schema(dir: 'src/main/resources/xjc/bibtexml', includes: 'bibtexml.xsd') - } - ant.xjc(destdir: 'src/main/gen/', package: 'org.jabref.logic.importer.fileformat.endnote') { - arg(value: '-dtd') - schema(dir: 'src/main/resources/xjc/endnote', includes: 'RSXML.dtd') - } - ant.xjc(destdir: 'src/main/gen/', package: 'org.jabref.logic.importer.fileformat.mods') { - arg(value: '-npa') //don't create package-info.java because it was manually added in src/main/java to ensure the namespace prefix mapping - schema(dir: 'src/main/resources/xjc/mods', includes: 'mods-3-7.xsd') - binding(dir: 'src/main/resources/xjc/mods', includes: 'mods-binding.xjb') - } - } -} - -tasks.compileJava.dependsOn xjc