auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void teardown() throws Exception { String methodName = "removeBucket(RemoveBucketArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName); } long startTime = System.currentTimeMillis(); try { client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } catch (Exception e) { handleException(methodName, null, startTime, e); } }

Target:
public static void teardown() throws Exception { long startTime = System.currentTimeMillis(); try { client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } catch (Exception e) { handleException("removeBucket(RemoveBucketArgs args)", null, startTime, e); } }
Source:
public void testOnErrorExceptionIsThrownFromSingleUnsafeSubscribe() { Single.create(new Single.OnSubscribe<Integer>() { @Override public void call(SingleSubscriber<? super Integer> s1) { Single.create(new Single.OnSubscribe<Integer>() { @Override public void call(SingleSubscriber<? super Integer> s2) { throw new IllegalArgumentException("original exception"); } }).unsafeSubscribe(new Subscriber<Integer>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { s1.onError(e); } @Override public void onNext(Integer v) { s1.onSuccess(v); } }); } } ).subscribe(new OnErrorFailedSubscriber()); }

Target:
public void testOnErrorExceptionIsThrownFromSingleUnsafeSubscribe() { Single.create(new Single.OnSubscribe<Integer>() { @Override public void call(final SingleSubscriber<? super Integer> s1) { Single.create(new Single.OnSubscribe<Integer>() { @Override public void call(SingleSubscriber<? super Integer> s2) { throw new IllegalArgumentException("original exception"); } }).unsafeSubscribe(new Subscriber<Integer>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { s1.onError(e); } @Override public void onNext(Integer v) { s1.onSuccess(v); } }); } } ).subscribe(new OnErrorFailedSubscriber()); }
Source:
public void onFatalError(Throwable throwable) { synchronized (lock) { if (running) { if (throwable instanceof LeaderElectionException) { leaderContender.handleError((LeaderElectionException) throwable); } else { leaderContender.handleError(new LeaderElectionException(throwable)); } } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } } } }

Target:
public void onFatalError(Throwable throwable) { synchronized (lock) { if (!running) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } return; } } if (throwable instanceof LeaderElectionException) { leaderContender.handleError((LeaderElectionException) throwable); } else { leaderContender.handleError(new LeaderElectionException(throwable)); } }
Source:
public static boolean syncHotlist() { if (relay == null || !relay.isConnection(RelayServiceBackbone.CONNECTED)) return false; connection.sendMsg("last_read_lines", "hdata", "buffer:gui_buffers(*)/own_lines/lastReadLine/data buffer"); connection.sendMsg("hotlist", "hdata", "hotlist:gui_hotlist(*) buffer,count"); return true; }

Target:
public static boolean syncHotlist() { if (relay == null || !relay.isConnection(RelayServiceBackbone.CONNECTED)) return false; connection.sendMsg("last_read_lines", "hdata", "buffer:gui_buffers(*)/own_lines/last_read_line/data buffer"); connection.sendMsg("hotlist", "hdata", "hotlist:gui_hotlist(*) buffer,count"); return true; }
Source:
public CandlepinQuery<Consumer> getHypervisors( @PathParam("owner_key") @Verify(Owner.class) String ownerKey, @QueryParam("hypervisor_id") List<String> hypervisorIds) { CandlepinQuery<Consumer> out = (hypervisorIds == null || hypervisorIds.isEmpty()) ? this.consumerCurator.getHypervisorsForOwner(ownerKey) : this.consumerCurator.getHypervisorsBulk(hypervisorIds, ownerKey); return out; }

Target:
public CandlepinQuery<Consumer> getHypervisors( @PathParam("owner_key") @Verify(Owner.class) String ownerKey, @QueryParam("hypervisor_id") List<String> hypervisorIds) { Owner owner = ownerCurator.lookupByKey(ownerKey); CandlepinQuery<Consumer> out = (hypervisorIds == null || hypervisorIds.isEmpty()) ? this.consumerCurator.getHypervisorsForOwner(owner.getId()) : this.consumerCurator.getHypervisorsBulk(hypervisorIds, owner.getId()); return out; }
Source:
private void syncRequestSuccess(JSONObject pData) { updateCrashedInFlightFromNewData(pData); updateDelayedFromNewData(pData); updateMetaFromNewData(pData); boolean hasRecords = false; if (pData.has("records")) { hasRecords = true; resetDataRecords(pData); } if (pData.has("updates")) { JSONArray ack = new JSONArray(); JSONObject updates = pData.getJSONObject("updates"); JSONObject applied = updates.optJSONObject("applied"); checkUidChanges(applied); processUpdates(applied, NotificationMessage.REMOTE_UPDATE_APPLIED_CODE, ack); processUpdates(updates.optJSONObject("failed"), NotificationMessage.REMOTE_UPDATE_FAILED_CODE, ack); processUpdates(updates.optJSONObject("collisions"), NotificationMessage.COLLISION_DETECTED_CODE, ack); mAcknowledgements = ack; } if (!hasRecords && pData.has("hash") && !pData.getString("hash").equals(mHashvalue)) { String remoteHash = pData.getString("hash"); FHLog.d( LOG_TAG, "Local dataset stale - syncing records :: local hash= " + mHashvalue + " - remoteHash =" + remoteHash); syncRecords(); } else { FHLog.i(LOG_TAG, "Local dataset up to date"); } syncCompleteWithCode("online"); }

