auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handle(Callback[] callbacks) throws UnsupportedCallbackException { Callback unsupportedCallback = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { ((NameCallback) callback).setName(username); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(password.toCharArray()); } else { log.warn( "Asked to handle unsupported callback '{}' of type {}; request authentication will fail", callback, callback.getClass() ); if (unsupportedCallback == null) unsupportedCallback = callback; } } if (unsupportedCallback != null) throw new UnsupportedCallbackException( unsupportedCallback, "Supports only NameCallback and PasswordCallback"); }

Target:
public void handle(Callback[] callbacks) throws UnsupportedCallbackException { List<Callback> unsupportedCallbacks = new ArrayList<>(); for (Callback callback : callbacks) { if (callback instanceof NameCallback) { ((NameCallback) callback).setName(username); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(password != null ? password.toCharArray() : null ); } else { unsupportedCallbacks.add(callback); } } if (!unsupportedCallbacks.isEmpty()) throw new ConnectException(String.format( "Unsupported callbacks %s; request authentication will fail. " + "This indicates the Connect worker was configured with a JAAS " + "LoginModule that is incompatible with the %s, and will need to be " + "corrected and restarted.", unsupportedCallbacks, BasicAuthSecurityRestExtension.class.getSimpleName() )); }
Source:
private void showNewUserListDialog(CategoryListItem categoryListItem, List<UserList> projectUserList, List<UserList> spriteUserList, FragmentActivity activity, TextInputDialog.Builder builder) { builder.setHint(activity.getString(R.string.data_label)) .setPositiveButton(activity.getString(R.string.ok), (TextInputDialog.OnClickListener) (dialog, textInput) -> { if (textInput.isEmpty()) { activity.onBackPressed(); return; } UserList userList = new UserList(textInput); RadioButton addToProjectListsRadioButton = ((Dialog) dialog).findViewById(R.id.global); boolean addToProjectLists = addToProjectListsRadioButton.isChecked(); if (addToProjectLists) { projectUserList.add(userList); } else { spriteUserList.add(userList); } addResourceToActiveFormulaInFormulaEditor(categoryListItem, userList); }) .setTitle(R.string.formula_editor_list_dialog_title) .setView(R.layout.dialog_new_user_data) .setNegativeButton(R.string.cancel, (dialogInterface, index) -> activity.onBackPressed()); builder.show(); }

Target:
private void showNewUserListDialog(CategoryListItem categoryListItem, List<UserList> projectUserList, List<UserList> spriteUserList, FragmentActivity activity, TextInputDialog.Builder builder) { AddUserListDialog userListDialog = new AddUserListDialog(builder); userListDialog.show(activity.getString(R.string.data_label), activity.getString(R.string.ok), new AddUserListDialog.Callback(){ @Override public void onPositiveButton(DialogInterface dialog, String textInput) { UserList userList = new UserList(textInput); userListDialog.addUserList(dialog, userList, projectUserList, spriteUserList); addResourceToActiveFormulaInFormulaEditor(categoryListItem, userList); } @Override public void onNegativeButton() { activity.onBackPressed(); } }); }
Source:
private Diagnostic validate(PreSetValidator validator, EStructuralFeature eStructuralFeature, Object value, Map<Object, Object> context) { final EClassifier eType = eStructuralFeature.getEType(); BasicDiagnostic diagnostics = new BasicDiagnostic(); if (eType instanceof EDataType && EDataType.class.cast(eType).getEPackage() == EcorePackage.eINSTANCE) { final EDataType eDataType = EDataType.class.cast(eType); diagnostics = Diagnostician.INSTANCE.createDefaultDiagnostic(eDataType, value); if (eDataType instanceof EEnum && value instanceof String) { if (validateEEnum((EEnum) eDataType, (String) value)) { return new BasicDiagnostic(); } } else if (eDataType instanceof EEnum && value instanceof List<?>) { try { if (validateEEnum((EEnum) eDataType, (List<Enumerator>) value)) { return new BasicDiagnostic(); } } catch (final ClassCastException ex) { } } if (validator != null) { validator.validate(eDataType, value, diagnostics, context); } final Set<IFeatureConstraint> dataTypeConstraints = eDataTypeConstraints.get(eType); if (dataTypeConstraints != null) { for (final IFeatureConstraint constraint : dataTypeConstraints) { final Diagnostic result = constraint.validate(eStructuralFeature, value, context); if (result.getSeverity() == Diagnostic.OK) { continue; } diagnostics.add(result); } } } final Set<IFeatureConstraint> featureConstraints = eStructuralFeatureConstraints.get(eStructuralFeature); if (featureConstraints != null) { for (final IFeatureConstraint constraint : featureConstraints) { final Diagnostic result = constraint.validate(eStructuralFeature, value, context); if (result.getSeverity() == Diagnostic.OK) { continue; } diagnostics.add(result); } } return diagnostics; }

Target:
private Diagnostic validate(PreSetValidator validator, EStructuralFeature eStructuralFeature, Object value, Map<Object, Object> context) { final EClassifier eType = eStructuralFeature.getEType(); BasicDiagnostic diagnostics = new BasicDiagnostic(); if (eType instanceof EDataType && EDataType.class.cast(eType).getEPackage() == EcorePackage.eINSTANCE) { final EDataType eDataType = EDataType.class.cast(eType); diagnostics = Diagnostician.INSTANCE.createDefaultDiagnostic(eDataType, value); if (eDataType instanceof EEnum && value instanceof String) { if (validateEEnum((EEnum) eDataType, (String) value)) { return new BasicDiagnostic(); } } else if (eDataType instanceof EEnum && value instanceof List<?>) { try { if (validateEEnum((EEnum) eDataType, (List<Enumerator>) value)) { return new BasicDiagnostic(); } } catch (final ClassCastException ex) { } } if (validator != null) { validator.validate(eDataType, value, diagnostics, context); } executeValidators(diagnostics, constraints.get(eType), eStructuralFeature, value, context); } executeValidators(diagnostics, constraints.get(eStructuralFeature), eStructuralFeature, value, context); return diagnostics; }
Source:
public Table getTable() { ReadableTable table; if (this.recordWriter == null) { table = new RemoteTable(tableSpec.getId(), recordReader); } else { table = new RemoteReadWriteTable(tableSpec.getId(), recordReader, recordWriter); } table.init(containerContext, taskContext); return table; }

