Projects >> thredds >>a9fbf4886f1e9ea6c52d1f901e8090b602402675

Chunk
Conflicting content
    dims.add( gateDim);

    Variable v = new Variable(ncfile, null, null, shortName);
<<<<<<< HEAD
    if(isCC)
      v.setDataType(DataType.SHORT);
    else
      v.setDataType(DataType.BYTE);
=======
    v.setDataType(DataType.UBYTE);
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    v.setDimensions(dims);
    ncfile.addVariable(null, v);
Solution content
    dims.add( gateDim);

    Variable v = new Variable(ncfile, null, null, shortName);
    v.setDataType(DataType.UBYTE);
    v.setDimensions(dims);
    ncfile.addVariable(null, v);
File
Cinrad2IOServiceProvider.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
    byte[] b = new byte[2];
    b[0] = Cinrad2Record.MISSING_DATA;
    b[1] = Cinrad2Record.BELOW_THRESHOLD;
<<<<<<< HEAD
    Array missingArray = Array.factory(DataType.BYTE.getPrimitiveClassType(), new int[] {2}, b);
    if(isCC)
      v.addAttribute( new Attribute(CDM.MISSING_VALUE, (short)-32768));
    else if(isCC20 && shortName.contains("RadialVelocity"))
      v.addAttribute( new Attribute(CDM.MISSING_VALUE, -128));
    else
      v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    //v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute( new Attribute(CDM.ADD_OFFSET, new Float( Cinrad2Record.getDatatypeAddOffset(datatype))));
    if(!isCC && !isCC20)
      v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));
=======
    Array missingArray = Array.factory(DataType.BYTE, new int[] {2}, b);

    v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute( new Attribute(CDM.ADD_OFFSET, new Float( Cinrad2Record.getDatatypeAddOffset(datatype))));
    //v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2

    ArrayList dim2 = new ArrayList();
    dim2.add( scanDim);
Solution content
    byte[] b = new byte[2];
    b[0] = Cinrad2Record.MISSING_DATA;
    b[1] = Cinrad2Record.BELOW_THRESHOLD;
    Array missingArray = Array.factory(DataType.BYTE, new int[] {2}, b);

    v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute( new Attribute(CDM.ADD_OFFSET, new Float( Cinrad2Record.getDatatypeAddOffset(datatype))));
    //v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));

    ArrayList dim2 = new ArrayList();
    dim2.add( scanDim);
File
Cinrad2IOServiceProvider.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
  private void makeVariableNoCoords(NetcdfFile ncfile, int datatype, String shortName, String longName, Variable from) {

    Variable v = new Variable(ncfile, null, null, shortName);
<<<<<<< HEAD
    if(isCC)
      v.setDataType(DataType.SHORT);
    else
      v.setDataType(DataType.BYTE);
=======
    v.setDataType(DataType.UBYTE);
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    v.setDimensions( from.getDimensions());
    ncfile.addVariable(null, v);
Solution content
  private void makeVariableNoCoords(NetcdfFile ncfile, int datatype, String shortName, String longName, Variable from) {

    Variable v = new Variable(ncfile, null, null, shortName);
    v.setDataType(DataType.UBYTE);
    v.setDimensions( from.getDimensions());
    ncfile.addVariable(null, v);
File
Cinrad2IOServiceProvider.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
    byte[] b = new byte[2];
    b[0] = Cinrad2Record.MISSING_DATA;
    b[1] = Cinrad2Record.BELOW_THRESHOLD;
<<<<<<< HEAD
    Array missingArray = Array.factory(DataType.BYTE.getPrimitiveClassType(), new int[]{2}, b);
    if(isCC)
      v.addAttribute( new Attribute(CDM.MISSING_VALUE, (short)-32768));
    else
      v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute(new Attribute(CDM.ADD_OFFSET, new Float(Cinrad2Record.getDatatypeAddOffset(datatype))));
    if(!isCC && !isCC20)
      v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));
