auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected java.util.ArrayList<StorageDomain> parseVGList(Map<String, Object>[] vgList) { java.util.ArrayList<StorageDomain> result = new java.util.ArrayList<StorageDomain>(vgList.length); for (Map<String, Object> vg : vgList) { StorageDomain sDomain = new StorageDomain(); if (vg.containsKey("name")) { try { sDomain.setId(new Guid(vg.get("name").toString())); } catch (java.lang.Exception e) { sDomain.setStorageName(vg.get("name").toString()); } } sDomain.setStorage(vg.get("vgUUID").toString()); Long size = IrsBrokerCommand.AssignLongValue(vg, "vgfree"); if (size != null) { sDomain.setAvailableDiskSize((int) (size / SizeConverter.BYTES_IN_GB)); } size = IrsBrokerCommand.AssignLongValue(vg, "vgsize"); if (size != null && sDomain.getAvailableDiskSize() != null) { sDomain.setUsedDiskSize((int) (size / SizeConverter.BYTES_IN_GB) - sDomain.getAvailableDiskSize()); } if (vg.containsKey("vgtype")) { sDomain.setStorageType(EnumUtils.valueOf(StorageType.class, vg.get("vgtype").toString(), true)); } else { <START> sDomain.setStorageType(StorageType.UNKNOWN); <END> } result.add(sDomain); } return result; }</code><technical_language>upgrade? older version users persisted in db? if possible, removing upgrade script possibly issues</technical_language>

Target:
protected java.util.ArrayList<StorageDomain> parseVGList(Map<String, Object>[] vgList) { java.util.ArrayList<StorageDomain> result = new java.util.ArrayList<StorageDomain>(vgList.length); for (Map<String, Object> vg : vgList) { StorageDomain sDomain = new StorageDomain(); if (vg.containsKey("name")) { try { sDomain.setId(new Guid(vg.get("name").toString())); } catch (java.lang.Exception e) { sDomain.setStorageName(vg.get("name").toString()); } } sDomain.setStorage(vg.get("vgUUID").toString()); Long size = IrsBrokerCommand.AssignLongValue(vg, "vgfree"); if (size != null) { sDomain.setAvailableDiskSize((int) (size / IrsBrokerCommand.BYTES_TO_GB)); } size = IrsBrokerCommand.AssignLongValue(vg, "vgsize"); if (size != null && sDomain.getAvailableDiskSize() != null) { sDomain.setUsedDiskSize((int) (size / IrsBrokerCommand.BYTES_TO_GB) - sDomain.getAvailableDiskSize()); } if (vg.containsKey("vgtype")) { sDomain.setStorageType(EnumUtils.valueOf(StorageType.class, vg.get("vgtype").toString(), true)); } else { sDomain.setStorageType(StorageType.UNKNOWN); } result.add(sDomain); } return result; }
Source:
<code>public void sendPasswordResetLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws InternalErrorException, PrivilegeException, MemberNotExistsException, UserNotExistsException, AttributeNotExistsException { Utils.checkPerunSession(sess); getMembersManagerBl().checkMemberExists(sess, member); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, member)) { throw new PrivilegeException(sess, "sendPasswordResetLinkEmail"); } Attribute mailAttribute = null; AttributeDefinition ad = getPerunBl().getAttributesManager().getAttributeDefinition(sess, mailAttributeUrn); try { if (ad.getEntity().equals("user")) { User user = perunBl.getUsersManagerBl().getUserByMember(sess, member); mailAttribute = getPerunBl().getAttributesManager().getAttribute(sess, user, mailAttributeUrn); } if (ad.getEntity().equals("member")) { mailAttribute = getPerunBl().getAttributesManager().getAttribute(sess, member, mailAttributeUrn); } } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } <START> if (mailAttribute != null) { <END> String mailAddress = mailAttribute.valueAsString(); getMembersManagerBl().sendPasswordResetLinkEmail(sess, member, namespace, url, mailAddress, language); } }</code><technical_language>This is a correct fix. mailAttribute null if attributeDefinition is user member attribute. Instead, if is null, throw some Exception. I suggest throwing InternalErrorException Exception for this case</technical_language>

Target:
public void sendPasswordResetLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws InternalErrorException, PrivilegeException, MemberNotExistsException, UserNotExistsException, AttributeNotExistsException { Utils.checkPerunSession(sess); getMembersManagerBl().checkMemberExists(sess, member); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, member)) { throw new PrivilegeException(sess, "sendPasswordResetLinkEmail"); } Attribute mailAttribute = null; AttributeDefinition ad = getPerunBl().getAttributesManager().getAttributeDefinition(sess, mailAttributeUrn); try { if (ad.getEntity().equals("user")) { User user = perunBl.getUsersManagerBl().getUserByMember(sess, member); mailAttribute = getPerunBl().getAttributesManager().getAttribute(sess, user, mailAttributeUrn); } if (ad.getEntity().equals("member")) { mailAttribute = getPerunBl().getAttributesManager().getAttribute(sess, member, mailAttributeUrn); } } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } if (mailAttribute == null) { throw new InternalErrorException("MailAttribute should not be null."); } String mailAddress = mailAttribute.valueAsString(); getMembersManagerBl().sendPasswordResetLinkEmail(sess, member, namespace, url, mailAddress, language); }
Source:
<code>public void testNoAdminPasswordCfgFile() throws Exception { MasterDaemon md = new MasterDaemon(workingDir, REST_PORT); md.start(); Client client = ClientBuilder.newClient(); Invocation.Builder invocation = client.target("http://localhost:" + REST_PORT + "/server/deployment_cfg").request(MediaType.TEXT_PLAIN_TYPE); Response response = invocation.get(); assertEquals(Status.OK.getStatusCode(), response.getStatus()); String respond = response.readEntity(String.class); <START> assertTrue(respond.equals(Paths.get(workingDir, MyriaConstants.DEPLOYMENT_CONF_FILE).toString())); <END> client.close(); md.stop(); }</code><technical_language>assertEquals</technical_language>

