auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SessionResultsBundle(FeedbackSessionAttributes feedbackSession, Map<String, FeedbackQuestionAttributes> questionsMap, List<FeedbackResponseAttributes> responses, Map<String, boolean[]> responseVisibilityTable, Map<String, List<FeedbackResponseCommentAttributes>> responseCommentsMap, Map<Long, boolean[]> commentVisibilityTable, CourseRoster roster) { this.feedbackSession = feedbackSession; this.questionsMap = questionsMap; this.responseCommentsMap = responseCommentsMap; this.responseVisibilityTable = responseVisibilityTable; this.commentVisibilityTable = commentVisibilityTable; this.roster = roster; questionResponseMap = new LinkedHashMap<>(); List<FeedbackQuestionAttributes> questions = new ArrayList<>(questionsMap.values()); for (FeedbackQuestionAttributes question : questions) { questionResponseMap.put(question.getId(), new ArrayList<>()); } for (FeedbackResponseAttributes response : responses) { FeedbackQuestionAttributes question = questionsMap.get(response.getFeedbackQuestionId()); List<FeedbackResponseAttributes> responsesForQuestion = questionResponseMap.get(question.getId()); responsesForQuestion.add(response); } }

Target:
public SessionResultsBundle(FeedbackSessionAttributes feedbackSession, Map<String, FeedbackQuestionAttributes> questionsMap, List<FeedbackResponseAttributes> responses, Map<String, boolean[]> responseVisibilityTable, Map<String, List<FeedbackResponseCommentAttributes>> responseCommentsMap, Map<Long, boolean[]> commentVisibilityTable, CourseRoster roster) { this.feedbackSession = feedbackSession; this.questionsMap = questionsMap; this.responseCommentsMap = responseCommentsMap; this.responseVisibilityTable = responseVisibilityTable; this.commentVisibilityTable = commentVisibilityTable; this.roster = roster; buildQuestionToResponseMap(responses); }
Source:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { new ExternalNetworkManager(oldIface).deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { VmDeviceUtils.clearNicAddress(getInterface().getVmId(), getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { new ExternalNetworkManager(oldIface).deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { getVmDeviceDao().clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }
Source:
static ReceiveCommand parseCommand(String line) { final ObjectId oldId = ObjectId.fromString(line.substring(0, 40)); final ObjectId newId = ObjectId.fromString(line.substring(41, 81)); String name = line.substring(82); final ReceiveCommand cmd = new ReceiveCommand(oldId, newId, name); return cmd; }

Target:
static ReceiveCommand parseCommand(String line) { ObjectId oldId = ObjectId.fromString(line.substring(0, 40)); ObjectId newId = ObjectId.fromString(line.substring(41, 81)); String name = line.substring(82); return new ReceiveCommand(oldId, newId, name); }
Source:
protected void postShutdownHook() { if (_enablePartitionAssignment) { boolean isInterrupted = false; for (int numAttempts = 0; numAttempts < 3; ++numAttempts) { try { LOG.info("Releasing the lock on datastreamTask: {}, isInterrupted: {}", _datastreamTask, isInterrupted); _datastreamTask.release(); return; } catch (ZkInterruptedException e) { LOG.warn("Releasing the task lock failed for datastreamTask: {}, retrying", _datastreamTask); if (Thread.currentThread().isInterrupted()) { isInterrupted = Thread.interrupted(); } } finally { if (isInterrupted) { Thread.currentThread().interrupt(); } } } } }

Target:
protected void postShutdownHook() { if (_enablePartitionAssignment) { boolean resetInterrupted = false; try { for (int numAttempts = 1; numAttempts <= 3; ++numAttempts) { try { LOG.info("Releasing the lock on datastreamTask: {}, was thread interrupted: {}, attempt: {}", _datastreamTask, resetInterrupted, numAttempts); _datastreamTask.release(); break; } catch (ZkInterruptedException e) { LOG.warn("Releasing the task lock failed for datastreamTask: {}, retrying", _datastreamTask); if (Thread.currentThread().isInterrupted()) { resetInterrupted = Thread.interrupted(); } } } } finally { if (resetInterrupted) { Thread.currentThread().interrupt(); } } } }
Source:
public FindResultViewImpl( PartStackUIResources resources, FindResultNodeFactory findResultNodeFactory, CoreLocalizationConstant localizationConstant) { super(resources); setTitle(localizationConstant.actionFullTextSearch()); this.findResultNodeFactory = findResultNodeFactory; NodeStorage nodeStorage = new NodeStorage(); NodeLoader loader = new NodeLoader(Collections.<NodeInterceptor>emptySet()); tree = new Tree(nodeStorage, loader); tree.ensureDebugId("resultSearchTree"); ensureDebugId("findInfoPanel"); tree.getSelectionModel() .addSelectionChangedHandler( new SelectionChangedEvent.SelectionChangedHandler() { @Override public void onSelectionChanged(SelectionChangedEvent event) { delegate.onSelectionChanged(event.getSelection()); } }); setContentWidget(tree); tree.setAutoSelect(true); }

Target:
public FindResultViewImpl( PartStackUIResources resources, FindResultNodeFactory findResultNodeFactory, CoreLocalizationConstant localizationConstant) { super(resources); setTitle(localizationConstant.actionFullTextSearch()); this.findResultNodeFactory = findResultNodeFactory; NodeStorage nodeStorage = new NodeStorage(); NodeLoader loader = new NodeLoader(Collections.<NodeInterceptor>emptySet()); tree = new Tree(nodeStorage, loader); tree.ensureDebugId("result-search-tree"); ensureDebugId("find-info-panel"); tree.getSelectionModel() .addSelectionChangedHandler( new SelectionChangedEvent.SelectionChangedHandler() { @Override public void onSelectionChanged(SelectionChangedEvent event) { delegate.onSelectionChanged(event.getSelection()); } }); setContentWidget(tree); tree.setAutoSelect(true); }
Source:
public GitHubPRPullRequest(GHPullRequest pr) throws IOException { userLogin = pr.getUser().getLogin(); number = pr.getNumber(); prUpdatedAt = pr.getUpdatedAt(); issueUpdatedAt = pr.getUpdatedAt(); headSha = pr.getHead().getSha(); headRef = pr.getHead().getRef(); title = pr.getTitle(); baseRef = pr.getBase().getRef(); htmlUrl = pr.getHtmlUrl(); try { Date maxDate = new Date(0); List<GHIssueComment> comments = execute(() -> pr.getComments()); for (GHIssueComment comment : comments) { if (comment.getCreatedAt().compareTo(maxDate) > 0) { maxDate = comment.getCreatedAt(); } } lastCommentCreatedAt = maxDate.getTime() == 0 ? null : new Date(maxDate.getTime()); } catch (IOException e) { LOGGER.error("Can't get comments for PR: {}", pr.getNumber(), e); lastCommentCreatedAt = null; } try { userEmail = execute(() -> pr.getUser().getEmail()); } catch (Exception e) { LOGGER.error("Can't get GitHub user email.", e); userEmail = ""; } GHRepository remoteRepo = pr.getRepository(); try { updateLabels(execute(() -> remoteRepo.getIssue(number).getLabels())); } catch (IOException e) { LOGGER.error("Can't retrieve label list: {}", e); inBadState = true; } try { mergeable = execute(() -> pr.getMergeable()); } catch (IOException e) { LOGGER.error("Can't get mergeable status.", e); mergeable = false; } sourceRepoOwner = remoteRepo.getOwnerName(); state = pr.getState().toString(); body = pr.getBody(); }

Target:
public GitHubPRPullRequest(GHPullRequest pr) throws IOException { userLogin = pr.getUser().getLogin(); number = pr.getNumber(); prUpdatedAt = pr.getUpdatedAt(); issueUpdatedAt = pr.getIssueUpdatedAt(); headSha = pr.getHead().getSha(); headRef = pr.getHead().getRef(); title = pr.getTitle(); baseRef = pr.getBase().getRef(); htmlUrl = pr.getHtmlUrl(); try { Date maxDate = new Date(0); List<GHIssueComment> comments = execute(() -> pr.getComments()); for (GHIssueComment comment : comments) { if (comment.getCreatedAt().compareTo(maxDate) > 0) { maxDate = comment.getCreatedAt(); } } lastCommentCreatedAt = maxDate.getTime() == 0 ? null : new Date(maxDate.getTime()); } catch (IOException e) { LOGGER.error("Can't get comments for PR: {}", pr.getNumber(), e); lastCommentCreatedAt = null; } try { userEmail = execute(() -> pr.getUser().getEmail()); } catch (Exception e) { LOGGER.error("Can't get GitHub user email.", e); userEmail = ""; } GHRepository remoteRepo = pr.getRepository(); try { updateLabels(execute(() -> remoteRepo.getIssue(number).getLabels())); } catch (IOException e) { LOGGER.error("Can't retrieve label list: {}", e); inBadState = true; } try { mergeable = execute(() -> pr.getMergeable()); } catch (IOException e) { LOGGER.error("Can't get mergeable status.", e); mergeable = false; } sourceRepoOwner = remoteRepo.getOwnerName(); state = pr.getState().toString(); body = pr.getBody(); }
Source:
public FyberRewardedVideoRenderer(MediationRewardedAdConfiguration adConfiguration, MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> adLoadCallback) { mAdConfiguration = adConfiguration; mAdLoadCallback = adLoadCallback; }

Target:
FyberRewardedVideoRenderer(MediationRewardedAdConfiguration adConfiguration, MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> adLoadCallback) { mAdConfiguration = adConfiguration; mAdLoadCallback = adLoadCallback; }
Source:
private Tuple2<ProtectedMailboxStorageEntry, DecryptedMessageWithPubKey> decryptProtectedMailboxStorageEntry( ProtectedMailboxStorageEntry protectedMailboxStorageEntry) { try { DecryptedMessageWithPubKey decryptedMessageWithPubKey = encryptionService.decryptAndVerify(protectedMailboxStorageEntry .getMailboxStoragePayload() .getPrefixedSealedAndSignedMessage() .getSealedAndSigned()); checkArgument(decryptedMessageWithPubKey.getNetworkEnvelope() instanceof MailboxMessage); return new Tuple2<>(protectedMailboxStorageEntry, decryptedMessageWithPubKey); } catch (CryptoException ignore) { } catch (ProtobufferException e) { log.error(e.toString()); e.getStackTrace(); } return null; }

Target:
private MailboxItem decryptProtectedMailboxStorageEntry(ProtectedMailboxStorageEntry protectedMailboxStorageEntry) { try { DecryptedMessageWithPubKey decryptedMessageWithPubKey = encryptionService.decryptAndVerify(protectedMailboxStorageEntry .getMailboxStoragePayload() .getPrefixedSealedAndSignedMessage() .getSealedAndSigned()); checkArgument(decryptedMessageWithPubKey.getNetworkEnvelope() instanceof MailboxMessage); return new MailboxItem(protectedMailboxStorageEntry, decryptedMessageWithPubKey); } catch (CryptoException ignore) { } catch (ProtobufferException e) { log.error(e.toString()); e.getStackTrace(); } return null; }
Source:
public boolean enterATCommandMode() throws InvalidOperatingModeException, XBeeException { if (operatingMode != OperatingMode.AT) throw new InvalidOperatingModeException("Invalid mode. Command mode can only be accesses while in AT mode."); byte[] readData = new byte[256]; try { connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); Thread.sleep(1500); int readBytes = connectionInterface.readData(readData); if (readBytes < 3) throw new XBeeException(XBeeException.CONNECTION_TIMEOUT); for (int i = 0; i < 3; i++) { if (readData[i] != COMMAND_MODE_OK.getBytes()[i]) return false; } return true; } catch (IOException e) { } catch (InterruptedException e) { } return false; }

Target:
public boolean enterATCommandMode() throws InvalidOperatingModeException, XBeeException { if (operatingMode != OperatingMode.AT) throw new InvalidOperatingModeException("Invalid mode. Command mode can only be accesses while in AT mode."); byte[] readData = new byte[256]; try { connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); Thread.sleep(TIMEOUT_ENTER_COMMAND_MODE); int readBytes = connectionInterface.readData(readData); if (readBytes < COMMAND_MODE_OK.length()) throw new XBeeException(XBeeException.CONNECTION_TIMEOUT); String readString = new String(readData, 0, readBytes); if (!readString.contains(COMMAND_MODE_OK)) return false; return true; } catch (IOException e) { } catch (InterruptedException e) { } return false; }
Source:
public void setUp() throws Exception { testUser = "testUser" + System.currentTimeMillis(); testEmail = testUser + "@gmail.com"; String testPassword = "pwspws"; listenerMock = Mockito.mock(TaskListener.class); authenticator = new ServerAuthenticator(testUser, testPassword, token, CatrobatWebClient.INSTANCE.getClient(), BASE_URL_TEST_HTTPS, listenerMock ); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); }

Target:
public void setUp() throws Exception { testUser = "testUser" + System.currentTimeMillis(); testEmail = testUser + "@gmail.com"; String testPassword = "pwspws"; listenerMock = Mockito.mock(TaskListener.class); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); authenticator = new ServerAuthenticator(testUser, testPassword, token, CatrobatWebClient.INSTANCE.getClient(), BASE_URL_TEST_HTTPS, sharedPreferences.edit(), listenerMock); }
Source:
public List<PoolUpdate> updatePoolsFromStack(Consumer consumer, List<Pool> pools, boolean deleteIfNoStackedEnts) { Map<String, List<Entitlement>> entitlementMap = new HashMap<String, List<Entitlement>>(); Set<String> sourceStackIds = new HashSet<String>(); List<PoolUpdate> result = new ArrayList<PoolUpdate>(); for (Pool pool : pools) { sourceStackIds.add(pool.getSourceStackId()); } List<Entitlement> stackedEnts = this.entCurator.findByStackIds(consumer, sourceStackIds); for (Entitlement entitlement : stackedEnts) { if (!entitlementMap.containsKey(entitlement.getPool().getStackId())) { entitlementMap.put(entitlement.getPool().getStackId(), new ArrayList<Entitlement>()); } entitlementMap.get(entitlement.getPool().getStackId()).add(entitlement); } List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool pool : pools) { List<Entitlement> entitlements = entitlementMap.get(pool.getSourceStackId()); if (CollectionUtils.isNotEmpty(entitlements)) { result.add(this.updatePoolFromStackedEntitlements(pool, entitlements, new HashSet<Product>())); } else if (deleteIfNoStackedEnts) { poolsToDelete.add(pool); } } if (!poolsToDelete.isEmpty()) { this.poolManager.deletePools(poolsToDelete); } return result; }

