auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options.Builder optionBuilder = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true); if(!selectedFormat.equalsIgnoreCase("default")) optionBuilder.setPlayerInfo(new CustomPlayerInfo(selectedFormat)); if(hevcMode.equalsIgnoreCase("HEVCPreferred")) optionBuilder.enableHevc(true); else if(hevcMode.equalsIgnoreCase("HEVCNotPreferred")) optionBuilder.enableHevc(false); Options options = optionBuilder.build(); player = new OoyalaPlayer(pcode, playerDomain, options); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) player.play(); } else { Log.e(TAG, "Asset Failure"); } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); player = new OoyalaPlayer(pcode, playerDomain, getOptions()); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } else { OoyalaPlayer.setEnvironment(Environment.EnvironmentType.PRODUCTION, Environment.PROTOCOL_HTTPS); } JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) { player.play(); } } else { Log.e(TAG, "Asset Failure"); } } }
Source:
public void handleEvent(final Event event) { final FlowRunner flowRunner = (FlowRunner) event.getRunner(); final ExecutableFlow flow = flowRunner.getExecutableFlow(); if (event.getType() != null && flow != null) { LOGGER.info( "Handling event for Flow execution " + flow.getExecutionId() + " and the event type is " + event.getType()); } if (event.getType() == EventType.FLOW_FINISHED || event.getType() == EventType.FLOW_STARTED) { if (event.getType() == EventType.FLOW_FINISHED) { this.recentlyFinishedFlows.put(flow.getExecutionId(), flow); LOGGER.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); this.runningFlows.remove(flow.getExecutionId()); this.deleteExecutionDir(flow.getExecutionId()); } else if (event.getType() == EventType.FLOW_STARTED) { this.triggerManager .addTrigger(flow.getExecutionId(), SlaOption.getFlowLevelSLAOptions(flow .getExecutionOptions().getSlaOptions())); } } }

Target:
public void handleEvent(final Event event) { final FlowRunner flowRunner = (FlowRunner) event.getRunner(); final ExecutableFlow flow = flowRunner.getExecutableFlow(); if (event.getType() != null && flow != null) { LOGGER.info( "Handling event for Flow execution " + flow.getExecutionId() + " and the event type is " + event.getType()); } else { LOGGER.info("Invalid event type or flow."); } if (event.getType() == EventType.FLOW_FINISHED || event.getType() == EventType.FLOW_STARTED) { if (event.getType() == EventType.FLOW_FINISHED) { this.recentlyFinishedFlows.put(flow.getExecutionId(), flow); LOGGER.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); this.runningFlows.remove(flow.getExecutionId()); this.deleteExecutionDir(flow.getExecutionId()); } else if (event.getType() == EventType.FLOW_STARTED) { this.triggerManager .addTrigger(flow.getExecutionId(), SlaOption.getFlowLevelSLAOptions(flow .getExecutionOptions().getSlaOptions())); } } }
Source:
protected void loadConfig() { InputStream input = null; try { input = new FileInputStream(new File(getInstallLocation() + "/conf/storm.yaml")); setConfig((Map<String, Object>)new Yaml().load(input)); LOG.info("Setting port for log viewer to " + config.get(LOG_VIEWER_PORT)); setPort(Optional.of((Integer)getConfig().get(LOG_VIEWER_PORT))); } catch (Exception e) { LOG.error("Failed to configure the log viewer controller,", e); setPort(Optional.fromNullable(((Integer)null))); } finally { IOUtils.closeQuietly(input); } }

Target:
protected void loadConfig() { InputStream input = null; try { input = new FileInputStream(Paths.get(getInstallLocation(), "/conf/storm.yaml").toFile()); setConfig((Map<String, Object>) new Yaml().load(input)); LOG.info("Setting port for log viewer to " + config.get(LOG_VIEWER_PORT)); setPort(Optional.of((Integer) getConfig().get(LOG_VIEWER_PORT))); } catch (Exception e) { LOG.error("Failed to configure the log viewer controller,", e); setPort(Optional.fromNullable(((Integer) null))); } finally { IOUtils.closeQuietly(input); } }
Source:
static public void sendXbmcNotification(@ParamDoc(name="host") String host,@ParamDoc(name="port") int port,@ParamDoc(name="title") String title,@ParamDoc(name="message") String message,@ParamDoc(name="image") String image,@ParamDoc(name="displayTime") long displayTime) { String url = "http://" + host + ":" + port + "/jsonrpc?request="; StringBuilder content = new StringBuilder(); content.append("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"" + title + "\",\"message\":\"" + message + "\""); if (StringUtils.isNotEmpty(image)) content.append(",\"image\":\"" + image + "\""); if (displayTime >= 1500 && displayTime <= 2147483647) content.append(",\"displaytime\":" + displayTime); content.append("}}"); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content.toString()), CONTENT_TYPE_JSON, 1000); }

Target:
static public void sendXbmcNotification(@ParamDoc(name="host") String host,@ParamDoc(name="port") int port,@ParamDoc(name="title") String title,@ParamDoc(name="message") String message,@ParamDoc(name="image") String image,@ParamDoc(name="displayTime") long displayTime) { String url = "http://" + host + ":" + port + "/jsonrpc"; StringBuilder content = new StringBuilder(); content.append("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"" + title + "\",\"message\":\"" + message + "\""); if (StringUtils.isNotEmpty(image)) content.append(",\"image\":\"" + image + "\""); if (displayTime >= 1500 && displayTime <= 2147483647) content.append(",\"displaytime\":" + displayTime); content.append("}}"); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content.toString()), CONTENT_TYPE_JSON, 1000); }
Source:
public MessageSourcePollingTemplate(MessageSource<?> source) { this.source = source; }

