auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void processSpartanDbFile(String eseDumperPath, List<AbstractFile> spartanFiles) throws IOException, TskCoreException { for (AbstractFile spartanFile : spartanFiles) { if (context.dataSourceIngestIsCancelled()) { return; } String tempSpartanFileName = EDGE_WEBCACHE_PREFIX + Integer.toString((int) spartanFile.getId()) + EDGE_WEBCACHE_EXT; File tempSpartanFile = new File(RAImageIngestModule.getRATempPath(currentCase, EDGE), tempSpartanFileName); try { ContentUtils.writeToFile(spartanFile, tempSpartanFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { <START> throw new IOException("Error writingToFile: " + spartanFile, ex); END> } File resultsDir = new File(moduleTempResultPath.toAbsolutePath() + Integer.toString((int) spartanFile.getId())); resultsDir.mkdirs(); try { executeDumper(eseDumperPath, tempSpartanFile.getAbsolutePath(), resultsDir.getAbsolutePath()); if (context.dataSourceIngestIsCancelled()) { return; } this.getBookmark(spartanFile, resultsDir); } finally { tempSpartanFile.delete(); resultsDir.delete(); } } }</code><technical_language>writingToFile in error message needs some spaces</technical_language>

Target:
void processSpartanDbFile(String eseDumperPath, List<AbstractFile> spartanFiles) throws IOException, TskCoreException { for (AbstractFile spartanFile : spartanFiles) { if (context.dataSourceIngestIsCancelled()) { return; } String tempSpartanFileName = EDGE_WEBCACHE_PREFIX + Integer.toString((int) spartanFile.getId()) + EDGE_WEBCACHE_EXT; File tempSpartanFile = new File(RAImageIngestModule.getRATempPath(currentCase, EDGE), tempSpartanFileName); try { ContentUtils.writeToFile(spartanFile, tempSpartanFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new IOException("Error writingToFile: " + spartanFile, ex); } File resultsDir = new File(moduleTempResultPath.toAbsolutePath() + Integer.toString((int) spartanFile.getId())); resultsDir.mkdirs(); try { executeDumper(eseDumperPath, tempSpartanFile.getAbsolutePath(), resultsDir.getAbsolutePath()); if (context.dataSourceIngestIsCancelled()) { return; } this.getBookmarks(spartanFile, resultsDir); } finally { tempSpartanFile.delete(); resultsDir.delete(); } } }
Source:
<code>public void rearrangeCategories(String eventName, List<CategoryOrdinalModification> categories, String username) { <START> var optionalEvent = getOptionalEventAndOrganizationIdByName(eventName, username); <END> if(optionalEvent.isPresent()) { var parameterSources = categories.stream() .map(category -> new MapSqlParameterSource("ordinal", category.getOrdinal()).addValue("id", category.getId())) .toArray(MapSqlParameterSource[]::new); int[] results = jdbcTemplate.batchUpdate(ticketCategoryRepository.updateOrdinal(), parameterSources); Validate.isTrue(IntStream.of(results).sum() == categories.size(), "Unexpected result from update."); } else { log.warn("unauthorized access to event {}", eventName); } }</code><technical_language>check categories id correct event</technical_language>

Target:
public void rearrangeCategories(String eventName, List<CategoryOrdinalModification> categories, String username) { var optionalEvent = getOptionalEventAndOrganizationIdByName(eventName, username); if(optionalEvent.isPresent()) { int eventId = optionalEvent.get().getId(); var parameterSources = categories.stream() .map(category -> new MapSqlParameterSource("ordinal", category.getOrdinal()) .addValue("id", category.getId()) .addValue("eventId", eventId)) .toArray(MapSqlParameterSource[]::new); int[] results = jdbcTemplate.batchUpdate(ticketCategoryRepository.updateOrdinal(), parameterSources); Validate.isTrue(IntStream.of(results).sum() == categories.size(), "Unexpected result from update."); } else { log.warn("unauthorized access to event {}", eventName); } }
Source:
<code>private void remainingUpdated(long remaining) { long percentOccupied = (capacity - remaining) * 100 / capacity; int newT, curT = threshold.get(); if (percentOccupied >= 90) { newT = 90; } else if (percentOccupied >= 75) { newT = 75; } else { newT = 0; } if (threshold.compareAndSet(curT, newT)) { if (newT > curT) { LOGGER.info(MESSAGE_PROPERTIES.getProperty(newT == 90 ? OFFHEAP_WARN_KEY : OFFHEAP_INFO_KEY), identifier, percentOccupied); onReservationThresholdReached.accept(this, new ThresholdChange(curT, newT)); } else if (newT < curT) { <START> if(newT == 75) { <END> LOGGER.info(MESSAGE_PROPERTIES.getProperty(OFFHEAP_INFO_KEY), identifier, percentOccupied); } onReservationThresholdReached.accept(this, new ThresholdChange(curT, newT)); } } }</code><technical_language>formatting</technical_language>

Target:
private void remainingUpdated(long remaining) { long percentOccupied = (capacity - remaining) * 100 / capacity; int newT, curT = threshold.get(); if (percentOccupied >= 90) { newT = 90; } else if (percentOccupied >= 75) { newT = 75; } else { newT = 0; } if (threshold.compareAndSet(curT, newT)) { if (newT > curT) { if (newT == 90) { LOGGER.warn(MESSAGE_PROPERTIES.getProperty(OFFHEAP_WARN_KEY), identifier, percentOccupied); } else { LOGGER.info(MESSAGE_PROPERTIES.getProperty(OFFHEAP_INFO_KEY), identifier, percentOccupied); } onReservationThresholdReached.accept(this, new ThresholdChange(curT, newT)); } else if (newT < curT) { if (newT == 75) { LOGGER.info(MESSAGE_PROPERTIES.getProperty(OFFHEAP_INFO_KEY), identifier, percentOccupied); } onReservationThresholdReached.accept(this, new ThresholdChange(curT, newT)); } } }
Source:
<code>public void decorate(World world, Random random, Chunk source) { if (random.nextFloat() < density) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = world.getHighestBlockYAt(sourceX, sourceZ); sourceY = fixedHeightRange ? sourceY : random.nextInt(sourceY << 1); for (int i = 0; i < 64; i++) { int x = sourceX + random.nextInt(8) - random.nextInt(8); int z = sourceZ + random.nextInt(8) - random.nextInt(8); int y = sourceY + random.nextInt(4) - random.nextInt(4); Block block = world.getBlockAt(x, y, z); Block blockBelow = world.getBlockAt(x, y - 1, z); if (y < 255 && block.getType() == Material.AIR) { boolean canPlaceShroom; switch (blockBelow.getType()) { case MYCEL: canPlaceShroom = true; break; case GRASS: canPlaceShroom = (block.getLightLevel() < 13); break; default: MaterialData data = blockBelow.getState().getData(); <START> if (data instanceof Dirt) { <END> canPlaceShroom = (((Dirt) data).getType() == DirtType.PODZOL || block.getLightLevel() < 13); } else { canPlaceShroom = false; } } if (canPlaceShroom) { BlockState state = block.getState(); state.setType(type); state.setData(new MaterialData(type)); state.update(true); } } } } }</code><technical_language>add a material case for DIRT do additional checks, in default</technical_language>

Target:
public void decorate(World world, Random random, Chunk source) { if (random.nextFloat() < density) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = world.getHighestBlockYAt(sourceX, sourceZ); sourceY = fixedHeightRange ? sourceY : random.nextInt(sourceY << 1); for (int i = 0; i < 64; i++) { int x = sourceX + random.nextInt(8) - random.nextInt(8); int z = sourceZ + random.nextInt(8) - random.nextInt(8); int y = sourceY + random.nextInt(4) - random.nextInt(4); Block block = world.getBlockAt(x, y, z); Block blockBelow = world.getBlockAt(x, y - 1, z); if (y < 255 && block.getType() == Material.AIR) { boolean canPlaceShroom; switch (blockBelow.getType()) { case MYCEL: canPlaceShroom = true; break; case GRASS: canPlaceShroom = (block.getLightLevel() < 13); break; case DIRT: MaterialData data = blockBelow.getState().getData(); if (data instanceof Dirt) { canPlaceShroom = (((Dirt) data).getType() == DirtType.PODZOL || block.getLightLevel() < 13); } else { canPlaceShroom = false; } break; default: canPlaceShroom = false; } if (canPlaceShroom) { BlockState state = block.getState(); state.setType(type); state.setData(new MaterialData(type)); state.update(true); } } } } }
Source:
<code>protected void commenceLoginRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException { if (request.getSession(false) == null && KeycloakCookieBasedRedirect.getRedirectUrlFromCookie(request) == null) { <START> response.addCookie(KeycloakCookieBasedRedirect.createCookieFromRedirectUrl(request.getRequestURI())); <END> } String contextAwareLoginUri = request.getContextPath() + loginUri; log.debug("Redirecting to login URI {}", contextAwareLoginUri); response.sendRedirect(contextAwareLoginUri); }</code><technical_language>This preserve query parameters of original request. Is this intentional? Is (e.g. security related) reason include query</technical_language>

Target:
protected void commenceLoginRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException { String contextAwareLoginUri = request.getContextPath() + loginUri; log.debug("Redirecting to login URI {}", contextAwareLoginUri); response.sendRedirect(contextAwareLoginUri); }
Source:
<code>public LockResource lockExclusive(StateLockOptions lockOptions) throws TimeoutException, InterruptedException { boolean lockAcquired = false; if (lockOptions.waitGraceCycle()) { long deadlineMs = System.currentTimeMillis() + lockOptions.getGraceCycleTimeoutMs(); while (System.currentTimeMillis() < deadlineMs) { if (mStateLock.writeLock().tryLock(lockOptions.getGraceCycleTryMs(), TimeUnit.MILLISECONDS)) { lockAcquired = true; break; } else { long remainingWaitMs = deadlineMs - System.currentTimeMillis(); if (remainingWaitMs > 0) { Thread.sleep(Math.min(lockOptions.getGraceCycleSleepMs(), remainingWaitMs)); } } } } if (lockAcquired) { scheduleInterruptCycle(lockOptions.getInterruptWaitersInternalMs()); } else { if (!lockOptions.lockAfterGraceCycle()) { throw new TimeoutException( ExceptionMessage.STATE_LOCK_TIMED_OUT.getMessage(lockOptions.getGraceCycleTimeoutMs())); } if (lockOptions.interruptCycleAfterGraceCycle()) { scheduleInterruptCycle(lockOptions.getInterruptWaitersInternalMs()); } mStateLock.writeLock().lock(); } return new LockResource(mStateLock.writeLock(), false, false, () -> { <START> if (mInterrupterFuture != null && !mInterrupterFuture.isDone()) { <END> mInterrupterFuture.cancel(true); } }); }</code><technical_language>Is danger this mInterrupterFuture points a future started</technical_language>

Target:
public LockResource lockExclusive(StateLockOptions lockOptions) throws TimeoutException, InterruptedException { StateLockOptions.GraceMode graceMode = lockOptions.getGraceMode(); boolean lockAcquired = false; long deadlineMs = System.currentTimeMillis() + lockOptions.getGraceCycleTimeoutMs(); while (System.currentTimeMillis() < deadlineMs) { if (mStateLock.writeLock().tryLock(lockOptions.getGraceCycleTryMs(), TimeUnit.MILLISECONDS)) { lockAcquired = true; break; } else { long remainingWaitMs = deadlineMs - System.currentTimeMillis(); if (remainingWaitMs > 0) { Thread.sleep(Math.min(lockOptions.getGraceCycleSleepMs(), remainingWaitMs)); } } } if (lockAcquired) { activateInterruptCycle(); } else { if (graceMode == StateLockOptions.GraceMode.TIMEOUT) { throw new TimeoutException( ExceptionMessage.STATE_LOCK_TIMED_OUT.getMessage(lockOptions.getGraceCycleTimeoutMs())); } activateInterruptCycle(); try { if (!mStateLock.writeLock().tryLock(mForcedDurationMs, TimeUnit.MILLISECONDS)) { throw new TimeoutException(ExceptionMessage.STATE_LOCK_TIMED_OUT .getMessage(lockOptions.getGraceCycleTimeoutMs() + mForcedDurationMs)); } } catch (InterruptedException e) { deactivateInterruptCycle(); throw e; } } return new LockResource(mStateLock.writeLock(), false, false, () -> { deactivateInterruptCycle(); }); }
Source:
<code>public void verifyCategoryError() { waitForElementByElement(categoryErrorMsg); <START> Assertion.assertEquals("Please choose a category", categoryErrorMsg.getText()); <END> }</code><technical_language>declare this string top of file put name of</technical_language>

Target:
public void verifyCategoryError() { waitForElementByElement(categoryErrorMsg); Assertion.assertEquals(CreateWikiMessages.categoryErrorMessage, categoryErrorMsg.getText()); }
Source:
<code>private static void addPublicationTypes(Result.Builder resBuilder, String... types) { <START> for (String type : types) { resBuilder.addInstanceBuilder().getInstancetypeBuilder() .setClassid(type); } <END> }</code><technical_language>This done oneliner java return Arrays.stream(types).forEach(type-> resBuilder.addInstanceBuilder().getInstancetypeBuilder().setClassid(type));</technical_language>

Target:
private static void addPublicationTypes(Result.Builder resBuilder, String... types) { Arrays.stream(types).forEach(type -> resBuilder.addInstanceBuilder().getInstancetypeBuilder().setClassid(type)); }
Source:
<code>public void update_warning_condition() throws Exception { logInAsQualityGateAdmin(); QualityGateDto qualityGate = db.qualityGates().insertQualityGate(); <START> MetricDto metric = db.measures().insertMetric(m -> m.setValueType(INT.name()).setHidden(false)); <END> QualityGateConditionDto condition = db.qualityGates().addCondition(qualityGate, metric, c -> c.setOperator("GT").setWarningThreshold(null).setErrorThreshold("80").setPeriod(null)); executeRequest(condition.getId(), metric.getKey(), "LT", "90", null, null); assertCondition(qualityGate, metric, "LT", "90", null, null); }</code><technical_language>valuable factorize : java logInAsQualityGateAdmin(); QualityGateDto qualityGate = db.qualityGates().insertQualityGate(); MetricDto metric = db.measures().insertMetric(m -> m.setValueType(INT.name()).setHidden(false));</technical_language>

Target:
public void update_warning_condition() throws Exception { logInAsQualityGateAdmin(); QualityGateDto qualityGate = db.qualityGates().insertQualityGate(); MetricDto metric = insertMetric(); QualityGateConditionDto condition = db.qualityGates().addCondition(qualityGate, metric, c -> c.setOperator("GT").setWarningThreshold(null).setErrorThreshold("80").setPeriod(null)); executeRequest(condition.getId(), metric.getKey(), "LT", "90", null, null); assertCondition(qualityGate, metric, "LT", "90", null, null); }
Source:
<code>public void testChangeDiskProfileForDisk() { image_storage_domain_map image_storage_domain_map = dao.getAllByImageId(EXISTING_IMAGE_ID).get(0); assertThat("Same source and dest disk profile id, cannot perform test", <START> image_storage_domain_map.getDiskProfileId(), not(equalTo(Guid.newGuid()))); <END> dao.updateDiskProfileByImageGroupId(EXISTING_DISK_ID, EXISTING_DOMAIN_ID, FixturesTool.DISK_PROFILE_2); image_storage_domain_map = dao.getAllByImageId(EXISTING_IMAGE_ID).get(0); assertEquals("disk profile wasn't changed", image_storage_domain_map.getDiskProfileId(), FixturesTool.DISK_PROFILE_2); }</code><technical_language>guid update statement</technical_language>

Target:
public void testChangeDiskProfileForDisk() { image_storage_domain_map image_storage_domain_map = dao.getAllByImageId(EXISTING_IMAGE_ID).get(0); assertThat("Same source and dest disk profile id, cannot perform test", image_storage_domain_map.getDiskProfileId(), not(equalTo(FixturesTool.DISK_PROFILE_2))); dao.updateDiskProfileByImageGroupId(EXISTING_DISK_ID, EXISTING_DOMAIN_ID, FixturesTool.DISK_PROFILE_2); image_storage_domain_map = dao.getAllByImageId(EXISTING_IMAGE_ID).get(0); assertEquals("disk profile wasn't changed", image_storage_domain_map.getDiskProfileId(), FixturesTool.DISK_PROFILE_2); }
Source:
<code><START> public synchronized ContentPersister getPersister(Class cls) { <END> if (!persisters.containsKey(cls.getCanonicalName())) { ContentPersister persister; if (cls.equals(HistoryEntry.class)) { persister = new HistoryEntryPersister(this); } else if (cls.equals(PageImage.class)) { persister = new PageImagePersister(this); } else if (cls.equals(RecentSearch.class)) { persister = new RecentSearchPersister(this); } else if (cls.equals(SavedPage.class)) { persister = new SavedPagePersister(this); } else if (cls.equals(EditSummary.class)) { persister = new EditSummaryPersister(this); } else { throw new RuntimeException("No persister found for class " + cls.getCanonicalName()); } persisters.put(cls.getCanonicalName(), persister); } return persisters.get(cls.getCanonicalName()); }</code><technical_language>I clearer wrap persisters in a synchronizedMap[0] instead. [0] <LINK_0><K, V>)</technical_language>

