auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Mono<RxDocumentServiceRequest> populateAuthorizationHeader(RxDocumentServiceRequest request, SimpleTokenCache simpleTokenCache) { if (request == null) { return Mono.error(new IllegalArgumentException("request")); } if (simpleTokenCache == null) { return Mono.error(new IllegalArgumentException("simpleTokenCache")); } return simpleTokenCache.getToken() .map(accessToken -> { String authorization = String.format(AAD_AUTH_TOKEN_FORMAT, AAD_AUTH_SCHEMA_TYPE_SEGMENT, AAD_AUTH_SCHEMA_TYPE_VALUE, AAD_AUTH_VERSION_SEGMENT, AAD_AUTH_VERSION_VALUE, AAD_AUTH_SIGNATURE_SEGMENT, accessToken.getToken()); try { authorization = URLEncoder.encode(authorization, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode authorization token.", e); } request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION, authorization); return request; }); }

Target:
if (request == null || request.getHeaders() == null) { throw new IllegalArgumentException("request"); } if (simpleTokenCache == null) { throw new IllegalArgumentException("simpleTokenCache"); } return getAuthorizationToken(simpleTokenCache) .map(authorization -> { request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION, authorization); return request; }); }
Source:
public void simple() throws Exception { final XsltTransformTest.SavingBillBoard board = new XsltTransformTest.SavingBillBoard(); new XsltTransform( StringUtils.join( "<?xml version=\"1.0\"?>", "<xsl:stylesheet xmlns:xsl=\"<LINK_0>\" version=\"1.0\">", "<xsl:template match=\"/body\">", "<test><xsl:value-of select=\"value\"/></test>", "</xsl:template>", "</xsl:stylesheet>" ), board ).announce("<body><value>Text</value></body>"); MatcherAssert .assertThat(board.getData(), Matchers.equalTo("<test>Text</test>")); }

Target:
public void simple() throws Exception { final Billboard board = Mockito.mock(Billboard.class); new XsltTransform( StringUtils.join( "<?xml version=\"1.0\"?>", "<xsl:stylesheet xmlns:xsl=\"<LINK_0>\" version=\"1.0\">", "<xsl:template match=\"/body\">", "<test><xsl:value-of select=\"value\"/></test>", "</xsl:template>", "</xsl:stylesheet>" ), board ).announce("<body><value>Text</value></body>"); Mockito.verify(board).announce(Mockito.eq("<test>Text</test>")); }
Source:
public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice display = context.get(DisplayDevice.class); boolean isHeadless = display.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless)) { if(registerInfo.requiresOptional().length != 0){ for(String s : registerInfo.requiresOptional()){ if(environment.get(new Name(s))!=null)systemsByModule.put(moduleId, type); } } else { systemsByModule.put(moduleId, type); } } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (RuntimeException | IllegalAccessException | InstantiationException | NoClassDefFoundError e) { logger.error("Failed to load system {}", id, e); } } } }

Target:
public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice display = context.get(DisplayDevice.class); boolean isHeadless = display.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless) && areOptionalRequirementsContained(registerInfo,environment)) { systemsByModule.put(moduleId, type); } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (RuntimeException | IllegalAccessException | InstantiationException | NoClassDefFoundError e) { logger.error("Failed to load system {}", id, e); } } } }
Source:
private void closeAggregationBuilder() { outputIterator = null; if (aggregationBuilder != null) { aggregationBuilder.recordHashCollisions(hashCollisionsCounter); aggregationBuilder.close(); aggregationBuilder = null; } localUserMemoryContext.setBytes(0); localRevocableMemoryContext.setBytes(0); }

Target:
private void closeAggregationBuilder() { outputIterator = null; if (aggregationBuilder != null) { aggregationBuilder.recordHashCollisions(hashCollisionsCounter); aggregationBuilder.close(); aggregationBuilder = null; } operatorContext.localUserMemoryContext().setBytes(0); operatorContext.localRevocableMemoryContext().setBytes(0); }
Source:
private boolean isAuthorized(String email, String password) { String liferayParameterURL = "/api/jsonws/user/get-user-id-by-email-address?companyId=%s&emailAddress=%s"; String url = sw360PortalServerURL + String.format(liferayParameterURL, sw360LiferayCompanyId, email); RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); String encodedPassword; try { encodedPassword = URLDecoder.decode(password, "US-ASCII"); } catch (UnsupportedEncodingException e) { return false; } RestTemplate restTemplate = restTemplateBuilder.basicAuthorization(email, encodedPassword).build(); ResponseEntity<String> response = restTemplate.postForEntity(url, null, String.class); return (parseInteger(response.getBody()) > 0); }

Target:
private boolean isAuthorized(String email, String password) { String liferayParameterURL = "/api/jsonws/user/get-user-id-by-email-address?companyId=%s&emailAddress=%s"; String url = sw360PortalServerURL + String.format(liferayParameterURL, sw360LiferayCompanyId, email); RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); String encodedPassword; try { encodedPassword = URLDecoder.decode(password, "US-ASCII"); } catch (UnsupportedEncodingException e) { return false; } RestTemplate restTemplate = restTemplateBuilder.basicAuthorization(email, encodedPassword).build(); ResponseEntity<String> response = restTemplate.postForEntity(url, null, String.class); try { Integer.parseInt(response.getBody()); } catch (NumberFormatException e) { return false; } return true; }
Source:
public void fetchPurchaseRequest() { new FirebaseCollection<>(Constants.PURCHASE_REQUEST + "/" + userId, PurchaseRequest.class).getAll(new DataCallback<List<PurchaseRequest>>() { @Override public void onSuccess(List<PurchaseRequest> data) { for (PurchaseRequest purchaseRequest : data) { if (!purchaseRequest.getReceiver().equals(userId)) purchaseList.add(purchaseRequest); } purchaseRequestHistoryAdapter.notifyDataSetChanged(); } @Override public void onError(String errorMessage) { } }); }

