auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createExistingTagsSection(Composite parent) { Composite right = new Composite(parent, SWT.NORMAL); right.setLayout(GridLayoutFactory.swtDefaults().create()); right.setLayoutData(GridLayoutFactory.fillDefaults().create()); new Label(right, SWT.WRAP).setText(UIText.CreateTagDialog_existingTags); Table table = new Table(right, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE); table.setLayoutData(GridDataFactory.fillDefaults().grab(true, true) .hint(80, 100).create()); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, 20)); table.setLayout(layout); tagViewer = new TableViewer(table); tagViewer.setLabelProvider(new TagLabelProvider()); tagViewer.setContentProvider(new ArrayContentProvider()); tagViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { fillTagDialog(); } }); tagViewer.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof String) return true; RevTag actTag = (RevTag) element; if (tagNamePattern != null) return tagNamePattern.matcher(actTag.getTagName()).find(); else return true; } }); tagViewer .setInput(new String[] { UIText.CreateTagDialog_LoadingMessageText }); tagViewer.getTable().setEnabled(false); applyDialogFont(parent); }

Target:
private void createExistingTagsSection(Composite parent) { Composite right = new Composite(parent, SWT.NORMAL); right.setLayout(GridLayoutFactory.swtDefaults().create()); right.setLayoutData(GridLayoutFactory.fillDefaults().create()); new Label(right, SWT.WRAP).setText(UIText.CreateTagDialog_existingTags); Table table = new Table(right, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE); table.setLayoutData(GridDataFactory.fillDefaults().grab(true, true) .hint(80, 100).create()); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, 20)); table.setLayout(layout); tagViewer = new TableViewer(table); tagViewer.setLabelProvider(new TagLabelProvider()); tagViewer.setContentProvider(ArrayContentProvider.getInstance()); tagViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { fillTagDialog(); } }); tagViewer.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof String) return true; RevTag actTag = (RevTag) element; if (tagNamePattern != null) return tagNamePattern.matcher(actTag.getTagName()).find(); else return true; } }); tagViewer .setInput(new String[] { UIText.CreateTagDialog_LoadingMessageText }); tagViewer.getTable().setEnabled(false); applyDialogFont(parent); }
Source:
public MyWalker() { super(ProjectState.this.wildProject, ProjectState.this.projectCache); }

Target:
MyWalker() { super(ProjectState.this.wildProject, ProjectState.this.projectCache); }
Source:
protected void onReveal() { Event entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); if (!entityChangedEvent.getListeners().contains(getView().getDiskTypeChangedEventListener())) { entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); } Event systemTreeSelectedItemChangedEvent = CommonModel.getInstance().getSystemTree().getSelectedItemChangedEvent(); if (!systemTreeSelectedItemChangedEvent.getListeners().contains(getView().systemTreeChangedEventListener())) { systemTreeSelectedItemChangedEvent.addListener(getView().systemTreeChangedEventListener()); } super.onReveal(); ((MainTabDiskView) getView()).handleQuotaColumnVisibility(); }

Target:
protected void onReveal() { Event entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); if (!entityChangedEvent.getListeners().contains(getView().getDiskTypeChangedEventListener())) { entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); } Event systemTreeSelectedItemChangedEvent = CommonModel.getInstance().getSystemTree().getSelectedItemChangedEvent(); systemTreeSelectedItemChangedEvent.addListener(systemTreeChangedEventListener); super.onReveal(); getView().handleQuotaColumnVisibility(); }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("search_members") .setResponseExample(getClass().getResource("search_members-example.json")) .setSince("6.4") .setInternal(true) .setHandler(this); action.addSearchQuery("orwe", "names", "logins"); action.addPagingParams(50, MAX_LIMIT); action.createParam(Param.SELECTED) .setDescription("Depending on the value, show only selected items (selected=selected) or deselected items (selected=deselected).") .setInternal(true) .setDefaultValue(SelectionMode.SELECTED.value()) .setPossibleValues(SelectionMode.SELECTED.value(), SelectionMode.DESELECTED.value()); action.createParam("organization") .setDescription("Organization key") .setInternal(true) .setRequired(false); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("search_members") .setDescription("Search members of an organization") .setResponseExample(getClass().getResource("search_members-example.json")) .setSince("6.4") .setInternal(true) .setHandler(this); action.addSearchQuery("orwe", "names", "logins"); action.addPagingParams(50, MAX_LIMIT); action.createParam(Param.SELECTED) .setDescription("Depending on the value, show only selected items (selected=selected) or deselected items (selected=deselected).") .setInternal(true) .setDefaultValue(SelectionMode.SELECTED.value()) .setPossibleValues(SelectionMode.SELECTED.value(), SelectionMode.DESELECTED.value()); action.createParam("organization") .setDescription("Organization key") .setInternal(true) .setRequired(false); }
Source:
public void addAll(Collection<Metric> metrics, String clientId) { Utils.injectTag(TsdbMetricsQueue.CLIENT_TAG, clientId, metrics); synchronized (this) { queue.addAll(metrics); incrementPerClientBacklog(clientId, metrics.size()); } incrementIncoming(metrics.size()); }

Target:
public void addAll(Collection<Metric> metrics, String clientId) { Utils.injectTag(TsdbMetricsQueue.CLIENT_TAG, clientId, metrics); queue.addAll(metrics); perClientBacklog.addAndGet(clientId, metrics.size()); incrementIncoming(metrics.size()); }
Source:
private Value getValueSlow(ResultInterface rows, Value l) { if (all) { while (rows.next()) { Value[] currentRow = rows.currentRow(); Value r = query.getColumnCount() == 1 ? currentRow[0] : ValueRow.get(currentRow); Value cmp; if (r == ValueNull.INSTANCE || (cmp = Comparison.compareNotNull(database, l, r, compareType)) == ValueNull.INSTANCE) { return ValueNull.INSTANCE; } else if (cmp == ValueBoolean.FALSE) { return cmp; } } return ValueBoolean.TRUE; } else { boolean hasNull = false; while (rows.next()) { Value[] currentRow = rows.currentRow(); Value r = query.getColumnCount() == 1 ? currentRow[0] : ValueRow.get(currentRow); Value cmp; if (r == ValueNull.INSTANCE || (cmp = Comparison.compareNotNull(database, l, r, compareType)) == ValueNull.INSTANCE) { hasNull = true; } else if (cmp == ValueBoolean.TRUE) { return cmp; } } if (hasNull) { return ValueNull.INSTANCE; } return ValueBoolean.FALSE; } }