Target:
public MessageSourcePollingTemplate(MessageSource<?> source) { Assert.notNull(source, "'source' cannot be null"); this.source = source; }
Source:
public static Options getCommonOptions() { Options o = new Options(); o.addOption("h", "help", false, "print usage information"); o.addOption("V", "version", false, "print version information"); o.addOption("v", "verbose", false, "increased logging"); o.addOption("vv", "very-verbose", false, "high logging"); o.addOption("vvv", "very-very-verbose", false, "maximum logging"); o.addOption("p", "prefix", true, "add a prefix 'foo: http://bar'"); o.addOption("P", "prefixes", true, "use prefixes from JSON-LD file"); o.addOption("noprefixes", false, "do not use default prefixes"); o.addOption("e", "entities", false, "use entity substitution when saving XML ontology"); return o; }

Target:
public static Options getCommonOptions() { Options o = new Options(); o.addOption("h", "help", false, "print usage information"); o.addOption("V", "version", false, "print version information"); o.addOption("v", "verbose", false, "increased logging"); o.addOption("vv", "very-verbose", false, "high logging"); o.addOption("vvv", "very-very-verbose", false, "maximum logging"); o.addOption("p", "prefix", true, "add a prefix 'foo: http://bar'"); o.addOption("P", "prefixes", true, "use prefixes from JSON-LD file"); o.addOption("noprefixes", false, "do not use default prefixes"); o.addOption("x", "xml-entities", false, "use entity substitution with ontology XML output"); return o; }
Source:
public Optional<String> namespace() { return Optional.of("InMemory namespace"); }

Target:
public Optional<String> namespace() { return Optional.of("test"); }
Source:
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) { super.statementExecuteUpdateBefore(statement,sql); try { Before(statement,sql); }catch (Exception e){ } }

Target:
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) { super.statementExecuteUpdateBefore(statement,sql); Before(statement,sql); }
Source:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { Preconditions.checkArgument(offset > -1); ObjectSpecification objectSpec = download(objectId); if (!forExternalUse && (offset == 0 && length < 0)) { return objectSpec; } if (length < 0) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } String objectKey = ObjectStoreUtil.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(offset, length); } else { parts = partCalculator.divide(offset, length); } fillUrl(objectKey, parts, forExternalUse); ObjectSpecification spec = new ObjectSpecification(objectKey, objectId, objectId, parts, length); return spec; }

Target:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { checkArgument(offset > -1L); ObjectSpecification objectSpec = download(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } String objectKey = ObjectStoreUtil.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillUrl(objectKey, parts, forExternalUse); ObjectSpecification spec = new ObjectSpecification(objectKey, objectId, objectId, parts, length); return spec; }
Source:
public String getIgnoredMessage(Description description) { Ignore ignore = description.getAnnotation(Ignore.class); return ignore == null ? "Test ignored (without reason)!" : ignore.value(); }

Target:
public String getIgnoredMessage(Description description) { Ignore ignore = description.getAnnotation(Ignore.class); return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value(); }
Source:
private void _add(String key, Collection<String> values) { if (values != null) { checkKey(key); List<String> checked = checkValues(values); if (!checked.isEmpty()) { List<String> currentSet = headerMap.get(key); if (currentSet == null) { headerMap.put(key, checked); } else { currentSet.addAll(checked); } serialized = null; } } }

Target:
private void _add(String key, Collection<String> values) { if (values != null) { Checker checked = new Checker(key, values); if (checked.hasValues()) { List<String> currentSet = headerMap.get(key); if (currentSet == null) { headerMap.put(key, checked.list); } else { currentSet.addAll(checked.list); } serialized = null; projectedLength += key.length() + checked.length; } } }
Source:
public static void lowBatteryLevelRequest(Context context){ int batteryLevel = Util.getBatteryLevel(context); SyncUrl model = new SyncUrl(); for(SyncUrl syncUrl : model.loadByStatus(ServicesConstants.ACTIVE_SYNC_URL)) { if (syncUrl.getUrl() != null && !syncUrl.getUrl().equals("")) { MainHttpClient client = new MainHttpClient(syncUrl.getUrl(), context); try { client.setMethod("GET"); client.addParam("Task", "alert"); client.addParam("message", context.getResources().getString(R.string.battery_level_message, batteryLevel)); client.execute(); } catch (Exception e) { Util.logActivities(context, e.getMessage()); } finally { if (HttpStatus.SC_OK == client.getResponseCode()) { Util.logActivities(context, context.getResources().getString(R.string.successful_alert_to_server)); } } } } if (!Prefs.alertPhoneNumber.matches("")) { new ProcessSms(context).sendSms(Prefs.alertPhoneNumber,context.getResources().getString(R.string.battery_level_message, batteryLevel)); } }

Target:
public static void lowBatteryLevelRequest(Context context){ int batteryLevel = Util.getBatteryLevel(context); SyncUrl model = new SyncUrl(); for(SyncUrl syncUrl : model.loadByStatus(ServicesConstants.ACTIVE_SYNC_URL)) { if (syncUrl.getUrl() != null && !syncUrl.getUrl().equals("")) { MainHttpClient client = new MainHttpClient(syncUrl.getUrl(), context); try { client.setMethod(METHOD_POST); client.addParam(TASK_PARAM, "alert"); client.addParam(MESSAGE_PARAM, context.getResources().getString(R.string.battery_level_message, batteryLevel)); client.execute(); } catch (Exception e) { Util.logActivities(context, e.getMessage()); } finally { if (HttpStatus.SC_OK == client.getResponseCode()) { Util.logActivities(context, context.getResources().getString(R.string.successful_alert_to_server)); } } } } if (!Prefs.alertPhoneNumber.matches("")) { new ProcessSms(context).sendSms(Prefs.alertPhoneNumber,context.getResources().getString(R.string.battery_level_message, batteryLevel)); } }
Source:
public boolean equals(Object o) { if (!(o instanceof LabelVote)) { return false; } LabelVote l = (LabelVote) o; return Objects.equal(name, l.name) && value == l.value; }