Target:
private void syncRequestSuccess(JSONObject pData) { updateCrashedInFlightFromNewData(pData); updateDelayedFromNewData(pData); updateMetaFromNewData(pData); boolean hasRecords = false; if (pData.has("records")) { hasRecords = true; } if (pData.has("updates")) { JSONArray ack = new JSONArray(); JSONObject updates = pData.getJSONObject("updates"); JSONObject applied = updates.optJSONObject("applied"); checkUidChanges(applied); processUpdates(applied, NotificationMessage.REMOTE_UPDATE_APPLIED_CODE, ack); processUpdates(updates.optJSONObject("failed"), NotificationMessage.REMOTE_UPDATE_FAILED_CODE, ack); processUpdates(updates.optJSONObject("collisions"), NotificationMessage.COLLISION_DETECTED_CODE, ack); mAcknowledgements = ack; } if (!hasRecords && pData.has("hash") && !pData.getString("hash").equals(mHashvalue)) { String remoteHash = pData.getString("hash"); FHLog.d( LOG_TAG, "Local dataset stale - syncing records :: local hash= " + mHashvalue + " - remoteHash =" + remoteHash); syncRecords(); } else { FHLog.i(LOG_TAG, "Local dataset up to date"); } syncCompleteWithCode("online"); }
Source:
public void runSync(final SyncState sync, final SyncUpdateCallback callback) { updateSync(sync, SyncState.Status.RUNNING, 0, callback); threadPool.execute(new Runnable() { @Override public void run() { try { switch (sync.getType()) { case syncDown: syncDown(sync, callback); break; case syncUp: syncUp(sync, callback); break; } updateSync(sync, SyncState.Status.DONE, 100, callback); } catch (RestClient.RefreshTokenRevokedException re) { SmartSyncLogger.e(TAG, "Exception thrown in runSync", re); } catch (Exception e) { SmartSyncLogger.e(TAG, "Exception thrown in runSync", e); String errorMessage = e.getMessage(); if(errorMessage != null){ try { JSONArray errorInJSON = new JSONArray(errorMessage); sync.setError(errorInJSON.getJSONObject(0)); } catch (JSONException jsonException) { jsonException.printStackTrace(); } } updateSync(sync, SyncState.Status.FAILED, UNCHANGED, callback); } } }); }

Target:
public void runSync(final SyncState sync, final SyncUpdateCallback callback) { updateSync(sync, SyncState.Status.RUNNING, 0, callback); threadPool.execute(new Runnable() { @Override public void run() { try { switch (sync.getType()) { case syncDown: syncDown(sync, callback); break; case syncUp: syncUp(sync, callback); break; } updateSync(sync, SyncState.Status.DONE, 100, callback); } catch (RestClient.RefreshTokenRevokedException re) { SmartSyncLogger.e(TAG, "Exception thrown in runSync", re); } catch (Exception e) { SmartSyncLogger.e(TAG, "Exception thrown in runSync", e); String errorMessage = e.getMessage(); if(errorMessage != null){ try { JSONArray errorInJSON = new JSONArray(errorMessage); sync.setError(errorInJSON.getJSONObject(0)); } catch (JSONException jsonException) { SmartSyncLogger.e(TAG, "Exception thrown while parsing JSON", jsonException); } } updateSync(sync, SyncState.Status.FAILED, UNCHANGED, callback); } } }); }
Source:
public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> next) { JavaType propType = null; if (type instanceof NestedComplexType) { propType = pMapper.constructType(((NestedComplexType) type).getOriginalType()); } else { propType = pMapper.constructType(type); } LOGGER.debug("resolveProperty " + propType); Property property = null; if (propType.isContainerType()) { JavaType keyType = propType.getKeyType(); JavaType valueType = propType.getContentType(); if (keyType != null && valueType != null) { property = new MapProperty() .additionalProperties(context.resolveProperty(valueType, new Annotation[] {})); } else if (valueType != null) { ArrayProperty arrayProperty = new ArrayProperty() .items(context.resolveProperty(valueType, new Annotation[] {})); if (pIsSetType(propType.getRawClass())) { arrayProperty.setUniqueItems(true); } property = arrayProperty; } } else { property = PrimitiveType.createProperty(propType); } if (property == null) { if (propType.isEnumType()) { property = new StringProperty(); pAddEnumProps(propType.getRawClass(), property); } else if (pIsOptionalType(propType)) { property = context.resolveProperty(propType.containedType(0), null); } else { Model innerModel = context.resolve(type); if (innerModel instanceof ModelImpl) { ModelImpl mi = (ModelImpl) innerModel; property = new RefProperty( StringUtils.isNotEmpty(mi.getReference()) ? mi.getReference() : mi.getName()); } } } return property; }

Target:
public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> next) { JavaType propType = null; if (type instanceof NestedComplexType) { propType = pMapper.constructType(((NestedComplexType) type).getOriginalType()); } else { propType = pMapper.constructType(type); } log.debug("resolveProperty {}", propType); Property property = null; if (propType.isContainerType()) { JavaType keyType = propType.getKeyType(); JavaType valueType = propType.getContentType(); if (keyType != null && valueType != null) { property = new MapProperty() .additionalProperties(context.resolveProperty(valueType, new Annotation[] {})); } else if (valueType != null) { ArrayProperty arrayProperty = new ArrayProperty() .items(context.resolveProperty(valueType, new Annotation[] {})); if (pIsSetType(propType.getRawClass())) { arrayProperty.setUniqueItems(true); } property = arrayProperty; } } else { property = PrimitiveType.createProperty(propType); } if (property == null) { if (propType.isEnumType()) { property = new StringProperty(); pAddEnumProps(propType.getRawClass(), property); } else if (pIsOptionalType(propType)) { property = context.resolveProperty(propType.containedType(0), null); } else { Model innerModel = context.resolve(type); if (innerModel instanceof ModelImpl) { ModelImpl mi = (ModelImpl) innerModel; property = new RefProperty( StringUtils.isNotEmpty(mi.getReference()) ? mi.getReference() : mi.getName()); } } } return property; }
Source:
public void testEditMarkerSet() { insertContent(); SWTBotRootMenu viewMenu = fViewBot.viewMenu(); List<String> menuItems = viewMenu.menu("Marker Set").menuItems(); assertEquals("number of items", 5, menuItems.size()); assertArrayEquals("menu items, no marker set", MENU_ITEMS_2_MARKERS_SET, menuItems.toArray()); testActiveMarkersSet(viewMenu, new int[] { 0, 1, 2 }); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[1]).click(); testActiveMarkersSet(viewMenu, new int[] { 1, 0, 2 }); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[2]).click(); testActiveMarkersSet(viewMenu, new int[] { 2, 1, 0 }); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[0]).click(); testActiveMarkersSet(viewMenu, new int[] { 0, 1, 2 }); removeContent(); menuItems.clear(); menuItems = viewMenu.menu("Marker Set").menuItems(); assertEquals("number of items", 3, menuItems.size()); assertArrayEquals("menu items, no marker set", MENU_ITEMS_NO_MARKERS_SET, menuItems.toArray()); }