Target:
public void testNoAdminPasswordCfgFile() throws Exception { MasterDaemon md = new MasterDaemon(workingDir, REST_PORT); md.start(); Client client = ClientBuilder.newClient(); Invocation.Builder invocation = client.target("http://localhost:" + REST_PORT + "/server/deployment_cfg").request(MediaType.TEXT_PLAIN_TYPE); Response response = invocation.get(); assertEquals(Status.OK.getStatusCode(), response.getStatus()); String respond = response.readEntity(String.class); assertEquals(Paths.get(workingDir, MyriaConstants.DEPLOYMENT_CONF_FILE).toString(), respond); client.close(); md.stop(); }
Source:
<code>public void execute() { log.info("method executing started"); <START> generateUICForPatientsWithout(); <END> }</code><technical_language>this job delete disable completed running. I a time Job</technical_language>

Target:
public void execute() { log.info("method executing started"); aijarService.generateAndSaveUICForPatientsWithOut(); }
Source:
<code>protected void onStart() { final long interval = 10 * 20L; final File databaseFile = getDatabase(); if (!ConfigEntry.COREPROTECT_AUTO_WIPING_ENABLED.getBoolean() || getCoreProtect() == null) { return; } wiper = new BukkitRunnable() { @Override <START> public void run() <END> { final CoreProtect coreProtect = getCoreProtect(); double bytes = databaseFile.length(); double kilobytes = (bytes / 1024); double megabytes = (kilobytes / 1024); double gigabytes = (megabytes / 1024); if (gigabytes > ConfigEntry.COREPROTECT_FILE_LIMIT.getInteger()) { FLog.info("The CoreProtect log file has grown too big for the server to cope, the data will be wiped!"); PluginManager pluginManager = server.getPluginManager(); pluginManager.disablePlugin(coreProtect); FUtil.deleteFolder(databaseFile); pluginManager.enablePlugin(coreProtect); } } }.runTaskTimer(plugin, interval, interval); }</code><technical_language>is of this onStart section? This split out called instead of located here...</technical_language>

Target:
protected void onStart() { if (ConfigEntry.COREPROTECT_AUTO_WIPING_ENABLED.getBoolean() && getCoreProtect() != null) { createAutomaticWiper(); } }
Source:
<code>private void cleanup() { OkHttpClient httpClient = getHttpClient(); try { if (httpClient.connectionPool() != null) { httpClient.connectionPool().evictAll(); } <START> if (httpClient.dispatcher() != null <END> && httpClient.dispatcher().executorService() != null && !httpClient.dispatcher().executorService().isShutdown()) { httpClient.dispatcher().executorService().shutdown(); } } catch (RuntimeException ex) { LOG.error(ex.getMessage()); } }</code><technical_language>I is shutdown dispatcher evicting connection pool. some probability dispatcher open new connection evicting existing ones. WDYT</technical_language>

Target:
private void cleanup() { try { doCleanup(); } catch (RuntimeException ex) { LOG.error(ex.getMessage()); } }
Source:
<code>private GraphicsInfo getGraphicsInfo() { final VM vm = vmDao.get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { throw new RuntimeException( <START> String.format("Vm id=%s can't be obtained. Insufficient permissions?", getParameters().getVmId())); <END> } final GraphicsInfo graphicsInfo = vm.getGraphicsInfos().get(getParameters().getGraphicsType()); if (graphicsInfo == null) { throw new RuntimeException( String.format( "Graphics console can't be obtained, vmid=%s console=%s. Is vm ready for connecting to console?", getParameters().getVmId(), getParameters().getGraphicsType())); } return graphicsInfo; }</code><technical_language>create EngineError key a message in vdsmerrors.{java/properties} files throw a EngineException this key this message translated user infra. also, hint permission, "could find vm" similar</technical_language>

Target:
private GraphicsInfo getGraphicsInfo() { final VM vm = vmDao.get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { throw new EngineException(EngineError.VMCantBeObtained, String.format("vmid=%s", getParameters().getVmId())); } final GraphicsInfo graphicsInfo = vm.getGraphicsInfos().get(getParameters().getGraphicsType()); if (graphicsInfo == null) { throw new EngineException(EngineError.GraphicsConsoleCantBeObtained, String.format( "vmid=%s console=%s", getParameters().getVmId(), getParameters().getGraphicsType())); } return graphicsInfo; }
Source:
<code>void serve(final HttpServletRequest req, final HttpServletResponse rsp, final boolean sendBody) throws IOException { if (!initRangeRequest(req, rsp)) { rsp.sendError(SC_REQUESTED_RANGE_NOT_SATISFIABLE); return; } rsp.setHeader(HDR_ACCEPT_RANGES, "bytes"); rsp.setContentLength((int) (end - pos)); if (sendBody) { final OutputStream out = rsp.getOutputStream(); try { final byte[] buf = new byte[4096]; while (pos < end) { <START> final int r = Math.min(buf.length, (int) (end - pos)); <END> final int n = source.read(buf, 0, r); if (n < 0) { throw new EOFException("Unexpected EOF on " + path); } out.write(buf, 0, n); pos += n; } out.flush(); } finally { out.close(); } } }</code><technical_language>I dont' this work for large end-pos</technical_language>

Target:
void serve(final HttpServletRequest req, final HttpServletResponse rsp, final boolean sendBody) throws IOException { if (!initRangeRequest(req, rsp)) { rsp.sendError(SC_REQUESTED_RANGE_NOT_SATISFIABLE); return; } rsp.setHeader(HDR_ACCEPT_RANGES, "bytes"); rsp.setHeader(HDR_CONTENT_LENGTH, Long.toString(end - pos)); if (sendBody) { final OutputStream out = rsp.getOutputStream(); try { final byte[] buf = new byte[4096]; while (pos < end) { final int r = (int) Math.min(buf.length, end - pos); final int n = source.read(buf, 0, r); if (n < 0) { throw new EOFException("Unexpected EOF on " + path); } out.write(buf, 0, n); pos += n; } out.flush(); } finally { out.close(); } } }
Source:
<code>private static void convertRowTypesToOutputTypes(List<DimensionSpec> dimensionSpecs, Map<String, Object> rowMap) { for (DimensionSpec dimSpec : dimensionSpecs) { <START> Object baseVal = rowMap.get(dimSpec.getOutputName()); <END> switch (dimSpec.getOutputType()) { case STRING: baseVal = baseVal == null ? "" : baseVal.toString(); break; case LONG: baseVal = DimensionHandlerUtils.convertObjectToLong(baseVal); baseVal = baseVal == null ? 0L : baseVal; break; case FLOAT: baseVal = DimensionHandlerUtils.convertObjectToFloat(baseVal); baseVal = baseVal == null ? 0.f : baseVal; break; default: throw new IAE("Unsupported type: " + dimSpec.getOutputType()); } rowMap.put(dimSpec.getOutputName(), baseVal); } }</code><technical_language>rowMap.compute(...)</technical_language>

