auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void initButton(final Button button) { button.setToolTipText("Create Working Branch"); button.setImage(ImageManager.getImage(FrameworkImage.BRANCH)); button.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { disableAll = true; refreshEnablement(button); Result result = AtsBranchUtil.createWorkingBranch_Validate(getTeamArt()); boolean appropriate = selectTargetedVersionIfAppropriate(result, button); if (appropriate) { return; } if (result.isFalse()) { AWorkbench.popup(result); disableAll = false; refreshEnablement(button); return; } try { String workingBranchName = AtsClientService.get().getBranchService().getBranchName(getTeamArt()); String baselineBranchName = getTeamArt().getParentTeamWorkflow().getBranch().toString(); if (!MessageDialog.openConfirm(Displays.getActiveShell(), "Create Working Branch", "Creating working branch,\n\n\"" + workingBranchName + "\"\n\nfrom parent branch, \n\n\"" + baselineBranchName + "\"\n\nIs that correct?\n\n" + "---\nNOTE: Working branches are necessary when OSEE Artifact changes " + "are made during implementation.")) { disableAll = false; refreshEnablement(button); return; } button.setText("Creating Branch..."); button.redraw(); button.getParent().layout(); AtsBranchUtil.createWorkingBranch_Create(getTeamArt(), false); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); disableAll = false; refreshEnablement(button); } } }); }

Target:
protected void initButton(final Button button) { button.setToolTipText("Create Working Branch"); button.setImage(ImageManager.getImage(FrameworkImage.BRANCH)); button.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { disableAll = true; refreshEnablement(button); Result result = AtsBranchUtil.createWorkingBranch_Validate(getTeamArt()); boolean appropriate = selectTargetedVersionIfAppropriate(result, button); if (appropriate) { return; } if (result.isFalse()) { AWorkbench.popup(result); disableAll = false; refreshEnablement(button); return; } try { String workingBranchName = AtsClientService.get().getBranchService().getBranchName(getTeamArt()); final BranchId parentBranch = AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(getTeamArt()); if (parentBranch.isValid()) { String pBranchName = AtsClientService.get().getBranchService().getBranchName(parentBranch); if (!MessageDialog.openConfirm(Displays.getActiveShell(), "Create Working Branch", "Creating working branch:\n\n\"" + workingBranchName + "\"\n\nfrom parent branch: \n\n\"" + pBranchName + "\"\n\nIs that correct?\n\n" + "---\nNOTE: Working branches are necessary when OSEE Artifact changes " + "are made during implementation.")) { disableAll = false; refreshEnablement(button); return; } button.setText("Creating Branch..."); button.redraw(); button.getParent().layout(); AtsBranchUtil.createWorkingBranch_Create(getTeamArt(), false); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); disableAll = false; refreshEnablement(button); } } }); }
Source:
protected boolean updateSelection(IStructuredSelection selection) { addAll(selectedDifferences, getSelectedDifferences(selection)); Iterable<Diff> terminalStateDiffs = filter(selectedDifferences, EMFComparePredicates.hasState(DifferenceState.MERGED, DifferenceState.DISCARDED)); if (!Iterables.isEmpty(terminalStateDiffs)) { return false; } if (this.adapterFactory != null) { contextualizeTooltip(); } return selection.toList().size() == selectedDifferences.size(); }

Target:
protected boolean updateSelection(IStructuredSelection selection) { addAll(selectedDifferences, getSelectedDifferences(selection)); if (any(selectedDifferences, hasState(MERGED, DISCARDED))) { return false; } if (this.adapterFactory != null) { contextualizeTooltip(); } return selection.toList().size() == selectedDifferences.size(); }
Source:
public DataFrame next() { while (intervalsLo < intervalsHi && partitionLo < partitionHi) { final int currentInterval = intervalsHi - 1; final int currentPartition = partitionHi - 1; long rowCount = reader.openPartition(currentPartition); if (rowCount > 0) { final ReadOnlyColumn column = reader.getColumn(TableReader.getPrimaryColumnIndex(reader.getColumnBase(currentPartition), timestampIndex)); final long intervalLo = intervals.getQuick(currentInterval * 2); final long intervalHi = intervals.getQuick(currentInterval * 2 + 1); if (column.getLong(0) > intervalHi) { partitionHi = currentPartition; partitionLimit = -1; continue; } if (column.getLong((rowCount - 1) * 8) < intervalLo) { partitionLimit = -1; intervalsHi = currentInterval; continue; } long lo = search(column, intervalLo, 0, partitionLimit == -1 ? rowCount : partitionLimit, true); if (lo < 0) { lo = -lo - 1; } long hi = search(column, intervalHi, lo, rowCount, false); if (hi < 0) { hi = -hi - 1; } else { hi++; } if (lo < hi) { dataFrame.partitionIndex = currentPartition; dataFrame.rowLo = lo; dataFrame.rowHi = hi; if (lo == 0) { partitionLimit = -1; partitionHi = currentPartition; } else { partitionLimit = lo; intervalsHi = currentInterval; } return dataFrame; } partitionLimit = lo; intervalsHi = currentInterval; } else { partitionHi = currentPartition; } } return null; }

