auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final JobManagerProcessSpec processSpec = JobManagerProcessUtils.processSpecFromConfigWithNewOptionToInterpretLegacyHeap( kubernetesJobManagerParameters.getFlinkConfiguration(), JobManagerOptions.TOTAL_PROCESS_MEMORY); final String startCommand = getJobManagerStartCommand( kubernetesJobManagerParameters.getFlinkConfiguration(), processSpec, kubernetesJobManagerParameters.getFlinkConfDirInPod(), kubernetesJobManagerParameters.getFlinkLogDirInPod(), kubernetesJobManagerParameters.hasLogback(), kubernetesJobManagerParameters.hasLog4j(), kubernetesJobManagerParameters.getEntrypointClass()); final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesJobManagerParameters.getContainerEntrypoint()) .withArgs(KubernetesUtils.getStartCommandWithBashWrapper(startCommand)) .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }

Target:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final JobManagerProcessSpec processSpec = JobManagerProcessUtils.processSpecFromConfigWithNewOptionToInterpretLegacyHeap( kubernetesJobManagerParameters.getFlinkConfiguration(), JobManagerOptions.TOTAL_PROCESS_MEMORY); final List<String> startCommand = getJobManagerStartCommand( kubernetesJobManagerParameters.getFlinkConfiguration(), processSpec, kubernetesJobManagerParameters.getFlinkConfDirInPod(), kubernetesJobManagerParameters.getFlinkLogDirInPod(), kubernetesJobManagerParameters.hasLogback(), kubernetesJobManagerParameters.hasLog4j(), kubernetesJobManagerParameters.getEntrypointClass()); final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesJobManagerParameters.getContainerEntrypoint()) .withArgs(startCommand) .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }
Source:
public boolean doPostUpdateRoleName(String roleName, String newRoleName, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } try { SCIMGroupHandler scimGroupHandler = new SCIMGroupHandler(userStoreManager.getTenantId()); String domainName = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration()); if (domainName == null) { domainName = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME; } String roleNameWithDomain = domainName.toUpperCase() + CarbonConstants.DOMAIN_SEPARATOR + roleName; String newRoleNameWithDomain = domainName.toUpperCase() + CarbonConstants.DOMAIN_SEPARATOR + newRoleName; try { scimGroupHandler.updateRoleName(roleNameWithDomain, newRoleNameWithDomain); } catch (IdentitySCIMException e) { throw new UserStoreException("Error updating group information in SCIM Tables.", e); } return true; } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException(e); } }

Target:
public boolean doPostUpdateRoleName(String roleName, String newRoleName, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } try { SCIMGroupHandler scimGroupHandler = new SCIMGroupHandler(userStoreManager.getTenantId()); String domainName = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration()); if (domainName == null) { domainName = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME; } String roleNameWithDomain = UserCoreUtil.addDomainToName(roleName, domainName); String newRoleNameWithDomain = UserCoreUtil.addDomainToName(newRoleName, domainName); try { scimGroupHandler.updateRoleName(roleNameWithDomain, newRoleNameWithDomain); } catch (IdentitySCIMException e) { throw new UserStoreException("Error updating group information in SCIM Tables.", e); } return true; } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException(e); } }
Source:
public Object merge( Object parent ) { if (parent == null) { return this; } if (parent instanceof MockHttpServletRequestBuilder) { this.mergeable = (Mergeable) parent; return this.mergeable; } else { throw new IllegalArgumentException("Cannot merge with [" + parent.getClass().getName() + "]"); } }

Target:
public Object merge(Object parent) { if (parent == null) { return this; } if (parent instanceof Mergeable ) { this.parent = (Mergeable) parent; return this; } else { throw new IllegalArgumentException("Cannot merge with [" + parent.getClass().getName() + "]"); } }
Source:
public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); target = BlockPos.fromLong(buf.readLong()); int l = buf.readInt(); subPoints = new Vec3d[l]; for(int i=0; i<l; i++) subPoints[i] = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); targetPoint = buf.readInt(); }

Target:
public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); target = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); int l = buf.readInt(); subPoints = new Vec3d[l]; for(int i=0; i<l; i++) subPoints[i] = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); targetPoint = buf.readInt(); }
Source:
public void setUp() throws Exception { brickPosition = 1; int timesToRepeat = 3; int changeYMovement = -10; LoopEndBrick endBrick = new LoopEndBrick(); RepeatBrick repeatBrick = new RepeatBrick(timesToRepeat); repeatBrick.setLoopEndBrick(endBrick); script = BrickTestUtils.createProjectAndGetStartScript("LoopBrickTest1"); script.addBrick(repeatBrick); script.addBrick(new ChangeYByNBrick(changeYMovement)); script.addBrick(endBrick); baseActivityTestRule.launchActivity(null); }

