auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { boolean shallow = (options & EFS.SHALLOW) != 0; boolean success = false; if (shallow) { success = file.mkdir(); } else { success = file.mkdirs(); } if (!file.isDirectory()) { if (success && !file.exists()) { try { Thread.sleep(100); } catch (InterruptedException e) { } if (file.isDirectory()) { return this; } } checkReadOnlyParent(file, null); checkTargetIsNotWritable(file, null); String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRONG_TYPE, message); } return this; }

Target:
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { boolean shallow = (options & EFS.SHALLOW) != 0; try { if (shallow) { Files.createDirectory(file.toPath()); } else { Files.createDirectories(file.toPath()); } } catch (IOException e) { String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRITE, message, e); } if (!file.isDirectory()) { checkReadOnlyParent(file, null); checkTargetDoesNotExist(file, null); checkTargetIsNotWritable(file, null); String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRONG_TYPE, message); } return this; }
Source:
public MessageChannelEvent.Chat simulateChat(Text message) { String messageRaw = SpongeTexts.toLegacy(message); ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", SpongeTexts.toComponent(getDisplayNameText()), net.minecraftforge.common.ForgeHooks.newChatWithLinks(messageRaw)); EntityPlayerMP thisPlayer = (EntityPlayerMP)(Object) this; final ServerChatEvent event = new ServerChatEvent(thisPlayer, messageRaw, itextcomponent); ((IMixinInitCause) event).initCause(Cause.of(NamedCause.source(this))); if (!MinecraftForge.EVENT_BUS.post(event)) { MessageChannelEvent.Chat spongeEvent = (MessageChannelEvent.Chat) event; Text theMessage = spongeEvent.getMessage(); if (!spongeEvent.isMessageCancelled()) { spongeEvent.getChannel().ifPresent(channel -> channel.send(this, theMessage, ChatTypes.CHAT)); } } return (MessageChannelEvent.Chat) event; }

Target:
public MessageChannelEvent.Chat simulateChat(Text message) { String messageRaw = SpongeTexts.toLegacy(message); TextComponentTranslation itextcomponent = new TextComponentTranslation("chat.type.text", SpongeTexts.toComponent(getDisplayNameText()), net.minecraftforge.common.ForgeHooks.newChatWithLinks(messageRaw)); EntityPlayerMP thisPlayer = (EntityPlayerMP)(Object) this; final ServerChatEvent event = new ServerChatEvent(thisPlayer, messageRaw, itextcomponent); ((IMixinInitCause) event).initCause(Cause.of(NamedCause.source(this))); if (!MinecraftForge.EVENT_BUS.post(event)) { MessageChannelEvent.Chat spongeEvent = (MessageChannelEvent.Chat) event; if (!spongeEvent.isMessageCancelled()) { spongeEvent.getChannel().ifPresent(channel -> channel.send(this, spongeEvent.getMessage(), ChatTypes.CHAT)); } } return (MessageChannelEvent.Chat) event; }
Source:
protected void generatePassword() { if (Strings.isBlank(getAttribute(AmbariServer.PASSWORD))) { String password; if (Strings.isBlank(getConfig(AmbariServer.PASSWORD))) { password = Identifiers.makeRandomId(10); } else { password = getConfig(AmbariServer.PASSWORD); } usernamePasswordCredentials = new UsernamePasswordCredentials(USERNAME, password); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(new UsernamePasswordCredentials(USERNAME, DEFAULT_PASSWORD))) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); ImmutableMap<String, ImmutableMap<String, String>> userRequest = ImmutableMap.of("Users", ImmutableMap.of( "user_name", USERNAME, "old_password", DEFAULT_PASSWORD, "password", usernamePasswordCredentials.getPassword() )); restAdapter.create(UsersEndpoint.class).updateUser(userRequest); sensors().set(AmbariServer.PASSWORD, password); } }

Target:
protected void generatePassword() { String password = getAttribute(AmbariServer.PASSWORD); if (password == null) { password = getConfig(AmbariServer.PASSWORD); if (password == null) { password = Identifiers.makeRandomId(10); } usernamePasswordCredentials = new UsernamePasswordCredentials(USERNAME, password); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(new UsernamePasswordCredentials(USERNAME, INITIAL_PASSWORD))) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); ImmutableMap<String, ImmutableMap<String, String>> userRequest = ImmutableMap.of("Users", ImmutableMap.of( "user_name", USERNAME, "old_password", INITIAL_PASSWORD, "password", usernamePasswordCredentials.getPassword() )); restAdapter.create(UsersEndpoint.class).updateUser(userRequest); sensors().set(AmbariServer.PASSWORD, password); } }
Source:
private List<OnmsAlarm> getAlarms() { final CriteriaBuilder alarmCb = new CriteriaBuilder(OnmsAlarm.class); alarmCb.alias("node", "node"); alarmCb.alias("node.categories", "category"); alarmCb.alias("lastEvent", "event"); String criteria = getDashletSpec().getParameters().get("criteria"); m_criteriaBuilderHelper.parseConfiguration(alarmCb, criteria); alarmCb.fetch("firstEvent", Fetch.FetchType.EAGER); alarmCb.fetch("lastEvent", Fetch.FetchType.EAGER); List<OnmsAlarm> onmsAlarmList = m_alarmDao.findMatching(alarmCb.toCriteria()); List<OnmsAlarm> distinctOnmsAlarmList = new LinkedList<>(); Set<Integer> onmsAlarmIdSet = new TreeSet<>(); for (OnmsAlarm onmsAlarm : onmsAlarmList) { if (!onmsAlarmIdSet.contains(onmsAlarm.getId())) { distinctOnmsAlarmList.add(onmsAlarm); onmsAlarmIdSet.add(onmsAlarm.getId()); } } return distinctOnmsAlarmList; }