Target:
public DataFrame next() { while (intervalsLo < intervalsHi && partitionLo < partitionHi) { final int currentInterval = intervalsHi - 1; final int currentPartition = partitionHi - 1; long rowCount = reader.openPartition(currentPartition); if (rowCount > 0) { final ReadOnlyColumn column = reader.getColumn(TableReader.getPrimaryColumnIndex(reader.getColumnBase(currentPartition), timestampIndex)); final long intervalLo = intervals.getQuick(currentInterval * 2); final long intervalHi = intervals.getQuick(currentInterval * 2 + 1); if (column.getLong(0) > intervalHi) { partitionHi = currentPartition; partitionLimit = -1; continue; } if (column.getLong((rowCount - 1) * 8) < intervalLo) { partitionLimit = -1; intervalsHi = currentInterval; continue; } long lo = search(column, intervalLo, 0, partitionLimit == -1 ? rowCount : partitionLimit, AbstractIntervalDataFrameCursor.SCAN_UP); if (lo < 0) { lo = -lo - 1; } long hi = search(column, intervalHi, lo, rowCount, AbstractIntervalDataFrameCursor.SCAN_DOWN); if (hi < 0) { hi = -hi - 1; } else { hi++; } if (lo < hi) { dataFrame.partitionIndex = currentPartition; dataFrame.rowLo = lo; dataFrame.rowHi = hi; if (lo == 0) { partitionLimit = -1; partitionHi = currentPartition; } else { partitionLimit = lo; intervalsHi = currentInterval; } return dataFrame; } partitionLimit = lo; intervalsHi = currentInterval; } else { partitionHi = currentPartition; } } return null; }
Source:
protected void runOneIteration() throws Exception { try { final HostStatus hostStatus = solo.client().hostStatus(solo.agentName()).get(); final Map<JobId, TaskStatus> statuses = hostStatus.getStatuses(); for (final TaskStatus status : statuses.values()) { final String containerId = status.getContainerId(); if (isNullOrEmpty(containerId) || logFutures.containsKey(containerId)) { continue; } final ScheduledFuture<?> future = this.executor().scheduleAtFixedRate(new Runnable() { @Override public void run() { try { final LogStream logStream = dockerClient.logs(containerId, stdout(), stderr(), follow()); log.info("attaching stdout/stderr for job={}, container={}", status.getJob().getId(), containerId); logStream.attach(System.out, System.err); } catch (Exception e) { log.debug("error streaming logs for job={}, container={} - {}", status.getJob().getId(), containerId, e); } } }, 0, 100, TimeUnit.MILLISECONDS); logFutures.put(containerId, future); } } catch (Exception e) { } }

Target:
protected void runOneIteration() throws Exception { try { for (final String host : heliosClient.listHosts().get()) { final HostStatus hostStatus = heliosClient.hostStatus(host).get(); final Map<JobId, TaskStatus> statuses = hostStatus.getStatuses(); for (final TaskStatus status : statuses.values()) { final JobId jobId = status.getJob().getId(); final String containerId = status.getContainerId(); if (isNullOrEmpty(containerId)) { continue; } if (!logFutures.containsKey(containerId)) { final Future<?> future = this.executor().submit(new Runnable() { @Override public void run() { try { final LogStream logStream = dockerClient.logs(containerId, stdout(), stderr(), follow()); log.info("attaching stdout/stderr for job={}, container={}", jobId, containerId); logStream.attach(logStreamProvider.getStdoutStream(jobId, containerId), logStreamProvider.getStderrStream(jobId, containerId)); } catch (final InterruptedException e) { } catch (final Exception e) { log.warn("error streaming log for job={}, container={} - {}", jobId, containerId, e); } } }); logFutures.put(containerId, future); } } } } catch (Exception e) { } }
Source:
public List<Constituent> getConstituentsWithSpan(IntPair span) { List<Constituent> list = new ArrayList<>(); for(Constituent c : this.constituents) if (c.getSpan().equals(span)) list.add(c); list.sort(TextAnnotationUtilities.constituentStartComparator); return list; }

Target:
public List<Constituent> getConstituentsWithSpan(IntPair span) { List<Constituent> list = new ArrayList<>(); for(Constituent c : this.constituents) if (c.getSpan().equals(span)) list.add(c); return list; }
Source:
private List<Message> generateMessagesForParticipant(Criteria recipientCriteria, Message message, HelixDataAccessor targetDataAccessor) { List<Message> messages = new ArrayList<Message>(); List<Map<String, String>> matchedList = _evaluator.evaluateCriteria(recipientCriteria, targetDataAccessor); if (!matchedList.isEmpty()) { Map<String, String> sessionIdMap = new HashMap<String, String>(); if (recipientCriteria.isSessionSpecific()) { Builder keyBuilder = targetDataAccessor.keyBuilder(); List<LiveInstance> liveInstances = targetDataAccessor.getChildValues(keyBuilder.liveInstances(), true); for (LiveInstance liveInstance : liveInstances) { sessionIdMap.put(liveInstance.getInstanceName(), liveInstance.getEphemeralOwner()); } } for (Map<String, String> map : matchedList) { String id = UUID.randomUUID().toString(); Message newMessage = new Message(message.getRecord(), id); String srcInstanceName = _manager.getInstanceName(); String tgtInstanceName = map.get("instanceName"); if (recipientCriteria.isSelfExcluded() && srcInstanceName.equalsIgnoreCase(tgtInstanceName)) { continue; } newMessage.setSrcName(srcInstanceName); newMessage.setTgtName(tgtInstanceName); newMessage.setResourceName(map.get("resourceName")); newMessage.setPartitionName(map.get("partitionName")); if (recipientCriteria.isSessionSpecific()) { newMessage.setTgtSessionId(sessionIdMap.get(tgtInstanceName)); } messages.add(newMessage); } } return messages; }

Target:
private List<Message> generateMessagesForParticipant(Criteria recipientCriteria, Message message, HelixDataAccessor targetDataAccessor) { List<Message> messages = new ArrayList<Message>(); List<Map<String, String>> matchedList = _evaluator.evaluateCriteria(recipientCriteria, targetDataAccessor); if (!matchedList.isEmpty()) { Map<String, String> sessionIdMap = new HashMap<String, String>(); if (recipientCriteria.isSessionSpecific()) { Builder keyBuilder = targetDataAccessor.keyBuilder(); List<LiveInstance> liveInstances = targetDataAccessor.getChildValues(keyBuilder.liveInstances(), false); for (LiveInstance liveInstance : liveInstances) { sessionIdMap.put(liveInstance.getInstanceName(), liveInstance.getEphemeralOwner()); } } for (Map<String, String> map : matchedList) { String id = UUID.randomUUID().toString(); Message newMessage = new Message(message.getRecord(), id); String srcInstanceName = _manager.getInstanceName(); String tgtInstanceName = map.get("instanceName"); if (recipientCriteria.isSelfExcluded() && srcInstanceName.equalsIgnoreCase(tgtInstanceName)) { continue; } newMessage.setSrcName(srcInstanceName); newMessage.setTgtName(tgtInstanceName); newMessage.setResourceName(map.get("resourceName")); newMessage.setPartitionName(map.get("partitionName")); if (recipientCriteria.isSessionSpecific()) { newMessage.setTgtSessionId(sessionIdMap.get(tgtInstanceName)); } messages.add(newMessage); } } return messages; }
Source:
private <T extends IBootstrapComponent> void addBootstrapComponent( Class<? extends IBootstrapComponent> eventType, T component ) { List<IBootstrapComponent> eventList = bootstrapComponents.get( eventType ); if( eventList == null ) { eventList = new ArrayList<>(); bootstrapComponents.put( eventType, eventList ); } eventList.add( component ); }