Target:
private static void convertRowTypesToOutputTypes(List<DimensionSpec> dimensionSpecs, Map<String, Object> rowMap) { for (DimensionSpec dimSpec : dimensionSpecs) { final ValueType outputType = dimSpec.getOutputType(); rowMap.compute( dimSpec.getOutputName(), (dimName, baseVal) -> { switch (outputType) { case STRING: baseVal = baseVal == null ? "" : baseVal.toString(); break; case LONG: baseVal = DimensionHandlerUtils.convertObjectToLong(baseVal); baseVal = baseVal == null ? 0L : baseVal; break; case FLOAT: baseVal = DimensionHandlerUtils.convertObjectToFloat(baseVal); baseVal = baseVal == null ? 0.f : baseVal; break; default: throw new IAE("Unsupported type: " + outputType); } return baseVal; } ); } }
Source:
<code>private void cleanup() { try { if (httpClient.connectionPool() != null) { <START> httpClient.connectionPool().evictAll(); <END> } if (httpClient.dispatcher() != null && httpClient.dispatcher().executorService() != null && !httpClient.dispatcher().executorService().isShutdown()) { httpClient.dispatcher().executorService().shutdown(); } } catch (RuntimeException ex) { LOG.error(ex.getMessage()); } }</code><technical_language>this method protected call OpenshiftClientFactory avoid duplicated code. WDYT</technical_language>

Target:
private void cleanup() { try { doCleanup(); } catch (RuntimeException ex) { LOG.error(ex.getMessage()); } }
Source:
<code><START> public void show() { <END> this.atlas = new TextureAtlas("uiskin.atlas"); this.skin = new Skin(Gdx.files.internal("uiskin.json"), this.atlas); this.stage = new Stage(); Texture texture = new Texture( Gdx.files.internal("assets/data/loading.jpeg")); TextureRegion region = new TextureRegion(texture, 0, 0, 1920, 1080); Image image = new Image(region); image.setFillParent(true); this.stage.addActor(image); this.timer = new Label("Time till game start: ", this.skin); this.timer.setPosition(1200, 540); this.stage.addActor(this.timer); this.counter = new Label("Connected: ", this.skin); this.counter.setPosition(1200, 500); this.stage.addActor(this.counter); this.startTimer(5); }</code><technical_language>Split smaller chunks</technical_language>

Target:
public void show() { this.atlas = new TextureAtlas("assets/uiskin.atlas"); this.skin = new Skin(Gdx.files.internal("assets/uiskin.json"), this.atlas); this.stage = new Stage(); Texture texture = new Texture( Gdx.files.internal("assets/data/loading.jpeg")); TextureRegion region = new TextureRegion(texture, 0, 0, (int) DesktopLauncher.WIDTH, (int) DesktopLauncher.HEIGHT); Image image = new Image(region); image.setFillParent(true); this.stage.addActor(image); this.createTimerLabel(); this.createCounterLabel(); this.startTimer(2); }
Source:
<code>public void test() { connect(); jq(".z-listbox-body").scrollTop(10000); <START> waitResponse(); <END> Assert.assertTrue(jq("@listcell:contains(199)").exists()); }</code><technical_language>need wait scrollTop</technical_language>

Target:
public void test() { connect(); waitResponse(); jq(".z-listbox-body").scrollTop(10000); waitResponse(); Assert.assertTrue(jq("@listcell:contains(199)").exists()); }
Source:
<code>public void downloadTransformation(HttpServletResponse response) throws IOException { InputStream inputStream = new ByteArrayInputStream(result.getBytes(StandardCharsets.UTF_8)); response.setContentLength(result.length()); response.setHeader("Content-Disposition", String.format("attachment; filename=" + "TransformationResult")); <START> FileCopyUtils.copy(inputStream, response.getOutputStream()); <END> }</code><technical_language>if result is null</technical_language>

Target:
public String downloadTransformation(HttpServletResponse response) throws IOException { if (result == null) { return "auth/transformation/failureTransformation"; } InputStream inputStream = new ByteArrayInputStream(result.getBytes(StandardCharsets.UTF_8)); response.setContentLength(result.length()); response.setHeader("Content-Disposition", String.format("attachment; filename=" + "TransformationResult.graphml")); FileCopyUtils.copy(inputStream, response.getOutputStream()); return null; }
Source:
<code>public void addCluster(String clusterName, boolean overwritePrevious, CloudConfig cloudConfig) throws HelixException { _admin.addCluster(clusterName, overwritePrevious); for (BuiltInStateModelDefinitions def : BuiltInStateModelDefinitions.values()) { addStateModelDef(clusterName, def.getStateModelDefinition().getId(), def.getStateModelDefinition(), overwritePrevious); } if (cloudConfig != null) { _admin.addCloudConfig(clusterName, cloudConfig); <START> if (cloudConfig.isCloudEnabled() <END> && cloudConfig.getCloudProvider().equals(CloudProvider.AZURE.name())) { ConfigAccessor configAccessor = new ConfigAccessor(_zkServerAddress); ClusterConfig clusterConfig = new ClusterConfig(clusterName); clusterConfig.setTopology("/helixZoneId/host"); clusterConfig.setTopologyAwareEnabled(true); clusterConfig.setFaultZoneType("helixZoneId"); configAccessor.updateClusterConfig(clusterName, clusterConfig); } } }</code><technical_language>1. update cloudconfig add cluster? ZK access. 2. If config is required for AZURE, add a more fundamental method instead of tool? if user call other API admin method create a cluster is compatible</technical_language>