Target:
public void testEditMarkerSet() { insertContent(); SWTBotRootMenu viewMenu = fViewBot.viewMenu(); List<String> menuItems = viewMenu.menu("Marker Set").menuItems(); assertArrayEquals("menu items, 2 marker set", MENU_ITEMS_2_MARKERS_SET, menuItems.toArray()); assertTrue("None is checked", viewMenu.menu("Marker Set").menu(MENU_ITEMS_2_MARKERS_SET[0]).isChecked()); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[1]).click(); assertTrue("None is checked", viewMenu.menu("Marker Set").menu(MENU_ITEMS_2_MARKERS_SET[1]).isChecked()); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[2]).click(); assertTrue("None is checked", viewMenu.menu("Marker Set").menu(MENU_ITEMS_2_MARKERS_SET[2]).isChecked()); viewMenu.menu("Marker Set", MENU_ITEMS_2_MARKERS_SET[0]).click(); assertTrue("None is checked", viewMenu.menu("Marker Set").menu(MENU_ITEMS_2_MARKERS_SET[0]).isChecked()); removeContent(); menuItems = viewMenu.menu("Marker Set").menuItems(); assertArrayEquals("menu items, no marker set", MENU_ITEMS_NO_MARKERS_SET, menuItems.toArray()); }
Source:
public void onDeveloperOptionsSwitchDisabled_shouldDisablePreference() { mController.onDeveloperOptionsSwitchDisabled(); assertThat(mPreference.getSummary()).isFalse(); assertThat(mPreference.getSummary()).isEqualTo( mContext.getString(R.string.angle_enabled_app_not_set)); }

Target:
public void onDeveloperOptionsSwitchDisabled_shouldDisablePreference() { mController.onDeveloperOptionsSwitchDisabled(); assertThat(mPreference.isEnabled()).isFalse(); assertThat(mPreference.getSummary()).isEqualTo( mContext.getString(R.string.angle_enabled_app_not_set)); }
Source:
public void doImport( Input input ) throws IOException { try ( BatchingNeoStores store = instantiateNeoStores( fileSystem, storeDir, externalPageCache, recordFormats, config, logService, additionalInitialIds, dbConfig ); ImportLogic logic = new ImportLogic( storeDir, fileSystem, store, config, logService, executionMonitor, recordFormats, input ) ) { store.createNew(); logic.importNodes(); logic.prepareIdMapper(); logic.importRelationships(); logic.calculateNodeDegrees(); int type = 0; do { type = logic.linkRelationships( type ); } while ( type != -1 ); logic.defragmentRelationshipGroups(); logic.buildCountsStore(); store.success(); } }

Target:
public void doImport( Input input ) throws IOException { try ( BatchingNeoStores store = instantiateNeoStores( fileSystem, storeDir, externalPageCache, recordFormats, config, logService, additionalInitialIds, dbConfig ); ImportLogic logic = new ImportLogic( storeDir, fileSystem, store, config, logService, executionMonitor, recordFormats, input ) ) { store.createNew(); logic.importNodes(); logic.prepareIdMapper(); logic.importRelationships(); logic.calculateNodeDegrees(); logic.linkRelationshipsOfAllTypes(); logic.defragmentRelationshipGroups(); logic.buildCountsStore(); store.success(); } }
Source:
public List<Modification> modificationsSince(GitMaterial material, File baseDir, Revision revision, SubprocessExecutionContext execCtx) { material = material.withShallowClone(isServerSideShallowCloneOn()); return material.withShallowClone(true).modificationsSince(baseDir, revision, execCtx); }

Target:
public List<Modification> modificationsSince(GitMaterial material, File baseDir, Revision revision, SubprocessExecutionContext execCtx) { return toggleShallowCloneFeature(material).modificationsSince(baseDir, revision, execCtx); }
Source:
public T call() throws Exception { hasStarted = true; return callable.call(); }

Target:
public T call() throws Exception { endTime = timeoutInNanos + System.nanoTime(); startedTasks.put(this); return callable.call(); }
Source:
public boolean isValid(Date value) { if (this.configuration.containsKey(AgeValidator.CONFIG_MIN_AGE)) { Calendar calander = Calendar.getInstance(); calander.add(Calendar.YEAR, -((Integer)this.configuration.get(AgeValidator.CONFIG_MIN_AGE))); calander.set(Calendar.MILLISECOND, 1); calander.set(Calendar.SECOND, 0); calander.set(Calendar.MINUTE, 0); calander.set(Calendar.HOUR_OF_DAY, 0); Date minAgeDate = new Date(calander.getTimeInMillis()); if (value.after(minAgeDate)) { return false; } } return true; }

Target:
public boolean isValid(Date value) { if (this.configuration.containsKey(AgeValidator.CONFIG_MIN_AGE)) { Date minAgeDate = new Date(); int year = minAgeDate.getYear(); minAgeDate.setYear(year-(Integer)configuration.get(AgeValidator.CONFIG_MIN_AGE)); minAgeDate.setHours(0); minAgeDate.setMinutes(0); minAgeDate.setSeconds(1); if (value.after(minAgeDate)) { return false; } } return true; }
Source:
public void run(final Server server, final User user, final String label, final String[] args) throws Exception { switch (args.length) { case 0: throw new NotEnoughArgumentsException(); default: final User target = getPlayer(server, args, 0, true, true); final Location logout = target.getLogoutLocation(); if (user.getWorld() != logout.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + logout.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + logout.getWorld().getName())); } user.sendMessage(tl("teleporting", logout.getWorld().getName(), logout.getBlockX(), logout.getBlockY(), logout.getBlockZ())); CompletableFuture<Exception> eFuture = new CompletableFuture<>(); eFuture.thenAccept(e -> showError(user.getBase(), e, label)); user.getAsyncTeleport().now(logout, false, PlayerTeleportEvent.TeleportCause.COMMAND, eFuture, new CompletableFuture<>()); } }