Target:
private Value getValueSlow(ResultInterface rows, Value l) { boolean hasNull = false; if (all) { while (rows.next()) { Value cmp = compare(l, rows); if (cmp == ValueNull.INSTANCE) { hasNull = true; } else if (cmp == ValueBoolean.FALSE) { return cmp; } } } else { while (rows.next()) { Value cmp = compare(l, rows); if (cmp == ValueNull.INSTANCE) { hasNull = true; } else if (cmp == ValueBoolean.TRUE) { return cmp; } } } if (hasNull) { return ValueNull.INSTANCE; } return ValueBoolean.get(all); }
Source:
private void updateGeoRepStatus(GlusterGeoRepSession session) { GlusterVolumeEntity volume = getVolumeDao().getById(session.getMasterVolumeId()); List<HashMap<Guid, GeoRepSessionStatus>> list = new ArrayList<>(); for (int i=0; i < volume.getBricks().size(); i= i + volume.getReplicaCount()) { HashMap<Guid, GeoRepSessionStatus> nodeStatus = new HashMap<>(); int j = 0; while (j < volume.getReplicaCount()) { Guid brickId = volume.getBricks().get(i + j).getId(); nodeStatus.put(brickId, getStatusForBrickFromSession(session, brickId)); j++; } list.add(nodeStatus); } session.setStatus(GeoRepSessionStatus.ACTIVE); for (HashMap<Guid, GeoRepSessionStatus> nodeStatusMap : list) { if (nodeStatusMap.containsValue(GeoRepSessionStatus.ACTIVE)) { continue; } else if (CollectionUtils.countMatches(nodeStatusMap.values(), PredicateUtils.equalPredicate(GeoRepSessionStatus.FAULTY)) > 0) { session.setStatus(GeoRepSessionStatus.FAULTY); continue; } GeoRepSessionStatus nodeStatus = (GeoRepSessionStatus) nodeStatusMap.values().toArray()[0]; if (CollectionUtils.countMatches(nodeStatusMap.values(), PredicateUtils.equalPredicate(nodeStatus)) == nodeStatusMap.size() && GeoRepSessionStatus.ACTIVE.equals(session.getStatus())) { session.setStatus(nodeStatus); } } }

Target:
private void updateGeoRepStatus(GlusterGeoRepSession session) { GlusterVolumeEntity volume = getVolumeDao().getById(session.getMasterVolumeId()); List<HashMap<Guid, GeoRepSessionStatus>> list = new ArrayList<>(); for (int i=0; i < volume.getBricks().size(); i= i + volume.getReplicaCount()) { HashMap<Guid, GeoRepSessionStatus> subVolumeStatusMap = new HashMap<>(); int j = 0; while (j < volume.getReplicaCount()) { Guid brickId = volume.getBricks().get(i + j).getId(); subVolumeStatusMap.put(brickId, getStatusForBrickFromSession(session, brickId)); j++; } list.add(subVolumeStatusMap); } session.setStatus(GeoRepSessionStatus.ACTIVE); for (HashMap<Guid, GeoRepSessionStatus> subVolumeStatusMap : list) { if (subVolumeStatusMap.containsValue(GeoRepSessionStatus.ACTIVE)) { continue; } else if (subVolumeStatusMap.containsValue(GeoRepSessionStatus.FAULTY)) { session.setStatus(GeoRepSessionStatus.FAULTY); return; } HashSet<GeoRepSessionStatus> statusValues = new HashSet<GeoRepSessionStatus>(subVolumeStatusMap.values()); if (ArrayUtils.contains(overridableStatuses, session.getStatus())) { if (statusValues.size() == 1) { session.setStatus((GeoRepSessionStatus) statusValues.toArray()[0]); } else { log.infoFormat("Multiple status values found in volume {0}" , session.getMasterVolumeName()); } } } }
Source:
@Override public void excludeNode(String nodeId) { impl.failNode(UUID.fromString(nodeId), "Node failed from JMX interface, initiator=" + getLocalNodeId()); }

Target:
@Override public void excludeNode(String nodeId) { UUID node; try { node = UUID.fromString(nodeId); } catch (IllegalArgumentException e) { U.error(log, e); return; } String msg = "Node excluded, node=" + nodeId + "using JMX interface, initiator=" + getLocalNodeId(); impl.failNode(node, msg); }
Source:
private void updateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, long stopRank, long startTime, long stopTime) { ITmfTrace trace = timeAnalysisEntry.getTrace(); TimeChartDecorationProvider decorationProvider = fDecorationProviders.get(trace); if (decorationProvider == null) { return; } boolean done = false; while (!done) { synchronized (timeAnalysisEntry) { try (ITmfContext context = checkNotNull( timeAnalysisEntry.getLastRank() != -1 ? trace.seekEvent(timeAnalysisEntry.getLastRank()) : trace.seekEvent(0));) { if (timeAnalysisEntry.getLastRank() >= trace.getNbEvents()) { done = true; break; } while (true) { long rank = context.getRank(); ITmfEvent event = trace.getNext(context); if (event == null) { done = true; break; } TimeChartEvent timeEvent = new TimeChartEvent(timeAnalysisEntry, event, rank, decorationProvider); if (timeEvent.getTime() >= startTime && timeEvent.getTime() <= stopTime) { timeAnalysisEntry.addTraceEvent(timeEvent); } if (context.getRank() == trace.getNbEvents() || context.getRank() == stopRank) { done = true; break; } if (context.getRank() % trace.getCacheSize() == 1) { break; } } timeAnalysisEntry.setLastRank(context.getRank()); } } redrawViewer(true); } }

