Commit 20cae900 authored by Florian Schäfer's avatar Florian Schäfer

Fix several Checkstyle issues

parent c5561d27
......@@ -102,7 +102,7 @@ public final class WikipediaApp {
+ "&gslimit=500"
+ "&gsbbox=" + max.lat() + "|" + min.lon() + "|" + min.lat() + "|" + max.lon();
// parse XML document
try (final InputStream in = connect(url).getContent()) {
try (InputStream in = connect(url).getContent()) {
final Document doc = newDocumentBuilder().parse(in);
final List<WikipediaEntry> entries = X_PATH.evaluateNodes("//gs", doc).stream()
.map(node -> {
......@@ -136,7 +136,7 @@ public final class WikipediaApp {
"&search=" + Utils.encodeUrl(query) +
"&limit=50" +
"&format=xml";
try (final InputStream in = connect(url).getContent()) {
try (InputStream in = connect(url).getContent()) {
final Document xml = newDocumentBuilder().parse(in);
final List<WikidataEntry> r = X_PATH.evaluateNodes("//entity", xml).stream()
.map(node -> new WikidataEntry(X_PATH.evaluateString("@id", node), null, null, null))
......
......@@ -145,7 +145,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
private final boolean wikidata;
public WikipediaLoadCoordinatesAction(boolean wikidata) {
WikipediaLoadCoordinatesAction(boolean wikidata) {
super(wikidata ? tr("Wikidata") : tr("Coordinates"));
this.wikidata = wikidata;
new ImageProvider("dialogs", wikidata ? "wikidata" : "wikipedia").getResource().attachImageIcon(this, true);
......@@ -158,7 +158,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
public void actionPerformed(ActionEvent e) {
try {
// determine bbox
MapView mapView = MainApplication.getMap().mapView;
MapView mapView = MainApplication.getMap().mapView;
final LatLon min = mapView.getLatLon(0, mapView.getHeight());
final LatLon max = mapView.getLatLon(mapView.getWidth(), 0);
// add entries to list model
......@@ -206,7 +206,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
class WikipediaLoadCategoryAction extends AbstractAction {
public WikipediaLoadCategoryAction() {
WikipediaLoadCategoryAction() {
super(tr("Category"));
new ImageProvider("data", "sequence").getResource().attachImageIcon(this, true);
putValue(SHORT_DESCRIPTION, tr("Fetches a list of all Wikipedia articles of a category"));
......@@ -239,7 +239,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
class PasteWikipediaArticlesAction extends AbstractAction {
public PasteWikipediaArticlesAction() {
PasteWikipediaArticlesAction() {
super(tr("Clipboard"));
new ImageProvider("paste").getResource().attachImageIcon(this, true);
putValue(SHORT_DESCRIPTION, tr("Pastes Wikipedia articles from the system clipboard"));
......@@ -261,7 +261,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
class OpenWikipediaArticleAction extends AbstractAction {
public OpenWikipediaArticleAction() {
OpenWikipediaArticleAction() {
super(tr("Open Article"));
new ImageProvider("browser").getResource().attachImageIcon(this);
putValue(SHORT_DESCRIPTION, tr("Opens the Wikipedia article of the selected item in a browser"));
......@@ -279,7 +279,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
class WikipediaSettingsAction extends AbstractAction {
public WikipediaSettingsAction() {
WikipediaSettingsAction() {
super(tr("Language"));
new ImageProvider("dialogs/settings").getResource().attachImageIcon(this, true);
putValue(SHORT_DESCRIPTION, tr("Sets the default language for the Wikipedia articles"));
......@@ -303,7 +303,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
private final JList<WikipediaEntry> list;
public AddWikipediaTagAction(JList<WikipediaEntry> list) {
AddWikipediaTagAction(JList<WikipediaEntry> list) {
super(tr("Add Tag"));
this.list = list;
new ImageProvider("pastetags").getResource().attachImageIcon(this, true);
......
......@@ -38,4 +38,4 @@ public class Debouncer {
public void shutdown() {
scheduler.shutdownNow();
}
}
\ No newline at end of file
}
......@@ -16,7 +16,7 @@ import javax.xml.xpath.XPathVariableResolver;
import java.util.AbstractList;
import java.util.Collection;
public class XPath implements javax.xml.xpath.XPath {
public final class XPath implements javax.xml.xpath.XPath {
private final javax.xml.xpath.XPath xPath;
private static final XPath INSTANCE = new XPath(XPathFactory.newInstance().newXPath());
......
// License: GPL. For details, see LICENSE file.
package org.wikipedia;
import org.junit.Rule;
......
......@@ -77,4 +77,4 @@ public class WikipediaEntryTest {
assertThat(entry.getBrowserUrl(), is("https://de.wikipedia.org/wiki/Sternheim_%26_Emanuel"));
}
}
\ No newline at end of file
}
// License: GPL. For details, see LICENSE file.
package org.wikipedia.gui;
import static org.hamcrest.CoreMatchers.is;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment