Revision: 5098
          http://sourceforge.net/p/jump-pilot/code/5098
Author:   michaudm
Date:     2016-10-25 07:11:00 +0000 (Tue, 25 Oct 2016)
Log Message:
-----------
small cleaning

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/feature/FeatureUtil.java
    
core/trunk/src/com/vividsolutions/jump/plugin/edit/AffineTransControlPointExtracter.java
    
core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringsWithData2Features.java
    core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryComponents.java
    core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryIndex.java
    core/trunk/src/com/vividsolutions/jump/qa/diff/ExactGeometryMatcher.java
    core/trunk/src/com/vividsolutions/jump/qa/diff/MatchFeature.java
    core/trunk/src/com/vividsolutions/jump/task/PrintStreamTaskMonitor.java
    core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java
    core/trunk/src/com/vividsolutions/jump/tools/OverlayEngine.java
    core/trunk/src/com/vividsolutions/jump/util/commandline/CommandLine.java
    core/trunk/src/com/vividsolutions/jump/util/commandline/Option.java
    core/trunk/src/com/vividsolutions/jump/util/commandline/OptionSpec.java

Modified: core/trunk/src/com/vividsolutions/jump/feature/FeatureUtil.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/feature/FeatureUtil.java     
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/feature/FeatureUtil.java     
2016-10-25 07:11:00 UTC (rev 5098)
@@ -34,7 +34,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.List;
 
 import com.vividsolutions.jts.geom.Geometry;
@@ -78,10 +77,8 @@
      * Compares two Features for order based on their feature ID.
      * @see Feature#getID()
      */
-       public static class IDComparator implements Comparator {
-               public int compare(Object o1, Object o2) {
-                       Feature f1 = (Feature) o1;
-                       Feature f2 = (Feature) o2;
+       public static class IDComparator implements Comparator<Feature> {
+               public int compare(Feature f1, Feature f2) {
 
                        if (f1.getID() < f2.getID()) {
                                return -1;
@@ -101,7 +98,7 @@
      * Increments and returns the feature-ID counter
      * @see Feature#getID()
      */
-       public static int nextID() { return ++lastID; }
+       static int nextID() { return ++lastID; }
 
     /**
      * Although Feature implements Cloneable, this method is useful

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/AffineTransControlPointExtracter.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/plugin/edit/AffineTransControlPointExtracter.java
    2016-10-24 19:04:27 UTC (rev 5097)
+++ 
core/trunk/src/com/vividsolutions/jump/plugin/edit/AffineTransControlPointExtracter.java
    2016-10-25 07:11:00 UTC (rev 5098)
@@ -54,8 +54,8 @@
  * @author Martin Davis
  * @version 1.0
  */
-public class AffineTransControlPointExtracter
-{
+public class AffineTransControlPointExtracter {
+
   public static final int TYPE_UNKNOWN = 0;
   public static final int TYPE_VECTOR = 1;
   public static final int TYPE_LINE_3 = 2;
@@ -66,11 +66,9 @@
   private int inputType = TYPE_UNKNOWN;
   private String parseErrMsg = 
I18N.get("jump.plugin.edit.AffineTransControlPointExtracter.Unrecognized-control-point-geometry");
 
-  private int numGeoms;
   private Geometry[] geomSrc = new Geometry[3];
   private Geometry[] geomDest = new Geometry[3];
 
-  private int numControlPts;
   private Coordinate[] controlPtSrc;
   private Coordinate[] controlPtDest;
 
@@ -80,19 +78,18 @@
     init();
   }
 
-  public int getInputType() { return inputType; }
-  public String getParseErrorMessage() { return parseErrMsg; }
+  int getInputType() { return inputType; }
+  String getParseErrorMessage() { return parseErrMsg; }
 
-  public Coordinate[] getSrcControlPoints() { return controlPtSrc; }
-  public Coordinate[] getDestControlPoints() { return controlPtDest; }
+  Coordinate[] getSrcControlPoints() { return controlPtSrc; }
+  Coordinate[] getDestControlPoints() { return controlPtDest; }
 
   private void init()
   {
     parseInput();
   }
 
-  private void parseInput()
-  {
+  private void parseInput() {
     inputType = TYPE_UNKNOWN;
     int fcSrcSize = fcSrc.size();
     int fcDestSize = fcDest.size();
@@ -102,14 +99,15 @@
       parseErrMsg = 
I18N.get("jump.plugin.edit.AffineTransControlPointExtracter.Control-point-collections-must-be-same-size");
       return;
     }
+
     // for now only handling pair of geoms to define control points
     if (fcSrcSize != 1) {
       parseErrMsg = 
I18N.get("jump.plugin.edit.AffineTransControlPointExtracter.Control-points-must-be-a-single-geometry");
       return;
     }
 
-    geomSrc[0] = ((Feature) fcSrc.iterator().next()).getGeometry();
-    geomDest[0] = ((Feature) fcDest.iterator().next()).getGeometry();
+    geomSrc[0] = fcSrc.iterator().next().getGeometry();
+    geomDest[0] = fcDest.iterator().next().getGeometry();
 
     if (geomSrc[0].getClass() != geomDest[0].getClass()) {
       parseErrMsg = 
I18N.get("jump.plugin.edit.AffineTransControlPointExtracter.Control-points-must-be-LineStrings");
@@ -123,11 +121,9 @@
     }
 
     parseLines();
-    return;
   }
 
-  private void parseLines()
-  {
+  private void parseLines() {
     controlPtSrc = geomSrc[0].getCoordinates();
     controlPtDest = geomDest[0].getCoordinates();
 

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringsWithData2Features.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringsWithData2Features.java
     2016-10-24 19:04:27 UTC (rev 5097)
+++ 
core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringsWithData2Features.java
     2016-10-25 07:11:00 UTC (rev 5098)
@@ -72,8 +72,10 @@
     public static Geometry buildGeometry(Geometry source, 
             Map<Integer,Map<Integer,List<SegmentString>>> nodedSegmentStrings,
             boolean interpolate_z, int interpolated_z_dp, GeometryFactory gf) {
+
         // Use the same factory as source
         Geometry[] finalComponents = new Geometry[nodedSegmentStrings.size()];
+
         // For each component
         for (int i = 0 ; i < finalComponents.length ; i++) {
             Geometry sourceComponent = source.getGeometryN(i);
@@ -102,7 +104,6 @@
                     interpolate(lines.get(0), exteriorRing, interpolated_z_dp);
                 }
                 // Now process holes the same way
-                //LinearRing[] holes = new LinearRing[lines.size()-1];
                 List<LinearRing> holes = new ArrayList<>();
                 for (int j = 0 ; j < lines.size()-1 ; j++) {
                     LinearRing hole = (LinearRing)merge(lines.get(j+1), gf, 
true);

Modified: 
core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryComponents.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryComponents.java  
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryComponents.java  
2016-10-25 07:11:00 UTC (rev 5098)
@@ -44,8 +44,8 @@
   private DiffGeometryMatcher diffMatcher = new ExactGeometryMatcher();
   private boolean splitIntoComponents = true;
   
-  final static String sMatchingfeatures = 
I18N.get("com.vividsolutions.jump.qa.diff.DiffGeometry.Matching-features");
-  final static String sGeometries = 
I18N.get("com.vividsolutions.jump.qa.diff.DiffGeometryComponents.geometries");
+  private final static String sMatchingfeatures = 
I18N.get("com.vividsolutions.jump.qa.diff.DiffGeometry.Matching-features");
+  private final static String sGeometries = 
I18N.get("com.vividsolutions.jump.qa.diff.DiffGeometryComponents.geometries");
 
   public DiffGeometryComponents(FeatureCollection fc0,
                                 FeatureCollection fc1,

Modified: core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryIndex.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryIndex.java       
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometryIndex.java       
2016-10-25 07:11:00 UTC (rev 5098)
@@ -108,7 +108,7 @@
         }
     }
 
-    public Collection<Feature> getUnmatchedFeatures() {
+    private Collection<Feature> getUnmatchedFeatures() {
         Set<Feature> unmatchedFeatureSet = new TreeSet<>(new 
FeatureUtil.IDComparator());
         for (FeatureGeometry featureGeom : featureList) {
             if (! featureGeom.isMatched()) {
@@ -118,12 +118,12 @@
         return unmatchedFeatureSet;
     }
 
-    public class FeatureGeometry {
+    private class FeatureGeometry {
         private Feature feat;
         private Geometry geom;
         private boolean isMatched = false;
 
-        public FeatureGeometry(Feature feat, Geometry geom) {
+        FeatureGeometry(Feature feat, Geometry geom) {
             this.feat = feat;
             this.geom = geom;
         }

Modified: 
core/trunk/src/com/vividsolutions/jump/qa/diff/ExactGeometryMatcher.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/qa/diff/ExactGeometryMatcher.java    
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/qa/diff/ExactGeometryMatcher.java    
2016-10-25 07:11:00 UTC (rev 5098)
@@ -42,10 +42,12 @@
   {
     queryGeom = geom;
   }
+
   public Geometry getQueryGeometry()
   {
     return queryGeom;
   }
+
   public boolean isMatch(Geometry geom)
   {
     return queryGeom.equalsExact(geom);

Modified: core/trunk/src/com/vividsolutions/jump/qa/diff/MatchFeature.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/qa/diff/MatchFeature.java    
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/qa/diff/MatchFeature.java    
2016-10-25 07:11:00 UTC (rev 5098)
@@ -35,6 +35,7 @@
 import com.vividsolutions.jump.feature.*;
 
 public class MatchFeature {
+
   private Feature feature;
   private boolean isMatched;
 
@@ -42,8 +43,17 @@
   {
     this.feature = feature;
   }
-  public Feature getFeature() { return feature; }
-  public void setMatched(boolean isMatched) { this.isMatched = isMatched; }
-  public boolean isMatched() { return isMatched; }
 
+  public Feature getFeature() {
+    return feature;
+  }
+
+  public void setMatched(boolean isMatched) {
+    this.isMatched = isMatched;
+  }
+
+  public boolean isMatched() {
+    return isMatched;
+  }
+
 }

Modified: 
core/trunk/src/com/vividsolutions/jump/task/PrintStreamTaskMonitor.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/task/PrintStreamTaskMonitor.java     
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/task/PrintStreamTaskMonitor.java     
2016-10-25 07:11:00 UTC (rev 5098)
@@ -45,7 +45,7 @@
  */
 public class PrintStreamTaskMonitor implements TaskMonitor {
     private PrintStream stream;
-    boolean isLoggingSubtasks = false;
+    private boolean isLoggingSubtasks = false;
 
     public PrintStreamTaskMonitor(PrintStream stream) {
         this.stream = stream;

Modified: core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java    
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java    
2016-10-25 07:11:00 UTC (rev 5098)
@@ -14,18 +14,18 @@
    * set message on autochecked monitor object
    */
   public static void report(TaskMonitor monitor, String message) {
-    if (monitor instanceof TaskMonitor)
+    if (monitor != null)
       monitor.report(message);
   }
 
   public static void report(TaskMonitor monitor, int itemsDone, int totalItems,
       String itemDescription) {
-    if (monitor instanceof TaskMonitor)
+    if (monitor != null)
       monitor.report(itemsDone, totalItems, itemDescription);
   }
 
   public static boolean isCancelRequested(TaskMonitor monitor){
-    if (monitor instanceof TaskMonitor)
+    if (monitor != null)
       return monitor.isCancelRequested();
     return false;
   }

Modified: core/trunk/src/com/vividsolutions/jump/tools/OverlayEngine.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/tools/OverlayEngine.java     
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/tools/OverlayEngine.java     
2016-10-25 07:11:00 UTC (rev 5098)
@@ -33,7 +33,6 @@
 
 package com.vividsolutions.jump.tools;
 
-import java.util.Iterator;
 import java.util.List;
 
 import com.vividsolutions.jts.geom.Geometry;

Modified: 
core/trunk/src/com/vividsolutions/jump/util/commandline/CommandLine.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/util/commandline/CommandLine.java    
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/util/commandline/CommandLine.java    
2016-10-25 07:11:00 UTC (rev 5098)
@@ -46,12 +46,12 @@
 public class CommandLine {
 
   // store options defs
-  Vector<OptionSpec> optSpecs = new Vector<>();
+  private Vector<OptionSpec> optSpecs = new Vector<>();
 
   // store optionless file parameters
-  Vector<String> parVec = new Vector<>(); // store plain params (e.g. 
projects/files to open)
+  private Vector<String> parVec = new Vector<>(); // store plain params (e.g. 
projects/files to open)
 
-  char optionChar; // the char that indicates an option. Default is '/', which 
is
+  private char optionChar; // the char that indicates an option. Default is 
'/', which is
                    // NT Standard, but this causes problems on Unix systems, so
                    // '-' is used by JUMPWorkbench (better for cross-platform 
apps)
 
@@ -69,7 +69,7 @@
 
   }
 
-  OptionSpec getOptionSpec(String name) {
+  private OptionSpec getOptionSpec(String name) {
     for (OptionSpec optionSpec : optSpecs) {
       if (optionSpec.matches(name)) {
         return optionSpec;

Modified: core/trunk/src/com/vividsolutions/jump/util/commandline/Option.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/util/commandline/Option.java 
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/util/commandline/Option.java 
2016-10-25 07:11:00 UTC (rev 5098)
@@ -38,8 +38,8 @@
  * The parameters for an instance of an option occurring in a command.
  */
 public class Option {
-  OptionSpec optSpec;
-  Vector<String> args = new Vector<>(); // the actual option args found
+  private OptionSpec optSpec;
+  private Vector<String> args = new Vector<>(); // the actual option args found
 
   public Option(OptionSpec spec, String[] _args) {
     optSpec = spec;

Modified: 
core/trunk/src/com/vividsolutions/jump/util/commandline/OptionSpec.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/util/commandline/OptionSpec.java     
2016-10-24 19:04:27 UTC (rev 5097)
+++ core/trunk/src/com/vividsolutions/jump/util/commandline/OptionSpec.java     
2016-10-25 07:11:00 UTC (rev 5098)
@@ -45,16 +45,17 @@
  * Specifies the syntax for a single option on a command line.
  */
 public class OptionSpec {
-  public final static int NARGS_ZERO_OR_MORE = -1;
-  public final static int NARGS_ONE_OR_MORE = -2;
-  public final static int NARGS_ZERO_OR_ONE = -3;
 
-  Vector<String> names = new Vector<>();
+  private final static int NARGS_ZERO_OR_MORE = -1;
+  private final static int NARGS_ONE_OR_MORE = -2;
+  private final static int NARGS_ZERO_OR_ONE = -3;
+
+  private Vector<String> names = new Vector<>();
   // number of arguments needed, will be checked
-  int nNeededArgs = 0;
-  String syntaxPattern;
-  String doc = ""; // option description
-  Vector<Option> options = new Vector<>();
+  private int nNeededArgs = 0;
+  private String syntaxPattern;
+  private String doc = ""; // option description
+  private Vector<Option> options = new Vector<>();
 
   public OptionSpec(String[] optNames, int numberOfNeededArgs, String desc) {
     for (String name : optNames) {
@@ -121,7 +122,7 @@
     return nNeededArgs;
   }
 
-  void checkNumArgs(String[] args) throws ParseException {
+  private void checkNumArgs(String[] args) throws ParseException {
     if (nNeededArgs == NARGS_ZERO_OR_MORE) {
       // this is senseless as it allows everything
     } else if (nNeededArgs == NARGS_ONE_OR_MORE) {


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to