Target:
private <T extends IBootstrapComponent> void addBootstrapComponent( Class<? extends IBootstrapComponent> eventType, T component ) { bootstrapComponents.computeIfAbsent( eventType, c -> new ArrayList<IBootstrapComponent>() ).add( component ); }
Source:
public ProfilingLogger(final ConnectionInfo connectionInfo) throws DbException { accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); accessMethod.createTableIfNotExists(MyriaConstants.PROFILING_RELATION, MyriaConstants.PROFILING_SCHEMA); accessMethod.createTableIfNotExists(MyriaConstants.SENT_RELATION, MyriaConstants.SENT_SCHEMA); createProfilingIndexes(); createSentIndex(); if (accessMethod instanceof JdbcAccessMethod) { connection = ((JdbcAccessMethod) accessMethod).getConnection(); try { statementEvent = connection.prepareStatement(accessMethod.insertStatementFromSchema(MyriaConstants.PROFILING_SCHEMA, MyriaConstants.PROFILING_RELATION)); } catch (SQLException e) { throw new DbException(e); } try { statementSent = connection.prepareStatement(accessMethod.insertStatementFromSchema(MyriaConstants.SENT_SCHEMA, MyriaConstants.SENT_RELATION)); } catch (SQLException e) { throw new DbException(e); } } else { connection = null; throw new NotImplementedError(); } }

Target:
public ProfilingLogger(final ConnectionInfo connectionInfo) throws DbException { accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); accessMethod.createTableIfNotExists(MyriaConstants.PROFILING_RELATION, MyriaConstants.PROFILING_SCHEMA); accessMethod.createTableIfNotExists(MyriaConstants.SENT_RELATION, MyriaConstants.SENT_SCHEMA); createProfilingIndexes(); createSentIndex(); if (accessMethod instanceof JdbcAccessMethod) { connection = ((JdbcAccessMethod) accessMethod).getConnection(); try { statementEvent = connection.prepareStatement(accessMethod.insertStatementFromSchema(MyriaConstants.PROFILING_SCHEMA, MyriaConstants.PROFILING_RELATION)); } catch (SQLException e) { throw new DbException(e); } try { statementSent = connection.prepareStatement(accessMethod.insertStatementFromSchema(MyriaConstants.SENT_SCHEMA, MyriaConstants.SENT_RELATION)); } catch (SQLException e) { throw new DbException(e); } } else { connection = null; throw new UnsupportedOperationException("Profiling only supported with JDBC connection"); } }
Source:
public long estimateMemorySize() { return SIZE_OF_OGC_POINT + (point != null ? point.estimateMemorySize() : 0) + (esriSR != null ? esriSR.estimateMemorySize() : 0); }

Target:
public long estimateMemorySize() { return SIZE_OF_OGC_POINT + (point != null ? point.estimateMemorySize() : 0); }
Source:
public void onDestroyView() { LoaderManager.getInstance(requireActivity()).destroyLoader(HISTORY_FRAGMENT_LOADER_ID); searchErrorView.setRetryClickListener(null); unbinder.unbind(); unbinder = null; disposables.clear(); super.onDestroyView(); }

Target:
public void onDestroyView() { searchErrorView.setRetryClickListener(null); unbinder.unbind(); unbinder = null; disposables.clear(); super.onDestroyView(); }
Source:
public String toString() { return "NotificationDto [runName=" + runAlias + ", sequencerFolderPath=" + sequencerFolderPath + ", sequencerName=" + sequencerName + ", containerId=" + containerSerialNumber + ", laneCount=" + laneCount + ", healthType=" + healthType + ", completionDate=" + completionDate + ", startDate=" + startDate + ", pairedEndRun=" + pairedEndRun + ", software=" + software + "]"; }

Target:
public String toString() { return "NotificationDto [runAlias=" + runAlias + ", sequencerFolderPath=" + sequencerFolderPath + ", sequencerName=" + sequencerName + ", containerSerialNumber=" + containerSerialNumber + ", laneCount=" + laneCount + ", healthType=" + healthType + ", startDate=" + startDate + ", completionDate=" + completionDate + ", pairedEndRun=" + pairedEndRun + ", software=" + software + "]"; }
Source:
void recurseSubmodules(String mode) { if (mode == null || mode.isEmpty()) { recurseSubmodules = FetchRecurseSubmodulesMode.YES; } else { try { recurseSubmodules = FetchRecurseSubmodulesMode.valueOf(mode); } catch (IllegalArgumentException e) { throw die(MessageFormat.format( CLIText.get().invalidRecurseSubmodulesMode, mode)); } } }

Target:
void recurseSubmodules(String mode) { if (mode == null || mode.isEmpty()) { recurseSubmodules = FetchRecurseSubmodulesMode.YES; } else { for (FetchRecurseSubmodulesMode m : FetchRecurseSubmodulesMode .values()) { if (m.matchConfigValue(mode)) { recurseSubmodules = m; return; } } throw die(MessageFormat .format(CLIText.get().invalidRecurseSubmodulesMode, mode)); } }
Source:
public Subscription schedule(final Action0 action, long delayTime, TimeUnit unit) { final ScheduledAction scheduledAction = new ScheduledAction(action); scheduledAction.addParent(mCompositeSubscription); scheduledAction.add(Subscriptions.create(new Action0() { @Override public void call() { handler.removeCallbacks(scheduledAction); } })); handler.postDelayed(scheduledAction, unit.toMillis(delayTime)); return scheduledAction; }

Target:
public Subscription schedule(final Action0 action, long delayTime, TimeUnit unit) { final ScheduledAction scheduledAction = new ScheduledAction(action); scheduledAction.add(Subscriptions.create(new Action0() { @Override public void call() { handler.removeCallbacks(scheduledAction); } })); scheduledAction.addParent(compositeSubscription); compositeSubscription.add(scheduledAction); handler.postDelayed(scheduledAction, unit.toMillis(delayTime)); return scheduledAction; }
Source:
public void readDirectory() throws Exception { SequenceFileTextValueReader reader = newReader(SEQUENCE_FILES); ArrayList<String> items = readAll(reader); assertThat(items, contains("a", "bb", "ccc", "a", "bb", "ccc")); }