Target:
public List<PoolUpdate> updatePoolsFromStack(Consumer consumer, List<Pool> pools, boolean deleteIfNoStackedEnts) { Map<String, List<Entitlement>> entitlementMap = new HashMap<String, List<Entitlement>>(); Set<String> sourceStackIds = new HashSet<String>(); List<PoolUpdate> result = new ArrayList<PoolUpdate>(); for (Pool pool : pools) { sourceStackIds.add(pool.getSourceStackId()); } List<Entitlement> stackedEnts = this.entCurator.findByStackIds(consumer, sourceStackIds); for (Entitlement entitlement : stackedEnts) { List<Entitlement> ents = entitlementMap.get(entitlement.getPool().getStackId()); if (ents == null) { ents = new ArrayList<Entitlement>(); entitlementMap.put(entitlement.getPool().getStackId(), ents); } ents.add(entitlement); } List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool pool : pools) { List<Entitlement> entitlements = entitlementMap.get(pool.getSourceStackId()); if (CollectionUtils.isNotEmpty(entitlements)) { result.add(this.updatePoolFromStackedEntitlements(pool, entitlements, new HashSet<Product>())); } else if (deleteIfNoStackedEnts) { poolsToDelete.add(pool); } } if (!poolsToDelete.isEmpty()) { this.poolManager.deletePools(poolsToDelete); } return result; }
Source:
public boolean isMatch(String ref) { if (ref == null) return false; if (isWildcard) return ref.startsWith(refName.substring(0, refName.length() - 1)); return refName.equals(ref); }