Target:
public void addCluster(String clusterName, boolean overwritePrevious, CloudConfig cloudConfig) throws HelixException { _admin.addCluster(clusterName, overwritePrevious); for (BuiltInStateModelDefinitions def : BuiltInStateModelDefinitions.values()) { addStateModelDef(clusterName, def.getStateModelDefinition().getId(), def.getStateModelDefinition(), overwritePrevious); } if (cloudConfig != null) { _admin.addCloudConfig(clusterName, cloudConfig); if (cloudConfig.isCloudEnabled() && cloudConfig.getCloudProvider().equals(CloudProvider.AZURE.name())) { ConfigAccessor configAccessor = new ConfigAccessor(_zkServerAddress); ClusterConfig clusterConfig = new ClusterConfig(clusterName); clusterConfig.setTopology(AzureConstants.AZURE_TOPOLOGY); clusterConfig.setTopologyAwareEnabled(true); clusterConfig.setFaultZoneType(AzureConstants.AZURE_FAULT_ZONE_TYPE); configAccessor.updateClusterConfig(clusterName, clusterConfig); } } }
Source:
<code>private byte[] encrypt(final byte[] bytes) throws IOException { try { final Cipher cipher = Cipher.getInstance(ALGORITHM); final AlgorithmParameterSpec spec = <START> new IvParameterSpec(this.ivbytes); <END> cipher.init(Cipher.ENCRYPT_MODE, this.secret, spec); return cipher.doFinal(bytes); } catch (final InvalidKeyException ike) { throw new IOException(ike); } catch (final NoSuchAlgorithmException nse) { throw new IOException(nse); } catch (final NoSuchPaddingException nspe) { throw new IOException(nspe); } catch (final InvalidAlgorithmParameterException iape) { throw new IOException(iape); } catch (final IllegalBlockSizeException ibse) { throw new IOException(ibse); } catch (final BadPaddingException bpe) { throw new IOException(bpe); } }</code><technical_language>@super132 init decrypt/encrypt ciphers in Ctor, need create this time</technical_language>

Target:
private byte[] encrypt(final byte[] bytes) throws IOException { try { return this.enc.doFinal(bytes); } catch (final GeneralSecurityException gse) { throw new IOException(gse); } }
Source:
<code>public List<HostAddress> getAddresses() { <START> return ImmutableList.of(); <END> }</code><technical_language>Do wanna return ImmutableList.of(address) this is intensionally</technical_language>

Target:
public List<HostAddress> getAddresses() { return ImmutableList.of(address); }
Source:
<code>public Set<AccountGroup.Id> getEffectiveGroups() { if (effectiveGroups == null) { <START> Set<AccountGroup.Id> seedGroups = new HashSet<AccountGroup.Id> (); <END> if (authConfig.isIdentityTrustable(state().getExternalIds())) { seedGroups = realm.groups(state()); } else { seedGroups = authConfig.getRegisteredGroups(); } effectiveGroups = getIncludedGroups(seedGroups); } return effectiveGroups; }</code><technical_language>is need initialize variable here, branch directions assign variable discard this HashSet</technical_language>

Target:
public Set<AccountGroup.Id> getEffectiveGroups() { if (effectiveGroups == null) { Set<AccountGroup.Id> seedGroups; if (authConfig.isIdentityTrustable(state().getExternalIds())) { seedGroups = realm.groups(state()); } else { seedGroups = authConfig.getRegisteredGroups(); } effectiveGroups = getIncludedGroups(seedGroups); } return effectiveGroups; }
Source:
<code>private void validateDepDefinitionUniqueness(final List<TriggerDependencyBean> dependencies) { final Set<String> seen = new HashSet<>(); for (final TriggerDependencyBean dep : dependencies) { final Map<String, String> props = dep.getParams(); <START> Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format <END> ("duplicate " + "dependency" + "config %s found, dependency config should be unique", dep.getName())); } }</code><technical_language>If params for deps content in order, check fail</technical_language>

Target:
private void validateDepDefinitionUniqueness(final List<TriggerDependencyBean> dependencies) { for (int i = 0; i < dependencies.size(); i++) { for (int j = i + 1; j < dependencies.size(); j++) { final boolean duplicateDepDefFound = dependencies.get(i).getType().equals(dependencies.get(j) .getType()) && dependencies.get(i).getParams() .equals(dependencies.get(j).getParams()); Preconditions.checkArgument(!duplicateDepDefFound, String.format("duplicate dependency" + "config %s found, dependency config should be unique", dependencies.get(i).getName())); } } }
Source:
<code>public void testNameStrategyOnExistingFolders() throws Exception{ jenkins.setProjectNamingStrategy(new ProjectNamingStrategy.PatternProjectNamingStrategy("DUMMY.*", true)); try { Folder folder = jenkins.createProject(Folder.class, "DUMMY_folder"); assertNotNull("No folder created", folder); try { jenkins.createProject(Folder.class, "project"); fail("Should not get here, the folder name is not allowed, therefore the creation must fail!"); } catch (Failure failure) { } try { folder.renameTo("project"); folder.setDisplayName("project"); folder.save(); System.out.println(folder.getDisplayName()); fail("Should not be allowed to rename existing folder to invalid folder."); } catch (Failure failure) { } } finally { <START> jenkins.setProjectNamingStrategy(ProjectNamingStrategy.DEFAULT_NAMING_STRATEGY); <END> } }</code><technical_language>unnecessary, test jenkins</technical_language>

Target:
public void testNameStrategyOnExistingFolders() throws Exception{ jenkins.setProjectNamingStrategy(new ProjectNamingStrategy.PatternProjectNamingStrategy("DUMMY.*", true)); Folder folder = jenkins.createProject(Folder.class, "DUMMY_folder"); assertNotNull("No folder created", folder); try { jenkins.createProject(Folder.class, "project"); fail("Should not get here, the folder name is not allowed, therefore the creation must fail!"); } catch (Failure failure) { } try { folder.renameTo("project"); folder.setDisplayName("project"); folder.save(); System.out.println(folder.getDisplayName()); fail("Should not be allowed to rename existing folder to invalid folder."); } catch (Failure failure) { } }
Source:
<code>public Object[] getElements(final Object inputElement) { <START> if (needsRecompute) <END> { needsRecompute = false; FileDiffInput input = currentInput; if (input != null) { cancel(); FileDiffLoader job = new FileDiffLoader(input, markTreeFilter); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { if (!event.getResult().isOK()) { return; } UIJob updater = new UIJob(MessageFormat.format( UIText.FileDiffContentProvider_updatingFileDiffs, input.getCommit().getName())) { @Override public IStatus runInUIThread( IProgressMonitor monitor) { if (!viewer.getControl().isDisposed() && loader == job) { diff = job.getDiffs(); viewer.refresh(); FileDiff interesting = getFirstInterestingElement(); if (interesting != null) { if (input.isSelectMarked()) { viewer.setSelection( new StructuredSelection( interesting), true); } else { viewer.reveal(interesting); } } } return Status.OK_STATUS; } }; updater.schedule(); } }); job.setUser(false); job.setSystem(true); loader = job; loader.schedule(); } else { diff = null; } } return diff != null ? diff : new Object[0]; }</code><technical_language>If revert if return here, code easier read</technical_language>