Target:
public boolean equals(Object o) { if (o instanceof LabelVote) { LabelVote l = (LabelVote) o; return Objects.equal(name, l.name) && value == l.value; } return false; }
Source:
private void assertVariableValuesMatch(final TestContext testContext, final String name1, final String name2) { String val1 = testContext.getVariable(name1); String val2 = testContext.getVariable(name2); if (val1.equals(val2)) { log.debug(String.format("Values match for variables %s and %s. Value: %s", name1, name2, val1)); } else { throw new RuntimeException(String.format("Values don't match for variables. %s: %s, %s: %s", name1, val1, name2, val2)); } }

Target:
private void assertVariableValuesMatch(final TestContext testContext, final String name1, final String name2) { String val1 = testContext.resolveDynamicValue(testContext.getVariable(name1)); String val2 = testContext.resolveDynamicValue(testContext.getVariable(name2)); if (val1.equals(val2)) { log.debug(String.format("Values match for variables %s and %s. Value: %s", name1, name2, val1)); } else { throw new RuntimeException(String.format("Values don't match for variables. %s: %s, %s: %s", name1, val1, name2, val2)); } }
Source:
public void compare() { Preconditions.checkArgument(maxElapsedTime > 0, "A positive maxElapsedTime is expected"); Preconditions.checkArgument(minElapsedTime > 0, "A positive minElapsedTime is expected"); Preconditions.checkArgument(remoteElapsedTime > 0, "A positive remoteElapsedTime is expected"); if (hasTooMuchTimeElapsedSincePreviousRequest()) { events.tooMuchTimeSincePreviousRequest(minElapsedTime); return; } if (requestsTookTooLongToComplete()) { events.requestsTookTooLong(minElapsedTime, maxElapsedTime); return; } if (hasSkew()) { long skew; if (remoteElapsedTime < minElapsedTime) { skew = minElapsedTime - remoteElapsedTime; } else { skew = remoteElapsedTime - maxElapsedTime; } events.clockSkew(server, skew); } events.requestPace(server, minElapsedTime, maxElapsedTime, remoteElapsedTime); }

Target:
public void compare() { Preconditions.checkArgument(maxElapsedTime > 0, "A positive maxElapsedTime is expected"); Preconditions.checkArgument(minElapsedTime > 0, "A positive minElapsedTime is expected"); Preconditions.checkArgument(remoteElapsedTime > 0, "A positive remoteElapsedTime is expected"); if (hasTooMuchTimeElapsedSincePreviousRequest()) { events.tooMuchTimeSincePreviousRequest(minElapsedTime); return; } if (requestsTookTooLongToComplete()) { events.requestsTookTooLong(minElapsedTime, maxElapsedTime); return; } long skew = getSkew(); if (skew != 0) { events.clockSkew(server, skew); } events.requestPace(server, minElapsedTime, maxElapsedTime, remoteElapsedTime); }
Source:
private <T> Task<Response<T>> createTaskWithTimeout(final String name, final Request<T> request, final RequestContext requestContext, RequestConfig config) { ConfigValue<Long> timeout = config.getTimeoutMs(); if (timeout.getValue() != null && timeout.getValue() > 0 && ParSeqGlobalConfiguration.isD2RequestTimeoutEnabled()) { reconcileRequestTimeout(requestContext, timeout.getValue()); } Task<Response<T>> requestTask; if (RequestGroup.isBatchable(request, config)) { requestTask = createBatchableTask(name, request, requestContext, config); } else { requestTask = Task.async(name, () -> sendRequest(request, requestContext)); } if (!ParSeqGlobalConfiguration.isD2RequestTimeoutEnabled()) { return withTimeout(requestTask, timeout); } else { return requestTask.transform((Try<Response<T>> tryGet) -> { if (tryGet.isFailed()) { if (tryGet.getError() instanceof TimeoutException && timeout.getValue() != null && timeout.getValue() > 0) { Optional<String> desc = timeout.getSource().map(src -> "src: " + src); String timeoutDetails = "withTimeout " + Math.min(timeout.getValue(), Integer.MAX_VALUE) + TimeUnitHelper.toString(TimeUnit.MILLISECONDS) + (desc != null ? " " + desc : ""); String timeoutExceptionMessage = "task: '" + requestTask.getName() + "' " + timeoutDetails; return Failure.of(Exceptions.timeoutException(timeoutExceptionMessage)); } else { return Failure.of(tryGet.getError()); } } else { return Success.of(tryGet.get()); } }); } }