Target:
private List<OnmsAlarm> getAlarms() { final CriteriaBuilder alarmCb = new CriteriaBuilder(OnmsAlarm.class); alarmCb.alias("node", "node"); alarmCb.alias("node.categories", "category"); alarmCb.alias("lastEvent", "event"); String criteria = getDashletSpec().getParameters().get("criteria"); m_criteriaBuilderHelper.parseConfiguration(alarmCb, criteria); alarmCb.fetch("firstEvent", Fetch.FetchType.EAGER); alarmCb.fetch("lastEvent", Fetch.FetchType.EAGER); List<OnmsAlarm> onmsAlarmList = m_alarmDao.findMatching(alarmCb.toCriteria()); Map<Integer, OnmsAlarm> onmsAlarmMap = new LinkedHashMap<>(); for (OnmsAlarm onmsAlarm : onmsAlarmList) { if (!onmsAlarmMap.containsKey(onmsAlarm.getId())) { onmsAlarmMap.put(onmsAlarm.getId(), onmsAlarm); } } return Lists.newArrayList(onmsAlarmMap.values()); }
Source:
public void parseStatFile(String fileName) throws FileNotFoundException { cpuCoreCountersOld = cpuCoreCounters; cpuCoreCounters = new ProcStatCounters(); File statFile = new File(fileName); if (!statFile.exists()) { throw new FileNotFoundException(); } BufferedReader reader = null; try { String coreId; Reader r = new InputStreamReader(new FileInputStream(statFile)); reader = new BufferedReader(r); String line; Pattern patternCpu = Pattern.compile("^(cpu[0-9]{1,})(.*)$"); while ((line = reader.readLine()) != null) { line = line.trim(); Matcher matcherCpu = patternCpu.matcher(line); if (matcherCpu.find()) { Vector<Integer> ticks = new Vector<Integer>(); coreId = matcherCpu.group(1); for (String tick : matcherCpu.group(2).trim().split("\\s+")) { ticks.add(Integer.parseInt(tick)); } try { cpuCoreCounters.addTickCounters(coreId, ticks.toArray(new Integer[ticks.size()])); } catch (ArithmeticException e) { break; } continue; } } } catch (IOException e) { } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } reader = null; } }

Target:
public void parseStatFile(String fileName) throws FileNotFoundException, NumberFormatException { cpuCoreCountersOld = cpuCoreCounters; File statFile = new File(fileName); if (!statFile.exists()) { throw new FileNotFoundException(); } cpuCoreCounters = new ProcStatCounters(); BufferedReader reader = null; try { String coreId; Reader r = new InputStreamReader(new FileInputStream(statFile)); reader = new BufferedReader(r); String line; Pattern patternCpu = Pattern.compile("^(cpu[0-9]+)(.*)$"); while ((line = reader.readLine()) != null) { line = line.trim(); Matcher matcherCpu = patternCpu.matcher(line); if (matcherCpu.find()) { Vector<Integer> ticks = new Vector<Integer>(); coreId = matcherCpu.group(1); for (String tick : matcherCpu.group(2).trim().split("\\s+")) { ticks.add(Integer.parseInt(tick)); } cpuCoreCounters.addTickCounters(coreId, ticks.toArray(new Integer[ticks.size()])); } } } catch (IOException e) { } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } reader = null; } }
Source:
public static String sanitizeFileName(String fileName) { return fileName.replaceAll("[^a-zA-Z0-9.-]", "_"); }

Target:
public static String sanitizeFileName(String fileName) { return fileName.replaceAll("[:\\\\/*\"?|<>']", "_"); }
Source:
public void testParallelThreadsWithDifferentLocales() throws InterruptedException, ExecutionException { final CyclicBarrier barrier = new CyclicBarrier(2); class GetBundle implements Callable<TranslationBundle> { private Locale locale; GetBundle(Locale locale) { this.locale = locale; } public TranslationBundle call() throws Exception { NLS.setLocale(locale); barrier.await(); return GermanTranslatedBundle.get(); } } ExecutorService pool = Executors.newFixedThreadPool(2); Future<TranslationBundle> root = pool.submit(new GetBundle( NLS.ROOT_LOCALE)); Future<TranslationBundle> german = pool.submit(new GetBundle( Locale.GERMAN)); assertEquals(NLS.ROOT_LOCALE, root.get().effectiveLocale()); assertEquals(Locale.GERMAN, german.get().effectiveLocale()); }

Target:
public void testParallelThreadsWithDifferentLocales() throws InterruptedException, ExecutionException { final CyclicBarrier barrier = new CyclicBarrier(2); class GetBundle implements Callable<TranslationBundle> { private Locale locale; GetBundle(Locale locale) { this.locale = locale; } public TranslationBundle call() throws Exception { NLS.setLocale(locale); barrier.await(); return GermanTranslatedBundle.get(); } } ExecutorService pool = Executors.newFixedThreadPool(2); try { Future<TranslationBundle> root = pool.submit(new GetBundle( NLS.ROOT_LOCALE)); Future<TranslationBundle> german = pool.submit(new GetBundle( Locale.GERMAN)); assertEquals(NLS.ROOT_LOCALE, root.get().effectiveLocale()); assertEquals(Locale.GERMAN, german.get().effectiveLocale()); } finally { pool.shutdown(); pool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } }
Source:
public void initialize() { fboManagerSubscribers = Lists.newArrayList(); createStaticFBOs(); setDynamicFBOsDimensions(); createDynamicFBOs(); graphicState.refreshDynamicFBOs(); postProcessor.refreshDynamicFBOs(); createShadowMapFBO(); graphicState.setSceneShadowMap(sceneShadowMap); }