Target:
public void readDirectory() throws Exception { SequenceFileTextValueReader reader = newReader(SEQUENCE_FILES); ArrayList<String> items = readAll(reader); assertThat(items, either(contains("a", "bb", "ccc", "d", "ee", "fff")) .or(contains("d", "ee", "fff", "a", "bb", "ccc"))); }
Source:
private Map<String, String> parsePathParameters() { Map<String, String> query_pairs = new LinkedHashMap<>(); int idxQuery = this.relativeUrl.indexOf("?"); if (idxQuery != -1 && idxQuery < this.relativeUrl.length() - 1) { String query = this.relativeUrl.substring(idxQuery+1); Matcher queryParamMatcher = PARAM_URL_REGEX.matcher(query); if (queryParamMatcher.find()) { throw methodError(method, "URL query string \"%s\" must not have replace block. " + "For dynamic query parameters use @Query.", query); } String[] pairs = query.split("&"); for (String pair : pairs) { int idx = pair.indexOf("="); query_pairs.put(pair.substring(0, idx), pair.substring(idx + 1)); } this.relativeUrl = this.relativeUrl.substring(0, idxQuery); } return query_pairs; }

Target:
private Map<String, String> parsePathParameters() { Map<String, String> queryPairs = new LinkedHashMap<>(); if(this.relativeUrl == null) { return queryPairs; } int idxQuery = this.relativeUrl.indexOf("?"); if (idxQuery != -1 && idxQuery < this.relativeUrl.length() - 1) { String query = this.relativeUrl.substring(idxQuery + 1); Matcher queryParamMatcher = PARAM_URL_REGEX.matcher(query); if (queryParamMatcher.find()) { throw methodError(method, "URL query string \"%s\" must not have replace block. " + "For dynamic query parameters use @Query.", query); } String[] pairs = query.split("&"); for (String pair : pairs) { int idx = pair.indexOf("="); queryPairs.put(pair.substring(0, idx), pair.substring(idx + 1)); } this.relativeUrl = this.relativeUrl.substring(0, idxQuery); } return queryPairs; }
Source:
private void sendForm(HttpServletRequest req, HttpServletResponse res, boolean link, @Nullable String errorMessage) throws IOException { String self = req.getRequestURI(); String cancel = Objects.firstNonNull(urlProvider != null ? urlProvider.get() : "/", "/"); String token = LoginUrlToken.getToken(req); cancel += token; Document doc = header.parse(LoginForm.class, "LoginForm.html"); HtmlDomUtil.find(doc, "hostName").setTextContent(req.getServerName()); HtmlDomUtil.find(doc, "login_form").setAttribute("action", self); HtmlDomUtil.find(doc, "cancel_link").setAttribute("href", cancel); if (!link || ssoUrl != null) { Element input = HtmlDomUtil.find(doc, "f_link"); input.getParentNode().removeChild(input); } String last = getLastId(req); if (last != null) { HtmlDomUtil.find(doc, "f_openid").setAttribute("value", last); } Element emsg = HtmlDomUtil.find(doc, "error_message"); if (Strings.isNullOrEmpty(errorMessage)) { emsg.getParentNode().removeChild(emsg); } else { emsg.setTextContent(errorMessage); } for (String name : ALL_PROVIDERS.keySet()) { Element div = HtmlDomUtil.find(doc, "provider_" + name); if (div == null) { continue; } if (!suggestProviders.contains(name)) { div.getParentNode().removeChild(div); continue; } Element a = HtmlDomUtil.find(div, "id_" + name); if (a == null) { div.getParentNode().removeChild(div); continue; } StringBuilder u = new StringBuilder(); u.append(self).append(a.getAttribute("href")); if (link) { u.append("&link"); } a.setAttribute("href", u.toString()); } sendHtml(res, doc); }

Target:
private void sendForm(HttpServletRequest req, HttpServletResponse res, boolean link, @Nullable String errorMessage) throws IOException { String self = req.getRequestURI(); String cancel = Objects.firstNonNull(urlProvider != null ? urlProvider.get() : "/", "/"); cancel += LoginUrlToken.getToken(req); Document doc = header.parse(LoginForm.class, "LoginForm.html"); HtmlDomUtil.find(doc, "hostName").setTextContent(req.getServerName()); HtmlDomUtil.find(doc, "login_form").setAttribute("action", self); HtmlDomUtil.find(doc, "cancel_link").setAttribute("href", cancel); if (!link || ssoUrl != null) { Element input = HtmlDomUtil.find(doc, "f_link"); input.getParentNode().removeChild(input); } String last = getLastId(req); if (last != null) { HtmlDomUtil.find(doc, "f_openid").setAttribute("value", last); } Element emsg = HtmlDomUtil.find(doc, "error_message"); if (Strings.isNullOrEmpty(errorMessage)) { emsg.getParentNode().removeChild(emsg); } else { emsg.setTextContent(errorMessage); } for (String name : ALL_PROVIDERS.keySet()) { Element div = HtmlDomUtil.find(doc, "provider_" + name); if (div == null) { continue; } if (!suggestProviders.contains(name)) { div.getParentNode().removeChild(div); continue; } Element a = HtmlDomUtil.find(div, "id_" + name); if (a == null) { div.getParentNode().removeChild(div); continue; } StringBuilder u = new StringBuilder(); u.append(self).append(a.getAttribute("href")); if (link) { u.append("&link"); } a.setAttribute("href", u.toString()); } sendHtml(res, doc); }
Source:
public static OwnershipTaxClassification fromTaxClassification(String taxClassification) { for (OwnershipTaxClassification oc : OwnershipTaxClassification.values()) { if (StringUtils.equals(taxClassification, oc.taxClassification)) { return oc; } } return null; }

Target:
public static OwnershipTaxClassification fromTaxClassification(String taxClassification) { for (OwnershipTaxClassification oc : OwnershipTaxClassification.values()) { if (StringUtils.equals(taxClassification, oc.taxClassification)) { return oc; } } return OwnershipTaxClassification.UNKNOWN; }
Source:
public boolean cancel(boolean mayInterruptIfRunning) { boolean cancelled = super.cancel(mayInterruptIfRunning); return clearTaskAfterCompletion(cancelled, CANCELLED); }