Target:
public Table getTable() { RemoteReadableTable table; TableReadFunction<?, ?> readFn = getReadFn(); RateLimiter rateLimiter = deserializeObject(RATE_LIMITER); if (rateLimiter != null) { rateLimiter.init(containerContext.config, taskContext); } CreditFunction<?, ?> readCreditFn = deserializeObject(READ_CREDIT_FN); if (readOnly) { table = new RemoteReadableTable(tableSpec.getId(), readFn, rateLimiter, readCreditFn); } else { CreditFunction<?, ?> writeCreditFn = deserializeObject(WRITE_CREDIT_FN); table = new RemoteReadWriteTable(tableSpec.getId(), readFn, getWriteFn(), rateLimiter, readCreditFn, writeCreditFn); } table.init(containerContext, taskContext); tables.add(table); return table; }
Source:
public QueryBuilder setLong(String name, long value) throws SQLException { for (int i : indexes(name)) { try { if (value == 0) { statement.setNull(i, Types.INTEGER); } else { statement.setLong(i, value); } } catch (SQLException error) { statement.close(); connection.close(); throw error; } } return this; }

Target:
public QueryBuilder setLong(String name, long value) throws SQLException { return setLong(name, value, false); }
Source:
private ConvertVmVDSParameters buildConvertParameters() { ConvertVmVDSParameters parameters = new ConvertVmVDSParameters(getVdsId()); parameters.setUrl(getParameters().getUrl()); parameters.setDisks(getParameters().getDisks()); parameters.setVmId(getVmId()); parameters.setVmName(getVmName()); parameters.setStoragePoolId(getStoragePoolId()); parameters.setStorageDomainId(getStorageDomainId()); parameters.setVirtioIsoPath(getVirtioIsoPath()); switch(getParameters().getOriginType()) { case VMWARE: default: parameters.setUsername(getParameters().getUsername()); parameters.setPassword(getParameters().getPassword()); break; } return parameters; }

Target:
private ConvertVmVDSParameters buildConvertParameters() { ConvertVmVDSParameters parameters = new ConvertVmVDSParameters(getVdsId()); parameters.setUrl(getParameters().getUrl()); parameters.setUsername(getParameters().getUsername()); parameters.setPassword(getParameters().getPassword()); parameters.setDisks(getParameters().getDisks()); parameters.setVmId(getVmId()); parameters.setVmName(getVmName()); parameters.setStoragePoolId(getStoragePoolId()); parameters.setStorageDomainId(getStorageDomainId()); parameters.setVirtioIsoPath(getVirtioIsoPath()); parameters.setOriginType(getParameters().getOriginType()); return parameters; }
Source:
public UUID createSecret111(boolean isPrivate) { ExperimentDTO mtab = ExperimentDTO.createNew(SECRET_111, TYPE_MICROARRAY, "cow", Sets.newHashSet("1"), "diff", isPrivate); return subject.addExperiment(mtab, Optional.<String>absent()); }

Target:
public UUID createSecret111(boolean isPrivate) { ExperimentDTO mtab = ExperimentDTO.createNew(SECRET_111, TYPE_MICROARRAY, "cow", Sets.newHashSet("1"), "diff", isPrivate); return subject.addExperiment(mtab, Optional.absent()); }
Source:
protected List<Attribute> getGlobalAttributesToUpdate(NetcdfFile nc) throws Exception{ List<Attribute> newAttributeList = new ArrayList<>(); String title = profile; try { title = nc.findGlobalAttribute("title").getStringValue(); title = title.substring(0, title.lastIndexOf(",")); } catch (Exception e) { logger.warn("Could not find 'title' attribute in result file"); } newAttributeList.add(new Attribute("title", String.format("%s, %s, %s", title, subset.get("TIME").start, subset.get("TIME").end))); newAttributeList.add(new Attribute(goGoDuckConfig.getLatitudeStart(profile), subset.get("LATITUDE").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getLatitudeEnd(profile), subset.get("LATITUDE").end)); newAttributeList.add(new Attribute(goGoDuckConfig.getLongitudeStart(profile), subset.get("LONGITUDE").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getLongitudeEnd(profile), subset.get("LONGITUDE").end)); newAttributeList.add(new Attribute(goGoDuckConfig.getTimeStart(profile), subset.get("TIME").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getTimeEnd(profile), subset.get("TIME").end)); return newAttributeList; }

Target:
protected List<Attribute> getGlobalAttributesToUpdate(NetcdfFile nc) throws Exception{ List<Attribute> newAttributeList = new ArrayList<>(); String title = profile; try { title = nc.findGlobalAttribute("title").getStringValue(); title = title.substring(0, title.lastIndexOf(",")); } catch (Exception e) { logger.warn("Could not find 'title' attribute in result file"); } newAttributeList.add(new Attribute(goGoDuckConfig.getTitle(profile), String.format("%s, %s, %s", title, subset.get("TIME").start, subset.get("TIME").end))); newAttributeList.add(new Attribute(goGoDuckConfig.getLatitudeStart(profile), subset.get("LATITUDE").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getLatitudeEnd(profile), subset.get("LATITUDE").end)); newAttributeList.add(new Attribute(goGoDuckConfig.getLongitudeStart(profile), subset.get("LONGITUDE").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getLongitudeEnd(profile), subset.get("LONGITUDE").end)); newAttributeList.add(new Attribute(goGoDuckConfig.getTimeStart(profile), subset.get("TIME").start)); newAttributeList.add(new Attribute(goGoDuckConfig.getTimeEnd(profile), subset.get("TIME").end)); return newAttributeList; }
Source:
public void doOnTerminateSuccess() { final AtomicBoolean atomicBoolean = new AtomicBoolean(); Maybe.just(1).doOnTerminate(new Action() { @Override public void run() { atomicBoolean.set(true); } }).subscribe(); assertTrue(atomicBoolean.get()); }

