auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_main, container, false); unbinder = ButterKnife.bind(this, view); disposables.add(WikipediaApp.getInstance().getBus().subscribe(new EventBusConsumer())); viewPager.setUserInputEnabled(false); viewPager.setAdapter(new NavTabFragmentPagerAdapter(this)); viewPager.registerOnPageChangeCallback(pageChangeCallback); FeedbackUtil.setButtonLongPressToast(moreContainer); tabLayout.setOnNavigationItemSelectedListener(item -> { if (getCurrentFragment() instanceof FeedFragment && item.getOrder() == 0) { ((FeedFragment) getCurrentFragment()).scrollToTop(); } viewPager.setCurrentItem(item.getOrder(), false); return true; }); if (!(getCurrentFragment() instanceof SuggestedEditsTasksFragment)) { maybeShowEditsTooltip(); } if (savedInstanceState == null) { handleIntent(requireActivity().getIntent()); } return view; }

Target:
@Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_main, container, false); unbinder = ButterKnife.bind(this, view); disposables.add(WikipediaApp.getInstance().getBus().subscribe(new EventBusConsumer())); viewPager.setUserInputEnabled(false); viewPager.setAdapter(new NavTabFragmentPagerAdapter(this)); viewPager.registerOnPageChangeCallback(pageChangeCallback); FeedbackUtil.setButtonLongPressToast(moreContainer); tabLayout.setOnNavigationItemSelectedListener(item -> { if (getCurrentFragment() instanceof FeedFragment && item.getOrder() == 0) { ((FeedFragment) getCurrentFragment()).scrollToTop(); } if (getCurrentFragment() instanceof HistoryFragment && item.getOrder() == NavTab.SEARCH.code()) { openSearchActivity(NAV_MENU, null); return true; } viewPager.setCurrentItem(item.getOrder(), false); return true; }); maybeShowEditsTooltip(); if (savedInstanceState == null) { handleIntent(requireActivity().getIntent()); } return view; }
Source:
public void run() { try { logger.trace("Processing document"); process(doc); } catch (Exception e) { exception = e; } finally { completed = true; } }

Target:
public void run() { try { logger.trace("Processing document"); process(doc); } catch (Exception e) { logger.trace("Caught exception during processing", e); exception = e; } finally { running = false; } }
Source:
public List<DeviceModelFirmware> findAllDeviceModelFirmwares(final String organisationIdentification, final String manufacturer, final String modelCode) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.GET_DEVICE_MODEL_FIRMWARE); final Manufacturer databaseManufacturer = this.manufacturerRepository.findByManufacturerId(manufacturer); final DeviceModel databaseDeviceModel = this.deviceModelRepository.findByManufacturerIdAndModelCode(databaseManufacturer, modelCode); final List<DeviceModelFirmware> deviceModelFirmwares = this.deviceModelFirmwareRepository.findByDeviceModel(databaseDeviceModel); for (final DeviceModelFirmware deviceModelFirmware : deviceModelFirmwares) { if (deviceModelFirmware.getFile() != null) { deviceModelFirmware.setFile(null); } } return deviceModelFirmwares; }

Target:
public List<DeviceModelFirmware> findAllDeviceModelFirmwares(final String organisationIdentification, final String manufacturer, final String modelCode) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.GET_DEVICE_MODEL_FIRMWARE); final Manufacturer databaseManufacturer = this.manufacturerRepository.findByManufacturerId(manufacturer); final DeviceModel databaseDeviceModel = this.deviceModelRepository.findByManufacturerIdAndModelCode(databaseManufacturer, modelCode); final List<DeviceModelFirmware> deviceModelFirmwares = this.deviceModelFirmwareRepository.findByDeviceModel(databaseDeviceModel); for (final DeviceModelFirmware deviceModelFirmware : deviceModelFirmwares) { deviceModelFirmware.setFile(null); } return deviceModelFirmwares; }
Source:
public Binding<MessageChannel> bindProducer(String name, MessageChannel outboundBindTarget, ProducerProperties properties) { SubscribableChannel functionOutputChannel = BinderFunctionSupport.andThenFunctionDefinition( this.integrationFlowFunctionSupport, outboundBindTarget); final BlockingQueue<Message<?>> queue = messageCollector.register(outboundBindTarget, properties.isUseNativeEncoding()); (functionOutputChannel).subscribe(message -> queue.add(message)); this.messageChannels.put(name, outboundBindTarget); return new TestBinding(outboundBindTarget, messageCollector); }

Target:
public Binding<MessageChannel> bindProducer(String name, MessageChannel outboundBindTarget, ProducerProperties properties) { final BlockingQueue<Message<?>> queue = messageCollector.register(outboundBindTarget, properties.isUseNativeEncoding()); ((SubscribableChannel) outboundBindTarget).subscribe(new MessageHandler() { @Override public void handleMessage(Message<?> message) throws MessagingException { queue.add(message); } }); this.messageChannels.put(name, outboundBindTarget); return new TestBinding(outboundBindTarget, messageCollector); }
Source:
private void addHash(long hash) { instance.insertHash(hash); if (instance instanceof SparseHll && instance.estimatedInMemorySize() > DenseHll.estimatedInMemorySize(instance.getIndexBitLength())) { instance = ((SparseHll) instance).toDense(); } }

Target:
private void addHash(long hash) { instance.insertHash(hash); if (instance instanceof SparseHll) { instance = makeDenseIfNecessary((SparseHll) instance); } }
Source:
public long getStartTimeAsLong() { return startTime.atZone(ZoneId.systemDefault()).toEpochSecond(); }