Target:
public boolean cancel(boolean mayInterruptIfRunning) { return clearTaskAfterCompletion(super.cancel(mayInterruptIfRunning), CANCELLED); }
Source:
public List<Group> listGroups(Condition condition, int limit, int offset) throws UserStoreException { validateCondition(condition); String domain = getDomainFromCondition(condition); handlePreListGroup(condition, domain); List<Group> filteredGroups = new ArrayList<>(); UserStoreManager secManager = getSecondaryUserStoreManager(domain); if (secManager != null) { if (secManager instanceof AbstractUserStoreManager) { if (isUniqueUserIdEnabled(secManager)) { UniqueIDPaginatedSearchResult <Group> groups = ((AbstractUserStoreManager) secManager) .doListGroups(condition, domain, offset, limit, null, null); filteredGroups = groups.getEntities(); } else { throw new UserStoreException(" listGroups is not supported."); } } } handlePostListGroups(condition, domain, false); return filteredGroups; }

Target:
public List<Group> listGroups(Condition condition, int limit, int offset) throws UserStoreException { return listGroups(condition, offset, limit, null, null); }
Source:
private static MemcacheProtocolConfig initMemcacheProtocolConfig(Config config) { AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig(); boolean isAdvancedNetwork = advancedNetworkConfig.isEnabled(); if (isAdvancedNetwork) { return new MemcacheProtocolConfig().setEnabled(true); } return config.getNetworkConfig().getMemcacheProtocolConfig(); }

Target:
private static MemcacheProtocolConfig initMemcacheProtocolConfig(Config config) { AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig(); boolean isAdvancedNetwork = advancedNetworkConfig.isEnabled(); if (isAdvancedNetwork && config.getAdvancedNetworkConfig().getEndpointConfigs().get(MEMCACHE) != null) { return new MemcacheProtocolConfig().setEnabled(true); } return config.getNetworkConfig().getMemcacheProtocolConfig(); }
Source:
private void runInternal() { try { operationSelector.start(); while (!stage.isTerminated()) { boolean started = stage.isStarted(); if (started) { txRemainingOperations = 0; if (ongoingTx != null) { endTransactionAndRegisterStats(null); } break; } else { if (!isStarted()) { Operation operation = operationSelector.next(random); try { logic.run(operation); stats.begin(); this.started = true; } catch (OperationLogic.RequestException e) { } } } } completion.start(); int i = 0; while (!stage.isTerminated()) { Operation operation = operationSelector.next(random); if (!completion.moreToRun()) break; try { logic.run(operation); } catch (OperationLogic.RequestException e) { } i++; completion.logProgress(i); } } finally { if (txRemainingOperations > 0) { endTransactionAndRegisterStats(null); } } }

Target:
private void runInternal() { boolean counted = false; try { operationSelector.start(); while (!stage.isTerminated()) { boolean started = stage.isStarted(); if (started) { txRemainingOperations = 0; if (ongoingTx != null) { endTransactionAndRegisterStats(null); } break; } else { if (!counted) { threadCountDown.countDown(); counted = true; } Operation operation = operationSelector.next(random); try { logic.run(operation); } catch (OperationLogic.RequestException e) { } } } stats.begin(); this.started = true; completion.start(); int i = 0; while (!stage.isTerminated()) { Operation operation = operationSelector.next(random); if (!completion.moreToRun()) break; try { logic.run(operation); } catch (OperationLogic.RequestException e) { } i++; completion.logProgress(i); } } finally { if (txRemainingOperations > 0) { endTransactionAndRegisterStats(null); } } }
Source:
protected List<MPartStack> findDirectStacks(MPartSashContainer root) { List<MPartStack> result = new ArrayList<>(); for (MPartSashContainerElement e : root.getChildren()) { if (e instanceof MPartStack) { result.add((MPartStack) e); } else if (e instanceof MPartSashContainer) { result.addAll(findDirectStacks((MPartSashContainer) e)); } } return result; }

Target:
private List<MPartStack> findDirectStacks(MPartSashContainer root) { List<MPartStack> result = new ArrayList<>(); for (MPartSashContainerElement e : root.getChildren()) { if (e instanceof MPartStack) { result.add((MPartStack) e); } else if (e instanceof MPartSashContainer) { result.addAll(findDirectStacks((MPartSashContainer) e)); } } return result; }
Source:
void setInput(final RevFlag hFlag, final SWTCommitList list, final SWTCommit[] asArray, HistoryPageInput input) { this.input = input; if (menuListener != null) menuListener.setInput(input); final SWTCommitList oldList = allCommits; highlight = hFlag; allCommits = list; table.setInput(asArray); if (asArray != null && asArray.length > 0) { if (oldList != list) selectCommit(asArray[0]); initCommitsMap(); } else { table.getTable().deselectAll(); } }