Target:
private void updateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, long stopRank, long startTime, long stopTime) { ITmfTrace trace = timeAnalysisEntry.getTrace(); TimeChartDecorationProvider decorationProvider = fDecorationProviders.get(trace); if (decorationProvider == null) { return; } boolean done = false; while (!done) { synchronized (timeAnalysisEntry) { try (ITmfContext context = (timeAnalysisEntry.getLastRank() != -1) ? trace.seekEvent(timeAnalysisEntry.getLastRank()) : trace.seekEvent(0);) { while (!done) { if (timeAnalysisEntry.getLastRank() >= trace.getNbEvents()) { done = true; break; } if (context == null || context.getRank() != timeAnalysisEntry.getLastRank()) { break; } while (true) { long rank = context.getRank(); ITmfEvent event = trace.getNext(context); if (event == null) { done = true; break; } TimeChartEvent timeEvent = new TimeChartEvent(timeAnalysisEntry, event, rank, decorationProvider); if (timeEvent.getTime() >= startTime && timeEvent.getTime() <= stopTime) { timeAnalysisEntry.addTraceEvent(timeEvent); } if (context.getRank() == trace.getNbEvents() || context.getRank() == stopRank) { done = true; break; } if (context.getRank() % trace.getCacheSize() == 1) { break; } } timeAnalysisEntry.setLastRank(context.getRank()); } redrawViewer(true); } } } redrawViewer(true); }
Source:
public ListRequest list() { return new ListRequest() { @Override public List<ProjectInfo> get() throws RestApiException { return ProjectsImpl.this.list(this); } }; }

Target:
public ListRequest list() { return new ListRequest() { @Override public List<ProjectInfo> get() throws RestApiException { return list(this); } }; }
Source:
private void readTXSHD() throws NitfFormatException { TreCollection extendedSubheaderTREs = parsingStrategy.parseTREs(reader, textExtendedSubheaderLength - TextConstants.TXSOFL_LENGTH, TreSource.TextExtendedSubheaderData); segment.mergeTREs(extendedSubheaderTREs); }

Target:
private void readTXSHD() throws NitfFormatException { TreCollection extendedSubheaderTREs = parsingStrategy.parseTREs(reader, textExtendedSubheaderLength - TXSOFL_LENGTH, TreSource.TextExtendedSubheaderData); segment.mergeTREs(extendedSubheaderTREs); }
Source:
public BlobReadOptions getBlobReadInfo(StoreKey id, EnumSet<StoreGetOptions> getOptions) throws StoreException { IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { if (getOptions.contains(StoreGetOptions.Store_Include_Deleted)) { MessageInfo deletedBlobInfo = hardDelete.getInfoOfMessageAtOffset(log, value.getOriginalMessageOffset(), value.getOffset(), factory); if (deletedBlobInfo == null) { logger.error("Could not get info of deleted blob at original offset {}", value.getOriginalMessageOffset()); return null; } if (!deletedBlobInfo.getStoreKey().equals(id)) { logger.error("Key at offset different from key in index", deletedBlobInfo.getStoreKey(), id); return null; } return new BlobReadOptions(value.getOriginalMessageOffset(), deletedBlobInfo.getSize(), deletedBlobInfo.getExpirationTimeInMs(), deletedBlobInfo.getStoreKey()); } else { throw new StoreException("Id " + id + " has been deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } } else if (value.isExpired() && !getOptions.contains(StoreGetOptions.Store_Include_Expired)) { throw new StoreException("Id " + id + " has expired ttl in index " + dataDir, StoreErrorCodes.TTL_Expired); } return new BlobReadOptions(value.getOffset(), value.getSize(), value.getTimeToLiveInMs(), id); }

Target:
public BlobReadOptions getBlobReadInfo(StoreKey id, EnumSet<StoreGetOptions> getOptions) throws StoreException { IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { if (getOptions.contains(StoreGetOptions.Store_Include_Deleted)) { try { MessageInfo deletedBlobInfo = hardDelete.getMessageInfo(log, value.getOriginalMessageOffset(), factory); return new BlobReadOptions(value.getOriginalMessageOffset(), deletedBlobInfo.getSize(), deletedBlobInfo.getExpirationTimeInMs(), deletedBlobInfo.getStoreKey()); } catch (IOException e) { throw new StoreException("IOError when reading delete blob info from the log " + dataDir, e, StoreErrorCodes.IOError); } } else { throw new StoreException("Id " + id + " has been deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } } else if (value.isExpired() && !getOptions.contains(StoreGetOptions.Store_Include_Expired)) { throw new StoreException("Id " + id + " has expired ttl in index " + dataDir, StoreErrorCodes.TTL_Expired); } return new BlobReadOptions(value.getOffset(), value.getSize(), value.getTimeToLiveInMs(), id); }
Source:
default List<BibEntry> performSearch(String query) throws FetcherException { if (StringUtil.isBlank(query)) { return Collections.emptyList(); } try (InputStream stream = getUrlDownload(query).asInputStream()) { List<BibEntry> fetchedEntries = new ArrayList<>(); PushbackInputStream pushbackInputStream = new PushbackInputStream(stream); int b; b = pushbackInputStream.read(); if (b != -1) { pushbackInputStream.unread(b); fetchedEntries = getParser().parseEntries(pushbackInputStream); fetchedEntries.forEach(this::doPostCleanup); } pushbackInputStream.close(); return fetchedEntries; } catch (URISyntaxException e) { throw new FetcherException("Search URI is malformed", e); } catch (IOException e) { throw new FetcherException("A network error occurred", e); } catch (ParseException e) { throw new FetcherException("An internal parser error occurred", e); } }

Target:
default List<BibEntry> performSearch(String query) throws FetcherException { if (StringUtil.isBlank(query)) { return Collections.emptyList(); } try (InputStream stream = getUrlDownload(getURLForQuery(query)).asInputStream()) { List<BibEntry> fetchedEntries = getParser().parseEntries(stream); fetchedEntries.forEach(this::doPostCleanup); return fetchedEntries; } catch (URISyntaxException e) { throw new FetcherException("Search URI is malformed", e); } catch (IOException e) { throw new FetcherException("A network error occurred", e); } catch (ParseException e) { throw new FetcherException("An internal parser error occurred", e); } }
Source:
public String getAddressValidationMessageIfCheckPayment(String employeeId) { String validationMessage = StringUtils.EMPTY; if (isPayeeSignedUpForACH(employeeId)) { LOG.info("validateAddressIfCheckPayment, the employee ID " + employeeId + " is signed up for ACH so no need to validdate address."); } else { boolean valid = validPdpAddress(employeeId); if (!valid) { validationMessage = getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.CONCUR_INCOMPLETE_ADDRESS); } } return validationMessage; }

Target:
public String getAddressValidationMessageIfCheckPayment(String employeeId) { String validationMessage = StringUtils.EMPTY; if (isPayeeSignedUpForACH(employeeId)) { LOG.info("validateAddressIfCheckPayment, the employee ID " + employeeId + " is signed up for ACH so no need to validdate address."); } else { if (!validPdpAddress(employeeId)) { LOG.info("validateAddressIfCheckPayment, the employee ID " + employeeId + " has an INVALID address."); validationMessage = getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.CONCUR_INCOMPLETE_ADDRESS); } else { LOG.info("validateAddressIfCheckPayment, the employee ID " + employeeId + " has an valid address."); } } return validationMessage; }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ApplyAclRuleVspCommand that = (ApplyAclRuleVspCommand) o; if (_egressDefaultPolicy != that._egressDefaultPolicy) return false; if (_isL2Network != that._isL2Network) return false; if (_networkAcl != that._networkAcl) return false; if (_networkId != that._networkId) return false; if (_networkReset != that._networkReset) return false; if (_aclRules != null ? !_aclRules.equals(that._aclRules) : that._aclRules != null) return false; if (_acsIngressAcl != null ? !_acsIngressAcl.equals(that._acsIngressAcl) : that._acsIngressAcl != null) return false; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_networkDomainUuid != null ? !_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid != null) return false; if (_networkName != null ? !_networkName.equals(that._networkName) : that._networkName != null) return false; if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; if (_vpcOrSubnetUuid != null ? !_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ApplyAclRuleVspCommand)) return false; if (!super.equals(o)) return false; ApplyAclRuleVspCommand that = (ApplyAclRuleVspCommand) o; if (_egressDefaultPolicy != that._egressDefaultPolicy) return false; if (_isL2Network != that._isL2Network) return false; if (_networkAcl != that._networkAcl) return false; if (_networkId != that._networkId) return false; if (_networkReset != that._networkReset) return false; if (_aclRules != null ? !_aclRules.equals(that._aclRules) : that._aclRules != null) return false; if (_acsIngressAcl != null ? !_acsIngressAcl.equals(that._acsIngressAcl) : that._acsIngressAcl != null) return false; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_networkDomainUuid != null ? !_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid != null) return false; if (_networkName != null ? !_networkName.equals(that._networkName) : that._networkName != null) return false; if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) : that._networkUuid != null) return false; if (_vpcOrSubnetUuid != null ? !_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null) return false; return true; }
Source:
public LongSelectiveStreamReader( StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, AggregatedMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "stream is null"); directReader = new LongDirectSelectiveStreamReader(streamDescriptor, filter, outputType, systemMemoryContext.newLocalMemoryContext(LongSelectiveStreamReader.class.getSimpleName())); dictionaryReader = new LongDictionarySelectiveStreamReader(streamDescriptor, filter, outputType, systemMemoryContext.newLocalMemoryContext(LongSelectiveStreamReader.class.getSimpleName())); }