Target:
public Object[] getElements(final Object inputElement) { if (!needsRecompute) { return diff != null ? diff : new Object[0]; } needsRecompute = false; FileDiffInput input = currentInput; if (input == null) { diff = null; return new Object[0]; } cancel(); FileDiffLoader job = new FileDiffLoader(input, markTreeFilter); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { if (!event.getResult().isOK()) { return; } UIJob updater = new UpdateJob(MessageFormat.format( UIText.FileDiffContentProvider_updatingFileDiffs, input.getCommit().getName()), job); updater.schedule(); } }); job.setUser(false); job.setSystem(true); loader = job; loader.schedule(); return new Object[0]; }
Source:
<code>public static <T> CompositeSubscription manageMultiViewModel( final Observable<? extends T> external, final Consumer<? super T> onExternal, final Scheduler externalScheduler, final Observable<? extends T> internal, final Consumer<? super T> onInternal, final Scheduler internalScheduler ) { <START> final SupressObservable<? extends T> es = new SupressObservable<>(external, externalScheduler, SUPPRESS_LEN); <END> final SupressObservable<? extends T> is = new SupressObservable<>(internal, internalScheduler, SUPPRESS_LEN); final CompositeSubscription sub = new CompositeSubscription(); sub.addAll( es.get().subscribe(v -> { is.supress(); onExternal.accept(v); }), is.get().subscribe(v -> { es.supress(); onInternal.accept(v); })); return sub; }</code><technical_language>I a suspicion this confirms it, "suppress" is spelled p's</technical_language>

Target:
public static <T> CompositeSubscription manageMultiViewModel( final Observable<? extends T> external, final Consumer<? super T> onExternal, final Scheduler externalScheduler, final Observable<? extends T> internal, final Consumer<? super T> onInternal, final Scheduler internalScheduler ) { final SuppressObservable<? extends T> es = new SuppressObservable<>(external, externalScheduler, SUPPRESS_LEN); final SuppressObservable<? extends T> is = new SuppressObservable<>(internal, internalScheduler, SUPPRESS_LEN); final CompositeSubscription sub = new CompositeSubscription(); sub.addAll( es.get().subscribe(v -> { is.supress(); onExternal.accept(v); }), is.get().subscribe(v -> { es.supress(); onInternal.accept(v); })); return sub; }
Source:
<code>private static long parseLimit(String limitStr, Map<String, Long> cvt) throws RetentionLimitException { if (StringUtils.isEmpty(limitStr)) { throw new RetentionLimitException("empty retention limit"); } String parse = limitStr.trim().toLowerCase(); if (parse.length() <= 2) { throw new RetentionLimitException("\"" + limitStr + "\" is too short for a retention limit"); } String qualifier = parse.substring(parse.length() - 2); if (!cvt.keySet().contains(qualifier)) { throw new RetentionLimitException("\"" + qualifier + "\" is not a valid limit qualifier: " + cvt.keySet() + " are the valid values"); } String valStr = parse.substring(0, parse.length() - 2); long limit = 0; try { limit = Long.parseLong(valStr.trim()); limit *= cvt.get(qualifier); } <START> catch (Exception ex) { <END> throw new RetentionLimitException("Failed to parse\"" + limitStr + "\": " + ex); } if (limit <= 0) { throw new RetentionLimitException("A retention limit must have a positive value"); } return limit; }</code><technical_language>catch specific exception. In this case, catch NumberFormatException</technical_language>

Target:
private static long parseLimit(String limitStr, Map<String, Long> cvt) throws RetentionLimitException { if (StringUtils.isEmpty(limitStr)) { throw new RetentionLimitException("empty retention limit"); } String parse = limitStr.trim().toLowerCase(); if (parse.length() <= 2) { throw new RetentionLimitException("\"" + limitStr + "\" is too short for a retention limit"); } String qualifier = parse.substring(parse.length() - 2); if (!cvt.keySet().contains(qualifier)) { throw new RetentionLimitException("\"" + qualifier + "\" is not a valid limit qualifier: " + cvt.keySet() + " are the valid values"); } String valStr = parse.substring(0, parse.length() - 2); long limit = 0; try { limit = Long.parseLong(valStr.trim()); limit *= cvt.get(qualifier); } catch (NumberFormatException ex) { throw new RetentionLimitException("Failed to parse\"" + limitStr + "\": " + ex); } if (limit <= 0) { throw new RetentionLimitException("A retention limit must have a positive value"); } return limit; }
Source:
<code>public void tokenRevocation(@PathVariable("id") final String id, @RequestHeader("Authorization") final String authorization) { User user = resourceServerConnector.getUserById(id); String searchKey = new User.Builder(user.getUserName()).setId(id).build().toString(); Collection<OAuth2AccessToken> tokens = tokenServices.findTokensByUserName(searchKey); <START> if (tokens == null) { <END> return; } for (OAuth2AccessToken token : new ArrayList<OAuth2AccessToken>(tokens)) { tokenServices.revokeToken(token.getValue()); } }</code><technical_language>is tokens is null this point</technical_language>

Target:
public void tokenRevocation(@PathVariable("id") final String id, @RequestHeader("Authorization") final String authorization) { User user = resourceServerConnector.getUserById(id); String searchKey = new User.Builder(user.getUserName()).setId(id).build().toString(); Collection<OAuth2AccessToken> tokens = tokenServices.findTokensByUserName(searchKey); for (OAuth2AccessToken token : new ArrayList<OAuth2AccessToken>(tokens)) { tokenServices.revokeToken(token.getValue()); } }
Source:
<code>public void onResume() { super.onResume(); themeUtils.onResume(this); setupStatusView(); <START> initializeGpsDataCollection(); <END> }</code><technical_language>GPS caps</technical_language>