Target:
public boolean isMatch(String ref) { if (ref == null) return false; if (isWildcard) return ref.startsWith(stripWildcard(refName)); return refName.equals(ref); }
Source:
public boolean isBare() { boolean bareSet = getConfig().getString( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_BARE) != null; if (bareSet) return getConfig().getBoolean(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_BARE, false); if (gitDirExplicit && workDir == null) return true; if (getDirectory().getName().equals(Constants.DOT_GIT)) return false; return true; }

Target:
public boolean isBare() { return workDir == null; }
Source:
protected String getProjectLocation() { IProject project = getProject(); if (null != project) { return project.getLocation().toOSString(); } return null; }

Target:
protected String getProjectLocation() { IProject project = getProject(); if (null != project) { return project.getLocation().toString(); } return null; }
Source:
public List<Rules> getEnabledRules() throws ArgumentParserException { List<Rules> enabledRules = new LinkedList<>(Arrays.asList(Rules.values())); List<String> enabledRuleNames = enabledRules.stream().map(Rules::getName).collect(Collectors.toList()); if (this.cmd.getOptionValues(ONLY_OPT) != null) { List<String> onlySpecificRules = new LinkedList<>(Arrays.asList(this.cmd.getOptionValues(ONLY_OPT))); checkValidRules(enabledRuleNames, onlySpecificRules); return enabledRules.stream().filter(onlySpecificRules::contains).collect(Collectors.toList()); } else if (this.cmd.getOptionValues(EXCLUDE_OPT) != null) { List<String> excludedRules = new LinkedList<>(Arrays.asList(this.cmd.getOptionValues(EXCLUDE_OPT))); checkValidRules(enabledRuleNames, excludedRules); return enabledRules.stream() .filter(rule -> !excludedRules.contains(rule.getName())).collect(Collectors.toList()); } return enabledRules; }