Target:
private <T> Task<Response<T>> createTaskWithTimeout(final String name, final Request<T> request, final RequestContext requestContext, RequestConfig config) { ConfigValue<Long> timeout = config.getTimeoutMs(); int reconciledTimeout = 0; if (timeout.getValue() != null && timeout.getValue() > 0 && _d2RequestTimeoutEnabled) { reconciledTimeout = reconcileRequestTimeout(requestContext, timeout.getValue()); } Task<Response<T>> requestTask; if (RequestGroup.isBatchable(request, config)) { requestTask = createBatchableTask(name, request, requestContext, config); } else { requestTask = Task.async(name, () -> sendRequest(request, requestContext)); } if (timeout.getValue() == null || timeout.getValue() <= 0) { return requestTask; } else { if (!_d2RequestTimeoutEnabled) { return withTimeout(requestTask, timeout); } else { assert reconciledTimeout > 0; String srcDesc = (reconciledTimeout < timeout.getValue().intValue()) ? " src: request context" : timeout.getSource().map(src -> " src: " + src).orElse(""); String timeoutTaskName = "withTimeout " + reconciledTimeout + TimeUnitHelper.toString(TimeUnit.MILLISECONDS) + srcDesc; return withD2Timeout(requestTask, timeoutTaskName); } } }
Source:
public String decode(byte[] wbxmlBody) { try { int i = 4; if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05)) { return ""; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_WITH_ATTRS) == WBXML_TOKEN_WITH_ATTRS)) { return ""; } i++; if ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05) { i += 8; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x06 || (wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x07)) { return ""; } if (wbxmlBody[i + 1] != WBXML_INLINE_STRING) { return ""; } i += 2; int j = i; while (wbxmlBody[j] != 0) { j++; } String value = new String(wbxmlBody, i, j-i); return value; } catch (ArrayIndexOutOfBoundsException e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "ArrayIndexOutOfBoundsException while handling " + "CONTENT_MIME_TYPE_B_EMN"); } } catch (Exception e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "Exception while handling CONTENT_MIME_TYPE_B_EMN " + e); } } return ""; }

Target:
public String decode(byte[] wbxmlBody) { try { int i = 4; if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05)) { return null; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_WITH_ATTRS) == WBXML_TOKEN_WITH_ATTRS)) { return null; } i++; if ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05) { i += 8; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x06 || (wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x07)) { return null; } if (wbxmlBody[i + 1] != WBXML_INLINE_STRING) { return null; } i += 2; int j = i; while (wbxmlBody[j] != 0) { j++; } String value = new String(wbxmlBody, i, j-i); return value; } catch (ArrayIndexOutOfBoundsException e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "ArrayIndexOutOfBoundsException while handling " + "CONTENT_MIME_TYPE_B_EMN"); } } catch (Exception e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "Exception while handling CONTENT_MIME_TYPE_B_EMN " + e); } } return null; }
Source:
public void testLanguageRangeSupport() throws NoSuchMethodException, SecurityException { ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, new Locale( "es", "ES" ) ); HibernateMessageInterpolator messageInterpolator = (HibernateMessageInterpolator) validatorFactory.getMessageInterpolator(); StaticFieldLocaleResolver.acceptLanguage = "fr-FR,fr;q=0.9"; assertThat( messageInterpolator.interpolate( "{javax.validation.constraints.AssertFalse.message}", new TestContext() ) ) .isEqualTo( "doit avoir la valeur faux" ); }

Target:
public void testLanguageRangeSupport() throws NoSuchMethodException, SecurityException { ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, new Locale( "es", "ES" ) ); MessageInterpolator messageInterpolator = validatorFactory.getMessageInterpolator(); StaticFieldLocaleResolver.acceptLanguage = "fr-FR,fr;q=0.9"; assertThat( messageInterpolator.interpolate( "{javax.validation.constraints.AssertFalse.message}", new TestContext() ) ) .isEqualTo( "doit avoir la valeur faux" ); }
Source:
public BaseTestClass() { KerberosHelper.loginFromKeytab(MerlinConstants.CURRENT_USER_NAME); prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); serverHC = new ArrayList<HCatClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); serverOC.add(server.getClusterHelper().getOozieClient()); serverHC.add(server.getClusterHelper().getHCatClient()); HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size ()-1)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } } bundles = new Bundle[serverNames.length]; }

Target:
public BaseTestClass() { KerberosHelper.loginFromKeytab(MerlinConstants.CURRENT_USER_NAME); prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); serverOC.add(server.getClusterHelper().getOozieClient()); HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size ()-1)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } } bundles = new Bundle[serverNames.length]; }
Source:
public void visitVariable(VariableTree tree) { scan(tree.modifiers()); completeMetadata(((VariableTreeImpl) tree).getSymbol(), tree.modifiers().annotations()); if (tree.initializer() != null) { resolveAs(tree.initializer(), JavaSymbol.VAR); if(((JavaType) tree.initializer().symbolType()).isTagged(JavaType.DEFERRED)) { setInferedType(tree.type().symbolType(), (DeferredType) tree.initializer().symbolType()); } } }

Target:
public void visitVariable(VariableTree tree) { scan(tree.modifiers()); completeMetadata(((VariableTreeImpl) tree).getSymbol(), tree.modifiers().annotations()); ExpressionTree initializer = tree.initializer(); if (initializer != null) { resolveAs(initializer, JavaSymbol.VAR); if(((JavaType) initializer.symbolType()).isTagged(JavaType.DEFERRED)) { setInferedType(tree.type().symbolType(), (DeferredType) initializer.symbolType()); } } }
Source:
public boolean respondsTo(RunEvent event) { Run r = event.getEventObject(); if (event.getEventType().equals(MisoEventType.RUN_FAILED) && r.getHealth().equals(HealthType.Failed)) { log.info("Run " + r.getAlias() + ": " + event.getEventMessage()); return true; } return false; }

