auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Mono<String> vote(ServerWebExchange serverWebExchange) { return serverWebExchange.getFormData() .flatMap(formData -> voteRepository.save(new Vote(formData.getFirst("team"))) .map(vote -> String.format("Vote successfully cast for '%s' at time %s!%n", vote.candidate, vote.timeCast))); }

Target:
public Mono<String> vote(ServerWebExchange serverWebExchange) { return serverWebExchange.getFormData() .flatMap(formData -> voteRepository.save(new Vote(formData.getFirst("team")))) .map(vote -> String.format("Vote successfully cast for '%s' at time %s!%n", vote.getCandidate(), vote.getTimeCast())); }
Source:
public void performWork(LuceneWork work, IndexWriter writer, IndexingMonitor monitor) { DeleteByQueryLuceneWork deleteWork = (DeleteByQueryLuceneWork) work; final Class<?> entityType = work.getEntityClass(); final DeletionQuery query = deleteWork.getDeletionQuery(); log.tracef( "Removing all %s matching Query: %s", entityType.toString(), query.toString() ); BooleanQuery entityDeletionQuery = new BooleanQuery(); { DeleteByQuerySupport.ToLuceneQuery converter = DeleteByQuerySupport.TO_LUCENE_QUERY_CONVERTER.get( query.getQueryKey() ); ScopedAnalyzer analyzer = this.workspace.getDocumentBuilder( entityType ).getAnalyzer(); Query queryToDelete = converter.build( query, analyzer ); entityDeletionQuery.add( queryToDelete, BooleanClause.Occur.MUST ); } Term classNameQueryTerm = new Term( ProjectionConstants.OBJECT_CLASS, entityType.getName() ); TermQuery classNameQuery = new TermQuery( classNameQueryTerm ); entityDeletionQuery.add( classNameQuery, BooleanClause.Occur.MUST ); try { writer.deleteDocuments( entityDeletionQuery ); } catch (Exception e) { String message = String.format( "unable to remove all %s matching Query: %s", entityType.toString(), query.toString() ); throw new SearchException( message, e ); } this.workspace.notifyWorkApplied( work ); }

Target:
public void performWork(LuceneWork work, IndexWriter writer, IndexingMonitor monitor) { DeleteByQueryLuceneWork deleteWork = (DeleteByQueryLuceneWork) work; final Class<?> entityType = work.getEntityClass(); final DeletionQuery query = deleteWork.getDeletionQuery(); if ( log.isTraceEnabled() ) { log.tracef( "Removing all %s matching Query: %s", entityType.toString(), query.toString() ); } BooleanQuery entityDeletionQuery = new BooleanQuery(); { DeleteByQuerySupport.ToLuceneQuery converter = DeleteByQuerySupport.TO_LUCENE_QUERY_CONVERTER.get( query.getQueryKey() ); ScopedAnalyzer analyzer = this.workspace.getDocumentBuilder( entityType ).getAnalyzer(); Query queryToDelete = converter.build( query, analyzer ); entityDeletionQuery.add( queryToDelete, BooleanClause.Occur.MUST ); } Term classNameQueryTerm = new Term( ProjectionConstants.OBJECT_CLASS, entityType.getName() ); TermQuery classNameQuery = new TermQuery( classNameQueryTerm ); entityDeletionQuery.add( classNameQuery, BooleanClause.Occur.MUST ); try { writer.deleteDocuments( entityDeletionQuery ); } catch (IOException e) { String message = String.format( "unable to remove all %s matching Query: %s", entityType.toString(), query.toString() ); throw new SearchException( message, e ); } this.workspace.notifyWorkApplied( work ); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CacheKey cacheKey = (CacheKey) o; return joinedPath.equals(cacheKey.joinedPath) && loader.equals(cacheKey.loader); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CacheKey cacheKey = (CacheKey) o; return new EqualsBuilder().append(joinedPath, cacheKey.joinedPath) .append(loader, cacheKey.loader).isEquals(); }
Source:
public static BlockData getLavaData(final int level) { return Material.LAVA.createBlockData(d -> ((Levelled) d).setLevel((level < 0 || level > 15) ? 0 : level)); }

Target:
public static BlockData getLavaData(final int level) { return Material.LAVA.createBlockData(d -> ((Levelled) d).setLevel((level < 0 || level > ((Levelled) d).getMaximumLevel()) ? 0 : level)); }
Source:
public String toString() { switch (this) { case TRAITS: return "Ink"; case TYPE: return "Material"; case COMBO: return "Combo"; case NONE: return "None"; } return "Unkown"; }

Target:
public String toString() { switch (this) { case TRAITS: return "Ink"; case TYPE: return "Material"; case COMBO: return "Combo"; case NONE: return "None"; } return "Unknown"; }
Source:
public UserData getUserDataFromSessionId(@PathParam("sessionId") String sessionId) { if (sessionId != null && sessionStore.exists(sessionId)) { try { renewSession(sessionId); Scheduler scheduler = sessionStore.get(sessionId).getScheduler(); UserData userData = scheduler.getCurrentUserData(); return userData; } catch (Exception e) { return null; } } else { return null; } }