Target:
public LongSelectiveStreamReader( StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, AggregatedMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "streamDescriptor is null"); directReader = new LongDirectSelectiveStreamReader(streamDescriptor, filter, outputType, systemMemoryContext.newLocalMemoryContext(LongSelectiveStreamReader.class.getSimpleName())); dictionaryReader = new LongDictionarySelectiveStreamReader(streamDescriptor, filter, outputType, systemMemoryContext.newLocalMemoryContext(LongSelectiveStreamReader.class.getSimpleName())); }
Source:
private static Optional<Expression> searchVerifyAssignment(CallExpression callExpr) { for (Argument a : callExpr.arguments()) { if (a instanceof RegularArgumentImpl) { RegularArgumentImpl regArg = (RegularArgumentImpl) a; Name keywordArgument = regArg.keywordArgument(); if (keywordArgument != null && "verify".equals(keywordArgument.name())) { return Optional.of(regArg.expression()); } } } return Optional.empty(); }

Target:
private static Optional<List<Expression>> searchVerifyAssignment(CallExpression callExpr) { for (Argument a : callExpr.arguments()) { if (a.is(Tree.Kind.REGULAR_ARGUMENT)) { RegularArgument regArg = (RegularArgument) a; Name keywordArgument = regArg.keywordArgument(); if (keywordArgument != null && "verify".equals(keywordArgument.name())) { return Optional.of(Collections.singletonList(regArg.expression())); } } } return Optional.empty(); }
Source:
private void restoreSendFeedbackTask() { Object object = getLastNonConfigurationInstance(); if (object != null && object instanceof SendFeedbackTask) { mSendFeedbackTask = (SendFeedbackTask) (object); mSendFeedbackTask.setHandler(mFeedbackHandler); } }

Target:
private void restoreSendFeedbackTask() { Object object = getLastNonConfigurationInstance(); if (object != null && object instanceof SendFeedbackTask) { mSendFeedbackTask = (SendFeedbackTask) object; mSendFeedbackTask.setHandler(mFeedbackHandler); } }
Source:
private Set<TopicPartition> validCheckpointableTopics() { final Set<TopicPartition> result = new HashSet<>(storeToChangelogTopic.size()); for (final Map.Entry<String, String> storeToChangelog : storeToChangelogTopic.entrySet()) { if (registeredStores.containsKey(storeToChangelog.getKey()) && registeredStores.get(storeToChangelog.getKey()).isPresent() && registeredStores.get(storeToChangelog.getKey()).get().persistent()) { result.add(new TopicPartition(storeToChangelog.getValue(), getPartition(storeToChangelog.getValue()))); } } return result; }