Target:
public void initialize() { fboManagerSubscribers = Sets.newHashSet(); createStaticFBOs(); setDynamicFBOsDimensions(); createDynamicFBOs(); createShadowMapFBO(); }
Source:
protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } if (actionBar != null && getIntent() != null && getIntent().hasExtra(ARG_TITLE)) { actionBar.setTitle(getIntent().getStringExtra(ARG_TITLE)); } StorageUtils.checkStorageAvailability(this); final String feedUrl; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); if (actionBar != null) { actionBar.setTitle(R.string.add_feed_label); } } else { throw new IllegalArgumentException("Activity must be started with feedurl argument!"); } if(feedUrl == null){ Toast toast = Toast.makeText(this.getApplicationContext(), "Feed URL not found.", Toast.LENGTH_SHORT); Log.e(TAG, "feedUrl is null."); toast.show(); }else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (savedInstanceState == null) { startFeedDownload(feedUrl, null, null); } else { startFeedDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }

Target:
protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } if (actionBar != null && getIntent() != null && getIntent().hasExtra(ARG_TITLE)) { actionBar.setTitle(getIntent().getStringExtra(ARG_TITLE)); } StorageUtils.checkStorageAvailability(this); String feedUrl = null; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); if (actionBar != null) { actionBar.setTitle(R.string.add_feed_label); } } if (feedUrl == null) { Log.e(TAG, "feedUrl is null."); new AlertDialog.Builder(OnlineFeedViewActivity.this). setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss()). setTitle(R.string.error_label). setMessage(R.string.null_value_podcast_error).create().show(); } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (savedInstanceState == null) { startFeedDownload(feedUrl, null, null); } else { startFeedDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }
Source:
public Connection(String connectionstring) throws MalformedURLException { URL theurl = new URL(connectionstring); setProtocol(theurl.getProtocol()); host = theurl.getHost(); if (theurl.getPort() < 0) throw new MalformedURLException("Invalid port encountered: '" + theurl.getPort() + "'" ); setPort(Integer.toString(theurl.getPort())); setURIPath(theurl.getPath()); options = new String[0]; if (theurl.getQuery() != null) options = theurl.getQuery().split("&"); constructUrl(); credentials = new Credentials(); }

Target:
public Connection(String connectionstring) throws MalformedURLException { URL theurl = new URL(connectionstring); setProtocol(theurl.getProtocol()); host = theurl.getHost(); if (theurl.getPort() < 0) throw new MalformedURLException("Invalid port encountered: '" + theurl.getPort() + "'" ); setPort(Integer.toString(theurl.getPort())); setURIPath(theurl.getPath()); options = null; if (theurl.getQuery() != null) options = theurl.getQuery().split("&"); constructUrl(); credentials = new Credentials(); }
Source:
void render(LinearLayout layout, boolean isListEmpty) { View emptyView = getViewToRender(); if (layout.findViewById(emptyView.getId()) == null) { layout.addView(emptyView); } if (emptyView != null) { if (!isListEmpty) { emptyView.setVisibility(View.GONE); } else { emptyView.setVisibility(View.VISIBLE); } } }

Target:
void render(LinearLayout layout, boolean isListEmpty) { View emptyView = getViewToRender(); if (emptyView != null) { if (!isListEmpty) { emptyView.setVisibility(View.GONE); } else { emptyView.setVisibility(View.VISIBLE); } } }
Source:
private void assertCurrentStateAtMost(Queries dao, States state) { dao.getVersion(namespace, useCase).ifPresent(currentVersion -> Preconditions.checkState(currentVersion <= state.getSchemaVersion())); }

Target:
private void assertCurrentStateAtMost(Queries dao, States state) { dao.getVersion(namespace, useCase).ifPresent(currentVersion -> Preconditions.checkState(currentVersion <= state.getSchemaVersion(), "Could not update migration state because it would cause us to go back in state version.", SafeArg.of("currentVersion", currentVersion), SafeArg.of("migrationState", state), SafeArg.of("migrationVersion", state.getSchemaVersion()))); }
Source:
private void stopVDOService(Guid vdsId) { boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "stop")).getSucceeded(); if (!succeeded) { log.error("Failed to stop VDO service while moving the host '{}' to maintenance", getHostName(vdsId)); } }

Target:
private void stopVDOService(Guid vdsId) { boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "stop")).getSucceeded(); if (!succeeded) { log.error("Failed to stop VDO service while moving the host '{}' to maintenance", getHostName(vdsId)); backend.runInternalAction(ActionType.ActivateVds, new VdsActionParameters(vdsId)); throw new RuntimeException(String.format("Failed to stop VDO services while moving the host '%s' to maintenance", getHostName(vdsId))); } }
Source:
public static Symbol generateCastFunction(Symbol sourceSymbol, DataType targetType, boolean tryCast) { DataType sourceType = sourceSymbol.valueType(); if (ArrayType.unnest(targetType).id() == OBJECT.id()) { return new Function( functionInfo(List.of(sourceType, targetType), targetType, tryCast), List.of(sourceSymbol, Literal.NULL)); } else { return new Function( functionInfo(List.of(sourceType), targetType, tryCast), List.of(sourceSymbol)); } }

Target:
public static Symbol generateCastFunction(Symbol sourceSymbol, DataType targetType, boolean tryCast) { DataType sourceType = sourceSymbol.valueType(); return new Function( functionInfo(List.of(sourceType, targetType), targetType, tryCast), List.of(sourceSymbol, Literal.NULL)); }
Source:
public void testCallRemoteKieServerOperationWhenServerTemplateHasMoreThanZeroServerInstanceKeys() { final ServerInstanceKey serverInstanceKey = mock(ServerInstanceKey.class); final Collection<ServerInstanceKey> serverInstanceKeys = Collections.singletonList(serverInstanceKey); when(serverTemplate.getServerInstanceKeys()).thenReturn(serverInstanceKeys); doReturn(client).when(instanceManager).getClient(any()); final List<Container> containers = instanceManager.callRemoteKieServerOperation(serverTemplate, containerSpec, operation); assertFalse(containers.isEmpty()); }