Target:
public UserData getUserDataFromSessionId(@PathParam("sessionId") String sessionId) { if (sessionId != null && sessionStore.exists(sessionId)) { try { renewSession(sessionId); Scheduler scheduler = sessionStore.get(sessionId).getScheduler(); UserData userData = scheduler.getCurrentUserData(); return userData; } catch (NotConnectedRestException | NotConnectedException e) { logger.trace(e); } catch (Exception e) { logger.warn(e); } } return null; }
Source:
public void auditLoggingOffForOutboundDR() { RetrieveDocumentSetRequestType request = new RetrieveDocumentSetRequestType(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targets = new NhinTargetCommunitiesType(); targets.setUseSpecVersion("2.0"); RetrieveDocumentSetResponseType expectedResponse = new RetrieveDocumentSetResponseType(); CONNECTOutboundOrchestrator orchestrator = mock(CONNECTOutboundOrchestrator.class); OutboundDocRetrieveOrchestratable orchResponse = mock(OutboundDocRetrieveOrchestratable.class); when(orchestrator.process(any(OutboundDocRetrieveOrchestratable.class))).thenReturn(orchResponse); when(orchResponse.getResponse()).thenReturn(expectedResponse); PassthroughOutboundDocRetrieve outboundDocRetrieve = (PassthroughOutboundDocRetrieve) getOutboundDocRetrieve( orchestrator, false); RetrieveDocumentSetResponseType actualResponse = outboundDocRetrieve.respondingGatewayCrossGatewayRetrieve( request, assertion, targets, ADAPTER_API_LEVEL.LEVEL_a0); assertSame(expectedResponse, actualResponse); verify(mockEJBLogger, never()).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.DOC_RETRIEVE_SERVICE_NAME), any(DocRetrieveAuditTransforms.class)); }

Target:
public void auditLoggingOffForOutboundDR() { targets.setUseSpecVersion("2.0"); RetrieveDocumentSetResponseType expectedResponse = new RetrieveDocumentSetResponseType(); when(orchestrator.process(any(OutboundDocRetrieveOrchestratable.class))).thenReturn(orchResponse); when(orchResponse.getResponse()).thenReturn(expectedResponse); PassthroughOutboundDocRetrieve outboundDocRetrieve = (PassthroughOutboundDocRetrieve) getOutboundDocRetrieve( orchestrator, false); RetrieveDocumentSetResponseType actualResponse = outboundDocRetrieve.respondingGatewayCrossGatewayRetrieve( request, assertion, targets, ADAPTER_API_LEVEL.LEVEL_a0); assertSame(expectedResponse, actualResponse); verify(mockEJBLogger, never()).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.DOC_RETRIEVE_SERVICE_NAME), any(DocRetrieveAuditTransforms.class)); }
Source:
private EClass getSubclass(Shell shell, EObject object, EReference reference) { EClass eclass = reference.getEReferenceType(); final EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(object); final Collection<EClass> subClasses = EMFUtils.getSubClasses(eclass, true, editingDomain); final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(new AdapterFactory[] { new ReflectiveItemProviderAdapterFactory(), new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE) }); final AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider( adapterFactory); final ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider); dialog.setTitle("Select EClass"); dialog.setMessage("Select a subclass to generate columns for all attributes from this EClass."); dialog.setMultipleSelection(false); dialog.setElements(subClasses.toArray(new EClass[subClasses.size()])); if (dialog.open() == Window.OK) { final Object firstResult = dialog.getFirstResult(); if (firstResult != null) { eclass = (EClass) firstResult; } } else { eclass = null; } labelProvider.dispose(); adapterFactory.dispose(); return eclass; }

Target:
private EClass getSubclass(Shell shell, EObject object, EReference reference) { EClass eclass = reference.getEReferenceType(); final Collection<EClass> subClasses = EMFUtils.getSubClasses(eclass, true, null); final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(new AdapterFactory[] { new ReflectiveItemProviderAdapterFactory(), new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE) }); final AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider( adapterFactory); final ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider); dialog.setTitle("Select EClass"); dialog.setMessage("Select a subclass to generate columns for all attributes from this EClass."); dialog.setMultipleSelection(false); dialog.setElements(subClasses.toArray(new EClass[subClasses.size()])); if (dialog.open() == Window.OK) { final Object firstResult = dialog.getFirstResult(); if (firstResult != null) { eclass = (EClass) firstResult; } } else { eclass = null; } labelProvider.dispose(); adapterFactory.dispose(); return eclass; }
Source:
private static Req pack(final Comment.Smart comment, final Pull pull) throws IOException { final PullRef head = pull.head(); final PullRef base = pull.base(); final Req req; final String repo = "repo"; if (head.json().isNull(repo)) { new Answer(comment).post( false, QnMerge.PHRASES.getString("QnMerge.head-is-gone") ); req = Req.EMPTY; } else if (base.json().isNull(repo)) { new Answer(comment).post( false, QnMerge.PHRASES.getString("QnMerge.base-is-gone") ); req = Req.EMPTY; } else { req = new Req.Simple( "merge", new MapOf<String, String>( new MapEntry<String, String>( "pull_id", Integer.toString(pull.number()) ), new MapEntry<String, String>( "pull_title", new Issue.Smart(comment.issue()).title() ), new MapEntry<String, String>( "fork_branch", head.ref() ), new MapEntry<String, String>( "head_branch", base.ref() ), new MapEntry<String, String>( "head", String.format( "git@github.com:%s.git", base.repo().coordinates().toString() ) ), new MapEntry<String, String>( "fork", String.format( "git@github.com:%s.git", head.repo().coordinates().toString() ) ) ) ); } return req; }

Target:
private static Req pack(final Comment.Smart comment, final Pull pull) throws IOException { final PullRef head = pull.head(); final PullRef base = pull.base(); final Req req; final String repo = "repo"; if (head.json().isNull(repo)) { new Answer(comment).post( false, QnMerge.PHRASES.getString("QnMerge.head-is-gone") ); req = Req.EMPTY; } else if (base.json().isNull(repo)) { new Answer(comment).post( false, QnMerge.PHRASES.getString("QnMerge.base-is-gone") ); req = Req.EMPTY; } else { req = new Req.Simple( "merge", new SolidMap<String, String>( new MapEntry<String, String>( "pull_id", Integer.toString(pull.number()) ), new MapEntry<String, String>( "pull_title", new Issue.Smart(comment.issue()).title() ), new MapEntry<String, String>( "fork_branch", head.ref() ), new MapEntry<String, String>( "head_branch", base.ref() ), new MapEntry<String, String>( "head", String.format( "git@github.com:%s.git", base.repo().coordinates().toString() ) ), new MapEntry<String, String>( "fork", String.format( "git@github.com:%s.git", head.repo().coordinates().toString() ) ) ) ); } return req; }
Source:
boolean validateVdsGroup() { if (getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); return false; } return true; }