Target:
public ContentPersister getPersister(Class cls) { if (!persisters.containsKey(cls.getCanonicalName())) { ContentPersister persister; if (cls.equals(HistoryEntry.class)) { persister = new HistoryEntryPersister(this); } else if (cls.equals(PageImage.class)) { persister = new PageImagePersister(this); } else if (cls.equals(RecentSearch.class)) { persister = new RecentSearchPersister(this); } else if (cls.equals(SavedPage.class)) { persister = new SavedPagePersister(this); } else if (cls.equals(EditSummary.class)) { persister = new EditSummaryPersister(this); } else { throw new RuntimeException("No persister found for class " + cls.getCanonicalName()); } persisters.put(cls.getCanonicalName(), persister); } return persisters.get(cls.getCanonicalName()); }
Source:
<code>private org.eclipse.californium.core.observe.Observation add(Token token, org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) { String endpoint = ObserveUtil.validateCoapObservation(obs); org.eclipse.californium.core.observe.Observation previousObservation = null; try (Jedis j = pool.getResource()) { byte[] lockValue = null; byte[] lockKey = toKey(LOCK_EP, endpoint); try { lockValue = RedisLock.acquire(j, lockKey); String registrationId = ObserveUtil.extractRegistrationId(obs); if (!j.exists(toRegIdKey(registrationId))) throw new IllegalStateException("no registration for this Id"); byte[] key = toKey(OBS_TKN, obs.getRequest().getToken().getBytes()); byte[] serializeObs = serializeObs(obs); byte[] previousValue = null; if (ifAbsent) { previousValue = j.get(key); <START> if (previousValue == null || previousValue.length > 0) { <END> j.set(key, serializeObs); } else { return deserializeObs(previousValue); } } else { previousValue = j.getSet(key, serializeObs); } j.lpush(toKey(OBS_TKNS_REGID_IDX, registrationId), obs.getRequest().getToken().getBytes()); if (previousValue != null && previousValue.length != 0) { previousObservation = deserializeObs(previousValue); LOG.warn( "Token collision ? observation from request will be replaced by observation from request ", previousObservation.getRequest(), obs.getRequest()); } } finally { RedisLock.release(j, lockKey, lockValue); } } return previousObservation; }</code><technical_language>previousValue.length > 0? I ==</technical_language>