Target:
public void testCallRemoteKieServerOperationWhenServerTemplateHasMoreThanZeroServerInstanceKeys() { final ServerInstanceKey serverInstanceKey = mock(ServerInstanceKey.class); final Collection<ServerInstanceKey> serverInstanceKeys = Collections.singletonList(serverInstanceKey); when(serverTemplate.getServerInstanceKeys()).thenReturn(serverInstanceKeys); doReturn(client).when(instanceManager).getClient(any()); final List<Container> containers = instanceManager.callRemoteKieServerOperation(serverTemplate, containerSpec, operation); assertEquals(1, containers.size()); }
Source:
findUnix() { return findResolvConf("/etc/resolv.conf"); }

Target:
findUnix() { try (InputStream in = Files.newInputStream(Paths.get("/etc/resolv.conf"))) { return findResolvConf(in); } catch (Exception e) { return false; } }
Source:
public void sendTextForSubscriber(int subId, String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp) { if (!getSmsPermissions(subId).checkCallingCanSendText(persistMessageForNonDefaultSmsApp, callingPackage, "Sending SMS message")) { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_ERROR_GENERIC_FAILURE); return; } long token = Binder.clearCallingIdentity(); try { SubscriptionInfo info = getSubscriptionInfo(subId); if (isBluetoothSubscription(info)) { sendBluetoothText(info, destAddr, text, sentIntent, deliveryIntent); } else { sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent, persistMessageForNonDefaultSmsApp); } } finally { Binder.restoreCallingIdentity(token); } }

Target:
public void sendTextForSubscriber(int subId, String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp) { if (!getSmsPermissions(subId).checkCallingCanSendText(persistMessageForNonDefaultSmsApp, callingPackage, "Sending SMS message")) { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_ERROR_GENERIC_FAILURE); return; } long token = Binder.clearCallingIdentity(); SubscriptionInfo info; try { info = getSubscriptionInfo(subId); } finally { Binder.restoreCallingIdentity(token); } if (isBluetoothSubscription(info)) { sendBluetoothText(info, destAddr, text, sentIntent, deliveryIntent); } else { sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent, persistMessageForNonDefaultSmsApp); } }
Source:
public String getFQN() { String domain = getDomainControler(); String username = getUserName(); if (username.contains("@") || StringUtils.isEmpty(domain)) { return getUserName(); } else { return getUserName() + "@" + domain; } }

Target:
public String getFQN() { String domain = getDomainControler(); String username = getUserName(); if (StringUtils.isEmpty(username) || username.contains("@") || StringUtils.isEmpty(domain)) { return username; } else { return username + "@" + domain; } }
Source:
public ExecutorManager(final Props azkProps, final ExecutorLoader loader, final AlerterHolder alerterHolder, final CommonMetrics commonMetrics, final ExecutorApiGateway apiGateway) throws ExecutorManagerException { this.alerterHolder = alerterHolder; this.azkProps = azkProps; this.commonMetrics = commonMetrics; this.executorLoader = loader; this.apiGateway = apiGateway; this.setupExecutors(); this.loadRunningFlows(); this.queuedFlows = new QueuedExecutions(azkProps.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.maxConcurrentRunsOneFlow = azkProps.getInt(AZKABAN_MAX_NUM_CONCURRENT_FLOW, 30); this.loadQueuedFlows(); this.cacheDir = new File(azkProps.getString("cache.directory", "cache")); this.executingManager = new ExecutingManagerUpdaterThread(); this.executingManager.start(); if (isMultiExecutorMode()) { setupMultiExecutorMode(); } final long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); this.cleanerThread = new CleanerThread(executionLogsRetentionMs); this.cleanerThread.start(); }

Target:
public ExecutorManager(final Props azkProps, final ExecutorLoader loader, final AlerterHolder alerterHolder, final CommonMetrics commonMetrics, final ExecutorApiGateway apiGateway) throws ExecutorManagerException { this.alerterHolder = alerterHolder; this.azkProps = azkProps; this.commonMetrics = commonMetrics; this.executorLoader = loader; this.apiGateway = apiGateway; this.setupExecutors(); this.loadRunningFlows(); this.queuedFlows = new QueuedExecutions(azkProps.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.maxConcurrentRunsOneFlow = azkProps.getInt(AZKABAN_MAX_CONCURRENT_RUNS_ONEFLOW, DEFAULT_MAX_ONCURRENT_RUNS_ONEFLOW); this.loadQueuedFlows(); this.cacheDir = new File(azkProps.getString("cache.directory", "cache")); this.executingManager = new ExecutingManagerUpdaterThread(); this.executingManager.start(); if (isMultiExecutorMode()) { setupMultiExecutorMode(); } final long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); this.cleanerThread = new CleanerThread(executionLogsRetentionMs); this.cleanerThread.start(); }
Source:
public void checkAndUpdateSettings(LiveStreamPacketizerCupertino cupertinoPacketizer, IMediaStream stream) { if (stream.getClientId() >= 0) { return; } updateStreamProperties(cupertinoPacketizer, stream.getName()); }

Target:
public void checkAndUpdateSettings(LiveStreamPacketizerCupertino cupertinoPacketizer, IMediaStream stream) { if (stream.getClientId() >= 0) { return; } setSegmentDuration(cupertinoPacketizer, stream.getName()); }
Source:
public void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener) { if (helixClusterManager != null) { helixClusterManager.registerClusterMapListener(clusterMapChangeListener); } }

Target:
public void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener) { helixClusterManager.registerClusterMapListener(clusterMapChangeListener); }
Source:
protected void setSelection(@NonNull Set<@NonNull Integer> selection) { super.setSelection(selection); Iterator<Color> lightColorsIt; Iterator<Color> colorsIt; colorsIt = Iterators.cycle(COLORS); lightColorsIt = Iterators.cycle(LIGHT_COLORS); Set<Integer> currentSelections = getInternalSelections(); for (ISeries series : getChart().getSeriesSet().getSeries()) { Color lightColor = lightColorsIt.next(); Color color = colorsIt.next(); Color[] colors = ((ILineSeries) series).getSymbolColors(); if (currentSelections.isEmpty()) { Arrays.fill(colors, color); } else { Arrays.fill(colors, lightColor); } ((ILineSeries) series).setSymbolColors(colors); } }

