auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void cancel() { WorkItem workItem = getWorkItem(); if (workItem != null && workItem.getState() != WorkItem.COMPLETED && workItem.getState() != WorkItem.ABORTED) { try { ((WorkItemManager) ((ProcessInstance) getProcessInstance()) .getKnowledgeRuntime().getWorkItemManager()).internalAbortWorkItem(workItemId); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } } if (processInstanceId > -1) { ProcessInstance processInstance = null; InternalKnowledgeRuntime kruntime = ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime(); RuntimeManager manager = (RuntimeManager) kruntime.getEnvironment().get(EnvironmentName.RUNTIME_MANAGER); if (manager != null) { try { org.kie.api.runtime.manager.Context<?> context = ProcessInstanceIdContext.get(processInstanceId); String caseId = (String) kruntime.getEnvironment().get(EnvironmentName.CASE_ID); if (caseId != null) { context = CaseContext.get(caseId); } RuntimeEngine runtime = manager.getRuntimeEngine(context); KieRuntime managedkruntime = (KieRuntime) runtime.getKieSession(); processInstance = (ProcessInstance) managedkruntime.getProcessInstance(processInstanceId); } catch (SessionNotFoundException e) { } } else { processInstance = (ProcessInstance) kruntime.getProcessInstance(processInstanceId); } if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } super.cancel(); }

Target:
public void cancel() { WorkItem workItem = getWorkItem(); if (workItem != null && workItem.getState() != WorkItem.COMPLETED && workItem.getState() != WorkItem.ABORTED) { try { ((WorkItemManager) ((ProcessInstance) getProcessInstance()) .getKnowledgeRuntime().getWorkItemManager()).internalAbortWorkItem(workItemId); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } } if (exceptionHandlingProcessInstanceId > -1) { ProcessInstance processInstance = null; KieRuntime kruntime = getKieRuntimeForSubprocess(); processInstance = (ProcessInstance) kruntime.getProcessInstance(exceptionHandlingProcessInstanceId); if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } super.cancel(); }
Source:
public SongMetadata remove(SongMetadata meta) { SongMetadata removeMeta = meta; boolean removed = musicList.remove(meta); if (!removed) { removed = playedList.remove(meta); if(!removed){ removeMeta = null; } } return removeMeta; }

Target:
public SongMetadata remove(SongMetadata meta) { boolean success; SongMetadata removeMeta = meta; if(musicList.contains(meta)) { success = musicList.remove(meta); } else if(playedList.contains(meta)){ success = playedList.remove(meta); } else { success = false; Log.wtf(TAG, "Asked to remove unknown object"); } if(!success){ removeMeta = null; } return removeMeta; }
Source:
private void sendUniqueOutcomeEvent(@NonNull final String name, @NonNull List<OSInfluence> sessionInfluences, @Nullable OneSignal.OutcomeCallback callback) { List<OSInfluence> influences = removeDisableInfluences(sessionInfluences); if (influences.isEmpty()) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Unique Outcome disabled for current session"); return; } boolean attributed = false; boolean unAttributed = false; for (OSInfluence influence : influences) { if (influence.getInfluenceType().isAttributed()) { attributed = true; break; } else if (influence.getInfluenceType().isUnattributed()) { unAttributed = true; } } if (attributed) { final List<OSInfluence> uniqueInfluences = getUniqueIds(name, influences); if (uniqueInfluences == null) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSessionInfluences: " + influences.toString() + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } sendAndCreateOutcomeEvent(name, 0, uniqueInfluences, callback); } else if (unAttributed) { if (unattributedUniqueOutcomeEventsSentOnSession.contains(name)) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSession: " + OSInfluenceType.UNATTRIBUTED + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } unattributedUniqueOutcomeEventsSentOnSession.add(name); sendAndCreateOutcomeEvent(name, 0, influences, callback); } else { OneSignal.Log(OneSignal.LOG_LEVEL.VERBOSE, "Outcomes disabled"); } }

Target:
private void sendUniqueOutcomeEvent(@NonNull final String name, @NonNull List<OSInfluence> sessionInfluences, @Nullable OneSignal.OutcomeCallback callback) { List<OSInfluence> influences = removeDisabledInfluences(sessionInfluences); if (influences.isEmpty()) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Unique Outcome disabled for current session"); return; } boolean attributed = false; for (OSInfluence influence : influences) { if (influence.getInfluenceType().isAttributed()) { attributed = true; break; } } if (attributed) { final List<OSInfluence> uniqueInfluences = getUniqueIds(name, influences); if (uniqueInfluences == null) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSessionInfluences: " + influences.toString() + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } sendAndCreateOutcomeEvent(name, 0, uniqueInfluences, callback); } else { if (unattributedUniqueOutcomeEventsSentOnSession.contains(name)) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSession: " + OSInfluenceType.UNATTRIBUTED + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } unattributedUniqueOutcomeEventsSentOnSession.add(name); sendAndCreateOutcomeEvent(name, 0, influences, callback); } }
Source:
protected void initializeConfiguration( ISynchronizePageConfiguration configuration) { configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID); String modelProvider; if(Activator.getDefault().getPreferenceStore().getBoolean( UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL)) { modelProvider = GitChangeSetModelProvider.ID; } else { modelProvider = WORKSPACE_MODEL_PROVIDER_ID; } configuration.setProperty( ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER, modelProvider); super.initializeConfiguration(configuration); configuration.addActionContribution(new GitActionContributor()); }