Target:
public Set<Rules> getEnabledRules() throws ArgumentParserException { Set<Rules> enabledRules = new HashSet<>(Arrays.asList(Rules.values())); Set<String> enabledRuleNames = enabledRules.stream().map(Rules::getName).collect(Collectors.toSet()); if (this.cmd.hasOption(ONLY_OPT)) { Set<String> onlySpecificRules = new HashSet<>(Arrays.asList(this.cmd.getOptionValues(ONLY_OPT))); checkValidRules(enabledRuleNames, onlySpecificRules); return enabledRules.stream() .filter(rule -> onlySpecificRules.contains(rule.getName())).collect(Collectors.toSet()); } else if (this.cmd.hasOption(EXCEPT_OPT)) { Set<String> excludedRules = new HashSet<>(Arrays.asList(this.cmd.getOptionValues(EXCEPT_OPT))); checkValidRules(enabledRuleNames, excludedRules); return enabledRules.stream() .filter(rule -> !excludedRules.contains(rule.getName())).collect(Collectors.toSet()); } return enabledRules; }
Source:
private void createIndexArea(Composite parent, FormToolkit toolkit, int span) { stagedDiffSection = createSection(parent, toolkit, span); String sectionTitle = MessageFormat.format( UIText.StashEditorPage_StagedChanges, Integer.valueOf(0)); stagedDiffSection.setText(sectionTitle); Composite unstagedChangesArea = createSectionClient( stagedDiffSection, toolkit); stagedDiffViewer = new CommitFileDiffViewer(unstagedChangesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); Control control = stagedDiffViewer.getControl(); if (control != null) { control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).applyTo(control); addToFocusTracking(control); } stagedDiffViewer.setContentProvider(ArrayContentProvider .getInstance()); stagedDiffViewer.setTreeWalk(getCommit().getRepository(), null); updateSectionClient(stagedDiffSection, unstagedChangesArea, toolkit); }

Target:
private void createIndexArea(Composite parent, FormToolkit toolkit, int span) { stagedDiffSection = createSection(parent, toolkit, span); String sectionTitle = MessageFormat.format( UIText.StashEditorPage_StagedChanges, Integer.valueOf(0)); stagedDiffSection.setText(sectionTitle); Composite unstagedChangesArea = createSectionClient( stagedDiffSection, toolkit); stagedDiffViewer = new CommitFileDiffViewer(unstagedChangesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); Control control = stagedDiffViewer.getControl(); control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).applyTo(control); addToFocusTracking(control); stagedDiffViewer.setContentProvider(ArrayContentProvider .getInstance()); stagedDiffViewer.setTreeWalk(getCommit().getRepository(), null); updateSectionClient(stagedDiffSection, unstagedChangesArea, toolkit); }
Source:
public void testFetchAuditEntriesForAllDataSources() throws Exception { List<Rule> rules = Arrays.<Rule>asList( new IntervalLoadRule( new Interval("2015-01-01/2015-02-01"), ImmutableMap.<String, Integer>of( DruidServer.DEFAULT_TIER, DruidServer.DEFAULT_NUM_REPLICANTS ) ) ); AuditInfo auditInfo = new AuditInfo("test_author", "test_comment", "127.0.0.1"); ruleManager.overrideRule( "test_dataSource", rules, auditInfo ); ruleManager.overrideRule( "test_dataSource2", rules, auditInfo ); ruleManager.poll(); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource")); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource2")); List<AuditEntry> auditEntries = auditManager.fetchAuditHistory("rules", null); Assert.assertEquals(2, auditEntries.size()); for (AuditEntry entry : auditEntries) { Assert.assertEquals(mapper.writeValueAsString(rules), entry.getPayload()); Assert.assertEquals(auditInfo, entry.getAuditInfo()); } }

