AppVersion v = versions.get(val); if (v != null) return v.getSequenceNumber();
if (val.equals("last") || val.equals("lastVersion")) return numVersions -1;  AppVersion v = versions.get(val); if (v != null) return v.getSequenceNumber(); try { long time = 0; if (val.endsWith("daysAgo")) time = System.currentTimeMillis() - 24*60*60*1000 * Integer.parseInt(val.substring(0, val.length() - 7)); else time = Date.parse(val); return getAppropriateSeq(timeStamps, time, roundToLaterVersion); } catch (Exception e) {
		static long getVersionNum(Map<String, AppVersion> versions, 				SortedMap<Long, AppVersion> timeStamps , String val, boolean roundToLaterVersion) {			if (val == null) return -1;				AppVersion v = versions.get(val);				if (v != null) return v.getSequenceNumber();				try {				long time = Date.parse(val);				return getAppropriateSeq(timeStamps, time, roundToLaterVersion);			} catch (IllegalArgumentException e) {				try {					return Long.parseLong(val);				}				catch (NumberFormatException e1) {					throw new IllegalArgumentException("Could not interpret version specification of '" + val + "'");				}			}		}