Target:
protected void initializeConfiguration( ISynchronizePageConfiguration configuration) { configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID); String modelProvider; if (Activator .getDefault() .getPreferenceStore() .getBoolean(UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL)) modelProvider = GitChangeSetModelProvider.ID; else modelProvider = WORKSPACE_MODEL_PROVIDER_ID; configuration.setProperty( ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER, modelProvider); super.initializeConfiguration(configuration); configuration.addActionContribution(new GitActionContributor()); }
Source:
private void initSystemDataSource(File sysDSFile) throws DataSourceException { try { System.setProperty("javax.xml.bind.JAXBContextFactory", "com.sun.xml.bind.v2.ContextFactory"); JAXBContext ctx = JAXBContext.newInstance(SystemDataSourcesConfiguration.class); Document doc = DataSourceUtils.convertToDocument(sysDSFile); DataSourceUtils.secureResolveDocument(doc, true); SystemDataSourcesConfiguration sysDS = (SystemDataSourcesConfiguration) ctx.createUnmarshaller(). unmarshal(doc); this.addDataSourceProviders(sysDS.getProviders()); DataSourceRepository dsRepo = this.getDataSourceRepository( MultitenantConstants.SUPER_TENANT_ID); for (DataSourceMetaInfo dsmInfo : sysDS.getDataSources()) { dsmInfo.setSystem(true); dsRepo.addDataSource(dsmInfo); } } catch (Exception e) { throw new DataSourceException("Error in initializing system data sources at '" + sysDSFile.getAbsolutePath() + "' - " + e.getMessage(), e); } }

Target:
private void initSystemDataSource(File sysDSFile) throws DataSourceException { try { JAXBContext ctx = JAXBContext.newInstance(SystemDataSourcesConfiguration.class); Document doc = DataSourceUtils.convertToDocument(sysDSFile); DataSourceUtils.secureResolveDocument(doc, true); SystemDataSourcesConfiguration sysDS = (SystemDataSourcesConfiguration) ctx.createUnmarshaller(). unmarshal(doc); this.addDataSourceProviders(sysDS.getProviders()); DataSourceRepository dsRepo = this.getDataSourceRepository( MultitenantConstants.SUPER_TENANT_ID); for (DataSourceMetaInfo dsmInfo : sysDS.getDataSources()) { dsmInfo.setSystem(true); dsRepo.addDataSource(dsmInfo); } } catch (Exception e) { throw new DataSourceException("Error in initializing system data sources at '" + sysDSFile.getAbsolutePath() + "' - " + e.getMessage(), e); } }
Source:
private ClientCnxnSocket getClientCnxnSocket() throws IOException { String clientCnxnSocketName = getClientConfig().getProperty( ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET); if (clientCnxnSocketName == null) { clientCnxnSocketName = ClientCnxnSocketNIO.class.getName(); } try { Constructor<?> clientCxnConstructor = Class.forName(clientCnxnSocketName).getConstructor(ZKClientConfig.class); ClientCnxnSocket clientCxnSocket = (ClientCnxnSocket) clientCxnConstructor.newInstance(getClientConfig()); return clientCxnSocket; } catch (Exception e) { IOException ioe = new IOException("Couldn't instantiate " + clientCnxnSocketName); ioe.initCause(e); throw ioe; } }

Target:
private ClientCnxnSocket getClientCnxnSocket() throws IOException { String clientCnxnSocketName = getClientConfig().getProperty( ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET); if (clientCnxnSocketName == null) { clientCnxnSocketName = ClientCnxnSocketNIO.class.getName(); } try { Constructor<?> clientCxnConstructor = Class.forName(clientCnxnSocketName).getDeclaredConstructor(ZKClientConfig.class); ClientCnxnSocket clientCxnSocket = (ClientCnxnSocket) clientCxnConstructor.newInstance(getClientConfig()); return clientCxnSocket; } catch (Exception e) { IOException ioe = new IOException("Couldn't instantiate " + clientCnxnSocketName); ioe.initCause(e); throw ioe; } }
Source:
public String getName() { String name= super.getName(); if (name != null) { name= MessageIds.IGNORED_TEST_PREFIX + name; if (reason != null && reason.length() > 0) { name= name + MessageIds.IGNORED_TEST_REASON_PREFIX + reason; } return name; } return null; }

Target:
public String getName() { String name= super.getName(); if (name != null) { name= MessageIds.IGNORED_TEST_PREFIX + name; if (reason != null && !reason.isEmpty()) { name= name + MessageIds.IGNORED_TEST_REASON_PREFIX + reason; } return name; } return null; }
Source:
public List<User> getUsersWithLimit(int limit) throws IOException { if (limit <= 0) { return get(getFullPath("/"), new TypeReference<List<User>>() { }); } return get(getEncodedPath("?" + LIMIT + "=%s", Integer.toString(limit)), new TypeReference<List<User>>() { }); }

Target:
public List<User> getUsersWithLimit(int limit) throws IOException { if (limit == -1) { return get(getFullPath("/"), new TypeReference<List<User>>() { }); } return get(getEncodedPath("?" + LIMIT + "=%s", Integer.toString(limit)), new TypeReference<List<User>>() { }); }
Source:
public void tearDown() { account.deleteDB("lightcouch-db-test"); }

Target:
public void tearDown() { account.deleteDB("lightcouch-db-test"); account.shutdown(); }
Source:
public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException { if (attribute.valueAsString() == null) throw new WrongReferenceAttributeValueException(attribute, "Value can't be null"); }

