Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (12 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java

    r29854 r30532  
    1212 *
    1313 */
    14 public class Response
     14public class Response<E>
    1515{
    1616    final static public byte typeFileInfo = (byte)0xBB;
     
    2323    private int nextIdx = 0;
    2424    private Dg100Config config = null;
    25     private List data = new ArrayList(100);
     25    private List<E> data = new ArrayList<>(100);
    2626    private long id = 0;
    2727
     
    3535     * @param resp
    3636     */
    37     static public Response parseResponse(byte resp[], int len)
     37    static public Response<?> parseResponse(byte resp[], int len)
    3838    {
    3939        ByteBuffer buf = ByteBuffer.wrap(resp);
    4040        byte respType = buf.get(4);
    41         Response response = new Response(respType);
    4241        buf.position(5);
    4342        if (respType == typeFileInfo) // file info
    4443        {
     44            Response<FileInfoRec> response = new Response<>(respType);
    4545            int cntInfoCur = buf.getShort();
    4646            int nextIdx = buf.getShort();
     
    5252                response.addRec(fileInfoRec);
    5353            }
     54            return response;
    5455        }
    5556        else if (respType == typeGpsRec) // gps recs
    5657        {
     58            Response<GpsRec> response = new Response<>(respType);
    5759            int recType = 2;
    5860            // read part 1
     
    8587                recType = gpsRec.getDg100TypeOfNextRec();
    8688            }
     89            return response;
    8790        }
    8891        else if (respType == typeConfig) // config
    8992        {
     93            Response<?> response = new Response<>(respType);
    9094            Dg100Config config = new Dg100Config(buf);
    9195            response.config = config;
     96            return response;
    9297        }
    9398        else if (respType == typeId) // id
    9499        {
     100            Response<?> response = new Response<>(respType);
    95101            response.id = 0;
    96102            for (int ii = 0 ; ii < 8 ; ++ii)
     
    99105                response.id = response.id * 10 + digit;
    100106            }
     107            return response;
    101108        }
    102109        else
    103110        {
     111            return new Response<>(respType);
    104112        }
    105         return response;
    106113    }
    107114
    108     private void addRec(Object obj)
     115    private void addRec(E obj)
    109116    {
    110117        data.add(obj);
    111118    }
    112119
    113     public List getRecs()
     120    public List<E> getRecs()
    114121    {
    115122        return data;
Note: See TracChangeset for help on using the changeset viewer.