Target:
public boolean respondsTo(RunEvent event) { Run r = event.getEventObject(); if (event.getEventType() == MisoEventType.RUN_FAILED && r.getHealth() == HealthType.Failed) { log.info("Run " + r.getAlias() + ": " + event.getEventMessage()); return true; } return false; }
Source:
public static void main(String[] args) { CorfuRuntime runtime; Map<String, Object> opts = new Docopt(USAGE) .withVersion(GitRepositoryState.getRepositoryState().describe) .parse(args); String host = opts.get("--host").toString(); Integer port = Integer.parseInt(opts.get("--port").toString()); boolean tlsEnabled = Boolean.parseBoolean(opts.get("--tlsEnabled").toString()); if (tlsEnabled) { String keystore = opts.get("--keystore").toString(); String ks_password = opts.get("--ks_password").toString(); String truststore = opts.get("--truststore").toString(); String truststore_password = opts.get("--truststore_password").toString(); runtime = CorfuRuntime.fromParameters( CorfuRuntime.CorfuRuntimeParameters.builder().useFastLoader(false) .cacheDisabled(true) .tlsEnabled(tlsEnabled) .keyStore(keystore) .ksPasswordFile(ks_password) .trustStore(truststore) .tsPasswordFile(truststore_password).build()); } else { runtime = CorfuRuntime.fromParameters( CorfuRuntime.CorfuRuntimeParameters.builder() .useFastLoader(false) .cacheDisabled(true) .tlsEnabled(tlsEnabled).build()); } String singleNodeEndpoint = String.format("%s:%d", host, port); runtime.parseConfigurationString(singleNodeEndpoint); runtime.connect(); log.info("Successfully connected to {}", singleNodeEndpoint); CorfuStoreBrowser browser = new CorfuStoreBrowser(runtime); CorfuTable<CorfuDynamicKey, CorfuDynamicRecord> table = browser.getTable(opts.get("--namespace").toString(), opts.get("--tablename").toString()); browser.printTable(table); }

Target:
public static void main(String[] args) { try { CorfuRuntime runtime; Map<String, Object> opts = new Docopt(USAGE) .withVersion(GitRepositoryState.getRepositoryState().describe) .parse(args); String host = opts.get("--host").toString(); Integer port = Integer.parseInt(opts.get("--port").toString()); boolean tlsEnabled = Boolean.parseBoolean(opts.get("--tlsEnabled") .toString()); CorfuRuntime.CorfuRuntimeParameters.CorfuRuntimeParametersBuilder builder = CorfuRuntime.CorfuRuntimeParameters.builder() .useFastLoader(false) .cacheDisabled(true) .tlsEnabled(tlsEnabled); if (tlsEnabled) { String keystore = opts.get("--keystore").toString(); String ks_password = opts.get("--ks_password").toString(); String truststore = opts.get("--truststore").toString(); String truststore_password = opts.get("--truststore_password").toString(); builder.tlsEnabled(tlsEnabled) .keyStore(keystore) .ksPasswordFile(ks_password) .trustStore(truststore) .tsPasswordFile(truststore_password); } runtime = CorfuRuntime.fromParameters(builder.build()); String singleNodeEndpoint = String.format("%s:%d", host, port); runtime.parseConfigurationString(singleNodeEndpoint); runtime.connect(); log.info("Successfully connected to {}", singleNodeEndpoint); CorfuStoreBrowser browser = new CorfuStoreBrowser(runtime); CorfuTable<CorfuDynamicKey, CorfuDynamicRecord> table = browser.getTable( opts.get("--namespace").toString(), opts.get("--tablename").toString() ); browser.printTable(table); } catch (Throwable t) { log.error("Error in Browser Execution.", t); throw t; } }
Source:
public NavigationView.OnNavigationItemSelectedListener getNewListener() { return new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem menuItem) { Intent intent = new Intent(); switch (menuItem.getItemId()) { case R.id.nav_item_today: page.displayMainPage(); break; case R.id.nav_item_history: page.pushFragment(new HistoryFragment()); break; case R.id.nav_item_saved_pages: page.pushFragment(new SavedPagesFragment()); break; case R.id.nav_item_nearby: page.pushFragment(new NearbyFragment()); break; case R.id.nav_item_more: intent.setClass(app, ApiUtil.hasHoneyComb() ? SettingsActivity.class : SettingsActivityGB.class); page.startActivityForResult(intent, SettingsActivity.ACTIVITY_REQUEST_SHOW_SETTINGS); break; case R.id.nav_item_login: intent.setClass(app, LoginActivity.class); intent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_NAV); page.startActivity(intent); break; case R.id.nav_item_random: page.getRandomHandler().doVisitRandomArticle(); break; default: throw new RuntimeException("Unknown ID clicked!"); } return false; } }; }

Target:
public NavigationView.OnNavigationItemSelectedListener getNewListener() { return new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem menuItem) { switch (menuItem.getItemId()) { case R.id.nav_item_today: page.displayMainPage(); break; case R.id.nav_item_history: page.pushFragment(new HistoryFragment()); break; case R.id.nav_item_saved_pages: page.pushFragment(new SavedPagesFragment()); break; case R.id.nav_item_nearby: page.pushFragment(new NearbyFragment()); break; case R.id.nav_item_more: launchSettingsActivity(); break; case R.id.nav_item_login: launchLoginActivity(); break; case R.id.nav_item_username: break; case R.id.nav_item_random: page.getRandomHandler().doVisitRandomArticle(); break; default: throw new RuntimeException("Unknown ID clicked!"); } return false; } }; }
Source:
public ArrayList updateReadyState(boolean state) { ArrayList<Integer> updateList = new ArrayList<Integer>(); if ( state && _lastReady != state ) { for (ADZone tz : _zoneList) { updateList.add(tz.getID()); } clearAll(); } _lastReady = state; return updateList; }

