auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Set<String> convertToTagSet(Object tagObject) { if (tagObject instanceof String) { LOGGER.trace("Found single tag {}", tagObject); return Collections.singleton((String) tagObject); } if (tagObject instanceof Set) { LOGGER.trace("Found set of tags {}", tagObject); Set<?> tagSet = (Set) tagObject; if (tagSet.size() != tagSet.stream().filter(String.class::isInstance).collect(Collectors.toSet()).size()) { LOGGER.trace("At least one of the objects in the set is not a string"); return Collections.emptySet(); } return tagSet.stream().map(String.class::cast).collect(Collectors.toSet()); } LOGGER.trace("Unrecognized tag object {}", tagObject); return Collections.emptySet(); }

Target:
private Set<String> convertToTagSet(Object tagObject) { if (tagObject instanceof String) { LOGGER.trace("Found single tag {}", tagObject); return Collections.singleton((String) tagObject); } if (tagObject instanceof Set) { LOGGER.trace("Found set of tags {}", tagObject); Set<?> tagSet = (Set) tagObject; if (tagSet.size() != tagSet.stream().filter(String.class::isInstance).count()) { LOGGER.trace("At least one of the objects in the set is not a string"); return Collections.emptySet(); } return tagSet.stream().map(String.class::cast).collect(Collectors.toSet()); } LOGGER.trace("Unrecognized tag object {}", tagObject); return Collections.emptySet(); }
Source:
public <S extends Message, T extends Message> void dispatch(SinkModule<S, T> module, String topic, T message) { try (MDCCloseable mdc = Logging.withPrefixCloseable(MessageConsumerManager.LOG_PREFIX)) { LOG.trace("dispatch({}): sending message {}", topic, message); final String queueName = getModuleMetadata(module); final String queueUrl = getQueueUrl(queueName); if (queueUrl == null) { LOG.warn("Cannot obtain URL for queue {}. The message cannot be sent.", queueName); } else { sqs.sendMessage(queueUrl, module.marshal((T)message)); } } }

Target:
public <S extends Message, T extends Message> void dispatch(SinkModule<S, T> module, String topic, T message) { try (MDCCloseable mdc = Logging.withPrefixCloseable(MessageConsumerManager.LOG_PREFIX)) { LOG.trace("dispatch({}): sending message {}", topic, message); final String queueName = awsSqsManager.getQueueName(awsConfig, module); final String queueUrl = getQueueUrl(queueName); if (queueUrl == null) { LOG.error("Cannot obtain URL for queue {}. The message cannot be sent.", queueName); } else { try { final String messageId = awsSqsManager.sendMessage(awsConfig, sqs, queueUrl, module.marshal((T)message)); LOG.debug("SQS Message with ID has been successfully sent to {}", messageId, queueUrl); } catch (RuntimeException ex) { LOG.error("Unexpected AWS SDK exception while sending a message", ex); } } } }
Source:
private void onOpenCategory(String categoryId) { categoryWidgets.entrySet().stream().filter(entry -> !entry.getKey().equals(categoryId)).forEach(entry -> entry.getValue().setVisible(false)); DefinitionPaletteCategoryWidget widget = categoryWidgets.get(categoryId); widget.setVisible(true); }

Target:
private void onOpenCategory(String categoryId) { categoryWidgets.entrySet() .stream() .filter(entry -> !Objects.equals(entry.getKey(), categoryId)) .forEach(entry -> entry.getValue().setVisible(false)); DefinitionPaletteCategoryWidget widget = categoryWidgets.get(categoryId); widget.setVisible(true); }
Source:
private void waitUntilCheck(Predicate<JsonRpcClient> check, String formatBefore, String formatAfter) throws InterruptedException { String hostname = client.getHostname(); if (logger.isDebugEnabled()) { logger.debug(formatBefore, hostname); } int retries = 50; while (check.test(this.client)) { if (retries == 0) { throw new VDSNetworkException("Unable to reconnect to " + hostname + " after policy reset"); } retries--; TimeUnit.MILLISECONDS.sleep(200); } if (logger.isDebugEnabled()) { logger.debug(formatAfter, hostname); } }

Target:
private void waitUntilCheck(Predicate<JsonRpcClient> check, String formatBefore, String formatAfter) throws InterruptedException { String hostname = client.getHostname(); logger.debug(formatBefore, hostname); int retries = 50; while (check.test(this.client)) { if (retries == 0) { throw new VDSNetworkException("Unable to reconnect to " + hostname + " after policy reset"); } retries--; TimeUnit.MILLISECONDS.sleep(200); } logger.debug(formatAfter, hostname); }
Source:
public EntitlerJobConfig setConsumer(final Consumer consumer) { if (consumer == null) { throw new IllegalArgumentException("Consumer is null"); } final String uuid = consumer.getUuid(); this.addConstraint(new ThrottlingConstraint(this.throttle, new AggregateJobMatcher( new MatchByJobKey(JOB_KEY), new MatchByArgument(CONSUMER_UUID_KEY, uuid) ))) .setJobArgument(CONSUMER_UUID_KEY, uuid); return this; }

Target:
public EntitlerJobConfig setConsumer(final Consumer consumer) { if (consumer == null) { throw new IllegalArgumentException("Consumer is null"); } this.setJobArgument(CONSUMER_UUID_KEY, consumer.getUuid()); return this; }
Source:
public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof HashMap) { final Iterator<?> thisIt = this.iterator(); final Iterator<?> thatIt = ((HashMap<?,?>) o).iterator(); while (thisIt.hasNext() && thatIt.hasNext()) { if (!Objects.equals(thisIt.next(), thatIt.next())) { return false; } } return thisIt.hasNext() == thatIt.hasNext(); } else { return false; } }