Target:
public Long getStartTimeAsLong() { return (startTime == null) ? null : startTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_content_simple); String timeFormat; if (android.text.format.DateFormat.is24HourFormat(this)) { timeFormat = "EEEE HH:mm"; } else { timeFormat = "EEEE hh:mm a"; } mTimeAndDayFormatter = new SimpleDateFormat(timeFormat, Locale.getDefault()); mTimeFormatter = android.text.format.DateFormat.getTimeFormat(this); mRes = getResources(); getListView().setFastScrollEnabled(true); getListView().setItemsCanFocus(false); getListView().setChoiceMode(ListView.CHOICE_MODE_NONE); Intent intent = getIntent(); String accountUuid = intent.getStringExtra(ChooseFolder.EXTRA_ACCOUNT); mAccount = Preferences.getPreferences(this).getAccount(accountUuid); mMessageReference = intent.getParcelableExtra(ChooseFolder.EXTRA_MESSAGE); mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1); mAdapter.addAll(getTimes()); setListAdapter(mAdapter); getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { SnoozeTime time = mAdapter.getItem(position); if (time.timestamp <= 0) { showDateTimePicker(new OnDateTimePickedListener() { @Override public void onDateTimePicked(long timestamp) { finishWithResult(timestamp); } }); return; } finishWithResult(time.timestamp); } }); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_content_simple); initFormatters(); mRes = getResources(); getListView().setFastScrollEnabled(true); getListView().setItemsCanFocus(false); getListView().setChoiceMode(ListView.CHOICE_MODE_NONE); Intent intent = getIntent(); String accountUuid = intent.getStringExtra(ChooseFolder.EXTRA_ACCOUNT); mAccount = Preferences.getPreferences(this).getAccount(accountUuid); mMessageReference = intent.getParcelableExtra(ChooseFolder.EXTRA_MESSAGE); mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1); mAdapter.addAll(getTimes()); setListAdapter(mAdapter); getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { SnoozeTime time = mAdapter.getItem(position); if (time.timestamp == SNOOZE_TIMESTAMP_CHOOSE_CUSTOM_TIME) { chooseCustomTimeFromPicker(); return; } finishWithResult(time.timestamp); } }); }
Source:
private Guid createDisk(DiskImage image, boolean isBoot) { image.setDiskAlias(renameDiskAlias(getVm().getOrigin(), image.getDiskAlias())); image.setVolumeFormat(VolumeFormat.COW); AddDiskParameters diskParameters = new AddDiskParameters(new DiskVmElement(null, getVmId()), image); diskParameters.setStorageDomainId(getStorageDomainId()); diskParameters.setParentCommand(getActionType()); diskParameters.setParentParameters(getParameters()); diskParameters.setShouldRemainIllegalOnFailedExecution(true); diskParameters.setStorageDomainId(getParameters().getDestDomainId()); DiskVmElement dve = new DiskVmElement(image.getId(), getVmId()); dve.setDiskInterface(DiskInterface.VirtIO); dve.setBoot(isBoot); diskParameters.setDiskVmElement(dve); VdcReturnValueBase vdcReturnValueBase = runInternalActionWithTasksContext(VdcActionType.AddDisk, diskParameters); if (!vdcReturnValueBase.getSucceeded()) { throw new EngineException(vdcReturnValueBase.getFault().getError(), "Failed to create disk!"); } getTaskIdList().addAll(vdcReturnValueBase.getInternalVdsmTaskIdList()); return vdcReturnValueBase.getActionReturnValue(); }

Target:
private Guid createDisk(DiskImage image, boolean isBoot) { image.setDiskAlias(renameDiskAlias(getVm().getOrigin(), image.getDiskAlias())); AddDiskParameters diskParameters = new AddDiskParameters(new DiskVmElement(null, getVmId()), image); diskParameters.setStorageDomainId(getStorageDomainId()); diskParameters.setParentCommand(getActionType()); diskParameters.setParentParameters(getParameters()); diskParameters.setShouldRemainIllegalOnFailedExecution(true); diskParameters.setStorageDomainId(getParameters().getDestDomainId()); DiskVmElement dve = new DiskVmElement(image.getId(), getVmId()); dve.setDiskInterface(DiskInterface.VirtIO); dve.setBoot(isBoot); diskParameters.setDiskVmElement(dve); VdcReturnValueBase vdcReturnValueBase = runInternalActionWithTasksContext(VdcActionType.AddDisk, diskParameters); if (!vdcReturnValueBase.getSucceeded()) { throw new EngineException(vdcReturnValueBase.getFault().getError(), "Failed to create disk!"); } getTaskIdList().addAll(vdcReturnValueBase.getInternalVdsmTaskIdList()); return vdcReturnValueBase.getActionReturnValue(); }
Source:
protected boolean allowPausedModeWork(boolean internalCall, boolean adminConnection) { return (VoltDB.instance().getMode() != OperationMode.PAUSED || internalCall || adminConnection); }

Target:
static protected boolean allowPausedModeWork(boolean internalCall, boolean adminConnection) { return (VoltDB.instance().getMode() != OperationMode.PAUSED || internalCall || adminConnection); }
Source:
public IonValue[] toArray() { checkForParentModification(); if (size < 1) return EMPTY_VALUE_ARRAY; IonValue[] array = new IonValue[size]; if(parent instanceof IonSequenceLite) { System.arraycopy(IonSequenceLite.this._children, fromIndex, array, 0, size); } else { for(int i = 0; i < size; i++) { array[i] = get(i); } } return array; }

Target:
public IonValue[] toArray() { checkForParentModification(); if (size < 1) { return EMPTY_VALUE_ARRAY; } return toArray(new IonValue[size]); }
Source:
public int compareTo(Address o) { return 0; }

Target:
public int compareTo(Address o) { return o == this ? 0 : -1; }
Source:
public void testDeactivatingTaskAndSavingAllWithOnlyOneDirtyFile() throws Exception { IEditorPart dirtyFile = activateTaskAndOpenOneFile(); doReturn(0).when(listener).openTaskDeactivationDialog(anyList()); assertTrue(listener.shouldDeactivateTask(task1)); assertFalse(dirtyFile.isDirty()); }

