Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
don-vip committed Oct 10, 2021
1 parent 17b814b commit 148645d
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.openstreetmap.josm.plugins.PluginInformation;
import org.openstreetmap.josm.spi.preferences.Config;

/**
* Conflation plugin.
*/
public class ConflationPlugin extends Plugin {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@
import org.openstreetmap.josm.plugins.conflation.config.SettingsDialog;
import org.openstreetmap.josm.spi.preferences.IPreferences;
import org.openstreetmap.josm.tools.InputMapUtils;
import org.openstreetmap.josm.tools.Logging;
import org.openstreetmap.josm.tools.Shortcut;
import org.xml.sax.SAXException;

/**
* Conflation dialog.
*/
public class ConflationToggleDialog extends ToggleDialog
implements DataSelectionListener, DataSetListener, SimpleMatchListListener, LayerChangeListener {

Expand Down Expand Up @@ -130,8 +134,6 @@ protected void buttonAction(int buttonIndex, ActionEvent evt) {
ConflationToggleDialog.this.settings = this.getSettings();
ConflationToggleDialog.this.settingsDialog.savePreferences(pref);
ConflationToggleDialog.this.performMatching();
} else {
// do nothing
}
} else {
super.buttonAction(buttonIndex, evt);
Expand Down Expand Up @@ -441,7 +443,9 @@ private void setListsContentAddListnersAndLayer(SimpleMatchList matchList,
MainApplication.getLayerManager().addLayer(conflationLayer);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(MainApplication.getMainFrame(), ex.toString(), "Error adding conflation layer", JOptionPane.ERROR_MESSAGE);
Logging.error(ex);
JOptionPane.showMessageDialog(MainApplication.getMainFrame(), ex.toString(),
"Error adding conflation layer", JOptionPane.ERROR_MESSAGE);
}
if (conflationLayer != null) {
conflationLayer.setMatches(matches);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.openstreetmap.josm.data.osm.visitor.MergeSourceBuildingVisitor;
import org.openstreetmap.josm.gui.MainApplication;

/**
* Utilities class.
*/
public final class ConflationUtils {

private ConflationUtils() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,5 @@ public void allowCancellationRequests() {
public boolean isCancelRequested() {
return josmMonitor.isCanceled();
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ public interface SimpleMatchListListener {
* @param list The new list.
*/
void simpleMatchListIntervalRemoved(SimpleMatchList list, int firstRow, int lastRow);

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class SimpleMatchSettings {
*/
public Collection<String> overwriteTags;


/**
* A Collection that always answer true when asked if it contains any object (except for the removed items!).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.openstreetmap.josm.tools.UserCancelException;
import org.openstreetmap.josm.tools.Utils;


/**
* Command to conflate one object with another.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import com.vividsolutions.jcs.conflate.polygonmatch.WindowFilter;
import com.vividsolutions.jcs.plugin.conflate.polygonmatch.MyValidatingTextField;


/**
* This advanced panel is a modified version of the original code
* from Vivd Solutions for the JUMP JCS Plugin ToolboxPanel.java.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ public abstract class MatchFinderPanel extends JPanel {
public abstract FCMatchFinder getMatchFinder();

public abstract void savePreferences(IPreferences pref);

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.vividsolutions.jcs.conflate.polygonmatch.FCMatchFinder;
import com.vividsolutions.jcs.conflate.polygonmatch.FeatureMatcher;


/**
* Programming Match Finder Panel.
* Allow user to directly enter a constructor expression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ private Border createLightTitleBorder(String title) {
return new CompoundBorder(tileBorder, emptyBorder);
}


public boolean checkValidityOrNotifyProblems() {
if (referenceSelection.isEmpty() || subjectSelection.isEmpty()) {
JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ public class AccentlessNormalizeRule implements NormalizeRule {
public String normalize(String value) {
return Normalizer.normalize(value, Normalizer.Form.NFD).replaceAll("\\p{M}", "");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ public class ExactValueMatcher implements ValueMatcher {
public double match(String target, String candidate) {
return target.equals(candidate) ? 1.0 : 0.0;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: GPL. For details, see LICENSE file.
package org.openstreetmap.josm.plugins.conflation.matcher;

import java.util.Locale;

import org.openstreetmap.josm.data.validation.tests.SimilarNamedWays.NormalizeRule;

public class LowerCaseNormalizeRule implements NormalizeRule {
Expand All @@ -9,7 +11,6 @@ public class LowerCaseNormalizeRule implements NormalizeRule {

@Override
public String normalize(String t) {
return t.toLowerCase();
return t.toLowerCase(Locale.ENGLISH);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ public class NoneNormalizeRule implements NormalizeRule {
public String normalize(String value) {
return value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ public interface ValueMatcher {
* @return matching score (between 0.0 and 1.0)
*/
double match(String target, String candidate);

}

0 comments on commit 148645d

Please sign in to comment.