Target:
public void doOnTerminateSuccess() { final AtomicBoolean atomicBoolean = new AtomicBoolean(); Maybe.just(1).doOnTerminate(new Action() { @Override public void run() { atomicBoolean.set(true); } }) .test() .assertResult(1); assertTrue(atomicBoolean.get()); }
Source:
public void testCreateWithNotNullColumns() { metadata.setConnectorCapabilities(NOT_NULL_COLUMNS); ImmutableList<ColumnDefinition> inputColumns = ImmutableList.of( new ColumnDefinition(identifier("a"), "DATE", emptyList(), Optional.empty(), true), new ColumnDefinition(identifier("b"), "VARCHAR", emptyList(), Optional.empty(), false), new ColumnDefinition(identifier("c"), "VARBINARY", emptyList(), Optional.empty(), false)); CreateTable statement = new CreateTable(QualifiedName.of("test_table"), inputColumns, true, ImmutableList.of(), Optional.empty()); getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList())); assertEquals(metadata.getCreateTableCallCount(), 1); List<ColumnMetadata> columns = metadata.getReceivedTableMetadata().get(0).getColumns(); assertEquals(columns.size(), 3); assertEquals(columns.get(0).getName(), inputColumns.get(0).getName().getValue()); assertEquals(columns.get(0).getType().getDisplayName().toUpperCase(ENGLISH), inputColumns.get(0).getType()); assertEquals(columns.get(0).isNullable(), inputColumns.get(0).isNullable()); assertEquals(columns.get(1).getName(), inputColumns.get(1).getName().getValue()); assertEquals(columns.get(1).getType().getDisplayName().toUpperCase(ENGLISH), inputColumns.get(1).getType()); assertEquals(columns.get(1).isNullable(), inputColumns.get(1).isNullable()); assertEquals(columns.get(2).getName(), inputColumns.get(2).getName().getValue()); assertEquals(columns.get(2).getType().getDisplayName().toUpperCase(ENGLISH), inputColumns.get(2).getType()); assertEquals(columns.get(2).isNullable(), inputColumns.get(2).isNullable()); }

Target:
public void testCreateWithNotNullColumns() { metadata.setConnectorCapabilities(NOT_NULL_COLUMN_CONSTRAINT); List<TableElement> inputColumns = ImmutableList.of( new ColumnDefinition(identifier("a"), "DATE", true, emptyList(), Optional.empty()), new ColumnDefinition(identifier("b"), "VARCHAR", false, emptyList(), Optional.empty()), new ColumnDefinition(identifier("c"), "VARBINARY", false, emptyList(), Optional.empty())); CreateTable statement = new CreateTable(QualifiedName.of("test_table"), inputColumns, true, ImmutableList.of(), Optional.empty()); getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList())); assertEquals(metadata.getCreateTableCallCount(), 1); List<ColumnMetadata> columns = metadata.getReceivedTableMetadata().get(0).getColumns(); assertEquals(columns.size(), 3); assertEquals(columns.get(0).getName(), "a"); assertEquals(columns.get(0).getType().getDisplayName().toUpperCase(ENGLISH), "DATE"); assertTrue(columns.get(0).isNullable()); assertEquals(columns.get(1).getName(), "b"); assertEquals(columns.get(1).getType().getDisplayName().toUpperCase(ENGLISH), "VARCHAR"); assertFalse(columns.get(1).isNullable()); assertEquals(columns.get(2).getName(), "c"); assertEquals(columns.get(2).getType().getDisplayName().toUpperCase(ENGLISH), "VARBINARY"); assertFalse(columns.get(2).isNullable()); }
Source:
public void onBackPressed() { if (onBackPressedListener != null) { onBackPressedListener.doBack(); } else { super.onBackPressed(); } Intent intent = new Intent(); setResult(ApplicationConstants.RequestCodes.FONT_SIZE_MATCHER, intent); }

Target:
public void onBackPressed() { if (onBackPressedListener != null) { onBackPressedListener.doBack(); } else { super.onBackPressed(); } Intent intent = new Intent(); setResult(ApplicationConstants.RequestCodes.PREFERENCES, intent); }
Source:
public static boolean isJobBlacklisted(final String jobName) { Boolean useJobRegex = DatadogUtilities.getDatadogDescriptor().getJobRegex(); logger.fine(String.format("JobRegex is " + useJobRegex)); if(useJobRegex) { final List<List<String>> blacklistRegexes = DatadogUtilities.regexJoblistStringtoList( DatadogUtilities.getBlacklist() ); for(List<String> regexPatternAndTags: blacklistRegexes) { if(regexPatternAndTags.isEmpty()) { return false; } Pattern p = Pattern.compile(regexPatternAndTags.get(0)); Matcher m = p.matcher(jobName); if(m.matches()) { logger.fine(String.format("We are blacklisted")); return true; } } return false; } else { final List<String> blacklist = DatadogUtilities.joblistStringtoList( DatadogUtilities.getBlacklist() ); return blacklist.contains(jobName.toLowerCase()); } }

Target:
public static boolean isJobBlacklisted(final String jobName) { final List<String> blacklist = DatadogUtilities.joblistStringtoList( DatadogUtilities.getBlacklist() ); return blacklist.contains(jobName.toLowerCase()); }
Source:
public void handleReconnect(ClientDescriptor clientDescriptor, byte[] extendedReconnectData) { if (inflightInvalidations == null) { throw new AssertionError("Load existing was not invoked before handleReconnect"); } if (!connectedClients.replace(clientDescriptor, false, true)) { throw new AssertionError("Client "+ clientDescriptor +" trying to reconnect is not connected to entity"); } ClusterTierReconnectMessage reconnectMessage = reconnectMessageCodec.decode(extendedReconnectData); ServerSideServerStore serverStore = stateService.getStore(storeIdentifier); addInflightInvalidationsForStrongCache(clientDescriptor, reconnectMessage, serverStore); attachStore(clientDescriptor, reconnectMessage.getClientId(), storeIdentifier); LOGGER.info("Client '{}' successfully reconnected to newly promoted ACTIVE after failover.", clientDescriptor); management.clientReconnected(clientDescriptor); }