Target:
private org.eclipse.californium.core.observe.Observation add(Token token, org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) { String endpoint = ObserveUtil.validateCoapObservation(obs); org.eclipse.californium.core.observe.Observation previousObservation = null; try (Jedis j = pool.getResource()) { byte[] lockValue = null; byte[] lockKey = toKey(LOCK_EP, endpoint); try { lockValue = RedisLock.acquire(j, lockKey); String registrationId = ObserveUtil.extractRegistrationId(obs); if (!j.exists(toRegIdKey(registrationId))) throw new IllegalStateException("no registration for this Id"); byte[] key = toKey(OBS_TKN, obs.getRequest().getToken().getBytes()); byte[] serializeObs = serializeObs(obs); byte[] previousValue = null; if (ifAbsent) { previousValue = j.get(key); if (previousValue == null || previousValue.length == 0) { j.set(key, serializeObs); } else { return deserializeObs(previousValue); } } else { previousValue = j.getSet(key, serializeObs); } j.lpush(toKey(OBS_TKNS_REGID_IDX, registrationId), obs.getRequest().getToken().getBytes()); if (previousValue != null && previousValue.length != 0) { previousObservation = deserializeObs(previousValue); LOG.warn( "Token collision ? observation from request will be replaced by observation from request ", previousObservation.getRequest(), obs.getRequest()); } } finally { RedisLock.release(j, lockKey, lockValue); } } return previousObservation; }
Source:
<code>public void testCreateInternalTopicsWithDefaultSettings() throws InterruptedException { int numWorkers = 1; int numBrokers = 3; connect = new EmbeddedConnectCluster.Builder().name("connect-cluster-1") .workerProps(workerProps) .numWorkers(numWorkers) .numBrokers(numBrokers) .brokerProps(brokerProps) .build(); connect.start(); connect.assertions().assertExactlyNumBrokersAreUp(numBrokers, "Brokers did not start in time."); connect.assertions().assertExactlyNumWorkersAreUp(numWorkers, "Worker did not start in time."); log.info("Completed startup of Kafka brokers and Connect workers", numBrokers, numWorkers); log.info("Verifying the internal topics for Connect"); connect.assertions().assertTopicsExist(configTopic(), offsetTopic(), statusTopic()); assertInternalTopicSettings(); log.info("Stopping the Connect worker"); connect.removeWorker(); <START> Thread.sleep(3000); <END> log.info("Starting the Connect worker"); connect.startConnect(); log.info("Verifying the internal topics for Connect"); connect.assertions().assertTopicsExist(configTopic(), offsetTopic(), statusTopic()); assertInternalTopicSettings(); connect.stop(); }</code><technical_language>notice this matters? suggesting remove necessarily, I noticed work otherwise</technical_language>