Target:
public void testDeactivatingTaskAndSavingAllWithOnlyOneDirtyFile() throws Exception { IEditorPart dirtyFile = activateTaskAndOnlyEditOneFile(); List<IEditorPart> dirtyParts = new ArrayList<IEditorPart>(); dirtyParts.add(dirtyFile); doReturn(0).when(listener).openTaskDeactivationDialog(anyList()); assertTrue(listener.shouldDeactivateTask(task1)); assertFalse(dirtyFile.isDirty()); verify(listener).openTaskDeactivationDialog( Matchers.argThat(new CompareListOfReferencesWithoutOrder(makeDirtyReferencesFromParts(dirtyParts)))); }
Source:
public static boolean setState(Block block, boolean state, Block source) { if (block.getTypeId() != BlockID.LEVER && block.getTypeId() != BlockID.REDSTONE_TORCH_OFF && block.getTypeId() != BlockID.REDSTONE_TORCH_ON) return false; boolean wasOn; if (block.getTypeId() != BlockID.LEVER) { wasOn = block.getTypeId() == BlockID.REDSTONE_TORCH_ON; if (wasOn == state) { block.setTypeIdAndData( (wasOn ? BlockID.REDSTONE_TORCH_OFF : BlockID.REDSTONE_TORCH_ON), block.getData(), true ); return true; } return false; } Lever lever = (Lever) block.getState().getData(); if (!block.getRelative(lever.getAttachedFace()).equals(source)) { return false; } wasOn = (block.getData() & 0x8) > 0; byte data = block.getData(); int newData; if (!state) { newData = data & 0x7; } else { newData = data | 0x8; } if (wasOn != state) { net.minecraft.server.World w = ((CraftWorld)block.getWorld()).getHandle(); w.setData(block.getX(), block.getY(), block.getZ(), newData); w.b(block.getX(), block.getY(), block.getZ()); w.applyPhysics(block.getX(), block.getY(), block.getZ(), 0); w.applyPhysics(source.getX(), source.getY(), source.getZ(), 0); return true; } return false; }

Target:
public static boolean setState(Block block, boolean state, Block source) { if (block.getTypeId() != BlockID.LEVER) return false; Lever lever = (Lever) block.getState().getData(); if (!block.getRelative(lever.getAttachedFace()).equals(source)) { return false; } boolean wasOn = (block.getData() & 0x8) > 0; byte data = block.getData(); int newData; if (!state) { newData = data & 0x7; } else { newData = data | 0x8; } if (wasOn != state) { block.setData((byte) newData, true); net.minecraft.server.World w = ((CraftWorld)block.getWorld()).getHandle(); w.applyPhysics(source.getX(), source.getY(), source.getZ(), 0); return true; } return false; }
Source:
public UserPrincipalManager(AuthorizationServerEndpoints authorizationServerEndpoints, AADAuthenticationProperties aadAuthenticationProperties, ResourceRetriever resourceRetriever, boolean explicitAudienceCheck) { this.aadAuthenticationProperties = aadAuthenticationProperties; this.explicitAudienceCheck = explicitAudienceCheck; if (explicitAudienceCheck) { this.validAudiences.add(this.aadAuthenticationProperties.getClientId()); this.validAudiences.add(this.aadAuthenticationProperties.getAppIdUri()); } try { String aadKeyDiscoveryUri = authorizationServerEndpoints.jwkSetEndpoint(this.aadAuthenticationProperties.getTenantId()); keySource = new RemoteJWKSet<>(new URL(aadKeyDiscoveryUri), resourceRetriever); } catch (MalformedURLException e) { LOGGER.error("Failed to parse active directory key discovery uri.", e); throw new IllegalArgumentException("Failed to parse active directory key discovery uri.", e); } }