Target:
public void run(final Server server, final User user, final String label, final String[] args) throws Exception { switch (args.length) { case 0: throw new NotEnoughArgumentsException(); default: final User target = getPlayer(server, args, 0, true, true); final Location logout = target.getLogoutLocation(); if (user.getWorld() != logout.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + logout.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + logout.getWorld().getName())); } user.sendMessage(tl("teleporting", logout.getWorld().getName(), logout.getBlockX(), logout.getBlockY(), logout.getBlockZ())); user.getAsyncTeleport().now(logout, false, PlayerTeleportEvent.TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), label)); } }
Source:
public Object status(@PathParam("executionId") String executionId) throws IOException, MessagingException { String error = getError(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (isCompleted(executionId)) { String resURL = String.format("%s/%s", getPath(), executionId); return redirect(resURL); } else { if (isAsync(executionId)) { Serializable taskId = getTaskId(executionId); Object result = getAsyncService(executionId).getStatus(taskId); return ResponseHelper.getResponse(result, request, HttpServletResponse.SC_OK); } else { return Response.status(HttpServletResponse.SC_OK).entity(RUNNING_STATUS).build(); } } }

Target:
public Object status(@PathParam("executionId") String executionId) throws IOException, MessagingException { String error = getError(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (isCompleted(executionId)) { String resURL = String.format("%s/%s", getPath(), executionId); return redirect(resURL); } else { if (isAsync(executionId)) { Serializable taskId = getTaskId(executionId); Object result = getAsyncService(executionId).getStatus(taskId); return ResponseHelper.getResponse(result, request, HttpServletResponse.SC_OK); } else { return Response.status(HttpServletResponse.SC_OK) .entity(MAPPER.writeValueAsString(RUNNING_STATUS)) .build(); } } }
Source:
public void click() { click(false, false, false, 0); }

Target:
public void click() { click(false, false, false, EMPTY_MASK); }
Source:
public @CheckForNull Node getBuiltOn() { Jenkins j = Jenkins.getInstance(); if (builtOn == null || builtOn.isEmpty() || j == null) { return j; } else { return j.getNode(builtOn); } }

Target:
public Node getBuiltOn() { Jenkins j = Jenkins.getInstance(); if (builtOn == null || builtOn.isEmpty() || j == null) { return j; } else { return j.getNode(builtOn); } }
Source:
public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) throws FormException, IOException { super(name, remoteFS, launcher); setNumExecutors(numExecutors); setMode(mode); setLabelString(labelString); setRetentionStrategy(retentionStrategy); setNodeProperties(nodeProperties); this.instanceId = instanceId; this.templateDescription = templateDescription; this.initScript = initScript; this.tmpDir = tmpDir; this.remoteAdmin = remoteAdmin; this.jvmopts = jvmopts; this.stopOnTerminate = stopOnTerminate; this.idleTerminationMinutes = idleTerminationMinutes; this.tags = tags; this.usePrivateDnsName = connectionStrategy == ConnectionStrategy.PRIVATE_DNS; this.useDedicatedTenancy = useDedicatedTenancy; this.cloudName = cloudName; this.launchTimeout = launchTimeout; this.amiType = amiType; this.maxTotalUses = maxTotalUses; readResolve(); try { fetchLiveInstanceData(true, 60); } catch (com.amazonaws.AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to get instance data for new instance " + getInstanceId(), ", terminating"); terminateInstance(); throw e; } }

Target:
public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) throws FormException, IOException { super(name, remoteFS, launcher); setNumExecutors(numExecutors); setMode(mode); setLabelString(labelString); setRetentionStrategy(retentionStrategy); setNodeProperties(nodeProperties); this.instanceId = instanceId; this.templateDescription = templateDescription; this.initScript = initScript; this.tmpDir = tmpDir; this.remoteAdmin = remoteAdmin; this.jvmopts = jvmopts; this.stopOnTerminate = stopOnTerminate; this.idleTerminationMinutes = idleTerminationMinutes; this.tags = tags; this.usePrivateDnsName = connectionStrategy == ConnectionStrategy.PRIVATE_DNS; this.useDedicatedTenancy = useDedicatedTenancy; this.cloudName = cloudName; this.launchTimeout = launchTimeout; this.amiType = amiType; this.maxTotalUses = maxTotalUses; readResolve(); try { fetchLiveInstanceData(true, 60); } catch (com.amazonaws.AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to get instance data for new instance " + getInstanceId() + ", terminating"); terminateInstance(); throw e; } }
Source:
public boolean apply(Server server) { checkNotNull(server, "Server"); server = api.serverApi().get(server.id()); if ((server.status().state() != Types.ServerState.POWERED_OFF && server.status().state() != Types.ServerState.POWERED_ON) || server.status().percent() != 0) { return false; } else { return true; } }

Target:
public boolean apply(Server server) { checkNotNull(server, "Server"); server = api.serverApi().get(server.id()); return !((server.status().state() != Types.ServerState.POWERED_OFF && server.status().state() != Types.ServerState.POWERED_ON) || server.status().percent() != 0); }
Source:
void convertChildNodes( ElementContainer p, DefinitionsBuildingContext context) { List<SubProcessPropertyWriter> subprocesses = context.nodes().map(converterFactory.subProcessConverter()::convertSubProcess) .filter(Result::notIgnored) .map(Result::value) .map(Optional::get) .collect(toList()); Set<String> processed = subprocesses.stream() .flatMap(sub -> sub.getChildElements().stream().map(BasePropertyWriter::getId)) .collect(toSet()); subprocesses.stream() .filter(e -> !processed.contains(e.getId())) .forEach(p::addChildElement); context.nodes() .filter(e -> !processed.contains(e.getUUID())) .map(converterFactory.viewDefinitionConverter()::toFlowElement) .filter(Result::notIgnored) .map(Result::value) .map(Optional::get) .forEach(p::addChildElement); convertLanes(context, processed, p); }

Target:
void convertChildNodes( ElementContainer p, DefinitionsBuildingContext context) { List<SubProcessPropertyWriter> subprocesses = context.nodes().map(converterFactory.subProcessConverter()::convertSubProcess) .filter(Result::notIgnored) .map(Result::value) .collect(toList()); Set<String> processed = subprocesses.stream() .flatMap(sub -> sub.getChildElements().stream().map(BasePropertyWriter::getId)) .collect(toSet()); subprocesses.stream() .filter(e -> !processed.contains(e.getId())) .forEach(p::addChildElement); context.nodes() .filter(e -> !processed.contains(e.getUUID())) .map(converterFactory.viewDefinitionConverter()::toFlowElement) .filter(Result::notIgnored) .map(Result::value) .forEach(p::addChildElement); convertLanes(context, processed, p); }
Source:
public void renameBranchSingleConfigValue() throws Exception { StoredConfig config = git.getRepository().getConfig(); config.setEnum(ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.REBASE); config.save(); String branch = "b1"; assertEquals(BranchRebaseMode.REBASE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); assertEquals(BranchRebaseMode.NONE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branch, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); assertNotNull(git.branchRename().setNewName(branch).call()); config = git.getRepository().getConfig(); assertEquals(BranchRebaseMode.NONE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); assertEquals(BranchRebaseMode.REBASE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branch, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); }

Target:
public void renameBranchSingleConfigValue() throws Exception { StoredConfig config = git.getRepository().getConfig(); config.setEnum(ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.REBASE); config.save(); String branch = "b1"; assertEquals(BranchRebaseMode.REBASE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); assertNull(config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branch, ConfigConstants.CONFIG_KEY_REBASE, null)); assertNotNull(git.branchRename().setNewName(branch).call()); config = git.getRepository().getConfig(); assertNull(config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, null)); assertEquals(BranchRebaseMode.REBASE, config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branch, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE)); }
Source:
private static boolean isOrderByNodeRequired(AbstractParsedStmt parsedStmt, AbstractPlanNode root) { if ( ! parsedStmt.hasOrderByColumns()) { return false; } AbstractPlanNode nonAggPlan; int numberWindowFunctions = 0; int numberReceiveNodes = 0; int numberHashAggregates = 0; AbstractPlanNode probe; for (probe = root; ! ((probe instanceof AbstractJoinPlanNode) || (probe instanceof AbstractScanPlanNode)) && (probe != null); probe = (probe.getChildCount() > 0) ? probe.getChild(0) : null) { if (probe.getPlanNodeType() == PlanNodeType.WINDOWFUNCTION) { numberWindowFunctions += 1; } if (probe.getPlanNodeType() == PlanNodeType.RECEIVE) { numberReceiveNodes += 1; } if ((probe.getPlanNodeType() == PlanNodeType.HASHAGGREGATE) || (probe.getPlanNodeType() == PlanNodeType.PARTIALAGGREGATE)) { numberHashAggregates += 1; } } if (probe != null) { nonAggPlan = probe; } else { nonAggPlan = root; return true; } if (nonAggPlan.getSortOrderFromIndexScan() == SortDirectionType.INVALID) { return true; } if (numberHashAggregates > 0) { return true; } if ( numberWindowFunctions == 0 ) { if ( nonAggPlan.getWindowFunctionUsesIndex() == SubPlanAssembler.NO_INDEX_USE ) { return true; } assert( nonAggPlan.getWindowFunctionUsesIndex() == SubPlanAssembler.STATEMENT_LEVEL_ORDER_BY_INDEX ); return numberReceiveNodes > 0; } else if (numberWindowFunctions == 1) { if ( ( nonAggPlan.getWindowFunctionUsesIndex() != 0 ) || ( ! nonAggPlan.isWindowFunctionCompatibleWithOrderBy() ) ) { return true; } return false; } else { return true; } }

Target:
private static boolean isOrderByNodeRequired(AbstractParsedStmt parsedStmt, AbstractPlanNode root) { if ( ! parsedStmt.hasOrderByColumns()) { return false; } int numberWindowFunctions = 0; int numberReceiveNodes = 0; int numberHashAggregates = 0; AbstractPlanNode probe; for (probe = root; ! ((probe instanceof AbstractJoinPlanNode) || (probe instanceof AbstractScanPlanNode)) && (probe != null); probe = (probe.getChildCount() > 0) ? probe.getChild(0) : null) { if (probe.getPlanNodeType() == PlanNodeType.WINDOWFUNCTION) { numberWindowFunctions += 1; } if (probe.getPlanNodeType() == PlanNodeType.RECEIVE) { numberReceiveNodes += 1; } if ((probe.getPlanNodeType() == PlanNodeType.HASHAGGREGATE) || (probe.getPlanNodeType() == PlanNodeType.PARTIALAGGREGATE)) { numberHashAggregates += 1; } } if (probe == null) { return true; } if ( ! (probe instanceof IndexSortablePlanNode)) { return true; } IndexUseForOrderBy indexUse = ((IndexSortablePlanNode)probe).indexUse(); if (indexUse.getSortOrderFromIndexScan() == SortDirectionType.INVALID) { return true; } if (numberHashAggregates > 0) { return true; } if ( numberWindowFunctions == 0 ) { if ( indexUse.getWindowFunctionUsesIndex() == SubPlanAssembler.NO_INDEX_USE ) { return true; } assert( indexUse.getWindowFunctionUsesIndex() == SubPlanAssembler.STATEMENT_LEVEL_ORDER_BY_INDEX ); return numberReceiveNodes > 0; } if (numberWindowFunctions == 1) { if ( ( indexUse.getWindowFunctionUsesIndex() != 0 ) || ( ! indexUse.isWindowFunctionCompatibleWithOrderBy() ) ) { return true; } return false; } return true; }
Source:
private void updateGameStatusMenuText(PlayerStatus status) { playerStatusFilter = status; if (status == null) { gameStatusMenu.setText(i18n.get("game.gameStatus")); gameStatusToggleGroup.selectToggle(null); return; } String key = switch (status) { case PLAYING -> PLAYING.getI18nKey(); case LOBBYING -> LOBBYING.getI18nKey(); case IDLE -> IDLE.getI18nKey(); default -> throw new ProgrammingError("Uncovered player status: " + status); }; gameStatusMenu.setText(i18n.get(key)); }

Target:
private void updateGameStatusMenuText(PlayerStatus status) { playerStatusFilter = status; if (status == null) { gameStatusMenu.setText(i18n.get("game.gameStatus")); gameStatusToggleGroup.selectToggle(null); return; } gameStatusMenu.setText(i18n.get(status.getI18nKey())); }
Source:
private Runnable createProxyThreadRunnable() { Runnable runnable= () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting runnable " + consumerPollThread.getName()); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); failureCause = throwable; isRunning = false; } if (!isRunning) { LOG.info("Stopping the KafkaConsumerProxy poll thread for system: {}.", systemName); } }; return runnable; }

Target:
private Runnable createProxyThreadRunnable() { Runnable runnable = () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); failureCause = throwable; isRunning = false; } if (!isRunning) { LOG.info("KafkaConsumerProxy for system has stopped.", systemName); } }; return runnable; }
Source:
public boolean hasStudentAsGiverInFeedbackPaths(StudentAttributes student) { if (giverType == FeedbackParticipantType.CUSTOM && recipientType == FeedbackParticipantType.CUSTOM) { for (FeedbackPathAttributes feedbackPath : feedbackPaths) { if (feedbackPath.isStudentFeedbackPathGiver(student)) { return true; } } } return false; }