Target:
public void fetchPurchaseRequest() { new FirebaseCollection<>(Constants.PURCHASE_REQUEST + "/" + userId, PurchaseRequest.class) .getAll(new DataCallback<List<PurchaseRequest>>() { @Override public void onSuccess(List<PurchaseRequest> data) { for (PurchaseRequest purchaseRequest : data) { if (!purchaseRequest.getReceiver().equals(userId)) addRequest(purchaseRequest); } purchaseRequestHistoryAdapter.notifyDataSetChanged(); } @Override public void onError(String errorMessage) { } }); }
Source:
private static void validateMigrationStates( Resource resource) throws InvalidReferenceException { if (resource == null) throw new ArgumentNullException("resource"); List<Migration> migrations = resource.getMigrations(); List<State> states = resource.getStates(); for (Migration m : migrations ) { boolean migrationToStateValid = false; boolean migrationFromStateValid = false; if (!m.getToState().isPresent()) { migrationToStateValid = true; } if (!m.getFromState().isPresent()) { migrationFromStateValid = true; } for (State s : states ) { if (m.getToState().equals(s.getStateId()) || m.getToState().equals(s.getLabel())) { migrationToStateValid = true; } if (m.getFromState().equals(s.getStateId()) || m.getFromState().equals(s.getLabel())) { migrationFromStateValid = true; } if (migrationFromStateValid && migrationToStateValid) { break; } } if (!migrationFromStateValid) { throw new InvalidReferenceException ( STATE, m.getFromState().get(), m.getApplicableTypes().toString(), m.getMigrationId().toString() ); } else if (!migrationToStateValid) { throw new InvalidReferenceException ( STATE, m.getToState().get(), m.getApplicableTypes().toString(), m.getMigrationId().toString() ); } } }

Target:
private static void validateMigrationStates( Resource resource) throws MigrationNotPossibleException, InvalidReferenceException { if (resource == null) throw new ArgumentNullException("resource"); List<Migration> migrations = resource.getMigrations(); List<State> states = resource.getStates(); for (Migration m : migrations) { if (!m.getFromState().isPresent() && !m.getToState().isPresent()) { throw new MigrationNotPossibleException(); } boolean fromIsValid = !m.getFromState().isPresent(); boolean toIsValid = !m.getToState().isPresent(); for (State s : states) { fromIsValid |= WildebeestApiImpl.stateEquals(m.getFromState(), s); toIsValid |= WildebeestApiImpl.stateEquals(m.getToState(), s); if (fromIsValid && toIsValid) { break; } } if (!fromIsValid && !toIsValid) { throw InvalidReferenceException.twoReferences( EntityType.State, m.getFromState().get(), EntityType.State, m.getToState().get(), EntityType.Migration, m.getMigrationId().toString()); } if (!fromIsValid) { throw InvalidReferenceException.oneReference( EntityType.State, m.getFromState().get(), EntityType.Migration, m.getMigrationId().toString()); } else if (!toIsValid) { throw InvalidReferenceException.oneReference( EntityType.State, m.getToState().get(), EntityType.Migration, m.getMigrationId().toString()); } } }
Source:
protected void removeTlsCertificateProvider(TlsCertificateProvider tlsCertificateProvider) { removeLinkedTrustManager(tlsCertificateProvider.getHostName(), mappingFromTlsCertificateProvider.get(tlsCertificateProvider)); }

Target:
protected void removeTlsCertificateProvider(TlsCertificateProvider tlsCertificateProvider) { removeLinkedTrustManager(tlsCertificateProvider.getHostName(), mappingFromTlsCertificateProvider.remove(tlsCertificateProvider)); }
Source:
private void setEntities(WeightedTable<EntitySnapshot> entities) { checkNotNull(entities).forEach(Preconditions::checkNotNull); this.entities = entities; }

Target:
private void setEntities(WeightedTable<EntitySnapshot> entities) { checkNotNull(entities); this.entities.clear(); this.entities.addAll(entities); }
Source:
private JsonNode findNodeByName(ArrayNode parentNode, String searchName, String parentNodeName) throws DevfileFormatException { return StreamSupport.stream(parentNode.spliterator(), false) .filter(node -> node.path("name").asText().equals(searchName)) .findFirst() .orElseThrow( () -> new DevfileFormatException( format( "Cannot apply override: object with name '%s' not found in array of %s.", searchName, parentNodeName))); }

Target:
private JsonNode findNodeByName(ArrayNode parentNode, String searchName, String parentNodeName) throws OverrideParameterException { return StreamSupport.stream(parentNode.spliterator(), false) .filter(node -> node.path("name").asText().equals(searchName)) .findFirst() .orElseThrow( () -> new OverrideParameterException( format( "Cannot apply override: object with name '%s' not found in array of %s.", searchName, parentNodeName))); }
Source:
private void manageToolbarSizes() { int width = getOffsetWidth(); if (width == 0) return; texToolbarButton_.setText(width < 520 ? "" : "Format"); runButton_.setText(((width < 480) || isShinyFile()) ? "" : "Run"); compilePdfButton_.setText(width < 450 ? "" : "Compile PDF"); previewHTMLButton_.setText(width < 450 ? "" : previewCommandText_); knitDocumentButton_.setText(width < 450 ? "" : knitCommandText_); if (editor_.getFileType().isRd() || editor_.getFileType().isJS() || editor_.getFileType().isSql()) { String preview = editor_.getFileType().getPreviewButtonText(); srcOnSaveLabel_.setText(width < 450 ? preview : preview + " on Save"); } else if (hasCustomSource()) { srcOnSaveLabel_.setText(width < 450 ? "Function" : "Function on Save"); } else { srcOnSaveLabel_.setText(width < 450 ? "Source" : "Source on Save"); } sourceButton_.setText(width < 400 ? "" : sourceCommandText_); }