Target:
public void handleReconnect(ClientDescriptor clientDescriptor, byte[] extendedReconnectData) { if (inflightInvalidations == null) { throw new AssertionError("Load existing was not invoked before handleReconnect"); } if (connectedClients.get(clientDescriptor) == null) { throw new AssertionError("Client "+ clientDescriptor +" trying to reconnect is not connected to entity"); } ClusterTierReconnectMessage reconnectMessage = reconnectMessageCodec.decode(extendedReconnectData); ServerSideServerStore serverStore = stateService.getStore(storeIdentifier); addInflightInvalidationsForStrongCache(clientDescriptor, reconnectMessage, serverStore); attachStore(clientDescriptor, reconnectMessage.getClientId()); LOGGER.info("Client '{}' successfully reconnected to newly promoted ACTIVE after failover.", clientDescriptor); management.clientReconnected(clientDescriptor, connectedClients.get(clientDescriptor)); }
Source:
public IAnswerData getAnswer() { String stringAnswer = binding.barcodeAnswerText.getText().toString(); return stringAnswer.equals("") ? null : new StringData(stringAnswer); }

Target:
public IAnswerData getAnswer() { String answer = binding.barcodeAnswerText.getText().toString(); return answer.isEmpty() ? null : new StringData(answer); }
Source:
public void commit() throws PersistException { if (m_declarations.size() == 0) { return; } try { final String ownerName = m_resource.getOwnerName(); final String absolutePath = getResourceDir(m_resource).getAbsolutePath(); List<RrdDataSource> dataSources = getDataSources(); if (dataSources != null && dataSources.size() > 0) { createRRD(m_rrdStrategy, ownerName, absolutePath, m_rrdName, getRepository().getStep(), dataSources, getRepository().getRraList(), m_metaData); long rrdTime = Boolean.getBoolean("org.opennms.netmgt.collection.persistence.rrd.useCollectionStartTime") ? m_collectionTime : m_timeKeeper.getCurrentTime(); updateRRD(m_rrdStrategy, ownerName, absolutePath, m_rrdName, rrdTime, getValues()); } } catch (FileNotFoundException e) { LoggerFactory.getLogger(getClass()).warn("Could not get resource directory: " + e.getMessage(), e); return; } catch (RrdException e) { throw new PersistException(e); } }

Target:
public void commit() throws PersistException { if (m_declarations.size() == 0) { return; } try { final String ownerName = m_resource.getOwnerName(); final String absolutePath = getResourceDir(m_resource).getAbsolutePath(); List<RrdDataSource> dataSources = getDataSources(); if (dataSources != null && dataSources.size() > 0) { createRRD(m_rrdStrategy, ownerName, absolutePath, m_rrdName, getRepository().getStep(), dataSources, getRepository().getRraList(), m_metaData); updateRRD(m_rrdStrategy, ownerName, absolutePath, m_rrdName, m_timeKeeper.getCurrentTime(), getValues()); } } catch (FileNotFoundException e) { LoggerFactory.getLogger(getClass()).warn("Could not get resource directory: " + e.getMessage(), e); return; } catch (RrdException e) { throw new PersistException(e); } }
Source:
private BundleDescription[] loadBundlesFromSite(IProgressMonitor monitor) { SiteBundle[] siteBundles = site.getBundles(); Map<String, BundleDescription> tmpBundleCache = new HashMap<>(siteBundles.length); for (SiteBundle siteBundle1 : siteBundles) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } SiteBundle siteBundle = siteBundle1; String key = null; if (siteBundle.getBundleIdentifier() != null && siteBundle.getBundleVersion() != null) { key = siteBundle.getBundleIdentifier() + VERSION_SEPARATOR + siteBundle.getBundleVersion(); if (tmpBundleCache.containsKey(key)) continue; } URI bundleURI = getSiteBundleURI(siteBundle); BundleDescription bundle = parseBundleDescription(bundleURI, monitor); if (bundle == null) { LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.ErrorReadingBundle, bundleURI))); } else { if (key == null) { siteBundle.setBundleIdentifier(bundle.getSymbolicName()); siteBundle.setBundleVersion(bundle.getVersion().toString()); key = siteBundle.getBundleIdentifier() + VERSION_SEPARATOR + siteBundle.getBundleVersion().toString(); } tmpBundleCache.put(key, bundle); } } bundleCache = tmpBundleCache; return bundleCache.values().toArray(new BundleDescription[bundleCache.size()]); }