Target:
public boolean hasStudentAsGiverInFeedbackPaths(StudentAttributes student) { for (FeedbackPathAttributes feedbackPath : feedbackPaths) { if (feedbackPath.isStudentFeedbackPathGiver(student)) { return true; } } return false; }
Source:
private Template getTemplate(String templateName, Theme theme) throws IOException { Configuration cfg = new Configuration(Configuration.VERSION_2_3_26); if (templateName.toLowerCase().endsWith(".ftl")) { cfg.setOutputFormat(HTMLOutputFormat.INSTANCE); } cfg.setTemplateLoader(new ThemeTemplateLoader(theme)); return cfg.getTemplate(templateName, "UTF-8"); }

Target:
private Template getTemplate(String templateName, Theme theme) throws IOException { Configuration cfg = new Configuration(); if (templateName.toLowerCase().endsWith(".ftl")) { cfg.setOutputFormat(HTMLOutputFormat.INSTANCE); } cfg.setTemplateLoader(new ThemeTemplateLoader(theme)); return cfg.getTemplate(templateName, "UTF-8"); }
Source:
private static void toStringBuilder(Iterable iterable, StringBuilder builder) { Iterator<Object> iterator = iterable.iterator(); if (!iterator.hasNext()) { builder.append("[]"); return; } builder.append("["); while (iterator.hasNext()) { toStringBuilder(iterator.next(), builder); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); }