Target:
private void manageToolbarSizes() { int width = getOffsetWidth(); if (width == 0) return; texToolbarButton_.setText(width < 520 ? "" : "Format"); runButton_.setText(((width < 480) || isShinyFile()) ? "" : "Run"); compilePdfButton_.setText(width < 450 ? "" : "Compile PDF"); previewHTMLButton_.setText(width < 450 ? "" : previewCommandText_); knitDocumentButton_.setText(width < 450 ? "" : knitCommandText_); if (editor_.getFileType().isRd() || editor_.getFileType().isJS() || editor_.getFileType().isSql() || editor_.getFileType().canPreviewFromR()) { String preview = editor_.getFileType().getPreviewButtonText(); srcOnSaveLabel_.setText(width < 450 ? preview : preview + " on Save"); } else { srcOnSaveLabel_.setText(width < 450 ? "Source" : "Source on Save"); } sourceButton_.setText(width < 400 ? "" : sourceCommandText_); }
Source:
private String verifyURL() { new PushButton(VERIFY_BUTTON).click(); Text labeledText = new LabeledText(REMOTE_CATALOG_SHELL); String text = labeledText.getText(); if (text.equals(EMPTY_CATALOG_MESSAGE)) { throw new IllegalArgumentException(EMPTY_CATALOG_EXCEPTION); } return text; }

Target:
protected String verifyURL() { new PushButton(VERIFY_BUTTON).click(); new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL); Text labeledText = new LabeledText(REMOTE_CATALOG_SHELL); String text = labeledText.getText(); return text; }
Source:
private static List<OutputInfo> outputInfoList(List<OutputStats> outputStatsList) { List<OutputInfo> outputInfoList = new ArrayList<OutputInfo>(); if (outputStatsList == null) { return outputInfoList; } for (OutputStats inputStats : outputStatsList) { outputInfoList.add(new PigOutputInfo(inputStats)); } return outputInfoList; }

Target:
private static List<OutputInfo> outputInfoList(List<OutputStats> outputStatsList) { List<OutputInfo> outputInfoList = new ArrayList<OutputInfo>(); if (outputStatsList == null) { return outputInfoList; } for (OutputStats outputStats : outputStatsList) { outputInfoList.add(new PigOutputInfo(outputStats)); } return outputInfoList; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.save_credentials_layout); if (!getIntent().getBooleanExtra(ExtraConstants.EXTRA_SMARTLOCK_ENABLED, true)) { finish(RESULT_OK, getIntent()); return; } if (!FirebaseAuthWrapperFactory.getFirebaseAuthWrapper(mActivityHelper.getAppName()) .isPlayServicesAvailable(this)) { finish(RESULT_FIRST_USER, getIntent()); return; } mName = getIntent().getStringExtra(ExtraConstants.EXTRA_NAME); mEmail = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); mPassword = getIntent().getStringExtra(ExtraConstants.EXTRA_PASSWORD); mProvider = getIntent().getStringExtra(ExtraConstants.EXTRA_PROVIDER); mProfilePictureUri = getIntent() .getStringExtra(ExtraConstants.EXTRA_PROFILE_PICTURE_URI); mCredentialsApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .build(); mCredentialsApiClient.connect(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.save_credentials_layout); if (!FirebaseAuthWrapperFactory.getFirebaseAuthWrapper(mActivityHelper.getAppName()) .isPlayServicesAvailable(this)) { finish(RESULT_FIRST_USER, getIntent()); return; } mName = getIntent().getStringExtra(ExtraConstants.EXTRA_NAME); mEmail = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); mPassword = getIntent().getStringExtra(ExtraConstants.EXTRA_PASSWORD); mProvider = getIntent().getStringExtra(ExtraConstants.EXTRA_PROVIDER); mProfilePictureUri = getIntent() .getStringExtra(ExtraConstants.EXTRA_PROFILE_PICTURE_URI); mCredentialsApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .build(); mCredentialsApiClient.connect(); }
Source:
private void createExtensionDirectory(String coordinate, File atLocation) { if (atLocation.exists()) { log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath()); return; } if (!atLocation.mkdir()) { throw new RuntimeException( String.format( "Unable to create directory at [%s] for coordinate [%s]", atLocation.getAbsolutePath(), coordinate ) ); } }

Target:
private void createExtensionDirectory(String coordinate, File atLocation) { if (atLocation.isDirectory()) { log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath()); return; } if (!atLocation.mkdir()) { throw new ISE( String.format( "Unable to create directory at [%s] for coordinate [%s]", atLocation.getAbsolutePath(), coordinate ) ); } }
Source:
public Subscriber<? super T> call(final Subscriber<? super Boolean> child) { final SingleDelayedProducer<Boolean> producer = new SingleDelayedProducer<Boolean>(child); Subscriber<T> s = new Subscriber<T>() { boolean done; @Override public void onNext(T t) { Boolean result; try { result = predicate.call(t); } catch (Throwable e) { Exceptions.throwOrReport(e, this, t); return; } if (!result && !done) { done = true; producer.setValue(false); unsubscribe(); } } @Override public void onError(Throwable e) { if (!done) { done = true; child.onError(e); } } @Override public void onCompleted() { if (!done) { done = true; producer.setValue(true); } } }; child.add(s); child.setProducer(producer); return s; }