Target:
private BundleDescription[] loadBundlesFromSite(IProgressMonitor monitor) { SiteBundle[] siteBundles = site.getBundles(); Map<String, BundleDescription> tmpBundleCache = new HashMap<>(siteBundles.length); for (SiteBundle siteBundle : siteBundles) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } String key = null; if (siteBundle.getBundleIdentifier() != null && siteBundle.getBundleVersion() != null) { key = siteBundle.getBundleIdentifier() + VERSION_SEPARATOR + siteBundle.getBundleVersion(); if (tmpBundleCache.containsKey(key)) continue; } URI bundleURI = getSiteBundleURI(siteBundle); BundleDescription bundle = parseBundleDescription(bundleURI, monitor); if (bundle == null) { LogHelper .log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.ErrorReadingBundle, bundleURI))); } else { if (key == null) { siteBundle.setBundleIdentifier(bundle.getSymbolicName()); siteBundle.setBundleVersion(bundle.getVersion().toString()); key = siteBundle.getBundleIdentifier() + VERSION_SEPARATOR + siteBundle.getBundleVersion().toString(); } tmpBundleCache.put(key, bundle); } } bundleCache = tmpBundleCache; return bundleCache.values().toArray(new BundleDescription[bundleCache.size()]); }
Source:
public BugzillaRestConfiguration getRepositoryConfiguration(TaskRepository repository) throws CoreException { if (clientCache.getIfPresent(repository.getId()) == null) { getClient(repository); } try { return configurationCache.get(repository.getId()); } catch (UncheckedExecutionException e) { if (!e.getMessage().startsWith( "com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } } catch (ExecutionException e) { if (!e.getMessage().startsWith("CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } } return null; }

Target:
public BugzillaRestConfiguration getRepositoryConfiguration(TaskRepository repository) throws CoreException { if (clientCache.getIfPresent(repository.getId()) == null) { getClient(repository); } try { return configurationCache.get(repository.getId()); } catch (UncheckedExecutionException e) { if (!e.getMessage().startsWith( "com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } else { return null; } } catch (ExecutionException e) { if (!e.getMessage().startsWith("CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } } return null; }
Source:
public void onBindViewHolder(SurahAudioManager.SurahViewHolder holder, int position) { holder.name.setText((position+1) + ""); QariDownloadInfo info = getSheikhInfoForPosition(sheikhPosition); if(info == null) { return; } boolean fullyDownloaded = info.downloadedSuras.get(position + 1); holder.quantity.setText(fullyDownloaded? "Downloaded" : "Not downloaded"); }

Target:
public void onBindViewHolder(SurahAudioManager.SurahViewHolder holder, int position) { holder.name.setText(quranInfo.getSuraName(context, position+1, true)); int surahStatus, surahStatusImage; if(isItemFullyDownloaded(position)) { surahStatus = R.string.audio_manager_surah_delete; surahStatusImage = R.drawable.ic_cancel; } else { surahStatus = R.string.audio_manager_surah_download; surahStatusImage = R.drawable.ic_download; } holder.status.setText(getString(surahStatus)); holder.image.setImageResource(surahStatusImage); holder.setChecked(isItemChecked(position)); }
Source:
public Collection<Device> get( @QueryParam("all") boolean all, @QueryParam("userId") long userId, @QueryParam("uniqueId") List<String> uniqueIds, @QueryParam("id") List<Long> deviceIds) throws SQLException { if (all) { if (Context.getPermissionsManager().isAdmin(getUserId())) { return Context.getDeviceManager().getAllDevices(); } else { Context.getPermissionsManager().checkManager(getUserId()); return Context.getDeviceManager().getManagedDevices(getUserId()); } } if (uniqueIds.isEmpty() && deviceIds.isEmpty()) { if (userId == 0) { userId = getUserId(); } Context.getPermissionsManager().checkUser(getUserId(), userId); return Context.getDeviceManager().getDevices(userId); } ArrayList<Device> devices = new ArrayList<>(); if (!uniqueIds.isEmpty()) { for (String uniqueId : uniqueIds) { Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); devices.add(device); } } if (!deviceIds.isEmpty()) { for (Long deviceId : deviceIds) { Context.getPermissionsManager().checkDevice(getUserId(), deviceId); devices.add(Context.getDeviceManager().getDeviceById(deviceId)); } } return devices; }

Target:
public Collection<Device> get( @QueryParam("all") boolean all, @QueryParam("userId") long userId, @QueryParam("uniqueId") List<String> uniqueIds, @QueryParam("id") List<Long> deviceIds) throws SQLException { if (all) { if (Context.getPermissionsManager().isAdmin(getUserId())) { return Context.getDeviceManager().getAllDevices(); } else { Context.getPermissionsManager().checkManager(getUserId()); return Context.getDeviceManager().getManagedDevices(getUserId()); } } if (uniqueIds.isEmpty() && deviceIds.isEmpty()) { if (userId == 0) { userId = getUserId(); } Context.getPermissionsManager().checkUser(getUserId(), userId); return Context.getDeviceManager().getDevices(userId); } ArrayList<Device> devices = new ArrayList<>(); for (String uniqueId : uniqueIds) { Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); devices.add(device); } for (Long deviceId : deviceIds) { Context.getPermissionsManager().checkDevice(getUserId(), deviceId); devices.add(Context.getDeviceManager().getDeviceById(deviceId)); } return devices; }
Source:
public List<QuotaCreditsVO> findCredits(final long accountId, final long domainId, final Date startDate, final Date endDate) { final short opendb = TransactionLegacy.currentTxn().getDatabaseId(); List<QuotaCreditsVO> qc = new ArrayList<>(); try { TransactionLegacy.open(TransactionLegacy.USAGE_DB); Filter filter = new Filter(QuotaCreditsVO.class, "updatedOn", true, 0L, Long.MAX_VALUE); SearchCriteria<QuotaCreditsVO> sc = createSearchCriteria(); sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); if ((startDate != null) && (endDate != null) && startDate.before(endDate)) { sc.addAnd("updatedOn", SearchCriteria.Op.BETWEEN, startDate, endDate); } else { return new ArrayList<QuotaCreditsVO>(); } qc = search(sc, filter); } catch (Exception e) { s_logger.error("QuotaCreditsDaoImpl::findCredits() failed due to: " + e.getMessage()); throw new CloudRuntimeException("Unable to find quota credits"); } finally { TransactionLegacy.open(opendb).close(); } return qc; }

Target:
public List<QuotaCreditsVO> findCredits(final long accountId, final long domainId, final Date startDate, final Date endDate) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaCreditsVO>>() { @Override public List<QuotaCreditsVO> doInTransaction(final TransactionStatus status) { if ((startDate != null) && (endDate != null) && startDate.before(endDate)) { Filter filter = new Filter(QuotaCreditsVO.class, "updatedOn", true, 0L, Long.MAX_VALUE); QueryBuilder<QuotaCreditsVO> qb = QueryBuilder.create(QuotaCreditsVO.class); qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId); qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId); qb.and(qb.entity().getUpdatedOn(), SearchCriteria.Op.BETWEEN, startDate, endDate); return search(qb.create(), filter); } else { return Collections.<QuotaCreditsVO> emptyList(); } } }); }
Source:
protected Supplier<String> internalGetAttribute(String attr) { if ("type".equals(attr)) { return () -> attributeType; } return super.internalGetAttribute(attr); }

Target:
protected Supplier<String> internalGetAttribute(String attr) { if ("type".equals(attr)) { return () -> attributeType != null ? attributeType : ""; } return super.internalGetAttribute(attr); }
Source:
public PagedFluxBase(Supplier<Mono<P>> firstPageRetriever, Function<String, Mono<P>> nextPageRetriever) { Objects.requireNonNull(firstPageRetriever, "First page supplier cannot be null."); Objects.requireNonNull(nextPageRetriever, "Next page retriever function cannot be null."); this.firstPageRetriever = firstPageRetriever; this.nextPageRetriever = nextPageRetriever; }