Target:
public void testFetchAuditEntriesForAllDataSources() throws Exception { List<Rule> rules = Arrays.<Rule>asList( new IntervalLoadRule( new Interval("2015-01-01/2015-02-01"), ImmutableMap.<String, Integer>of( DruidServer.DEFAULT_TIER, DruidServer.DEFAULT_NUM_REPLICANTS ) ) ); AuditInfo auditInfo = new AuditInfo("test_author", "test_comment", "127.0.0.1"); ruleManager.overrideRule( "test_dataSource", rules, auditInfo ); ruleManager.overrideRule( "test_dataSource2", rules, auditInfo ); ruleManager.poll(); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource")); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource2")); List<AuditEntry> auditEntries = auditManager.fetchAuditHistory("rules", null); Assert.assertEquals(2, auditEntries.size()); for (AuditEntry entry : auditEntries) { Assert.assertEquals( rules, mapper.readValue( entry.getPayload(), new TypeReference<List<Rule>>() { } ) ); Assert.assertEquals(auditInfo, entry.getAuditInfo()); } }
Source:
public void removeDeviceModelFirmware(@Identification final String organisationIdentification, @Valid final int firmwareIdentification) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.REMOVE_DEVICE_MODEL_FIRMWARE); final DeviceModelFirmware removedDeviceModelFirmware = this.deviceModelFirmwareRepository.findById(Long.valueOf(firmwareIdentification)); if (removedDeviceModelFirmware == null) { LOGGER.info("DeviceModelFirmware not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL_FIRMWARE, ComponentType.WS_CORE, new UnknownEntityException(DeviceModelFirmware.class, String.valueOf(firmwareIdentification))); } else { this.deviceModelFirmwareRepository.delete(removedDeviceModelFirmware); } }

Target:
public void removeDeviceModelFirmware(@Identification final String organisationIdentification, @Valid final int firmwareIdentification) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.REMOVE_DEVICE_MODEL_FIRMWARE); final DeviceModelFirmware removedDeviceModelFirmware = this.deviceModelFirmwareRepository.findById(Long.valueOf(firmwareIdentification)); if (removedDeviceModelFirmware == null) { LOGGER.info("DeviceModelFirmware not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL_FIRMWARE, ComponentType.WS_CORE, new UnknownEntityException(DeviceModelFirmware.class, String.valueOf(firmwareIdentification))); } this.deviceModelFirmwareRepository.delete(removedDeviceModelFirmware); }
Source:
private boolean needsInforming() { final Integer repeat = settings.KEEP_INFORMING.get(); if (repeat == null || repeat == 0) return false; final long now = System.currentTimeMillis(); if (lastAnnouncement + repeat * 60 * 1000L < now) { lastAnnouncement = now; return true; } return false; }

Target:
private boolean needsInforming() { final Integer repeat = settings.KEEP_INFORMING.get(); if (repeat == null || repeat == 0) return false; final long notBefore = lastAnnouncement + repeat * 60 * 1000L; return System.currentTimeMillis() > notBefore; }
Source:
public void doPeriodicWork(int today) { if (activeUserCache.claimActiveWorker(workerId, WORKER_TTL_MS)) { try { Optional<Long> id = activeUserCache.getId(); int date = activeUserCache.getDate(); if (today > date) { date = today; id = Optional.of(ActiveUserCache.INITIAL_ID); activeUserCache.setId(id); activeUserCache.setDate(date); activeUserCache.resetTallies(PLATFORMS, INTERVALS); logger.info(date + " started"); } if (id.isPresent()) { id = processChunk(date, id.get(), CHUNK_SIZE); activeUserCache.setId(id); if (!id.isPresent()) { registerMetrics(); logger.info(date + " completed"); } } lastDate = date; lastId = id; } finally { activeUserCache.releaseActiveWorker(workerId); } } }

Target:
public boolean doPeriodicWork(int today) { if (activeUserCache.claimActiveWorker(workerId, WORKER_TTL_MS)) { try { long startTimeMs = System.currentTimeMillis(); Optional<String> number = activeUserCache.getLastNumberVisited(); int date = activeUserCache.getDateToReport(INITIAL_DATE); if (today > date) { logger.info(date + " started"); date = today; number = Optional.of(INITIAL_NUMBER); activeUserCache.setLastNumberVisited(number); activeUserCache.setDateToReport(date); activeUserCache.resetTallies(PLATFORMS, INTERVALS); } if (!number.isPresent()) return false; number = processChunk(date, number.get(), CHUNK_SIZE); activeUserCache.setLastNumberVisited(number); if (!number.isPresent()) { logger.info(date + " completed"); registerMetrics(); return false; } long endTimeMs = System.currentTimeMillis(); long sleepInterval = getDelayWithJitter() - (endTimeMs - startTimeMs); if (sleepInterval > 0) sleepWhileRunning(sleepInterval); } finally { activeUserCache.releaseActiveWorker(workerId); } } return true; }
Source:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { super.recordCapabilitiesAndRequirements(context, operation, resource); ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, resource.getModel()); if (defaultTracer.isDefined()) { context.deregisterCapability(RuntimeCapability.Builder.of(DEFAULT_TRACER_CAPABILITY.getDynamicName(defaultTracer.asString()), false).build().getName()); } }

Target:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { super.recordCapabilitiesAndRequirements(context, operation, resource); ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, resource.getModel()); if (defaultTracer.isDefined()) { context.deregisterCapability(DEFAULT_TRACER_CAPABILITY_NAME); } }
Source:
public boolean forceRun() { return true; }

Target:
public boolean forceRun() { try { return !new DotDatabaseMetaData().getColumnNames(DbConnectionFactory.getConnection(), "publishing_bundle").contains("filter_key"); } catch (SQLException e) { Logger.error(this, e.getMessage(),e); return false; } }
Source:
void move(byte[] encodedRegionName, ServerName destServerName) throws IOException; void assign(byte[] regionName) throws IOException; void unassign(byte[] regionName) throws IOException; @Deprecated void unassign(byte[] regionName, boolean force) throws IOException; void offline(byte[] regionName) throws IOException; boolean balancerSwitch(boolean onOrOff, boolean synchronous) throws IOException; boolean balance() throws IOException; boolean balance(boolean force) throws IOException; boolean isBalancerEnabled() throws IOException; CacheEvictionStats clearBlockCache(final TableName tableName) throws IOException; boolean normalize() throws IOException; boolean isNormalizerEnabled() throws IOException; boolean normalizerSwitch(boolean on) throws IOException; boolean catalogJanitorSwitch(boolean onOrOff) throws IOException; int runCatalogJanitor() throws IOException; boolean isCatalogJanitorEnabled() throws IOException; boolean cleanerChoreSwitch(boolean onOrOff) throws IOException; boolean runCleanerChore() throws IOException; boolean isCleanerChoreEnabled() throws IOException; @Deprecated default Future<Void> mergeRegionsAsync(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) throws IOException { byte[][] nameofRegionsToMerge = new byte[2][]; nameofRegionsToMerge[0] = nameOfRegionA; nameofRegionsToMerge[1] = nameOfRegionB; return mergeRegionsAsync(nameofRegionsToMerge, forcible); }

Target:
void move(byte[] encodedRegionName, ServerName destServerName) throws IOException; void assign(byte[] regionName) throws IOException; void unassign(byte[] regionName) throws IOException; @Deprecated default void unassign(byte[] regionName, boolean force) throws IOException { unassign(regionName); }
Source:
public String toString() { return String.format("PackExt[%s]", getExtension()); }

Target:
public String toString() { return String.format("PackExt[%s, bit=0x%s]", getExtension(), Integer.toHexString(1 << getPosition())); }
Source:
public void restart() throws IOException, InterruptedException { Jenkins jenkins = Jenkins.getInstance(); if (jenkins != null) { jenkins.cleanUp(); } File me = getHudsonWar(); File home = me.getParentFile(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); String exe = System.getenv("WINSW_EXECUTABLE"); File executable; if (exe!=null) executable = new File(exe); else executable = new File(home, "hudson.exe"); if (!executable.exists()) executable = new File(home, "jenkins.exe"); int r = new LocalLauncher(task).launch().cmds(executable, "restart!") .stdout(task).pwd(home).join(); if(r!=0) throw new IOException(baos.toString()); }

Target:
public void restart() throws IOException, InterruptedException { Jenkins jenkins = Jenkins.getInstance(); try { if (jenkins != null) { jenkins.cleanUp(); } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); } File me = getHudsonWar(); File home = me.getParentFile(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); String exe = System.getenv("WINSW_EXECUTABLE"); File executable; if (exe!=null) executable = new File(exe); else executable = new File(home, "hudson.exe"); if (!executable.exists()) executable = new File(home, "jenkins.exe"); int r = new LocalLauncher(task).launch().cmds(executable, "restart!") .stdout(task).pwd(home).join(); if(r!=0) throw new IOException(baos.toString()); }
Source:
public Path generateArtifact(URI uri, int size) throws IOException { this.in(Paths.get(uri)); return(this.buildPublishJson()); }