Target:
public Subscriber<? super T> call(final Subscriber<? super Boolean> child) { final SingleDelayedProducer<Boolean> producer = new SingleDelayedProducer<Boolean>(child); Subscriber<T> s = new Subscriber<T>() { boolean done; @Override public void onNext(T t) { if (done) { return; } Boolean result; try { result = predicate.call(t); } catch (Throwable e) { Exceptions.throwOrReport(e, this, t); return; } if (!result) { done = true; producer.setValue(false); unsubscribe(); } } @Override public void onError(Throwable e) { if (!done) { done = true; child.onError(e); } else { RxJavaHooks.onError(e); } } @Override public void onCompleted() { if (!done) { done = true; producer.setValue(true); } } }; child.add(s); child.setProducer(producer); return s; }
Source:
public void extraSweepersGiveUpAfterFailingToAcquireEnoughTimes() throws InterruptedException { int shards = 8; int sweepers = 2; int threads = shards / sweepers + 1; LockService stickyLockService = createStickyLockService(); createAndInitializeSweepersAndWaitForOneBackgroundIteration(sweepers, shards, threads, stickyLockService); ArgumentCaptor<LockRequest> captor = ArgumentCaptor.forClass(LockRequest.class); verify(stickyLockService, atLeast(2 * shards - shards / sweepers + 2 * shards)) .lock(eq(LockClient.ANONYMOUS.getClientId()), any(LockRequest.class)); verify(stickyLockService, atMost(2 * shards - 1 + 2 * shards)) .lock(eq(LockClient.ANONYMOUS.getClientId()), captor.capture()); Set<String> requestedLockIds = captor.getAllValues().stream() .map(LockRequest::getLocks) .map(list -> list.get(0)) .map(LockWithMode::getLockDescriptor) .map(LockDescriptor::getLockIdAsString) .collect(Collectors.toSet()); Set<String> expectedLockIds = IntStream.range(0, shards).boxed() .map(ShardAndStrategy::conservative) .map(ShardAndStrategy::toText) .collect(Collectors.toSet()); assertThat(requestedLockIds).hasSameElementsAs(expectedLockIds); }

