curtime to current_time translation

@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
514438
public static void sqlcurtime(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    zeroArgumentFunctionCall(buf, "current_time", "curtime", parsedArgs);
  }
966551
public static String time2DateString(java.sql.Timestamp time, Locale locale) {
        DateFormat df = DateFormat.getDateInstance(dateStyle, locale);
        return df.format(time);
    }
1181188
private void evalDateTimeInterval(List<MessageArg> args) {
    int size = args.size();
    if (size != 2) {
      return;
    }
    for (int i = 0; i < size; i++) {
      if (!args.get(i).resolve()) {
        return;
      }
    }

    ZonedDateTime start = parseDateTime(args.get(0));
    ZonedDateTime end = parseDateTime(args.get(1));
    
    // Parse optional skeleton argument
    DateTimeIntervalSkeleton skeleton = null;
    tag.skip(COMMA_WS);
    if (tag.seek(SKELETON, choice)) {
      String skel = choice.toString();
      tag.jump(choice);
      skeleton = DateTimeIntervalSkeleton.fromString(skel);
    }
    
    CalendarFormatter formatter = CLDR_INSTANCE.getCalendarFormatter(locale);
    formatter.format(start, end, skeleton, buf);
  }
76509
private void convertValue() throws JspException {

        if ((type == null) || (type.equalsIgnoreCase(TIMESTAMP_TYPE))) {
            if (!(value instanceof java.sql.Timestamp)) {
                value = new java.sql.Timestamp(value.getTime());
            }
        } else if (type.equalsIgnoreCase(TIME_TYPE)) {
            if (!(value instanceof java.sql.Time)) {
                value = new java.sql.Time(value.getTime());
            }
        } else if (type.equalsIgnoreCase(DATE_TYPE)) {
            if (!(value instanceof java.sql.Date)) {
                value = new java.sql.Date(value.getTime());
            }
        } else {
            throw new JspException(
                    Resources.getMessage("SQL_DATE_PARAM_INVALID_TYPE", type));
        }
    }
199033
public void run(CallURL args) {

        logger = LoggerUtil.getStandardLogger();
        logger.info("Calling ProcessSlaScheduledJob");
        TransactionWrapper transaction = null;
        EngineDataAccessDB edao = new EngineDataAccessDB();
        SimpleDateFormat sdfStatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        try {
            transaction = edao.startTransaction();
            //long dbtime = getDatabaseTime();
            long dbtime =DatabaseAccess.getCurrentTime();
            Calendar systcalendar = Calendar.getInstance();
            systcalendar.setTimeInMillis(dbtime);

            for (Process processVO : ProcessCache.getAllProcesses()) {
                int sla = 0;
                processVO = ProcessCache.getProcess(processVO.getId());
                if ((processVO.getAttribute("SLA") != null && processVO.getAttribute("SLA") != "")) {

                    sla = Integer.parseInt(processVO.getAttribute("SLA"));
                    boolean dealyHandlerDefined = false;
                    if (sla > 0) {
                        List <Process> subProcess = processVO.getSubprocesses();
                        for (Process sProcess : subProcess){
                            if(sProcess.getName().contains("Delay Handler")){
                                dealyHandlerDefined = true;
                                if (dealyHandlerDefined) break;
                            }
                        }
                      if (dealyHandlerDefined){
                        ArrayList<ProcessInstance> listProcessVo = getProcessInstances(processVO.getId());

                        for (ProcessInstance tempProcessVO : listProcessVo) {

                            String processStartDate = tempProcessVO.getStartDate();
                            Date date = sdfStatDate.parse(processStartDate);
                            Calendar processCalendar = Calendar.getInstance();
                            processCalendar.setTimeInMillis(date.getTime());

                            if (ServiceLevelAgreement.INTERVAL_MINUTES.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.MINUTE, sla);
                            }
                            else if (ServiceLevelAgreement.INTERVAL_HOURS.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.HOUR, sla);
                            }
                            else if (ServiceLevelAgreement.INTERVAL_DAYS.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.DATE, sla);
                            }
                            boolean eligibleToProcess = processCalendar.compareTo(systcalendar) < 0;

                            if (eligibleToProcess) {
                                List<ActivityInstance> activityList = tempProcessVO
                                        .getActivities();
                                for (ActivityInstance tempActivityInstanceVO : activityList) {
                                    if (tempActivityInstanceVO.getStatusCode() == WorkStatus.STATUS_WAITING
                                            .intValue()
                                            || tempActivityInstanceVO.getStatusCode() == WorkStatus.STATUS_IN_PROGRESS
                                                    .intValue()) {
                                        InternalEvent event = InternalEvent
                                                .createActivityDelayMessage(tempActivityInstanceVO,
                                                        tempProcessVO.getMasterRequestId());
                                        logger.info("SLA clean event=" + event);
                                        ProcessEngineDriver driver = new ProcessEngineDriver();
                                        driver.processEvents(null, event.toXml());
                                    }

                                }
                            }
                        }
                      }
                    }
                }

            }

        }
        catch (Exception exp) {
            logger.severeException(exp.getMessage(), exp);
        }
        finally {
            try {
                edao.stopTransaction(transaction);
            }
            catch (Exception exp) {
                logger.severeException(exp.getMessage(), exp);
            }
        }
    }
