Changeset 32049 in osm


Ignore:
Timestamp:
2016-02-03T23:26:51+01:00 (8 years ago)
Author:
donvip
Message:

[josm_proj4j] fix warnings

Location:
applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/Registry.java

    r29325 r32049  
    105105  }
    106106
    107   private Map<String, Class> projRegistry;
    108 
    109   private void register( String name, Class cls, String description ) {
     107  private Map<String, Class<?>> projRegistry;
     108
     109  private void register( String name, Class<?> cls, String description ) {
    110110    projRegistry.put( name, cls );
    111111  }
     
    114114//    if ( projRegistry == null )
    115115//      initialize();
    116     Class cls = (Class)projRegistry.get( name );
     116    Class<?> cls = (Class<?>)projRegistry.get( name );
    117117    if ( cls != null ) {
    118118      try {
     
    136136    if (projRegistry != null)
    137137      return;
    138     projRegistry = new HashMap();
     138    projRegistry = new HashMap<>();
    139139    register( "aea", AlbersProjection.class, "Albers Equal Area" );
    140140    register( "aeqd", EquidistantAzimuthalProjection.class, "Azimuthal Equidistant" );
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/datum/GeocentricConverter.java

    r28495 r32049  
    140140        double SPHI;     /* sin of searched geodetic latitude */
    141141        double SDPHI;    /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
    142         boolean At_Pole;     /* indicates location is in polar region */
     142        //boolean At_Pole;     /* indicates location is in polar region */
    143143        int iter;        /* # of continous iteration, max. 30 is always enough (s.a.) */
    144144
     
    150150        double Height;
    151151
    152         At_Pole = false;
     152        //At_Pole = false;
    153153        P = Math.sqrt(X*X+Y*Y);
    154154        RR = Math.sqrt(X*X+Y*Y+Z*Z);
     
    158158
    159159                /*  special case, if P=0. (X=0., Y=0.) */
    160                 At_Pole = true;
     160                //At_Pole = true;
    161161                Longitude = 0.0;
    162162
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/io/CSVRecordParser.java

    r26409 r32049  
    5858  {
    5959    loc = 0;
    60     List vals = new ArrayList();
     60    List<String> vals = new ArrayList<>();
    6161    int lineLen = record.length();
    6262    while (loc < lineLen) {
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/io/MetaCRSTestCase.java

    r26409 r32049  
    99        private static final CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();
    1010       
    11   private boolean verbose = true;
    12  
    1311  String testName;
    1412  String testMethod;
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/io/MetaCRSTestFileReader.java

    r30737 r32049  
    3434  throws IOException
    3535  {
    36     LineNumberReader lineReader = new LineNumberReader(new FileReader(file));
    37     List<MetaCRSTestCase> tests = null;
    38     try {
    39        tests = parseFile(lineReader);
     36    try (LineNumberReader lineReader = new LineNumberReader(new FileReader(file))) {
     37       return parseFile(lineReader);
    4038    }
    41     finally {
    42       lineReader.close();
    43     }
    44     return tests;
    4539  }
    4640 
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/io/Proj4FileReader.java

    r27902 r32049  
    2828                throw new IllegalStateException("Unable to access CRS file: " + filename);
    2929        }
    30     BufferedReader reader = new BufferedReader(
    31           new InputStreamReader(inStr) );
    32     String[] args;
    33     try {
    34       args = readFile(reader, name);
     30    try (BufferedReader reader = new BufferedReader(new InputStreamReader(inStr))) {
     31      return readFile(reader, name);
    3532    }
    36     finally {
    37       if (reader != null)
    38         reader.close();
    39     }
    40     return args;
    4133  }
    4234 
     
    7668        throw new IOException( t.lineno()+": '>' expected" );
    7769      t.nextToken();
    78       List v = new ArrayList();
     70      List<String> v = new ArrayList<>();
    7971
    8072      while ( t.ttype != '<' ) {
     
    116108  }
    117109 
    118   private static void addParam(List v, String key, String value)
     110  private static void addParam(List<String> v, String key, String value)
    119111  {
    120112    String plusKey = key;
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/parser/DatumParameters.java

    r27902 r32049  
    2323  private final static double RA4 = .04722222222222222222; /* 17/360 */
    2424  private final static double RA6 = .02215608465608465608; /* 67/3024 */
    25   private final static double RV4 = .06944444444444444444; /* 5/72 */
    26   private final static double RV6 = .04243827160493827160; /* 55/1296 */
     25  //private final static double RV4 = .06944444444444444444; /* 5/72 */
     26  //private final static double RV6 = .04243827160493827160; /* 55/1296 */
    2727
    2828  private Datum datum = null;
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/parser/Proj4Keyword.java

    r30737 r32049  
    5454  private static Set<String> supportedParams = null;
    5555 
    56   public static synchronized Set supportedParameters()
     56  public static synchronized Set<String> supportedParameters()
    5757  {
    5858    if (supportedParams == null) {
     
    110110  }
    111111 
    112   public static void checkUnsupported(Collection params)
     112  public static void checkUnsupported(Collection<?> params)
    113113  {
    114114    for (Object s : params) {
  • applications/editors/josm/plugins/proj4j/src/org/osgeo/proj4j/parser/Proj4Parser.java

    r30737 r32049  
    2727      return null;
    2828   
    29     Map params = createParameterMap(args);
     29    Map<String, String> params = createParameterMap(args);
    3030    Proj4Keyword.checkUnsupported(params.keySet());
    3131    DatumParameters datumParam = new DatumParameters();
     
    4545  * initialized from a PROJ.4 argument list.
    4646  */
    47  private Projection parseProjection( Map params, Ellipsoid ellipsoid ) {
     47 private Projection parseProjection( Map<String, String> params, Ellipsoid ellipsoid ) {
    4848   Projection projection = null;
    4949
     
    136136 }
    137137
    138  private void parseDatum(Map params, DatumParameters datumParam)
     138 private void parseDatum(Map<String, String> params, DatumParameters datumParam)
    139139 {
    140140   String towgs84 = (String) params.get(Proj4Keyword.towgs84);
     
    193193 }
    194194 
    195  private void parseEllipsoid(Map params, DatumParameters datumParam)
     195 private void parseEllipsoid(Map<String, String> params, DatumParameters datumParam)
    196196 {
    197197   double b = 0;
     
    280280  * @param datumParam
    281281  */
    282  private void parseEllipsoidModifiers(Map params, DatumParameters datumParam)
     282 private void parseEllipsoidModifiers(Map<String, String> params, DatumParameters datumParam)
    283283 {
    284284   /**
     
    292292 }
    293293 
    294  private Map createParameterMap(String[] args) {
    295    Map params = new HashMap();
     294 private Map<String, String> createParameterMap(String[] args) {
     295   Map<String, String> params = new HashMap<>();
    296296   for (int i = 0; i < args.length; i++) {
    297297     String arg = args[i];
Note: See TracChangeset for help on using the changeset viewer.