Target:
public void extraSweepersGiveUpAfterFailingToAcquireEnoughTimes() throws InterruptedException { int shards = 16; int sweepers = 4; int threads = shards / (sweepers / 2); TimelockService stickyLockService = createStickyLockService(); createAndInitializeSweepersAndWaitForOneBackgroundIteration(sweepers, shards, threads, stickyLockService); ArgumentCaptor<LockRequest> captor = ArgumentCaptor.forClass(LockRequest.class); verify(stickyLockService, atLeast(shards * (shards / threads + 1) / 2 + shards * (threads * sweepers - shards))) .lock(any(LockRequest.class)); verify(stickyLockService, atMost(shards * ((threads + 1) * sweepers - shards) - sweepers * (sweepers - 1) / 2)) .lock(captor.capture()); Set<String> requestedLockIds = captor.getAllValues().stream() .map(LockRequest::getLockDescriptors) .map(Iterables::getOnlyElement) .map(LockDescriptor::getLockIdAsString) .collect(Collectors.toSet()); Set<String> expectedLockIds = IntStream.range(0, shards).boxed() .map(ShardAndStrategy::conservative) .map(ShardAndStrategy::toText) .collect(Collectors.toSet()); assertThat(requestedLockIds).hasSameElementsAs(expectedLockIds); }
Source:
protected Builder() { super(B2Api.class); id("b2") .name("Backblaze B2 API") .identityName("Access Key ID") .credentialName("Secret Access Key") .documentation(URI.create("<LINK_0>")) .defaultEndpoint("<LINK_1>") .defaultProperties(B2ApiMetadata.defaultProperties()) .view(typeToken(BlobStoreContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( B2HttpApiModule.class)); }

Target:
protected Builder() { super(B2Api.class); id("b2") .name("Backblaze B2 API") .identityName("Account Id") .credentialName("Application Key") .documentation(URI.create("<LINK_0>")) .defaultEndpoint("<LINK_1>") .defaultProperties(B2ApiMetadata.defaultProperties()) .view(typeToken(BlobStoreContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( B2HttpApiModule.class)); }
Source:
public void boxedLong() { @Indexed(index = INDEX_NAME) class IndexedEntity { Long id; @DocumentId public Long getId() { return id; } } doTestBridge( IndexedEntity.class, id -> { IndexedEntity entity = new IndexedEntity(); entity.id = id; return entity; }, 73l, "73" ); }

Target:
public void boxedLong() { @Indexed(index = INDEX_NAME) class IndexedEntity { Long id; @DocumentId public Long getId() { return id; } } doTestBridge( IndexedEntity.class, id -> { IndexedEntity entity = new IndexedEntity(); entity.id = id; return entity; }, 73L, "73" ); }
Source:
public Map<SystemStreamPartition, List<String>> readTaskPartitionAssignments() { try { Map<SystemStreamPartition, List<String>> sspToTaskNamesMap = new HashMap<>(); Map<String, byte[]> allMetadataEntries = metadataStore.all(); for (Map.Entry<String, byte[]> entry : allMetadataEntries.entrySet()) { LOG.info("Trying to deserialize the system stream partition: {}", entry.getKey()); SystemStreamPartition systemStreamPartition = getSystemStreamPartition(entry.getKey()); String taskNameAsJson = valueSerde.fromBytes(entry.getValue()); List<String> taskNames = taskNameMapper.readValue(taskNameAsJson, new TypeReference<List<String>>() { }); sspToTaskNamesMap.put(systemStreamPartition, taskNames); } return sspToTaskNamesMap; } catch (Exception e) { throw new SamzaException("Exception occurred when reading task partition assignments.", e); } }

Target:
public Map<SystemStreamPartition, List<String>> readTaskPartitionAssignments() { try { Map<SystemStreamPartition, List<String>> sspToTaskNamesMap = new HashMap<>(); Map<String, byte[]> allMetadataEntries = metadataStore.all(); for (Map.Entry<String, byte[]> entry : allMetadataEntries.entrySet()) { SystemStreamPartition systemStreamPartition = deserializeSSPFromJson(entry.getKey()); String taskNamesAsJson = valueSerde.fromBytes(entry.getValue()); List<String> taskNames = taskNamesMapper.readValue(taskNamesAsJson, new TypeReference<List<String>>() { }); sspToTaskNamesMap.put(systemStreamPartition, taskNames); } return sspToTaskNamesMap; } catch (Exception e) { throw new SamzaException("Exception occurred when reading task partition assignments.", e); } }
Source:
public void postProcess(ServerResponse response) { HttpSession httpSession = getCurrentSession(false); if (!current.get(MetaData.class).hasKey("async") || (!(Boolean.TRUE.equals((Boolean) current.get(MetaData.class).get("async"))))) { httpSession.setAttribute("async", false); } sessionHelper.clean(); }

Target:
public void postProcess(ServerResponse response) { if (current.get(MetaData.class).hasKey("async") && Boolean.TRUE.equals((Boolean) current.get(MetaData.class).get("async"))) { SessionUtils.getCurrentHttpServletRequest().setAttribute("ovirt_aaa_async", true); } sessionHelper.clean(); }
Source:
public void changeDictionary(Dictionary oldDictionary, Dictionary newDictionary, boolean externalize) { final List<Dictionary> dictionaries = _userPreferences.getUserDictionaries(); if (dictionaries.remove(oldDictionary)) { if (externalize) { _configurationWriter.removeDictionary(oldDictionary.getName()); _userPreferences.save(); } } addDictionaryHelper(newDictionary, externalize); for(ReferenceDataChangeListener<Dictionary> listener : _dictionaryV2Listeners){ listener.onChange(oldDictionary, newDictionary); } }

Target:
public void changeDictionary(Dictionary oldDictionary, Dictionary newDictionary, boolean externalize) { final List<Dictionary> dictionaries = _userPreferences.getUserDictionaries(); if (dictionaries.remove(oldDictionary)) { if (externalize) { _configurationWriter.removeDictionary(oldDictionary.getName()); _userPreferences.save(); } } addDictionaryInternal(newDictionary, externalize); for(ReferenceDataChangeListener<Dictionary> listener : _dictionaryChangeListeners){ listener.onChange(oldDictionary, newDictionary); } for (DictionaryChangeListener listener : _dictionaryListeners) { listener.onRemove(oldDictionary); listener.onAdd(newDictionary); } }
Source:
public String getContainer() { return container; }

Target:
public String getContainer() { return parent2; }
Source:
public void entityReference(String entity) { throw new UnsupportedOperationException("Builder does not currently support entity references."); }

Target:
public void entityReference(String entity) { throw new UnsupportedOperationException(); }
Source:
public void setMaxBufferSize(final int size) { ArgumentVerifier.assertNotNegative(size, "size"); maxBufferSize = size; }

Target:
public void setMaxBufferSize(final int size) { ArgumentVerifier.assertGreaterThanZero(size, "size"); maxBufferSize = size; }
Source:
@Bean PaProgDataProcessor paProgrammeProcessor() { return new PaProgrammeProcessor(contentWriter, contentBuffer(), log, new PaTagMap(topicStore, new MongoSequentialIdGenerator(mongo, "topics"))); }

Target:
@Bean PaProgDataProcessor paProgrammeProcessor() { return new PaProgrammeProcessor(contentWriter, contentBuffer(), log, paTagMap); }
Source:
public void checkSourceType(CommandSource source) throws CommandException { checkNotNull(source, "source"); if (!testSourceType(source)) { throw new CommandSourceTypeException(sourceType); } }

Target:
public void checkSourceType(CommandSource source) throws CommandException { checkNotNull(source, "source"); if (!testSourceType(source)) { throw new CommandSourceTypeException(this.sourceType); } }
Source:
private CompletableFuture<List<? extends ICodeMining>> provideCodeMinings(@NonNull IDocument document) { URI docURI = LSPEclipseUtils.toUri(document); if (docURI != null) { CodeLensParams param = new CodeLensParams(new TextDocumentIdentifier(docURI.toString())); return LanguageServiceAccessor .getLanguageServers(document, capabilities -> capabilities.getCodeLensProvider() != null) .thenComposeAsync(languageServers -> getCodeMiningsFromServers(languageServers, document, param)); } else { return null; } }

Target:
private CompletableFuture<List<? extends ICodeMining>> provideCodeMinings(@NonNull IDocument document) { URI docURI = LSPEclipseUtils.toUri(document); if (docURI != null) { CodeLensParams param = new CodeLensParams(new TextDocumentIdentifier(docURI.toString())); return LanguageServiceAccessor .getLanguageServers(document, capabilities -> capabilities.getCodeLensProvider() != null) .thenComposeAsync(languageServers -> getCodeMiningsFromServers(languageServers, document, param)); } return null; }
Source:
public void setSizeCallback( CallbackDataProvider.CountCallback<T, ?> sizeCallback) { if (sizeCallback == null) { throw new IllegalArgumentException( "Provided size callback cannot be null - for switching between defined and undefined size use setDefinedSize(boolean) method instead."); } clearSizeCallbacksAndState(); this.sizeCallback = sizeCallback; definedSize = true; skipSizeCheckUntilReset = false; sizeReset = true; requestFlush(); }

Target:
public void setSizeCallback( CallbackDataProvider.CountCallback<T, ?> sizeCallback) { if (sizeCallback == null) { throw new IllegalArgumentException( "Provided size callback cannot be null - for switching " + "between defined and undefined size use " + "setDefinedSize(boolean) method instead."); } clearSizeCallbacksAndState(); this.sizeCallback = sizeCallback; definedSize = true; skipSizeCheckUntilReset = false; sizeReset = true; requestFlush(); }
Source:
protected void zoomEntries(@NonNull Iterable<@NonNull TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { if (resolution < 0) { return; } long start = Long.min(zoomStartTime, zoomEndTime); long end = Long.max(zoomStartTime, zoomEndTime); List<@NonNull Long> times = StateSystemUtils.getTimes(start, end, resolution); Sampling sampling = new Sampling(start, end, resolution); Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(entries, zoomStartTime, zoomEndTime); SubMonitor subMonitor = SubMonitor.convert(monitor, getClass().getSimpleName() + "#zoomEntries", providersToModelIds.size()); for (Entry<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Collection<Long>> entry : providersToModelIds.asMap().entrySet()) { ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = entry.getKey(); TimegraphStateQueryFilter filter = new TimegraphStateQueryFilter(times, entry.getValue(), getRegexes()); TmfModelResponse<List<ITimeGraphRowModel>> response = dataProvider.fetchRowModel(filter, monitor); List<ITimeGraphRowModel> model = response.getModel(); if (model != null) { zoomEntries(fEntries.row(dataProvider), model, response.getStatus() == ITmfResponse.Status.COMPLETED, sampling); } subMonitor.worked(1); } }

Target:
protected void zoomEntries(@NonNull Iterable<@NonNull TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { if (resolution < 0) { return; } long start = Long.min(zoomStartTime, zoomEndTime); long end = Long.max(zoomStartTime, zoomEndTime); List<@NonNull Long> times = StateSystemUtils.getTimes(start, end, resolution); Sampling sampling = new Sampling(start, end, resolution); Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(entries, zoomStartTime, zoomEndTime); SubMonitor subMonitor = SubMonitor.convert(monitor, getClass().getSimpleName() + "#zoomEntries", providersToModelIds.size()); for (Entry<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Collection<Long>> entry : providersToModelIds.asMap().entrySet()) { ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = entry.getKey(); TimeGraphStateQueryFilter filter = new TimeGraphStateQueryFilter(times, entry.getValue(), getRegexes()); TmfModelResponse<List<ITimeGraphRowModel>> response = dataProvider.fetchRowModel(filter, monitor); List<ITimeGraphRowModel> model = response.getModel(); if (model != null) { zoomEntries(fEntries.row(dataProvider), model, response.getStatus() == ITmfResponse.Status.COMPLETED, sampling); } subMonitor.worked(1); } }
Source:
public void execute(DsAPI digitalSTROM, String token) { DeviceSceneSpec sceneConfig = digitalSTROM.getDeviceSceneMode(token, device.getDSID(), null, sceneID); if (sceneConfig != null) { device.addSceneConfig(sceneID, sceneConfig); logger.debug("UPDATED scene configuration for dSID: {}, sceneID: {}, configuration: {}", this.device.getDSID(), sceneID, sceneConfig.toString()); } }

Target:
public void execute(DsAPI digitalSTROM, String token) { DeviceSceneSpec sceneConfig = digitalSTROM.getDeviceSceneMode(token, device.getDSID(), null, sceneID); if (sceneConfig != null) { device.addSceneConfig(sceneID, sceneConfig); logger.debug("UPDATED scene configuration for dSID: {}, sceneID: {}, configuration: {}", this.device.getDSID(), sceneID, sceneConfig); } }
Source:
public void testDataStalenessCheck() throws NetworkException, InterruptedException { int i; final int numberOfKeys = 3; doAnswer(invocation -> { final byte[] data = invocation.getArgumentAt(2, byte[].class); final AggregationMessage aggregationMessage = getTestAggregationMessage("worker", data); sspWorkerClockMessageHandler.onNext(aggregationMessage); return null; }).when(mockAggregationMaster).send(anyString(), anyString(), anyObject()); for (i = 0; i < (2 * numberOfKeys); i++) { parameterWorker.pull((i % numberOfKeys)); } assertEquals(initialGlobalMinimumClock, sspWorkerClock.getGlobalMinimumClock()); final byte[] data = codec.encode(ClockManager.getBroadcastMinClockMessage(initialGlobalMinimumClock + (2 * staleness))); mockAggregationMaster.send(ClockManager.AGGREGATION_CLIENT_NAME, "worker", data); assertEquals(initialGlobalMinimumClock + (2 * staleness), sspWorkerClock.getGlobalMinimumClock()); for (i = 0; i < numberOfKeys; i++) { parameterWorker.pull(i); } assertEquals(2 * numberOfKeys, numberOfPullRequests.get()); }

Target:
public void testDataStalenessCheck() throws NetworkException, InterruptedException { final int numberOfKeys = 3; doAnswer(invocation -> { final byte[] initClockMsgData = invocation.getArgumentAt(2, byte[].class); final AggregationMessage aggregationMessage = getTestAggregationMessage("worker", initClockMsgData); sspWorkerClockMessageHandler.onNext(aggregationMessage); return null; }).when(mockAggregationMaster).send(anyString(), anyString(), anyObject()); for (int i = 0; i < numberOfKeys; i++) { parameterWorker.pull(i); } verify(mockSender, times(numberOfKeys)).sendPullMsg(anyString(), anyObject()); for (int i = 0; i < numberOfKeys; i++) { parameterWorker.pull(i); } verify(mockSender, times(numberOfKeys)).sendPullMsg(anyString(), anyObject()); final int oldGlobalMinimumClock = workerClock.getGlobalMinimumClock(); final int deltaClock = STALENESS_BOUND + 1; final byte[] initClockMsgData = codec.encode(ClockManager.getBroadcastMinClockMessage(oldGlobalMinimumClock + deltaClock)); mockAggregationMaster.send(ClockManager.AGGREGATION_CLIENT_NAME, "worker", initClockMsgData); assertEquals(oldGlobalMinimumClock + deltaClock, workerClock.getGlobalMinimumClock()); for (int i = 0; i < numberOfKeys; i++) { parameterWorker.pull(i); } verify(mockSender, times(2 * numberOfKeys)).sendPullMsg(anyString(), anyObject()); }
Source:
public void onClickMapIcon(final Address address) { DefaultMap.startActivityCoords(this, new Geopoint(address.getLatitude(), address.getLongitude()), null, null); finish(); }

Target:
public void onClickMapIcon(final Address address) { DefaultMap.startActivityGeoCode(this, new Geopoint(address.getLatitude(), address.getLongitude())); finish(); }
Source:
public OMElement serializeSpecificMediator(Mediator m) { if (!(m instanceof CallMediator)) { handleException("Unsupported mediator passed in for serialization : " + m.getType()); } CallMediator mediator = (CallMediator) m; OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, mediator); Endpoint activeEndpoint = mediator.getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } call.addAttribute(fac.createOMAttribute("blocking", nullNS, Boolean.toString(mediator.getBlocking()))); return call; }

Target:
public OMElement serializeSpecificMediator(Mediator m) { if (!(m instanceof CallMediator)) { handleException("Unsupported mediator passed in for serialization : " + m.getType()); } CallMediator mediator = (CallMediator) m; OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, mediator); Endpoint activeEndpoint = mediator.getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } if (mediator.getBlocking() == true) { call.addAttribute(fac.createOMAttribute("blocking", nullNS, Boolean.toString(mediator.getBlocking()))); } return call; }
Source:
private List<MemberIdentity> getMembersFromGroup(String groupId) { Collection<MemberDescription> members = new ArrayList<>(); try { members = describeConsumerGroups(Collections.singleton(groupId)).describedGroups().get(groupId).get().members(); } catch (Throwable ex) { System.out.println("Encounter exception when trying to get members from group: " + groupId); ex.printStackTrace(); } List<MemberIdentity> memberToRemove = new ArrayList<>(); for (MemberDescription member: members) { if (member.groupInstanceId().isPresent()) { memberToRemove.add(new MemberIdentity().setGroupInstanceId(member.groupInstanceId().get()) ); } else { memberToRemove.add(new MemberIdentity().setMemberId(member.consumerId())); } } return memberToRemove; }