Target:
boolean validateVdsGroup() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } return true; }
Source:
public void canGetAliases() { assertTrue(scv.getAliases().containsAll(aliases)); }

Target:
public void canGetAliases() { assertThat(scv.getAliases(), contains(aliases.toArray())); }
Source:
private boolean auditDomainsOnVsp(HostVO host, boolean add, boolean remove) { List<NuageVspDeviceVO> nuageVspDevices = _nuageVspDao.listByHost(host.getId()); if (!CollectionUtils.isEmpty(nuageVspDevices)) { _hostDao.loadDetails(host); List<DomainVO> allDomains = _domainDao.listAll(); for (DomainVO domain : allDomains) { try { SyncDomainCommand cmd = new SyncDomainCommand(domain.getUuid(), domain.getName(), domain.getPath(), add, remove); SyncDomainAnswer answer = (SyncDomainAnswer) _agentMgr.easySend(host.getId(), cmd); return answer.getSuccess(); } catch (Exception e) { s_logger.warn(e.getMessage()); return false; } } } return true; }

Target:
private boolean auditDomainsOnVsp(HostVO host, boolean add, boolean remove) { List<NuageVspDeviceVO> nuageVspDevices = _nuageVspDao.listByHost(host.getId()); if (CollectionUtils.isEmpty(nuageVspDevices)) { return true; } _hostDao.loadDetails(host); List<DomainVO> allDomains = _domainDao.listAll(); for (DomainVO domain : allDomains) { SyncDomainCommand cmd = new SyncDomainCommand(domain.getUuid(), domain.getName(), domain.getPath(), add, remove); SyncDomainAnswer answer = (SyncDomainAnswer) _agentMgr.easySend(host.getId(), cmd); return answer.getSuccess(); } return true; }
Source:
public void send_shouldFillInIntentData() throws Exception { Intent intent = new Intent(); Context context = new Activity(); PendingIntent pendingIntent = PendingIntent.getActivity(context, 99, intent, 100); Activity otherContext = new Activity(); Intent fillIntent = new Intent().putExtra("TEST", 23); pendingIntent.send(otherContext, 0, fillIntent); Intent i = shadowOf(otherContext).getNextStartedActivity(); assertThat(i).isNotNull(); assertThat(i).isSameAs(intent); assertThat(i.getIntExtra("TEST", -1)).isEqualTo(23); }

Target:
public void send_shouldFillInIntentData() throws Exception { Intent intent = new Intent(); Context context = Robolectric.setupActivity(Activity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 99, intent, 100); Activity otherContext = Robolectric.setupActivity(Activity.class); Intent fillIntent = new Intent().putExtra("TEST", 23); pendingIntent.send(otherContext, 0, fillIntent); Intent i = shadowOf(otherContext).getNextStartedActivity(); assertThat(i).isNotNull(); assertThat(i).isSameAs(intent); assertThat(i.getIntExtra("TEST", -1)).isEqualTo(23); }
Source:
private void showDetachedHeadWarning() { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); if (store.getBoolean(UIPreferences.SHOW_DETACHED_HEAD_WARNING)) { String toggleMessage = UIText.BranchResultDialog_DetachedHeadWarningDontShowAgain; MessageDialogWithToggle dialog = new MessageDialogWithToggle( PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(), UIText.BranchOperationUI_DetachedHeadTitle, null, UIText.BranchOperationUI_DetachedHeadMessage, MessageDialog.INFORMATION, new String[] { IDialogConstants.CLOSE_LABEL }, 0, toggleMessage, false); int result = dialog.open(); if (result == IDialogConstants.CLOSE_ID && dialog.getToggleState()) { store.setValue(UIPreferences.SHOW_DETACHED_HEAD_WARNING, false); } } } }); }

Target:
private void showDetachedHeadWarning() { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); if (store.getBoolean(UIPreferences.SHOW_DETACHED_HEAD_WARNING)) { String toggleMessage = UIText.BranchResultDialog_DetachedHeadWarningDontShowAgain; MessageDialogWithToggle dialog = new MessageDialogWithToggle( PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(), UIText.BranchOperationUI_DetachedHeadTitle, null, UIText.BranchOperationUI_DetachedHeadMessage, MessageDialog.INFORMATION, new String[] { IDialogConstants.CLOSE_LABEL }, 0, toggleMessage, false); dialog.open(); if (dialog.getToggleState()) { store.setValue(UIPreferences.SHOW_DETACHED_HEAD_WARNING, false); } } } }); }
Source:
public void testVersionNumber() { Pattern versionPattern = Pattern.compile("^(([1]\\.([1][4-9]|[2-9]\\d))|([2-9]\\.\\d{1,2}))\\."); assertTrue(versionPattern.matcher(BigtableHBaseVersion.CLIENT_VERSION).find()); }

Target:
public void testVersionNumber() { Pattern versionPattern = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+)(-\\w+)?"); Matcher versionMatcher = versionPattern.matcher(BigtableHBaseVersion.getVersion()); assertTrue("incorrect version format", versionMatcher.matches()); int result = ComparisonChain.start() .compare(1, Integer.parseInt(versionMatcher.group(1))) .compare(14, Integer.parseInt(versionMatcher.group(2))) .compare(1, Integer.parseInt(versionMatcher.group(3))) .result(); assertTrue("Expected BigtableHBaseVersion.getVersion() to be at least 1.14.1", result <= 0); }
Source:
public Iterator<TokenCacheItem> getAll() { @SuppressWarnings("unchecked") Map<String, String> results = (Map<String, String>)mPrefs.getAll(); ArrayList<TokenCacheItem> tokens = new ArrayList<>(results.values().size()); Iterator<Entry<String, String>> tokenResultEntrySet = results.entrySet().iterator(); while (tokenResultEntrySet.hasNext()) { final Entry<String, String> tokenEntry = tokenResultEntrySet.next(); final String tokenKey = tokenEntry.getKey(); final String tokenValue = tokenEntry.getValue(); final String decryptedValue = decrypt(tokenKey, tokenValue); if (decryptedValue != null) { final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class); tokens.add(tokenCacheItem); } } return tokens.iterator(); }