Target:
public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException { if (attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, "Value can't be null"); }
Source:
public static Module module() { return new CacheModule() { @Override protected void configure() { cache(PARENT_GROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(ParentGroupsLoader.class); cache(SUBGROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(SubgroupsLoader.class); cache(GROUPS_ACCOUNTS, AccountGroup.UUID.class, new TypeLiteral<Set<Account.Id>>() {}) .loader(AccountsOfLoader.class); cache(EXTERNAL_NAME, String.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(AllExternalLoader.class); bind(GroupIncludeCacheImpl.class); bind(GroupIncludeCache.class).to(GroupIncludeCacheImpl.class); } }; }

Target:
public static Module module() { return new CacheModule() { @Override protected void configure() { cache(PARENT_GROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(ParentGroupsLoader.class); cache(SUBGROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(SubgroupsLoader.class); cache(GROUPS_ACCOUNTS, AccountGroup.UUID.class, new TypeLiteral<Set<Account.Id>>() {}) .loader(GroupsAccountsLoader.class); cache(EXTERNAL_NAME, String.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(AllExternalLoader.class); bind(GroupIncludeCacheImpl.class); bind(GroupIncludeCache.class).to(GroupIncludeCacheImpl.class); } }; }
Source:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); if (dataType.hasPriority()) { firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); if (dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } channelStatePersister.checkForBarrier(sequenceBuffer.buffer).ifPresent(id -> { lastBarrierSequenceNumber = sequenceBuffer.sequenceNumber; lastBarrierId = id; }); channelStatePersister.maybePersist(buffer); ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }

Target:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); if (dataType.hasPriority()) { firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); if (dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } channelStatePersister .checkForBarrier(sequenceBuffer.buffer) .filter(id -> id > lastBarrierId) .ifPresent(id -> { lastBarrierId = id; lastBarrierSequenceNumber = sequenceBuffer.sequenceNumber; }); channelStatePersister.maybePersist(buffer); ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }
Source:
public void stop() { this.partitionConsumers.forEach((key, value) -> { try { logger.info("Closing event hub consumer for partition {}", key); value.close(); partitionConsumers.remove(key); } catch (IOException ex) { logger.warning("Unable to close event hub consumer for partition {}", key); } }); disposable.dispose(); scheduler.dispose(); logger.info("Stopping the event processor"); }

Target:
public synchronized void stop() { if (!started.compareAndSet(true, false)) { logger.info("Event processor has already stopped"); return; } this.partitionConsumers.forEach((key, value) -> { try { logger.info("Closing event hub consumer for partition {}", key); value.close(); logger.info("Closed event hub consumer for partition {}", key); partitionConsumers.remove(key); } catch (IOException ex) { logger.warning("Unable to close event hub consumer for partition {}", key); } }); runner.dispose(); scheduler.dispose(); }
Source:
private void getEndPointFromConnectionString(String connectionString) { HashMap<String, String> connectionStringPieces = new HashMap<>(); for (String connectionStringPiece : connectionString.split(";")) { String[] kvp = connectionStringPiece.split("=", 2); connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); } String accountName = connectionStringPieces.get(ACCOUNT_NAME); try { this.endpoint = new URL(String.format("<LINK_0>", accountName)); } catch (MalformedURLException e) { throw new IllegalArgumentException(String.format("There is no valid account for the connection string. " + "Connection String: %s", connectionString)); } }

Target:
private void getEndPointFromConnectionString(String connectionString) { HashMap<String, String> connectionStringPieces = new HashMap<>(); for (String connectionStringPiece : connectionString.split(";")) { String[] kvp = connectionStringPiece.split("=", 2); connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); } String accountName = connectionStringPieces.get(ACCOUNT_NAME); try { this.endpoint = new URL(String.format("<LINK_0>", accountName)); } catch (MalformedURLException e) { LOGGER.asError().log("There is no valid account for the connection string. " + "Connection String: %s", connectionString); throw new IllegalArgumentException(String.format("There is no valid account for the connection string. " + "Connection String: %s", connectionString)); } }
Source:
public static long hash(byte[] bytes, int offset, int length) { final long m = 0xc6a4a7935bd1e995L; long seed = 1; int i = 0; for (; i + 8 <= length; i += 8) { seed = (seed * m * unsafe.getLong(bytes, (long) ARRAY_BYTE_BASE_OFFSET + offset + i)) ^ (seed >> 27); } long lastWord = 0; for (; i < length; i++) { lastWord = bytes[offset + i] | (lastWord << 8); } return (seed * m * lastWord) ^ (seed << 27); }

Target:
public static long hash(byte[] bytes, int offset, int length) { long seed = 1; int i = 0; for (; i + 8 <= length; i += 8) { seed = (seed * M * unsafe.getLong(bytes, (long) ARRAY_BYTE_BASE_OFFSET + offset + i)) ^ (seed >> 27); } long lastWord = 0; for (; i < length; i++) { lastWord = bytes[offset + i] | (lastWord << 8); } return (seed * M * lastWord) ^ (seed << 27); }
Source:
private RefList<Ref> parsePackedRefs(final BufferedReader br) throws IOException { RefList.Builder<Ref> all = new RefList.Builder<Ref>(); Ref last = null; boolean peeled = false; boolean needSort = false; String p; while ((p = br.readLine()) != null) { if (p.charAt(0) == '#') { if (p.startsWith(PACKED_REFS_HEADER)) { p = p.substring(PACKED_REFS_HEADER.length()); peeled = p.contains(PACKED_REFS_PEELED); } continue; } if (p.charAt(0) == '^') { if (last == null) throw new IOException(JGitText.get().peeledLineBeforeRef); ObjectId id = ObjectId.fromString(p.substring(1)); last = new ObjectIdRef.PeeledTag(PACKED, last.getName(), last .getObjectId(), id); all.set(all.size() - 1, last); continue; } int sp = p.indexOf(' '); if (sp < 0) throw new IOException(MessageFormat.format(JGitText .get().packedRefsCorruptionDetected, packedRefsFile.getAbsolutePath())); ObjectId id = ObjectId.fromString(p.substring(0, sp)); String name = copy(p, sp + 1, p.length()); ObjectIdRef cur; if (peeled) cur = new ObjectIdRef.PeeledNonTag(PACKED, name, id); else cur = new ObjectIdRef.Unpeeled(PACKED, name, id); if (last != null && RefComparator.compareTo(last, cur) > 0) needSort = true; all.add(cur); last = cur; } if (needSort) all.sort(); return all.toRefList(); }