Target:
public UserPrincipalManager(AuthorizationServerEndpoints authorizationServerEndpoints, AADAuthenticationProperties aadAuthenticationProperties, ResourceRetriever resourceRetriever, boolean explicitAudienceCheck) { this.aadAuthenticationProperties = aadAuthenticationProperties; this.explicitAudienceCheck = explicitAudienceCheck; if (explicitAudienceCheck) { this.validAudiences.add(this.aadAuthenticationProperties.getClientId()); this.validAudiences.add(this.aadAuthenticationProperties.getAppIdUri()); } try { String jwkSetEndpoint = authorizationServerEndpoints.jwkSetEndpoint(this.aadAuthenticationProperties.getTenantId()); keySource = new RemoteJWKSet<>(new URL(jwkSetEndpoint), resourceRetriever); } catch (MalformedURLException e) { LOGGER.error("Failed to parse active directory key discovery uri.", e); throw new IllegalArgumentException("Failed to parse active directory key discovery uri.", e); } }
Source:
private String findRequiresCheckoutOptionsColumn() { if (DbConnectionFactory.isMySql()) { return MYSQL_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isOracle()) { return ORACLE_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else { return null; } }

Target:
private String findRequiresCheckoutOptionsColumn() { String sql = null; if (DbConnectionFactory.isMySql()) { sql = MYSQL_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_FIND_REQUIRES_CHECKOUT_OPTION_COLUMN; } return sql; }
Source:
protected void updateUsbNativeMessageVisibility(final UnitVmModel object) { VDSGroup vdsGroup = (VDSGroup) object.getCluster().getSelectedItem(); nativeUsbWarningMessage.setVisible(object.getUsbPolicy().getSelectedItem() == UsbPolicy.ENABLED_NATIVE && vdsGroup != null && vdsGroup.getcompatibility_version() != null && !AppConfig.INSTANCE.getBoolean(ConfigurationValues.MigrationSupportForNativeUsb, vdsGroup.getcompatibility_version().getValue())); }

Target:
protected void updateUsbNativeMessageVisibility(final UnitVmModel object) { VDSGroup vdsGroup = (VDSGroup) object.getCluster().getSelectedItem(); nativeUsbWarningMessage.setVisible(object.getUsbPolicy().getSelectedItem() == UsbPolicy.ENABLED_NATIVE && vdsGroup != null && vdsGroup.getcompatibility_version() != null && !(Boolean) AsyncDataProvider.GetConfigValuePreConverted(ConfigurationValues.MigrationSupportForNativeUsb, vdsGroup.getcompatibility_version().getValue())); }
Source:
private void refreshValues() { try { txtPrincipal.setText(loan.getPrincipal().toAmountAndSymbolString()); lblAPR.setText(loan.getInterestRate() + "%"); lblCollateralPct.setText(loan.getCollateralPercent() + "%"); lblYears.setText(loan.getYears() + " years"); lblSchedule.setText(Finances.getScheduleName(loan.getPaymentSchedule())); lblPrincipal.setText(loan.getPrincipal().toAmountAndSymbolString()); lblFirstPayment.setText(SimpleDateFormat.getDateInstance().format(loan.getNextPayDate())); lblPayAmount.setText(loan.getPaymentAmount().toAmountAndSymbolString()); lblNPayment.setText(numberFormatter.valueToString(loan.getRemainingPayments())); lblTotalPayment.setText(loan.getRemainingValue().toAmountAndSymbolString()); lblCollateralAmount.setText(loan.getCollateralAmount().toAmountAndSymbolString()); } catch (Exception ignored ){ } }

Target:
private void refreshValues() { final String METHOD_NAME = "refreshValues"; try { txtPrincipal.setText(loan.getPrincipal().toAmountAndSymbolString()); lblAPR.setText(loan.getInterestRate() + "%"); lblCollateralPct.setText(loan.getCollateralPercent() + "%"); lblYears.setText(loan.getYears() + " years"); lblSchedule.setText(Finances.getScheduleName(loan.getPaymentSchedule())); lblPrincipal.setText(loan.getPrincipal().toAmountAndSymbolString()); lblFirstPayment.setText(SimpleDateFormat.getDateInstance().format(loan.getNextPayDate())); lblPayAmount.setText(loan.getPaymentAmount().toAmountAndSymbolString()); lblNPayment.setText(numberFormatter.valueToString(loan.getRemainingPayments())); lblTotalPayment.setText(loan.getRemainingValue().toAmountAndSymbolString()); lblCollateralAmount.setText(loan.getCollateralAmount().toAmountAndSymbolString()); } catch (Exception ex ){ MekHQ.getLogger().error(NewLoanDialog.class, METHOD_NAME, ex); } }
Source:
public synchronized void refreshCache() { log.debug("refreshCache"); ResourceResolver resolver = null; try { resolver = getResourceResolver(); Resource aprRoot = resolver.getResource(getRootPath()); List<String> configuredIds = new ArrayList<String>(); for (Resource child : aprRoot.getChildren()) { if (!JcrConstants.JCR_CONTENT.equals(child.getName())) { updateJobService(child.getPath(), child.getChild(JcrConstants.JCR_CONTENT)); configuredIds.add(child.getPath()); } } String filter = "(" + SERVICE_OWNER_KEY + "=" + getClass().getCanonicalName() + ")"; ServiceReference[] serviceReferences = (ServiceReference[]) ArrayUtils.addAll( bctx.getServiceReferences(Runnable.class.getCanonicalName(), filter), bctx.getServiceReferences(EventHandler.class.getCanonicalName(), filter)); log.warn("Found registered services", serviceReferences.length); for (ServiceReference reference : serviceReferences) { try { String configurationId = (String) reference.getProperty(CONFIGURATION_ID_KEY); if (!configuredIds.contains(configurationId)) { log.debug("Unregistering service for configuration {}", configurationId); this.unregisterService(configurationId); } } catch (Exception e) { log.warn("Exception unregistering reference " + reference, e); } } } catch (InvalidSyntaxException e) { log.warn("Unable to search for invalid references due to invalid filter format", e); } finally { if (resolver != null) { resolver.close(); } } }

Target:
public synchronized void refreshCache() { log.trace("refreshCache"); ResourceResolver resolver = null; try { resolver = getResourceResolver(); Resource aprRoot = resolver.getResource(getRootPath()); List<String> configuredIds = new ArrayList<String>(); for (Resource child : aprRoot.getChildren()) { if (!JcrConstants.JCR_CONTENT.equals(child.getName())) { log.debug("Updating service for configuration {}", child.getPath()); updateJobService(child.getPath(), child.getChild(JcrConstants.JCR_CONTENT)); configuredIds.add(child.getPath()); } } String filter = "(" + SERVICE_OWNER_KEY + "=" + getClass().getCanonicalName() + ")"; ServiceReference[] serviceReferences = (ServiceReference[]) ArrayUtils.addAll( bctx.getServiceReferences(Runnable.class.getCanonicalName(), filter), bctx.getServiceReferences(EventHandler.class.getCanonicalName(), filter)); log.debug("Found registered services", serviceReferences.length); for (ServiceReference reference : serviceReferences) { try { String configurationId = (String) reference.getProperty(CONFIGURATION_ID_KEY); if (!configuredIds.contains(configurationId)) { log.debug("Unregistering service for configuration {}", configurationId); this.unregisterService(configurationId); } } catch (Exception e) { log.warn("Exception unregistering reference " + reference, e); } } } catch (InvalidSyntaxException e) { log.warn("Unable to search for invalid references due to invalid filter format", e); } finally { if (resolver != null) { resolver.close(); } } }
Source:
public static String nullToEmptyString(@Nullable Object obj) { if (obj == null) { return ""; } String str = obj.toString(); return str != null ? str : ""; }

Target:
public static String nullToEmptyString(@Nullable Object obj) { if (obj == null) { return ""; } String str = obj.toString(); return (str == null ? "" : str); }
Source:
public static CloudConfigurationProvider getCloudConfigurationProvider() { if (!isEnabled()) { return null; } return getCloudConfigurationProviderExtension(); }

Target:
public static CloudConfigurationProvider getCloudConfigurationProvider() { if (!isEnabled()) { return null; } return getExtension(); }
Source:
public static TaskInfo getTaskInfoFromTaskType(TaskType taskType, String taskInfoString) throws IOException { TaskInfo taskInfo = null; try { switch(taskType) { case DATA_QUALITY: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionPipelineTaskInfo.class); break; case DETECTION: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionPipelineTaskInfo.class); break; case DETECTION_ALERT: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionAlertTaskInfo.class); break; case YAML_DETECTION_ONBOARD: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, YamlOnboardingTaskInfo.class); break; case ANOMALY_DETECTION: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionTaskInfo.class); break; case MERGE: LOG.error("TaskType MERGE not supported"); break; case MONITOR: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, MonitorTaskInfo.class); break; default: LOG.error("TaskType must be one of ANOMALY_DETECTION, MONITOR, ALERT, ALERT2, DATA_COMPLETENESS, CLASSIFICATION"); break; } } catch (Exception e) { LOG.error("Exception in converting taskInfoString to taskType {}", taskInfoString, taskType, e); } return taskInfo; }