Target:
private Set<TopicPartition> validCheckpointableTopics() { final Set<TopicPartition> result = new HashSet<>(storeToChangelogTopic.size()); for (final Map.Entry<String, String> storeToChangelog : storeToChangelogTopic.entrySet()) { final String storeName = storeToChangelog.getKey(); if (registeredStores.containsKey(storeName) && registeredStores.get(storeName).isPresent() && registeredStores.get(storeName).get().persistent()) { final String changelogTopic = storeToChangelog.getValue(); result.add(new TopicPartition(changelogTopic, getPartition(changelogTopic))); } } return result; }
Source:
public synchronized static void setTasksMap(String hostName, String taskId) { tasksmap.put(hostName, taskId); }

Target:
public static void setTasksMap(String hostName, String taskId) { tasksmap.put(hostName, taskId); }
Source:
public String url(String remoteHost, String workingUrl) throws IOException { boolean fileExist = artifact.exists(); LOG.debug( "Requesting the file [" + artifact.getAbsolutePath() + "], exist? [" + fileExist + "]"); if (fileExist && artifact.isFile()) { String sha1 = StringUtil.sha1Digest(artifact); return format("%s/%s/%s/%s?sha1=%s", remoteHost, "remoting", "files", workingUrl, URLEncoder.encode(sha1, "UTF-8")); } else { return format("%s/%s/%s/%s", remoteHost, "remoting", "files", workingUrl); } }

Target:
public String url(String remoteHost, String workingUrl) throws IOException { boolean fileExist = artifact.exists(); LOG.debug("Requesting the file [{}], exist? [{}]", artifact.getAbsolutePath(), fileExist); if (fileExist && artifact.isFile()) { String sha1 = StringUtil.sha1Digest(artifact); return format("%s/%s/%s/%s?sha1=%s", remoteHost, "remoting", "files", workingUrl, URLEncoder.encode(sha1, "UTF-8")); } else { return format("%s/%s/%s/%s", remoteHost, "remoting", "files", workingUrl); } }
Source:
public boolean hasMemoryToRunVM(VDS curVds, VM vm) { boolean retVal = false; if (curVds.getMemCommited() != null && curVds.getPhysicalMemMb() != null && curVds.getReservedMem() != null && curVds.getSwapTotal() != null) { double vdsCurrentMem = getVdsCurrentReservedMemory(curVds) + vm.getMinAllocatedMem(); double vdsMemLimit = getVdsMemLimit(curVds); log.debug("hasMemoryToRunVM: host '{}' physical vmem size is : {}, swap total vmem size is : MB", curVds.getName(), curVds.getPhysicalMemMb(), curVds.getSwapTotal()); log.debug("Host Mem Conmmitted: '{}', pending vmem size is : {}, Host Guest Overhead {}, Host Reserved Mem: {}, VM Min Allocated Mem {}", curVds.getMemCommited(), curVds.getPendingVmemSize(), curVds.getGuestOverhead(), curVds.getReservedMem(), vm.getMinAllocatedMem()); log.debug("{} <= ??? {}", vdsCurrentMem, vdsMemLimit); retVal = (vdsCurrentMem <= vdsMemLimit); } return retVal; }

Target:
public boolean hasMemoryToRunVM(VDS curVds, VM vm) { boolean retVal = false; if (curVds.getMemCommited() != null && curVds.getPhysicalMemMb() != null && curVds.getReservedMem() != null) { double vdsCurrentMem = getVdsCurrentMemoryInUse(curVds) + vm.getMinAllocatedMem(); double vdsMemLimit = getVdsMemLimit(curVds); log.debug("hasMemoryToRunVM: host '{}' physical vmem size is : MB", curVds.getName(), curVds.getPhysicalMemMb()); log.debug("Host Mem Conmmitted: '{}', pending vmem size is : {}, Host Guest Overhead {}, Host Reserved Mem: {}, VM Min Allocated Mem {}", curVds.getMemCommited(), curVds.getPendingVmemSize(), curVds.getGuestOverhead(), curVds.getReservedMem(), vm.getMinAllocatedMem()); log.debug("{} <= ??? {}", vdsCurrentMem, vdsMemLimit); retVal = (vdsCurrentMem <= vdsMemLimit); } return retVal; }
Source:
public void refreshArticleRelationships(ArticleRevision sourceArticleRev) { ArticleXml sourceArticleXml = new ArticleXml(getManuscriptXml(sourceArticleRev.getIngestion())); Article sourceArticle = sourceArticleRev.getIngestion().getArticle(); List<RelatedArticleLink> xmlRelationships = sourceArticleXml.parseRelatedArticles(); List<ArticleRelationship> dbRelationships = getRelationshipsFrom(ArticleIdentifier.create(sourceArticle.getDoi())); dbRelationships.forEach(ar -> hibernateTemplate.delete(ar)); xmlRelationships.forEach(ar -> { getArticle(ar.getArticleId()).ifPresent((Article targetArticle) -> { hibernateTemplate.save(new ArticleRelationship(sourceArticle, targetArticle, ar.getType())); getLatestRevision(targetArticle).ifPresent((ArticleRevision targetArticleRev) -> { ArticleXml targetArticleXml = new ArticleXml(getManuscriptXml(targetArticleRev.getIngestion())); List<ArticleRelationship> reciprocalDbRelationships = getRelationshipsFrom(ArticleIdentifier.create(targetArticle.getDoi())).stream() .filter(dbAr -> dbAr.getTargetArticle() == sourceArticle) .collect(Collectors.toList()); targetArticleXml.parseRelatedArticles().stream() .filter(ral -> ral.getArticleId().getDoiName().equals(sourceArticle.getDoi())) .map(ral -> new ArticleRelationship(targetArticle, sourceArticle, ral.getType())) .filter(targetAr -> reciprocalDbRelationships.stream().noneMatch(dbr -> dbr.getType().equals(targetAr.getType()))) .forEach(targetAr -> hibernateTemplate.save(targetAr)); }); }); }); }