Target:
private RefList<Ref> parsePackedRefs(final BufferedReader br) throws IOException { RefList.Builder<Ref> all = new RefList.Builder<Ref>(); Ref last = null; boolean peeled = false; boolean needSort = false; String p; while ((p = br.readLine()) != null) { if (p.charAt(0) == '#') { if (p.startsWith(PACKED_REFS_HEADER)) { p = p.substring(PACKED_REFS_HEADER.length()); peeled = p.contains(PACKED_REFS_PEELED); } continue; } if (p.charAt(0) == '^') { if (last == null) throw new IOException(JGitText.get().peeledLineBeforeRef); ObjectId id = ObjectId.fromString(p.substring(1)); last = new ObjectIdRef.PeeledTag(PACKED, last.getName(), last .getObjectId(), id); all.set(all.size() - 1, last); continue; } int sp = p.indexOf(' '); if (sp < 0) { throw new IOException(MessageFormat.format( JGitText.get().packedRefsCorruptionDetected, packedRefsFile.getAbsolutePath())); } ObjectId id = ObjectId.fromString(p.substring(0, sp)); String name = copy(p, sp + 1, p.length()); ObjectIdRef cur; if (peeled) cur = new ObjectIdRef.PeeledNonTag(PACKED, name, id); else cur = new ObjectIdRef.Unpeeled(PACKED, name, id); if (last != null && RefComparator.compareTo(last, cur) > 0) needSort = true; all.add(cur); last = cur; } if (needSort) all.sort(); return all.toRefList(); }
Source:
private void checkoutBranch(String branchName) throws IllegalStateException, IOException { RevWalk walk = new RevWalk(db); RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD)); RevCommit branch = walk.parseCommit(db.resolve(branchName)); DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree().getId(), db.lockDirCache(), branch.getTree().getId()); dco.setFailOnConflict(true); assertTrue(dco.checkout()); walk.release(); RefUpdate refUpdate = db.updateRef(Constants.HEAD); assertEquals(Result.FORCED, refUpdate.link(branchName)); }

Target:
private void checkoutBranch(String branchName) throws IllegalStateException, IOException { RevWalk walk = new RevWalk(db); RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD)); RevCommit branch = walk.parseCommit(db.resolve(branchName)); DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree(), db.lockDirCache(), branch.getTree()); dco.setFailOnConflict(true); assertTrue(dco.checkout()); walk.release(); RefUpdate refUpdate = db.updateRef(Constants.HEAD); assertEquals(Result.FORCED, refUpdate.link(branchName)); }
Source:
protected static File searchPath(String path, String... lookFor) { if (path == null) return null; for (String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File file = new File(p, command); try { if (file.isFile()) { return file.getAbsoluteFile(); } } catch (SecurityException e) { LOG.warn("The path '{}' isn't accessible. Skip it", file.getPath()); } } } return null; }

Target:
protected static File searchPath(String path, String... lookFor) { if (path == null) return null; for (String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File file = new File(p, command); try { if (file.isFile()) { return file.getAbsoluteFile(); } } catch (SecurityException e) { LOG.warn(MessageFormat.format( JGitText.get().skipNotAccessiblePath, file.getPath())); } } } return null; }
Source:
public void testKSTS() throws Exception { RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean(); Log logger = spy(TestUtils.getPropertyValue(fb, "logger", Log.class)); given(logger.isDebugEnabled()).willReturn(true); new DirectFieldAccessor(fb).setPropertyValue("logger", logger); ConnectionFactory rabbitCf = spy(TestUtils.getPropertyValue(fb, "connectionFactory", ConnectionFactory.class)); new DirectFieldAccessor(fb).setPropertyValue("connectionFactory", rabbitCf); fb.setUseSSL(true); fb.setKeyStoreType("JKS"); fb.setKeyStoreResource(new ClassPathResource("test.ks")); fb.setKeyStorePassphrase("secret"); fb.setTrustStoreResource(new ClassPathResource("test.truststore.ks")); fb.setKeyStorePassphrase("secret"); fb.setSecureRandom(SecureRandom.getInstanceStrong()); fb.afterPropertiesSet(); fb.getObject(); ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); verify(logger).debug(captor.capture()); final String log = captor.getValue(); assertThat(log, allOf(containsString("KM: ["), containsString("TM: ["), containsString("random: java."))); }