Target:
void setInput(final RevFlag hFlag, final SWTCommitList list, final SWTCommit[] asArray, HistoryPageInput input) { this.input = input; if (menuListener != null) menuListener.setInput(input); final SWTCommitList oldList = allCommits; highlight = hFlag; allCommits = list; table.setInput(asArray); if (asArray != null && asArray.length > 0) { if (oldList != list) { selectCommit(asArray[0]); initCommitsMap(); } } else { table.getTable().deselectAll(); } }
Source:
private Node deserializeObject(JsonObject nodeJson) { try { String serializedNodeType = nodeJson.getString("!"); BaseNodeMetaModel nodeMetaModel = getNodeMetaModel(Class.forName(serializedNodeType)) .orElseThrow(() -> new IllegalStateException("Trying to deserialize an unknown node type: " + serializedNodeType)); Map<String, Object> parameters = new HashMap<>(); for (String name : nodeJson.keySet()) { if (name.equals("!")) { continue; } PropertyMetaModel propertyMetaModel = nodeMetaModel.getAllPropertyMetaModels().stream() .filter(mm -> mm.getName().equals(name)) .findFirst().orElseThrow(() -> new IllegalStateException("Unknown property: " + nodeMetaModel.getQualifiedClassName() + "." + name)); if (propertyMetaModel.isNodeList()) { JsonArray nodeListJson = nodeJson.getJsonArray(name); parameters.put(name, deserializeNodeList(nodeListJson)); } else if (propertyMetaModel.isEnumSet()) { JsonArray enumSetJson = nodeJson.getJsonArray(name); parameters.put(name, deserializeEnumSet(enumSetJson)); } else if (propertyMetaModel.isNode()) { parameters.put(name, deserializeObject(nodeJson.getJsonObject(name))); } else { Class<?> type = propertyMetaModel.getType(); if (type == String.class) { parameters.put(name, nodeJson.getString(name)); } else if (type == boolean.class) { parameters.put(name, Boolean.parseBoolean(nodeJson.getString(name))); } else { throw new IllegalStateException("Don't know how to convert: " + type); } } } return nodeMetaModel.construct(parameters); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }

Target:
private Node deserializeObject(JsonObject nodeJson) { try { String serializedNodeType = nodeJson.getString(SERIALIZED_CLASS_KEY); BaseNodeMetaModel nodeMetaModel = getNodeMetaModel(Class.forName(serializedNodeType)) .orElseThrow(() -> new IllegalStateException("Trying to deserialize an unknown node type: " + serializedNodeType)); Map<String, Object> parameters = new HashMap<>(); for (String name : nodeJson.keySet()) { if (name.equals(SERIALIZED_CLASS_KEY)) { continue; } PropertyMetaModel propertyMetaModel = nodeMetaModel.getAllPropertyMetaModels().stream() .filter(mm -> mm.getName().equals(name)) .findFirst().orElseThrow(() -> new IllegalStateException("Unknown property: " + nodeMetaModel.getQualifiedClassName() + "." + name)); if (propertyMetaModel.isNodeList()) { JsonArray nodeListJson = nodeJson.getJsonArray(name); parameters.put(name, deserializeNodeList(nodeListJson)); } else if (propertyMetaModel.isEnumSet()) { JsonArray enumSetJson = nodeJson.getJsonArray(name); parameters.put(name, deserializeEnumSet(enumSetJson)); } else if (propertyMetaModel.isNode()) { parameters.put(name, deserializeObject(nodeJson.getJsonObject(name))); } else { Class<?> type = propertyMetaModel.getType(); if (type == String.class) { parameters.put(name, nodeJson.getString(name)); } else if (type == boolean.class) { parameters.put(name, Boolean.parseBoolean(nodeJson.getString(name))); } else { throw new IllegalStateException("Don't know how to convert: " + type); } } } return nodeMetaModel.construct(parameters); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }
Source:
public Connection connect(String url, Properties info) throws SQLException { if (url.startsWith(LONG_PREFIX)) { url = url.substring(LONG_PREFIX.length()); } else if (url.startsWith(PREFIX)) { url = url.substring(PREFIX.length()); } else { return null; } CrateConnection connection; ClientHandleRegistry.ClientHandle handle = clientHandleRegistry.getHandle(url); if (url.equals("/")) { connection = new CrateConnection(handle, info); connection.connect(); } else { String[] pathAndParams = url.split("\\?"); connection = new CrateConnection(handle, info); connection.connect(); try { String[] urlParts = pathAndParams[0].split("/"); if (urlParts.length == 2) connection.setSchema(urlParts[1]); if (pathAndParams.length == 2) connection.setClientInfo(parseProperties(pathAndParams[1])); else if (urlParts.length > 2) { connection.close(); throw new SQLException("URL format is invalid. " + "Valid format is: [jdbc:]crate://[host1:port1][, host2:port2 ...][/schema][?property=value]"); } } catch (InvalidPropertiesFormatException e) { connection.close(); throw new SQLException(e.getMessage()); } } return connection; }

Target:
public Connection connect(String url, Properties info) throws SQLException { if (url.startsWith(LONG_PREFIX)) { url = url.substring(LONG_PREFIX.length()); } else if (url.startsWith(PREFIX)) { url = url.substring(PREFIX.length()); } else { return null; } try { url = parseUrl(url, info); } catch (IOException e) { throw new SQLException(e); } ClientHandleRegistry.ClientHandle handle = clientHandleRegistry.getHandle(url); CrateConnection connection = new CrateConnection(handle, info); connection.connect(); if (!url.equals("/")) { String[] urlParts = url.split("/"); if (urlParts.length == 2) { connection.setSchema(urlParts[1]); } else if (urlParts.length > 2) { connection.close(); throw new SQLException("URL format is invalid. " + "Valid format is: [jdbc:]crate://[host1:port1][, host2:port2 ...][/schema][?property=value]"); } connection.setClientInfo(info); } return connection; }
Source:
public Object visit(ASTUserClass node, Object data) { List<ASTFieldDeclaration> fields = node.findDescendantsOfType(ASTFieldDeclaration.class); List<ASTMethod> methods = node.findDescendantsOfType(ASTMethod.class); Optional<NodeAndLocation> firstMethod = methods.stream() .filter(method -> method.hasRealLoc()) .map(method -> new NodeAndLocation(method)) .min(Comparator.naturalOrder()); if (!firstMethod.isPresent()) { return data; } for (ASTFieldDeclaration field : fields) { NodeAndLocation fieldPosition = new NodeAndLocation(field); if (fieldPosition.compareTo(firstMethod.get()) > 0) { addViolation(data, field, field.getName()); } } return data; }

Target:
public Object visit(ASTUserClass node, Object data) { List<ASTField> fields = node.findChildrenOfType(ASTField.class); List<ApexNode<?>> nonFieldDeclarations = new ArrayList<>(); nonFieldDeclarations.addAll(getMethodNodes(node)); nonFieldDeclarations.addAll(node.findChildrenOfType(ASTUserClass.class)); nonFieldDeclarations.addAll(node.findChildrenOfType(ASTProperty.class)); nonFieldDeclarations.addAll(node.findChildrenOfType(ASTBlockStatement.class)); Optional<ApexNode<?>> firstNonFieldDeclaration = nonFieldDeclarations.stream() .filter(ApexNode::hasRealLoc) .min(NODE_BY_SOURCE_LOCATION_COMPARATOR); if (!firstNonFieldDeclaration.isPresent()) { return data; } for (ASTField field : fields) { if (NODE_BY_SOURCE_LOCATION_COMPARATOR.compare(field, firstNonFieldDeclaration.get()) > 0) { addViolation(data, field, field.getName()); } } return data; }
Source:
public void givenTextContentTypeAtLowAlertThresholdThenAlertRaised() throws Exception { rule.setAlertThreshold(Plugin.AlertThreshold.LOW); HttpMessage msg = createHttpMessageWithHeaders(new String[] {HEADER_TEXT}); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertContentSecurityPolicyAlertRaised(); }

Target:
public void givenTextContentTypeAtLowAlertThresholdThenAlertRaised() throws Exception { rule.setAlertThreshold(Plugin.AlertThreshold.LOW); HttpMessage msg = createHttpMessageWithHeaders(HEADER_TEXT); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertContentSecurityPolicyAlertRaised(); }
Source:
public void initialize() throws Exception { super.init(); endpointUrl = backEndServerUrl.getWebAppURLHttp() + API_END_POINT_POSTFIX_URL; storeURLHttp = getStoreURLHttp(); providerName = publisherContext.getContextTenant().getTenantUser(USER_KEY_USER2).getUserName(); User publisherUser1 = publisherContext.getContextTenant().getTenantUser(USER_KEY_USER2); apiPublisherClientCarbonSuperUser1 = new RestAPIPublisherImpl(publisherUser1.getUserNameWithoutDomain(), publisherUser1.getPassword(), publisherUser1.getUserDomain(), publisherURLHttps); userManagementClient = new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(), createSession(keyManagerContext)); userManagementClient.addRole(ROLE, null, PERMISSIONS); userManagementClient.addUser(ALLOWED_USER, ALLOWED_USER_PASS, new String[] {ROLE}, null); apiStoreClientAllowedUser = new RestAPIStoreImpl(ALLOWED_USER, ALLOWED_USER_PASS, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, storeURLHttps); anonymousRestAPIImpl = super.getRestAPIStoreForAnonymousUser(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); }

Target:
public void initialize() throws Exception { super.init(); endpointUrl = backEndServerUrl.getWebAppURLHttp() + API_END_POINT_POSTFIX_URL; storeURLHttp = getStoreURLHttp(); providerName = publisherContext.getContextTenant().getTenantUser(USER_KEY_USER2).getUserName(); User publisherUser1 = publisherContext.getContextTenant().getTenantUser(USER_KEY_USER2); apiPublisherClientCarbonSuperUser1 = new RestAPIPublisherImpl(publisherUser1.getUserNameWithoutDomain(), publisherUser1.getPassword(), publisherUser1.getUserDomain(), publisherURLHttps); userManagementClient = new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(), createSession(keyManagerContext)); userManagementClient.addRole(ROLE, null, PERMISSIONS); userManagementClient.addUser(ALLOWED_USER, ALLOWED_USER_PASS, new String[] {ROLE}, null); apiStoreClientAllowedUser = new RestAPIStoreImpl(ALLOWED_USER, ALLOWED_USER_PASS, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, storeURLHttps); anonymousRestAPIImpl = getRestAPIStoreForAnonymousUser(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); }
Source:
public FileInfo[] listDir(){ try { return Files.list(p).map( path -> new PathInfo(path) ).toArray(PathInfo[]::new); } catch (IOException e) { e.printStackTrace(); return null; } }