Target:
public void testCreateInternalTopicsWithDefaultSettings() throws InterruptedException { int numWorkers = 1; int numBrokers = 3; connect = new EmbeddedConnectCluster.Builder().name("connect-cluster-1") .workerProps(workerProps) .numWorkers(numWorkers) .numBrokers(numBrokers) .brokerProps(brokerProps) .build(); connect.start(); connect.assertions().assertExactlyNumBrokersAreUp(numBrokers, "Brokers did not start in time."); connect.assertions().assertExactlyNumWorkersAreUp(numWorkers, "Worker did not start in time."); log.info("Completed startup of Kafka brokers and Connect workers", numBrokers, numWorkers); log.info("Verifying the internal topics for Connect"); connect.assertions().assertTopicsExist(configTopic(), offsetTopic(), statusTopic()); assertInternalTopicSettings(); log.info("Stopping the Connect worker"); connect.removeWorker(); log.info("Starting the Connect worker"); connect.startConnect(); log.info("Verifying the internal topics for Connect"); connect.assertions().assertTopicsExist(configTopic(), offsetTopic(), statusTopic()); assertInternalTopicSettings(); connect.stop(); }
Source:
<code>protected boolean validate() { if (!super.validate()) { return false; } if (isClusterSwitchTypeOVS() && !isVnicAttachedToExternalNetwork()) { <START> addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_ONLY_EXTERNAL_NETWORK_IS_SUPPORTED_IN_OVS_SWITCH_TYPE); <END> return false; } return true; }</code><technical_language>get variable replacement need idiom: if (!validate(isClusterSwitchTypeOVS()) && !validate(...)) { return false; } predicate methods return a validation result instead of a boolean (which encapsulate test+result nicely) lots of examples in other commands</technical_language>

