Returns the build date or {@code null} if not run from JAR.
761080
@Nullable
  private static String getBuildDate() {
    try {
      URL res = JLanguageTool.class.getResource(JLanguageTool.class.getSimpleName() + ".class");
      if (res == null) {
        // this will happen on Android, see http://stackoverflow.com/questions/15371274/
        return null;
      }
      Object connObj = res.openConnection();
      if (connObj instanceof JarURLConnection) {
        JarURLConnection conn = (JarURLConnection) connObj;
        Manifest manifest = conn.getManifest();
        return manifest.getMainAttributes().getValue("Implementation-Date");
      } else {
        return null;
      }
    } catch (IOException e) {
      throw new RuntimeException("Could not get build date from JAR", e);
    }
  }
827032
public static java.sql.Date getDate(Object value) {
        try {
            return toDate(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
1257920
public Date getLastModificationDate() {
		if (this.year == 0 || this.month == 0 || this.day == 0){
			return null;
		}
		try {
			Calendar calendar = Calendar.getInstance();
			calendar.set(this.year, this.month, this.day, 0, 0, 0);
			calendar.set(Calendar.MILLISECOND, 0);
			return calendar.getTime();
		}
		catch (Exception e) {
			return null;
		}
	}
1361945
private String getVersion(boolean verbose) {
        try {
            InputStream stream = getClass().getResourceAsStream("/version.properties");
            Properties props = new Properties();
            props.load(stream);
            if (verbose) {
                return String.format("Version=%s, build date=%s",
                        props.getProperty("version"),
                        props.getProperty("buildDate"));
            } else {
                return props.getProperty("version");
            }
        } catch (IOException e) {
            log.error("Unable to retrieve version", e);
            return "unknown";
        }
    }
610781
public @Nullable String build() {
    StringBuilder queryString = new StringBuilder();

    for (NameValuePair param : params) {
      if (queryString.length() > 0) {
        queryString.append(PARAM_SEPARATOR);
      }
      queryString.append(Escape.urlEncode(param.getName()));
      queryString.append(VALUE_SEPARATOR);
      queryString.append(Escape.urlEncode(param.getValue()));
    }

    if (queryString.length() > 0) {
      return queryString.toString();
    }
    else {
      return null;
    }
  }
194386
public Optional<Build> getBuildByNumber(final int buildNumber) {
        return builds.stream().filter(isBuildNumberEqualTo(buildNumber)).findFirst();
    }
583631
public UpdateSite.Plugin getUpdateInfo() {
        UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
        UpdateSite.Plugin p = uc.getPlugin(getShortName(), getVersionNumber());
        if(p!=null && p.isNewerThan(getVersion())) return p;
        return null;
    }
758262
@Override
    public Date getNextRunTime(LastExecution lastExecutionInfo, Date taskScheduledTime) {
        Date lastExecution = lastExecutionInfo == null ? null : lastExecutionInfo.getScheduledStart();
        return getNextTimeout(lastExecution, taskScheduledTime);
    }
1119824
public function getNextBuildTime()
    {
        $nextBuildTime = null;
        $build = null;
        while ($this->builds->valid()) {
            $build = $this->builds->current();
            if ($build->getNextBuildTime() <= $nextBuildTime
               || $nextBuildTime === null) {
                if ($build->getStatus() != BuildInterface::STOPPED) {
                    $buildTime = $build->getNextBuildTime();

                    if ($buildTime !== null && !$build->isQueued()) {
                        $nextBuildTime = $buildTime;
                        /*
                         * Need to write to queue here and have a FIFO
                         * check before if not already in queue
                         */
                        //if (!in_array($build, $this->_queue)) {
                            $this->queue[] = $build;
                        $build->enqueue();
                        //}
                    } else {
                        /*
                         * we need to check if a scheduled build has a lower build time
                         * but we dont want to queue it again
                         */
                        $nextBuildTime = $buildTime;
                    }
                }
            }
            $this->builds->next();
        }
        usort($this->queue, array($this, 'sortQueue'));
        $this->builds->rewind();

        return $nextBuildTime;
    }
747164
private DateValue generateInstance() {
		try {
			do {
				if (!instanceGenerator.generate(builder)) {
					return null;
				}
				DateValue dUtc = dtStart instanceof TimeValue ? TimeUtils.toUtc(builder.toDateTime(), tzid) : builder.toDate();
				if (dUtc.compareTo(lastUtc_) > 0) {
					return dUtc;
				}
			} while (true);
		} catch (Generator.IteratorShortCircuitingException ex) {
			return null;
		}
	}
118027
private static Calendar buildCalendar(final Date date) {

    Calendar calendar = buildCalendar();
    calendar.setTime(date);
    return calendar;
  }
454181
@SuppressWarnings(UNUSED)
    @CheckForNull
    @Exported
    public Run getLastBuild() {
        Run retVal = null;
        for (Job job : getAllJobs()) {
            retVal = takeLast(retVal, job.getLastBuild());
        }
        return retVal;
    }
173015
public final Date compiledOnDate() {
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    try {
      return dateFormat.parse(compiledOn());
    } catch (ParseException e) {
      return null;
    }
  }
330445
public static String[] getBuildInfoFromJar(InMemoryJarfile jarfile)
            throws IOException
    {
        // Read the raw build info bytes.
        byte[] buildInfoBytes = jarfile.get(CATALOG_BUILDINFO_FILENAME);
        if (buildInfoBytes == null) {
            throw new IOException("Catalog build information not found - please build your application using the current version of VoltDB.");
        }

        // Convert the bytes to a string and split by lines.
        String buildInfo;
        buildInfo = new String(buildInfoBytes, Constants.UTF8ENCODING);
        String[] buildInfoLines = buildInfo.split("\n");

        // Sanity check the number of lines and the version string.
        if (buildInfoLines.length < 1) {
            throw new IOException("Catalog build info has no version string.");
        }
        String versionFromCatalog = buildInfoLines[0].trim();
        if (!CatalogUtil.isCatalogVersionValid(versionFromCatalog)) {
            throw new IOException(String.format(
                    "Catalog build info version (%s) is bad.", versionFromCatalog));
        }

        // Trim leading/trailing whitespace.
        for (int i = 0; i < buildInfoLines.length; ++i) {
            buildInfoLines[i] = buildInfoLines[i].trim();
        }

        return buildInfoLines;
    }
404390
protected Date getPickerDate() {
        try {
            JsDate pickerDate = getPicker().get("select").obj;
            return new Date((long) pickerDate.getTime());
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
266528
protected final Date getExpirationDate() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            return (currentSession != null) ? currentSession.getExpirationDate() : null;
        }
        return null;
    }
627927
def _parse_last_build_date(self):
        
        date = self._channel.find('lastBuildDate').text
        date = parser.parse(date, ignoretz=True)
        return date