Target:
public Iterator<TokenCacheItem> getAll() { @SuppressWarnings("unchecked") Map<String, String> results = (Map<String, String>)mPrefs.getAll(); final List<TokenCacheItem> tokens = new ArrayList<>(results.values().size()); Iterator<Entry<String, String>> tokenResultEntrySet = results.entrySet().iterator(); while (tokenResultEntrySet.hasNext()) { final Entry<String, String> tokenEntry = tokenResultEntrySet.next(); final String tokenKey = tokenEntry.getKey(); final String tokenValue = tokenEntry.getValue(); final String decryptedValue = decrypt(tokenKey, tokenValue); if (decryptedValue != null) { final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class); tokens.add(tokenCacheItem); } } return tokens.iterator(); }
Source:
public void killTask(ExecutorDriver driver, TaskID taskId) { LOGGER.info("Killing task : " + taskId.getValue()); if (task.process != null) { LOGGER.info("Found task to kill: " + taskId.getValue()); int pid = getPid(); if (pid == -1) { LOGGER.debug("Graceful shutdown failed. Could not read crate.pid."); } try { LOGGER.info("PID to kill: " + pid); Runtime.getRuntime().exec("kill -USR2 " + pid); } catch (IOException e) { LOGGER.debug("Graceful shutdown failed. Could not read crate.pid.", e); } task.process.destroy(); task.process = null; driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(taskId) .setState(TaskState.TASK_KILLED) .build()); driver.stop(); } else { LOGGER.debug("No running task found :("); } }

Target:
public void killTask(ExecutorDriver driver, TaskID taskId) { LOGGER.info("Killing task : " + taskId.getValue()); if (task.process != null) { LOGGER.info("Found task to kill: " + taskId.getValue()); int pid = task.pid(); if (pid == -1) { LOGGER.debug("Graceful shutdown failed. Could not read crate.pid."); task.process.destroy(); task.process = null; return; } boolean success = task.gracefulStop(); if (success) { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(taskId) .setState(TaskState.TASK_KILLED) .build()); driver.stop(); } else { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(taskId) .setState(TaskState.TASK_RUNNING) .build()); } } else { LOGGER.debug("No running task found :("); } }
Source:
private List<String> runNodetoolCommandOnAllContainers(String nodetoolCommand, int timeoutSeconds) throws IOException, InterruptedException { List<String> ret = Lists.newArrayList(); for (String containerName : containerNames) { ret.add(runNodetoolCommandOnContainer(nodetoolCommand, timeoutSeconds, containerName)); } return ret; }

Target:
private void runNodetoolCommandOnAllContainers(String nodetoolCommand, int timeoutSeconds) throws IOException, InterruptedException { for (String containerName : containerNames) { runNodetoolCommandOnContainer(nodetoolCommand, timeoutSeconds, containerName); } }
Source:
private void processStoreByMetricResource(final Path metaPath) { final Path path = metaPath.getParent(); final String metric = FilenameUtils.removeExtension(metaPath.getFileName().toString()); final Properties meta = new Properties(); try (final BufferedReader r = Files.newBufferedReader(path.resolve(String.format("%s.meta", metric)))) { meta.load(r); } catch (final IOException e) { throw Throwables.propagate(e); } final String group = meta.getProperty("GROUP"); if (group == null) { throw NewtsConverterError.create("No group information found - please verify storeByGroup settings"); } this.executor.execute(() -> this.processResource(path, metric, group)); }

Target:
private void processStoreByMetricResource(final Path metaPath) { final Path path = metaPath.getParent(); final String metric = FilenameUtils.removeExtension(metaPath.getFileName().toString()); final Properties meta = new Properties(); try (final BufferedReader r = Files.newBufferedReader(metaPath)) { meta.load(r); } catch (final IOException e) { LOG.error("Failed to read .meta file: {}", metaPath, e); return; } final String group = meta.getProperty("GROUP"); if (group == null) { LOG.warn("No group information found - please verify storageStrategy settings"); return; } this.executor.execute(() -> this.processResource(path, metric, group)); }
Source:
public static boolean isTargetQueueBoundByMatchingToRoutingKey(String queueBoundRoutingKey, String messageRoutingKey) { return SubscriptionsStoreUtil.matchTopics(messageRoutingKey, queueBoundRoutingKey); }

Target:
public static boolean isTargetQueueBoundByMatchingToRoutingKey(String queueBoundRoutingKey, String messageRoutingKey) { return matchTopics(messageRoutingKey, queueBoundRoutingKey); }
Source:
public SpongeTagsData() { this(Collections.<String>emptySet()); }

Target:
public SpongeTagsData() { this(new HashSet<>()); }
Source:
private BigInteger solve(final String formula) { ArrayDeque<BigInteger> stack = new ArrayDeque<BigInteger>(); for (int i = 0; i < formula.length(); ++i) { if ((formula.charAt(i) <= '9') && (formula.charAt(i) >= '0')) { BigInteger tmp = new BigInteger(Integer.valueOf( formula.charAt(i) - '0').toString()); for (int j = i + 1; j < formula.length(); ++j) if ((formula.charAt(j) <= '9') && (formula.charAt(j) >= '0')) { tmp = tmp.multiply( new BigInteger(Integer.valueOf(10).toString())) .add(new BigInteger(Integer.valueOf(formula .charAt(j) - '0').toString())); ++i; } else break; stack.push(tmp); continue; } else if (formula.charAt(i) == ' ') continue; try { switch (formula.charAt(i)) { case '/': BigInteger a = stack.pop(); try { stack.push(stack.pop().divide(a)); } catch (Exception e3) { System.out .print("Division by zero or another error with division!\n"); System.exit(1); } break; case '*': stack.push(stack.pop().multiply(stack.pop())); break; case '-': BigInteger b = stack.pop(); stack.push(stack.pop().subtract(b)); break; case '+': stack.push(stack.pop().add(stack.pop())); break; } } catch (Exception e3) { System.out.print("Error with operations."); System.exit(1); } } return stack.pop(); }