Target:
public FileInfo[] listDir() throws IOException { return Files.list(p).map( path -> new PathInfo(path) ).toArray(PathInfo[]::new); }
Source:
public void setRyaStreamsConfiguration(final String ryaInstance, final RyaStreamsDetails streamsDetails) throws InstanceDoesNotExistException, RyaClientException{ requireNonNull(streamsDetails); if(!instanceExists.exists(ryaInstance)) { throw new InstanceDoesNotExistException("There is no Rya instance named '" + ryaInstance + "' in this storage."); } final RyaDetailsRepository repo = getRyaDetailsRepo(ryaInstance); try { new RyaDetailsUpdater(repo).update(oldDetails -> { final RyaDetails.Builder builder = RyaDetails.builder(oldDetails); builder.setRyaStreamsDetails(streamsDetails); return builder.build(); }); } catch (CouldNotApplyMutationException | RyaDetailsRepositoryException e) { throw new RyaClientException("Unable to update which Rya Streams subsystem is used by the '" + ryaInstance + "' Rya instance.", e); } }

Target:
public void setRyaStreamsConfiguration(final String ryaInstance, final RyaStreamsDetails streamsDetails) throws InstanceDoesNotExistException, RyaClientException{ requireNonNull(ryaInstance); requireNonNull(streamsDetails); if(!instanceExists.exists(ryaInstance)) { throw new InstanceDoesNotExistException("There is no Rya instance named '" + ryaInstance + "' in this storage."); } final RyaDetailsRepository repo = getRyaDetailsRepo(ryaInstance); try { new RyaDetailsUpdater(repo).update(oldDetails -> { final RyaDetails.Builder builder = RyaDetails.builder(oldDetails); builder.setRyaStreamsDetails(streamsDetails); return builder.build(); }); } catch (CouldNotApplyMutationException | RyaDetailsRepositoryException e) { throw new RyaClientException("Unable to update which Rya Streams subsystem is used by the '" + ryaInstance + "' Rya instance.", e); } }
Source:
private void uploadPersonalNote() { final SimpleCancellableHandler myHandler = new SimpleCancellableHandler(CacheDetailActivity.this, progress); final Message cancelMessage = myHandler.cancelMessage(res.getString(R.string.cache_personal_note_upload_cancelled)); progress.show(CacheDetailActivity.this, res.getString(R.string.cache_personal_note_uploading), res.getString(R.string.cache_personal_note_uploading), true, cancelMessage); myHandler.unsubscribeIfCancelled(AndroidRxUtils.networkScheduler.createWorker().schedule(new Action0() { @Override public void call() { final IConnector con = ConnectorFactory.getConnector(cache); if (con.supportsPersonalNote()) { final boolean success = con.uploadPersonalNote(cache); final Message msg = Message.obtain(); final Bundle bundle = new Bundle(); if (success) { bundle.putString(SimpleCancellableHandler.MESSAGE_TEXT, CgeoApplication.getInstance().getString(R.string.cache_personal_note_upload_done)); } else { bundle.putString(SimpleCancellableHandler.MESSAGE_TEXT, CgeoApplication.getInstance().getString(R.string.cache_personal_note_upload_error)); } msg.setData(bundle); myHandler.sendMessage(msg); } } })); }