Target:
public ArrayList<Integer> updateReadyState(boolean state) { ArrayList<Integer> updateList = new ArrayList<Integer>(); if (state && _lastReady != state) { for (ADZone tz : _zoneList) { updateList.add(tz.getID()); } clearAll(); } _lastReady = state; return updateList; }
Source:
protected void appendStatementStart(StringBuilder sb, List<ArgumentHolder> argList) { if (joinList == null) { setAddTableName(false); } else { setAddTableName(true); } sb.append("SELECT "); if (databaseType.isLimitAfterSelect()) { appendLimit(sb); } if (distinct) { sb.append("DISTINCT "); } if (countOfQuery == null) { appendSelects(sb); } else { type = StatementType.SELECT_LONG; sb.append("COUNT(").append(countOfQuery).append(") "); } sb.append("FROM "); if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); sb.append("."); } databaseType.appendEscapedEntityName(sb, tableName); if (alias != null) { appendAlias(sb); } sb.append(' '); if (joinList != null) { appendJoinSql(sb); } }

Target:
protected void appendStatementStart(StringBuilder sb, List<ArgumentHolder> argList) { if (joinList == null) { setAddTableName(false); } else { setAddTableName(true); } sb.append("SELECT "); if (databaseType.isLimitAfterSelect()) { appendLimit(sb); } if (distinct) { sb.append("DISTINCT "); } if (countOfQuery == null) { appendSelects(sb); } else { type = StatementType.SELECT_LONG; sb.append("COUNT(").append(countOfQuery).append(") "); } sb.append("FROM "); if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); sb.append('.'); } databaseType.appendEscapedEntityName(sb, tableName); if (alias != null) { appendAlias(sb); } sb.append(' '); if (joinList != null) { appendJoinSql(sb); } }
Source:
public Object create(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { if (post == null) { return null; } IdentifierSourceService service = Context.getService(IdentifierSourceService.class); String identifier = service.generateIdentifier(service.getIdentifierSourceByUuid(parentUniqueId), post.containsKey("comment") ? String.valueOf((String)post.get("comment")) : ""); SimpleObject response = new SimpleObject(); response.add(IDENTIFIER_KEY, identifier); return response; }

Target:
public Object create(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { if (post == null) { return null; } IdentifierSourceService service = Context.getService(IdentifierSourceService.class); String identifier = service.generateIdentifier(service.getIdentifierSourceByUuid(parentUniqueId), post.containsKey("comment") ? String.valueOf(post.get("comment")) : ""); SimpleObject response = new SimpleObject(); response.add(IDENTIFIER_KEY, identifier); return response; }
Source:
public GridSystemViewManager(GridKernalContext ctx) { super(ctx, ((Supplier<SystemViewExporterSpi[]>)() -> { SystemViewExporterSpi[] spi = ctx.config().getSystemViewExporterSpi(); if (!IgniteComponentType.INDEXING.inClassPath()) return spi; SystemViewExporterSpi[] spiWithSql = new SystemViewExporterSpi[spi != null ? spi.length + 1 : 1]; if (!F.isEmpty(spi)) System.arraycopy(spi, 0, spiWithSql, 0, spi.length); try { spiWithSql[spiWithSql.length - 1] = U.newInstance(SYSTEM_VIEW_SQL_SPI); } catch (IgniteCheckedException e) { throw new IgniteException(e); } return spiWithSql; }).get()); }

Target:
public GridSystemViewManager(GridKernalContext ctx) { super(ctx, addStandardExporters(ctx.config().getSystemViewExporterSpi())); }
Source:
public static boolean isWikimediaHost(String host) { return ( Utilities.patternIsFound(URI_HOST_WIKIMEDIA_DOMAIN_PATTERN, host) || Utilities.patternIsFound(URI_HOST_OTHER_PROJECTS_PATTERN, host) || Utilities.patternIsFound(URI_HOST_PROJECT_DOMAIN_PATTERN, host) ); }

Target:
public static boolean isWikimediaHost(String host) { int MAX_REFERER_LENGTH = 5000; if(host.length() > MAX_REFERER_LENGTH) return false; return ( Utilities.patternIsFound(URI_HOST_WIKIMEDIA_DOMAIN_PATTERN, host) || Utilities.patternIsFound(URI_HOST_OTHER_PROJECTS_PATTERN, host) || Utilities.patternIsFound(URI_HOST_PROJECT_DOMAIN_PATTERN, host) ); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_ISSUE) { super.onRefresh(); } else { super.onActivityResult(requestCode, resultCode, data); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_ISSUE) { if (resultCode == Activity.RESULT_OK) { super.onRefresh(); } } else { super.onActivityResult(requestCode, resultCode, data); } }
Source:
public List<Order> getTableFromView() { List<Order> table = new LinkedList<>(); int quantityOfOrdersPerTable = Integer.parseInt(driver.findElement(OrderingPageLocators.QUANTITY_OF_ROWS).getAttribute("value")); int quantityOfOrdersPerPage = driver.findElements(OrderingPageLocators.QUANTITY_OF_ROWS_PER_PAGE).size(); double iteration = new BigDecimal(quantityOfOrdersPerTable / quantityOfOrdersPerPage).setScale(0, RoundingMode.UP).doubleValue(); for (int i = 1; i <= iteration; i++) { for (int j = 2; j <= quantityOfOrdersPerPage + 1; j++) { if (isElementDisplayed(By.xpath(String.format(OrderingPageLocators.TABLE_ROW_CELL, j)))) { List<WebElement> webElements = driver.findElements(By.xpath(String.format(OrderingPageLocators.TABLE_ROW, j))); table.add(new Order.OrdersStepBuilder().withOrderName(webElements.get(0).getText()).withTotalPrice(webElements.get(1).getText()) .withMaxDiscount(webElements.get(2).getText()).withDeliveryDate(webElements.get(3).getText()) .withStatus(webElements.get(4).getText()).withAssignee(webElements.get(5).getText()) .withRole(webElements.get(6).getText()).build()); } } if (i != iteration) { clickNextButton(); } else { clickFirstButton(); } } return table; }

Target:
public List<Order> getTableFromView() { List<Order> table = new LinkedList<>(); int quantityOfOrdersPerTable = Integer.parseInt(driver.findElement(OrderingPageLocators.QUANTITY_OF_ROWS).getAttribute("value")); int quantityOfOrdersPerPage = driver.findElements(OrderingPageLocators.QUANTITY_OF_ROWS_PER_PAGE).size(); double iteration = new BigDecimal(quantityOfOrdersPerTable / quantityOfOrdersPerPage).setScale(0, RoundingMode.UP).doubleValue(); for (int i = 1; i <= iteration; i++) { for (int j = 2; j <= quantityOfOrdersPerPage + 1; j++) { if (isElementDisplayed(By.xpath(String.format(OrderingPageLocators.TABLE_ROW_CELL, j)))) { List<WebElement> ordersFields = driver.findElements(By.xpath(String.format(OrderingPageLocators.TABLE_ROW, j))); table.add(new Order.OrdersBuilder() .withOrderName(ordersFields.get(0).getText()) .withTotalPrice(ordersFields.get(1).getText()) .withMaxDiscount(ordersFields.get(2).getText()) .withDeliveryDate(ordersFields.get(3).getText()) .withStatus(ordersFields.get(4).getText()) .withAssignee(ordersFields.get(5).getText()) .withRole(ordersFields.get(6).getText()) .build()); } } if (i != iteration) { clickNextButton(); } else { clickFirstButton(); } } return table; }
Source:
public static Set<String> identifyTopNodes(Map<String, Set<String>> childMap) { Set<String> candidateTopNodes = new HashSet<>(); Set<String> topNodes = new HashSet<>(); Set<String> children = new HashSet<>(); for (String parent : childMap.keySet()) { if (children.contains(parent) == false) candidateTopNodes.add(parent); children.addAll(childMap.get(parent)); } for (String candidate : candidateTopNodes) { if (children.contains(candidate) == false) topNodes.add(candidate); } return topNodes; }

Target:
public static Set<String> identifyTopNodes(Map<String, Set<String>> childMap) { Set<String> candidateTopNodes = new HashSet<>(); Set<String> topNodes = new HashSet<>(); Set<String> children = new HashSet<>(); for (String parent : childMap.keySet()) { if (!children.contains(parent)) candidateTopNodes.add(parent); children.addAll(childMap.get(parent)); } for (String candidate : candidateTopNodes) { if (!children.contains(candidate)) topNodes.add(candidate); } return topNodes; }
Source:
public FeatureState getFeatureState(Feature feature) { for (StateRepository repository : iterationOrder.getSelected(repositories)) { FeatureState featureState = repository.getFeatureState(feature); if (featureState != null) { return featureState } } return null; }

Target:
public FeatureState getFeatureState(Feature feature) { for (StateRepository repository : iterationOrder.getSelected(repositories)) { FeatureState featureState = repository.getFeatureState(feature); if (featureState != null) { return featureState; } } return null; }
Source:
public static PackExt newPackExt(String ext) { synchronized (lock) { PackExt[] dst = new PackExt[VALUES.length + 1]; for (int i = 0; i < VALUES.length; i++) { PackExt packExt = VALUES[i]; if (packExt.getExtension().equals(ext)) return packExt; dst[i] = packExt; } PackExt value = new PackExt(ext, VALUES.length); dst[VALUES.length] = value; VALUES = dst; return value; } }

Target:
public synchronized static PackExt newPackExt(String ext) { PackExt[] dst = new PackExt[VALUES.length + 1]; for (int i = 0; i < VALUES.length; i++) { PackExt packExt = VALUES[i]; if (packExt.getExtension().equals(ext)) return packExt; dst[i] = packExt; } if (VALUES.length >= 32) throw new IllegalStateException( "maximum number of pack extensions exceeded"); PackExt value = new PackExt(ext, VALUES.length); dst[VALUES.length] = value; VALUES = dst; return value; }
Source:
public void setTest() throws SQLException { String userId = "test"; String classification = "test"; String itemId="test"; final State.Builder state = State.newBuilder(); state.setCompleted(true); state.setStarted(true); state.setGraded(true); IMocksControl control = createControl (); Connection conn = control.createMock (Connection. class); PreparedStatement st = control.createMock (PreparedStatement. class); ResultSet rs = control.createMock (ResultSet. class); final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; expect(conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(st); st.setString(1, userId); st.setString(2, classification); st.setString(3, itemId); expect(st.executeQuery()).andReturn(rs); expect(rs.next()).andReturn(true); rs.updateBoolean("Completed", state.getCompleted()); rs.updateBoolean("Started", state.getStarted()); rs.updateBoolean("Graded", state.getGraded()); rs.updateRow(); st.close(); rs.close(); control.replay (); String res=""; try { res = SqlStateManager.setState(conn, userId, classification, itemId, state.build()); } catch (DatabaseAccessException e) { } String expected = "SET"; assertEquals (expected, res); control.verify (); }

Target:
public void setTest() throws SQLException { String userId = "test"; String classification = "test"; String itemId="test"; final State.Builder state = State.newBuilder(); state.setCompleted(true); state.setStarted(true); state.setGraded(true); IMocksControl control = createControl (); Connection conn = control.createMock (Connection. class); PreparedStatement st = control.createMock (PreparedStatement. class); ResultSet rs = control.createMock (ResultSet. class); final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; expect(conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(st); st.setString(1, userId); st.setString(2, classification); st.setString(3, itemId); expect(st.executeQuery()).andReturn(rs); expect(rs.next()).andReturn(true); rs.updateBoolean(DatabaseStringConstants.STATE_COMPLETED, state.getCompleted()); rs.updateBoolean(DatabaseStringConstants.STATE_STARTED, state.getStarted()); rs.updateBoolean(DatabaseStringConstants.STATE_GRADED, state.getGraded()); rs.updateRow(); st.close(); rs.close(); control.replay (); String res=""; try { res = SqlStateManager.setState(conn, userId, classification, itemId, state.build()); } catch (DatabaseAccessException e) { } String expected = "SET"; assertEquals (expected, res); control.verify (); }
Source:
PRED_commit_committer_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n); }

Target:
public PRED_commit_committer_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n); }
Source:
public void update(ActionEvent event) { Selection<?> select = selectionAgent.getSelection(); Selection<Resource> selection = (Selection<Resource>)select; if (selection.getFirstElement().getId() != null && select.getFirstElement() instanceof Resource) { event.getPresentation().setEnabled(true); } else event.getPresentation().setEnabled(false); }