Target:
public void setUp() throws Exception { int timesToRepeat = 3; int changeYMovement = -10; LoopEndBrick endBrick = new LoopEndBrick(); RepeatBrick repeatBrick = new RepeatBrick(timesToRepeat); repeatBrick.setLoopEndBrick(endBrick); Script script = BrickTestUtils.createProjectAndGetStartScript("LoopBrickTest1"); script.addBrick(repeatBrick); script.addBrick(new ChangeYByNBrick(changeYMovement)); script.addBrick(endBrick); baseActivityTestRule.launchActivity(null); }
Source:
private ResponseEntity<Object> createContainer(String id, Resource containerType) { Map<String, Object> result = new HashMap<>(); result.put("action", "create"); PID parentPid = PIDs.get(id); result.put("pid", parentPid.getUUID()); try { addContainerService.addContainer(AgentPrincipals.createFromThread(), parentPid, containerType); } catch (Exception e) { result.put("error", e.getMessage()); Throwable t = e.getCause(); if (t instanceof AuthorizationException || t instanceof AccessRestrictionException) { return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to create container for {}", e); return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }

Target:
private ResponseEntity<Object> createContainer(String id, Resource containerType) { Map<String, Object> result = new HashMap<>(); result.put("action", "create"); result.put("pid", id); PID parentPid = PIDs.get(id); try { addContainerService.addContainer(AgentPrincipals.createFromThread(), parentPid, containerType); } catch (Exception e) { result.put("error", e.getMessage()); Throwable t = e.getCause(); if (t instanceof AuthorizationException || t instanceof AccessRestrictionException) { return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to create container for {}", e); return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }
Source:
public void checkFormatCodeFeature() { projectExplorer.openItemByPath(PROJECT_NAME + "/towers.py"); editor.selectTabByName("towers.py"); editor.openContextMenuInEditor(); editor.clickOnItemInContextMenu(FORMAT); editor.waitTextIntoEditor( " towers(i-1, middle, finish, start)\n\n\n" + "towers(5, 'X', 'Z', 'Y')\n"); }

Target:
public void checkFormatCodeFeature() { projectExplorer.openItemByPath(PROJECT_NAME + "/towers.py"); editor.selectTabByName("towers.py"); editor.openContextMenuInEditor(); editor.clickOnItemInContextMenu(FORMAT); editor.waitTextIntoEditor( " towers(i-1, middle, finish, start)\n\n\ntowers(5, 'X', 'Z', 'Y')\n"); }
Source:
public synchronized void stop() { stopping = true; supervisor.stop(); if (monitorServer != null) { monitorServer.stop(); } stopping = false; }

Target:
public void stop() { lifecycleLock.lock(); try { supervisor.stop(); if (monitorServer != null) { monitorServer.stop(); } } finally { lifecycleLock.unlock(); } }
Source:
public void cancelCurrentTask() { stateHolder.cancelTask(); if (stateHolder.canDetachFromCancelledTask()) { dismissProgressDialog(); } }

Target:
public void cancelCurrentTask() { synchronized (stateHolder.getTaskCancelLock()) { if (stateHolder.canCancel()) { stateHolder.cancelTask(); if (stateHolder.canDetachFromCancelledTask()) { dismissProgressDialog(); stateHolder.performDetach(); stateHolder.clearTask(); } } } }
Source:
private void updateRenderer() { ColorRamp colorRamp = mColorRampType != ColorRamp.PresetType.NONE ? new ColorRamp(mColorRampType, 800) : null; mRasterLayer = colorRamp != null ? new RasterLayer(mElevationRaster) : new RasterLayer(mImageryRaster); mMapView.getMap().setBasemap(new Basemap(mRasterLayer)); BlendRenderer blendRenderer = new BlendRenderer( mElevationRaster, Arrays.asList(9.0), Arrays.asList(255.0), null, null, null, null, colorRamp, mAltitude, mAzimuth, mZFactor, mSlopeType, mPixelSizeFactor, mPixelSizePower, mOutputBitDepth); mRasterLayer.setRasterRenderer(blendRenderer); }

Target:
private void updateRenderer() { ColorRamp colorRamp = mColorRampType != ColorRamp.PresetType.NONE ? new ColorRamp(mColorRampType, 800) : null; RasterLayer mRasterLayer = colorRamp != null ? new RasterLayer(mElevationRaster) : new RasterLayer(mImageryRaster); mMapView.getMap().setBasemap(new Basemap(mRasterLayer)); BlendRenderer blendRenderer = new BlendRenderer( mElevationRaster, Collections.singletonList(9.0), Collections.singletonList(255.0), null, null, null, null, colorRamp, mAltitude, mAzimuth, mZFactor, mSlopeType, mPixelSizeFactor, mPixelSizePower, mOutputBitDepth); mRasterLayer.setRasterRenderer(blendRenderer); }
Source:
public static Subscribe parse(List<Object> wmsg) { MessageUtil.validateMessage(wmsg, MESSAGE_TYPE, "SUBSCRIBE", 4); long request = MessageUtil.parseRequestID(wmsg.get(1)); Map<String, Object> options = (Map<String, Object>) wmsg.get(2); String match = null; if (options.containsKey("match")) { match = (String) options.get("match"); if (!Objects.equals(match, MATCH_EXACT) && !Objects.equals(match, MATCH_PREFIX) && !Objects.equals(match, MATCH_WILDCARD)) { throw new ProtocolError("match must be one of exact, prefix or wildcard."); } } boolean getRetained = false; if (options.containsKey("get_retained")) { getRetained = (boolean) options.get("get_retained"); } String topic = (String) wmsg.get(3); SubscribeOptions opt = new SubscribeOptions(match, true, getRetained); return new Subscribe(request, opt, topic); }

Target:
public static Subscribe parse(List<Object> wmsg) { MessageUtil.validateMessage(wmsg, MESSAGE_TYPE, "SUBSCRIBE", 4); long request = MessageUtil.parseRequestID(wmsg.get(1)); Map<String, Object> options = (Map<String, Object>) wmsg.get(2); String match = null; if (options.containsKey("match")) { match = (String) options.get("match"); if (!Objects.equals(match, MATCH_EXACT) && !Objects.equals(match, MATCH_PREFIX) && !Objects.equals(match, MATCH_WILDCARD)) { throw new ProtocolError("match must be one of exact, prefix or wildcard."); } } boolean getRetained = (boolean)options.getOrDefault("get_retained", false); String topic = (String) wmsg.get(3); SubscribeOptions opt = new SubscribeOptions(match, true, getRetained); return new Subscribe(request, opt, topic); }
Source:
public void testDefaultTranslationFileIsMissing() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TranslationCheck.class); checkConfig.addAttribute("requiredTranslations", "ja, de, ja"); final File[] propertyFiles = { new File(getPath("checks" + File.separator + "translation-check-messages_de.properties")), new File(getPath("checks" + File.separator + "translation-check-messages_ja.properties")), }; final String[] expected = { "0: Properties file 'translation-check-messages.properties' is missing.", }; verify( createChecker(checkConfig), propertyFiles, getPath("checks"), expected); }

Target:
public void testDefaultTranslationFileIsMissing() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TranslationCheck.class); checkConfig.addAttribute("requiredTranslations", "ja,,, de, ja"); final File[] propertyFiles = { new File(getPath("checks" + File.separator + "messages_translation_de.properties")), new File(getPath("checks" + File.separator + "messages_translation_ja.properties")), }; final String[] expected = { "0: Properties file 'messages_translation.properties' is missing.", }; verify( createChecker(checkConfig), propertyFiles, getPath("checks"), expected); }
Source:
public boolean doCheckAndSend() throws JobEmailNotificationException { switch (eventType) { case JOB_PAUSED: case JOB_RESUMED: case JOB_IN_ERROR: case JOB_PENDING_TO_FINISHED: case JOB_RUNNING_TO_FINISHED: case JOB_RESTARTED_FROM_ERROR: break; default: logger.trace("Event unrelated to job finish, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } try { sender.send(getFrom(), getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }

Target:
public boolean doCheckAndSend() throws JobEmailNotificationException { switch (eventType) { case JOB_PAUSED: case JOB_RESUMED: case JOB_IN_ERROR: case JOB_SUBMITTED: case JOB_PENDING_TO_RUNNING: case JOB_CHANGE_PRIORITY: case JOB_PENDING_TO_FINISHED: case JOB_RUNNING_TO_FINISHED: case JOB_RESTARTED_FROM_ERROR: break; default: logger.trace("Event unrelated to job finish, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } try { sender.send(getFrom(), getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }
Source:
public void setEnableEvalExpression(String evalExpression) { if (!this.enableEvalExpressionValueSet) { this.enableEvalExpression = "true".equals(evalExpression); this.enableEvalExpressionValueSet = true; if (this.enableEvalExpression) { LOG.warn("Enabling OGNL expression evaluation may introduce security risks " + "(see <LINK_0> for further details)"); } } else { LOG.debug("Error setting enable OGNL expression evaluation value [{}], already previously set to [{}]", evalExpression, this.enableEvalExpression); } }

Target:
protected void setEnableEvalExpression(String evalExpression) { this.enableEvalExpression = BooleanUtils.toBoolean(evalExpression); if (this.enableEvalExpression) { LOG.warn("Enabling OGNL expression evaluation may introduce security risks " + "(see <LINK_0> for further details)"); } }
Source:
public String getImageUrl(String id) { return getProvider().getUrl() + API_VERSION + "/images/" + id + "/file"; }

Target:
public String getImageUrl(String id) { return getProvider().getUrl() + API_VERSION + "/images/" + id; }
Source:
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { List<String> mechanismList = Arrays.asList(mechanisms); mechanismList.sort(mechanismNameComparator); return super.createSaslClient(mechanismList.toArray(new String[mechanismList.size()]), authorizationId, protocol, serverName, props, cbh); }

Target:
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { String[] sortedMechanisms = mechanisms.clone(); Arrays.sort(sortedMechanisms, mechanismNameComparator); return super.createSaslClient(sortedMechanisms, authorizationId, protocol, serverName, props, cbh); }
Source:
private boolean doesDestinationMatch(Datastream newDatastream, Datastream existingDatastream) { if ((!newDatastream.hasDestination() && !existingDatastream.hasDestination()) || (newDatastream.hasDestination() && existingDatastream.hasDestination() && newDatastream.getDestination().equals(existingDatastream.getDestination()))) { return true; } return false; }

Target:
private boolean doesDestinationMatch(Datastream newDatastream, Datastream existingDatastream) { return ((!newDatastream.hasDestination() && !existingDatastream.hasDestination()) || (newDatastream.hasDestination() && existingDatastream.hasDestination() && newDatastream.getDestination().equals(existingDatastream.getDestination()))); }
Source:
private void initAttributes(Context context, AttributeSet attributeSet) { TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton, 0, 0); if (attr != null) { try { mColorNormal = attr.getColor(R.styleable.FloatingActionButton_fab_colorNormal, getColor(android.R.color.holo_blue_dark)); mColorPressed = attr.getColor(R.styleable.FloatingActionButton_fab_colorPressed, getColor(android.R.color.holo_blue_light)); mSize = attr.getInt(R.styleable.FloatingActionButton_fab_size, SIZE_NORMAL); mIcon = attr.getResourceId(R.styleable.FloatingActionButton_fab_icon, 0); mEnableInnerColor = attr.getBoolean(R.styleable.FloatingActionButton_fab_enable_inner_color, true); } finally { attr.recycle(); } } }

Target:
private void initAttributes(Context context, AttributeSet attributeSet) { TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton, 0, 0); if (attr != null) { try { mColorNormal = attr.getColor(R.styleable.FloatingActionButton_fab_colorNormal, getColor(android.R.color.holo_blue_dark)); mColorPressed = attr.getColor(R.styleable.FloatingActionButton_fab_colorPressed, getColor(android.R.color.holo_blue_light)); mSize = attr.getInt(R.styleable.FloatingActionButton_fab_size, SIZE_NORMAL); mIcon = attr.getResourceId(R.styleable.FloatingActionButton_fab_icon, 0); mEnableInnerShadow = attr.getBoolean(R.styleable.FloatingActionButton_fab_enableInnerShadow, true); } finally { attr.recycle(); } } }
Source:
public String getDisableFlash() { return config.get("disable-flash"); }

Target:
public String getDisableFlash() { return String.valueOf(config.get("disable-flash")); }
Source:
public AppointmentDAOImpl(){ List<String> applicants = new ArrayList<>(); applicants.add("testApplicantId"); List<String> users = new ArrayList<>(); users.add("testUserId"); List<String> applicants2 = new ArrayList<>(); applicants2.add("testApplicantIdWRONG"); List<String> users2 = new ArrayList<>(); users2.add("testUserId"); List<String> applicants3 = new ArrayList<>(); applicants3.add("testApplicantId"); List<String> users3 = new ArrayList<>(); users3.add("testUserId"); appointmentsList = new LinkedList<>(); appointmentsList.add(new Appointment(users, applicants, 1401866602 + TOMORROW)); appointmentsList.add(new Appointment(users2, applicants2, 1401866603 + TOMORROW)); appointmentsList.add(new Appointment(users3, applicants3, 1401866604 + TOMORROW)); }

Target:
public AppointmentDAOImpl(){ }
Source:
public static QuorumPeer createQuorumPeer(File tmpDir) throws IOException{ QuorumPeer peer = new QuorumPeer(); peer.syncLimit = 2; peer.initLimit = 2; peer.tickTime = 2000; peer.quorumPeers = new HashMap<Long, QuorumPeer.QuorumServer>(); peer.quorumPeers.put(0L, new QuorumPeer.QuorumServer(0, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(1L, new QuorumPeer.QuorumServer(1, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(2L, new QuorumPeer.QuorumServer(2, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.setQuorumVerifier(new QuorumMaj(peer.quorumPeers.size())); peer.setCnxnFactory(new NullServerCnxnFactory()); File version2 = new File(tmpDir, "version-2"); version2.mkdir(); FileOutputStream fos; fos = new FileOutputStream(new File(version2, "currentEpoch")); fos.write("0\n".getBytes()); fos.close(); fos = new FileOutputStream(new File(version2, "acceptedEpoch")); fos.write("0\n".getBytes()); fos.close(); return peer; }

Target:
public static QuorumPeer createQuorumPeer(File tmpDir) throws IOException{ QuorumPeer peer = new QuorumPeer(); peer.syncLimit = 2; peer.initLimit = 2; peer.tickTime = 2000; peer.quorumPeers = new HashMap<Long, QuorumPeer.QuorumServer>(); peer.quorumPeers.put(0L, new QuorumPeer.QuorumServer(0, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(1L, new QuorumPeer.QuorumServer(1, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(2L, new QuorumPeer.QuorumServer(2, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.setQuorumVerifier(new QuorumMaj(peer.quorumPeers.size())); peer.setCnxnFactory(new NullServerCnxnFactory()); File version2 = new File(tmpDir, "version-2"); version2.mkdir(); FileOutputStream fos = new FileOutputStream(new File(version2, "currentEpoch")); fos.write("0\n".getBytes()); fos.close(); fos = new FileOutputStream(new File(version2, "acceptedEpoch")); fos.write("0\n".getBytes()); fos.close(); return peer; }
Source:
private RegionScanner rebuildIndices(final RegionScanner innerScanner, final Region region, final Scan scan, final RegionCoprocessorEnvironment env) throws IOException { boolean oldCoproc = region.getTableDesc().hasCoprocessor(Indexer.class.getCanonicalName()); byte[] valueBytes = scan.getAttribute(BaseScannerRegionObserver.INDEX_REBUILD_VERIFY_TYPE); IndexTool.IndexVerifyType verifyType = (valueBytes != null) ? IndexTool.IndexVerifyType.fromValue(valueBytes):IndexTool.IndexVerifyType.NONE; if (oldCoproc && verifyType == IndexTool.IndexVerifyType.ONLY) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } if (!scan.isRaw()) { Scan rawScan = new Scan(scan); rawScan.setRaw(true); rawScan.setMaxVersions(); rawScan.getFamilyMap().clear(); rawScan.setFilter(null); rawScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { rawScan.addFamily(family); } innerScanner.close(); RegionScanner scanner = region.getScanner(rawScan); if (oldCoproc) { return new IndexerRegionScanner(scanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(scanner, region, scan, env, this); } } if (oldCoproc) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(innerScanner, region, scan, env, this); } }

Target:
private RegionScanner rebuildIndices(final RegionScanner innerScanner, final Region region, final Scan scan, final RegionCoprocessorEnvironment env) throws IOException { boolean oldCoproc = region.getTableDesc().hasCoprocessor(Indexer.class.getCanonicalName()); byte[] valueBytes = scan.getAttribute(BaseScannerRegionObserver.INDEX_REBUILD_VERIFY_TYPE); IndexTool.IndexVerifyType verifyType = (valueBytes != null) ? IndexTool.IndexVerifyType.fromValue(valueBytes) : IndexTool.IndexVerifyType.NONE; if (oldCoproc && verifyType == IndexTool.IndexVerifyType.ONLY) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } if (!scan.isRaw()) { Scan rawScan = new Scan(scan); rawScan.setRaw(true); rawScan.setMaxVersions(); rawScan.getFamilyMap().clear(); if (scan.getFilter() instanceof FirstKeyOnlyFilter) { rawScan.setFilter(null); } else if (scan.getFilter() != null) { rawScan.setFilter(new AllVersionsIndexRebuildFilter(scan.getFilter())); } rawScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { rawScan.addFamily(family); } innerScanner.close(); RegionScanner scanner = region.getScanner(rawScan); if (oldCoproc) { return new IndexerRegionScanner(scanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(scanner, region, scan, env); } } if (oldCoproc) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(innerScanner, region, scan, env); } }
Source:
public void onClick(View view) { switch (view.getId()) { case R.id.button_sign_in: if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) { Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!"); } Log.d(TAG, "Sign-in button clicked"); mSignInClicked = true; mGoogleApiClient.connect(); break; case R.id.button_sign_out: mSignInClicked = false; Games.signOut(mGoogleApiClient); mGoogleApiClient.disconnect(); showSignInBar(); mSaveGame = new SaveGame(); mAlreadyLoadedState = false; updateUi(); break; case R.id.button_next_world: if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld < WORLD_MAX) { mWorld++; updateUi(); } break; case R.id.button_prev_world: if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld > WORLD_MIN) { mWorld--; updateUi(); } break; default: if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } for (int i = 0; i < LEVEL_BUTTON_IDS.length; ++i) { if (view.getId() == LEVEL_BUTTON_IDS[i]) { launchLevel(i + 1); return; } } } }

Target:
public void onClick(View view) { switch (view.getId()) { case R.id.button_sign_in: if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) { Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!"); } Log.d(TAG, "Sign-in button clicked"); mSignInClicked = true; mGoogleApiClient.connect(); break; case R.id.button_sign_out: mSignInClicked = false; Games.signOut(mGoogleApiClient); mGoogleApiClient.disconnect(); showSignInBar(); mSaveGame = new SaveGame(); mAlreadyLoadedState = false; updateUi(); break; case R.id.button_next_world: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld < WORLD_MAX) { mWorld++; updateUi(); } break; case R.id.button_prev_world: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld > WORLD_MIN) { mWorld--; updateUi(); } break; default: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } for (int i = 0; i < LEVEL_BUTTON_IDS.length; ++i) { if (view.getId() == LEVEL_BUTTON_IDS[i]) { launchLevel(i + 1); return; } } } }
Source:
public @Nullable StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj == null || toAppendTo == null) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } Double doubleObj = (Double) obj; if ((doubleObj % 1 != 0) || !fMap.containsValue((doubleObj.intValue()))) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } for (Entry<@Nullable String, Integer> entry : fMap.entrySet()) { if (Double.compare(entry.getValue().doubleValue(), doubleObj.doubleValue()) == 0) { if (entry.getKey() == null) { return new StringBuffer(UNKNOW_REPRESENTATION); } if (entry.getKey() == null) { return new StringBuffer(UNKNOW_REPRESENTATION); } return toAppendTo.append(entry.getKey()); } } return new StringBuffer(SWTCHART_EMPTY_LABEL); }

Target:
public @Nullable StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj == null || toAppendTo == null) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } Double doubleObj = (Double) obj; if ((doubleObj % 1 != 0) || !fMap.containsValue((doubleObj.intValue()))) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } for (Entry<@Nullable String, Integer> entry : fMap.entrySet()) { if (Double.compare(entry.getValue().doubleValue(), doubleObj.doubleValue()) == 0) { if (entry.getKey() == null) { return new StringBuffer(UNKNOWN_REPRESENTATION); } return toAppendTo.append(entry.getKey()); } } return new StringBuffer(SWTCHART_EMPTY_LABEL); }
Source:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = this.preferences.getSavePreferences() .withEncoding(encoding) .withSaveType(saveType); Consumer<List<FieldChange>> consumer = fieldChanges -> panel.registerUndoableChanges(fieldChanges); var future = saveManager.save(file, selectedOnly, encoding, saveType, consumer); Set<Character> characters; try { characters = future.get(); if (!characters.isEmpty()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), characters, saveType); } } catch (InterruptedException | ExecutionException e) { throw new SaveException("Error excuting save acton", e); } return true; }

Target:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = this.preferences.getSavePreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.shouldMakeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(libraryTab.getBibDatabaseContext(), libraryTab.getSelectedEntries()); } else { databaseWriter.saveDatabase(libraryTab.getBibDatabaseContext()); } libraryTab.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving: " + ex, ex); } return true; }
Source:
public DataSeriesWriter(final DataSeriesType valueType, final EncodingParams params, final BitOutputStream bitOutputStream, final Map<Integer, ExposedByteArrayOutputStream> outputMap) { final EncodingFactory f = new EncodingFactory(); final Encoding<T> encoding = f.createEncoding(valueType, params.id); if (encoding == null) throw new RuntimeException("Encoding not found: value type=" + valueType.name() + ", encoding id=" + params.id.name()); encoding.fromByteArray(params.params); this.codec = encoding.buildCodec(null, outputMap); this.bitOutputStream = bitOutputStream; }

Target:
public DataSeriesWriter(final DataSeriesType valueType, final EncodingParams params, final BitOutputStream bitOutputStream, final Map<Integer, ExposedByteArrayOutputStream> outputMap) { final EncodingFactory f = new EncodingFactory(); final Encoding<T> encoding = f.createEncoding(valueType, params.id); if (encoding == null) { throw new IllegalArgumentException("Encoding not found: value type=" + valueType.name() + ", encoding id=" + params.id.name()); } encoding.fromByteArray(params.params); this.codec = encoding.buildCodec(null, outputMap); this.bitOutputStream = bitOutputStream; }
Source:
private Credentials getCredentialsFromFactory(ClientConfig config) { CredentialsFactoryConfig credentialsFactoryConfig = config.getSecurityConfig().getCredentialsFactoryConfig(); ICredentialsFactory factory = credentialsFactoryConfig.getImplementation(); if (factory == null) { String factoryClassName = credentialsFactoryConfig.getClassName(); if (factoryClassName != null) { try { factory = ClassLoaderUtil.newInstance(config.getClassLoader(), factoryClassName); } catch (Exception e) { throw rethrow(e); } } } if (factory == null) { return null; } factory.configure(config.getGroupConfig(), credentialsFactoryConfig.getProperties()); Credentials credentials = factory.newCredentials(); factory.destroy(); return credentials; }

Target:
private ICredentialsFactory getCredentialsFromFactory(ClientConfig config) { CredentialsFactoryConfig credentialsFactoryConfig = config.getSecurityConfig().getCredentialsFactoryConfig(); ICredentialsFactory factory = credentialsFactoryConfig.getImplementation(); if (factory == null) { String factoryClassName = credentialsFactoryConfig.getClassName(); if (factoryClassName != null) { try { factory = ClassLoaderUtil.newInstance(config.getClassLoader(), factoryClassName); } catch (Exception e) { throw rethrow(e); } } } if (factory == null) { return null; } factory.configure(config.getGroupConfig(), credentialsFactoryConfig.getProperties()); return factory; }
Source:
public void writeStartpoint(SystemStreamPartition ssp, Startpoint startpoint) { Preconditions.checkNotNull(metadataStore, "Underlying metadata store not available"); Preconditions.checkNotNull(ssp, "SystemStreamPartition cannot be null"); Preconditions.checkNotNull(startpoint, "Startpoint cannot be null"); try { metadataStore.put(toStoreKey(ssp), startpointSerde.toBytes(startpoint.copyWithStoredAt(Instant.now().toEpochMilli()))); } catch (Exception ex) { throw new SamzaException(String.format( "Startpoint for SSP: %s may not have been written to the metadata store.", ssp), ex); } }

Target:
public void writeStartpoint(SystemStreamPartition ssp, Startpoint startpoint) { writeStartpoint(ssp, null, startpoint); }
Source:
@Override public Spliterator<T> spliterator() { return iterExec == null ? QueryCursorEx.super.spliterator() : iterExec.spliterator(); }

Target:
@Override public Spliterator<T> spliterator() { return iterExec.spliterator(); }
Source:
protected LdapUser populateUserData(LdapUser user, String domain) { if (user == null) { return null; } user.setDomainControler(domain); java.util.HashMap<String, LdapGroup> groupsDict = new java.util.HashMap<String, LdapGroup>(); GroupsDNQueryGenerator generator = new GroupsDNQueryGenerator(); proceedGroupsSearchResult(user.getMemberof(), groupsDict, generator); user.setGroups(groupsDict); if (user.getUserName() != null && !user.getUserName().contains("@")) { user.setUserName(user.getUserName() + user.getDomainControler()); } return user; }

Target:
protected LdapUser populateUserData(LdapUser user, String domain) { if (user == null) { return null; } user.setDomainControler(domain); java.util.HashMap<String, LdapGroup> groupsDict = new java.util.HashMap<String, LdapGroup>(); GroupsDNQueryGenerator generator = new GroupsDNQueryGenerator(); proceedGroupsSearchResult(user.getMemberof(), groupsDict, generator); user.setGroups(groupsDict); if (user.getUserName() != null && !user.getUserName().contains("@")) { user.setUserName(user.getUserName() + "@" + user.getDomainControler()); } return user; }
Source:
private void updateData(OCShare share) { share.setPath(mPath); if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) { share.setIsFolder(true); } else { share.setIsFolder(false); } share.setPermissions(mPermissions); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink()); mSendIntent.putExtra(Intent.EXTRA_SUBJECT, getClient().getCredentials().getUsername() + " shared >>" + file.getFileName() + "<< with you"); file.setPublicLink(share.getShareLink()); file.setShareByLink(true); getStorageManager().saveFile(file); Log_OC.d(TAG, "Public Link = " + file.getPublicLink()); } }

Target:
private void updateData(OCShare share) { share.setPath(mPath); if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) { share.setIsFolder(true); } else { share.setIsFolder(false); } share.setPermissions(mPermissions); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink()); mSendIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(mContext.getString(R.string.subject_token), getClient().getCredentials().getUsername(), mContext.getString(R.string.shared_subject_header), file.getFileName(), mContext.getString(R.string.with_you_subject_header))); file.setPublicLink(share.getShareLink()); file.setShareByLink(true); getStorageManager().saveFile(file); Log_OC.d(TAG, "Public Link = " + file.getPublicLink()); } }
Source:
protected Event doExecute(final RequestContext context) throws Exception { final String activeFlow = context.getActiveFlow().getId(); final MultifactorAuthenticationProvider provider = ApplicationContextProvider.getApplicationContext() .getBeansOfType(MultifactorAuthenticationProvider.class) .entrySet().stream().filter(e -> e.getKey().startsWith(activeFlow)) .map(e -> e.getValue()) .findFirst().get(); if (provider != null) { context.getFlowScope().put("provider", provider); return success(); } return error(); }

Target:
protected Event doExecute(final RequestContext context) throws Exception { final ApplicationContext applicationContext = ApplicationContextProvider.getApplicationContext(); final String activeFlow = context.getActiveFlow().getId(); final Optional<MultifactorAuthenticationProvider> provider = applicationContext .getBeansOfType(MultifactorAuthenticationProvider.class) .entrySet().stream().filter(e -> e.getKey().startsWith(activeFlow)) .map(e -> e.getValue()) .findFirst(); if (provider.isPresent()) { context.getFlowScope().put("provider", provider); return success(); } return error(); }
Source:
public CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest(catalogFramework.getId(), filterBuilder); Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); List<Result> results; if (cqlRequest.getCount() == 0) { results = retrieveHitCount(request, responses); } else { results = retrieveResults(cqlRequest, request, responses); } QueryResponse aggregatedResponse = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1L), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); Set<ProcessingDetails> detailsOfAggregatedResponse = aggregatedResponse.getProcessingDetails(); for (QueryResponse response : responses) { detailsOfAggregatedResponse.addAll(response.getProcessingDetails()); } stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, aggregatedResponse, cqlRequest.getSourceResponseString(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry, descriptors); }