Target:
public void testKSTS() throws Exception { RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean(); Log logger = spy(TestUtils.getPropertyValue(fb, "logger", Log.class)); given(logger.isDebugEnabled()).willReturn(true); new DirectFieldAccessor(fb).setPropertyValue("logger", logger); fb.setUseSSL(true); fb.setKeyStoreType("JKS"); fb.setKeyStoreResource(new ClassPathResource("test.ks")); fb.setKeyStorePassphrase("secret"); fb.setTrustStoreResource(new ClassPathResource("test.truststore.ks")); fb.setKeyStorePassphrase("secret"); fb.setSecureRandom(SecureRandom.getInstanceStrong()); fb.afterPropertiesSet(); fb.getObject(); ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); verify(logger).debug(captor.capture()); final String log = captor.getValue(); assertThat(log, allOf(containsString("KM: ["), containsString("TM: ["), containsString("random: java."))); }
Source:
public static <T> BasicEList<T> newBasicEList(T... elements) { BasicEList<T> result = new BasicEList<T>(elements.length); result.addAll(Arrays.asList(elements)); return result; }

Target:
public static <T> BasicEList<T> newBasicEList(T... elements) { BasicEList<T> result = new BasicEList<T>(elements.length); System.arraycopy(elements, 0, result.data, 0, elements.length); return result; }
Source:
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable { final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings); final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request); assertNotNull("asyncResponse should not be null", asyncResponse); ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }

Target:
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable { final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings); final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request); assertNotNull("AsyncResponse should not be null", asyncResponse); ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }
Source:
public static int doSendInvite(String accountEmail, String currentUserEmail, String instructorName) { int rv = 0; try { emailMessage = Friend.readFile(friendEmailFile, StandardCharsets.UTF_8); emailMessage = emailMessage.replace("<instructor>", instructorName); emailMessage = emailMessage.replace("<contactEmail>", contactEmail); Xclient = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL(friendUrl)); Xclient.setTransportFactory(new XmlRpcSun15HttpTransportFactory(Xclient)); Xclient.setConfig(config); Object[] params = new Object[]{contactEmail, referrerUrl, emailMessage, new String[]{accountEmail}, currentUserEmail}; Object[] results = (Object[]) Xclient.execute("sendInvites", params); if (results != null && results.length == 1) { rv = ((Integer) results[0]).intValue(); } } catch (Exception e) { M_log.warn("Friend doSendInvite(): email address=" + accountEmail + " " + e.getMessage()); } return rv; }

Target:
public CreateAccountResponse doSendInvite(String accountEmail, String currentUserEmail, String instructorName) { M_log.debug("Friend doSendInvite() called"); CreateAccountResponse response = CreateAccountResponse.RUNTIME_PROBLEM; int rv = 0; try { HashMap<String, String> map = new HashMap<String,String>(); map.put(INSTRUCTOR_NAME_TAG, instructorName); map.put(CONTACT_EMAIL_TAG, contactEmail); emailMessage = Friend.readFile(friendEmailFile, StandardCharsets.UTF_8); emailMessage = replacePlaceHolders(emailMessage, map); Object[] params = new Object[]{contactEmail, referrerUrl, emailMessage, new String[]{accountEmail}, currentUserEmail}; Object[] results = (Object[]) Xclient.execute(SEND_INVITES_WS, params); if (results != null && results.length == 1) { rv = ((Integer) results[0]).intValue(); } } catch (Exception e) { M_log.warn("Friend doSendInvite(): email address=" + accountEmail + " " + e.getMessage()); } if(rv == -1){ response = CreateAccountResponse.INVALID_EMAIL; } if(rv == 0){ response = CreateAccountResponse.RUNTIME_PROBLEM; } if(rv == 1){ response = CreateAccountResponse.INVITATION_SUCCESSFULLY_SENT; } return response; }
Source:
protected boolean checkSriovHotPlugSupported() { if (!FeatureSupported.sriovHotPlugSupported(getVm().getVdsGroupCompatibilityVersion())) { addCanDoActionMessage(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); return false; } return true; }

Target:
protected boolean checkSriovHotPlugSupported() { if (!FeatureSupported.sriovHotPlugSupported(getVm().getVdsGroupCompatibilityVersion())) { return failValidation(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); } return true; }
Source:
public String removeQueryStringsFromURL(String url) { if (url.contains("?")) { return url.substring(0, url.indexOf("?")); } else return url; }

Target:
public String removeQueryStringsFromURL(String url) { if (url.contains("?")) { return url.substring(0, url.indexOf("?")); } return url; }
Source:
public GrpcBackedCommandMessage(Command command, Serializer serializer) { this.command = command; this.serializedPayload = new LazyDeserializingObject<>(new GrpcSerializedObject(command.getPayload()), serializer); this.metaDataSupplier = new GrpcMetaData(command.getMetaDataMap(), serializer); }

Target:
public GrpcBackedCommandMessage(Command command, Serializer serializer) { this( command, new LazyDeserializingObject<>(new GrpcSerializedObject(command.getPayload()), serializer), new GrpcMetaData(command.getMetaDataMap(), serializer) ); }
Source:
private DiskImage createMetadataDisk(VM vm, Snapshot snapshot) { List<Guid> guids = Guid.createGuidListFromString(snapshot.getMemoryVolume()); StorageDomainStatic sd = validateStorageDomainExistsInDb(snapshot, guids.get(0), guids.get(4), guids.get(5)); DiskImage disk = isMemoryDiskAlreadyExistsInDb(snapshot, guids.get(4), guids.get(5)); if (sd == null || disk != null) { return null; } DiskImage memoryDisk = MemoryUtils.createSnapshotMetadataDisk(MemoryUtils.generateMemoryDiskDescription(vm, snapshot.getDescription())); memoryDisk.setId(guids.get(4)); memoryDisk.setImageId(guids.get(5)); memoryDisk.setStorageIds(new ArrayList<>(Collections.singletonList(guids.get(0)))); memoryDisk.setStoragePoolId(guids.get(1)); memoryDisk.setCreationDate(snapshot.getCreationDate()); memoryDisk.setActive(true); memoryDisk.setWipeAfterDelete(vm.getDiskList().stream().anyMatch(d -> d.isWipeAfterDelete())); return memoryDisk; }