Target:
public Path generateArtifact(URI uri, int size) throws IOException { buildPublishJson(); return getPackagePath(); }
Source:
public String toString() { return new StringBuilder() .append("Injectable type: Invoker") .append(", accessor: ").append(methodLocation.name) .append(", method name: ").append(methodName) .append(", invokes method: ").append(mName).toString(); }

Target:
public String toString() { return String.format("Injectable type: Invoker, accessor: %s, method name: %s, invokes method: %s", methodLocation.name, methodName, mName); }
Source:
public static void sendOutcomeWithValue(@NonNull String name, float value, OutcomeCallback callback) { if (!isValidOutcomeEntry(name) && !isValidOutcomeValue(value)) return; if (outcomeEventsController == null) { OneSignal.Log(LOG_LEVEL.ERROR, "Make sure OneSignal.init is called first"); return; } outcomeEventsController.sendOutcomeEventWithValue(name, value, callback); }

Target:
public static void sendOutcomeWithValue(@NonNull String name, float value, OutcomeCallback callback) { if (!isValidOutcomeEntry(name) || !isValidOutcomeValue(value)) return; if (outcomeEventsController == null) { OneSignal.Log(LOG_LEVEL.ERROR, "Make sure OneSignal.init is called first"); return; } outcomeEventsController.sendOutcomeEventWithValue(name, value, callback); }
Source:
private PerfTimer(final String title, final int reportingFrequency) { this.title = title; this.reportingFrequency = reportingFrequency; this.startMillis = this.reportingFrequency > 0 ? System.nanoTime() : 0; }

Target:
private PerfTimer(final String title, final int reportingFrequency) { this.title = title; this.reportingFrequency = reportingFrequency; this.startNanos = System.nanoTime(); }
Source:
public void initSequence(String key, int id) { try { Bson filter = and(eq(MongoDBSerializationHelper.MONGODB_ID, key), not(gte(SEQUENCE_VALUE_FIELD, id))); Document sequence = new Document(); sequence.put(MongoDBSerializationHelper.MONGODB_ID, key); sequence.put(SEQUENCE_VALUE_FIELD, id); getSequencerCollection().replaceOne(filter, sequence, new UpdateOptions().upsert(true)); } catch (MongoWriteException e) { if (log.isWarnEnabled()) { log.warn("Failed to update the sequence '" + key + "' with value "+id, e); } } }

Target:
public void initSequence(String key, int id) { try { Bson filter = and(eq(MongoDBSerializationHelper.MONGODB_ID, key), not(gte(SEQUENCE_VALUE_FIELD, id))); Document sequence = new Document(); sequence.put(MongoDBSerializationHelper.MONGODB_ID, key); sequence.put(SEQUENCE_VALUE_FIELD, id); getSequencerCollection().replaceOne(filter, sequence, new UpdateOptions().upsert(true)); } catch (MongoWriteException e) { throw new NuxeoException("Failed to update the sequence '" + key + "' with value " + id, e); } }
Source:
public void addTaskAssocation(ITask review, TaskData taskData) { TaskAttribute attr = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); if (attr == null) { return; } String description = attr.getValue(); for (String token : description.split("\\s+")) { if (token.contains("://")) { try { @SuppressWarnings("unused") URL url = new URL(token); ITask task = getTaskByUrl(token); if (task != null) { review.setAttribute(ATTR_ASSOCIATED_TASK, task.getUrl()); updateMapping(review, task); break; } else { review.setAttribute(ATTR_ASSOCIATED_TASK, null); } } catch (MalformedURLException e) { } } } }