Target:
protected void setSelection(@NonNull Set<@NonNull Integer> selection) { super.setSelection(selection); Iterator<Color> colorsIt = Iterators.cycle(COLORS); Iterator<Color> lightColorsIt = Iterators.cycle(LIGHT_COLORS); Set<Integer> currentSelections = getInternalSelections(); for (ISeries series : getChart().getSeriesSet().getSeries()) { Color lightColor = lightColorsIt.next(); Color color = colorsIt.next(); Color[] colors = ((ILineSeries) series).getSymbolColors(); if (currentSelections.isEmpty()) { Arrays.fill(colors, color); } else { Arrays.fill(colors, lightColor); } ((ILineSeries) series).setSymbolColors(colors); } }
Source:
public SpawnResult exec(Spawn spawn, SpawnExecutionContext context) throws ExecException, IOException, InterruptedException { this.supportsMultiplexWorkers = Spawns.supportsMultiplexWorkers(spawn); if (!Spawns.supportsWorkers(spawn) && !Spawns.supportsMultiplexWorkers(spawn)) { reporter.handle( Event.warn( String.format(ERROR_MESSAGE_PREFIX + REASON_NO_EXECUTION_INFO, spawn.getMnemonic()))); return fallbackRunner.exec(spawn, context); } context.report(ProgressStatus.SCHEDULING, getName()); return actuallyExec(spawn, context); }

Target:
public SpawnResult exec(Spawn spawn, SpawnExecutionContext context) throws ExecException, IOException, InterruptedException { if (!Spawns.supportsWorkers(spawn) && !Spawns.supportsMultiplexWorkers(spawn)) { reporter.handle( Event.warn( String.format(ERROR_MESSAGE_PREFIX + REASON_NO_EXECUTION_INFO, spawn.getMnemonic()))); return fallbackRunner.exec(spawn, context); } context.report(ProgressStatus.SCHEDULING, WorkerKey.makeWorkerTypeName(Spawns.supportsMultiplexWorkers(spawn))); return actuallyExec(spawn, context); }
Source:
private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { if(oldVersionCode < 1030000) { new Thread() { public void run() { List<Feed> feeds = DBReader.getFeedList(context); for (Feed podcast : feeds) { List<FeedItem> episodes = DBReader.getFeedItemList(context, podcast); for (FeedItem episode : episodes) { FeedImage image = episode.getImage(); if (image != null && image.isDownloaded() && image.getFile_url() != null) { File imageFile = new File(image.getFile_url()); if (imageFile.exists()) { imageFile.delete(); } image.setFile_url(null); DBWriter.setFeedImage(context, image); } } } } }.start(); } }

Target:
private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { if(oldVersionCode < 1030099) { new Thread() { public void run() { List<Feed> feeds = DBReader.getFeedList(context); for (Feed podcast : feeds) { List<FeedItem> episodes = DBReader.getFeedItemList(context, podcast); for (FeedItem episode : episodes) { FeedImage image = episode.getImage(); if (image != null && image.isDownloaded() && image.getFile_url() != null) { File imageFile = new File(image.getFile_url()); if (imageFile.exists()) { imageFile.delete(); } image.setFile_url(null); DBWriter.setFeedImage(context, image); } } } } }.start(); } }
Source:
public MuteStatusChangeEvent(IUser affected, IUser controller, boolean value, Long timestamp, String reason) { super(affected, controller, value); this.timestamp = timestamp; if (reason == null) { this.reason = null; } else { this.reason = reason.isEmpty() ? null : reason; } }

Target:
public MuteStatusChangeEvent(IUser affected, IUser controller, boolean value, Long timestamp, String reason) { super(affected, controller, value); this.timestamp = timestamp; this.reason = reason == null ? null : (reason.isEmpty() ? null : reason); }
Source:
public JSONStringer toJSONStringerV2(JSONStringer js) { try { VoltTableRow row = cloneRow(); row.resetRowPosition(); js.array(); while (row.advanceRow()) { js.object(); for (int i = 0; i < getColumnCount(); i++) { js.key(getColumnName(i)); row.putJSONRep(i, js); } js.endObject(); } js.endArray(); } catch (JSONException e) { e.printStackTrace(); throw new RuntimeException("Failed to serialized a table to JSON V2.", e); } return js; }

Target:
public JSONStringer toJSONStringerV2(JSONStringer js) throws JSONException{ VoltTableRow row = cloneRow(); row.resetRowPosition(); js.array(); while (row.advanceRow()) { js.object(); for (int i = 0; i < getColumnCount(); i++) { js.key(getColumnName(i)); row.putJSONRep(i, js); } js.endObject(); } js.endArray(); return js; }
Source:
public FileMode getIndexFileMode(final DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter == null) { return wtMode; } final FileMode iMode = indexIter.getEntryFileMode(); if (getOptions().isFileMode() && iMode != FileMode.GITLINK && iMode != FileMode.TREE) { return wtMode; } if (FileMode.REGULAR_FILE == wtMode && FileMode.EXECUTABLE_FILE == iMode) { return iMode; } if (FileMode.EXECUTABLE_FILE == wtMode && FileMode.REGULAR_FILE == iMode) { return iMode; } if (FileMode.GITLINK == iMode && FileMode.TREE == wtMode) { return iMode; } if (FileMode.TREE == iMode && FileMode.GITLINK == wtMode) { return iMode; } return wtMode; }