Target:
public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof HashMap) { final HashMap<?,?> that = (HashMap<?,?>) o; return this.iterator().equals(that.iterator()); } else { return false; } }
Source:
public DaysOfMonthSelector() { initWidget(wrapperPanel); style = RESOURCES.daysOfMonthSelectorCSS(); style.ensureInjected(); daysOfMonth.setStyleName("daysOfMonthWidget"); showDaysOfMonth(); daysOfMonth.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Cell cellClicked = daysOfMonth.getCellForEvent(event); int cellColumn = cellClicked.getCellIndex(); int cellRow = cellClicked.getRowIndex(); int actualCellIndex = cellRow * DAYS_IN_WEEK + cellColumn + 1; if (!clickedList.get(actualCellIndex)) { clickedList.set(actualCellIndex, true); onSelectedItemsChange(actualCellIndex, true); } else { clickedList.set(actualCellIndex, false); onSelectedItemsChange(actualCellIndex, false); } } }); }

Target:
public DaysOfMonthSelector() { initWidget(wrapperPanel); style = RESOURCES.daysOfMonthSelectorCSS(); style.ensureInjected(); daysOfMonth.setStyleName(style.daysOfMonthWidget()); showDaysOfMonth(); daysOfMonth.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Cell cellClicked = daysOfMonth.getCellForEvent(event); int cellColumn = cellClicked.getCellIndex(); int cellRow = cellClicked.getRowIndex(); int actualCellIndex = (cellRow - 1) * DAYS_IN_WEEK + cellColumn; if (!clickedList.get(actualCellIndex)) { ValueChangeEvent.fire(DaysOfMonthSelector.this, addSelectedDate(getValue(), getDateFromIndex(actualCellIndex))); } else { ValueChangeEvent.fire(DaysOfMonthSelector.this, removeSelectedDate(getValue(), getDateFromIndex(actualCellIndex))); } } }); }
Source:
private void commitFile(TopicPartition topicPart) throws IOException, InterruptedException { long startOffset = offsets.get(topicPart) + 1; long endOffset = startOffset + recordCounters.get(topicPart) - 1; offsets.put(topicPart, endOffset); String tempFileName = tempFileNames.get(topicPart); String finalFileName = FileUtils.committedFileName(url, topicsDir, topicPart, startOffset, endOffset); WAL wal = wals.get(topicPart); wal.append(tempFileName, finalFileName); FileUtils.renameFile(fs, tempFileName, finalFileName); }

Target:
private void commitFile(TopicPartition topicPart) throws IOException { long startOffset = offsets.get(topicPart) + 1; long endOffset = startOffset + recordCounters.get(topicPart) - 1; String tempFileName = tempFileNames.get(topicPart); String finalFileName = FileUtils.committedFileName(url, topicsDir, topicPart, startOffset, endOffset); storage.commit(tempFileName, finalFileName); offsets.put(topicPart, endOffset); }
Source:
public void deleteUpload(Contribution contribution) { compositeDisposable.add(repository.deleteContributionFromDB(contribution) .observeOn(mainThreadScheduler) .subscribeOn(ioThreadScheduler) .subscribe()); }

Target:
public void deleteUpload(Contribution contribution) { compositeDisposable.add(repository.deleteContributionFromDB(contribution) .subscribeOn(ioThreadScheduler) .subscribe()); }
Source:
public UsersWorkspaceImpl(String id, String name, String owner, Map<String, String> attributes, List<? extends Command> commands, List<? extends ProjectConfig> projects, Map<String, ? extends Environment> environments, String defaultEnvironment, String description) { this.id = id; this.name = name; this.owner = owner; this.description = description; if (environments != null) { this.environments = environments.values() .stream() .collect(toMap(Environment::getName, EnvironmentImpl::new)); } if (commands != null) { this.commands = commands.stream() .map(CommandImpl::new) .collect(toList()); } if (projects != null) { this.projects = projects.stream() .map(ProjectConfigImpl::new) .collect(toList()); } if (attributes != null) { this.attributes = new HashMap<>(attributes); } setDefaultEnvName(defaultEnvironment); }

Target:
public UsersWorkspaceImpl(String id, String name, String owner, Map<String, String> attributes, List<? extends Command> commands, List<? extends ProjectConfig> projects, Map<String, ? extends Environment> environments, String defaultEnvironment, String description) { this.id = id; this.name = name; this.owner = owner; this.description = description; if (environments != null) { this.environments = environments.values() .stream() .collect(toMap(Environment::getName, EnvironmentStateImpl::new)); } if (commands != null) { this.commands = commands.stream() .map(CommandImpl::new) .collect(toList()); } if (projects != null) { this.projects = projects.stream() .map(ProjectConfigImpl::new) .collect(toList()); } if (attributes != null) { this.attributes = new HashMap<>(attributes); } setDefaultEnvName(defaultEnvironment); }
Source:
public void attemptAddBudget(){ boolean cancel = false; View focusView = null; mBudgetAmountView.setError(null); mBudgetNameView.setError(null); if (mBudgetAmountView.getText().toString().isEmpty()) { mBudgetAmountView.setError(getString(R.string.error_invalid_amount)); focusView = mBudgetAmountView; cancel = true; } if (!cancel&& Double.parseDouble(mBudgetAmountView.getText().toString()) == 0.0) { mBudgetAmountView.setError(getString(R.string.error_zero_amount)); mBudgetAmountView.requestFocus(); focusView = mBudgetAmountView; cancel = true; } if (mBudgetNameView.getText().toString().isEmpty()) { mBudgetNameView.setError(getString(R.string.error_invalid_budget_name)); focusView = mBudgetNameView; cancel = true; } if (cancel) { focusView.requestFocus(); return; } final Budget newBudget = createBudget(); createButtonView.setClickable(false); ApiInterface.getInstance().create(newBudget, new ApiCallback<Long>() { @Override public void onSuccess(Long result) { UBudgetApp app = (UBudgetApp) getApplication(); app.budgetList.add(0, newBudget); finish(); } @Override public void onFailure(String errorMessage) { Toast.makeText(AddBudgetActivity.this, errorMessage, Toast.LENGTH_LONG).show(); createButtonView.setClickable(true); } }); }