Target:
public PagedFluxBase(Supplier<Mono<P>> firstPageRetriever, Function<String, Mono<P>> nextPageRetriever) { Objects.requireNonNull(firstPageRetriever, "'firstPageRetriever' cannot be null."); Objects.requireNonNull(nextPageRetriever, "'nextPageRetriever' function cannot be null."); this.firstPageRetriever = firstPageRetriever; this.nextPageRetriever = nextPageRetriever; }
Source:
public GroupBySubscriber( Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends R> elementSelector, Subscriber<? super GroupedObservable<K, R>> child) { super(); this.keySelector = keySelector; this.elementSelector = elementSelector; this.child = child; child.add(Subscriptions.create(new Action0() { @Override public void call() { if (groups.isEmpty()) { parentSubscription.unsubscribe(); } } })); }

Target:
public GroupBySubscriber( Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends R> elementSelector, Subscriber<? super GroupedObservable<K, R>> child) { super(); this.keySelector = keySelector; this.elementSelector = elementSelector; this.child = child; child.add(Subscriptions.create(new Action0() { @Override public void call() { if (WIP_FOR_UNSUBSCRIBE_UPDATER.decrementAndGet(self) == 0) { self.unsubscribe(); } } })); }
Source:
public static Class<?> loadClass(ClassLoader classLoader, String className) { try { if (classLoader != null) { return Class.forName(className, true, classLoader); } else { return Class.forName(className); } } catch (ClassNotFoundException e) { return null; } }

Target:
public static Class<?> loadClass(ClassLoader classLoader, String className) { try { ClassLoader cl = classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader(); if (cl != null) { return Class.forName(className, true, cl); } else { return Class.forName(className); } } catch (ClassNotFoundException e) { return null; } }
Source:
public String nextAvailableColumn(Field field) throws DotDataException { DotConnect dc = new DotConnect(); if (field instanceof HostFolderField || field instanceof TagField) { dc.setSQL(this.sql.selectCountOfType); dc.addParam(field.contentTypeId()); dc.addParam(LegacyFieldTypes.getLegacyName(field.type() + "%")); dc.addParam(LegacyFieldTypes.getImplClass(field.type() + "%")); int x = dc.getInt("test"); if (x > 0) { throw new OverFieldLimitException("Only one " + field.type() + " per ContentType"); } } if (field.dataType() == DataTypes.SYSTEM) { return field.dataType().toString(); } String dbColumn = field.dbColumn().replaceAll("[0-9]", ""); dc.setSQL(this.sql.selectFieldOfDbType); dc.addParam(field.contentTypeId()); dc.addParam(dbColumn + "%"); List<Map<String, Object>> rows = dc.loadObjectResults(); Set<String> columns = new TreeSet<String>(); for (int i = 0; i < rows.size(); i++) { columns.add((String) rows.get(i).get("field_contentlet")); } for (int i = 0; i < Config.getIntProperty("db.number.of.contentlet.columns.per.datatype", 25); i++) { if (!columns.contains(dbColumn + (i + 1))) { return dbColumn + (i + 1); } } throw new OverFieldLimitException("No more columns for datatype:" + dbColumn); }

Target:
public String nextAvailableColumn(Field field) throws DotDataException { DotConnect dc = new DotConnect(); if (field instanceof HostFolderField || field instanceof TagField) { dc.setSQL(this.sql.selectCountOfType); dc.addParam(field.contentTypeId()); dc.addParam(LegacyFieldTypes.getLegacyName(field.type() + "%")); dc.addParam(LegacyFieldTypes.getImplClass(field.type() + "%")); int x = dc.getInt("test"); if (x > 0) { throw new OverFieldLimitException("Only one " + field.type() + " per ContentType"); } } if (field.dataType() == DataTypes.SYSTEM) { return field.dataType().toString(); } final String dbColumn = field.dbColumn().replaceAll("[0-9]", com.dotcms.repackage.org.apache.commons.lang.StringUtils.EMPTY); dc.setSQL(this.sql.selectFieldOfDbType); dc.addParam(field.contentTypeId()); dc.addParam(dbColumn + "%"); List<Map<String, Object>> rows = dc.loadObjectResults(); Set<String> columns = new TreeSet<String>(); for (int i = 0; i < rows.size(); i++) { columns.add((String) rows.get(i).get("field_contentlet")); } for (int i = 0; i < Config.getIntProperty("db.number.of.contentlet.columns.per.datatype", 25); i++) { if (!columns.contains(dbColumn + (i + 1))) { return dbColumn + (i + 1); } } throw new OverFieldLimitException("No more columns for datatype:" + dbColumn); }
Source:
private Object deserialize(ByteArrayInputStream inputStream, Deserializer<Object> deserializer) throws IOException { ClassLoader classLoader = null; try { classLoader = (ClassLoader) new DirectFieldAccessor(deserializer).getPropertyValue("classLoader"); } catch (Exception e) { } try { ObjectInputStream objectInputStream = new ConfigurableObjectInputStream(inputStream, classLoader) { @Override protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { Class<?> clazz = super.resolveClass(classDesc); checkWhiteList(clazz); return clazz; } }; return objectInputStream.readObject(); } catch (ClassNotFoundException ex) { throw new NestedIOException("Failed to deserialize object type", ex); } }

Target:
private Object deserialize(ByteArrayInputStream inputStream, Deserializer<Object> deserializer) throws IOException { try { ObjectInputStream objectInputStream = new ConfigurableObjectInputStream(inputStream, this.defaultDeserializerClassLoader) { @Override protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { Class<?> clazz = super.resolveClass(classDesc); checkWhiteList(clazz); return clazz; } }; return objectInputStream.readObject(); } catch (ClassNotFoundException ex) { throw new NestedIOException("Failed to deserialize object type", ex); } }
Source:
public ASTNode visit(MapBuiltin map, Void _) { Map result = new Map(); for (java.util.Map.Entry<Term, Term> entry : map.elements().entrySet()) { result.add(new MapItem((Term)this.visitNode(entry.getKey()), (Term)this.visitNode(entry.getValue()))); } Collections.sort(result.getContents(), unparserLexicalComparator); if (map.hasViewBase()) { result.add((Term)this.visitNode(map.viewBase())); } return result; }