Target:
private BigInteger solve(final String formula) { ArrayDeque<BigInteger> stack = new ArrayDeque<BigInteger>(); int begin = 0; boolean first = true; for (int i = 0; i < formula.length(); ++i) { if (Character.isDigit(formula.charAt(i))) { if (first) { begin = i; first = false; } else if (!Character.isDigit(formula.charAt(i + 1))) { stack.push(new BigInteger(formula.substring(begin, i + 1))); first = true; } } else if (formula.charAt(i) == ' ') { continue; } else { try { switch (formula.charAt(i)) { case '/': BigInteger a = stack.pop(); try { stack.push(stack.pop().divide(a)); } catch (Exception e3) { System.out .print("Division by zero or another error with division!\n"); System.exit(1); } break; case '*': stack.push(stack.pop().multiply(stack.pop())); break; case '-': BigInteger b = stack.pop(); stack.push(stack.pop().subtract(b)); break; case '+': stack.push(stack.pop().add(stack.pop())); break; } } catch (Exception e3) { System.out.print("Error with operations."); System.exit(1); } } } return stack.pop(); }
Source:
public void onClick(final View v) { if (cacheCoords == null) { final AbstractActivity activity = (AbstractActivity) getActivity(); activity.showToast(activity.getString(R.string.err_location_unknown)); return; } CalcState theState = ((CalculateState) getActivity()).fetchCalculatoState(); final CoordinatesCalculateDialog calculateDialog = CoordinatesCalculateDialog.getInstance(gp, theState); calculateDialog.setTargetFragment(CoordinatesInputDialog.this, 1); calculateDialog.setCancelable(true); calculateDialog.show(myContext.getSupportFragmentManager(), "wpcalcdialog"); }

Target:
public void onClick(final View v) { if (cacheCoords == null) { final AbstractActivity activity = (AbstractActivity) getActivity(); activity.showToast(activity.getString(R.string.err_location_unknown)); return; } final CalcState newState = ((CalculateState) getActivity()).fetchCalculatorState(); final CoordinatesCalculateDialog calculateDialog = CoordinatesCalculateDialog.getInstance(gp, newState); calculateDialog.setTargetFragment(CoordinatesInputDialog.this, 1); calculateDialog.setCancelable(true); calculateDialog.show(myContext.getSupportFragmentManager(), "wpcalcdialog"); }
Source:
public void beginTree(DetailAST rootAST) { final Map<Integer, TextBlock> cppComments = getFileContents() .getSingleLineComments(); final Map<Integer, List<TextBlock>> cComments = getFileContents() .getBlockComments(); final Set<Integer> lines = new HashSet<>(); lines.addAll(cppComments.keySet()); lines.addAll(cComments.keySet()); for (Integer lineNo : lines) { final String line = getLines()[lineNo - 1]; final String lineBefore; final TextBlock comment; if (cppComments.containsKey(lineNo)) { comment = cppComments.get(lineNo); lineBefore = line.substring(0, comment.getStartColNo()); } else { final List<TextBlock> commentList = cComments.get(lineNo); comment = commentList.get(commentList.size() - 1); lineBefore = line.substring(0, comment.getStartColNo()); if (comment.getText().length == 1 && !CommonUtils.isOnlyWhitespacesOrEmpty(line .substring(comment.getEndColNo() + 1))) { continue; } } if (!format.matcher(lineBefore).find() && !isLegalComment(comment)) { log(lineNo, MSG_KEY); } } }

Target:
public void beginTree(DetailAST rootAST) { final Map<Integer, TextBlock> cppComments = getFileContents() .getSingleLineComments(); final Map<Integer, List<TextBlock>> cComments = getFileContents() .getBlockComments(); final Set<Integer> lines = new HashSet<>(); lines.addAll(cppComments.keySet()); lines.addAll(cComments.keySet()); for (Integer lineNo : lines) { final String line = getLines()[lineNo - 1]; final String lineBefore; final TextBlock comment; if (cppComments.containsKey(lineNo)) { comment = cppComments.get(lineNo); lineBefore = line.substring(0, comment.getStartColNo()); } else { final List<TextBlock> commentList = cComments.get(lineNo); comment = commentList.get(commentList.size() - 1); lineBefore = line.substring(0, comment.getStartColNo()); if (comment.getText().length == 1 && !CommonUtils.isBlank(line .substring(comment.getEndColNo() + 1))) { continue; } } if (!format.matcher(lineBefore).find() && !isLegalComment(comment)) { log(lineNo, MSG_KEY); } } }
Source:
public Module getModule(Configuration configuration) { return new AbstractModule() { @Override protected void configure() { bind(Configuration.class).toInstance(configuration); bindConfigurationKeys(); } private void bindConfigurationKeys() { configuration.listKeys().forEach(key -> configuration.get(key).ifPresent(value -> { bind(getBindingKey(value, key)).toInstance(value); })); } private Key getBindingKey(Object configValue, String configKey) { if (configValue instanceof List) { return Key.get(new TypeLiteral<List<String>>() {}, named(configKey)); } return Key.get(configValue.getClass(), named(configKey)); } }; }