Target:
public void attemptAddBudget(){ boolean cancel = false; View focusView = null; mBudgetAmountView.setError(null); mBudgetNameView.setError(null); mBudgetAmount = mBudgetAmountView.getText().toString(); mBudgetName = mBudgetNameView.getText().toString(); if (mBudgetAmount.isEmpty()) { mBudgetAmountView.setError(getString(R.string.error_invalid_amount)); focusView = mBudgetAmountView; cancel = true; } double amount = Double.parseDouble(mBudgetAmountView.getText().toString()); if (!cancel && amount == 0.0) { mBudgetAmountView.setError(getString(R.string.error_zero_amount)); mBudgetAmountView.requestFocus(); focusView = mBudgetAmountView; cancel = true; } if (mBudgetName.isEmpty()) { mBudgetNameView.setError(getString(R.string.error_invalid_budget_name)); focusView = mBudgetNameView; cancel = true; } if (cancel) { focusView.requestFocus(); return; } final Budget newBudget = createBudget(); createButtonView.setClickable(false); ApiInterface.getInstance().create(newBudget, new ApiCallback<Long>() { @Override public void onSuccess(Long result) { UBudgetApp app = (UBudgetApp) getApplication(); app.getBudgetList().add(0, newBudget); finish(); } @Override public void onFailure(String errorMessage) { Toast.makeText(AddBudgetActivity.this, errorMessage, Toast.LENGTH_LONG).show(); createButtonView.setClickable(true); } }); }
Source:
public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.of(FlowElement.class, Result.class) .when(StartEvent.class, converterFactory.startEventConverter()::convert) .when(EndEvent.class, converterFactory.endEventConverter()::convert) .when(BoundaryEvent.class, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .when(IntermediateCatchEvent.class, converterFactory.intermediateCatchEventConverter()::convert) .when(IntermediateThrowEvent.class, converterFactory.intermediateThrowEventConverter()::convert) .when(Task.class, converterFactory.taskConverter()::convert) .when(Gateway.class, converterFactory.gatewayConverter()::convert) .when(SubProcess.class, converterFactory.subProcessConverter()::convertSubProcess) .when(CallActivity.class, converterFactory.callActivityConverter()::convert) .ignore(DataStore.class) .ignore(DataStoreReference.class) .ignore(DataObjectReference.class) .ignore(DataObject.class) .ignore(TextAnnotation.class) .ignore(Group.class) .defaultValue(Result.ignored("FlowElement not found")) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value() .get(); }

Target:
public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.of(FlowElement.class, Result.class) .when(StartEvent.class, converterFactory.startEventConverter()::convert) .when(EndEvent.class, converterFactory.endEventConverter()::convert) .when(BoundaryEvent.class, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .when(IntermediateCatchEvent.class, converterFactory.intermediateCatchEventConverter()::convert) .when(IntermediateThrowEvent.class, converterFactory.intermediateThrowEventConverter()::convert) .when(Task.class, converterFactory.taskConverter()::convert) .when(Gateway.class, converterFactory.gatewayConverter()::convert) .when(SubProcess.class, converterFactory.subProcessConverter()::convertSubProcess) .when(CallActivity.class, converterFactory.callActivityConverter()::convert) .ignore(DataStoreReference.class) .ignore(DataObjectReference.class) .ignore(DataObject.class) .ignore(TextAnnotation.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); }
Source:
public static List<Object> sscan(Region<ByteArrayWrapper, RedisSet> region, ByteArrayWrapper key, Pattern matchPattern, int count, int cursor) { RedisSet RedisSet = region.get(key); if (RedisSet != null) { return RedisSet.doSscan(matchPattern, count, cursor); } else { return null; } }

Target:
public static List<Object> sscan(Region<ByteArrayWrapper, RedisSet> region, ByteArrayWrapper key, Pattern matchPattern, int count, int cursor) { RedisSet RedisSet = region.get(key); if (RedisSet != null) { return RedisSet.doSscan(matchPattern, count, cursor); } else { return emptyList(); } }
Source:
public boolean hasLong() { return this.isIntegerCell; }