Target:
public static TaskInfo getTaskInfoFromTaskType(TaskType taskType, String taskInfoString) throws IOException { TaskInfo taskInfo = null; try { switch(taskType) { case DATA_QUALITY: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionPipelineTaskInfo.class); break; case DETECTION: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionPipelineTaskInfo.class); break; case DETECTION_ALERT: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, DetectionAlertTaskInfo.class); break; case YAML_DETECTION_ONBOARD: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, YamlOnboardingTaskInfo.class); break; case MONITOR: taskInfo = OBJECT_MAPPER.readValue(taskInfoString, MonitorTaskInfo.class); break; default: LOG.error("TaskType must be one of DATA_QUALITY, DETECTION, DETECTION_ALERT, YAML_DETECTION_ONBOARD, MONITOR"); break; } } catch (Exception e) { LOG.error("Exception in converting taskInfoString to taskType {}", taskInfoString, taskType, e); } return taskInfo; }
Source:
public String toString() { return "HeatAdoptStackData{" + "id=" + id + ", name=" + name + ", status=" + status + ", resources=" + resources + '}'; }

Target:
public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() .add("id", id) .add("name", name) .add("status", status) .add("resources", resources) .toString(); }
Source:
private boolean handleWMSSpecific(final ActionParameters params, OskariLayer ml) { final String xslt = params.getHttpParam("xslt"); if(xslt != null) { ml.setGfiXslt(xslt); } ml.setGfiType(params.getHttpParam("gfiType", ml.getGfiType())); try { OskariLayerCapabilities raw = capabilitiesService.getCapabilities(ml, true); WebMapService wms = OskariLayerCapabilitiesHelper.parseWMSCapabilities(raw.getData(), ml); OskariLayerCapabilitiesHelper.setPropertiesFromCapabilitiesWMS(wms, ml); return true; } catch (ServiceException ex) { LOG.error(ex, "Couldn't update capabilities for layer", ml); return false; } }

Target:
private boolean handleWMSSpecific(final ActionParameters params, OskariLayer ml) { HttpServletRequest request = params.getRequest(); final String xslt = request.getParameter("xslt"); if(xslt != null) { ml.setGfiXslt(xslt); } ml.setGfiType(params.getHttpParam("gfiType", ml.getGfiType())); try { OskariLayerCapabilities raw = capabilitiesService.getCapabilities(ml, true); WebMapService wms = OskariLayerCapabilitiesHelper.parseWMSCapabilities(raw.getData(), ml); OskariLayerCapabilitiesHelper.setPropertiesFromCapabilitiesWMS(wms, ml); return true; } catch (ServiceException ex) { LOG.error(ex, "Couldn't update capabilities for layer", ml); return false; } }
Source:
public void testChannelClosedException() throws IOException { GoogleCloudStorage rawStorage = createGoogleCloudStorage(); final int totalBytes = 1200; StorageResourceId resourceId = new StorageResourceId(BUCKET_NAME, "testChannelClosedException_Object"); writeObject(rawStorage, resourceId, totalBytes); byte[] readArray = new byte[totalBytes]; SeekableByteChannel readableByteChannel = rawStorage.open(resourceId); ByteBuffer readBuffer = ByteBuffer.wrap(readArray); readBuffer.limit(5); readableByteChannel.read(readBuffer); assertThat(readableByteChannel.position()).isEqualTo(readBuffer.position()); readableByteChannel.close(); readBuffer.clear(); assertThrows(ClosedChannelException.class, () -> readableByteChannel.read(readBuffer)); }

Target:
public void testChannelClosedException() throws IOException { GoogleCloudStorage rawStorage = createGoogleCloudStorage(); int totalBytes = 1200; StorageResourceId resourceId = new StorageResourceId(BUCKET_NAME, "testChannelClosedException_Object"); writeObject(rawStorage, resourceId, totalBytes); byte[] readArray = new byte[totalBytes]; SeekableByteChannel readableByteChannel = rawStorage.open(resourceId); ByteBuffer readBuffer = ByteBuffer.wrap(readArray); readBuffer.limit(5); readableByteChannel.read(readBuffer); assertThat(readableByteChannel.position()).isEqualTo(readBuffer.position()); readableByteChannel.close(); readBuffer.clear(); assertThrows(ClosedChannelException.class, () -> readableByteChannel.read(readBuffer)); }
Source:
public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { LOG.debug("createDataType(sqlType={}, sqlTypeName={})", String.valueOf(sqlType), sqlTypeName); if (sqlType == Types.OTHER) if ("json".equals(sqlTypeName)) { return new JsonType(); } else if ("uuid".equals(sqlTypeName)) return new UuidType(); else if ("interval".equals(sqlTypeName)) return new IntervalType(); else if ("inet".equals(sqlTypeName)) return new InetType(); else if("geometry".equals(sqlTypeName)) return new GeometryType(); else if("citext".equals(sqlTypeName)) return new CitextType(); else { if(isEnumType(sqlTypeName)) { if(LOG.isDebugEnabled()) LOG.debug("Custom enum type used for sqlTypeName (sqlType '{}')", new Object[] {sqlTypeName, new Integer(sqlType)} ); return new GenericEnumType(sqlTypeName); } } return super.createDataType(sqlType, sqlTypeName); }