720568
public static void sqlweek(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "extract(week from ", "week", parsedArgs);
  }
928827
public static void sqluser(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    zeroArgumentFunctionCall(buf, "user", "user", parsedArgs);
  }
834132
public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs);
  }
188832
@Override
    public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
211877
public static void logSqlTime(String sql, long elapsedTime) {
        if (SniffyConfiguration.INSTANCE.getTopSqlCapacity() <= 0) return;
        String normalizedSql = SqlUtil.normalizeInStatement(sql);
        Timer timer = globalSqlStats.get(normalizedSql);
        if (null == timer) {
            Timer newTimer = new Timer();
            newTimer.update(elapsedTime, TimeUnit.MILLISECONDS);
            timer = globalSqlStats.putIfAbsent(normalizedSql, newTimer);
        }
        if (null != timer) {
            timer.update(elapsedTime, TimeUnit.MILLISECONDS);
        }
    }
539787
public static void sqlceiling(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "ceil(", "ceiling", parsedArgs);
  }
1149896
public static void sqlquarter(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "extract(quarter from ", "quarter", parsedArgs);
  }
52610
public void format(MessageArgs args, StringBuilder buf) {
    this.args = args;
    this.buf = buf;
    this.reset();
    format(streams[0], null);
  }
1148760
public static void sqldatabase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    zeroArgumentFunctionCall(buf, "current_database()", "database", parsedArgs);
  }
820131
public StringBuffer format(Calendar calendar, StringBuffer buf) {
        if (mTimeZoneForced) {
            calendar.getTime(); /// LANG-538
            calendar = (Calendar) calendar.clone();
            calendar.setTimeZone(mTimeZone);
        }
        return applyRules(calendar, buf);
    }
392533
public static java.sql.Time getTime(Object value) {
        try {
            return toTime(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
849907
static SQLTransform getUtilTransform(TypeName type) {
		String typeName = type.toString();

		// Integer.class.getCanonicalName().equals(typeName)
		if (Date.class.getCanonicalName().equals(typeName)) {
			return new DateSQLTransform();
		}
		if (Locale.class.getCanonicalName().equals(typeName)) {
			return new LocaleSQLTransform();
		}
		if (Currency.class.getCanonicalName().equals(typeName)) {
			return new CurrencySQLTransform();
		}
		if (Calendar.class.getCanonicalName().equals(typeName)) {
			return new CalendarSQLTransform();
		}
		if (TimeZone.class.getCanonicalName().equals(typeName)) {
			return new TimeZoneSQLTransform();
		}
		return null;
	}