Target:
public void update(ActionEvent event) { Selection<?> select = selectionAgent.getSelection(); if (select != null && select.getFirstElement() != null && select.getFirstElement() instanceof Resource) { Selection<Resource> selection = (Selection<Resource>)select; event.getPresentation().setEnabled(selection.getFirstElement().getId() != null); } else event.getPresentation().setEnabled(false); }
Source:
public ResponseEntity<?> disable(@RequestBody List<Long> printerIds) throws IOException { return setState(printerIds, false); }

Target:
public void disable(@RequestBody List<Long> printerIds) throws IOException { setState(printerIds, false); }
Source:
public Guid schedule(String className, Guid jobId, String methodName, List<String> inputTypes, List<String> inputParams, String cronExpression, Date startDate, Date endDate, String timeZone) { log.info("Scheduling a cron job. className: {},methodName : , jobId: {}", className, methodName, jobId); boolean isNewJob = false; if (Guid.isNullOrEmpty(jobId)) { jobId = Guid.newGuid(); isNewJob = true; } GlusterJobDetails job = new GlusterJobDetails(); job.setJobId(jobId); job.setJobClassName(className); job.setJobName(methodName); job.setCronSchedule(cronExpression); if (startDate != null) { job.setStartDate(convertDate(startDate)); } if (endDate != null) { job.setEndDate(convertDate(endDate)); } if (!StringUtils.isEmpty(timeZone)) { job.setTimeZone(timeZone); } List<GlusterJobParams> params = new ArrayList<>(); for (int i = 0; i < inputTypes.size(); i++) { GlusterJobParams param = new GlusterJobParams(); param.setJobId(job.getJobId()); param.setParamsClassName(inputTypes.get(i)); param.setParamsClassValue(inputParams.get(i)); params.add(param); } if (isNewJob) { log.info("Scheduling a new cron job. className: {},methodName : , jobId: {}", className, methodName, jobId); scheduleDao.save(job); jobParamsDao.save(job.getJobId(), params); } TimerConfig config = new TimerConfig(); config.setInfo(job); timerService.createCalendarTimer(getScheduleExpression(cronExpression, startDate, endDate, timeZone), config); return jobId; }