Target:
public boolean hasLong() { return pbCell.hasSint64Value(); }
Source:
public void run() { aclService.assertHasAccess("Insufficient privileges to delete/restore object " + pid.getUUID(), pid, agent.getPrincipals(), markForDeletion); RepositoryObject repoObj = repositoryObjectLoader.getRepositoryObject(pid); if (repoObj instanceof AdminUnit) { aclService.assertHasAccess("Insufficient privileges to delete/restore admin unit " + pid.getUUID(), pid, agent.getPrincipals(), markForDeletionUnit); } if (!(repoObj instanceof ContentObject)) { throw new InvalidOperationForObjectType("Cannot mark object " + pid.getUUID() + " for deletion, objects of type " + repoObj.getClass().getName() + " are not eligible."); } String updateString = createSparqlReplace(pid.getRepositoryPath(), markedForDeletion, true); sparqlUpdateService.executeUpdate(repoObj.getMetadataUri().toString(), updateString); repoObj.getPremisLog().buildEvent(Premis.Deletion) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Item marked for deletion and not available without permissions") .write(); }

Target:
public void run() { aclService.assertHasAccess("Insufficient privileges to delete object " + pid.getUUID(), pid, agent.getPrincipals(), markForDeletion); RepositoryObject repoObj = repositoryObjectLoader.getRepositoryObject(pid); if (repoObj instanceof AdminUnit) { aclService.assertHasAccess("Insufficient privileges to delete admin unit " + pid.getUUID(), pid, agent.getPrincipals(), markForDeletionUnit); } if (!(repoObj instanceof ContentObject)) { throw new InvalidOperationForObjectType("Cannot mark object " + pid.getUUID() + " for deletion, objects of type " + repoObj.getClass().getName() + " are not eligible."); } String updateString = createSparqlReplace(pid.getRepositoryPath(), markedForDeletion, true); sparqlUpdateService.executeUpdate(repoObj.getMetadataUri().toString(), updateString); repoObj.getPremisLog().buildEvent(Premis.Deletion) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Item marked for deletion and not available without permissions") .write(); }
Source:
public GiveCommand(String name) { super(name, "%nukkit.command.give.description", "%nukkit.command.give.usage"); this.setPermission("nukkit.command.give"); this.commandParameters.clear(); this.commandParameters.put("default", new CommandParameter[]{ new CommandParameter("player", CommandParameter.ARG_TYPE_TARGET, false), new CommandParameter("item", false, CommandParameter.ENUM_TYPE_ITEM_LIST), new CommandParameter("amount", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("meta", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("tags...", CommandParameter.ARG_TYPE_RAW_TEXT, true) }); }

Target:
public GiveCommand(String name) { super(name, "%nukkit.command.give.description", "%nukkit.command.give.usage"); this.setPermission("nukkit.command.give"); this.commandParameters.clear(); this.commandParameters.put("default", new CommandParameter[]{ new CommandParameter("player", CommandParameter.ARG_TYPE_TARGET, false), new CommandParameter("item", false, CommandParameter.ENUM_TYPE_ITEM_LIST), new CommandParameter("amount", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("meta", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("tags...", CommandParameter.ARG_TYPE_RAW_TEXT, true) }); this.commandParameters.put("toPlayerById", new CommandParameter[]{ new CommandParameter("player", CommandParameter.ARG_TYPE_TARGET, false), new CommandParameter("item ID", CommandParameter.ARG_TYPE_INT, false), new CommandParameter("amount", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("tags...", CommandParameter.ARG_TYPE_RAW_TEXT, true) }); this.commandParameters.put("toPlayerByIdMeta", new CommandParameter[]{ new CommandParameter("player", CommandParameter.ARG_TYPE_TARGET, false), new CommandParameter("item ID:meta", CommandParameter.ARG_TYPE_RAW_TEXT, false), new CommandParameter("amount", CommandParameter.ARG_TYPE_INT, true), new CommandParameter("tags...", CommandParameter.ARG_TYPE_RAW_TEXT, true) }); }
Source:
public static String shorten(String s, int len) { s = s.trim(); if (s.length() > 12) { s = s.substring(0, len - 3).trim() + "..."; } return s; }

Target:
public static String shorten(String s, int len) { s = s.trim(); if (s.length() > len) { s = s.substring(0, len - 3).trim() + "..."; } return s; }
Source:
public void bindViewModel(@NonNull final ProductListViewModel viewModel) { this.viewModel = viewModel; viewModel.fetchDataIfNecessary(); viewModel .state() .observe(this, state -> setRefreshing(state == CollectionListViewModel.State.FETCHING)); viewModel .error() .observe(this, error -> { Snackbar snackbar = Snackbar.make(this, R.string.default_error, Snackbar.LENGTH_LONG); snackbar.getView().setBackgroundResource(R.color.snackbar_error_background); snackbar.show(); }); Transformations .map(viewModel.data(), products -> Util.reduce(products, (viewModels, product) -> { viewModels.add(new ProductListItemViewModel(product)); return viewModels; }, new ArrayList<ListItemViewModel>())) .observe(this, adapter::swapItemsAndNotify); }

Target:
public void bindViewModel(@NonNull final ProductListViewModel viewModel) { this.viewModel = viewModel; viewModel.fetchDataIfNecessary(); viewModel .state() .observe(this, state -> setRefreshing(state == CollectionListViewModel.State.FETCHING)); viewModel .error() .observe(this, error -> { Snackbar snackbar = Snackbar.make(this, R.string.default_error, Snackbar.LENGTH_LONG); snackbar.getView().setBackgroundResource(R.color.snackbar_error_background); snackbar.show(); }); viewModel .items() .observe(this, adapter::swapItemsAndNotify); }
Source:
protected void addItem(String iconClass, String id, String name, String description, Command onClicked) { Element nameEl = onClicked != null ? Document.get().createAnchorElement() : Document.get().createSpanElement(); nameEl.setInnerText(name); nameEl.setClassName(onClicked != null ? "navtree-widget-non-clicked" : "navtree-widget-non-clickable"); if (description != null && !description.equals(name)) { nameEl.setTitle(description); } SpanElement iconSpan = Document.get().createSpanElement(); iconSpan.setClassName("navtree-widget-icon " + iconClass); DivElement div = Document.get().createDivElement(); div.appendChild(iconSpan); div.appendChild(nameEl); navWidget.appendChild((Node) div); itemMap.put(id, nameEl); if (onClicked != null) { Event.sinkEvents(nameEl, Event.ONCLICK); Event.setEventListener(nameEl, event -> { if (Event.ONCLICK == event.getTypeInt()) { onClicked.execute(); } }); } }

Target:
protected void addItem(String iconClass, String id, String name, String description, Command onClicked) { Element nameEl = onClicked != null ? Document.get().createAnchorElement() : Document.get().createSpanElement(); nameEl.setInnerText(name); nameEl.setClassName(onClicked != null ? "uf-navtree-widget-non-clicked" : "uf-navtree-widget-non-clickable"); if (description != null && !description.equals(name)) { nameEl.setTitle(description); } SpanElement iconSpan = Document.get().createSpanElement(); iconSpan.setClassName("uf-navtree-widget-icon " + iconClass); DivElement div = Document.get().createDivElement(); div.appendChild(iconSpan); div.appendChild(nameEl); navWidget.appendChild((Node) div); itemMap.put(id, nameEl); if (onClicked != null) { Event.sinkEvents(nameEl, Event.ONCLICK); Event.setEventListener(nameEl, event -> { if (Event.ONCLICK == event.getTypeInt()) { onClicked.execute(); } }); } }
Source:
private static ITypedElement createTypedElement(Repository repository, String path, final RevCommit commit, final ObjectId objectId) { if (null != commit) return CompareUtils.getFileRevisionTypedElement(path, commit, repository, objectId); else return new GitCompareFileRevisionEditorInput.EmptyTypedElement(""); }

Target:
private static ITypedElement createTypedElement(Repository repository, String path, final RevCommit commit, final ObjectId objectId) { if (null != commit) { return CompareUtils.getFileRevisionTypedElement(path, commit, repository, objectId); } else { return new GitCompareFileRevisionEditorInput.EmptyTypedElement(""); } }
Source:
private void prepareInsertExistingPartition(HdfsContext context, PartitionAndMore partitionAndMore) { Partition partition = partitionAndMore.getPartition(); Partition oldPartition = delegate.getPartition(partition.getDatabaseName(), partition.getTableName(), partition.getValues()) .orElseThrow(() -> new PrestoException( TRANSACTION_CONFLICT, format("The partition that this transaction modified was deleted in another transaction. %s %s", partition.getTableName(), partition.getValues()))); Path targetPath = new Path(partition.getStorage().getLocation()); Path currentPath = partitionAndMore.getCurrentLocation(); cleanUpTasksForAbort.add(new DirectoryCleanUpTask(context, targetPath, false)); if (!targetPath.equals(currentPath)) { asyncRename(hdfsEnvironment, renameExecutor, fileRenameCancelled, fileRenameFutures, context, currentPath, targetPath, partitionAndMore.getFileNames()); } replaceParametersOperations.add(new ReplaceParametersOperation( partition.getDatabaseName(), partition.getTableName(), Optional.of(partition.getValues()), partition.getParameters(), oldPartition.getParameters())); }

Target:
private void prepareInsertExistingPartition(HdfsContext context, PartitionAndMore partitionAndMore) { deleteOnly = false; Partition partition = partitionAndMore.getPartition(); Path targetPath = new Path(partition.getStorage().getLocation()); Path currentPath = partitionAndMore.getCurrentLocation(); cleanUpTasksForAbort.add(new DirectoryCleanUpTask(context, targetPath, false)); if (!targetPath.equals(currentPath)) { asyncRename(hdfsEnvironment, renameExecutor, fileRenameCancelled, fileRenameFutures, context, currentPath, targetPath, partitionAndMore.getFileNames()); } if (partitionAndMore.getStatisticsUpdate().isPresent()) { updateStatisticsOperations.add( new UpdateStatisticsOperation( new SchemaTableName(partition.getDatabaseName(), partition.getTableName()), Optional.of(partition.getValues()), partitionAndMore.getStatisticsUpdate().get())); } }
Source:
public static Package getUserModel(ExecutionEvent event) { ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); try { EList<Resource> resources = serviceUtils.getModelSet(event).getResources(); for (int i = 0; i < Math.min(resources.size(), 4); i++) { Resource userResource = resources.get(i); if (userResource.getContents().size() > 0) { EObject topEObj = userResource.getContents().get(0); if ((topEObj instanceof Package) && (!(topEObj instanceof Profile))) { return (Package) topEObj; } } } } catch (ServiceException e) { } return null; }

Target:
public static Package getUserModel(ExecutionEvent event) { ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); try { URI uri = serviceUtils.getModelSet(event).getURIWithoutExtension().appendFileExtension(UML_EXT); Resource userResource = serviceUtils.getModelSet(event).getResource(uri, false); if (userResource != null && userResource.getContents().size() > 0) { EObject topEObj = userResource.getContents().get(0); if ((topEObj instanceof Package) && (!(topEObj instanceof Profile))) { return (Package) topEObj; } } } catch (ServiceException e) { Activator.log.error(e); } return null; }
Source:
public void testPerSessionInterpreterCloseOnNoteRemoval() throws IOException, InterpreterException, InterruptedException { Note note1 = notebook.createNote("note1", anonymous); Paragraph p1 = note1.addNewParagraph(AuthenticationInfo.ANONYMOUS); p1.setText("%mock1 getId"); p1.setAuthenticationInfo(anonymous); for (InterpreterSetting setting : note1.getBindedInterpreterSettings(new ArrayList<>())) { setting.getOption().setPerNote(setting.getOption().SCOPED); notebook.getInterpreterSettingManager().restart(setting.getId()); } Thread.sleep(2000); note1.run(p1.getId()); while (p1.getStatus() != Status.FINISHED) Thread.yield(); InterpreterResult result = p1.getReturn(); notebook.removeNote(note1, anonymous); note1 = notebook.createNote("note1", anonymous); p1 = note1.addNewParagraph(AuthenticationInfo.ANONYMOUS); p1.setText("%mock1 getId"); p1.setAuthenticationInfo(anonymous); note1.run(p1.getId()); while (p1.getStatus() != Status.FINISHED) Thread.yield(); assertNotEquals(p1.getReturn().message(), result.message()); notebook.removeNote(note1, anonymous); }

Target:
public void testPerSessionInterpreterCloseOnNoteRemoval() throws IOException, InterpreterException { Note note1 = notebook.createNote("note1", anonymous); Paragraph p1 = note1.addNewParagraph(AuthenticationInfo.ANONYMOUS); p1.setText("%mock1 getId"); p1.setAuthenticationInfo(anonymous); for (InterpreterSetting setting : note1.getBindedInterpreterSettings(new ArrayList<>())) { setting.getOption().setPerNote(setting.getOption().SCOPED); notebook.getInterpreterSettingManager().restart(setting.getId()); } note1.run(p1.getId()); while (p1.getStatus() != Status.FINISHED) Thread.yield(); InterpreterResult result = p1.getReturn(); notebook.removeNote(note1, anonymous); note1 = notebook.createNote("note1", anonymous); p1 = note1.addNewParagraph(AuthenticationInfo.ANONYMOUS); p1.setText("%mock1 getId"); p1.setAuthenticationInfo(anonymous); note1.run(p1.getId()); while (p1.getStatus() != Status.FINISHED) Thread.yield(); assertNotEquals(p1.getReturn().message(), result.message()); notebook.removeNote(note1, anonymous); }
Source:
public MessageStream<M> sink(SinkFunction<? super M> sinkFn) { String opId = this.streamAppDesc.getNextOpId(OpCode.SINK); SinkOperatorSpec<M> op = OperatorSpecs.createSinkOperatorSpec(sinkFn, opId); this.operatorSpec.registerNextOperatorSpec(op); return new MessageStreamImpl<>(this.streamAppDesc, op); }

Target:
public void sink(SinkFunction<? super M> sinkFn) { String opId = this.streamAppDesc.getNextOpId(OpCode.SINK); SinkOperatorSpec<M> op = OperatorSpecs.createSinkOperatorSpec(sinkFn, opId); this.operatorSpec.registerNextOperatorSpec(op); }
Source:
public void shouldFetchOnlyNonVoidedPatientEncountersIfIncludeAllParamIsSetToFalse() throws Exception { String encounterUuuid = "c59b3942-4fdd-11e5-8c3c-410f8777c163"; String patientUuid = "da7f524f-27ce-4bb2-86d6-6d1d05312bd5"; Patient patient = Context.getPatientService().getPatientByUuid(patientUuid); Encounter enc = Context.getEncounterService().getEncounterByUuid(encounterUuuid); Context.getEncounterService().voidEncounter(enc, "bcbcb"); Context.getEncounterService().saveEncounter(enc); List<Encounter> encs = Context.getEncounterService().getEncountersByPatient(patient.getGivenName()); Assert.assertEquals(1, encs.size()); MockHttpServletRequest req = request(RequestMethod.GET, getURI()); req.addParameter("patient", patientUuid); req.addParameter("includeAll", "false"); SimpleObject result = deserialize(handle(req)); List<Object> encounters = result.get("results"); Assert.assertEquals(1, encounters.size()); }

Target:
public void shouldFetchOnlyNonVoidedPatientEncountersIfIncludeAllParamIsSetToFalse() throws Exception { Patient patient = Context.getPatientService().getPatientByUuid(RestTestConstants1_9.PATIENT_WITH_ENCOUNTER_UUID); Encounter enc = Context.getEncounterService().getEncounterByUuid(RestTestConstants1_9.ENCOUNTER_UUID); Context.getEncounterService().voidEncounter(enc, "bcbcb"); Context.getEncounterService().saveEncounter(enc); List<Encounter> encs = Context.getEncounterService().getEncountersByPatient(patient); Assert.assertEquals(1, encs.size()); MockHttpServletRequest req = request(RequestMethod.GET, getURI()); req.addParameter("patient", RestTestConstants1_9.PATIENT_WITH_ENCOUNTER_UUID); req.addParameter("includeAll", "false"); SimpleObject result = deserialize(handle(req)); List<Object> encounters = result.get("results"); Assert.assertEquals(1, encounters.size()); }
Source:
public void testSecondEvent() { CtfTmfEvent event = getEvent(1); assertEquals("Second event type", event.getType().getName()); assertEquals("Second event timestamp" ,1234568, event.getTimestamp().getValue()); assertEquals("Second event int field", 0, ((Long) event.getContent().getField("field_1").getValue()).intValue()); assertEquals("Second event string field", "This is a test", event.getContent().getField("a_string").getValue()); }

Target:
public void testSecondEvent() { CtfTmfEvent event = getEvent(1); assertEquals("Second event type", "Spammy_Event", event.getType().getName()); assertEquals("Second event timestamp" ,1234568, event.getTimestamp().getValue()); assertEquals("Second event int field", 0, ((Long) event.getContent().getField("field_1").getValue()).intValue()); assertEquals("Second event string field", "This is a test", event.getContent().getField("a_string").getValue()); }
Source:
private boolean hasStatus(final StatuteType statuteType, final Registration registration) { return registration.getStudent().getStudentStatutesSet().stream() .filter(statute -> statute.getType() == statuteType) .anyMatch(statute -> statute.getBeginExecutionPeriod().isCurrent() || statute.getBeginExecutionPeriod().isCurrent()); }

Target:
private boolean hasStatus(final StatuteType statuteType, final Registration registration) { return registration.getStudent().getStudentStatutesSet().stream() .filter(statute -> statute.getType().getCode().equals(statuteType.getCode())) .anyMatch(statute -> statute.getBeginExecutionPeriod().isCurrent() || statute.getEndExecutionPeriod().isCurrent()); }
Source:
public ModelAndView handleRequest(final HttpServletRequest request, final HttpServletResponse response) { val context = new JEEContext(request, response, getOAuthConfigurationContext().getSessionStore()); if (!verifyRevocationRequest(context)) { LOGGER.error("Revocation request verification failed. Request is missing required parameters"); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } val manager = new ProfileManager<CommonProfile>(context, context.getSessionStore()); val clientId = OAuth20Utils.getClientIdAndClientSecret(context).getLeft(); val registeredService = getRegisteredServiceByClientId(clientId); if (isServiceNeedAuthentication(registeredService)) { if (manager.get(true).isEmpty()) { LOGGER.error("Service requests authentication", clientId); return OAuth20Utils.writeError(response, OAuth20Constants.ACCESS_DENIED); } } val token = context.getRequestParameter(OAuth20Constants.TOKEN) .map(String::valueOf).orElse(StringUtils.EMPTY); if (isAsupportedTokenType(token)) { return generateRevocationResponse(token, clientId, response); } return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); }

Target:
public ModelAndView handleRequest(final HttpServletRequest request, final HttpServletResponse response) { val context = new JEEContext(request, response, getOAuthConfigurationContext().getSessionStore()); if (!verifyRevocationRequest(context)) { LOGGER.error("Revocation request verification failed. Request is missing required parameters"); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } val manager = new ProfileManager<CommonProfile>(context, context.getSessionStore()); val clientId = OAuth20Utils.getClientIdAndClientSecret(context).getLeft(); val registeredService = getRegisteredServiceByClientId(clientId); if (OAuth20Utils.doesServiceNeedAuthentication(registeredService)) { if (manager.get(true).isEmpty()) { LOGGER.warn("Service requests authentication", clientId); return OAuth20Utils.writeError(response, OAuth20Constants.ACCESS_DENIED); } } else { val service = getOAuthConfigurationContext().getWebApplicationServiceServiceFactory().createService(registeredService.getServiceId()); val audit = AuditableContext.builder() .service(service) .registeredService(registeredService) .build(); val accessResult = getOAuthConfigurationContext().getRegisteredServiceAccessStrategyEnforcer().execute(audit); if (accessResult.isExecutionFailure()) { return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } } val token = context.getRequestParameter(OAuth20Constants.TOKEN) .map(String::valueOf).orElse(StringUtils.EMPTY); return generateRevocationResponse(token, clientId, response); }
Source:
protected boolean shouldUpdate(final Set<String> changedKeys) { assert changedKeys != null; if (clientConfig.shouldUseDnsForFetchingServiceUrls()) { return false; } if (changedKeys.contains("eureka.client.region")) { return true; } for (final String key : changedKeys) { assert key != null; if (key.startsWith("eureka.client.service-url.") || key.startsWith("eureka.client.serviceUrl.") || key.startsWith("eureka.client.availability-zones.") || key.startsWith("eureka.client.availabilityZones.")) { return true; } } return false; }

Target:
protected boolean shouldUpdate(final Set<String> changedKeys) { assert changedKeys != null; if (clientConfig.shouldUseDnsForFetchingServiceUrls()) { return false; } if (changedKeys.contains("eureka.client.region")) { return true; } for (final String key : changedKeys) { if (key.startsWith("eureka.client.service-url.") || key.startsWith("eureka.client.availability-zones.")) { return true; } } return false; }
Source:
public Object execute() throws Exception { System.out.println("testCommit"); if (tm == null) { System.out.println("Can not get transaction manager"); } else { DummyXAResource xa1 = new DummyXAResource(); DummyXAResource xa2 = new DummyXAResource(); tm.begin(); Transaction transaction = tm.getTransaction(); transaction.enlistResource(xa1); transaction.enlistResource(xa2); tm.commit(); } return null; }

Target:
public Object execute() throws Exception { System.out.println("testCommit"); if (tm == null) { System.out.println("Can not get transaction manager"); } else { DummyXAResource xa = new DummyXAResource(); Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("osgi:service/test"); Connection conn = null; Statement stmt = null; try { tm.begin(); Transaction transaction = tm.getTransaction(); transaction.enlistResource(xa); conn = ds.getConnection(); stmt = conn.createStatement(); stmt.execute("CREATE TABLE IF NOT EXISTS example ( id varchar(10), name varchar(32) )"); stmt.execute("insert into example values (1, 'commit')"); tm.commit(); } catch (SQLException e) { System.out.println(e); tm.rollback(); } finally { stmt.close(); conn.close(); } } return null; }
Source:
public int indexOfByte(int b) { checkArgument((b >> Byte.SIZE) == 0, "byte value out of range"); for (int i = 0; i < size; i++) { if (getByteUnchecked(i) == b) { return i; } } return -1; }

Target:
public int indexOfByte(int b) { checkArgument((b >> Byte.SIZE) == 0, "byte value out of range"); return indexOfByte((byte) b); }
Source:
public static void input( @AggregationState EntropyState state, @SqlType(StandardTypes.BIGINT) long count) { if (count == 0) { return; } if (count < 0) { state.setNull(true); return; } final double countVal = count; state.setSumC(state.getSumC() + countVal); state.setSumCLogC(state.getSumCLogC() + countVal * Math.log(countVal)); }

Target:
public static void input( @AggregationState EntropyState state, @SqlType(StandardTypes.BIGINT) long count) { if (count < 0) { throw new PrestoException( INVALID_FUNCTION_ARGUMENT, "Entropy count argument must be non-negative"); } if (count == 0) { return; } state.setSumC(state.getSumC() + count); state.setSumCLogC(state.getSumCLogC() + count * Math.log(count)); }
Source:
public static boolean containsLetters(String parameter) { byte[] byteArray = parameter.getBytes(); for (int i = 0; i < byteArray.length; i++){ if (!((byteArray[i] >= '0') && (byteArray[i] <= '9'))) return true; } return false; }

Target:
public static boolean containsLetters(String parameter) { if (parameter == null) throw new NullPointerException("Parameter cannot be null."); byte[] byteArray = parameter.getBytes(); for (int i = 0; i < byteArray.length; i++){ if (!((byteArray[i] >= '0') && (byteArray[i] <= '9'))) return true; } return false; }
Source:
public void enqueue(final DeferredSerialization ds) { synchronized (this) { if (m_isShutdown) { ds.cancel(); return; } updateLastPendingWriteTimeAndQueueBackpressure(); if (m_isSSLConfigured) { Iterator<DeferredSerialization> dsIter = new SSLDeferredSerializationIterator(m_sslEngine, ds); while (dsIter.hasNext()) { m_queuedWrites.offer(dsIter.next()); } } else { m_queuedWrites.offer(ds); } m_port.setInterests( SelectionKey.OP_WRITE, 0); } }

Target:
public void enqueue(final DeferredSerialization ds) { synchronized (this) { if (m_isShutdown) { ds.cancel(); return; } updateLastPendingWriteTimeAndQueueBackpressure(); m_queuedWrites.offer(ds); m_port.setInterests( SelectionKey.OP_WRITE, 0); } }
Source:
public <R extends RestResponse, E extends Named> Map<String, E> retrieveItems(IOperationMonitor monitor, String path, TypeToken typeToken) throws BugzillaRestException { R response = new BugzillaRestAuthenticatedGetRequest<R>(client, path, typeToken).run(monitor); Named[] members = new Function<R, Named[]>() { public Named[] apply(R input) { return input.getArray(); } }.apply(response); return Maps.uniqueIndex((ArrayList<E>) Lists.newArrayList(members), new Function<E, String>() { public String apply(E input) { return input.getName(); }; }); }

Target:
public <R extends RestResponse<E>, E extends Named> Map<String, E> retrieveItems(IOperationMonitor monitor, String path, TypeToken typeToken) throws BugzillaRestException { R response = new BugzillaRestAuthenticatedGetRequest<R>(client, path, typeToken).run(monitor); E[] members = response.getArray(); return Maps.uniqueIndex(Lists.newArrayList(members), new Function<E, String>() { public String apply(E input) { return input.getName(); }; }); }
Source:
private static boolean shouldMoveATask(final ClientState sourceClientState, final ClientState destinationClientState) { final double assignedTasksPerStreamThreadAtDestination = 1.0 * destinationClientState.assignedTasks().size() / destinationClientState.capacity(); final double assignedTasksPerStreamThreadAtSource = 1.0 * sourceClientState.assignedTasks().size() / sourceClientState.capacity(); final double skew = assignedTasksPerStreamThreadAtSource - assignedTasksPerStreamThreadAtDestination; if (skew <= 0) { return false; } final double proposedAssignedTasksPerStreamThreadAtDestination = (destinationClientState.assignedTasks().size() + 1.0) / destinationClientState.capacity(); final double proposedAssignedTasksPerStreamThreadAtSource = (sourceClientState.assignedTasks().size() - 1.0) / sourceClientState.capacity(); final double proposedSkew = proposedAssignedTasksPerStreamThreadAtSource - proposedAssignedTasksPerStreamThreadAtDestination; if (proposedSkew < 0) { return false; } return proposedSkew < skew; }

Target:
private static boolean shouldMoveATask(final ClientState sourceClientState, final ClientState destinationClientState) { final double skew = sourceClientState.assignedTaskLoad() - destinationClientState.assignedTaskLoad(); if (skew <= 0) { return false; } final double proposedAssignedTasksPerStreamThreadAtDestination = (destinationClientState.assignedTaskCount() + 1.0) / destinationClientState.capacity(); final double proposedAssignedTasksPerStreamThreadAtSource = (sourceClientState.assignedTaskCount() - 1.0) / sourceClientState.capacity(); final double proposedSkew = proposedAssignedTasksPerStreamThreadAtSource - proposedAssignedTasksPerStreamThreadAtDestination; if (proposedSkew < 0) { return false; } return proposedSkew < skew; }
Source:
public static <T extends CommandBase<?>> List<T> findChildCommands(Guid commandId) { final List<Guid> childCommandIds = getChildCommandIds(commandId); final List<T> childCommands = childCommandIds .stream() .map(CommandCoordinatorUtil::<T> retrieveCommand) .collect(Collectors.toList()); return childCommands; }

Target:
public static List<CommandEntity> findChildCommands(Guid commandId) { final List<Guid> childCommandIds = getChildCommandIds(commandId); final List<CommandEntity> childCommands = childCommandIds .stream() .map(CommandCoordinatorUtil::getCommandEntity) .collect(Collectors.toList()); return childCommands; }
Source:
public long getHeaderLength() throws NitfFormatException, IOException { long headerLength = DataExtensionConstants.DE.length() + DataExtensionConstants.DESID_LENGTH + DataExtensionConstants.DESVER_LENGTH + getSecurityMetadata().getSerialisedLength(); if (isTreOverflowNitf20() || isTreOverflowNitf21()) { headerLength += DataExtensionConstants.DESOFLW_LENGTH; headerLength += DataExtensionConstants.DESITEM_LENGTH; } headerLength += DataExtensionConstants.DESSHL_LENGTH; headerLength += getUserDefinedSubheaderField().length(); return headerLength; }

Target:
public long getHeaderLength() throws NitfFormatException, IOException { long headerLength = DE.length() + DESID_LENGTH + DESVER_LENGTH + getSecurityMetadata().getSerialisedLength(); if (isTreOverflowNitf20() || isTreOverflowNitf21()) { headerLength += DESOFLW_LENGTH; headerLength += DESITEM_LENGTH; } headerLength += DESSHL_LENGTH; headerLength += getUserDefinedSubheaderField().length(); return headerLength; }
Source:
private RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp) { super(leftOp, rightOp); this.kind = kind; }

Target:
private RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp) { this.kind = kind; this.leftOp = leftOp; this.rightOp = rightOp; }
Source:
public PlanNodeCostEstimate visitSpatialJoin(SpatialJoinNode node, Void context) { return calculateJoinCost( node.getLeft(), node.getRight(), Objects.equals(node.getDistributionType(), SpatialJoinNode.DistributionType.REPLICATED)); }

Target:
public PlanNodeCostEstimate visitSpatialJoin(SpatialJoinNode node, Void context) { return calculateJoinExchangeCost( node.getLeft(), node.getRight(), stats, types, node.getDistributionType() == SpatialJoinNode.DistributionType.REPLICATED, taskCountEstimator.estimateSourceDistributedTaskCount()); }
Source:
public View display(final Context context, int position, View v) { if (v == null) { if (appPojo.displayTags.isEmpty()) { v = inflateFromId(context, R.layout.item_app); } else { v = inflateFromId(context, R.layout.item_app_with_tags); TextView tagsView = (TextView) v.findViewById(R.id.item_app_tag); tagsView.setText(enrichText(appPojo.displayTags)); } } TextView appName = (TextView) v.findViewById(R.id.item_app_name); appName.setText(enrichText(appPojo.displayName)); final ImageView appIcon = (ImageView) v.findViewById(R.id.item_app_icon); if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("icons-hide", false)) { if (position < 15 || Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { appIcon.setImageDrawable(this.getDrawable(context)); } else { Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { appIcon.setImageDrawable(getDrawable(context)); } }); } } else { appIcon.setVisibility(View.INVISIBLE); } return v; }

Target:
public View display(final Context context, int position, View v) { if (v == null) { v = inflateFromId(context, R.layout.item_app); } TextView appName = (TextView) v.findViewById(R.id.item_app_name); appName.setText(enrichText(appPojo.displayName)); TextView tagsView = (TextView) v.findViewById(R.id.item_app_tag); if (appPojo.displayTags.isEmpty()) { tagsView.setVisibility(View.GONE); } else { tagsView.setVisibility(View.VISIBLE); } tagsView.setText(enrichText(appPojo.displayTags)); final ImageView appIcon = (ImageView) v.findViewById(R.id.item_app_icon); if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("icons-hide", false)) { if (position < 15 || Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { appIcon.setImageDrawable(this.getDrawable(context)); } else { Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { appIcon.setImageDrawable(getDrawable(context)); } }); } } else { appIcon.setVisibility(View.INVISIBLE); } return v; }
Source:
FrameworkField(Field field) { if (field == null) { throw new IllegalArgumentException( "FrameworkField cannot be created without an underlying field."); } fField = field; }

Target:
FrameworkField(Field field) { if (field == null) { throw new NullPointerException( "FrameworkField cannot be created without an underlying field."); } fField = field; }