Target:
private List<MemberIdentity> getMembersFromGroup(String groupId) { Collection<MemberDescription> members; try { members = describeConsumerGroups(Collections.singleton(groupId)).describedGroups().get(groupId).get().members(); } catch (Exception ex) { throw new KafkaException("Encounter exception when trying to get members from group: " + groupId, ex); } List<MemberIdentity> membersToRemove = new ArrayList<>(); for (final MemberDescription member : members) { if (member.groupInstanceId().isPresent()) { membersToRemove.add(new MemberIdentity().setGroupInstanceId(member.groupInstanceId().get())); } else { membersToRemove.add(new MemberIdentity().setMemberId(member.consumerId())); } } return membersToRemove; }
Source:
@Test public void queryParamMapsConvertedToNullShouldError() throws IOException, InterruptedException { class Example { @POST("/query") Call<String> queryPath(@QueryMap HashMap<String, String> a) { return null; } } Retrofit.Builder retrofitBuilder = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(new NullObjectConverterFactory()); final HashMap<String, String> queryMap = new HashMap<String, String>() {{ put("Ignored", "Always Null"); }}; try { buildRequest(Example.class, retrofitBuilder, queryMap); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessageContaining("Query map contained null value for key"); } }

Target:
@Test public void queryParamMapsConvertedToNullShouldError() throws IOException, InterruptedException { class Example { @POST("/query") Call<String> queryPath(@QueryMap HashMap<String, String> a) { return null; } } Retrofit.Builder retrofitBuilder = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(new NullObjectConverterFactory()); final Map<String, String> queryMap = new LinkedHashMap<String, String>() {{ put("Ignored", "Always Null"); }}; try { buildRequest(Example.class, retrofitBuilder, queryMap); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessageContaining("Query map contained null value for key 'Ignored'"); } }
Source:
public void verifyAllPinTypesIsUncheck() { waitForElementByElement(allPinTypes); if(allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types was checked", false); }else { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types was unchecked", true); } }