=======
    Array missingArray = Array.factory(DataType.BYTE, new int[] {2}, b);

    v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute( new Attribute(CDM.ADD_OFFSET, new Float( Cinrad2Record.getDatatypeAddOffset(datatype))));
    //v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2

    Attribute fromAtt = from.findAttribute(_Coordinate.Axes);
    v.addAttribute(new Attribute(_Coordinate.Axes, fromAtt));
Solution content
    byte[] b = new byte[2];
    b[0] = Cinrad2Record.MISSING_DATA;
    b[1] = Cinrad2Record.BELOW_THRESHOLD;
    Array missingArray = Array.factory(DataType.BYTE, new int[] {2}, b);

    v.addAttribute( new Attribute(CDM.MISSING_VALUE, missingArray));
    v.addAttribute( new Attribute("signal_below_threshold", new Byte( Cinrad2Record.BELOW_THRESHOLD)));
    v.addAttribute( new Attribute(CDM.SCALE_FACTOR, new Float( Cinrad2Record.getDatatypeScaleFactor(datatype))));
    v.addAttribute( new Attribute(CDM.ADD_OFFSET, new Float( Cinrad2Record.getDatatypeAddOffset(datatype))));
    //v.addAttribute( new Attribute(CDM.UNSIGNED, "true"));

    Attribute fromAtt = from.findAttribute(_Coordinate.Axes);
File
Cinrad2IOServiceProvider.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
    long start = System.currentTimeMillis();
    remoteURI = location;

<<<<<<< HEAD
    try {
      NcStreamReader reader = new NcStreamReader();
      reader.readStream(is, this);
      this.location = SCHEME + remoteURI;

    } finally {
      is.close();
    }
=======
    NcStreamReader reader = new NcStreamReader();
    reader.readStream(is, this);
    this.location = SCHEME + remoteURI;
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    long took = System.currentTimeMillis() - start;
    if (showRequest) System.out.printf(" took %d msecs %n", took);
  }
Solution content
    long start = System.currentTimeMillis();
    remoteURI = location;

    NcStreamReader reader = new NcStreamReader();
    reader.readStream(is, this);
    this.location = SCHEME + remoteURI;
    long took = System.currentTimeMillis() - start;
    if (showRequest) System.out.printf(" took %d msecs %n", took);
  }
File
CdmRemote.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Variable
Chunk
Conflicting content
    }
  }

<<<<<<< HEAD
  public static InputStream sendQuery(String remoteURI, String query) throws IOException {
=======
  // session may be null, if so, will be closed on method.close()
  public static InputStream sendQuery(HTTPSession session, String remoteURI, String query) throws IOException {
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    long start = System.currentTimeMillis();

    StringBuilder sbuff = new StringBuilder(remoteURI);
Solution content
    }
  }

  // session may be null, if so, will be closed on method.close()
  public static InputStream sendQuery(HTTPSession session, String remoteURI, String query) throws IOException {
    long start = System.currentTimeMillis();

    StringBuilder sbuff = new StringBuilder(remoteURI);
File
CdmRemote.java
Developer's decision
Version 2
Kind of conflict
Comment
Method signature
Chunk
Conflicting content
    if (showRequest) System.out.printf(" CdmRemote sendQuery= %s", sbuff);

<<<<<<< HEAD
    HTTPMethod method = HTTPFactory.Get(sbuff.toString());
    try {
      int statusCode = method.execute();
      if (statusCode == 404) {
        throw new FileNotFoundException(method.getPath() + " " + method.getStatusLine());
      } else if (statusCode >= 400) {
        throw new IOException(method.getPath() + " " + method.getStatusLine());
      }

      InputStream stream = method.getResponseBodyAsStream();
      if (showRequest) System.out.printf(" took %d msecs %n", System.currentTimeMillis() - start);

      // Leave the stream open. We must also leave the HTTPMethod open because the two are linked:
      // calling close() on one object causes the other object to be closed as well.
      return stream;
    } catch (IOException e) {
      // Close the HTTPMethod if there was an exception; otherwise leave it open.
      method.close();
      throw e;
=======
    try (HTTPMethod method = HTTPFactory.Get(session, sbuff.toString()) ) {
      int statusCode = method.execute();

      if (statusCode == 404)
        throw new FileNotFoundException(getErrorMessage(method));

      if (statusCode >= 300)
        throw new IOException(getErrorMessage(method));

      InputStream stream = method.getResponseBodyAsStream();
      if (showRequest) System.out.printf(" took %d msecs %n", System.currentTimeMillis() - start);
      return stream;

    } catch (HTTPException he) {
      throw new IOException(he);

    } catch (IOException ioe) {
      throw ioe;
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    }
  }
Solution content
  }

    if(showRequest)
      System.out.printf(" CdmRemote sendQuery= %s", sbuff);

    try (HTTPMethod method = HTTPFactory.Get(session, sbuff.toString()) ) {
      int statusCode = method.execute();

      if (statusCode == 404)
        throw new FileNotFoundException(getErrorMessage(method));

      if (statusCode >= 300)
        throw new IOException(getErrorMessage(method));

      InputStream stream = method.getResponseBodyAsStream();
      if (showRequest) System.out.printf(" took %d msecs %n", System.currentTimeMillis() - start);
      return stream;

    } catch (HTTPException he) {
      throw new IOException(he);

    } catch (IOException ioe) {
      throw ioe;
    }