Target:
public ASTNode visit(MapBuiltin map, Void _) { Map result = new Map(); for (java.util.Map.Entry<Term, Term> entry : map.elements().entrySet()) { result.add(new MapItem((Term)this.visitNode(entry.getKey()), (Term)this.visitNode(entry.getValue()))); } Collections.sort(result.getContents(), unparserLexicalComparator); for (Term base : map.baseTerms()) { result.add((Term)this.visitNode(base)); } return result; }
Source:
public int hashCode() { int h = parent == null ? 0 : parent.hashCode(); for (char c : label) { h = 31 * h + c; } assert toString().hashCode() == h; return h; }

Target:
public int hashCode() { int h = parent == null ? 0 : parent.hashCode(); h = 31 * h + ArrayUtils.hashCode(label); assert toString().hashCode() == h; return h; }
Source:
public static Type extractConstraintValidatorTypeArgumentType(Class<? extends ConstraintValidator<?, ?>> validator, int typeArgumentIndex) { Map<Type, Type> resolvedTypes = new HashMap<>(); Type constraintValidatorType = resolveTypes( resolvedTypes, validator ); Type constraintType = ( (ParameterizedType) constraintValidatorType ).getActualTypeArguments()[typeArgumentIndex]; if ( constraintType == null ) { throw LOG.getNullIsAnInvalidTypeForAConstraintValidatorException(); } else if ( constraintType instanceof GenericArrayType ) { constraintType = TypeHelper.getArrayType( TypeHelper.getComponentType( constraintType ) ); } while ( resolvedTypes.containsKey( constraintType ) ) { constraintType = resolvedTypes.get( constraintType ); } return constraintType; }

Target:
public static Type extractConstraintValidatorTypeArgumentType(Class<? extends ConstraintValidator<?, ?>> validator, int typeArgumentIndex) { Map<Type, Type> resolvedTypes = new HashMap<>(); Type constraintValidatorType = resolveTypes( resolvedTypes, validator ); Type type = ( (ParameterizedType) constraintValidatorType ).getActualTypeArguments()[typeArgumentIndex]; if ( type == null ) { throw LOG.getNullIsAnInvalidTypeForAConstraintValidatorException(); } else if ( type instanceof GenericArrayType ) { type = TypeHelper.getArrayType( TypeHelper.getComponentType( type ) ); } while ( resolvedTypes.containsKey( type ) ) { type = resolvedTypes.get( type ); } return type; }
Source:
private boolean verifyDisksIfNeeded() { boolean verified = true; if (!getParameters().isImportAsNewEntity() && !isImagesAlreadyOnTarget()) { verified = checkIfDisksExist(imageList); } return verified; }

Target:
private boolean verifyDisksIfNeeded() { if (!getParameters().isImportAsNewEntity() && !isImagesAlreadyOnTarget()) { return checkIfDisksExist(imageList); } return true; }
Source:
public int compareTo(TemplateBundle other) { if(other == null) { return -1; } if (this.getBundleId().equals((long) FRAMEWORK_BUNDLE_ID)) { return Integer.MIN_VALUE; } else if (other.getBundleId().equals((long) FRAMEWORK_BUNDLE_ID)) { return Integer.MAX_VALUE; } int compare = this.getName().compareToIgnoreCase(other.getName()); if (compare == 0) { return other.getVersion().compareTo(this.getVersion()); } return compare; }

Target:
public int compareTo(TemplateBundle other) { if(other == null) { return -1; } if (this.getBundleId().equals((long) FRAMEWORK_BUNDLE_ID)) { return Integer.MIN_VALUE; } else if (other.getBundleId().equals((long) FRAMEWORK_BUNDLE_ID)) { return Integer.MAX_VALUE; } int compare = this.getName().compareToIgnoreCase(other.getName()); if (compare == 0) { return this.getVersion().compareTo(other.getVersion()); } return compare; }
Source:
public IManager start() { File metadata = new File(getStorageFolder(), METAFILE); if (metadata.exists()) { Collection<FilestoreModel> items = null; Gson gson = gson(); try { FileReader file = new FileReader(metadata); items = gson.fromJson(file, METAFILE_TYPE); file.close(); } catch (IOException e) { e.printStackTrace(); } for(Iterator<FilestoreModel> itr = items.iterator(); itr.hasNext(); ) { FilestoreModel model = itr.next(); fileCache.put(model.oid, model); } logger.info("Loaded items from filestore metadata file", fileCache.size()); } else { logger.info("No filestore metadata file found"); } return this; }

Target:
public IManager start() { File metadata = new File(getStorageFolder(), METAFILE); if (metadata.exists()) { Collection<FilestoreModel> items = null; Gson gson = gson(); try (FileReader file = new FileReader(metadata)) { items = gson.fromJson(file, METAFILE_TYPE); file.close(); } catch (IOException e) { e.printStackTrace(); } for(Iterator<FilestoreModel> itr = items.iterator(); itr.hasNext(); ) { FilestoreModel model = itr.next(); fileCache.put(model.oid, model); } logger.info("Loaded items from filestore metadata file", fileCache.size()); } else { logger.info("No filestore metadata file found"); } return this; }
Source:
public Theme getTheme(String blogId, String themeId) { String[] columns = {COLUMN_NAME_ID, Theme.ID, Theme.AUTHOR, Theme.SCREENSHOT, Theme.AUTHOR_URI, Theme.DEMO_URI, Theme.NAME, Theme.STYLESHEET, Theme.PRICE}; String[] selection = {blogId, themeId}; Cursor cursor = db.query(THEMES_TABLE, columns, Theme.BLOG_ID + "=? AND " + Theme.ID + " id=?", selection, null, null, null); if (cursor.moveToFirst()) { String id = cursor.getString(0); String author = cursor.getString(1); String screenshot = cursor.getString(2); String authorURI = cursor.getString(3); String demoURI = cursor.getString(4); String name = cursor.getString(5); String stylesheet = cursor.getString(6); String price = cursor.getString(7); boolean isCurrent = cursor.getInt(8) > 0; Theme theme = new Theme(id, author, screenshot, authorURI, demoURI, name, stylesheet, price, blogId, isCurrent); cursor.close(); return theme; } else { cursor.close(); return null; } }