Target:
private static void toStringBuilder(Iterable iterable, StringBuilder builder) { builder.append("["); Iterator<Object> iterator = iterable.iterator(); while (iterator.hasNext()) { toStringBuilder(iterator.next(), builder); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); }
Source:
public void addJobProperties(Job job) { Configuration conf = job.getConfiguration(); for (final Map.Entry<String, String> entry : schema.getTuningConfig().getJobProperties().entrySet()) { conf.set(entry.getKey(), entry.getValue()); } }

Target:
public void addJobProperties(Job job) { addJobProperties(job.getConfiguration()); }
Source:
protected void RunCommands() { SortCommands(); for (final CommandBase<?> command : getCommands()) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { executeValidatedCommand(command); } }); } }

Target:
protected void RunCommands() { SortCommands(); for (final CommandBase<?> command : getCommands()) { if (command.getReturnValue().getCanDoAction()) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { executeValidatedCommand(command); } }); } } }
Source:
public void bindServiceShouldAddServiceConnectionToListOfBoundServiceConnections() { final ShadowApplication shadowApplication = Shadows.shadowOf(RuntimeEnvironment.application); final ServiceConnection expectedServiceConnection = new EmptyServiceConnection(); assertEquals(0, shadowApplication.getBoundServiceConnections().size()); assertTrue(shadowApplication.bindService(new Intent("connect"), expectedServiceConnection, 0)); assertEquals(1, shadowApplication.getBoundServiceConnections().size()); assertSame(expectedServiceConnection, shadowApplication.getBoundServiceConnections().get(0)); }