Target:
private void uploadPersonalNote() { final SimpleCancellableHandler myHandler = new SimpleCancellableHandler(CacheDetailActivity.this, progress); final Message cancelMessage = myHandler.cancelMessage(res.getString(R.string.cache_personal_note_upload_cancelled)); progress.show(CacheDetailActivity.this, res.getString(R.string.cache_personal_note_uploading), res.getString(R.string.cache_personal_note_uploading), true, cancelMessage); myHandler.unsubscribeIfCancelled(AndroidRxUtils.networkScheduler.createWorker().schedule(new Action0() { @Override public void call() { final IConnector con = ConnectorFactory.getConnector(cache); final boolean success = con.uploadPersonalNote(cache); final Message msg = Message.obtain(); final Bundle bundle = new Bundle(); bundle.putString(SimpleCancellableHandler.MESSAGE_TEXT, CgeoApplication.getInstance().getString(success ? R.string.cache_personal_note_upload_done : R.string.cache_personal_note_upload_error)); msg.setData(bundle); myHandler.sendMessage(msg); } })); }
Source:
private UpdatedObservableAdapter<EditableConfiguration> setAsObservableConfigModel(ForwardingObservable<EditableConfiguration> model) { Optional.ofNullable(observableConfigModel).ifPresent(UpdatedObservableAdapter::close); observableConfigModel = new UpdatedObservableAdapter<>(model); groupEditorViewModel.updateModel(observableConfigModel); return observableConfigModel; }

Target:
private void setAsObservableConfigModel(ForwardingObservable<EditableConfiguration> model) { Optional.ofNullable(observableConfigModel).ifPresent(UpdatedObservableAdapter::close); observableConfigModel = new UpdatedObservableAdapter<>(model); groupEditorViewModel.updateModel(observableConfigModel); }
Source:
public void testExpiredEntriesCleared() { for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, i, TimeUnit.MILLISECONDS); } timeService.advance(SIZE / 2); cache.clear(); assertEquals(0, cache.getAdvancedCache().getDataContainer().sizeIncludingExpired()); }

Target:
public void testExpiredEntriesCleared() { for (int i = 0; i < 2; i++) { cache.put("key-" + i, "value-" + i,-1, null, i, TimeUnit.MILLISECONDS); } timeService.advance(1); cache.clear(); assertEquals(0, cache.getAdvancedCache().getDataContainer().sizeIncludingExpired()); }
Source:
public void onMediaDeleted(String localMediaId) { if (!TextUtils.isEmpty(localMediaId)) { if (mShowAztecEditor && !mShowGutenbergEditor) { mAztecBackspaceDeletedOrGbBlockDeletedMediaItemIds.add(localMediaId); UploadService.setDeletedMediaItemIds(mAztecBackspaceDeletedOrGbBlockDeletedMediaItemIds); cancelMediaUpload(StringUtils.stringToInt(localMediaId), false); } else if (mShowGutenbergEditor) { MediaModel mediaModel = mMediaStore.getMediaWithLocalId(StringUtils.stringToInt(localMediaId)); if (mediaModel == null) { return; } mAztecBackspaceDeletedOrGbBlockDeletedMediaItemIds.add(localMediaId); UploadService.setDeletedMediaItemIds(mAztecBackspaceDeletedOrGbBlockDeletedMediaItemIds); if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase(Locale.ROOT)) && !UploadService.isPendingOrInProgressMediaUpload(mediaModel)) { mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel)); } } } }

Target:
public void onMediaDeleted(String localMediaId) { if (!TextUtils.isEmpty(localMediaId)) { if (mShowAztecEditor && !mShowGutenbergEditor) { setDeletedMediaIdOnUploadService(localMediaId); cancelMediaUpload(StringUtils.stringToInt(localMediaId), false); } else if (mShowGutenbergEditor) { MediaModel mediaModel = mMediaStore.getMediaWithLocalId(StringUtils.stringToInt(localMediaId)); if (mediaModel == null) { return; } setDeletedMediaIdOnUploadService(localMediaId); if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase(Locale.ROOT)) && !UploadService.isPendingOrInProgressMediaUpload(mediaModel)) { mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel)); } } } }
Source:
private String createMailMessage(QueryContext queryContext) { StringBuilder msgBuilder = new StringBuilder(); switch(queryContext.getStatus().getStatus()){ case SUCCESSFUL: msgBuilder.append("Result available at "); String baseURI = conf.get(GrillConfConstants.GRILL_SERVER_BASE_URL, GrillConfConstants.DEFAULT_GRILL_SERVER_BASE_URL); msgBuilder.append(baseURI); msgBuilder.append("queryapi/queries/"); msgBuilder.append(queryContext.getQueryHandle()); msgBuilder.append("/resultset"); break; case FAILED: msgBuilder.append(queryContext.getStatus().getErrorMessage()); break; case CANCELED: case CLOSED: default: break; } return msgBuilder.toString(); }

Target:
private String createMailMessage(QueryContext queryContext) { StringBuilder msgBuilder = new StringBuilder(); switch(queryContext.getStatus().getStatus()){ case SUCCESSFUL: msgBuilder.append("Result available at "); String baseURI = conf.get(GrillConfConstants.GRILL_SERVER_BASE_URL, GrillConfConstants.DEFAULT_GRILL_SERVER_BASE_URL); msgBuilder.append(baseURI); msgBuilder.append("queryapi/queries/"); msgBuilder.append(queryContext.getQueryHandle()); msgBuilder.append("/httpresultset"); break; case FAILED: msgBuilder.append(queryContext.getStatus().getErrorMessage()); break; case CANCELED: case CLOSED: default: break; } return msgBuilder.toString(); }
Source:
public InvalidParameterValueException(Class expected, Class<? extends Object> actual) { super(MSG_PREFIX+expected.getName()+" but actual class was "+actual.getName()); }

Target:
public InvalidParameterValueException(Class expected, Class<? extends Object> actual) { super(format(MSG, expected.getName(), actual.getName())); }