Target:
public void verifyAllPinTypesIsUncheck() { try { waitForElementByElement(allPinTypes); if (!allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were unchecked", true); } }catch (Exception e) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were checked", false); } }
Source:
public void onFollowTapped(View view, String blogName, final long blogId) { mDispatcher.dispatch(AccountActionBuilder.newFetchSubscriptionsAction()); Snackbar.make(view, Html.fromHtml(getString(R.string.reader_followed_blog_notifications, "<b>", blogName, "</b>")), Snackbar.LENGTH_LONG) .setAction(getString(R.string.reader_followed_blog_notifications_action), new View.OnClickListener() { @Override public void onClick(View view) { AnalyticsUtils.trackWithSiteId(Stat.FOLLOWED_BLOG_NOTIFICATIONS_READER_ENABLED, blogId); AddOrDeleteSubscriptionPayload payload = new AddOrDeleteSubscriptionPayload( String.valueOf(blogId), SubscriptionAction.NEW); mDispatcher.dispatch(newUpdateSubscriptionNotificationPostAction(payload)); } }) .setActionTextColor(getResources().getColor(R.color.color_accent)) .show(); }

Target:
public void onFollowTapped(View view, String blogName, final long blogId) { mDispatcher.dispatch(AccountActionBuilder.newFetchSubscriptionsAction()); String blog = TextUtils.isEmpty(blogName) ? getString(R.string.reader_followed_blog_notifications_this) : blogName; Snackbar.make(view, Html.fromHtml(getString(R.string.reader_followed_blog_notifications, "<b>", blog, "</b>")), AccessibilityUtils.getSnackbarDuration(getActivity())) .setAction(getString(R.string.reader_followed_blog_notifications_action), new View.OnClickListener() { @Override public void onClick(View view) { AnalyticsUtils.trackWithSiteId(Stat.FOLLOWED_BLOG_NOTIFICATIONS_READER_ENABLED, blogId); AddOrDeleteSubscriptionPayload payload = new AddOrDeleteSubscriptionPayload( String.valueOf(blogId), SubscriptionAction.NEW); mDispatcher.dispatch(newUpdateSubscriptionNotificationPostAction(payload)); ReaderBlogTable.setNotificationsEnabledByBlogId(blogId, true); } }) .setActionTextColor(getResources().getColor(R.color.color_accent)) .show(); }
Source:
private static void printDownstream(PrintStream buildLog, List<FailureCauseDisplayData> downstreamFailureCauses) { if (!downstreamFailureCauses.isEmpty()) { for (FailureCauseDisplayData displayData : downstreamFailureCauses) { FailureCauseDisplayData.Links links = displayData.getLinks(); if (!displayData.getFoundFailureCauses().isEmpty()) { buildLog.println("[BFA] See: " + Jenkins.getInstance().getRootUrl() + links.getBuildUrl()); for (FoundFailureCause foundCause : displayData.getFoundFailureCauses()) { String foundString = "[BFA] " + foundCause.getName(); if (foundCause.getCategories() != null) { foundString += " from category " + foundCause.getCategories().get(0); } buildLog.println(foundString); } } printDownstream(buildLog, displayData.getDownstreamFailureCauses()); } } }