Target:
protected boolean validate() { return super.validate() && validate(isNetworkSupportedInClusterWithOvsSwitch()); }
Source:
<code>protected int getMaxResults() throws MalformedNumberException{ if (getUriInfo()!=null && QueryHelper.hasMatrixParam(getUriInfo(), MAX)) { HashMap<String,String> matrixConstraints = QueryHelper.getMatrixConstraints(getUriInfo(), MAX); String maxString = matrixConstraints.get(MAX); try { Integer max = Integer.valueOf(maxString); <START> if (max.compareTo(-1) == -1){ <END> return failMaxResults(maxString); } return max; } catch (NumberFormatException e) { return failMaxResults(maxString); } } else { return NO_LIMIT; } }</code><technical_language>max < 0 more readable</technical_language>

Target:
protected int getMaxResults() throws MalformedNumberException{ if (getUriInfo()!=null && QueryHelper.hasMatrixParam(getUriInfo(), MAX)) { HashMap<String,String> matrixConstraints = QueryHelper.getMatrixConstraints(getUriInfo(), MAX); String maxString = matrixConstraints.get(MAX); try { Integer max = Integer.valueOf(maxString); if (max < -1){ return failMaxResults(maxString); } return max; } catch (NumberFormatException e) { return failMaxResults(maxString); } } else { return NO_LIMIT; } }
Source:
<code>public Apply(final Func func, final Expr ... args) throws HaskellException { super(((FuncT) func.getType()).getAppliedType(Apply.getArgTypes(args))); this.func = func; <START> this.args = args.clone(); <END> }</code><technical_language>Is this .clone call required</technical_language>

Target:
public Apply(final Func func, final Expr ... args) throws HaskellException { super(((FuncT) func.getType()).getAppliedType(Apply.getArgTypes(args))); this.func = func; this.args = args; }
Source:
<code>public Object encode(Object value, MappedField optionalExtraInfo) { if(value == null) return null; CauseAction action = (CauseAction) value; <START> List core = new BasicDBList(); <END> for(Object obj : action.getCauses()) { core.add(getMapper().toDBObject(obj)); } return BasicDBObjectBuilder.start("causes",core).add("className",CauseAction.class.getName()).get(); }</code><technical_language>core for CopyOnWriteListConverter internal variable named core. CauseActions causeBag</technical_language>

Target:
public Object encode(Object value, MappedField optionalExtraInfo) { if (value == null) return null; CauseAction action = (CauseAction) value; List causes = new BasicDBList(); for (Object obj : action.getCauses()) { causes.add(getMapper().toDBObject(obj)); } return BasicDBObjectBuilder.start("causes", causes).add("className", CauseAction.class.getName()).get(); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + ((dragTypeName == null) ? 0 : dragTypeName.hashCode()); <END> result = prime * result + ((parts == null) ? 0 : parts.hashCode()); result = prime * result + ((properties == null) ? 0 : properties.hashCode()); return result; }</code><technical_language>If this method is called in client-side, do result = ~~result result attribution due a GWT limitation</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = ~~result; result = prime * result + ((dragTypeName == null) ? 0 : dragTypeName.hashCode()); result = ~~result; result = prime * result + ((parts == null) ? 0 : parts.hashCode()); result = ~~result; result = prime * result + ((properties == null) ? 0 : properties.hashCode()); result = ~~result; return result; }
Source:
<code>public CloudFilesApi getCloudFilesApi(final CloudFilesAccountConfig config) { <START> Iterable<com.google.inject.Module> modules = ImmutableSet.<com.google.inject <END> .Module> of(new SLF4JLoggingModule()); ContextBuilder cb = ContextBuilder.newBuilder(config.getProvider()) .credentials(config.getUserName(), config.getApiKey()).modules(modules); CloudFilesApi cfa = cb.buildApi(CloudFilesApi.class); log.info("Cloud Files Api built."); return cfa; }</code><technical_language>this included pom level set a command line parameter for jcloud</technical_language>