File
CdmRemote.java
Developer's decision
Manual
Kind of conflict
Other
Chunk
Conflicting content
     return size;
    }

<<<<<<< HEAD
    // Writing the size of the block is handled for us.
    DataOutputStream dos = compress.setupStream(out, (int)uncompressedLength);
    v.readToStream(section, dos);
    dos.flush();
    size += dos.size();
=======
     // regular arrays
    if (deflate) {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      DeflaterOutputStream dout = new DeflaterOutputStream(bout);
      v.readToStream(section, dout); // write to internal buffer

      // write internal buffer to output stream
      dout.close();
      int deflatedSize = bout.size();
      size += NcStream.writeVInt(out, deflatedSize);
      bout.writeTo(out);
      size += deflatedSize;
      if (show) System.out.printf("  %s proto=%d dataSize=%d len=%d%n", v.getFullName(), datab.length, deflatedSize, uncompressedLength);

    }  else {
      size += NcStream.writeVInt(out, (int) uncompressedLength); // data len or number of objects
      if (show) System.out.printf("  %s proto=%d data=%d%n", v.getFullName(), datab.length, uncompressedLength);
      size += v.readToStream(section, out); // try to do a direct transfer
    }

>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
    return size;
  }
Solution content
     return size;
    }

     // regular arrays
    if (deflate) {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      DeflaterOutputStream dout = new DeflaterOutputStream(bout);
      v.readToStream(section, dout); // write to internal buffer

      // write internal buffer to output stream
      dout.close();
      int deflatedSize = bout.size();
      size += NcStream.writeVInt(out, deflatedSize);
      bout.writeTo(out);
      size += deflatedSize;
      if (show) System.out.printf("  %s proto=%d dataSize=%d len=%d%n", v.getFullName(), datab.length, deflatedSize, uncompressedLength);

    }  else {
      size += NcStream.writeVInt(out, (int) uncompressedLength); // data len or number of objects
      if (show) System.out.printf("  %s proto=%d data=%d%n", v.getFullName(), datab.length, uncompressedLength);
      size += v.readToStream(section, out); // try to do a direct transfer
    }

    return size;
  }
File
NcStreamWriter.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Chunk
Conflicting content
    if (!allowedServices.isAllowed(StandardService.cdmRemote))
      throw new ServiceNotAllowed(StandardService.cdmRemote.toString());