Target:
public void addTaskAssocation(ITask review, TaskData taskData) { TaskAttribute attr = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); if (attr == null) { return; } String description = attr.getValue(); for (String token : description.split("\\s+")) { if (token.contains("://")) { try { @SuppressWarnings("unused") URL url = new URL(token); ITask task = getTaskByUrl(token); if (task != null) { updateMapping(review, task); review.setAttribute(ATTR_ASSOCIATED_TASK, task.getUrl()); return; } } catch (MalformedURLException e) { } } } deleteMappingsTo(review); }
Source:
public V get(final K key) throws CacheLoaderException { getObserver.begin(); cacheLoaderObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(key); final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { loaded = cacheLoader.load(k); cacheLoaderObserver.end(CacheLoaderOutcome.SUCCESS); } } catch (Exception e) { cacheLoaderObserver.end(CacheLoaderOutcome.FAILURE); throw newCacheLoaderException(e); } return loaded; } }); try { final Store.ValueHolder<V> valueHolder = store.computeIfAbsent(key, mappingFunction); if (valueHolder == null) { getObserver.end(cacheLoader == null ? GetOutcome.MISS_NO_LOADER : GetOutcome.MISS_WITH_LOADER); return null; } else { getObserver.end(cacheLoader == null ? GetOutcome.HIT_NO_LOADER : GetOutcome.HIT_WITH_LOADER); return valueHolder.value(); } } catch (CacheAccessException e) { getObserver.end(GetOutcome.FAILURE); removeKeysWithStrategy(Collections.singleton(key), e); return mappingFunction.apply(key); } catch (CacheLoaderException e) { getObserver.end(GetOutcome.FAILURE); removeKeysWithStrategy(Collections.singleton(key), e); throw e; } }

Target:
public V get(final K key) throws CacheLoaderException { getObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(key); final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { cacheLoaderObserver.begin(); loaded = cacheLoader.load(k); cacheLoaderObserver.end(CacheLoaderOutcome.SUCCESS); getObserver.end(loaded != null ? GetOutcome.HIT_WITH_LOADER : GetOutcome.MISS_WITH_LOADER); } } catch (Exception e) { cacheLoaderObserver.end(CacheLoaderOutcome.FAILURE); throw newCacheLoaderException(e); } return loaded; } }); try { final Store.ValueHolder<V> valueHolder = store.computeIfAbsent(key, mappingFunction); if (valueHolder == null) { if (cacheLoader == null) { getObserver.end(GetOutcome.MISS_NO_LOADER); } return null; } else { if (cacheLoader == null) { getObserver.end(GetOutcome.HIT_NO_LOADER); } return valueHolder.value(); } } catch (CacheAccessException e) { getObserver.end(GetOutcome.FAILURE); removeKeysWithStrategy(Collections.singleton(key), e); return mappingFunction.apply(key); } catch (CacheLoaderException e) { getObserver.end(GetOutcome.FAILURE); removeKeysWithStrategy(Collections.singleton(key), e); throw e; } }
Source:
public void sendTicketTransferMail(User sender, User receiver, String url) throws MessagingException { String message = "The user \"" + sender.getUsername() + "\" has send you a ticket for AreaFiftyLAN! To accept this ticket please click on the following link: " + url; sendMail(receiver.getEmail(), receiver.getUsername(), null, "A ticket for AreaFiftyLAN has been sent to you!", message); }

Target:
public void sendTicketTransferMail(User sender, User receiver, String url) throws MessagingException { String message = sender.getProfile().firstName + " has send you a ticket for AreaFiftyLAN! To accept this ticket please click on the following link: " + url; sendMail(receiver.getEmail(), receiver.getProfile().getFirstName() + receiver.getProfile().getLastName(), null, "A ticket for AreaFiftyLAN has been sent to you!", message); }
Source:
public void factoryWithDirectUrlWithRootFolder() { String repositoryName = testRepo.getName(); List<String> expectedItemsAfterCloning = Arrays.asList( "CHANGELOG.md", "Dockerfile", "LICENSE.txt", "README.md", "favicon.ico", "index.html", "karma-test-shim.js", "karma.conf.js", "package.json", "protractor.config.js", "styles.css", "systemjs.config.js", "tsconfig.json", "tslint.json", "typings.json", "wallaby.js"); testFactoryWithRootFolder.authenticateAndOpen(); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); theiaIde.waitLoaderInvisibility(); theiaIde.waitNotificationDisappearance("Che Workspace: Finished cloning projects."); theiaIde.waitNotificationDisappearance( "Che Workspace: Finished cloning projects.", UPDATING_PROJECT_TIMEOUT_SEC); theiaProjectTree.waitFilesTab(); theiaProjectTree.clickOnFilesTab(); theiaProjectTree.waitItem(repositoryName); theiaProjectTree.expandItem(repositoryName); expectedItemsAfterCloning.forEach( name -> { theiaProjectTree.waitItem(repositoryName + "/" + name); }); }