Target:
public void refreshArticleRelationships(ArticleRevision sourceArticleRev) { ArticleXml sourceArticleXml = new ArticleXml(getManuscriptXml(sourceArticleRev.getIngestion())); Article sourceArticle = sourceArticleRev.getIngestion().getArticle(); List<RelatedArticleLink> xmlRelationships = sourceArticleXml.parseRelatedArticles(); List<ArticleRelationship> dbRelationships = getRelationshipsFrom(ArticleIdentifier.create(sourceArticle.getDoi())); dbRelationships.forEach(ar -> hibernateTemplate.delete(ar)); xmlRelationships.forEach(ar -> { getArticle(ar.getArticleId()).ifPresent((Article relatedArticle) -> { hibernateTemplate.save(fromRelatedArticleLink(sourceArticle, ar)); getLatestRevision(relatedArticle).ifPresent((ArticleRevision relatedArticleRev) -> { ArticleXml relatedArticleXml = new ArticleXml(getManuscriptXml(relatedArticleRev.getIngestion())); Set<ArticleRelationship> inboundDbRelationships = getRelationshipsTo(ArticleIdentifier.create(sourceArticle.getDoi())).stream() .filter(dbAr -> dbAr.getSourceArticle().equals(relatedArticle)) .collect(Collectors.toSet()); relatedArticleXml.parseRelatedArticles().stream() .filter(ral -> ral.getArticleId().getDoiName().equals(sourceArticle.getDoi())) .map(ral -> fromRelatedArticleLink(relatedArticle, ral)) .filter(relatedAr -> !inboundDbRelationships.contains(relatedAr)) .forEach(relatedAr -> hibernateTemplate.save(relatedAr)); }); }); }); }
Source:
public void put(K key, T obj) throws GoraException { try { if (obj.isDirty()) { Schema schema = obj.getSchema(); List<Schema.Field> fields = schema.getFields(); Map<Column, Object> data = new HashMap<>(); if (igniteMapping.getPrimaryKey().size() == 1) { Column getKey = igniteMapping.getPrimaryKey().get(0); data.put(getKey, key); } else { } for (Schema.Field field : fields) { Column get = igniteMapping.getFields().get(field.name()); Object v = obj.get(field.pos()); if (get != null && v != null) { Schema fieldSchema = field.schema(); Object serializedObj = serializeFieldValue(fieldSchema, v); data.put(get, serializedObj); } } String baseInsertStatement = IgniteSQLBuilder.baseInsertStatement(igniteMapping, data); try (PreparedStatement stmt = connection.prepareStatement(baseInsertStatement)) { IgniteSQLBuilder.fillInsertStatement(stmt, data); stmt.executeUpdate(); } catch (SQLException ex) { throw new GoraException(ex); } } else { LOG.info("Ignored putting object in the store as it is neither " + "new, neither dirty.", new Object[]{obj}); } } catch (Exception e) { throw new GoraException(e); } }

Target:
public void put(K key, T obj) throws GoraException { try { if (obj.isDirty()) { Schema schema = obj.getSchema(); List<Schema.Field> fields = schema.getFields(); Map<Column, Object> data = new HashMap<>(); if (igniteMapping.getPrimaryKey().size() == 1) { Column getKey = igniteMapping.getPrimaryKey().get(0); data.put(getKey, key); } else { } for (Schema.Field field : fields) { Column mappedColumn = igniteMapping.getFields().get(field.name()); Object fieldValue = obj.get(field.pos()); if (mappedColumn != null && fieldValue != null) { Schema fieldSchema = field.schema(); Object serializedObj = serializeFieldValue(fieldSchema, fieldValue); data.put(mappedColumn, serializedObj); } } String baseInsertStatement = IgniteSQLBuilder.createInsertQuery(igniteMapping, data); try (PreparedStatement stmt = connection.prepareStatement(baseInsertStatement)) { IgniteSQLBuilder.fillInsertQuery(stmt, data); stmt.executeUpdate(); } catch (SQLException ex) { throw new GoraException(ex); } } else { LOG.info("Ignored putting object in the store as it is neither " + "new, neither dirty.", new Object[]{obj}); } } catch (Exception e) { throw new GoraException(e); } }
Source:
public Yielder<OutType> next(final OutType initValue) { try { return wrapper.wrap(new Supplier<Yielder<OutType>>() { @Override public Yielder<OutType> get() { return new WrappingYielder<>(baseYielder.next(initValue), wrapper); } }); } catch (Throwable t) { try { wrapper.after(false, t); } catch (Exception e) { t.addSuppressed(e); } if (t instanceof RuntimeException) { throw t; } throw new RuntimeException(t); } }

Target:
public Yielder<OutType> next(final OutType initValue) { try { return wrapper.wrap(new Supplier<Yielder<OutType>>() { @Override public Yielder<OutType> get() { return new WrappingYielder<>(baseYielder.next(initValue), wrapper); } }); } catch (Throwable t) { try { wrapper.after(false, t); } catch (Exception e) { t.addSuppressed(e); } Throwables.propagateIfPossible(t); throw new RuntimeException(t); } }
Source:
public Contentlet fire(final Map<String, Object> properties, final String wfActionId) throws DotToolException { Contentlet contentlet = new Contentlet(); try { final MapToContentletPopulator mapToContentletPopulator = MapToContentletPopulator.INSTANCE; contentlet = mapToContentletPopulator.populate(contentlet, properties); if(UtilMethods.isSet(properties.get("inode"))) { contentlet.setInode((String) properties.get("inode")); } final boolean ALLOW_FRONT_END_SAVING = Config .getBooleanProperty("WORKFLOW_TOOL_ALLOW_FRONT_END_SAVING", false); final List<Category> cats = categoryAPI.getCategoriesFromContent(contentlet, user, ALLOW_FRONT_END_SAVING); final Map<Relationship, List<Contentlet>> relationships = (Map<Relationship, List<Contentlet>>) contentlet.get(RELATIONSHIP_KEY); final ContentletDependencies contentletDependencies = new ContentletDependencies.Builder() .workflowActionId(wfActionId) .respectAnonymousPermissions(ALLOW_FRONT_END_SAVING) .modUser(user).categories(cats) .relationships(relationshipAPI.getContentletRelationshipsFromMap(contentlet, relationships)) .indexPolicy(IndexPolicyProvider.getInstance().forSingleContent()) .build(); contentlet = workflowAPI.fireContentWorkflow(contentlet, contentletDependencies); } catch (Exception e) { throw new DotToolException(e); } return contentlet; }