Target:
private DiskImage createMetadataDisk(VM vm, Snapshot snapshot) { List<Guid> guids = Guid.createGuidListFromString(snapshot.getMemoryVolume()); StorageDomainStatic sd = validateStorageDomainExistsInDb(snapshot, guids.get(0), guids.get(4), guids.get(5)); DiskImage disk = isMemoryDiskAlreadyExistsInDb(snapshot, guids.get(4), guids.get(5)); if (sd == null || disk != null) { return null; } DiskImage memoryDisk = MemoryUtils.createSnapshotMetadataDisk(MemoryUtils.generateMemoryDiskDescription(vm, snapshot.getDescription())); memoryDisk.setId(guids.get(4)); memoryDisk.setImageId(guids.get(5)); memoryDisk.setStorageIds(new ArrayList<>(Collections.singletonList(guids.get(0)))); memoryDisk.setStoragePoolId(guids.get(1)); memoryDisk.setCreationDate(snapshot.getCreationDate()); memoryDisk.setActive(true); memoryDisk.setWipeAfterDelete(vm.getDiskList().stream().anyMatch(DiskImage::isWipeAfterDelete)); return memoryDisk; }
Source:
public void finishBundle(DoFn<KV<String, Iterable<Mutation>>, Void>.Context c) throws Exception { synchronized(this) { if (mutators != null) { for (BufferedMutator bufferedMutator : mutators.values()) { try { bufferedMutator.flush(); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(c, exception); rethrowException(exception); } } } mutators.clear(); } super.finishBundle(c); }