Target:
public CloudFilesApi getCloudFilesApi(final CloudFilesAccountConfig config) { log.info("Building Cloud Files Api..."); Iterable<com.google.inject.Module> modules = null; if (config.getUseServiceNet()) { log.info("Configuring Cloud Files Api to use the internal service network..."); modules = ImmutableSet.<com.google.inject.Module>of(new SLF4JLoggingModule(), new InternalUrlModule()); } else { log.info("Configuring Cloud Files Api to use the public network..."); modules = ImmutableSet.<com.google.inject.Module>of(new SLF4JLoggingModule()); } ProviderRegistry.registerProvider(CloudFilesUSProviderMetadata.builder().build()); ProviderRegistry.registerProvider(CloudFilesUKProviderMetadata.builder().build()); ContextBuilder cb = ContextBuilder.newBuilder(config.getProvider()) .credentials(config.getUserName(), config.getApiKey()).modules(modules); CloudFilesApi cfa = cb.buildApi(CloudFilesApi.class); log.info("Cloud Files Api built."); return cfa; }
Source:
<code>protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } <START> LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); <END> ValidationResult validationResult = diskValidator.isUsingScsiReservationValid(lunDisk); if (!validate(validationResult)) { return failCanDoAction(validationResult.getMessage()); } return true; }</code><technical_language>I add this line line 134, fetch LunDisk fetch lun</technical_language>

Target:
protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); LUNs lun = lunDisk.getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } ValidationResult validationResult = diskValidator.isUsingScsiReservationValid(lunDisk); if (!validate(validationResult)) { return failCanDoAction(validationResult.getMessage()); } return true; }
Source:
<code>public void test_getDetachedPlugins() { <START> List<DetachedPlugin> list = DetachedPluginsManager.getDetachedPlugins(new VersionNumber("1.296")); <END> Assert.assertTrue(list.size() >= 14); Assert.assertNotNull(findPlugin("maven-plugin", list)); Assert.assertNotNull(findPlugin("subversion", list)); list = DetachedPluginsManager.getDetachedPlugins(new VersionNumber("1.310")); Assert.assertNull(findPlugin("maven-plugin", list)); Assert.assertNotNull(findPlugin("subversion", list)); list = DetachedPluginsManager.getDetachedPlugins(new VersionNumber("1.311")); Assert.assertNull(findPlugin("maven-plugin", list)); Assert.assertNull(findPlugin("subversion", list)); }</code><technical_language>move this a test suite named class is testing. a minimum @For</technical_language>

Target:
public void test_getDetachedPlugins() { List<DetachedPlugin> list = DetachedPluginsUtil.getDetachedPlugins(new VersionNumber("1.296")); Assert.assertTrue(list.size() >= 14); Assert.assertNotNull(findPlugin("maven-plugin", list)); Assert.assertNotNull(findPlugin("subversion", list)); list = DetachedPluginsUtil.getDetachedPlugins(new VersionNumber("1.310")); Assert.assertNull(findPlugin("maven-plugin", list)); Assert.assertNotNull(findPlugin("subversion", list)); list = DetachedPluginsUtil.getDetachedPlugins(new VersionNumber("1.311")); Assert.assertNull(findPlugin("maven-plugin", list)); Assert.assertNull(findPlugin("subversion", list)); }
Source:
<code>public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, OCommandContext iContext) { Method method = pickMethod(iParams); <START> try { <END> return method.invoke(null, iParams); } catch (ReflectiveOperationException e) { throw new OQueryParsingException("Error on executing method " + method + " with parameters " + Arrays.toString(iParams)); } }</code><technical_language>add a null check here...</technical_language>

Target:
public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, OCommandContext iContext) { final Supplier<String> paramsPrettyPrint = () -> Arrays.stream(iParams).map(p -> p + " [ " + p.getClass().getName() + " ]").collect(Collectors.joining(", ", "(", ")")); Method method = pickMethod(iParams); if (method == null) { throw new OQueryParsingException("Unable to find a function for " + name + paramsPrettyPrint.get()); } try { return method.invoke(null, iParams); } catch (ReflectiveOperationException | IllegalArgumentException e) { e.printStackTrace(); throw new OQueryParsingException("Error executing function " + name + paramsPrettyPrint.get()); } }
Source:
<code>public void loggedInPageTest() { personalInfoPage.navigateTo(); loginToAccount(); assertTestUserLocale(null); personalInfoPage.selectLocale(CUSTOM_LOCALE); personalInfoPage.clickSave(false); <START> WaitUtils.pause(1000); <END> assertTestUserLocale(CUSTOM_LOCALE); assertCustomLocalePersonalInfo(); personalInfoPage.header().clickLogoutBtn(); welcomeScreen.assertCurrent(); assertCustomLocaleWelcomeScreen(); }</code><technical_language>Please this instead: suggestion WaitUtils.waitForPageToLoad();</technical_language>

Target:
public void loggedInPageTest() { personalInfoPage.navigateTo(); loginToAccount(); assertTestUserLocale(null); personalInfoPage.selectLocale(CUSTOM_LOCALE); personalInfoPage.clickSave(false); WaitUtils.waitForPageToLoad(); assertTestUserLocale(CUSTOM_LOCALE); assertCustomLocalePersonalInfo(); personalInfoPage.header().clickLogoutBtn(); welcomeScreen.assertCurrent(); assertCustomLocaleWelcomeScreen(); }
Source:
<code>private void writeResponse(OutputStream out, MockResponse response) throws IOException { out.write((response.getStatus() + "\r\n").getBytes(StandardCharsets.US_ASCII)); List<String> headers = response.getHeaders(); for (int i = 0, size = headers.size(); i < size; i++) { String header = headers.get(i); out.write((header + "\r\n").getBytes(StandardCharsets.US_ASCII)); } out.write(("\r\n").getBytes(StandardCharsets.US_ASCII)); out.flush(); long bodyDelayTimeMs = <START> response.getBodyDelayTimeMs(); <END> if (bodyDelayTimeMs > 0) { try { Thread.sleep(bodyDelayTimeMs); } catch (InterruptedException e) { throw new AssertionError(); } } InputStream in = response.getBodyStream(); if (in == null) return; throttledTransfer(response, in, out, Long.MAX_VALUE); }</code><technical_language>Want do delay return line 527 instead</technical_language>

