Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor code cleanups #1991

Merged
merged 1 commit into from
Sep 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public HelpFile getHelpPage() {
return HelpFile.FETCHER_GVK;
}

private String getSearchQueryStringForComplexQuery(List<String> queryList) throws FetcherException {
private String getSearchQueryStringForComplexQuery(List<String> queryList) {
String query = "";
boolean lastWasNoKey = false;

Expand All @@ -56,7 +56,7 @@ private String getSearchQueryStringForComplexQuery(List<String> queryList) throw
return query.trim();
}

protected String getSearchQueryString(String query) throws FetcherException {
protected String getSearchQueryString(String query) {
Objects.requireNonNull(query);
LinkedList<String> queryList = new LinkedList<>(Arrays.asList(query.split("\\s")));

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/model/entry/AuthorList.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ public String getForAlphabetization() {
* Regarding to the name affixes.
* @return New string with correct seperation
*/
private static StringBuilder buildWithAffix(Collection<Integer> indexArray, List nameList) {
private static StringBuilder buildWithAffix(Collection<Integer> indexArray, List<String> nameList) {
StringBuilder stringBuilder = new StringBuilder();
// avoidedTimes needs to be increased by the count of avoided terms for correct odd/even calculation
int avoidedTimes = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/model/groups/GroupTreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ public String getName() {
return group.getName();
}

public GroupTreeNode addSubgroup(AbstractGroup group) {
GroupTreeNode child = GroupTreeNode.fromGroup(group);
public GroupTreeNode addSubgroup(AbstractGroup subgroup) {
GroupTreeNode child = GroupTreeNode.fromGroup(subgroup);
addChild(child);
return child;
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/net/sf/jabref/preferences/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private JabRefPreferences() {
defaults.put(LATEX_EDITOR_PATH, JabRefDesktop.getNativeDesktop().detectProgramPath("LEd", "LEd"));
defaults.put(TEXSTUDIO_PATH, JabRefDesktop.getNativeDesktop().detectProgramPath("texstudio", "TeXstudio"));

defaults.put(BIBLATEX_DEFAULT_MODE, false);
defaults.put(BIBLATEX_DEFAULT_MODE, Boolean.FALSE);

if (OS.OS_X) {
defaults.put(EMACS_PATH, "emacsclient");
Expand All @@ -508,7 +508,7 @@ private JabRefPreferences() {
} else if (OS.WINDOWS) {
defaults.put(WIN_LOOK_AND_FEEL, "com.jgoodies.looks.windows.WindowsLookAndFeel");
defaults.put(EMACS_PATH, "emacsclient.exe");
defaults.put(EMACS_23, true);
defaults.put(EMACS_23, Boolean.TRUE);
defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-n -e");
defaults.put(FONT_FAMILY, "Arial");

Expand All @@ -518,7 +518,7 @@ private JabRefPreferences() {
defaults.put(FONT_FAMILY, "SansSerif");

defaults.put(EMACS_PATH, "gnuclient");
defaults.put(EMACS_23, false);
defaults.put(EMACS_23, Boolean.FALSE);
defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-batch -eval");
}
defaults.put(PUSH_TO_APPLICATION, "TeXstudio");
Expand Down Expand Up @@ -712,9 +712,9 @@ private JabRefPreferences() {
defaults.put(OO_JARS_PATH, "/opt/openoffice.org/basis3.0");
}

defaults.put(OO_SYNC_WHEN_CITING, false);
defaults.put(OO_SHOW_PANEL, false);
defaults.put(OO_USE_ALL_OPEN_BASES, true);
defaults.put(OO_SYNC_WHEN_CITING, Boolean.FALSE);
defaults.put(OO_SHOW_PANEL, Boolean.FALSE);
defaults.put(OO_USE_ALL_OPEN_BASES, Boolean.TRUE);
defaults.put(OO_BIBLIOGRAPHY_STYLE_FILE,
StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH);
defaults.put(OO_EXTERNAL_STYLE_FILES, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void testCrossRef() throws URISyntaxException, IOException {
}

@Test
public void testFileNotFound() throws URISyntaxException, IOException {
public void testFileNotFound() {
AuxParser auxParser = new AuxParser("unknownfile.bib", new BibDatabase());
AuxParserResult auxResult = auxParser.parse();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.sf.jabref.logic.importer.fetcher;

import java.io.IOException;
import java.util.Optional;

import net.sf.jabref.logic.importer.FetcherException;
Expand Down Expand Up @@ -46,37 +45,37 @@ public void testHelpPage() {
}

@Test
public void testFetcher10() throws FetcherException, IOException {
public void testFetcher10() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("0321356683");
assertEquals(Optional.of(bibEntry), fetchedEntry);
}

@Test
public void testFetcher13() throws FetcherException, IOException {
public void testFetcher13() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("978-0321356680");
assertEquals(Optional.of(bibEntry), fetchedEntry);
}

@Test
public void testFetcher10Empty() throws FetcherException, IOException {
public void testFetcher10Empty() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("");
assertEquals(Optional.empty(), fetchedEntry);
}

@Test
public void testFetcher10ShortISBN() throws FetcherException, IOException {
public void testFetcher10ShortISBN() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("123456789");
assertEquals(Optional.empty(), fetchedEntry);
}

@Test
public void testFetcher10LongISBN() throws FetcherException, IOException {
public void testFetcher10LongISBN() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("012345678910");
assertEquals(Optional.empty(), fetchedEntry);
}

@Test
public void testFetcher10InvalidISBN() throws FetcherException, IOException {
public void testFetcher10InvalidISBN() throws FetcherException {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("jabref-4-ever");
assertEquals(Optional.empty(), fetchedEntry);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.sf.jabref.logic.util.io;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -23,7 +22,7 @@ public class RegExpFileSearchTests {
private BibEntry entry;

@Before
public void setUp() throws IOException {
public void setUp() {

entry = new BibEntry();
entry.setType(BibtexEntryTypes.ARTICLE);
Expand Down