<<<<<<< HEAD
          ncfile.setLocation(datasetPath); // hide where the file is stored
          String cdl = ncfile.toString();
          res.setContentLength(cdl.length());
          pw.write(cdl);
          size = cdl.length();
          break;
        }

        case ncml: {
          res.setContentType(ContentType.xml.getContentHeader());
          PrintWriter pw = res.getWriter();
          ncfile.writeNcML(pw, absPath);
          break;
        }

        case header: {
          res.setContentType(ContentType.binary.getContentHeader());
          res.setHeader("Content-Description", "ncstream");

          OutputStream out = new BufferedOutputStream(res.getOutputStream(), 10 * 1000);
          //WritableByteChannel wbc = Channels.newChannel(out);
          NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(req));
          size = ncWriter.sendHeader(out);
          out.flush();
          break;
        }

        default: {
          res.setContentType(ContentType.binary.getContentHeader());
          res.setHeader("Content-Description", "ncstream");

          size = 0;
          //WritableByteChannel wbc = Channels.newChannel(out);
          NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(req));
          String query;
          if(qb.getVar() != null)
              query = qb.getVar();
          else
              query = req.getQueryString();

          if ((query == null) || (query.length() == 0)) {
            res.sendError(HttpServletResponse.SC_BAD_REQUEST, "must have query string");
            return;
          }

          OutputStream out = new BufferedOutputStream(res.getOutputStream(), 10 * 1000);
          query = EscapeStrings.unescapeURLQuery(query);
          StringTokenizer stoke = new StringTokenizer(query, ";"); // need UTF/%decode
          while (stoke.hasMoreTokens()) {
            ParsedSectionSpec cer = ParsedSectionSpec.parseVariableSection(ncfile, stoke.nextToken());
            size += ncWriter.sendData(cer.v, cer.section, out, qb.getCompression());
          }
          out.flush();
        }
      } // end switch on req type

      res.flushBuffer();
      if (showReq)
        System.out.printf("CdmRemoteController ok, size=%s%n", size);
=======
    if (validationResult.hasErrors())
      throw new BindException(validationResult);
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2

    String datasetPath = TdsPathUtils.extractPath(request, "/cdmremote");
    String absPath = getAbsolutePath(request);
Solution content
    if (!allowedServices.isAllowed(StandardService.cdmRemote))
      throw new ServiceNotAllowed(StandardService.cdmRemote.toString());

    if (validationResult.hasErrors())
      throw new BindException(validationResult);

    String datasetPath = TdsPathUtils.extractPath(request, "/cdmremote");
    String absPath = getAbsolutePath(request);
File
CdmRemoteController.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
import com.google.common.base.MoreObjects;

<<<<<<< HEAD
import ucar.nc2.stream.NcStreamCompression;
import ucar.nc2.units.DateRange;
import ucar.nc2.units.DateType;
import ucar.nc2.units.TimeDuration;
import ucar.unidata.geoloc.LatLonPoint;
import ucar.unidata.geoloc.LatLonPointImpl;
import ucar.unidata.geoloc.LatLonRect;
=======
import java.util.ArrayList;
import java.util.List;
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2