Target:
public void onResume() { super.onResume(); themeUtils.onResume(this); setupStatusView(); initializeGPSDataCollection(); }
Source:
<code>public void testCreateLargeMatrix(){ final int numRows = 2500000; final int numCols = 10; final double mean = 3e-7; final RealMatrix bigCounts = new Array2DRowRealMatrix(numRows, numCols); final RandomDataGenerator randomDataGenerator = new RandomDataGenerator(); randomDataGenerator.reSeed(337337337); bigCounts.walkInColumnOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(int row, int column, double value) { return randomDataGenerator.nextGaussian(mean, 1e-9); } }); final File tempOutputHD5 = IOUtils.createTempFile("big-ol-", ".hd5"); final HDF5File hdf5File = new HDF5File(tempOutputHD5, HDF5File.OpenMode.CREATE); final String hdf5Path = "/test/m"; hdf5File.makeDoubleMatrix(hdf5Path, bigCounts.getData()); hdf5File.close(); final HDF5File hdf5FileForReading = new HDF5File(tempOutputHD5, HDF5File.OpenMode.READ_ONLY); final double[][] result = hdf5FileForReading.readDoubleMatrix(hdf5Path); Assert.assertTrue(result.length == numRows); <START> Assert.assertTrue(result[0].length == numCols); <END> final RealMatrix readMatrix = new Array2DRowRealMatrix(result); final double[] colMeans = GATKProtectedMathUtils.columnMeans(readMatrix); for (double m: colMeans) { Assert.assertEquals(m, mean, 1e-4); } }</code><technical_language>a bit cleaner construct RealMatrix check readMatrix.getColumnDimension() == numCols</technical_language>

Target:
public void testCreateLargeMatrix(){ final int numRows = 2500000; final int numCols = 10; final double mean = 3e-7; final double sigma = 1e-9; final RealMatrix bigCounts = createMatrixOfGaussianValues(numRows, numCols, mean, sigma); final File tempOutputHD5 = IOUtils.createTempFile("big-ol-", ".hd5"); final HDF5File hdf5File = new HDF5File(tempOutputHD5, HDF5File.OpenMode.CREATE); final String hdf5Path = "/test/m"; hdf5File.makeDoubleMatrix(hdf5Path, bigCounts.getData()); hdf5File.close(); final HDF5File hdf5FileForReading = new HDF5File(tempOutputHD5, HDF5File.OpenMode.READ_ONLY); final double[][] result = hdf5FileForReading.readDoubleMatrix(hdf5Path); final RealMatrix resultAsRealMatrix = new Array2DRowRealMatrix(result); Assert.assertTrue(resultAsRealMatrix.getRowDimension() == numRows); Assert.assertTrue(resultAsRealMatrix.getColumnDimension() == numCols); final RealMatrix readMatrix = new Array2DRowRealMatrix(result); PoNTestUtils.assertEqualsMatrix(readMatrix, bigCounts, false); }
Source:
<code>private RepositoryMapping(final @NonNull IContainer mappedContainer, final @NonNull IPath location, final @NonNull File gitDir) { container = mappedContainer; containerPathString = container.getProjectRelativePath() .toPortableString(); if (!gitDir.isAbsolute()) { gitDirPathString = Path.fromOSString(gitDir.getPath()) .removeTrailingSeparator().toPortableString(); return; } java.nio.file.Path gPath = gitDir.toPath(); java.nio.file.Path lPath = location.toFile().toPath(); if (lPath.getNameCount() > 0 && gPath.getNameCount() > 0 <START> && gPath.getRoot() != null && gPath.getRoot().equals(lPath.getRoot()) <END> && gPath.getName(0).equals(lPath.getName(0))) { gPath = lPath.relativize(gPath); } gitDirPathString = Path.fromOSString(gPath.toString()) .removeTrailingSeparator().toPortableString(); }</code><technical_language>this "either null, non-null equal()"? && (gPath.getRoot() == lPath.getRoot() || gPath.getRoot() != null && gPath.getRoot().equals(lPath.getRoot()))</technical_language>

Target:
private RepositoryMapping(final @NonNull IContainer mappedContainer, final @NonNull IPath location, final @NonNull File gitDir) { container = mappedContainer; containerPathString = container.getProjectRelativePath() .toPortableString(); if (!gitDir.isAbsolute()) { gitDirPathString = Path.fromOSString(gitDir.getPath()) .removeTrailingSeparator().toPortableString(); return; } java.nio.file.Path gPath = gitDir.toPath(); java.nio.file.Path lPath = location.toFile().toPath(); if (lPath.getNameCount() > 0 && gPath.getNameCount() > 0 && (gPath.getRoot() == lPath.getRoot() || gPath.getRoot() != null && gPath.getRoot().equals(lPath.getRoot())) && gPath.getName(0).equals(lPath.getName(0))) { gPath = lPath.relativize(gPath); } gitDirPathString = Path.fromOSString(gPath.toString()) .removeTrailingSeparator().toPortableString(); }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); <START> if (mShowNewEditor || mShowAztecEditor || mShowGutenbergEditor) { <END> inflater.inflate(R.menu.edit_post, menu); } else { inflater.inflate(R.menu.edit_post_legacy, menu); } return true; }</code><technical_language>Code logic good - I is expressions: - mShowNewEditor || mShowAztecEditor || mShowGutenbergEditor - !mShowNewEditor && !mShowAztecEditor && !mShowGutenbergEditor times (the 5 times, 2 times) move functions these?: private boolean isShowAnyNewEditor() { return (mShowNewEditor || mShowAztecEditor || mShowGutenbergEditor); } private boolean isDontShowAnyNewEditor() { return (!mShowNewEditor && !mShowAztecEditor && !mShowGutenbergEditor); }</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); if (isModernEditor()) { inflater.inflate(R.menu.edit_post, menu); } else { inflater.inflate(R.menu.edit_post_legacy, menu); } return true; }
Source:
<code>public Double getTruncatedMean(double lowerQuantile, double upperQuantile) { double sum = 0; double count = 0; double mean = 0; compress(); if (totalWeight == 0 || lowerQuantile >= upperQuantile) { return null; } AtomicDouble meanResult = new AtomicDouble(); double lowerRank = lowerQuantile * totalWeight; double upperRank = upperQuantile * totalWeight; for (int i = 0; i < activeCentroids; i++) { double centroidWeight = weight[i]; sum += centroidWeight; double amountOverLower = Math.max(sum - lowerRank, 0); double amountOverUpper = Math.max(sum - upperRank, 0); <START> <END> centroidWeight = Math.max(0, Math.min(Math.min(centroidWeight, amountOverLower), centroidWeight - amountOverUpper)); if (amountOverLower > 0) { mean = weightedAverage(mean, count, this.mean[i], centroidWeight); count += centroidWeight; } if (amountOverUpper > 0 || sum == totalWeight) { meanResult.set(mean); break; } } return meanResult.get(); }</code><technical_language>AtomicDouble here? Do need variable above</technical_language>