Target:
public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { LOG.debug("createDataType(sqlType={}, sqlTypeName={})", String.valueOf(sqlType), sqlTypeName); if (sqlType == Types.OTHER && "json".equals(sqlTypeName)) { return new JsonType(); } else { return super.createDataType(sqlType, sqlTypeName); } }
Source:
private static String profileArgsDesc(String method, List<String> args) { StringBuilder b = new StringBuilder(); b.append(method).append(": "); String sep = ""; for (String arg : args) { int appendLen = arg.length() + sep.length(); int remainingLen = MAX_PROFILE_ARGS_LEN - b.length(); if (appendLen <= remainingLen) { b.append(sep); b.append(arg); } else { String shortenedArg = (sep + arg).substring(0, remainingLen); b.append(shortenedArg); b.append("..."); break; } sep = " "; } return b.toString(); }

Target:
private static String profileArgsDesc(String method, List<String> args) { StringBuilder b = new StringBuilder(); b.append(method).append(":"); final String sep = " "; for (String arg : args) { int appendLen = sep.length() + arg.length(); int remainingLen = MAX_PROFILE_ARGS_LEN - b.length(); if (appendLen <= remainingLen) { b.append(sep); b.append(arg); } else { String shortenedArg = (sep + arg).substring(0, remainingLen); b.append(shortenedArg); b.append("..."); break; } } return b.toString(); }
Source:
public Response intercept(Chain chain) throws IOException { okhttp3.Request requestWithUserAgent = chain.request() .newBuilder() .addHeader(USER_AGENT_HEADER, userAgent) .build(); return chain.proceed(requestWithUserAgent); }

Target:
public Response intercept(Chain chain) throws IOException { Request requestWithUserAgent = chain.request() .newBuilder() .addHeader(USER_AGENT_HEADER, userAgent) .build(); return chain.proceed(requestWithUserAgent); }
Source:
private static <E> Set<E> computeIgnoredElements(Comparison comparison, IEqualityHelper equalityHelper, List<E> candidates, final Diff diff, boolean rightToLeft) { if (!candidates.isEmpty()) { IgnoredElementsEntry currentIgnoredElementsEntry = null; Iterable<? extends Diff> filteredCandidates = null; final Set<E> ignored = Sets.newLinkedHashSet(); UnresolvedDiffMatching predicate = new UnresolvedDiffMatching(comparison, equalityHelper, diff, rightToLeft); for (E candidate : candidates) { predicate.setReferenceValue(candidate); if (candidate instanceof EObject) { if (currentIgnoredElementsEntry == null) { currentIgnoredElementsEntry = ignoredElementsEntry.get(); if (currentIgnoredElementsEntry == null || !currentIgnoredElementsEntry.appliesTo(candidates)) { currentIgnoredElementsEntry = new IgnoredElementsEntry(comparison, candidates); ignoredElementsEntry = new WeakReference<IgnoredElementsEntry>( currentIgnoredElementsEntry); } } List<Diff> differences = currentIgnoredElementsEntry.getDifferences(candidate); if (Iterables.any(differences, predicate)) { ignored.add(candidate); } } else { if (filteredCandidates == null) { Match match = diff.getMatch(); filteredCandidates = Lists.newArrayList(match.getDifferences()); } if (Iterables.any(filteredCandidates, predicate)) { ignored.add(candidate); } } } return ignored; } else { return Collections.emptySet(); } }

Target:
private static <E> Set<E> computeIgnoredElements(Comparison comparison, IEqualityHelper equalityHelper, List<E> candidates, final Diff diff, boolean rightToLeft) { if (!candidates.isEmpty()) { return Collections.emptySet(); } IgnoredElementsEntry currentIgnoredElementsEntry = null; Iterable<? extends Diff> filteredCandidates = null; final Set<E> ignored = Sets.newLinkedHashSet(); UnresolvedDiffMatching predicate = new UnresolvedDiffMatching(comparison, equalityHelper, diff, rightToLeft); for (E candidate : candidates) { predicate.setReferenceValue(candidate); if (candidate instanceof EObject) { if (currentIgnoredElementsEntry == null) { currentIgnoredElementsEntry = ignoredElementsEntry.get(); if (currentIgnoredElementsEntry == null || !currentIgnoredElementsEntry.appliesTo(candidates)) { currentIgnoredElementsEntry = new IgnoredElementsEntry(comparison, candidates); ignoredElementsEntry = new WeakReference<IgnoredElementsEntry>( currentIgnoredElementsEntry); } } List<Diff> differences = currentIgnoredElementsEntry.getDifferences(candidate); if (Iterables.any(differences, predicate)) { ignored.add(candidate); } } else { if (filteredCandidates == null) { Match match = diff.getMatch(); filteredCandidates = Lists.newArrayList(match.getDifferences()); } if (Iterables.any(filteredCandidates, predicate)) { ignored.add(candidate); } } } return ignored; }
Source:
public boolean visit(@Nonnull JMethod method) { if (method.isNative() || method.isAbstract()) { return false; } if (ams == null || throwable == null || boostMethodId == null || resetMethodId == null) { return false; } return super.visit(method); }