Target:
public CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest(catalogFramework.getId(), filterBuilder); Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); List<Result> results; if (cqlRequest.getCount() == 0) { results = retrieveHitCount(request, responses); } else { results = retrieveResults(cqlRequest, request, responses); } QueryResponse aggregatedResponse = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1L), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); responses .stream() .map(QueryResponse::getProcessingDetails) .forEach(aggregatedResponse.getProcessingDetails()::addAll); stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, aggregatedResponse, cqlRequest.getSourceResponseString(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry, descriptors); }
Source:
public void sync() { if (!ReleaseUtil.isPreBetaRelease() || !User.isLoggedIn() || !isReadingListSyncEnabled()) { syncSavedPages(); if (Prefs.isReadingListsRemoteDeletePending()) { deleteRemoteReadingLists(); } L.d("Skipped sync of reading lists."); return; } CallbackTask.execute(new CallbackTask.Task<Void>() { @Override public Void execute() { try { UserInfo info = UserOptionDataClientSingleton.instance().get(); synchronized (ReadingListSynchronizer.this) { long localRev = Prefs.getReadingListSyncRev(); RemoteReadingLists remoteReadingLists = null; for (UserOption option : info.userjsOptions()) { if (READING_LISTS_SYNC_OPTION.equals(option.key())) { remoteReadingLists = GsonUnmarshaller .unmarshal(RemoteReadingLists.class, option.val()); } } if ((remoteReadingLists == null) || (remoteReadingLists.rev() < localRev)) { if (localRev == 0) { bumpRev(); } L.d("Pushing local reading lists to server."); UserOptionDataClientSingleton.instance() .post(new UserOption(READING_LISTS_SYNC_OPTION, GsonMarshaller.marshal(makeRemoteReadingLists()))); } else if (localRev < remoteReadingLists.rev()) { L.d("Updating local reading lists from server."); reconcileAsRightJoin(remoteReadingLists); Prefs.setReadingListSyncRev(remoteReadingLists.rev()); WikipediaApp.getInstance().getOnboardingStateMachine().setReadingListTutorial(); } else { L.d("Local and remote reading lists are in sync."); } } syncSavedPages(); } catch (IOException e) { e.printStackTrace(); } return null; } }, null); }