Target:
public Module getModule(Configuration configuration) { return new AbstractModule() { @Override protected void configure() { bind(Configuration.class).toInstance(configuration); bindConfigurationKeys(); } private void bindConfigurationKeys() { configuration.listKeys().forEach(key -> configuration.get(key).ifPresent(value -> bind(getBindingKey(value, key)).toInstance(value))); } private Key getBindingKey(Object configValue, String configKey) { if (configValue instanceof List) { return Key.get(new TypeLiteral<List<String>>() {}, named(configKey)); } return Key.get(configValue.getClass(), named(configKey)); } }; }
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaPlayer); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); controller = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); controller.addObserver(this); player.addObserver(this); OoyalaFreewheelManager fwManager = new OoyalaFreewheelManager(this, skinLayout, player); Map<String, String> freewheelParameters = new HashMap<String, String>(); freewheelParameters.put("fw_android_mrm_network_id", "380912"); freewheelParameters.put("fw_android_ad_server", "<LINK_0>"); freewheelParameters.put("fw_android_player_profile", "90750:ooyala_android"); freewheelParameters.put("FRMSegment", "channel=TEST;subchannel=TEST;section=TEST;mode=online;player=ooyala;beta=n"); freewheelParameters.put("fw_android_site_section_id", "ooyala_android_internalapp"); freewheelParameters.put("fw_android_video_asset_id", "NqcGg4bzoOmMiV35ZttQDtBX1oNQBnT-"); fwManager.overrideFreewheelParameters(freewheelParameters); if (player.setEmbedCode(embedCode)) { } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaPlayer); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); OoyalaFreewheelManager fwManager = new OoyalaFreewheelManager(this, skinLayout, player); Map<String, String> freewheelParameters = new HashMap<String, String>(); freewheelParameters.put("fw_android_mrm_network_id", "380912"); freewheelParameters.put("fw_android_ad_server", "<LINK_0>"); freewheelParameters.put("fw_android_player_profile", "90750:ooyala_android"); freewheelParameters.put("FRMSegment", "channel=TEST;subchannel=TEST;section=TEST;mode=online;player=ooyala;beta=n"); freewheelParameters.put("fw_android_site_section_id", "ooyala_android_internalapp"); freewheelParameters.put("fw_android_video_asset_id", "NqcGg4bzoOmMiV35ZttQDtBX1oNQBnT-"); fwManager.overrideFreewheelParameters(freewheelParameters); if (player.setEmbedCode(embedCode)) { } } }
Source:
public AbstractBucketLifecycleManager(String bucket, @Nullable UploadModule module) { super(bucket, false , false , false , null , module); }

Target:
public AbstractBucketLifecycleManager(String bucket, @Nullable UploadModule module) { super(bucket, false , false , null , module); }
Source:
Date parseDateTimeString(String dateString, boolean isUTC, String... patterns) { for (String pattern : patterns) { SimpleDateFormat utcFormatter = new SimpleDateFormat(pattern); if (isUTC) { utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); } try { return utcFormatter.parse(dateString); } catch (ParseException e) { log.debug("Unable to parse " + dateString + " using pattern " + pattern, e); } } throw new IllegalArgumentException(String.format("Date String %s not in valid UTC/local format using any of the following patterns %s", dateString, Arrays.toString(patterns))); }

Target:
protected Date parseDateTimeString(String dateString, boolean isUTC, String... patterns) { for (String pattern : patterns) { SimpleDateFormat utcFormatter = new SimpleDateFormat(pattern); if (isUTC) { utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); } try { return utcFormatter.parse(dateString); } catch (ParseException e) { log.debug("Unable to parse " + dateString + " using pattern " + pattern, e); } } throw new IllegalArgumentException(String.format("Date String %s not in valid UTC/local format using any of the following patterns %s", dateString, Arrays.toString(patterns))); }
Source:
public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (sqlObjectType != null ? sqlObjectType.hashCode() : 0); result = 31 * result + (sqlObjectMethod != null ? sqlObjectMethod.hashCode() : 0); return result; }

Target:
public int hashCode() { int result = name == null ? 0 : name.hashCode(); result = 31 * result + (sqlObjectType != null ? sqlObjectType.hashCode() : 0); result = 31 * result + (sqlObjectMethod != null ? sqlObjectMethod.hashCode() : 0); return result; }
Source:
private void checkContentUids(DDiagram origin, DDiagram copy) { List<IdentifiedElement> copied = Lists.newArrayList(Iterators.filter(originalDiagram.eAllContents(), IdentifiedElement.class)); List<IdentifiedElement> copies = Lists.newArrayList(Iterators.filter(copy.eAllContents(), IdentifiedElement.class)); assertEquals(copied.size(), copies.size()); EqualityHelper helper = new EqualityHelper() { @Override protected boolean haveEqualAttribute(EObject eObject1, EObject eObject2, EAttribute attribute) { boolean ignored = attribute.isID() || ViewpointPackage.Literals.DREPRESENTATION__NAME.equals(attribute); return ignored || super.haveEqualAttribute(eObject1, eObject2, attribute); } }; assertTrue(helper.equals(originalDiagram, copy)); for (int i = 0; i < copied.size(); i++) { IdentifiedElement copiedElt = copied.get(i); IdentifiedElement copyElt = copies.get(i); boolean equality = helper.equals(copiedElt, copyElt); boolean nullUIds = StringUtil.isEmpty(copiedElt.getUid()) || StringUtil.isEmpty(copyElt.getUid()); boolean duplicatedUids = copiedElt.getUid().equals(copyElt.getUid()); assertTrue(equality && !nullUIds && !duplicatedUids); } }

Target:
private void checkContentUids(DDiagram origin, DDiagram copy) { List<IdentifiedElement> copied = collectAllIdentifiedElements(originalDiagram); List<IdentifiedElement> copies = collectAllIdentifiedElements(copy); assertEquals("Copied and copies lists must have the same size.", copied.size(), copies.size()); EqualityHelper helper = new EqualityHelper() { @Override protected boolean haveEqualAttribute(EObject eObject1, EObject eObject2, EAttribute attribute) { boolean ignored = attribute.isID() || ViewpointPackage.Literals.DREPRESENTATION__NAME.equals(attribute); return ignored || super.haveEqualAttribute(eObject1, eObject2, attribute); } }; assertTrue(helper.equals(originalDiagram, copy)); for (int i = 0; i < copied.size(); i++) { IdentifiedElement copiedElt = copied.get(i); IdentifiedElement copyElt = copies.get(i); boolean equality = helper.equals(copiedElt, copyElt); boolean nullUIds = StringUtil.isEmpty(copiedElt.getUid()) || StringUtil.isEmpty(copyElt.getUid()); boolean duplicatedUids = copiedElt.getUid().equals(copyElt.getUid()); assertTrue(equality && !nullUIds && !duplicatedUids); } }
Source:
public Builder sortByField(String field, Order order) { sorts.add(new SortByField(field, order)); return this; }