Target:
private void writeResponse(OutputStream out, MockResponse response) throws IOException { out.write((response.getStatus() + "\r\n").getBytes(StandardCharsets.US_ASCII)); List<String> headers = response.getHeaders(); for (int i = 0, size = headers.size(); i < size; i++) { String header = headers.get(i); out.write((header + "\r\n").getBytes(StandardCharsets.US_ASCII)); } out.write(("\r\n").getBytes(StandardCharsets.US_ASCII)); out.flush(); InputStream in = response.getBodyStream(); if (in == null) return; long bodyDelayTimeMs = response.getBodyDelayTimeMs(); if (bodyDelayTimeMs > 0) { try { Thread.sleep(bodyDelayTimeMs); } catch (InterruptedException e) { throw new AssertionError(); } } throttledTransfer(response, in, out, Long.MAX_VALUE); }
Source:
<code>public void testAssociationLnListTypeDtoMappingWithEmptyLists() { final List<AssociationLnListElementDto> associationLnListElementDto = new ArrayList<>(); final AssociationLnListTypeDto associationLnListTypeDto = new AssociationLnListTypeDto( associationLnListElementDto); final AssociationLnListType associationLnListType = this.mapperFactory.getMapperFacade() .map(associationLnListTypeDto, AssociationLnListType.class); this.checkAssociationLnListElementMapping(associationLnListType.getAssociationLnListElement(), associationLnListTypeDto.getAssociationLnListElement()); <START> assertNotNull(associationLnListType); <END> }</code><technical_language>If this check for null is needed desirable, previous statement. is now, if associationLnListType == null this line reached a NullPointerException thrown</technical_language>

Target:
public void testAssociationLnListTypeDtoMappingWithEmptyLists() { final AssociationLnListTypeDto associationLnListTypeDto = new AssociationLnListTypeDtoBuilder().withEmptyLists() .build(); final AssociationLnListType associationLnListType = this.configurationMapper.map(associationLnListTypeDto, AssociationLnListType.class); assertNotNull(associationLnListType); this.checkAssociationLnListElementMapping(associationLnListType.getAssociationLnListElement(), associationLnListTypeDto.getAssociationLnListElement()); }
Source:
<code>public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); context.readResource(PathAddress.EMPTY_ADDRESS, false); final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); final String group = getServerGroupName(operation); final boolean blocking = operation.get(BLOCKING).asBoolean(false); <START> final int timeout = operation.get(TIMEOUT).asInt(0); <END> context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getServiceRegistry(true); Map<String, ProcessInfo> processes = serverInventory.determineRunningProcesses(true); final Set<String> serversInGroup = getServersForGroup(model, group); final Set<String> waitForServers = new HashSet<String>(); for (String serverName : processes.keySet()) { final String serverModelName = serverInventory.getProcessServerName(serverName); if (group == null || serversInGroup.contains(serverModelName)) { serverInventory.restartServer(serverModelName, timeout > 0 ? timeout * 1000 : timeout, model); waitForServers.add(serverModelName); } } if (blocking) { serverInventory.awaitServersState(waitForServers, true); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME); context.stepCompleted(); }</code><technical_language>re: AD for calls</technical_language>

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); context.readResource(PathAddress.EMPTY_ADDRESS, false); final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); final String group = getServerGroupName(operation); final boolean blocking = BLOCKING.resolveModelAttribute(context, operation).asBoolean(); final int timeout = TIMEOUT.resolveModelAttribute(context, operation).asInt(); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getServiceRegistry(true); Map<String, ProcessInfo> processes = serverInventory.determineRunningProcesses(true); final Set<String> serversInGroup = getServersForGroup(model, group); final Set<String> waitForServers = new HashSet<String>(); for (String serverName : processes.keySet()) { final String serverModelName = serverInventory.getProcessServerName(serverName); if (group == null || serversInGroup.contains(serverModelName)) { serverInventory.restartServer(serverModelName, timeout > 0 ? timeout * 1000 : timeout, model); waitForServers.add(serverModelName); } } if (blocking) { serverInventory.awaitServersState(waitForServers, true); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME); context.stepCompleted(); }
Source:
<code>public PortalAccessPermission(String portals) { super("portal access"); portals = portals.trim(); <START> if (portals.equals("*")) { <END> allPortals = true; } else if (portals.isEmpty()) { portalsAccess = new HashSet<>(); } else { portalsAccess = Sets.newHashSet(portals.split("[\\s,]+")); } }</code><technical_language>check null here</technical_language>

Target:
public PortalAccessPermission(String portals) { super("portal access"); portals = portals.trim(); if (portals == null || portals.isEmpty()) { portalsAccess = new HashSet<>(); } else if (portals.equals("*")) { allPortals = true; } else { portalsAccess = Sets.newHashSet(portals.split("[\\s,]+")); } }
Source:
<code>private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; <START> String contend = composeSquashMessage(isSquash, <END> commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, contend); if (messageFixup.exists()) { rebaseState.createFile(MESSAGE_FIXUP, contend); } return squashIntoPrevious( !messageFixup.exists(), nextStep); }</code><technical_language>s/contend/content/</technical_language>