Target:
public void sync() { if (!ReleaseUtil.isPreBetaRelease() || !User.isLoggedIn() || !(isReadingListSyncEnabled() || isReadingListsRemoteDeletePending())) { syncSavedPages(); L.d("Skipped sync of reading lists."); return; } CallbackTask.execute(new CallbackTask.Task<Void>() { @Override public Void execute() { try { UserInfo info = UserOptionDataClientSingleton.instance().get(); synchronized (ReadingListSynchronizer.this) { long localRev = Prefs.getReadingListSyncRev(); RemoteReadingLists remoteReadingLists = null; for (UserOption option : info.userjsOptions()) { if (READING_LISTS_SYNC_OPTION.equals(option.key())) { remoteReadingLists = GsonUnmarshaller .unmarshal(RemoteReadingLists.class, option.val()); } } if ((remoteReadingLists == null) || (remoteReadingLists.rev() < localRev)) { if (localRev == 0) { bumpRev(); } L.d("Pushing local reading lists to server."); UserOptionDataClientSingleton.instance() .post(new UserOption(READING_LISTS_SYNC_OPTION, GsonMarshaller.marshal(makeRemoteReadingLists()))); } else if (localRev < remoteReadingLists.rev()) { L.d("Updating local reading lists from server."); reconcileAsRightJoin(remoteReadingLists); Prefs.setReadingListSyncRev(remoteReadingLists.rev()); WikipediaApp.getInstance().getOnboardingStateMachine().setReadingListTutorial(); } else { L.d("Local and remote reading lists are in sync."); if (isReadingListsRemoteDeletePending()) { deleteRemoteReadingLists(); } } } syncSavedPages(); } catch (IOException e) { e.printStackTrace(); } return null; } }, null); }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("Skipping pgpverify:check"); } else { final SkipFilter dependencyFilter = prepareDependencyFilters(); final SkipFilter pluginFilter = preparePluginFilters(); prepareForKeys(); final ArtifactResolver resolver = new ArtifactResolver(getLog(), repositorySystem, localRepository, remoteRepositories); final Configuration config = new Configuration(dependencyFilter, pluginFilter, this.verifyPomFiles, this.verifyPlugins, this.verifyPluginDependencies, this.verifyAtypical); final Set<Artifact> artifacts = resolver.resolveProjectArtifacts(this.project, config); getLog().info("Validating " + artifacts.size() + " artifacts ..."); getLog().debug("Discovered project artifacts: " + artifacts); final SignatureRequirement signaturePolicy = determineSignaturePolicy(); final Map<Artifact, Artifact> artifactMap = resolver.resolveSignatures(artifacts, signaturePolicy); verifyArtifactSignatures(artifactMap); } }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("Skipping pgpverify:check"); } else { final SkipFilter dependencyFilter = prepareDependencyFilters(); final SkipFilter pluginFilter = preparePluginFilters(); prepareForKeys(); final ArtifactResolver resolver = new ArtifactResolver(getLog(), repositorySystem, localRepository, remoteRepositories); final Configuration config = new Configuration(dependencyFilter, pluginFilter, this.verifyPomFiles, this.verifyPlugins, this.verifyPluginDependencies, this.verifyAtypical); final Set<Artifact> artifacts = resolver.resolveProjectArtifacts(this.project, config); getLog().info("Validating " + artifacts.size() + " artifacts ..."); if (getLog().isDebugEnabled()) { getLog().debug("Discovered project artifacts: " + artifacts); } final SignatureRequirement signaturePolicy = determineSignaturePolicy(); final Map<Artifact, Artifact> artifactMap = resolver.resolveSignatures(artifacts, signaturePolicy); verifyArtifactSignatures(artifactMap); } }
Source:
private boolean changedProductsInSet(Set<Product> products, Map<String, Product> changedProducts) { if (products != null && changedProducts != null) { for (Product product: products) { if (product != null && product.getId() != null && changedProducts.get(product.getId()) != null) { return true; } } } return false; }