Target:
public Builder sortByField(String field, Order order) { sorts.add(field(field, order)); return this; }
Source:
private static Boolean isMatch(Boolean exactMatch, String query, String string) { if (string != null) { if (exactMatch) { if (string.toLowerCase().equals(query)) { return true; } } else { if (string.toLowerCase().contains(query)) { return true; } } } return false; }

Target:
private static Boolean isMatch(Boolean exactMatch, String query, String string) { if (string != null) { if (exactMatch) { if (StringUtils.containsIgnoreCase(string, query)) { return true; } } else { if (StringUtils.containsIgnoreCase(string, query)) { return true; } } } return false; }
Source:
public int hashCode() { return (shouldAudit ? 1 : 0); }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (shouldAudit ? 1 : 0); return result; }
Source:
private String normalize(String number) { if (number.length() > 11 || number.length() < 10) { throw new IllegalArgumentException("Number must be 10 or 11 digits"); } if (number.length() == 11) { if (number.startsWith("1")) { number = number.substring(1, number.length()); } else { throw new IllegalArgumentException("Can only have 11 digits if number starts with '1'"); } } if (number.startsWith("0") || number.startsWith("1")){ throw new IllegalArgumentException("Illegal character in phone number. " + "Only digits, spaces, parentheses, hyphens or dots accepted."); } else if (number.charAt(3) == '0' || number.charAt(3) == '1'){ throw new IllegalArgumentException("Illegal character in phone number. " + "Only digits, spaces, parentheses, hyphens or dots accepted."); } return number; }

Target:
private String normalize(String number) { if (number.length() > 11 || number.length() < 10) { throw new IllegalArgumentException("Number must be 10 or 11 digits"); } if (number.length() == 11) { if (number.startsWith("1")) { number = number.substring(1, number.length()); } else { throw new IllegalArgumentException("Can only have 11 digits if number starts with '1'"); } } if (number.startsWith("0") || number.startsWith("1")){ throw new IllegalArgumentException("Illegal Area Or Exchange Code. " + "Only 2-9 are valid digits"); } else if (number.charAt(3) == '0' || number.charAt(3) == '1'){ throw new IllegalArgumentException("Illegal Area Or Exchange Code. " + "Only 2-9 are valid digits"); } return number; }
Source:
public void testOvfDataUpdaterAllVmsAndTemplatesAreLocked() { int size = ITEMS_COUNT_PER_UPDATE - 1; List<Guid> vmGuids = generateGuidList(size); addVms(vmGuids, 2, VMStatus.ImageLocked, ImageStatus.OK); List<Guid> removedGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); addTemplates(templatesGuids, 2, VmTemplateStatus.Locked, ImageStatus.OK); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); updater.ovfUpdate_timer(); verify(updater, never()).performOvfUpdate(any(Guid.class), any(Map.class)); verify(updater, times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); verifyCorrectOvfDataUpdaterRun(pool1.getId(), Collections.<Guid> emptyList(), removedGuids); }

Target:
public void testOvfDataUpdaterAllVmsAndTemplatesAreLocked() { int size = ITEMS_COUNT_PER_UPDATE - 1; List<Guid> vmGuids = generateGuidList(size); addVms(vmGuids, 2, VMStatus.ImageLocked, ImageStatus.OK); List<Guid> removedGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); addTemplates(templatesGuids, 2, VmTemplateStatus.Locked, ImageStatus.OK); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); updater.ovfUpdate_timer(); verify(updater, never()).performOvfUpdate(any(Guid.class), anyMap()); verify(updater, times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); verifyCorrectOvfDataUpdaterRun(pool1.getId(), Collections.<Guid> emptyList(), removedGuids); }
Source:
public void init(IWorkbench workbench, IStructuredSelection selection) { fSelectDirectories = new ImportTraceWizardPageSelectDirectories(workbench, selection); fScanPage = new ImportTraceWizardPageScan(workbench, selection); fSelectPage = new ImportTraceWizardPageSelectTraceType(workbench, selection); fImportOptions = new ImportTraceWizardPageOptions(workbench, selection); setNeedsProgressMonitor(true); }

Target:
public void init(IWorkbench workbench, IStructuredSelection selection) { fSelectDirectories = new ImportTraceWizardPageSelectDirectories(workbench, selection); fScanPage = new ImportTraceWizardPageScan(workbench, selection); fSelectPage = new ImportTraceWizardPageSelectTraceType(workbench, selection); fResults.clear(); setNeedsProgressMonitor(true); }
Source:
protected EClass checkForCommonSuperClass(IEObjectDescription one, IEObjectDescription two, ValidationMessageAcceptor acceptor) { Node<EClass> superClassesOne = getSuperClassTree(one.getEClass()); Node<EClass> superClassesTwo = getSuperClassTree(two.getEClass()); List<EClass> flatOne = superClassesOne.flatten(); List<EClass> flatTwo = superClassesTwo.flatten(); for(EClass eC : flatOne) { if(flatTwo.contains(eC)) return eC; } return null; }

Target:
protected EClass checkForCommonSuperClass(IEObjectDescription one, IEObjectDescription two, ValidationMessageAcceptor acceptor) { List<EClass> flatOne = buildSuperClassList(one.getEClass()); List<EClass> flatTwo = buildSuperClassList(two.getEClass()); for(EClass eC : flatOne) { if(flatTwo.contains(eC)) return eC; } return null; }
Source:
public Emitter getEmitter( DropwizardEmitterConfig dropwizardEmitterConfig, ObjectMapper mapper, final Injector injector ) { List<Emitter> alertEmitters = Lists.transform( dropwizardEmitterConfig.getAlertEmitters(), s -> injector.getInstance(Key.get(Emitter.class, Names.named(s))) ); return new DropwizardEmitter(dropwizardEmitterConfig, mapper, alertEmitters); }