Target:
public void factoryWithDirectUrlWithRootFolder() { String repositoryName = testRepo.getName(); List<String> expectedItemsAfterCloning = Arrays.asList( "CHANGELOG.md", "Dockerfile", "LICENSE.txt", "README.md", "favicon.ico", "index.html", "karma-test-shim.js", "karma.conf.js", "package.json", "protractor.config.js", "styles.css", "systemjs.config.js", "tsconfig.json", "tslint.json", "typings.json", "wallaby.js"); testFactoryWithRootFolder.authenticateAndOpen(); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); theiaIde.waitLoaderInvisibility(); theiaIde.waitNotificationDisappearance( "Che Workspace: Finished cloning projects.", UPDATING_PROJECT_TIMEOUT_SEC); theiaProjectTree.waitFilesTab(); theiaProjectTree.clickOnFilesTab(); theiaProjectTree.waitItem(repositoryName); theiaProjectTree.expandItem(repositoryName); expectedItemsAfterCloning.forEach( name -> { theiaProjectTree.waitItem(repositoryName + "/" + name); }); }
Source:
public void updateProjectionResults( final TransactionBase tx, final VisibilityBindingSet childBindingSet, final ProjectionMetadata projectionMetadata) throws Exception { checkNotNull(tx); checkNotNull(childBindingSet); checkNotNull(projectionMetadata); log.trace( "Transaction ID: " + tx.getStartTimestamp() + "\n" + "Node ID: " + projectionMetadata.getNodeId() + "\n" + "Parent Node ID: " + projectionMetadata.getParentNodeId() + "\n" + "Child Node ID: " + projectionMetadata.getChildNodeId() + "\n" + "Child Binding Set:\n" + childBindingSet + "\n"); final VariableOrder queryVarOrder = projectionMetadata.getVariableOrder(); final VariableOrder projectionVarOrder = projectionMetadata.getProjectedVars(); final BindingSet queryBindingSet = BindingSetUtil.keepBindings(projectionVarOrder, childBindingSet); VisibilityBindingSet projectedBs = new VisibilityBindingSet(queryBindingSet, childBindingSet.getVisibility()); Bytes resultRow = getRowKey(projectionMetadata.getNodeId(), queryVarOrder, projectedBs); final Bytes nodeValueBytes = BS_SERDE.serialize(projectedBs); log.trace( "Transaction ID: " + tx.getStartTimestamp() + "\n" + "New Binding Set: " + childBindingSet + "\n"); tx.set(resultRow, FluoQueryColumns.PROJECTION_BINDING_SET, nodeValueBytes); }

Target:
public void updateProjectionResults( final TransactionBase tx, final VisibilityBindingSet childBindingSet, final ProjectionMetadata projectionMetadata) throws Exception { checkNotNull(tx); checkNotNull(childBindingSet); checkNotNull(projectionMetadata); log.trace( "Transaction ID: " + tx.getStartTimestamp() + "\n" + "Node ID: " + projectionMetadata.getNodeId() + "\n" + "Parent Node ID: " + projectionMetadata.getParentNodeId() + "\n" + "Child Node ID: " + projectionMetadata.getChildNodeId() + "\n" + "Child Binding Set:\n" + childBindingSet + "\n"); final VariableOrder queryVarOrder = projectionMetadata.getVariableOrder(); final VariableOrder projectionVarOrder = projectionMetadata.getProjectedVars(); final BindingSet queryBindingSet = BindingSetUtil.keepBindings(projectionVarOrder, childBindingSet); VisibilityBindingSet projectedBs = new VisibilityBindingSet(queryBindingSet, childBindingSet.getVisibility()); Bytes resultRow = makeRowKey(projectionMetadata.getNodeId(), queryVarOrder, projectedBs); final Bytes nodeValueBytes = BS_SERDE.serialize(projectedBs); log.trace( "Transaction ID: " + tx.getStartTimestamp() + "\n" + "New Binding Set: " + childBindingSet + "\n"); tx.set(resultRow, FluoQueryColumns.PROJECTION_BINDING_SET, nodeValueBytes); }
Source:
public ShellCommandProcessor(AbstractByteArraySerializer serializer, String command) { this(serializer, StringUtils.delimitedListToStringArray(command," ")); }

Target:
public ShellCommandProcessor(AbstractByteArraySerializer serializer, String command) { Assert.hasLength(command, "A shell command is required"); Assert.notNull(serializer, "'serializer' cannot be null"); this.command = command; List<String> commandPlusArgs = parse(command); Assert.notEmpty(commandPlusArgs, "The shell command is invalid: '" + command + "'"); this.serializer = serializer; processBuilder = new ProcessBuilder(commandPlusArgs); }
Source:
public void put(T element) { fInputLock.lock(); try { fQueueSize.incrementAndGet(); fInputBuffer.add(element); fInputBufferSize++; if (fInputBufferSize >= fChunkSize) { this.flushInputBuffer(); } } finally { fInputLock.unlock(); } }

Target:
public void put(T element) { fInputLock.lock(); try { fInputBuffer.add(element); fQueueSize.incrementAndGet(); fInputBufferSize++; if (fInputBufferSize >= fChunkSize) { this.flushInputBuffer(); } } finally { fInputLock.unlock(); } }
Source:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.modifyAttribute(0, statev, quark); fixture.modifyAttribute(10, TmfStateValue.nullValue(), quark); } fixture.closeHistory(1002); String[] csp = { CALLSTACK_PATH }; String[] pp = { PROCESS_PATH }; String[] tp = { THREAD_PATH }; CGAnalysis cga = new CGAnalysis(); assertTrue(cga.iterateOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); ISegmentStore<@NonNull ISegment> segmentStore = cga.getSegmentStore(); assertNotNull(segmentStore); Object[] segments = segmentStore.toArray(); assertEquals("Number of segments found", LARGE_AMOUNT_OF_SEGMENTS, segments.length, ERROR); }

Target:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.pushAttribute(0, statev, quark); } for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); fixture.popAttribute(10, quark); } fixture.closeHistory(1002); CGAnalysis cga = new CGAnalysis(); assertTrue(cga.iterateOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); ISegmentStore<@NonNull ISegment> segmentStore = cga.getSegmentStore(); assertNotNull(segmentStore); Object[] segments = segmentStore.toArray(); assertEquals("Number of segments found", LARGE_AMOUNT_OF_SEGMENTS, segments.length, ERROR); }
Source:
public void write(ObjectDataOutput out, SerializedPage page) throws IOException { out.writeInt(page.getPageId()); out.writeUTF(page.getPageType()); out.write(page.getData()); }

Target:
public void write(ObjectDataOutput out, SerializedPage page) throws IOException { out.writeInt(page.getPageId()); out.writeUTF(page.getPageType()); out.writeByteArray(page.getData()); }