Target:
public Theme getTheme(String blogId, String themeId) { String[] columns = {COLUMN_NAME_ID, Theme.ID, Theme.AUTHOR, Theme.SCREENSHOT, Theme.AUTHOR_URI, Theme.DEMO_URI, Theme.NAME, Theme.STYLESHEET, Theme.PRICE}; String[] selection = {blogId, themeId}; Cursor cursor = db.query(THEMES_TABLE, columns, Theme.BLOG_ID + "=? AND " + Theme.ID + " id=?", selection, null, null, null); if (cursor.moveToFirst()) { String id = cursor.getString(cursor.getColumnIndex(Theme.ID)); String author = cursor.getString(cursor.getColumnIndex(Theme.AUTHOR)); String screenshot = cursor.getString(cursor.getColumnIndex(Theme.SCREENSHOT)); String authorURI = cursor.getString(cursor.getColumnIndex(Theme.AUTHOR_URI)); String demoURI = cursor.getString(cursor.getColumnIndex(Theme.DEMO_URI)); String name = cursor.getString(cursor.getColumnIndex(Theme.NAME)); String stylesheet = cursor.getString(cursor.getColumnIndex(Theme.STYLESHEET)); String price = cursor.getString(cursor.getColumnIndex(Theme.PRICE)); boolean isCurrent = cursor.getInt(cursor.getColumnIndex(Theme.IS_CURRENT)) > 0; Theme theme = new Theme(id, author, screenshot, authorURI, demoURI, name, stylesheet, price, blogId, isCurrent); cursor.close(); return theme; } else { cursor.close(); return null; } }
Source:
private void handleWrite(WriteEvent event) { out.println(); out.println(STEP_SCENARIO_INDENT + event.text); out.println(); }

Target:
private void handleWrite(WriteEvent event) { out.println(); try(BufferedReader lines = new BufferedReader(new StringReader(event.text))) { String line; while ((line = lines.readLine()) != null) { out.println(STEP_SCENARIO_INDENT + line); } } catch (IOException e) { throw new CucumberException(e); } out.println(); }
Source:
private String getPackageFileType() throws MojoFailureException { if (packageType != null && packageType.equals("jar")) { if (include == null || include.equals("all") || include.equals("minify")) { return ".jar"; } else { throw new MojoFailureException("The jar packageType requires `all` or `minify` in the `include` parameter"); } } else { if (packageType != null && !packageType.equals("zip")) { log.info(packageType + " not supported. Defaulting to 'zip'"); } if (include.contains("runnable")) { if (packageType != null && packageType.equals("zip")) { throw new MojoFailureException("The `include` parameter `runnable` cannot be used with the `zip` packageType"); } log.warn("The `runnable` value for the include parameter is deprecated. Use packageType `jar` instead."); packageType = "jar"; return ".jar"; } packageType = "zip"; return ".zip"; } }

Target:
private String getPackageFileType() throws MojoFailureException { if (packageType != null && packageType.equals("jar")) { if (include == null || include.equals("all") || include.equals("minify")) { return ".jar"; } else { throw new MojoFailureException("The jar packageType requires `all` or `minify` in the `include` parameter"); } } else { if (packageType != null && !packageType.equals("zip")) { log.info(packageType + " not supported. Defaulting to 'zip'"); } if (include != null && include.contains("runnable")) { if (packageType != null && packageType.equals("zip")) { throw new MojoFailureException("The `include` parameter `runnable` cannot be used with the `zip` packageType"); } log.warn("The `runnable` value for the include parameter is deprecated. Use packageType `jar` instead."); packageType = "jar"; return ".jar"; } packageType = "zip"; return ".zip"; } }
Source:
private String validateTableNameArgument(ByteBuffer tableNameArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String tableName = tableNameArg == null ? null : ByteBufferUtil.toString(tableNameArg); if ((tableName != null) && (tableName.length() > MAX_TABLE_NAME_LEN)) { log.warn( "Table names greater than 1024 characters should be renamed to conform to a 1024 character limit. " + "Longer table names are no longer supported and may result in unexpected behavior."); } return _validateArgument(tableName, op, VALID_NAME.and(userValidator)); }

Target:
private String validateTableNameArgument(ByteBuffer tableNameArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String tableName = tableNameArg == null ? null : ByteBufferUtil.toString(tableNameArg); if ((tableName != null) && (tableName.length() > MAX_TABLE_NAME_LEN)) { log.warn("Table names greater than " + MAX_TABLE_NAME_LEN + " characters should be renamed to conform to a " + MAX_TABLE_NAME_LEN + " character limit. Longer table names are no longer supported and may result in " + " unexpected behavior."); } return _validateArgument(tableName, op, VALID_NAME.and(userValidator)); }
Source:
private synchronized void handleNi(GpsNiNotification notif) { if (DEBUG) Log.d(TAG, "entering handleNi(GpsNiNotification notif)"); if (notif.needNotify) { if (DEBUG) Log.d(TAG, "notif.needNotify is true"); if (notif.needVerify && mPopupImmediately) { if (DEBUG) Log.d(TAG, "calling openNiDialog(notif)"); openNiDialog(notif); } else { if (DEBUG) Log.d(TAG, "calling setNiNotification(notif)"); setNiNotification(notif); } } if (!notif.needVerify || notif.privacyOverride) { if (DEBUG) Log.d(TAG, "!notif.needVerify || notif.privacyOverride is true"); try { if (DEBUG) Log.d(TAG, "sending GPS_NI_RESPONSE_ACCEPT"); mNetInitiatedListener.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_ACCEPT); } catch (RemoteException e) { Slog.e(TAG, "RemoteException in sendNiResponse"); } } if (DEBUG) Log.d(TAG, "leaving handleNi(GpsNiNotification notif)"); }

Target:
private void handleNi(GpsNiNotification notif) { if (DEBUG) Log.d(TAG, "in handleNi () :" + " needNotify: " + notif.needNotify + " needVerify: " + notif.needVerify + " privacyOverride: " + notif.privacyOverride + " mPopupImmediately: " + mPopupImmediately); if (notif.needNotify) { if (notif.needVerify && mPopupImmediately) { openNiDialog(notif); } else { setNiNotification(notif); } } if (!notif.needVerify || notif.privacyOverride) { try { mNetInitiatedListener.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_ACCEPT); } catch (RemoteException e) { Log.e(TAG, "RemoteException in sendNiResponse"); } } }