Target:
public boolean visit(@Nonnull JMethod method) { if (method.isNative() || method.isAbstract()) { return false; } return super.visit(method); }
Source:
public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset) throws IOException { if (charset == null) { throw new IllegalArgumentException("charset is null"); } this.destPath = destinationPath; Path dir = this.destPath.getParent(); if (Files.exists(dir) && !Files.isDirectory(dir)) { throw new IOException(dir + " exists and is neither a directory nor a symlink to a directory"); } else { if (Files.isSymbolicLink(dir)) { LOGGER.log(Level.CONFIG, "{0} is a symlink to a directory", dir); } else { Files.createDirectories(dir); } } try { tmpPath = Files.createTempFile(dir, "atomic", "tmp"); } catch (IOException e) { throw new IOException("Failed to create a temporary file in "+ dir,e); } core = new FileChannelWriter(tmpPath, charset, false, StandardOpenOption.WRITE); }

Target:
public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset) throws IOException { this(destinationPath, charset, false, true); }
Source:
public static String getVersion() { final Properties properties = new Properties(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); InputStream stream = classLoader.getResourceAsStream("project.properties"); try { properties.load(stream); stream.close(); return properties.getProperty("version"); } catch (IOException e) { try { stream.close(); } catch (IOException ex) { ex.printStackTrace(); } e.printStackTrace(); return "?.?.?"; } }

Target:
public static String getVersion() { final Properties properties = new Properties(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try (InputStream stream = classLoader.getResourceAsStream("project.properties")) { properties.load(stream); return properties.getProperty("version"); } catch (IOException e) { e.printStackTrace(); return "?.?.?"; } }
Source:
protected void syncSearch() { SearchParameters tempVar = new SearchParameters(getSearchString(), SearchType.VDS, isCaseSensitiveSearch()); tempVar.setRefresh(getIsQueryFirstTime()); super.syncSearch(VdcQueryType.Search, tempVar); }

Target:
protected void syncSearch() { SearchParameters tempVar = new SearchParameters(getSearchString(), SearchType.VDS); tempVar.setRefresh(getIsQueryFirstTime()); super.syncSearch(VdcQueryType.Search, tempVar); }
Source:
public boolean onKeyUp(int keyCode, KeyEvent event) { AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); switch (keyCode) { case KeyEvent.KEYCODE_P: case KeyEvent.KEYCODE_SPACE: onPlayPause(); toggleVideoControlsVisibility(); return true; case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_A: case KeyEvent.KEYCODE_COMMA: onRewind(); showSkipAnimation(false); return true; case KeyEvent.KEYCODE_K: case KeyEvent.KEYCODE_D: case KeyEvent.KEYCODE_PERIOD: onFastForward(); showSkipAnimation(true); return true; case KeyEvent.KEYCODE_F: case KeyEvent.KEYCODE_ESCAPE: onBackPressed(); return true; case KeyEvent.KEYCODE_I: compatEnterPictureInPicture(); return true; case KeyEvent.KEYCODE_PLUS: case KeyEvent.KEYCODE_W: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_MINUS: case KeyEvent.KEYCODE_S: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_M: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_TOGGLE_MUTE, 0); return true; } break; } if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) { controller.seekTo((int) (0.1f * (keyCode - KeyEvent.KEYCODE_0) * controller.getDuration())); return true; } return super.onKeyUp(keyCode, event); }

Target:
public boolean onKeyUp(int keyCode, KeyEvent event) { AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); switch (keyCode) { case KeyEvent.KEYCODE_P: case KeyEvent.KEYCODE_SPACE: onPlayPause(); toggleVideoControlsVisibility(); return true; case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_A: case KeyEvent.KEYCODE_COMMA: onRewind(); showSkipAnimation(false); return true; case KeyEvent.KEYCODE_K: case KeyEvent.KEYCODE_D: case KeyEvent.KEYCODE_PERIOD: onFastForward(); showSkipAnimation(true); return true; case KeyEvent.KEYCODE_F: case KeyEvent.KEYCODE_ESCAPE: onBackPressed(); return true; case KeyEvent.KEYCODE_I: compatEnterPictureInPicture(); return true; case KeyEvent.KEYCODE_PLUS: case KeyEvent.KEYCODE_W: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_MINUS: case KeyEvent.KEYCODE_S: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_M: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_TOGGLE_MUTE, AudioManager.FLAG_SHOW_UI); return true; } break; } if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) { controller.seekTo((int) (0.1f * (keyCode - KeyEvent.KEYCODE_0) * controller.getDuration())); return true; } return super.onKeyUp(keyCode, event); }
Source:
public List<Page> benchmarkJoin(Context context) { return context.getQueryRunner() .execute("SELECT count(1) FROM points, polygons WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(latitude, longitude))"); }

Target:
public List<Page> benchmarkJoin(Context context) { return context.getQueryRunner() .execute("SELECT count(*) FROM points, polygons WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(latitude, longitude))"); }
Source:
private InputStream open() throws IOException, CoreException, IncorrectObjectTypeException { final ObjectLoader reader = db.openBlob(blobId); if (reader == null) throw new CoreException(new Status(IStatus.ERROR, path, NLS.bind(CoreText.BlobStorage_blobNotFound, blobId), null)); final byte[] data = reader.getBytes(); if (reader.getType() != Constants.OBJ_BLOB) throw new IncorrectObjectTypeException(blobId, Constants.TYPE_BLOB); return new ByteArrayInputStream(data); }

Target:
private InputStream open() throws IOException, CoreException, IncorrectObjectTypeException { final ObjectLoader reader = db.openBlob(blobId); if (reader == null) throw new CoreException(Activator.error(NLS.bind( CoreText.BlobStorage_blobNotFound, blobId.name(), path), null)); final byte[] data = reader.getBytes(); if (reader.getType() != Constants.OBJ_BLOB) throw new IncorrectObjectTypeException(blobId, Constants.TYPE_BLOB); return new ByteArrayInputStream(data); }
Source:
public LogEntry newObject() { return null; }

Target:
public LogEntry newObject() { return Context.getService(IdentifierSourceService.class) .getLogEntries(null, null, null, getUuidProperty(), null, null).get(0); }
Source:
static public String getDescription(int quotaType) { HashMap<Integer, QuotaTypes> quotaMap = listQuotaTypes(); if (quotaMap.containsKey(quotaType)) { return quotaMap.get(quotaType).getDescription(); } return null; }