Target:
public Emitter getEmitter( DropwizardEmitterConfig dropwizardEmitterConfig, ObjectMapper mapper, final Injector injector ) { List<Emitter> alertEmitters = dropwizardEmitterConfig.getAlertEmitters() .stream() .map(s -> injector.getInstance( Key.get( Emitter.class, Names.named(s) ))) .collect(Collectors.toList()); return new DropwizardEmitter(dropwizardEmitterConfig, mapper, alertEmitters); }
Source:
public Response workflowsExternalWorkflowRefGet(String externalWorkflowRef, String ifNoneMatch) { WorkflowInfoDTO workflowinfoDTO; try { Workflow workflow; String status="CREATED"; String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); APIAdmin apiAdmin = new APIAdminImpl(); workflow=apiAdmin.getworkflowReferenceByExternalWorkflowReferenceID(externalWorkflowRef, status ,tenantDomain); try { workflowinfoDTO = WorkflowMappingUtil.fromWorkflowsToInfoDTO(workflow); return Response.ok().entity(workflowinfoDTO).build(); } catch(NullPointerException e){ RestApiUtil.handleInternalServerError("Error while retrieving workflow request by the external workflow reference" , e,log); } } catch(APIManagementException e){ RestApiUtil.handleInternalServerError("Error while retrieving workflow request by the external workflow reference" , e, log); } return null; }

Target:
public Response workflowsExternalWorkflowRefGet(String externalWorkflowRef, String ifNoneMatch) { WorkflowInfoDTO workflowinfoDTO; try { Workflow workflow; String status = "CREATED"; String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); APIAdmin apiAdmin = new APIAdminImpl(); workflow = apiAdmin.getworkflowReferenceByExternalWorkflowReferenceID(externalWorkflowRef, status, tenantDomain); workflowinfoDTO = WorkflowMappingUtil.fromWorkflowsToInfoDTO(workflow); return Response.ok().entity(workflowinfoDTO).build(); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while retrieving workflow request by the " + "external workflow reference. ", e, log); } return null; }
Source:
protected void activate(ComponentContext cContext, Map<String, Object> properties) { dbFolderName = ConfigConstants.getUserDataFolder() + File.separator + dbFolderName; File folder = new File(dbFolderName); if (!folder.exists()) { folder.mkdirs(); } File backup = new File(dbFolderName, "backup"); if (!backup.exists()) { backup.mkdirs(); } logger.debug("Json Storage Service: Activated."); if (properties == null || properties.isEmpty()) { return; } try { if (properties.get(CFG_MAX_BACKUP_FILES) != null) { maxBackupFiles = Integer.parseInt((String) properties.get(CFG_MAX_BACKUP_FILES)); } if (properties.get(CFG_WRITE_DELAY) != null) { writeDelay = Integer.parseInt((String) properties.get(CFG_WRITE_DELAY)); } if (properties.get(CFG_MAX_DEFER_DELAY) != null) { maxDeferredPeriod = Integer.parseInt((String) properties.get(CFG_MAX_DEFER_DELAY)); } } catch (NumberFormatException nfe) { logger.error("NumberFormatException: {}", nfe.getMessage()); } }

Target:
protected void activate(ComponentContext cContext, Map<String, Object> properties) { dbFolderName = ConfigConstants.getUserDataFolder() + File.separator + dbFolderName; File folder = new File(dbFolderName); if (!folder.exists()) { folder.mkdirs(); } File backup = new File(dbFolderName, "backup"); if (!backup.exists()) { backup.mkdirs(); } logger.debug("Json Storage Service: Activated."); if (properties == null || properties.isEmpty()) { return; } try { if (properties.get(CFG_MAX_BACKUP_FILES) != null) { maxBackupFiles = Integer.parseInt((String) properties.get(CFG_MAX_BACKUP_FILES)); } } catch (NumberFormatException nfe) { logger.error("Value for is invalid. Using {}.", properties.get(CFG_MAX_BACKUP_FILES), CFG_MAX_BACKUP_FILES, maxBackupFiles); } try { if (properties.get(CFG_WRITE_DELAY) != null) { writeDelay = Integer.parseInt((String) properties.get(CFG_WRITE_DELAY)); } } catch (NumberFormatException nfe) { logger.error("Value for is invalid. Using {}.", properties.get(CFG_WRITE_DELAY), CFG_WRITE_DELAY, writeDelay); } try { if (properties.get(CFG_MAX_DEFER_DELAY) != null) { maxDeferredPeriod = Integer.parseInt((String) properties.get(CFG_MAX_DEFER_DELAY)); } } catch (NumberFormatException nfe) { logger.error("Value for is invalid. Using {}.", properties.get(CFG_MAX_DEFER_DELAY), CFG_MAX_DEFER_DELAY, maxDeferredPeriod); } }
Source:
private void updateActionAvailability() { getEditParameterCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); getResetParameterCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); getResetAllParameterCommand().setIsExecutionAllowed(getItems() != null && ((List) getItems()).size() > 0); }

Target:
private void updateActionAvailability() { getEditParameterCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); getResetParameterCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); getResetAllParameterCommand().setIsExecutionAllowed(getItems() != null && ((List<GlusterVolumeOptionEntity>) getItems()).size() > 0); }
Source:
public boolean isMultisimSupported(String callingPackage) { if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultPhone().getSubId(), callingPackage, "isMultisimSupported")) { return false; } final long identity = Binder.clearCallingIdentity(); try { return isMultisimSupported(); } finally { Binder.restoreCallingIdentity(identity); } }

Target:
public boolean isMultisimSupported(String callingPackage) { if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultPhone().getSubId(), callingPackage, "isMultisimSupported")) { return false; } final long identity = Binder.clearCallingIdentity(); try { return isMultisimSupportedInternal(); } finally { Binder.restoreCallingIdentity(identity); } }