Target:
public double getTruncatedMean(double lowerQuantile, double upperQuantile) { double sum = 0; double count = 0; double mean = 0; compress(); checkArgument(totalWeight != 0, "t-digest is empty"); checkArgument(lowerQuantile < upperQuantile, "lower quantile must be strictly less than upper quantile"); double lowerRank = lowerQuantile * totalWeight; double upperRank = upperQuantile * totalWeight; for (int i = 0; i < activeCentroids; i++) { double centroidWeight = weight[i]; sum += centroidWeight; double amountOverLower = Math.max(sum - lowerRank, 0); double amountOverUpper = Math.max(sum - upperRank, 0); centroidWeight = Math.max(0, Math.min(Math.min(centroidWeight, amountOverLower), centroidWeight - amountOverUpper)); if (amountOverLower > 0) { mean = weightedAverage(mean, count, this.mean[i], centroidWeight); count += centroidWeight; } if (amountOverUpper > 0 || sum == totalWeight) { break; } } return mean; }
Source:
<code>public static ReplicaMetadataResponseInfo readFrom(DataInputStream stream, FindTokenHelper helper, ClusterMap clusterMap, short replicaMetadataResponseVersion) throws IOException, ReflectiveOperationException { PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream); ServerErrorCode error = ServerErrorCode.values()[stream.readShort()]; if (error != ServerErrorCode.No_Error) { return new ReplicaMetadataResponseInfo(partitionId, error); } else { <START> FindToken token = helper.getFindTokenFromStream(stream); <END> MessageInfoAndMetadataListSerde messageInfoAndMetadataList = MessageInfoAndMetadataListSerde.deserializeMessageInfoAndMetadataList(stream, clusterMap, getMessageInfoAndMetadataListSerDeVersion(replicaMetadataResponseVersion)); long remoteReplicaLag = stream.readLong(); return new ReplicaMetadataResponseInfo(partitionId, token, messageInfoAndMetadataList.getMessageInfoList(), remoteReplicaLag, replicaMetadataResponseVersion); } }</code><technical_language>I prefer factory get token</technical_language>

Target:
public static ReplicaMetadataResponseInfo readFrom(DataInputStream stream, FindTokenHelper helper, ClusterMap clusterMap, short replicaMetadataResponseVersion) throws IOException { PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream); ReplicaType replicaType; if (replicaMetadataResponseVersion == ReplicaMetadataResponse.REPLICA_METADATA_RESPONSE_VERSION_V_6) { replicaType = ReplicaType.values()[stream.readShort()]; } else { replicaType = ReplicaType.DISK_BACKED; } ServerErrorCode error = ServerErrorCode.values()[stream.readShort()]; if (error != ServerErrorCode.No_Error) { return new ReplicaMetadataResponseInfo(partitionId, replicaType, error, replicaMetadataResponseVersion); } else { FindTokenFactory findTokenFactory = helper.getFindTokenFactoryFromReplicaType(replicaType); FindToken token = findTokenFactory.getFindToken(stream); MessageInfoAndMetadataListSerde messageInfoAndMetadataList = MessageInfoAndMetadataListSerde.deserializeMessageInfoAndMetadataList(stream, clusterMap, getMessageInfoAndMetadataListSerDeVersion(replicaMetadataResponseVersion)); long remoteReplicaLag = stream.readLong(); return new ReplicaMetadataResponseInfo(partitionId, replicaType, token, messageInfoAndMetadataList.getMessageInfoList(), remoteReplicaLag, replicaMetadataResponseVersion); } }
Source:
<code>public void testStartFetcherWith_NullToken_ShouldStartFromBeginning() throws InterruptedException { CountDownLatch messageCounter = new CountDownLatch(1); KafkaTrackingToken endToken = KafkaTrackingToken.newInstance(new HashMap<Integer, Long>() {{ put(0, 0L); }}); String topic = "foo"; <START> ConsumerFactory<String, String> cf = mockConsumerFactory(topic); <END> SortedKafkaMessageBuffer<KafkaEventMessage> buffer = new SortedKafkaMessageBuffer<>(1); Fetcher testSubject = AsyncFetcher.<String, String>builder() .consumerFactory(cf) .bufferFactory(() -> buffer) .executorService(newSingleThreadExecutor()) .messageConverter(new ValueConverter()) .topic(topic) .consumerRecordCallback(countMessage(messageCounter)) .pollTimeout(3000, TimeUnit.MILLISECONDS) .build(); testSubject.start(null); messageCounter.await(); assertThat(buffer.size()).isOne(); assertThat(currentToken).isEqualTo(endToken); testSubject.shutdown(); }</code><technical_language>cf -> consumerFactory</technical_language>

Target:
public void testStartFetcherWith_NullToken_ShouldStartFromBeginning() throws InterruptedException { CountDownLatch messageCounter = new CountDownLatch(1); KafkaTrackingToken endToken = KafkaTrackingToken.newInstance(new HashMap<Integer, Long>() {{ put(0, 0L); }}); String topic = "foo"; ConsumerFactory<String, String> consumerFactory = mockConsumerFactory(topic); SortedKafkaMessageBuffer<KafkaEventMessage> buffer = new SortedKafkaMessageBuffer<>(1); Fetcher testSubject = AsyncFetcher.<String, String>builder() .consumerFactory(consumerFactory) .bufferFactory(() -> buffer) .executorService(newSingleThreadExecutor()) .messageConverter(new ValueConverter()) .topic(topic) .consumerRecordCallback(countMessage(messageCounter)) .pollTimeout(3000, TimeUnit.MILLISECONDS) .build(); testSubject.start(null); messageCounter.await(); assertThat(buffer.size()).isOne(); assertThat(currentToken).isEqualTo(endToken); testSubject.shutdown(); }
Source:
<code>public boolean modifyEvent(String key, Construct value, BindableEvent event) { if(event instanceof MCPlayerVelocityEvent) { if(key.equalsIgnoreCase("velocity")) { Vector3D v3d = ObjectGenerator.GetGenerator().vector(value, Target.UNKNOWN); Vector vector = new Vector(v3d.X(), v3d.Y(), v3d.Z()); <START> ((MCPlayerVelocityEvent) event).setVelocity(vector); <END> return true; } } return false; }</code><technical_language>Part 4: This usage avoided... (see part 5)</technical_language>