Target:
public void finishBundle(DoFn<KV<String, Iterable<Mutation>>, Void>.Context c) throws Exception { for (BufferedMutator bufferedMutator : mutators.values()) { try { bufferedMutator.flush(); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(c, exception); rethrowException(exception); } } mutators.clear(); super.finishBundle(c); }
Source:
public void eventReceived(Action action, ConfigMap configMap) { logger.debug("Received event for configMap {}, details: {}", action, configMap.getMetadata().getName(), configMap.getData()); switch (action) { case ADDED: callbackHandler.onAdded(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case MODIFIED: callbackHandler.onModified(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case ERROR: callbackHandler.onError(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case DELETED: callbackHandler.onDeleted(Collections.singletonList(new KubernetesConfigMap(configMap))); break; default: logger.debug("Ignore handling event for configMap {}", action, configMap.getMetadata().getName()); break; } }

Target:
public void eventReceived(Action action, ConfigMap configMap) { logger.debug("Received event for configMap {}, details: {}", action, configMap.getMetadata().getName(), configMap.getData()); final List<KubernetesConfigMap> configMaps = Collections.singletonList(new KubernetesConfigMap(configMap)); switch (action) { case ADDED: callbackHandler.onAdded(configMaps); break; case MODIFIED: callbackHandler.onModified(configMaps); break; case ERROR: callbackHandler.onError(configMaps); break; case DELETED: callbackHandler.onDeleted(configMaps); break; default: logger.debug("Ignore handling event for configMap {}", action, configMap.getMetadata().getName()); break; } }
Source:
protected StorageDomain electNewMaster(boolean duringReconstruct, boolean selectInactiveWhenNoActiveUnknownDomains, boolean canChooseCurrentMasterAsNewMaster) { if (getStoragePool() == null) { log.warn("Cannot elect new master: storage pool not found"); return null; } List<StorageDomain> storageDomains = getStorageDomainDao().getAllForStoragePool(getStoragePool().getId()); if (storageDomains.isEmpty()) { log.warn("Cannot elect new master, no storage domains found for pool {}", getStoragePool().getName()); return null; } Collections.sort(storageDomains, Comparator.comparing(StorageDomain::getLastTimeUsedAsMaster) .thenComparing(Comparator.comparing(StorageDomain::isShared))); StorageDomain newMaster = null; StorageDomain storageDomain = getStorageDomain(); for (StorageDomain dbStorageDomain : storageDomains) { if (hostedEngineHelper.isHostedEngineStorageDomain(dbStorageDomain)) { continue; } if ((storageDomain == null || (duringReconstruct || !dbStorageDomain.getId() .equals(storageDomain.getId()))) && ((dbStorageDomain.getStorageDomainType() == StorageDomainType.Data) || (canChooseCurrentMasterAsNewMaster && dbStorageDomain.getStorageDomainType() == StorageDomainType.Master))) { if (dbStorageDomain.getStatus() == StorageDomainStatus.Active || dbStorageDomain.getStatus() == StorageDomainStatus.Unknown) { newMaster = dbStorageDomain; break; } else if (selectInactiveWhenNoActiveUnknownDomains && newMaster == null && dbStorageDomain.getStatus() == StorageDomainStatus.Inactive) { newMaster = dbStorageDomain; } } } return newMaster; }

Target:
protected StorageDomain electNewMaster(boolean duringReconstruct, boolean selectInactiveWhenNoActiveUnknownDomains, boolean canChooseCurrentMasterAsNewMaster) { if (getStoragePool() == null) { log.warn("Cannot elect new master: storage pool not found"); return null; } List<StorageDomain> storageDomains = getStorageDomainDao().getAllForStoragePool(getStoragePool().getId()); if (storageDomains.isEmpty()) { log.warn("Cannot elect new master, no storage domains found for pool {}", getStoragePool().getName()); return null; } Collections.sort(storageDomains, Comparator.comparing(StorageDomain::getLastTimeUsedAsMaster) .thenComparing(Comparator.comparing(StorageDomain::isLocal))); StorageDomain newMaster = null; StorageDomain storageDomain = getStorageDomain(); for (StorageDomain dbStorageDomain : storageDomains) { if (hostedEngineHelper.isHostedEngineStorageDomain(dbStorageDomain)) { continue; } if ((storageDomain == null || (duringReconstruct || !dbStorageDomain.getId() .equals(storageDomain.getId()))) && ((dbStorageDomain.getStorageDomainType() == StorageDomainType.Data) || (canChooseCurrentMasterAsNewMaster && dbStorageDomain.getStorageDomainType() == StorageDomainType.Master))) { if (dbStorageDomain.getStatus() == StorageDomainStatus.Active || dbStorageDomain.getStatus() == StorageDomainStatus.Unknown) { newMaster = dbStorageDomain; break; } else if (selectInactiveWhenNoActiveUnknownDomains && newMaster == null && dbStorageDomain.getStatus() == StorageDomainStatus.Inactive) { newMaster = dbStorageDomain; } } } return newMaster; }
Source:
protected void doDelivery(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource) { IClientExecutable<?, ?> operation; switch (theMsg.getOperationType()) { case CREATE: case UPDATE: if (thePayloadResource == null || thePayloadResource.isEmpty()) { if (thePayloadType != null) { operation = theClient.create().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } else { if (thePayloadType != null) { operation = theClient.update().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } break; case DELETE: operation = theClient.delete().resourceById(theMsg.getPayloadId(myFhirContext)); break; default: ourLog.warn("Ignoring delivery message of type: {}", theMsg.getOperationType()); return; } if (thePayloadType != null) { operation.encoded(thePayloadType); } ourLog.info("Delivering rest-hook payload for {}", theMsg.getOperationType(), thePayloadResource.getIdElement().toUnqualified().getValue(), theSubscription.getIdElement(myFhirContext).toUnqualifiedVersionless().getValue()); try { operation.execute(); } catch (ResourceNotFoundException e) { ourLog.error("Cannot reach " + theMsg.getSubscription().getEndpointUrl(), e); throw e; } }

Target:
protected void doDelivery(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource) { IClientExecutable<?, ?> operation; switch (theMsg.getOperationType()) { case CREATE: case UPDATE: if (thePayloadResource == null || thePayloadResource.isEmpty()) { if (thePayloadType != null) { operation = theClient.create().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } else { if (thePayloadType != null) { operation = theClient.update().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } break; case DELETE: operation = theClient.delete().resourceById(theMsg.getPayloadId(myFhirContext)); break; default: ourLog.warn("Ignoring delivery message of type: {}", theMsg.getOperationType()); return; } if (thePayloadType != null) { operation.encoded(thePayloadType); } ourLog.info("Delivering rest-hook payload for {}", theMsg.getOperationType(), thePayloadResource.getIdElement().toUnqualified().getValue(), theSubscription.getIdElement(myFhirContext).toUnqualifiedVersionless().getValue()); try { operation.execute(); } catch (ResourceNotFoundException e) { ourLog.error("Cannot reach ", theMsg.getSubscription().getEndpointUrl()); ourLog.error("Exception: ", e); throw e; } }
Source:
public void afterPropertiesSet() throws Exception { if (this.propertyAccessors.isEmpty()) { this.loadDefaultPropertyAccessors(this.propertyAccessors); } this.beanResolver = new BeanFactoryResolver(this.beanFactory); ConversionService conversionService = IntegrationContextUtils.getConversionService(this.beanFactory); if (conversionService != null) { this.typeConverter = new StandardTypeConverter(conversionService); } Collection<SpelFunctionRegistrar> spelFunctionRegistrars = IntegrationContextUtils.beansOfTypeIncludingAncestors(this.beanFactory, SpelFunctionRegistrar.class); for (SpelFunctionRegistrar spelFunctionRegistrar : spelFunctionRegistrars) { Map<String, Method> functions = spelFunctionRegistrar.getFunctions(); for (String key : functions.keySet()) { if (!this.functions.containsKey(key)) { this.functions.put(key, functions.get(key)); } } } Collection<SpelPropertyAccessorRegistrar> propertyAccessorRegistrars = IntegrationContextUtils.beansOfTypeIncludingAncestors(this.beanFactory, SpelPropertyAccessorRegistrar.class); for (SpelPropertyAccessorRegistrar propertyAccessorRegistrar : propertyAccessorRegistrars) { this.propertyAccessors.addAll(propertyAccessorRegistrar.getPropertyAccessors()); } }

Target:
public void afterPropertiesSet() throws Exception { if (this.propertyAccessors.isEmpty()) { this.loadDefaultPropertyAccessors(this.propertyAccessors); } if (this.applicationContext != null) { this.beanResolver = new BeanFactoryResolver(this.applicationContext); ConversionService conversionService = IntegrationContextUtils.getConversionService(this.applicationContext); if (conversionService != null) { this.typeConverter = new StandardTypeConverter(conversionService); } Map<String, SpelFunctionFactoryBean> functionFactoryBeanMap = BeanFactoryUtils.beansOfTypeIncludingAncestors(this.applicationContext, SpelFunctionFactoryBean.class); for (SpelFunctionFactoryBean spelFunctionFactoryBean : functionFactoryBeanMap.values()) { if (!this.functions.containsKey(spelFunctionFactoryBean.getFunctionName())) { this.functions.put(spelFunctionFactoryBean.getFunctionName(), spelFunctionFactoryBean.getObject()); } } try { SpelPropertyAccessorRegistrar propertyAccessorRegistrar = this.applicationContext.getBean(SpelPropertyAccessorRegistrar.class); this.propertyAccessors.addAll(propertyAccessorRegistrar.getPropertyAccessors()); } catch (NoSuchBeanDefinitionException e) { } } }
Source:
protected void validateEnterpriseRepo() { if (warningComponent != null) { warningComponent.setLinkText(""); if (!isEnterpriseTargetRuntime()) { return; } warningComponent.setLinkText(Messages.NewProjectExamplesStacksRequirementsPage_Checking_Enterprise_Maven_Repo_Availability, false); IStatus enterpriseRepoStatus = enterpriseRepoStatusMap.get(version); if (enterpriseRepoStatus != null) { updateWarningComponent(enterpriseRepoStatus); return; } final IStatus[] checkResult = new IStatus[1]; Job job = new Job(Messages.NewProjectExamplesStacksRequirementsPage_Check_Maven_Repo_Job) { @Override protected IStatus run(IProgressMonitor monitor) { if (StacksArchetypeUtil.getRequiredDependencies(version) == null) { checkResult[0] = MavenArtifactHelper.checkEnterpriseRequirementsAvailable(projectExample); } else { checkResult[0] = MavenArtifactHelper.checkRequirementsAvailable(version); } return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { enterpriseRepoStatusMap.put(version, checkResult[0]); Display.getDefault().syncExec( new Runnable() { public void run() { updateWarningComponent(checkResult[0]); } }); }; }); job.schedule(); } }

Target:
protected void validateEnterpriseRepo() { if (exampleInitialized && warningComponent != null) { warningComponent.setLinkText(""); if (!isEnterpriseTargetRuntime()) { return; } warningComponent.setLinkText(Messages.NewProjectExamplesStacksRequirementsPage_Checking_Enterprise_Maven_Repo_Availability, false); IStatus enterpriseRepoStatus = enterpriseRepoStatusMap.get(version); if (enterpriseRepoStatus != null) { updateWarningComponent(enterpriseRepoStatus); return; } final IStatus[] checkResult = new IStatus[1]; stopMavenRepoCheckJob(); job = new Job(Messages.NewProjectExamplesStacksRequirementsPage_Check_Maven_Repo_Job) { @Override protected IStatus run(IProgressMonitor monitor) { if (StacksArchetypeUtil.getRequiredDependencies(version) == null) { checkResult[0] = MavenArtifactHelper.checkEnterpriseRequirementsAvailable(projectExample); } else { checkResult[0] = MavenArtifactHelper.checkRequirementsAvailable(version); } return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { enterpriseRepoStatusMap.put(version, checkResult[0]); final IStatus status = event.getResult().isOK()?checkResult[0]:event.getResult(); Display.getDefault().syncExec( new Runnable() { public void run() { updateWarningComponent(status); } }); }; }); job.schedule(); } }
Source:
public void newColumn( final int columnIndex ) { final List<BaseColumn> expandedColumns = model.getExpandedColumns(); final BaseColumn baseColumn1 = expandedColumns.get( columnIndex ); index.columns.add( new ColumnBuilder( model, baseColumn1 ).build() ); int rowIndex = 0; for ( final List<DTCellValue52> row : model.getData() ) { final BaseColumn baseColumn = model.getExpandedColumns().get( columnIndex ); final Rule rule = getRule( rowIndex ); new CellBuilder( index, model, columnIndex, utils, baseColumn ).build( rule, row ); rowIndex++; } }

Target:
public void newColumn( final int columnIndex ) { index.columns.add( new ColumnBuilder( model, model.getExpandedColumns().get( columnIndex ) ).build() ); int rowIndex = 0; for ( final List<DTCellValue52> row : model.getData() ) { final BaseColumn baseColumn = model.getExpandedColumns().get( columnIndex ); final Rule rule = getRule( rowIndex ); new CellBuilder( index, model, columnIndex, utils, baseColumn ).build( rule, row ); rowIndex++; } }
Source:
public void getParameterName_OldAnnotation() throws NoSuchMethodException { String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualResult); }

Target:
public void getParameterName_OldAnnotation() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualRes); }
Source:
private void replayModificationsInTransaction(PrepareCommand command, boolean onePhaseCommit) throws Throwable { TransactionManager tm = txManager(); tm.begin(); try { replayModifications(command); } finally { int status = -1; try { status = tm.getStatus(); } catch (Exception e) LocalTransaction localTx = txTable().getLocalTransaction(tm.getTransaction()); localTx.setFromRemoteSite(true); if (onePhaseCommit) { if( status == Status.STATUS_ACTIVE ) { log.tracef("Committing remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.commit(); } else { log.tracef("Rolling back remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.rollback(); } } else { remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction()); } tm.suspend(); } }

Target:
private void replayModificationsInTransaction(PrepareCommand command, boolean onePhaseCommit) throws Throwable { TransactionManager tm = txManager(); boolean replaySuccessful = false; try { tm.begin(); replayModifications(command); replaySuccessful = true; } finally { LocalTransaction localTx = txTable().getLocalTransaction( tm.getTransaction() ); localTx.setFromRemoteSite(true); if (onePhaseCommit) { if( replaySuccessful ) { log.tracef("Committing remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.commit(); } else { log.tracef("Rolling back remotely originated tx %s", command.getGlobalTransaction()); tm.rollback(); } } else { remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction()); tm.suspend(); } } }