Target:
public void bindServiceShouldAddServiceConnectionToListOfBoundServiceConnections() { final ShadowApplication shadowApplication = Shadows.shadowOf(RuntimeEnvironment.application); final ServiceConnection expectedServiceConnection = new EmptyServiceConnection(); assertThat(shadowApplication.getBoundServiceConnections()).hasSize(0); assertThat(shadowApplication.bindService(new Intent("connect"), expectedServiceConnection, 0)).isTrue(); assertThat(shadowApplication.getBoundServiceConnections()).hasSize(1); assertThat(shadowApplication.getBoundServiceConnections().get(0)).isSameAs(expectedServiceConnection); }
Source:
private void testCacheConfig(OutputFormat outputFormat, int nodesCnt, int cachesCnt) throws Exception { assert nodesCnt > 0; assert cachesCnt > 0; Ignite ignite = startGrid(nodesCnt); ignite.cluster().active(true); List<CacheConfiguration> ccfgs = new ArrayList<>(cachesCnt); for (int i = 0; i < cachesCnt; i++) { ccfgs.add( new CacheConfiguration<>() .setAffinity(new RendezvousAffinityFunction(false, 32)) .setBackups(1) .setName(DEFAULT_CACHE_NAME + i) ); } ignite.createCaches(ccfgs); IgniteCache<Object, Object> cache1 = ignite.cache(DEFAULT_CACHE_NAME + 0); for (int i = 0; i < 100; i++) cache1.put(i, i); injectTestSystemOut(); int exitCode; if (outputFormat == null) exitCode = execute("--cache", "list", ".*", "--config"); else exitCode = execute("--cache", "list", ".*", "--config", "--output-format", outputFormat.text()); assertEquals(EXIT_CODE_OK, exitCode); String outStr = testOut.toString(); if (outputFormat == null || outputFormat == SINGLE_LINE) { for (int i = 0; i < cachesCnt; i++) assertTrue(outStr.contains("name=" + DEFAULT_CACHE_NAME + i)); assertTrue(outStr.contains("partitions=32")); assertTrue(outStr.contains("function=o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction")); } else if (outputFormat == MULTI_LINE) { for (int i = 0; i < cachesCnt; i++) assertTrue(outStr.contains("[cache = '" + DEFAULT_CACHE_NAME + i + "']")); assertTrue(outStr.contains("Affinity Partitions: 32")); assertTrue(outStr.contains("Affinity Function: o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction")); } }

Target:
private void testCacheConfig(OutputFormat outputFormat, int nodesCnt, int cachesCnt) throws Exception { assertTrue("Invalid number of nodes or caches", nodesCnt > 0 && cachesCnt > 0); Ignite ignite = startGrid(nodesCnt); ignite.cluster().active(true); List<CacheConfiguration> ccfgs = new ArrayList<>(cachesCnt); for (int i = 0; i < cachesCnt; i++) { ccfgs.add( new CacheConfiguration<>() .setAffinity(new RendezvousAffinityFunction(false, 32)) .setBackups(1) .setName(DEFAULT_CACHE_NAME + i) ); } ignite.createCaches(ccfgs); IgniteCache<Object, Object> cache1 = ignite.cache(DEFAULT_CACHE_NAME + 0); for (int i = 0; i < 100; i++) cache1.put(i, i); injectTestSystemOut(); int exitCode; if (outputFormat == null) exitCode = execute("--cache", "list", ".*", "--config"); else exitCode = execute("--cache", "list", ".*", "--config", "--output-format", outputFormat.text()); assertEquals(EXIT_CODE_OK, exitCode); String outStr = testOut.toString(); if (outputFormat == null || outputFormat == SINGLE_LINE) { for (int i = 0; i < cachesCnt; i++) assertTrue(outStr.contains("name=" + DEFAULT_CACHE_NAME + i)); assertTrue(outStr.contains("partitions=32")); assertTrue(outStr.contains("function=o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction")); } else if (outputFormat == MULTI_LINE) { for (int i = 0; i < cachesCnt; i++) assertTrue(outStr.contains("[cache = '" + DEFAULT_CACHE_NAME + i + "']")); assertTrue(outStr.contains("Affinity Partitions: 32")); assertTrue(outStr.contains("Affinity Function: o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction")); } }
Source:
public ModuleDeploymentStatus(String container, ModuleDescriptor.Key key, Map<String,String> map) { this.container = container; this.key = key; Assert.state(map.containsKey(STATUS_KEY)); this.state = State.valueOf(map.get(STATUS_KEY)); this.errorDescription = map.get(ERROR_DESCRIPTION_KEY); }

Target:
public ModuleDeploymentStatus(String container, ModuleDescriptor.Key key, Map<String,String> map) { this.container = container; this.key = key; Assert.state(map.containsKey(STATUS_KEY), String.format("missing key '%s' from map; contents: %s", STATUS_KEY, map)); this.state = State.valueOf(map.get(STATUS_KEY)); this.errorDescription = map.get(ERROR_DESCRIPTION_KEY); }
Source:
public final GenericType<?> getComponentType() { return new GenericType(token.getComponentType()); }

Target:
public final GenericType<?> getComponentType() { TypeToken<?> componentTypeToken = token.getComponentType(); return (componentTypeToken == null) ? null : new GenericType(componentTypeToken); }
Source:
public Destination getJMSReplyTo() throws JMSException { if (replyTo == null) { SimpleString address = MessageUtil.getJMSReplyTo(message); if (address != null) { String name = address.toString(); if (session.isEnable1xPrefixes()) { if (address.startsWith(OLD_QUEUE_QUALIFIED_PREFIX)) { name = address.subSeq(OLD_QUEUE_QUALIFIED_PREFIX.length(), address.length()).toString(); } else if (address.startsWith(OLD_TEMP_QUEUE_QUALIFED_PREFIX)) { name = address.subSeq(OLD_TEMP_QUEUE_QUALIFED_PREFIX.length(), address.length()).toString(); } else if (address.startsWith(OLD_TOPIC_QUALIFIED_PREFIX)) { name = address.subSeq(OLD_TOPIC_QUALIFIED_PREFIX.length(), address.length()).toString(); } else if (address.startsWith(OLD_TEMP_TOPIC_QUALIFED_PREFIX)) { name = address.subSeq(OLD_TEMP_TOPIC_QUALIFED_PREFIX.length(), address.length()).toString(); } } replyTo = ActiveMQDestination.fromPrefixedName(address.toString(), name); } } return replyTo; }