Target:
private boolean changedProductsInSet(Set<Product> products, Map<String, Product> changedProducts) { if (products != null && changedProducts != null) { for (Product product : products) { if (product != null && changedProducts.get(product.getId()) != null) { return true; } } } return false; }
Source:
private void createIntegerAccessor() { accessors.put(Integer.class, new Accessor<Integer>() { @Override public Integer get(String key, Integer defaultValue) { return preferences.getInt(key, (defaultValue == null) ? 0 : defaultValue); } @Override public void put(String key, Integer value) { editor.putInt(key, value).apply(); } }); }

Target:
private void createIntegerAccessor() { accessors.put(Integer.class, new Accessor<Integer>() { @Override public Integer get(String key) { return preferences.getInt(key, 0); } @Override public void put(String key, Integer value) { editor.putInt(key, value).apply(); } }); }
Source:
public String get() { if (SystemInfo.isWindows()) { return System.getProperty("user.home") + "\\AppData\\Local\\che\\ext-conf"; } else { final String localConfDir = System.getenv(CheBootstrap.CHE_LOCAL_CONF_DIR); String pathToExtConfDir = localConfDir == null ? "" : localConfDir + File.separator + "ext"; if (!pathToExtConfDir.isEmpty() && new File(pathToExtConfDir).isDirectory()) { return pathToExtConfDir + ":" + EXT_CHE_LOCAL_CONF_DIR + ":ro"; } else { return ""; } } }

Target:
public String get() { if (SystemInfo.isWindows()) { return System.getProperty("user.home") + "\\AppData\\Local\\che\\ext-conf" + CONTAINER_TARGET; } String localConfDir = System.getenv(CheBootstrap.CHE_LOCAL_CONF_DIR); if (localConfDir != null) { File extConfDir = new File(localConfDir, "ext"); if (extConfDir.isDirectory()) { return extConfDir.getAbsolutePath() + CONTAINER_TARGET; } } return null; }