Target:
private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; String content = composeSquashMessage(isSquash, commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, content); if (messageFixup.exists()) { rebaseState.createFile(MESSAGE_FIXUP, content); } return squashIntoPrevious( !messageFixup.exists(), nextStep); }
Source:
<code>private boolean eraseSimulator() { assert instrumentsVersion.getMajor() >= 6; List<String> simctlArgs; <START> simctlArgs = Arrays.asList("xcrun", "simctl", "erase", deviceUUID); <END> Command simctlCmd = new Command(simctlArgs, false); int exitCode = simctlCmd.executeAndWait(true); if (exitCode == 146) { return false; } else if (exitCode != 0) { throw new WebDriverException("Failed to erase contents and settings of this device: " + deviceUUID + ". Exit code =" + exitCode + " , command was: " + simctlCmd.commandString()); } String deviceLogDir = System.getProperty("user.home") + "/Library/Logs/CoreSimulator/" + deviceUUID; File deviceLog = new File(deviceLogDir, "system.log"); if (deviceLog.exists()) { deviceLog.delete(); } return true; }</code><technical_language>of changes eraseSimulator() formatting changes. I generally for I combine 2 lines a single line: List<String> simctlArgs = Arrays.asList("xcrun", "simctl", "erase", deviceUUID);</technical_language>

Target:
private boolean eraseSimulator() { assert instrumentsVersion.getMajor() >= 6; List<String> simctlArgs = Arrays.asList("xcrun", "simctl", "erase", deviceUUID); Command simctlCmd = new Command(simctlArgs, false); int exitCode = simctlCmd.executeAndWait(true); if (exitCode == 146) { return false; } else if (exitCode != 0) { throw new WebDriverException("Failed to erase contents and settings of this device: " + deviceUUID + ". Exit code =" + exitCode + " , command was: " + simctlCmd.commandString()); } String deviceLogDir = System.getProperty("user.home") + "/Library/Logs/CoreSimulator/" + deviceUUID; File deviceLog = new File(deviceLogDir, "system.log"); if (deviceLog.exists()) { deviceLog.delete(); } return true; }
Source:
<code>public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { <START> if(value instanceof String){ <END> CanvasSE cse = new CanvasSE(symbolizer.getSymbolizer()); Map<String,Object> map = new HashMap<String,Object>(); map.put(symbolizer.getLookupFieldName(), value); cse.setSampleDatasource(map); return cse; } else { return lookAndFeelRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } }</code><technical_language>lookAndFeelRenderer.getTableCellRendererComponent used, return a JLabel, if cse is image, cast component a JLabel setImage() setText("") in order set preview image</technical_language>

Target:
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel lab = (JLabel)lookAndFeelRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(value instanceof String){ lab.setText(""); CanvasSE cse = new CanvasSE(symbolizer.getSymbolizer()); Map<String,Object> map = new HashMap<String,Object>(); map.put(symbolizer.getLookupFieldName(), value); cse.setSampleDatasource(map); ImageIcon ii = new ImageIcon(cse.getImage()); lab.setIcon(ii); lab.setOpaque(true); } return lab; }
Source:
<code>public Map<String, String> getDivisions(List<LanguageRange> priorityList, boolean all, boolean subdivisionsByDate) { Collection<UniversalDivision> universalDivisions = new LinkedList<>(); for (Division division : declaration.getDivisions()) { UniversalDivision universalDivision = new UniversalDivision(this, division); if (all || universalDivision.getProcessTitle().isPresent()) { universalDivisions.add(universalDivision); } if (subdivisionsByDate) { for (UniversalDivision subdivision : universalDivision.getUniversalDivisions()) { if (all || subdivision.getProcessTitle().isPresent()) { universalDivisions.add(subdivision); } } } } <START> return all || !universalDivisions.isEmpty() ? Labeled.listByTranslatedLabel(this, universalDivisions, <END> UniversalDivision::getId, UniversalDivision::getLabels, priorityList) : getDivisions(priorityList, true, subdivisionsByDate); }</code><technical_language>put logic in return statement</technical_language>

Target:
public Map<String, String> getDivisions(List<LanguageRange> priorityList, boolean all, boolean subdivisionsByDate) { Collection<UniversalDivision> universalDivisions = new LinkedList<>(); for (Division division : declaration.getDivisions()) { UniversalDivision universalDivision = new UniversalDivision(this, division); if (all || universalDivision.getProcessTitle().isPresent()) { universalDivisions.add(universalDivision); } if (subdivisionsByDate) { for (UniversalDivision subdivision : universalDivision.getUniversalDivisions()) { if (all || subdivision.getProcessTitle().isPresent()) { universalDivisions.add(subdivision); } } } } Map<String, String> map = all || !universalDivisions.isEmpty() ? Labeled.listByTranslatedLabel(this, universalDivisions, UniversalDivision::getId, UniversalDivision::getLabels, priorityList) : getDivisions(priorityList, true, subdivisionsByDate); return map; }
Source:
<code>public void prettyPrint(Node node, SourcePrinter printer) { LineEnding lineEnding = node.getLineEndingStyleOrDefault(LineEnding.SYSTEM); <START> printer.print("\"\"\"" + lineEnding.toString()); <END> printer.print(property.getValueAsStringAttribute(node)); printer.print("\"\"\""); }</code><technical_language>remain "\n", textblocks generate "\r\n" so</technical_language>

Target:
public void prettyPrint(Node node, SourcePrinter printer) { printer.print("\"\"\"\n"); printer.print(property.getValueAsStringAttribute(node)); printer.print("\"\"\""); }