/**
 * Parses the query parameters for cdmRemote datasets.
Solution content
import com.google.common.base.MoreObjects;

import java.util.ArrayList;
import java.util.List;

/**
 * Parses the query parameters for cdmRemote datasets.
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
  private String variables; // (forms) all some
    capabilities, cdl, data, header, ncml
  }

<<<<<<< HEAD
  public enum ResponseType {
    csv, netcdf, ncstream, html, xml
  }

  public enum SpatialSelection {
    all, bb, point, stns
  }

  public enum TemporalSelection {
    all, range, point
  }

  // type of request
  private String req = "";

  // type of response
  private String accept = "";

  // type of compression
  private NcStreamCompression compress = NcStreamCompression.none();

  // comma delimited list of variable names
=======
  // raw query parameters
  private String req;
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
  private String var;

  // parsed
Solution content
    capabilities, cdl, data, header, ncml
  }

  // raw query parameters
  private String req;
  private String var;

  // parsed
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
  // parsed
  private RequestType reqType = null;

<<<<<<< HEAD
  boolean hasFatalError() {
    return fatal;
  }

  String getErrorMessage() {
    return errs.toString();
  }

  public LatLonRect getLatLonRect() {
    return (spatialSelection == SpatialSelection.bb) ? llbb : null;
  }

  DateRange getDateRange() {
    return dateRange;
  }

  public LatLonPoint getLatlonPoint() {
    return latlonPoint;
  }

  public DateType getTimePoint() {
    return timePoint;
  }

  public RequestType getRequestType() {
    if (reqType == null) {
      if (req.equalsIgnoreCase("capabilities")) reqType = RequestType.capabilities;
      else if (req.equalsIgnoreCase("cdl")) reqType = RequestType.cdl;
      else if (req.equalsIgnoreCase("data")) reqType = RequestType.data;
      else if (req.equalsIgnoreCase("dataForm")) reqType = RequestType.dataForm;
      else if (req.equalsIgnoreCase("form")) reqType = RequestType.form;
      else if (req.equalsIgnoreCase("header")) reqType = RequestType.header;
      else if (req.equalsIgnoreCase("ncml")) reqType = RequestType.ncml;
      else if (req.equalsIgnoreCase("stations")) reqType = RequestType.stations;
      else reqType = RequestType.data; // default
    }
    return reqType;
  }

  ResponseType getResponseType() {
    if (resType == null) {
      RequestType req = getRequestType();
      if (req == RequestType.capabilities) resType = ResponseType.xml;
      else if (req == RequestType.form) resType = ResponseType.html;
    }

    if (resType == null) {
      if (accept.equalsIgnoreCase("csv")) resType = ResponseType.csv;
      else if (accept.equalsIgnoreCase("ncstream")) resType = ResponseType.ncstream;
      else if (accept.equalsIgnoreCase("netcdf")) resType = ResponseType.netcdf;
      else if (accept.equalsIgnoreCase("xml")) resType = ResponseType.xml;
      else resType = ResponseType.ncstream; // default
    }

    return resType;
  }

  NcStreamCompression getCompression() {
    return compress;
  }

  public void setDeflate(String level) {
    compress = NcStreamCompression.deflate(Integer.parseInt(level));
  }

  SpatialSelection getSpatialSelection() {
    return spatialSelection;
  }


  TemporalSelection getTemporalSelection() {
    return temporalSelection;
  }

   boolean validate() {
    RequestType reqType = getRequestType();
    if (reqType == RequestType.dataForm) {
      parseVariablesForm();
      parseSpatialExtentForm();
      parseTemporalExtentForm();

    } else {
      parseSpatialExtent();
      parseTimeExtent();

      if ((spatialSelection == null) && (stn != null))
        spatialSelection = SpatialSelection.stns;
    }
    return !fatal;
  }

  private void parseVariablesForm() {  // from the form
    if (variables == null) {
      errs.format("form must have variables=(all|some)%n");
      fatal = true;
      return;
    }

    if (variables.equalsIgnoreCase("all")) {
      setVar(null);
    }
  }

  private void parseSpatialExtentForm() { // from the form
    if (spatial == null) {
      errs.format("form must have spatial=(all|bb|point|stns)%n");
      fatal = true;
      return;
    }

    if (spatial.equalsIgnoreCase("all")) spatialSelection = SpatialSelection.all;
    else if (spatial.equalsIgnoreCase("bb")) spatialSelection = SpatialSelection.bb;
    else if (spatial.equalsIgnoreCase("point")) spatialSelection = SpatialSelection.point;
    else if (spatial.equalsIgnoreCase("stns")) spatialSelection = SpatialSelection.stns;

    if (spatialSelection == SpatialSelection.bb) {
      parseSpatialExtent();

    } else if (spatialSelection == SpatialSelection.point) {
      double lat = parseLat("latitude", latitude);
      double lon = parseLon("longitude", longitude);
      latlonPoint = new LatLonPointImpl(lat, lon);
    }

  }

  private void parseSpatialExtent() {
    if (bbox != null) {
      String[] s = bbox.split(",");
      if (s.length != 4) {
        errs.format("bbox must have form 'bbox=west,east,south,north'; found 'bbox=%s'%n", bbox);
        fatal = true;
        return;
      }
      west = s[0];
      east = s[1];
      south = s[2];
      north = s[3];
    }

    if ((west != null) || (east != null) || (south != null) || (north != null)) {
      if ((west == null) || (east == null) || (south == null) || (north == null)) {
        errs.format("All edges (west,east,south,north) must be specified; found west=%s east=%s south=%s north=%s %n", west, east, south, north);
        fatal = true;
        return;
      }
      double westd = parseLon("west", west);
      double eastd = parseLon("east", east);
      double southd = parseLat("south", south);
      double northd = parseLat("north", north);

      if (!fatal) {
        llbb = new LatLonRect(new LatLonPointImpl(southd, westd), new LatLonPointImpl(northd, eastd));
        spatialSelection = SpatialSelection.bb;
      }
    }
  }

  private double parseLat(String key, String value) {
    double lat = parseDouble(key, value);
    if (!Double.isNaN(lat)) {
      if ((lat > 90.0) || (lat < -90.0)) {
        errs.format("Illegal param= param='%s=%s' must be between +/- 90.0 %n", key, value);
        lat = Double.NaN;
        fatal = true;
      }
    }
    return lat;
  }

  private double parseLon(String key, String value) {
    return parseDouble(key, value);
  }

  private double parseDouble(String key, String value) {
    value = value.trim();
    try {
      return Double.parseDouble(value);
    } catch (NumberFormatException e) {
      errs.format("Illegal param='%s=%s' must be valid floating point number%n", key, value);
      fatal = true;
    }
    return Double.NaN;
  }

  ////////////////////////////////////////

  private void parseTemporalExtentForm() { // from the form
    if (temporal == null) {
      errs.format("form must have temporal=(all|range|point)%n");
      fatal = true;
      return;
    }

    if (temporal.equalsIgnoreCase("all")) temporalSelection = TemporalSelection.all;
    else if (temporal.equalsIgnoreCase("range")) temporalSelection = TemporalSelection.range;
    else if (temporal.equalsIgnoreCase("point")) temporalSelection = TemporalSelection.point;

    if (temporal.equalsIgnoreCase("range")) {
      try {
        parseTimeExtent();
      } catch (Throwable t) {
        errs.format("badly specified time range");
        fatal = true;
      }
    } else if (temporal.equalsIgnoreCase("point")) {
      timePoint = parseDate("time", time);
    }
  }

  private void parseTimeExtent() {
    DateType startDate = parseDate("time_start", time_start);
    DateType endDate = parseDate("time_end", time_end);
    TimeDuration duration = parseW3CDuration("time_duration", time_duration);

    // no range
    if ((startDate != null) && (endDate != null))
      dateRange = new DateRange(startDate, endDate, null, null);
    else if ((startDate != null) && (duration != null))
      dateRange = new DateRange(startDate, null, duration, null);
    else if ((endDate != null) && (duration != null))
      dateRange = new DateRange(null, endDate, duration, null);

    if (dateRange != null)
      temporalSelection = TemporalSelection.range;
  }


  public DateType parseDate(String key, String value) {
    if (value != null) {
      try {
        return new DateType(value, null, null);
      } catch (java.text.ParseException e) {
        errs.format("Illegal param='%s=%s'  must be valid ISO Date%n", key, value);
        fatal = true;
      }
    }
    return null;
  }

  public TimeDuration parseW3CDuration(String key, String value) {
    if (value != null) {
      try {
        return new TimeDuration(value);
      } catch (java.text.ParseException e) {
        errs.format("Illegal param='%s=%s'  must be valid ISO Duration%n", key, value);
        fatal = true;
      }
    }
    return null;
  }

  /////////////////////////////////////

  public void setAccept(String accept) {
    this.accept = accept;
=======
  public String getReq() {
    return req;
>>>>>>> 449355970c1921a21fbf130e00cd21594c4d51b2
  }

  public void setReq(String req) {
Solution content
  // parsed
  private RequestType reqType = null;

  public String getReq() {
    return req;
  }

  public void setReq(String req) {
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method signature
Return statement