Target:
public Guid schedule(String className, Guid jobId, String methodName, List<String> inputTypes, List<String> inputParams, String cronExpression, Date startDate, Date endDate, String timeZone) { log.info("Scheduling a cron job. className: {},methodName : , jobId: {}", className, methodName, jobId); boolean isNewJob = false; if (Guid.isNullOrEmpty(jobId)) { jobId = Guid.newGuid(); isNewJob = true; } GlusterJobDetails job = new GlusterJobDetails(); job.setJobId(jobId); job.setJobClassName(className); job.setJobName(methodName); job.setCronSchedule(cronExpression); try { if (startDate != null) { job.setStartDate(convertDate(startDate)); } if (endDate != null) { job.setEndDate(convertDate(endDate)); } } catch (ParseException e) { log.error("Error while converting the date to simple date format startDate: endDate:{}", startDate, endDate); } if (StringUtils.isNotBlank(timeZone)) { job.setTimeZone(timeZone); } List<GlusterJobParams> params = new ArrayList<>(); for (int i = 0; i < inputTypes.size(); i++) { GlusterJobParams param = new GlusterJobParams(); param.setJobId(job.getJobId()); param.setParamsClassName(inputTypes.get(i)); param.setParamsClassValue(inputParams.get(i)); params.add(param); } if (isNewJob) { log.info("Scheduling a new cron job. className: {},methodName : , jobId: {}", className, methodName, jobId); scheduleDao.save(job); jobParamsDao.save(job.getJobId(), params); } TimerConfig config = new TimerConfig(); config.setInfo(job.getJobId()); timerService.createCalendarTimer(getScheduleExpression(cronExpression, startDate, endDate, timeZone), config); return jobId; }
Source:
public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Points", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, lines.getPointCount()); for (int i = 0; i < lines.getPointCount(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(createFromEsriGeometry(lines.getPoint(i), reference))); } return blockBuilder.build(); }

Target:
public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Points", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, lines.getPointCount()); for (int i = 0; i < lines.getPointCount(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(createFromEsriGeometry(lines.getPoint(i), null))); } return blockBuilder.build(); }