Target:
public Contentlet fire(final Map<String, Object> properties, final String wfActionId) throws DotToolException { Contentlet contentlet = new Contentlet(); try { final MapToContentletPopulator mapToContentletPopulator = MapToContentletPopulator.INSTANCE; contentlet = mapToContentletPopulator.populate(contentlet, properties); if(UtilMethods.isSet(properties.get("inode"))) { contentlet.setInode((String) properties.get("inode")); } final boolean allowFrontEndSaving = Config .getBooleanProperty("WORKFLOW_TOOL_ALLOW_FRONT_END_SAVING", false); final List<Category> categories = categoryAPI.getCategoriesFromContent(contentlet, user, allowFrontEndSaving); final Map<Relationship, List<Contentlet>> relationships = (Map<Relationship, List<Contentlet>>) contentlet.get(RELATIONSHIP_KEY); final ContentletDependencies contentletDependencies = new ContentletDependencies.Builder() .workflowActionId(wfActionId) .respectAnonymousPermissions(allowFrontEndSaving) .modUser(user).categories(categories) .relationships(relationshipAPI.getContentletRelationshipsFromMap(contentlet, relationships)) .indexPolicy(IndexPolicyProvider.getInstance().forSingleContent()) .build(); contentlet = workflowAPI.fireContentWorkflow(contentlet, contentletDependencies); } catch (Exception e) { throw new DotToolException(e); } return contentlet; }
Source:
private Throwable getRealException(Throwable re) { if (re.getCause() == null) return re; Throwable cause = re.getCause(); if (cause instanceof CacheException || cause instanceof RuntimeException || cause instanceof Error) return getRealException(cause); else return re; }

Target:
private Throwable getRealException(Throwable re) { if (re.getCause() == null) return re; Throwable cause = re.getCause(); if (cause instanceof RuntimeException || cause instanceof Error) return getRealException(cause); else return re; }
Source:
public void testFormattedAmountUSAndGBP() throws Exception { final FixedPriceInvoiceItem fixedItemEUR = new FixedPriceInvoiceItem(UUID.randomUUID(), UUID.randomUUID(), null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), new LocalDate(), new BigDecimal("1499.95"), Currency.GBP); final Invoice invoiceEUR = new DefaultInvoice(UUID.randomUUID(), new LocalDate(), new LocalDate(), Currency.GBP); invoiceEUR.addInvoiceItem(fixedItemEUR); checkOutput(invoiceEUR, "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedChargedAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedPaidAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedBalance}}</strong></td>\n" + "</tr>", "<tr>\n" + " <td class=\"amount\"><strong>£1,499.95</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>£0.00</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>£1,499.95</strong></td>\n" + "</tr>", Locale.US); }

Target:
public void testFormattedAmountUSAndGBP() throws Exception { final FixedPriceInvoiceItem fixedItem = new FixedPriceInvoiceItem(UUID.randomUUID(), UUID.randomUUID(), null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), new LocalDate(), new BigDecimal("1499.95"), Currency.GBP); final Invoice invoice = new DefaultInvoice(UUID.randomUUID(), new LocalDate(), new LocalDate(), Currency.GBP); invoice.addInvoiceItem(fixedItem); checkOutput(invoice, "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedChargedAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedPaidAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedBalance}}</strong></td>\n" + "</tr>", "<tr>\n" + " <td class=\"amount\"><strong>£1,499.95</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>£0.00</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>£1,499.95</strong></td>\n" + "</tr>", Locale.US); }
Source:
public String getProperty(String key) { String value = super.getProperty(key); if (value != null) { int beginIndex = 0; int startName = value.indexOf(PREFIX, beginIndex); while (startName != -1) { int endName = value.indexOf(SUFFIX, startName); if (endName == -1) { return value; } String constName = value.substring(startName + 1, endName); String constValue = getProperty(constName); if (constValue == null) { return value; } String newValue = (startName > 0) ? value.substring(0, startName) : ""; newValue += constValue; beginIndex = newValue.length(); newValue += value.substring(endName + 1); value = newValue; startName = value.indexOf(PREFIX, beginIndex); } } return value; }

Target:
public String getProperty(String key) { String value = getRawPropertyValue(key); return replaceProperties(value); }
Source:
public Stream<Entry<K, V>> entryStream() { final ReadOptions readOptions = new ReadOptions(); readOptions.setSnapshot(null); final RocksDbEntryIterator entryIterator = new RocksDbEntryIterator(rocksDb.newIterator(readOptions), serializer); Stream<Entry<K, V>> resStream = StreamSupport.stream( Spliterators.spliteratorUnknownSize(entryIterator, Spliterator.ORDERED), false); resStream.onClose(entryIterator::close); return resStream; }

Target:
public Stream<Entry<K, V>> entryStream() { final RocksDbEntryIterator entryIterator = new RocksDbEntryIterator(rocksDb, serializer); Stream<Entry<K, V>> resStream = Streams.stream(entryIterator); resStream.onClose(entryIterator::close); return resStream; }
Source:
private void disposeToolBarElement(ToolBarManager parentManager, MToolBarElement toolBarElement) { IContributionItem ici = getContribution(toolBarElement); if (ici == null) { return; } parentManager.remove(ici); ici.dispose(); clearModelToContribution(toolBarElement, ici); }

Target:
private void disposeToolBarElement(ToolBarManager parentManager, MToolBarElement toolBarElement) { IContributionItem ici = getContribution(toolBarElement); if (ici == null) { return; } parentManager.remove(ici); clearModelToContribution(toolBarElement, ici); ici.dispose(); }
Source:
private JobGraph createJobGraph(TestCase testCase, int numTasks) { JobVertex source = new JobVertex("Source"); if (testCase == TestCase.JOB_FAILS || testCase == TestCase.JOB_IS_CANCELLED) { source.setInvokableClass(FailingBlockingInvokable.class); } else { source.setInvokableClass(NoOpInvokable.class); } source.setParallelism(numTasks); JobGraph jobGraph = new JobGraph("BlobCleanupTest", source); jobGraph.setJobID(new JobID(0, testCase.ordinal())); return jobGraph; }