Target:
public FileMode getIndexFileMode(final DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter == null) { return wtMode; } final FileMode iMode = indexIter.getEntryFileMode(); if (getOptions().isFileMode() && iMode != FileMode.GITLINK && iMode != FileMode.TREE) { return wtMode; } if (!getOptions().isFileMode()) { if (FileMode.REGULAR_FILE == wtMode && FileMode.EXECUTABLE_FILE == iMode) { return iMode; } if (FileMode.EXECUTABLE_FILE == wtMode && FileMode.REGULAR_FILE == iMode) { return iMode; } } if (FileMode.GITLINK == iMode && FileMode.TREE == wtMode) { return iMode; } if (FileMode.TREE == iMode && FileMode.GITLINK == wtMode) { return iMode; } return wtMode; }
Source:
public static Optional<Collection> getCollectionByVreId(Element element, Vres mappings, String vreId) { return Arrays.asList(getEntityTypesOrDefault(element)) .stream() .map(type -> mappings.getCollectionForType(type).get()) .filter(collection -> collection.getVreName().equals(vreId)) .findFirst(); }

Target:
public static Optional<Collection> getCollectionByVreId(Element element, Vres mappings, String vreId) { return Arrays.stream(getEntityTypesOrDefault(element)) .map(type -> mappings.getCollectionForType(type).get()) .filter(collection -> collection.getVreName().equals(vreId)) .findFirst(); }
Source:
public static void setDefaults(Properties conf) { { Properties defaults = new Properties(); try { defaults.load(Utils.class.getResourceAsStream("defaults.properties")); for (Map.Entry<Object, Object> entry : defaults.entrySet()) { putIfAbsent(conf, (String) entry.getKey(), (String) entry.getValue()); } } catch (IOException e) { throw new RuntimeException(e); } } }

Target:
public static void setDefaults(Properties conf) { { Properties defaults = new Properties(); try (Reader reader = new InputStreamReader(Utils.class.getResourceAsStream("defaults.properties"), Charset.forName("UTF-8"))) { defaults.load(reader); for (Map.Entry<Object, Object> entry : defaults.entrySet()) { putIfAbsent(conf, (String) entry.getKey(), (String) entry.getValue()); } } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
public MCCIIN000002UV01 processPatientDiscoveryAsyncReq(RespondingGatewayPRPAIN201305UV02SecuredRequestType request) { AssertionType assertion = getAssertion(context, null); return outboundPatientDiscoveryRequest.processPatientDiscoveryAsyncReq(request.getPRPAIN201305UV02(), assertion, request.getNhinTargetCommunities(), getWebContextProperties(context)); }

Target:
public MCCIIN000002UV01 processPatientDiscoveryAsyncReq(RespondingGatewayPRPAIN201305UV02SecuredRequestType request) { AssertionType assertion = getAssertion(context, null); return outboundPatientDiscoveryRequest.processPatientDiscoveryAsyncReq(request.getPRPAIN201305UV02(), assertion, request.getNhinTargetCommunities()); }
Source:
public static ArrayList<Pseudostate> getInitialPsudoStates(Region region) { ArrayList<Pseudostate> pseudoStates = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (isInitialPseudoState(vertex)) { pseudoStates.add((Pseudostate) vertex); } } return pseudoStates; }

Target:
public static List<Pseudostate> getInitialPsudoStates(Region region) { List<Pseudostate> pseudoStates = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (isInitialPseudoState(vertex)) { pseudoStates.add((Pseudostate) vertex); } } return pseudoStates; }
Source:
private void synchCTFState(MArea areaModel) { List<MPartStack> stacks = findDirectStacks(areaModel); int count = 0; for (MPartStack stack : stacks) { if (stack.isToBeRendered()) count++; } if (count > 1) ensureCTF(areaModel); else ensureComposite(areaModel); }

Target:
private void synchCTFState(MArea areaModel) { List<MPartStack> stacks = findDirectStacks(areaModel); int count = 0; for (MPartStack stack : stacks) { if (stack.isToBeRendered()) count++; } if (count > 1) ensureCTF(areaModel, stacks); else ensureComposite(areaModel, stacks); }
Source:
private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BBContainer cont = null; BBContainer schemaCont = null; try { if (m_reader.isReadFirstObjectOfSegment()) { schemaCont = m_reader.getSchema(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } cont = m_reader.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } catch (IOException e) { exportLog.error(e); } if (cont == null) { return null; } else { cont.b().order(ByteOrder.LITTLE_ENDIAN); final BBContainer fcont = cont; long seqNo = cont.b().getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); int tupleCount = cont.b().getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = cont.b().getLong(StreamBlock.UNIQUE_ID_OFFSET); StreamBlock block = new StreamBlock( fcont, schemaCont, seqNo, tupleCount, uniqueId, true); if (!actuallyPoll) { m_memoryDeque.offer(block); } return block; } }

Target:
private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BBContainer cont = null; BBContainer schemaCont = null; try { if (m_reader.isStartOfSegment()) { schemaCont = m_reader.getSchema(-1, false, false); } cont = m_reader.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } catch (IOException e) { exportLog.error("Failed to poll from persistent binary deque:" + e); } if (cont == null) { return null; } else { long segmentIndex = m_reader.getSegmentIndex(); cont.b().order(ByteOrder.LITTLE_ENDIAN); final BBContainer fcont = cont; long seqNo = cont.b().getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); int tupleCount = cont.b().getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = cont.b().getLong(StreamBlock.UNIQUE_ID_OFFSET); StreamBlock block = new StreamBlock( fcont, schemaCont, seqNo, tupleCount, uniqueId, segmentIndex, true); if (!actuallyPoll) { m_memoryDeque.offer(block); } return block; } }
Source:
private void encodeRemainingNullsAsBits() { byte value = 0; int mask = 0b1000_0000; for (int i = 0; i < remainingNullsCount; i++) { value |= remainingNullsFromLastBatch[i] ? mask : 0; mask >>>= 1; } nullsBufferContainsNull |= (value != 0); ByteArrayUtils.writeByte(nullsBuffer, nullsBufferIndex, value); nullsBufferIndex++; }