Target:
static public String getDescription(int quotaType) { QuotaTypes t = quotaTypeMap.get(quotaType); if (t != null) { return t.getDescription(); } return null; }
Source:
public void onSuccess(final int httpStatusCode, final String response, final Map<String, String> headers) { final PageItem page = JSonItemReader.parseItem(response, PageDefinition.get()); addBody(new DeletePageFormProblemsCallout(formMappings, page.getDisplayName())); pagesLeft--; if (pagesLeft==0) { addBody(new CalloutWarning(_("If you delete a page that is used by a process, the process becomes unresolved.\nBefore deleting a page, you should also check whether it is used in a custom profile navigation."))); addBody(new Paragraph(_("Do you still want to delete the selected pages?"))); } }

Target:
public void onSuccess(final int httpStatusCode, final String response, final Map<String, String> headers) { final PageItem page = JSonItemReader.parseItem(response, PageDefinition.get()); addBody(new DeletePageFormProblemsCallout(formMappings, page.getDisplayName())); if (--pagesLeft==0) { addBody(new CalloutWarning(_("If you delete a page that is used by a process, the process becomes unresolved.\nBefore deleting a page, you should also check whether it is used in a custom profile navigation."))); addBody(new Paragraph(_("Do you still want to delete the selected pages?"))); } }
Source:
private void setDarkReviewScreen(boolean enabled) { if (invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_TRANSLATE_IMAGE_CAPTION || invokeSource == SUGGESTED_EDITS_TRANSLATE_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION) { int whiteRes = getResources().getColor(android.R.color.white); toolbarContainer.setBackgroundResource(enabled ? android.R.color.black : ResourceUtil.getThemedAttributeId(getContext(), R.attr.main_toolbar_color)); saveButton.setColorFilter(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.themed_icon_color), PorterDuff.Mode.SRC_IN); cancelButton.setColorFilter(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.main_toolbar_icon_color), PorterDuff.Mode.SRC_IN); headerText.setTextColor(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.main_toolbar_title_color)); ((DescriptionEditActivity) activity).updateStatusBarColor(enabled ? android.R.color.black : ResourceUtil.getThemedAttributeId(getContext(), R.attr.main_status_bar_color)); ((DescriptionEditActivity) activity).updateNavigationBarColor(enabled ? ContextCompat.getColor(activity, android.R.color.black) : ResourceUtil.getThemedAttributeId(getContext(), R.attr.paper_color)); DeviceUtil.updateStatusBarTheme(activity, null, enabled); } }

Target:
private void setDarkReviewScreen(boolean enabled) { if (invokeSource == SUGGESTED_EDITS_ADD_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_TRANSLATE_IMAGE_CAPTION || invokeSource == SUGGESTED_EDITS_TRANSLATE_CAPTION || invokeSource == FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION) { int whiteRes = getResources().getColor(android.R.color.white); toolbarContainer.setBackgroundResource(enabled ? android.R.color.black : ResourceUtil.getThemedAttributeId(getContext(), R.attr.main_toolbar_color)); saveButton.setColorFilter(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.themed_icon_color), PorterDuff.Mode.SRC_IN); cancelButton.setColorFilter(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.main_toolbar_icon_color), PorterDuff.Mode.SRC_IN); headerText.setTextColor(enabled ? whiteRes : ResourceUtil.getThemedColor(getContext(), R.attr.main_toolbar_title_color)); ((DescriptionEditActivity) activity).updateStatusBarColor(enabled ? ContextCompat.getColor(activity, android.R.color.black) : ResourceUtil.getThemedColor(getContext(), R.attr.main_status_bar_color)); DeviceUtil.updateStatusBarTheme(activity, null, enabled); ((DescriptionEditActivity) activity).updateNavigationBarColor(enabled ? ContextCompat.getColor(activity, android.R.color.black) : ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); } }
Source:
public void no_key_value_deserialization_on_server_when_entry_is_removed() { if (inMemoryFormat == InMemoryFormat.OBJECT) { return; } Config config = new Config(); config.getReplicatedMapConfig("default").setInMemoryFormat(inMemoryFormat); HazelcastInstance server = factory.newHazelcastInstance(config); HazelcastInstance client = factory.newHazelcastClient(); ReplicatedMap<DeserializationCounter, DeserializationCounter> replicatedMap = client.getReplicatedMap("test"); DeserializationCounter key = new Key1(); DeserializationCounter value = new Value1(); replicatedMap.put(key, value); replicatedMap.remove(key); assertEquals(0, ((Key1) key).COUNTER.get()); assertEquals(1, ((Value1) value).COUNTER.get()); }

Target:
public void no_key_value_deserialization_on_server_when_entry_is_removed() { Assume.assumeThat(inMemoryFormat, is(BINARY)); Config config = new Config(); config.getReplicatedMapConfig("default").setInMemoryFormat(inMemoryFormat); HazelcastInstance server = factory.newHazelcastInstance(config); HazelcastInstance client = factory.newHazelcastClient(); ReplicatedMap<DeserializationCounter, DeserializationCounter> replicatedMap = client.getReplicatedMap("test"); DeserializationCounter key = new Key1(); DeserializationCounter value = new Value1(); replicatedMap.put(key, value); replicatedMap.remove(key); assertEquals(0, ((Key1) key).COUNTER.get()); assertEquals(1, ((Value1) value).COUNTER.get()); }
Source:
public MappingElasticsearchConverter elasticsearchEntityMapper( SimpleElasticsearchMappingContext elasticsearchMappingContext) { return new MappingElasticsearchConverter(elasticsearchMappingContext, new DefaultConversionService()); }

Target:
public MappingElasticsearchConverter elasticsearchEntityMapper( SimpleElasticsearchMappingContext elasticsearchMappingContext) { return new MappingElasticsearchConverter(elasticsearchMappingContext); }