Target:
private static void printDownstream(PrintStream buildLog, List<FailureCauseDisplayData> downstreamFailureCauses) { for (FailureCauseDisplayData displayData : downstreamFailureCauses) { FailureCauseDisplayData.Links links = displayData.getLinks(); if (!displayData.getFoundFailureCauses().isEmpty()) { buildLog.println("[BFA] See: " + Jenkins.getInstance().getRootUrl() + links.getBuildUrl()); for (FoundFailureCause foundCause : displayData.getFoundFailureCauses()) { String foundString = "[BFA] " + foundCause.getName(); if (foundCause.getCategories() != null) { foundString += " from category " + foundCause.getCategories().get(0); } buildLog.println(foundString); } } printDownstream(buildLog, displayData.getDownstreamFailureCauses()); } }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null) { logger.debug("binding-configuration is currently not set for item: " + item.getName()); } String itemName = null; Matcher mItemName = Pattern.compile(REGEX_ITEM_NAME).matcher(bindingConfig); if (mItemName.find()) { itemName = mItemName.group(1); } String typeString = null; Matcher mType = Pattern.compile(REGEX_TYPE).matcher(bindingConfig); if (mType.find()) { typeString = mType.group(1); } CalDavType type = null; try { type = CalDavType.valueOf(typeString); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("cannot read required parameter 'type' for item: " + item.getName()); } logger.debug("adding item: {}", item.getName()); this.addBindingConfig(item, new CalDavNextEventConfig(item.getName(), itemName, type)); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null) { logger.debug("binding-configuration is currently not set for item: {}", item.getName()); } String itemName = null; Matcher mItemName = Pattern.compile(REGEX_ITEM_NAME).matcher(bindingConfig); if (mItemName.find()) { itemName = mItemName.group(1); } String typeString = null; Matcher mType = Pattern.compile(REGEX_TYPE).matcher(bindingConfig); if (mType.find()) { typeString = mType.group(1); } CalDavType type = null; try { type = CalDavType.valueOf(typeString); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("cannot read required parameter 'type' for item: " + item.getName()); } logger.debug("adding item: {}", item.getName()); this.addBindingConfig(item, new CalDavNextEventConfig(item.getName(), itemName, type)); }
Source:
private void checkoutCommit(RevCommit commit) throws IOException { try { monitor.beginTask( "Rewinding to commit " + commit.getShortMessage(), ProgressMonitor.UNKNOWN); RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD)); DirCacheCheckout dco = new DirCacheCheckout(repo, head.getTree() .getId(), repo.lockDirCache(), commit.getTree().getId()); dco.setFailOnConflict(true); dco.checkout(); walk.release(); RefUpdate refUpdate = repo.updateRef(Constants.HEAD, true); refUpdate.setNewObjectId(commit); Result res = refUpdate.forceUpdate(); switch (res) { case REJECTED: case IO_FAILURE: case LOCK_FAILURE: throw new IOException("Could not rewind to upstream commit"); default: break; } } finally { monitor.endTask(); } }

Target:
private void checkoutCommit(RevCommit commit) throws IOException { try { monitor.beginTask( "Rewinding to commit " + commit.getShortMessage(), ProgressMonitor.UNKNOWN); RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD)); DirCacheCheckout dco = new DirCacheCheckout(repo, head.getTree() .getId(), repo.lockDirCache(), commit.getTree().getId()); dco.setFailOnConflict(true); dco.checkout(); walk.release(); RefUpdate refUpdate = repo.updateRef(Constants.HEAD, true); refUpdate.setExpectedOldObjectId(head); refUpdate.setNewObjectId(commit); Result res = refUpdate.forceUpdate(); switch (res) { case FAST_FORWARD: case NO_CHANGE: case FORCED: break; default: throw new IOException("Could not rewind to upstream commit"); } } finally { monitor.endTask(); } }
Source:
public boolean isRunning() { return true; }

Target:
public boolean isRunning() { return this.running; }
Source:
public synchronized boolean addRevision(InternalCDORevision revision) { if (revision.getBranch().getID() == 34 && revision.getVersion() == 2 && revision.getEClass().getName().equals("Concept")) { System.err.println(); } int version = revision.getVersion(); for (ListIterator<InternalCDORevision> it = listIterator(); it.hasNext();) { InternalCDORevision revisionInList = it.next(); int v = revisionInList.getVersion(); if (v == version) { return false; } if (v < version) { it.previous(); it.add(revision); return true; } } addLast(revision); return true; }

Target:
public synchronized boolean addRevision(InternalCDORevision revision) { int version = revision.getVersion(); for (ListIterator<InternalCDORevision> it = listIterator(); it.hasNext();) { InternalCDORevision revisionInList = it.next(); int v = revisionInList.getVersion(); if (v == version) { return false; } if (v < version) { it.previous(); it.add(revision); return true; } } addLast(revision); return true; }