Target:
private int encodeRemainingNullsAsBits() { if (remainingNullsCount == 0) { return 0; } byte value = 0; for (int i = 0; i < remainingNullsCount; i++) { value |= remainingNullsFromLastBatch[i] ? 0b1000_0000 >>> i : 0; } nullsBufferContainsNull |= (value != 0); nullsBufferIndex = setByte(nullsBuffer, nullsBufferIndex, value); int padding = BITS_IN_BYTE - remainingNullsCount; remainingNullsCount = 0; return padding; }
Source:
private double nullSafeArrayLength(long[] array) { return null == array ? 0 : array.length; }

Target:
private static double nullSafeArrayLength(long[] array) { return null == array ? 0 : array.length; }
Source:
public static PowerManagement map(VDS entity, PowerManagement template) { PowerManagement model = template != null ? template : new PowerManagement(); model.setType(entity.getpm_type()); model.setEnabled(entity.getpm_enabled()); model.setAddress(entity.getManagmentIp()); model.setUsername(entity.getpm_user()); if (entity.getPmOptionsMap() != null) { model.setOptions(map(entity.getPmOptionsMap(), null)); } if (entity.getPmProxyPreferences() != null) { PmProxies pmProxies = (model.getPmProxies() != null) ? model.getPmProxies() : new PmProxies(); pmProxies.getPmProxy().clear(); String[] proxies = StringUtils.split(entity.getPmProxyPreferences(), ","); for (String proxy : proxies) { PmProxy pmProxy = new PmProxy(); pmProxy.setPropietary(proxy); pmProxies.getPmProxy().add(pmProxy); } model.setPmProxies(pmProxies); } return model; }

Target:
public static PowerManagement map(VDS entity, PowerManagement template) { PowerManagement model = template != null ? template : new PowerManagement(); model.setType(entity.getpm_type()); model.setEnabled(entity.getpm_enabled()); model.setAddress(entity.getManagmentIp()); model.setUsername(entity.getpm_user()); if (entity.getPmOptionsMap() != null) { model.setOptions(map(entity.getPmOptionsMap(), null)); } if (entity.getPmProxyPreferences() != null) { PmProxies pmProxies = new PmProxies(); String[] proxies = StringUtils.split(entity.getPmProxyPreferences(), ","); for (String proxy : proxies) { PmProxy pmProxy = new PmProxy(); pmProxy.setPropietary(proxy); pmProxies.getPmProxy().add(pmProxy); } model.setPmProxies(pmProxies); } return model; }
Source:
public void synchronize(NewProjectHandler newProjectHandler, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { SynchronizeGradleBuildsOperation syncOperation = SynchronizeGradleBuildsOperation.forSingleGradleBuild(this, newProjectHandler); try { syncOperation.run(tokenSource, monitor); GradleMarkerManager.clear(this); } catch (Exception e) { GradleMarkerManager.clear(this); ToolingApiStatus status = ToolingApiStatus.from("Project synchronization" , e); if (status.severityMatches(IStatus.WARNING | IStatus.ERROR)) { GradleMarkerManager.addError(this, status); } throw e; } }

Target:
public void synchronize(NewProjectHandler newProjectHandler, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { SynchronizeGradleBuildsOperation syncOperation = SynchronizeGradleBuildsOperation.forSingleGradleBuild(this, newProjectHandler); try { GradleMarkerManager.clear(this); syncOperation.run(tokenSource, monitor); } catch (Exception e) { ToolingApiStatus status = ToolingApiStatus.from("Project synchronization" , e); if (status.severityMatches(IStatus.WARNING | IStatus.ERROR)) { GradleMarkerManager.addError(this, status); } throw e; } }
Source:
default void interactBlockWith(Vector3i position, ItemStack itemStack, Direction side) { interactBlockWith(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(itemStack, "itemStack"), checkNotNull(side, "side")); }

Target:
default boolean interactBlockWith(Vector3i position, ItemStack itemStack, Direction side) { return interactBlockWith(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(itemStack, "itemStack"), checkNotNull(side, "side")); }
Source:
public String checkpoint() throws IOException { try (LockResource lr = mMasterContext.getStateLockManager().lockExclusive(StateLockOptions.defaults())) { mJournalSystem.checkpoint(); return NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.MASTER_RPC, ServerConfiguration.global()); } catch (Exception e) { throw new IOException("Failed to take a checkpoint", e); } }

Target:
public String checkpoint() throws IOException { try (LockResource lr = mMasterContext.getStateLockManager().lockExclusive(StateLockOptions.defaults())) { mJournalSystem.checkpoint(); return NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.MASTER_RPC, ServerConfiguration.global()); } catch (Exception e) { throw new IOException("Failed to take a checkpoint.", e); } }
Source:
protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(SerializationContextHolder.getSerializationContext()); MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); ConfigurationBuilder builder = hotRodCacheConfiguration(); builder.dataContainer().keyEquivalence(AnyEquivalence.getInstance()); builder.dataContainer().valueEquivalence(AnyEquivalence.getInstance()); builder.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .indexing().enable() .indexLocalOnly(false) .addProperty("default.directory_provider", "ram") .addProperty("lucene_version", "LUCENE_CURRENT"); cacheManager = TestCacheManagerFactory.createCacheManager(builder); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); Properties hotrodClientConf = new Properties(); hotrodClientConf.put("infinispan.client.hotrod.server_list", "localhost:" + hotRodServer.getPort()); hotrodClientConf.put("infinispan.client.hotrod.marshaller", ProtoStreamMarshaller.class.getName()); remoteCacheManager = new RemoteCacheManager(hotrodClientConf); remoteCache = remoteCacheManager.getCache(); return cacheManager; }

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(SerializationContextHolder.getSerializationContext()); MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); ConfigurationBuilder builder = hotRodCacheConfiguration(); builder.transaction() .indexing().enable() .indexLocalOnly(false) .addProperty("default.directory_provider", "ram") .addProperty("lucene_version", "LUCENE_CURRENT"); builder.dataContainer().valueEquivalence(AnyEquivalence.getInstance()); cacheManager = TestCacheManagerFactory.createCacheManager(builder); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort()); clientBuilder.marshaller(new ProtoStreamMarshaller()); remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); remoteCache = remoteCacheManager.getCache(); return cacheManager; }
Source:
public void testSTDifference() throws Exception { assertQuery("select ST_AsText(ST_Difference(ST_GeometryFromText('Polygon ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('Polygon ((2 2, 2 5, 5 5, 5 2))')))", "select 'POLYGON ((1 1, 4 1, 4 2, 2 2, 2 4, 1 4, 1 1))'"); }