Target:
public Destination getJMSReplyTo() throws JMSException { if (replyTo == null) { SimpleString repl = MessageUtil.getJMSReplyTo(message); if (repl != null) { replyTo = ActiveMQDestination.fromPrefixedName(repl.toString()); } } return replyTo; }
Source:
public Pair<Long, Long> getTxAt(long ts) throws IOException { long closestTS = Long.MAX_VALUE, closestTx = -1; Pair<Long, Long> before, after; for(byte i = 0; i < SIConstants.TRANSACTION_TABLE_BUCKET_COUNT; ++i) { before = first(i); if(before == null ) { continue; } if(before.getSecond() > ts) { if(LOG.isTraceEnabled()) SpliceLogUtils.trace(LOG,"in bucket %d the first txn [%s (TS: %s), id %s] happened after the needle (%s) exiting!", (int)i, TxnUtils.rowKeytoHbaseEscaped(toRowKeyWithBucket(before.getFirst(), i)), new Timestamp(before.getSecond()).toString(), before.getFirst().toString(), new Timestamp(ts).toString()); return new Pair<>(slideToNextTx(closestTx), closestTS); } after = last(i); if(after.getSecond() < ts) { if(LOG.isTraceEnabled()) SpliceLogUtils.trace(LOG,"in bucket %d the last txn [%s (TS: %s), id %s] happened before the needle (%s) exiting!", (int)i, TxnUtils.rowKeytoHbaseEscaped(toRowKeyWithBucket(after.getFirst(), i)), new Timestamp(after.getSecond()).toString(), after.getFirst().toString(), new Timestamp(ts).toString()); return new Pair<>(slideToNextTx(after.getFirst()), after.getSecond()); } Pair<Long, Long> seachResults = bsearch(ts, i, toRowKeyWithBucket(before.getFirst(), i), before.getSecond(), toRowKeyWithBucket(after.getFirst(), i), after.getSecond()); if(seachResults == null) { continue; } if(Math.abs(seachResults.getSecond() - ts)< Math.abs(closestTS)) { closestTx = seachResults.getFirst(); closestTS = seachResults.getSecond(); } } return new Pair<>(slideToNextTx(closestTx), closestTS); }

Target:
public Pair<Long, Long> getTxAt(long ts) throws IOException { long closestTS = Long.MAX_VALUE, closestTx = -1; Pair<Long, Long> before, after; for(byte i = 0; i < SIConstants.TRANSACTION_TABLE_BUCKET_COUNT; ++i) { before = first(i); if(before == null ) { continue; } if(before.getSecond() > ts) { if(LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG,"in bucket %d the first txn [%s (TS: %s), id %s] happened after the needle (%s) exiting!", (int)i, TxnUtils.rowKeytoHbaseEscaped(toRowKeyWithBucket(before.getFirst(), i)), new Timestamp(before.getSecond()).toString(), before.getFirst().toString(), new Timestamp(ts).toString()); return new Pair<>(slideToNextTx(closestTx), closestTS); } after = last(i); if(after.getSecond() < ts) { if(LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG,"in bucket %d the last txn [%s (TS: %s), id %s] happened before the needle (%s) exiting!", (int)i, TxnUtils.rowKeytoHbaseEscaped(toRowKeyWithBucket(after.getFirst(), i)), new Timestamp(after.getSecond()).toString(), after.getFirst().toString(), new Timestamp(ts).toString()); return new Pair<>(slideToNextTx(after.getFirst()), after.getSecond()); } Pair<Long, Long> seachResults = bsearch(ts, i, toRowKeyWithBucket(before.getFirst(), i), before.getSecond(), toRowKeyWithBucket(after.getFirst(), i), after.getSecond()); if(seachResults == null) { continue; } if(Math.abs(seachResults.getSecond() - ts)< Math.abs(closestTS)) { closestTx = seachResults.getFirst(); closestTS = seachResults.getSecond(); } } return new Pair<>(slideToNextTx(closestTx), closestTS); }
Source:
public String getBranchNameSuggestion() { ITask task = getCurrentTask(); if (task == null) return null; String taskKey = task.getTaskKey(); if (taskKey == null) taskKey = task.getTaskId(); StringBuilder sb = new StringBuilder(); sb.append(TasksUiInternal.getTaskPrefix(task.getConnectorKind())); sb.append(taskKey); sb.append("-"); sb.append(task.getSummary()); return normalizeBranchName(sb.toString()); }

Target:
public String getBranchNameSuggestion() { ITask task = getCurrentTask(); if (task == null) return null; String taskKey = task.getTaskKey(); if (taskKey == null) taskKey = task.getTaskId(); StringBuilder sb = new StringBuilder(); sb.append(TasksUiInternal.getTaskPrefix(task.getConnectorKind())); sb.append(taskKey); sb.append('-'); sb.append(task.getSummary()); return normalizeBranchName(sb.toString()); }
Source:
private Set<UpdateSite.Warning> getActiveWarnings() { ExtensionList<UpdateSiteWarningsConfiguration> configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); if (configurations.isEmpty()) { return Collections.emptySet(); } UpdateSiteWarningsConfiguration configuration = configurations.get(0); HashSet<UpdateSite.Warning> warnings = new HashSet<>(configuration.getApplicableWarnings()); for (Iterator<UpdateSite.Warning> it = warnings.iterator(); it.hasNext(); ) { UpdateSite.Warning warning = it.next(); if (configuration.getIgnoredWarnings().contains(warning.id)) { it.remove(); } } return Collections.unmodifiableSet(warnings); }

Target:
private Set<UpdateSite.Warning> getActiveWarnings() { ExtensionList<UpdateSiteWarningsConfiguration> configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); if (configurations.isEmpty()) { return Collections.emptySet(); } UpdateSiteWarningsConfiguration configuration = configurations.get(0); HashSet<UpdateSite.Warning> activeWarnings = new HashSet<>(); for (UpdateSite.Warning warning : configuration.getApplicableWarnings()) { if (!configuration.getIgnoredWarnings().contains(warning.id)) { activeWarnings.add(warning); } } return Collections.unmodifiableSet(activeWarnings); }