Target:
public boolean modifyEvent(String key, Construct value, BindableEvent event) { if(event instanceof MCPlayerVelocityEvent) { if(key.equalsIgnoreCase("velocity")) { Vector3D vector = ObjectGenerator.GetGenerator().vector(value, Target.UNKNOWN); ((MCPlayerVelocityEvent) event).setVelocity(vector); return true; } } return false; }
Source:
<code>public void start(Xid xid, int flags) throws XAException { <START> System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource (" + serverId + ") XA_START [" + xid + "] Flags=" + flags); <END> }</code><technical_language>worth debugging for this QS</technical_language>

Target:
public void start(Xid xid, int flags) throws XAException { }
Source:
<code><START> public int setPaddingSize(int len) <END> { if (buffer == null || buffer.length < offset + FIXED_HEADER_SIZE + len || len < 0 || len > 0xFF) { return -1; } buffer[offset] |= 0x20; buffer[offset + length - 1] = (byte) len; return 2; }</code><technical_language>is of bytes written used? return -1 2 wondering if a boolean indicating success failure better</technical_language>

Target:
public boolean setPaddingSize(int len) { if (buffer == null || buffer.length < offset + FIXED_HEADER_SIZE + len || len < 0 || len > 0xFF) { return false; } buffer[offset] |= 0x20; buffer[offset + length - 1] = (byte) len; return true; }
Source:
<code>public static void writeRecord(ObjectDataOutput out, Record record, Data dataValue) throws IOException { <START> getById(record.getMatchingRecordReaderWriterId()).writeRecord(out, record, dataValue); <END> }</code><technical_language>write record.getMatchingRecordReaderWriterId() here, is read in Records#readRecord</technical_language>

Target:
public static void writeRecord(ObjectDataOutput out, Record record, Data dataValue) throws IOException { out.writeByte(record.getMatchingRecordReaderWriter().getId()); record.getMatchingRecordReaderWriter().writeRecord(out, record, dataValue); }
Source:
<code>public Map<Guid, Integer> getHostsViolations(boolean enforcing, List<VDS> hosts, VM vm, PerHostMessages messages) { Map<Guid, Integer> hostViolations = new HashMap<>(); List<AffinityGroup> affinityGroups = affinityGroupDao.getAllAffinityGroupsByVmId(vm.getId()); if (affinityGroups.isEmpty()) { return hostViolations; } Map<Guid, VDS> hostMap = hosts.stream().collect(Collectors.toMap(VDS::getId, h -> h)); for (AffinityGroup affinityGroup : affinityGroups) { if (affinityGroup.isVdsEnforcing() == enforcing) { <START> List vdsIds <END> = affinityGroup.getVdsIds(); if (affinityGroup.isVdsPositive()) { hostMap.keySet().stream() .filter(host_id -> !vdsIds.contains(host_id)) .forEach(id -> { messages.addMessage(id, String.format("$affinityRules %1$s", "")); messages.addMessage(id, EngineMessage.VAR__DETAIL__AFFINITY_FAILED_POSITIVE.toString()); hostViolations.put(id, 1 + hostViolations.getOrDefault(id, INITIAL_HOST_SCORE)); }); } else { hostMap.keySet().stream() .filter(host_id -> vdsIds.contains(host_id)) .forEach(id -> { messages.addMessage(id, String.format("$affinityRules %1$s", "")); messages.addMessage(id, EngineMessage.VAR__DETAIL__AFFINITY_FAILED_NEGATIVE.toString()); hostViolations.put(id, 1 + hostViolations.getOrDefault(id, INITIAL_HOST_SCORE)); }); } } } return hostViolations; }</code><technical_language>Generic type missing, please add <type></technical_language>

Target:
public Map<Guid, Integer> getHostsViolations(boolean enforcing, List<VDS> hosts, VM vm, PerHostMessages messages) { Map<Guid, Integer> hostViolations = new HashMap<>(); List<AffinityGroup> affinityGroups = affinityGroupDao.getAllAffinityGroupsByVmId(vm.getId()); if (affinityGroups.isEmpty()) { return hostViolations; } Map<Guid, VDS> hostMap = hosts.stream().collect(Collectors.toMap(VDS::getId, h -> h)); for (AffinityGroup affinityGroup : affinityGroups) { if (affinityGroup.isVdsEnforcing() == enforcing) { List<Guid> vdsIds = affinityGroup.getVdsIds(); if (affinityGroup.isVdsPositive()) { hostMap.keySet().stream() .filter(host_id -> !vdsIds.contains(host_id)) .forEach(id -> { messages.addMessage(id, String.format("$affinityRules %1$s", "")); messages.addMessage(id, EngineMessage.VAR__DETAIL__AFFINITY_FAILED_POSITIVE.toString()); hostViolations.put(id, 1 + hostViolations.getOrDefault(id, INITIAL_HOST_SCORE)); }); } else { hostMap.keySet().stream() .filter(host_id -> vdsIds.contains(host_id)) .forEach(id -> { messages.addMessage(id, String.format("$affinityRules %1$s", "")); messages.addMessage(id, EngineMessage.VAR__DETAIL__AFFINITY_FAILED_NEGATIVE.toString()); hostViolations.put(id, 1 + hostViolations.getOrDefault(id, INITIAL_HOST_SCORE)); }); } } } return hostViolations; }
Source:
<code>public ScheduleBootstrapController scheduleBootstrapController() { return new ScheduleBootstrapController( workers.scheduleBootstrapTaskFactory(), persistence.channelStore(), <START> executorService(2, "ScheduleBootstrapController"), <END> scheduleBootstrapper() ); }</code><technical_language>magic number</technical_language>

Target:
public ScheduleBootstrapController scheduleBootstrapController() { return new ScheduleBootstrapController( workers.scheduleBootstrapTaskFactory(), persistence.channelStore(), executorService(NUMBER_OF_SCHECHULE_CONTROLLER_THREADS, "ScheduleBootstrapController"), scheduleBootstrapper() ); }