Target:
private JobGraph createJobGraph(TestCase testCase, int numTasks) { JobVertex source = new JobVertex("Source"); if (testCase == TestCase.JOB_FAILS || testCase == TestCase.JOB_IS_CANCELLED) { source.setInvokableClass(FailingBlockingInvokable.class); } else { source.setInvokableClass(NoOpInvokable.class); } source.setParallelism(numTasks); return new JobGraph(new JobID(0, testCase.ordinal()), "BlobCleanupTest", source); }
Source:
private PlaybackParameters retrievePlaybackParametersFromPreferences() { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); final float speed = preferences .getFloat(context.getString(R.string.playback_speed_key), getPlaybackSpeed()); final float pitch = preferences.getFloat(context.getString(R.string.playback_pitch_key), getPlaybackPitch()); final boolean skipSilence = preferences .getBoolean(context.getString(R.string.playback_skip_silence_key), getPlaybackSkipSilence()); return new PlaybackParameters(speed, pitch, skipSilence); }

Target:
private PlaybackParameters retrievePlaybackParametersFromPreferences() { final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); final float speed = preferences .getFloat(context.getString(R.string.playback_speed_key), getPlaybackSpeed()); final float pitch = preferences.getFloat(context.getString(R.string.playback_pitch_key), getPlaybackPitch()); final boolean skipSilence = preferences .getBoolean(context.getString(R.string.playback_skip_silence_key), getPlaybackSkipSilence()); return new PlaybackParameters(speed, pitch, skipSilence); }
Source:
private void initializeDataChunks() { if (options.getChunkIdsOnly || options.getBlobOptions.getOperationType() == GetBlobOptions.OperationType.BlobInfo) { chunkIdIterator = null; numChunksTotal = 0; dataChunks = null; } else { chunkIdIterator = keysAndSizesAndOffsets.listIterator(); numChunksTotal = keysAndSizesAndOffsets.size(); dataChunks = new GetChunk[Math.min(keysAndSizesAndOffsets.size(), NonBlockingRouter.MAX_IN_MEM_CHUNKS)]; for (int i = 0; i < dataChunks.length; i++) { int idx = chunkIdIterator.nextIndex(); CompositeBlobInfo.ChunkMetadata keyAndOffset = chunkIdIterator.next(); dataChunks[i] = new GetChunk(idx, keyAndOffset); } } }

Target:
private void initializeDataChunks() { if (options.getChunkIdsOnly || options.getBlobOptions.getOperationType() == GetBlobOptions.OperationType.BlobInfo) { chunkIdIterator = null; numChunksTotal = 0; dataChunks = null; } else { chunkIdIterator = chunkMetadataList.listIterator(); numChunksTotal = chunkMetadataList.size(); dataChunks = new GetChunk[Math.min(chunkMetadataList.size(), NonBlockingRouter.MAX_IN_MEM_CHUNKS)]; for (int i = 0; i < dataChunks.length; i++) { int idx = chunkIdIterator.nextIndex(); CompositeBlobInfo.ChunkMetadata keyAndOffset = chunkIdIterator.next(); dataChunks[i] = new GetChunk(idx, keyAndOffset); } } }
Source:
public boolean remove(Object key, Object value) { cacheImplementation.assertKeyValueNotNull(key, value); InvocationContext ctx = cacheImplementation.getInvocationContextWithImplicitTransaction(false, 1); RemoveCommand command = cacheImplementation.createRemoveConditionalCommand(key, value, flags, ctx); return (Boolean) cacheImplementation.executeCommandAndCommitIfNeeded(ctx, command); }

Target:
public boolean remove(Object key, Object value) { return cacheImplementation.remove(key, value, flags, writeContext(1)); }
Source:
public T take() { T headValue = null; try { headValue = super.take(); super.offer(headValue); } catch (InterruptedException e) { e.printStackTrace(); } return headValue; }

Target:
public synchronized T take() { T headValue = null; try { headValue = super.take(); super.offer(headValue); } catch (InterruptedException e) { logger.error("Thread interrupted during the 'take' from a circular queue in the " + "RoundRobinAssignmentStrategy",e); } return headValue; }
Source:
public void testCreateLocalNotificationAndVerify() { Notification localPhoneNotification = new NotificationFactory(new SmartActionFactory(context)) .buildSimpleNotification(context, localPhone); assertTrue(localPhoneNotification.priority != Notification.PRIORITY_MIN); }

Target:
public void testCreateLocalNotificationAndVerify() { ClippingDto localClipping = new ClippingDto().setContent("+919876543210") .setType(ClippingDto.ClippingType.PHONE_NUMBER) .setClippingProvider(ClippingDto.ClippingProvider.LOCAL).setCreateAt(new Date()) .setDeviceId("uniqueId"); Notification localPhoneNotification = new NotificationFactory(new SmartActionFactory(context)) .buildSimpleNotification(context, localClipping); assertTrue(localPhoneNotification.priority != Notification.PRIORITY_MIN); }
Source:
public static void main(String[] args) throws Exception { CommandLine cmdLine = null; try { cmdLine = new CommandLine(args); } catch (final Exception e) { System.out.println("Failed due to invalid parameters: " + Arrays.toString(args)); e.printStackTrace(); System.out.println("Use '-h' for more details."); System.exit(1); } initClassLoader(); ZapBootstrap bootstrap = createZapBootstrap(cmdLine); try { int rc = bootstrap.start(); if (rc != 0) { System.exit(rc); } } catch (final Exception e) { logger.fatal(e.getMessage(), e); System.exit(1); } }

Target:
public static void main(String[] args) throws Exception { CommandLine cmdLine = null; try { cmdLine = new CommandLine(args); } catch (final Exception e) { System.out.println("Failed due to invalid parameters: " + Arrays.toString(args)); System.out.println(e.getMessage()); System.out.println("Use '-h' for more details."); System.exit(1); } initClassLoader(); ZapBootstrap bootstrap = createZapBootstrap(cmdLine); try { int rc = bootstrap.start(); if (rc != 0) { System.exit(rc); } } catch (final Exception e) { logger.fatal(e.getMessage(), e); System.exit(1); } }