Target:
public void testSTDifference() throws Exception { assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)')))", VARCHAR, "POINT (50 100)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTIPOINT (50 100, 50 200)'), ST_GeometryFromText('POINT (50 100)')))", VARCHAR, "POINT (50 200)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('LINESTRING (50 100, 50 200)'), ST_GeometryFromText('LINESTRING (50 50, 50 150)')))", VARCHAR, "LINESTRING (50 150, 50 200)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'), ST_GeometryFromText('MULTILINESTRING ((2 1, 4 1), (3 3, 7 3))')))", VARCHAR, "MULTILINESTRING ((1 1, 2 1), (4 1, 5 1), (2 4, 4 4))"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('POLYGON ((2 2, 2 5, 5 5, 5 2))')))", VARCHAR, "POLYGON ((1 1, 4 1, 4 2, 2 2, 2 4, 1 4, 1 1))"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((0 0, 0 2, 2 2, 2 0)))'), ST_GeometryFromText('POLYGON ((0 1, 3 1, 3 3, 0 3, 0 1))')))", VARCHAR, "POLYGON ((1 1, 0 1, 0 0, 2 0, 2 1, 1 1))"); }
Source:
private IndexValue(long size, Offset offset, byte flags, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { this.size = size; this.offset = offset; this.flags = flags; int expiryInSecs = (int) (expiresAtMs / Time.MsPerSec); this.expiresAtMs = expiresAtMs != Utils.Infinite_Time ? expiryInSecs * Time.MsPerSec : Utils.Infinite_Time; this.originalMessageOffset = originalMessageOffset; int operationTimeInSecs = (int) (operationTimeInMs / Time.MsPerSec); this.operationTimeInMs = operationTimeInMs != Utils.Infinite_Time ? operationTimeInSecs * Time.MsPerSec : Utils.Infinite_Time; this.serviceId = serviceId; this.containerId = containerId; version = PersistentIndex.VERSION_1; }

Target:
private IndexValue(long size, Offset offset, byte flags, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { this.size = size; this.offset = offset; this.flags = flags; this.expiresAtMs = Utils.getTimeInMsToTheNearestSec(expiresAtMs); this.originalMessageOffset = originalMessageOffset; this.operationTimeInMs = Utils.getTimeInMsToTheNearestSec(operationTimeInMs); this.serviceId = serviceId; this.containerId = containerId; version = PersistentIndex.CURRENT_VERSION; }
Source:
public void defaultMainThreadSchedulerIsInitializedLazily() { final Function<Callable<Scheduler>, Scheduler> safeOverride = new Function<Callable<Scheduler>, Scheduler>() { @Override public Scheduler apply(Callable<Scheduler> __) { return new EmptyScheduler(); } }; final Callable<Scheduler> unsafeDefault = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { throw new AssertionError( "Default Scheduler instance should not have been evaluated"); } }; try { RxAndroidPlugins.setInitMainThreadSchedulerHandler(safeOverride); RxAndroidPlugins.initMainThreadScheduler(unsafeDefault); } finally { RxAndroidPlugins.reset(); } }

Target:
public void defaultMainThreadSchedulerIsInitializedLazily() { Function<Callable<Scheduler>, Scheduler> safeOverride = new Function<Callable<Scheduler>, Scheduler>() { @Override public Scheduler apply(Callable<Scheduler> scheduler) { return new EmptyScheduler(); } }; Callable<Scheduler> unsafeDefault = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { throw new AssertionError(); } }; RxAndroidPlugins.setInitMainThreadSchedulerHandler(safeOverride); RxAndroidPlugins.initMainThreadScheduler(unsafeDefault); }
Source:
public boolean canMaintain(Object dataObject, Person user) { if (!super.canMaintain(dataObject, user)) { return false; } WebServiceCredential webServiceCredential = (WebServiceCredential) dataObject; ParameterEvaluator parameterEvaluator = SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator( WebServiceCredential.class, CUKFSParameterKeyConstants.NON_EDITABLE_CREDENTIAL_VALUES, webServiceCredential.getCredentialGroupCode(), webServiceCredential.getCredentialKey() ); return !parameterEvaluator.evaluationSucceeds(); }

Target:
public boolean canMaintain(Object dataObject, Person user) { if (!super.canMaintain(dataObject, user)) { return false; } WebServiceCredential webServiceCredential = (WebServiceCredential) dataObject; ParameterEvaluator parameterEvaluator = getParameterEvaluatorService().getParameterEvaluator( WebServiceCredential.class, CUKFSParameterKeyConstants.NON_EDITABLE_CREDENTIAL_VALUES, webServiceCredential.getCredentialGroupCode(), webServiceCredential.getCredentialKey() ); return !parameterEvaluator.evaluationSucceeds(); }
Source:
public String getLogMessage() { return String.format("Processed Pool with id %d", poolProgressStep.getInput().getId()); }

Target:
public String getLogMessage() { Pool pool = poolProgressStep.getInput(); return String.format("Selected Pool %s (%s)", pool.getAlias(), pool.getName()); }