auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void endElement(String uri, String localName, String qName) throws SAXException { <START> if ("link".equals(localName)) { <END> setLocURL(); } else if ("guid".equals(localName)) { if (locURL == null) { setLocURL(); } resetCharacterBuffer(); } else if ("item".equals(localName)) { maybeAddSiteMapUrl(); } else if ("rss".equals(localName)) { sitemap.setProcessed(true); } else if ("pubDate".equals(localName)) { String value = getAndResetCharacterBuffer(); if (value != null) { lastMod = AbstractSiteMap.parseRSSTimestamp(value); if (lastMod != null && "channel".equals(super.currentElementParent())) { sitemap.setLastModified(lastMod); } } } }</code><technical_language>This a separate fix for some issue (vs. in CHANGES.txt entry), yes? guid check for previously</technical_language>

Target:
public void endElement(String uri, String localName, String qName) throws SAXException { if ("link".equals(localName)) { setLocURL(); } else if ("guid".equals(localName)) { if (locURL == null) { setLocURL(); } resetCharacterBuffer(); } else if ("item".equals(localName)) { maybeAddSiteMapUrl(); } else if ("rss".equals(localName)) { sitemap.setProcessed(true); } else if ("pubDate".equals(localName)) { String value = getAndResetCharacterBuffer(); lastMod = AbstractSiteMap.parseRSSTimestamp(value); if (lastMod != null && "channel".equals(super.currentElementParent())) { sitemap.setLastModified(lastMod); } } }
Source:
<code>public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Node dockSourceNode = getDockSourceNode(node); if (dockSourceNode != null) { @SuppressWarnings("unchecked") Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { <START> super.setAbsoluteBounds(node); <END> } }</code><technical_language>Is this uncommon case case? Is import 3-rd party modelling tool? worth support BPMN 2.0 standard standard for boundary bounds? drop implementation BPMN's 2.0 one? P.S. Also, test coverage for this case</technical_language>

Target:
public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } }
Source:
<code>public boolean addAll(int index, @Nonnull Collection<? extends T> elements) { boolean changed = delegate.addAll(index, elements); if (changed) { <START> ModContainer modContainer = Loader.instance().activeModContainer(); <END> if (modContainer != null) { for (T element : elements) { modContainerMap.put(element, modContainer); } } } return changed; }</code><technical_language>trackModContainer(@Nonnull Collection<? extends T> elements) for addAll methods, for add</technical_language>

Target:
public boolean addAll(int index, @Nonnull Collection<? extends T> elements) { boolean changed = delegate.addAll(index, elements); if (changed) { trackModContainer(elements); } return changed; }
Source:
<code>public void formatXNodeToString() { XPathParser parser = new XPathParser("<users><user><id>100</id><name>Tom</name><age>30</age><cars><car>BMW</car><car>Audi</car><car>Benz</car></cars></user></users>"); String usersNodeToString = parser.evalNode("/users").toString(); String userNodeToString = parser.evalNode("/users/user").toString(); String carsNodeToString = parser.evalNode("/users/user/cars").toString(); String usersNodeToStringExpect = "<users>\n" + " <user>\n" + " <id>100</id>\n" + " <name>Tom</name>\n" + " <age>30</age>\n" + " <cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + " </cars>\n" + " </user>\n" + "</users>\n"; String userNodeToStringExpect = "<user>\n" + " <id>100</id>\n" + " <name>Tom</name>\n" + " <age>30</age>\n" + " <cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + " </cars>\n" + "</user>\n"; String carsNodeToStringExpect = "<cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + "</cars>\n"; assertEquals(usersNodeToString, usersNodeToStringExpect); assertEquals(userNodeToString, userNodeToStringExpect); <START> assertEquals(carsNodeToString, carsNodeToStringExpect); <END> }</code><technical_language>argument order assertEquals(expected, actual)</technical_language>

Target:
public void formatXNodeToString() { XPathParser parser = new XPathParser("<users><user><id>100</id><name>Tom</name><age>30</age><cars><car>BMW</car><car>Audi</car><car>Benz</car></cars></user></users>"); String usersNodeToString = parser.evalNode("/users").toString(); String userNodeToString = parser.evalNode("/users/user").toString(); String carsNodeToString = parser.evalNode("/users/user/cars").toString(); String usersNodeToStringExpect = "<users>\n" + " <user>\n" + " <id>100</id>\n" + " <name>Tom</name>\n" + " <age>30</age>\n" + " <cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + " </cars>\n" + " </user>\n" + "</users>\n"; String userNodeToStringExpect = "<user>\n" + " <id>100</id>\n" + " <name>Tom</name>\n" + " <age>30</age>\n" + " <cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + " </cars>\n" + "</user>\n"; String carsNodeToStringExpect = "<cars>\n" + " <car>BMW</car>\n" + " <car>Audi</car>\n" + " <car>Benz</car>\n" + "</cars>\n"; assertEquals(usersNodeToStringExpect, usersNodeToString); assertEquals(userNodeToStringExpect, userNodeToString); assertEquals(carsNodeToStringExpect, carsNodeToString); }
Source:
<code>protected void run() { long timerFdDeadline = Long.MAX_VALUE; for (;;) { try { int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (wakenUp.get() == 1) { wakenUp.set(0); } if (!hasTasks()) { timerFdDeadline = checkScheduleTaskQueueForNewDelay(timerFdDeadline); try { strategy = epollWait(); } finally { timerFdDeadline = nextDeadlineNanos.getAndAdd(Long.MAX_VALUE + 1); } } default: } try { boolean timerFdFired = processReady(events, strategy); <START> if (timerFdFired) { <END> timerFdDeadline = Long.MAX_VALUE; } } finally { runAllTasks(); } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }</code><technical_language>merge lines</technical_language>

Target:
protected void run() { long timerFdDeadline = Long.MAX_VALUE; for (;;) { try { processPendingChannelFlags(); int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (wakenUp.get() == 1) { wakenUp.set(0); } if (!hasTasks()) { timerFdDeadline = checkScheduleTaskQueueForNewDelay(timerFdDeadline); try { strategy = epollWait(); } finally { timerFdDeadline = nextDeadlineNanos.getAndAdd(Long.MAX_VALUE + 1); } } default: } try { if (processReady(events, strategy)) { timerFdDeadline = Long.MAX_VALUE; } } finally { runAllTasks(); } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }
Source:
<code><START> public void includeStatsTrueShouldIncludeStatistics() { <END> boolean includeStats = true; boolean calculateStats = true; boolean includeSample = false; Variant variant = buildVariant("12", 3, 4, "A", "T", fileId, studyId); variantToMongoDbObjectConverter = new VariantToMongoDbObjectConverter(includeStats, samplesPosition, calculateStats, includeSample, includeSrc); conversionService.addConverter(variantToMongoDbObjectConverter); DBObject dbObject = conversionService.convert(variant, DBObject.class); assertNotNull(dbObject); BasicDBObject addToSet = (BasicDBObject) dbObject.get("$addToSet"); BasicDBObject st = (BasicDBObject) addToSet.get("st"); assertNotNull(st); }</code><technical_language>tested too</technical_language>

Target:
public void includeStatsTrueShouldIncludeStatistics() { Variant variant = buildVariant("12", 3, 4, "A", "T", fileId, studyId); variantToMongoDbObjectConverter = new VariantToMongoDbObjectConverter(true, samplesPosition, true, false, includeSrc); conversionService.addConverter(variantToMongoDbObjectConverter); DBObject dbObject = conversionService.convert(variant, DBObject.class); assertNotNull(dbObject); BasicDBObject addToSet = (BasicDBObject) dbObject.get("$addToSet"); BasicDBObject st = (BasicDBObject) addToSet.get("st"); assertNotNull(st); }
Source:
<code>public static Properties processProperties(final String propertyFileName) throws IOException { final File propertyFile = new File(propertyFileName); <START> if (!propertyFile.exists()) { <END> throw new FileNotFoundException(propertyFile.toString()); } final Properties properties = new Properties(); final InputStream is = new FileInputStream(propertyFile); try { properties.load(is); } finally { if (is != null) { is.close(); } } return properties; }</code><technical_language>FileInputStream do if file exists</technical_language>

Target:
private static Properties processProperties(final String propertyFileName) throws IOException { final File propertyFile = new File(propertyFileName); if (!propertyFile.exists()) { throw new FileNotFoundException(propertyFile.toString()); } final Properties properties = new Properties(); try (InputStream is = new FileInputStream(propertyFile)) { properties.load(is); } return properties; }
Source:
<code>private void updateModel(final AttributeChange diff, final EAttribute eAttribute, final IEqualityHelper equalityHelper, final EObject eObject, final boolean isLeft) { final String oldValue = getStringValue(eObject, eAttribute); GetContentRunnable runnable = new GetContentRunnable(isLeft); Display.getDefault().syncExec(runnable); String newValue = (String)runnable.getResult(); final boolean oldAndNewEquals = equalityHelper.matchingAttributeValues(newValue, oldValue); if (eObject != null && !oldAndNewEquals && <START> getCompareConfiguration().isLeftEditable()) { <END> getCompareConfiguration().getEditingDomain().getCommandStack().execute( new UpdateModelAndRejectDiffCommand(getCompareConfiguration().getEditingDomain() .getChangeRecorder(), eObject, eAttribute, newValue, diff, isLeft)); } }</code><technical_language>change enables editing right-hand side if left-hand side is read-only, changes right-hand side saved; I assume need modify check too: (isLeft && getCompareConfiguration().isLeftEditable() || !isLeft && getCompareConfiguration().isRightEditable())</technical_language>

Target:
private void updateModel(final AttributeChange diff, final EAttribute eAttribute, final IEqualityHelper equalityHelper, final EObject eObject, final boolean isLeft) { final String oldValue = getStringValue(eObject, eAttribute); GetContentRunnable runnable = new GetContentRunnable(isLeft); Display.getDefault().syncExec(runnable); String newValue = (String)runnable.getResult(); final boolean oldAndNewEquals = equalityHelper.matchingAttributeValues(newValue, oldValue); if (eObject != null && !oldAndNewEquals && getCompareConfiguration().isEditable(isLeft)) { getCompareConfiguration().getEditingDomain().getCommandStack().execute( new UpdateModelAndRejectDiffCommand(getCompareConfiguration().getEditingDomain() .getChangeRecorder(), eObject, eAttribute, newValue, diff, isLeft)); } }
Source:
<code>public <S extends NamedSnapshot> S getSingle(Class<S> type, String snapshotName, VersionCorrection versionCorrection) { <START> return new TypedSnapshotSearcher<>(getMaster(), type, snapshotName, versionCorrection).search(); <END> }</code><technical_language>I prefer avoid pattern of new Foo().methodCall() lines local var</technical_language>

Target:
public <S extends NamedSnapshot> S getSingle(Class<S> type, String snapshotName, VersionCorrection versionCorrection) { TypedSnapshotSearcher<S> searcher = new TypedSnapshotSearcher<>(getMaster(), type, snapshotName, versionCorrection); return searcher.search(); }
Source:
<code><START> public List<String> getUndeletedList() { <END> return undeletedList; }</code><technical_language>return List<File></technical_language>

Target:
public List<File> getUndeletedList() { return undeletedList; }
Source:
<code>public ExecutionResult execute(Item item) { if (item != null && item instanceof MDMServerDefItem) { MDMServerDef serverDef = ((MDMServerDefItem) item).getServerDef(); String algorithm = serverDef.getAlgorithm(); if (algorithm != null) { String decryptedPassword = null; if (algorithm.equals(PasswordUtil.ALGORITHM_COMMON)) { try { decryptedPassword = PasswordEncryptUtil.decryptPassword(serverDef.getPasswd()); } catch (Exception e) { return ExecutionResult.FAILURE; } } if (algorithm.equals(PasswordUtil.ALGORITHM_COMMON_V2)) { try { decryptedPassword = CryptoMigrationUtil.decrypt(serverDef.getPasswd()); } catch (Exception e) { return ExecutionResult.FAILURE; } } if (decryptedPassword != null) { <START> serverDef.setPasswd(PasswordUtil.encryptPassword(decryptedPassword)); <END> serverDef.setAlgorithm(PasswordUtil.ALGORITHM_COMMON_V3); try { factory.save(item, true); return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } } } } return ExecutionResult.NOTHING_TO_DO; }</code><technical_language>this encryptPassword call need change StudioEncryption well</technical_language>

Target:
public ExecutionResult execute(Item item) { if (item != null && item instanceof MDMServerDefItem) { MDMServerDef serverDef = ((MDMServerDefItem) item).getServerDef(); String algorithm = serverDef.getAlgorithm(); if (algorithm != null) { String decryptedPassword = null; if (algorithm.equals(PasswordUtil.ALGORITHM_COMMON)) { try { decryptedPassword = PasswordEncryptUtil.decryptPassword(serverDef.getPasswd()); } catch (Exception e) { return ExecutionResult.FAILURE; } } else if (algorithm.equals(PasswordUtil.ALGORITHM_COMMON_V2)) { try { decryptedPassword = CryptoMigrationUtil.decrypt(serverDef.getPasswd()); } catch (Exception e) { return ExecutionResult.FAILURE; } } if (decryptedPassword != null) { serverDef.setPasswd(PasswordUtil.encryptPassword(decryptedPassword)); serverDef.setAlgorithm(PasswordUtil.ALGORITHM_COMMON_V3); try { factory.save(item, true); return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } } } } return ExecutionResult.NOTHING_TO_DO; }
Source:
<code>public void onConnect(WebInspector inspector) { <START> inspector.sendCommand(Timeline.start()); <END> }</code><technical_language>Page Network too. matter other code enables for other reasons. enables idempotent, disable anywhere</technical_language>

Target:
public void onConnect(WebInspector inspector) { inspector.sendCommand(Network.enable()); inspector.sendCommand(Page.enable()); inspector.sendCommand(Timeline.start()); }
Source:
<code>public String toString() { <START> return "polygon (" + polygon.getGeometry().getNumPoints() + " points)"; <END> }</code><technical_language>number of holes interesting,</technical_language>

Target:
public String toString() { return "polygon (" + prepPolygon.getGeometry().getNumPoints() + " points," + prepPolygon.getGeometry().getNumGeometries() + " geometries)"; }
Source:
<code>public void clearCachingDirectory() { File cache = new File(getCachingDirectory()); if (cache.exists()) { try { FileUtils.deleteDirectory(cache); } catch (IOException e) { <START> throw new RuntimeException("Cannot create cache dir " + cache, e); <END> } } cache.mkdirs(); }</code><technical_language>throw a NuxeoException here</technical_language>

Target:
public void clearCachingDirectory() { File cache = new File(getCachingDirectory()); if (cache.exists()) { try { FileUtils.deleteDirectory(cache); } catch (IOException e) { throw new NuxeoException("Cannot create cache dir " + cache, e); } } cache.mkdirs(); }
Source:
<code>public Publisher<CacheEntry<K, V>> localPublisher(int segment) { <START> Set<K> seenKeys = new HashSet<>(cache.getAdvancedCache().getDataContainer().sizeIncludingExpired()); <END> Flowable<CacheEntry<K, V>> inMemoryFlowable = Flowable.fromPublisher(cacheSet.localPublisher(segment)) .doOnNext(ce -> seenKeys.add(ce.getKey())); Flowable<CacheEntry<K, V>> loaderFlowable = Flowable.fromPublisher(persistenceManager.<K, V>publishEntries(IntSets.immutableSet(segment), k -> !seenKeys.contains(k), true, true, BOTH)) .map(me -> PersistenceUtil.convert(me, iceFactory)); return Flowable.concat(inMemoryFlowable, loaderFlowable); }</code><technical_language>try estimate size of a single segment create a smaller set</technical_language>

Target:
public Publisher<CacheEntry<K, V>> localPublisher(int segment) { Publisher<CacheEntry<K, V>> inMemorySource = cacheSet.localPublisher(segment); IntSet segments = IntSets.immutableSet(segment); return getCacheEntryPublisher(inMemorySource, segments); }
Source:
<code>void execute() throws IOException { recvCommands(); if (hasCommands()) { for (ReceiveCommand c : getAllCommands()) c.setName(SubscribedRepository.getPubSubRefFromRemote( remote, c.getRefName())); Throwable unpackError = null; if (needPack()) { try { receivePackAndCheckConnectivity(); } catch (IOException err) { unpackError = err; } catch (RuntimeException err) { unpackError = err; } catch (Error err) { unpackError = err; } } if (unpackError == null) { validateCommands(); executeCommands(); } <START> unlockPack(); <END> if (unpackError != null) throw new UnpackException(unpackError); } }</code><technical_language>unlock twice... 86</technical_language>

Target:
private void execute() throws IOException { recvCommands(); if (hasCommands()) { for (ReceiveCommand c : getAllCommands()) c.setRefName(RefTranslator.getPubSubRefFromRemote( remote, c.getRefName())); Throwable unpackError = null; if (needPack()) { try { receivePackAndCheckConnectivity(); } catch (IOException err) { unpackError = err; } catch (RuntimeException err) { unpackError = err; } catch (Error err) { unpackError = err; } } if (unpackError == null) { validateCommands(); executeCommands(); } if (unpackError != null) throw new UnpackException(unpackError); } }
Source:
<code><START> protected static void addGlobalResource(String category, String providerName, String resourcePath) { <END> ResourceFactory resourceFactory = ResourceFactory.getInstance(); PageFactory pageFactory = Context.getRegisteredComponents(PageFactory.class).get(0); File resource = resourceFactory.getResource(providerName, resourcePath); if (resource != null) { GlobalResourceIncluder globalResourceIncluder = new GlobalResourceIncluder(); globalResourceIncluder.addResource(new Resource(category, providerName, resourcePath, -100)); pageFactory.getModelConfigurators().add(globalResourceIncluder); } }</code><technical_language>suggestion protected static void addGlobalResource(String category, String providerName, String resourcePath) {</technical_language>

Target:
protected static void addGlobalResource(String category, String providerName, String resourcePath) { ResourceFactory resourceFactory = ResourceFactory.getInstance(); PageFactory pageFactory = Context.getRegisteredComponents(PageFactory.class).get(0); File resource = resourceFactory.getResource(providerName, resourcePath); if (resource != null && pageFactory != null) { GlobalResourceIncluder globalResourceIncluder = new GlobalResourceIncluder(); int priority = -100; globalResourceIncluder.addResource(new Resource(category, providerName, resourcePath, priority)); pageFactory.getModelConfigurators().add(globalResourceIncluder); } }
Source:
<code>private boolean shouldFlushL1(TxInvocationContext ctx) { return shouldInvokeRemoteTxCommand(ctx) || <START> !ctx.isOriginLocal() && !ctx.getAffectedKeys().isEmpty(); <END> }</code><technical_language>I enough check if affectedKeys is empty, originator owner. all, invalidation done if requestors for a key, happen owners. sounds a bit expensive, L1WriteSynchronizer approach for non-tx caches invalidate primary owner instead</technical_language>

Target:
private boolean shouldFlushL1(TxInvocationContext ctx) { return !ctx.getAffectedKeys().isEmpty(); }
Source:
<code>private void determineRanking(List<SingleBenchmark> rankedSingleBenchmarkList) { Collections.sort(rankedSingleBenchmarkList, Collections.reverseOrder(new SingleBenchmarkRankingComparator())); int singleBenchmarkRanking = 0; SingleBenchmark previousSingleBenchmark = null; SingleBenchmarkRankingComparator singleBenchmarkRankingComparator = new SingleBenchmarkRankingComparator(); <START> for(SingleBenchmark singleBenchmark : rankedSingleBenchmarkList) { <END> if(previousSingleBenchmark!=null && singleBenchmarkRankingComparator.compare(previousSingleBenchmark, singleBenchmark)!=0) { singleBenchmarkRanking++; } singleBenchmark.setRanking(singleBenchmarkRanking); previousSingleBenchmark = singleBenchmark; } winningSingleBenchmark = rankedSingleBenchmarkList.isEmpty() ? null : rankedSingleBenchmarkList.get(0); worstSingleBenchmark = rankedSingleBenchmarkList.isEmpty() ? null : rankedSingleBenchmarkList.get(rankedSingleBenchmarkList.size() - 1); }</code><technical_language>space for</technical_language>

Target:
private void determineRanking(List<SingleBenchmark> rankedSingleBenchmarkList) { Comparator singleBenchmarkRankingComparator = new SingleBenchmarkRankingComparator(); Collections.sort(rankedSingleBenchmarkList, Collections.reverseOrder(singleBenchmarkRankingComparator)); int singleBenchmarkRanking = 0; int sameRankCount = 0; SingleBenchmark previousSingleBenchmark = null; for (SingleBenchmark singleBenchmark : rankedSingleBenchmarkList) { if (previousSingleBenchmark != null && singleBenchmarkRankingComparator.compare(previousSingleBenchmark, singleBenchmark) != 0) { singleBenchmarkRanking += sameRankCount; sameRankCount = 1; } else { sameRankCount++; } singleBenchmark.setRanking(singleBenchmarkRanking); previousSingleBenchmark = singleBenchmark; } winningSingleBenchmark = rankedSingleBenchmarkList.isEmpty() ? null : rankedSingleBenchmarkList.get(0); worstSingleBenchmark = rankedSingleBenchmarkList.isEmpty() ? null : rankedSingleBenchmarkList.get(rankedSingleBenchmarkList.size() - 1); }
Source:
<code>public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if (bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) { scheduler.schedule(() -> { coapClient.startObserve(this); <START> }, 3, TimeUnit.SECONDS); <END> } }</code><technical_language>wait 3 seconds here</technical_language>

Target:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if (bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) { scheduler.schedule(() -> { coapClient.startObserve(this); }, 0, TimeUnit.SECONDS); } }
Source:
<code>public float getLoad() { int machPort = SystemB.INSTANCE.mach_host_self(); int[] prevTicks = new int[SystemB.CPU_STATE_MAX]; HOST_CPU_LOAD_INFO cpuLoadInfo = new HOST_CPU_LOAD_INFO(); int ret = SystemB.INSTANCE.host_statistics(machPort, SystemB.HOST_CPU_LOAD_INFO, cpuLoadInfo, new IntByReference( SystemB.HOST_CPU_LOAD_INFO_COUNT)); if (ret == 0) { for (int i = 0; i < SystemB.CPU_STATE_MAX; i++) { prevTicks[i] = cpuLoadInfo.cpu_ticks[i]; } } try { Thread.sleep(1000); } catch (InterruptedException e) { <START> } <END> ret = SystemB.INSTANCE.host_statistics(machPort, SystemB.HOST_CPU_LOAD_INFO, cpuLoadInfo, new IntByReference( SystemB.HOST_CPU_LOAD_INFO_COUNT)); if (ret == 0) { int total = 0; for (int i = 0; i < SystemB.CPU_STATE_MAX; i++) { total += (cpuLoadInfo.cpu_ticks[i] - prevTicks[i]); } int idle = cpuLoadInfo.cpu_ticks[SystemB.CPU_STATE_IDLE] - prevTicks[SystemB.CPU_STATE_IDLE]; return 100f * (total - idle) / total; } return 0; }</code><technical_language>I crazy, do I :)</technical_language>

Target:
public float getLoad() { int[] prevTicks = getCpuTicks(); try { Thread.sleep(500); } catch (InterruptedException e) { } int[] ticks = getCpuTicks(); int total = 0; for (int i = 0; i < SystemB.CPU_STATE_MAX; i++) { total += (ticks[i] - prevTicks[i]); } int idle = ticks[SystemB.CPU_STATE_IDLE] - prevTicks[SystemB.CPU_STATE_IDLE]; if (total > 0 && idle >= 0) return 100f * (total - idle) / total; else return 0f; }
Source:
<code>public void onAdjustment( final FixedRateWalkerThrottleController controller ) { <START> logger.info( <END> "Current speed upgrades/sec, with average upgrade/sec (is limited to upgrades/sec), currently sleeping {}ms per upgrade.", new Object[] { controller.getLastSliceTps(), controller.getGlobalAverageTps(), controller.getLimiterTps(), controller.getCurrentSleepTime() } ); }</code><technical_language>this DEBUG level for final release</technical_language>

Target:
public void onAdjustment( final FixedRateWalkerThrottleController controller ) { logger.debug( "Current speed upgrades/sec, with average upgrade/sec (is limited to upgrades/sec), currently sleeping {}ms per upgrade.", new Object[] { controller.getLastSliceTps(), controller.getGlobalAverageTps(), controller.getLimiterTps(), controller.getCurrentSleepTime() } ); }
Source:
<code><START> private static void validateTopics(Catalog catalog, DeploymentType deployment) { <END> Pair<TopicDefaultsType, Map<String, TopicProfileType>> topics = getDeploymentTopics(deployment); TopicDefaultsType defaults = topics.getFirst(); Map<String, TopicProfileType> profileMap = topics.getSecond(); CompoundErrors errors = new CompoundErrors(); if (defaults != null) { validateRetention("topic defaults", defaults.getRetention(), errors); } if (profileMap != null) { for(TopicProfileType profile : profileMap.values()) { String what = "topic profile " + profile.getName(); validateRetention(what, profile.getRetention(), errors); } } if (errors.hasErrors()) { throw new RuntimeException(errors.getErrorMessage()); } hostLog.warn("FIXME: validate the topic references !!!"); }</code><technical_language>catalog is in this method</technical_language>

Target:
private static void validateTopics(Catalog catalog, DeploymentType deployment) { CompoundErrors errors = new CompoundErrors(); Pair<TopicDefaultsType, Map<String, TopicProfileType>> topics = getDeploymentTopics(deployment, errors); TopicDefaultsType defaults = topics.getFirst(); Map<String, TopicProfileType> profileMap = topics.getSecond(); if (defaults != null) { validateRetention("topic defaults", defaults.getRetention(), errors); } if (profileMap != null) { for(TopicProfileType profile : profileMap.values()) { String what = "topic profile " + profile.getName(); validateRetention(what, profile.getRetention(), errors); } } if (errors.hasErrors()) { throw new RuntimeException(errors.getErrorMessage()); } hostLog.warn("FIXME: validate the topic references !!!"); }
Source:
<code>public String toString() { <START> return "VM [" + vmStatic.getvm_name() + "]"; <END> }</code><technical_language>getName() instead of vmStatic.getvm_name()</technical_language>

Target:
public String toString() { return "VM [" + getName() + "]"; }
Source:
<code>private void createSecurityToken(SoapVersion version, SOAPFactory soapFactory, SOAPElement securityHeader) { <START> Subject subject = anonymousSubject; <END> if (tokenAboutToExpire()) { AnonymousAuthenticationToken token = new AnonymousAuthenticationToken(BaseAuthenticationToken.DEFAULT_REALM); LOGGER.debug("Getting new Anonymous user token"); synchronized (lock) { try { subject = securityManager.getSubject(token); anonymousSubject = subject; } catch (SecurityServiceException sse) { LOGGER.warn("Unable to request subject for anonymous user.", sse); } } } else { LOGGER.debug("Using cached Anonymous user token"); } if (subject != null) { PrincipalCollection principals = subject.getPrincipals(); if (principals != null) { SecurityAssertion securityAssertion = principals.oneByType(SecurityAssertion.class); if (securityAssertion != null) { SecurityToken securityToken = securityAssertion.getSecurityToken(); Element samlElement = securityToken.getToken(); SOAPElement samlAssertion = null; try { samlAssertion = soapFactory.createElement(samlElement); securityHeader.addChildElement(samlAssertion); } catch (SOAPException e) { LOGGER.error("Unable to convert SecurityToken to SOAPElement.", e); } } else { LOGGER.warn("Subject did not contain a security assertion, could not assertion" + "to security header."); } } else { LOGGER.warn("Subject did not contain any principals, could not create element."); } } }</code><technical_language>Instead of growing this big class, move token management piece a separate, thread-safe class? unit testing easier ;-)</technical_language>

Target:
private void createSecurityToken(SoapVersion version, SOAPFactory soapFactory, SOAPElement securityHeader) { Subject subject = getSubject(); if (subject != null) { PrincipalCollection principals = subject.getPrincipals(); if (principals != null) { SecurityAssertion securityAssertion = principals.oneByType(SecurityAssertion.class); if (securityAssertion != null) { SecurityToken securityToken = securityAssertion.getSecurityToken(); Element samlElement = securityToken.getToken(); SOAPElement samlAssertion = null; try { samlAssertion = soapFactory.createElement(samlElement); securityHeader.addChildElement(samlAssertion); } catch (SOAPException e) { LOGGER.error("Unable to convert SecurityToken to SOAPElement.", e); } } else { LOGGER.warn("Subject did not contain a security assertion, could not assertion" + "to security header."); } } else { LOGGER.warn("Subject did not contain any principals, could not create element."); } } }
Source:
<code>public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { <START> this.buffer = buf; <END> this.cur = 0; this.max = maxOffset; }</code><technical_language>Objects.requireNonNull(buf)</technical_language>

Target:
public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { Preconditions.checkNotNull(buf, "bug argument was null"); this.buffer = buf; this.cur = 0; this.max = maxOffset; }
Source:
<code>public ClassFileInfo getClassFileInfo(String className) { if (!jandexStaticCheckAvailable) { throw new ClassFileInfoException("Using old Jandex version."); <START> } <END> return new JandexClassFileInfo(className, index, annotationClassAnnotationsCache, classLoader); }</code><technical_language>Altough logical throw exception here, throw in ClassFileInfo.getModifiers(). reason is performance - FastAnnotatedTypeLoader sucessfully "skip" classes (annotation, @Vetoed... FastAnnotatedTypeLoader.loadAnnotatedType())</technical_language>

Target:
public ClassFileInfo getClassFileInfo(String className) { return new JandexClassFileInfo(className, index, annotationClassAnnotationsCache, classLoader); }
Source:
<code>public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(true); IFolderLayout topLeftFolder = layout.createFolder( "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(PROJECT_VIEW_ID); IFolderLayout topFolders[] = new IFolderLayout[3]; topFolders[0] = layout.createFolder( <START> "topFolder1", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); END> topFolders[0].addView(CPU_VIEW_ID); topFolders[1] = layout.createFolder( "topFolder2", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[1].addView(DISK_VIEW_ID); topFolders[2] = layout.createFolder( "topFolders3", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[2].addView(MEMORY_VIEW_ID); IFolderLayout bottomRightFolder = layout.createFolder( "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); bottomRightFolder.addView(HISTOGRAM_VIEW_ID); bottomRightFolder.addView(BOOKMARKS_VIEW_ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }</code><technical_language>ratio part ratio top part, I guess for ones, is ratio of is left, etc. view smaller down. Is design? If so, I agree design</technical_language>

Target:
public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(true); IFolderLayout topLeftFolder = layout.createFolder( "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(PROJECT_VIEW_ID); IFolderLayout topFolders[] = new IFolderLayout[3]; topFolders[0] = layout.createFolder( "topFolder1", IPageLayout.TOP, 1.0f/5.0f, IPageLayout.ID_EDITOR_AREA); topFolders[0].addView(CPU_VIEW_ID); topFolders[1] = layout.createFolder( "topFolder2", IPageLayout.TOP, 1.0f/4.0f, IPageLayout.ID_EDITOR_AREA); topFolders[1].addView(DISK_VIEW_ID); topFolders[2] = layout.createFolder( "topFolders3", IPageLayout.TOP, 1.0f/3.0f, IPageLayout.ID_EDITOR_AREA); topFolders[2].addView(MEMORY_VIEW_ID); IFolderLayout bottomRightFolder = layout.createFolder( "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); bottomRightFolder.addView(HISTOGRAM_VIEW_ID); bottomRightFolder.addView(BOOKMARKS_VIEW_ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }
Source:
<code>public DelegatingResourceDescription getCreatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("diagnosis"); description.addRequiredProperty("encounter"); description.addRequiredProperty("uuid"); description.addRequiredProperty("condition"); description.addRequiredProperty("certainty"); description.addRequiredProperty("patient"); description.addRequiredProperty("rank"); <START> description.addRequiredProperty("voided"); <END> return description; }</code><technical_language>Remove voided creatable</technical_language>

Target:
public DelegatingResourceDescription getCreatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("diagnosis"); description.addRequiredProperty("encounter"); description.addRequiredProperty("condition"); description.addRequiredProperty("certainty"); description.addRequiredProperty("patient"); description.addRequiredProperty("rank"); return description; }
Source:
<code>public void updateFlatLighting() { full = state.isFullCube(); packed[0] = state.getPackedLightmapCoords(world, blockPos); <START> for (EnumFacing side : EnumFacing.values()) <END> { int i = side.ordinal() + 1; packed[i] = state.getPackedLightmapCoords(world, blockPos.offset(side)); } }</code><technical_language>EnumFacing.VALUES save a small allocation, in case escape analysis get</technical_language>

Target:
public void updateFlatLighting() { full = state.isFullCube(); packed[0] = state.getPackedLightmapCoords(world, blockPos); for (EnumFacing side : SIDES) { int i = side.ordinal() + 1; packed[i] = state.getPackedLightmapCoords(world, blockPos.offset(side)); } }
Source:
<code>public void onMatch(RelOptRuleCall call) { VoltDBLLimit limitOffset = call.rel(0); RelNode input = limitOffset.getInput(); RelTraitSet convertedTraits = limitOffset.getTraitSet() .replace(VoltDBPRel.VOLTDB_PHYSICAL).simplify(); RelNode convertedInput = convert(input, input.getTraitSet().replace(VoltDBPRel.VOLTDB_PHYSICAL).simplify()); <START> int splitCount = (convertedInput instanceof VoltDBPRel) ? <END> ((VoltDBPRel) convertedInput).getSplitCount() : 1; call.transformTo(new VoltDBPLimit( limitOffset.getCluster(), convertedTraits, convertedInput, limitOffset.getOffset(), limitOffset.getLimit(), splitCount)); }</code><technical_language>determinations of splitCount need factored out classes</technical_language>

Target:
public void onMatch(RelOptRuleCall call) { VoltDBLLimit limitOffset = call.rel(0); RelNode input = limitOffset.getInput(); RelTraitSet convertedTraits = limitOffset.getTraitSet() .replace(VoltDBPRel.VOLTDB_PHYSICAL).simplify(); RelNode convertedInput = convert(input, input.getTraitSet().replace(VoltDBPRel.VOLTDB_PHYSICAL).simplify()); int splitCount = VoltDBRelUtil.decideSplitCount(convertedInput); call.transformTo(new VoltDBPLimit( limitOffset.getCluster(), convertedTraits, convertedInput, limitOffset.getOffset(), limitOffset.getLimit(), splitCount)); }
Source:
<code>public static Thing createThing(ThingUID thingUID, Configuration configuration, Map<String, String> properties, ThingUID bridgeUID, ThingTypeUID thingTypeUID, List<ThingHandlerFactory> thingHandlerFactories) { for (ThingHandlerFactory thingHandlerFactory : thingHandlerFactories) { if (thingHandlerFactory.supportsThingType(thingTypeUID)) { Thing thing = thingHandlerFactory.createThing(thingTypeUID, configuration, thingUID, bridgeUID); <START> if (thing != null && properties != null) { <END> for (String key : properties.keySet()) { thing.setProperty(key, properties.get(key)); } } return thing; } } return null; }</code><technical_language>use: java if (thing == null) { continue; } If factories create thing, return "null" do try other factory</technical_language>

Target:
public static Thing createThing(ThingUID thingUID, Configuration configuration, Map<String, String> properties, ThingUID bridgeUID, ThingTypeUID thingTypeUID, List<ThingHandlerFactory> thingHandlerFactories) { for (ThingHandlerFactory thingHandlerFactory : thingHandlerFactories) { if (thingHandlerFactory.supportsThingType(thingTypeUID)) { Thing thing = thingHandlerFactory.createThing(thingTypeUID, configuration, thingUID, bridgeUID); if (thing == null) { logger.error("Thing factory returned null when it reports to support the thing"); } else { if (properties != null) { for (String key : properties.keySet()) { thing.setProperty(key, properties.get(key)); } } } return thing; } } return null; }
Source:
<code>public OAuthAuthenticatorProvider(final Set<OAuthAuthenticator> oAuthAuthenticators) { <START> for (final OAuthAuthenticator oneOAuthAuthenticator : oAuthAuthenticators) { <END> this.oAuthAuthenticators.put(oneOAuthAuthenticator.getOAuthProvider(), oneOAuthAuthenticator); } }</code><technical_language>rewrite this stream API. WDYT</technical_language>

Target:
public OAuthAuthenticatorProvider(final Set<OAuthAuthenticator> oAuthAuthenticators) { oAuthAuthenticators.forEach(authenticator -> this.oAuthAuthenticators.put(authenticator.getOAuthProvider(), authenticator)); }
Source:
<code>public Set<AccountGroup.UUID> getAllOwners() { Set<AccountGroup.UUID> result = new <START> HashSet<AccountGroup.UUID>(); <END> for (ProjectState p : tree()) { result.addAll(p.localOwners); } return result; }</code><technical_language>In event, Java7, just: new HashSet<>();</technical_language>

Target:
public Set<AccountGroup.UUID> getAllOwners() { Set<AccountGroup.UUID> result = new HashSet<>(); for (ProjectState p : tree()) { result.addAll(p.localOwners); } return result; }
Source:
<code>public JsonNode remove(String name) { <START> return JsonNodeUtils.fromGsonElement(jsonObject.remove(name)); <END> }</code><technical_language>gson code base, remove return null if element exists want guard aganist NPE well</technical_language>

Target:
public JsonNode remove(String name) { JsonElement jsonElement = jsonObject.remove(name); return (jsonElement == null) ? null : JsonNodeUtils.fromGsonElement(jsonElement); }
Source:
<code>public void substring() { assertThat( value.apply( "hello" ).substring( 2, 5 ), equalTo( value.apply( "llo" ) ) ); assertThat( value.apply( "hello" ).substring( 4, 5 ), equalTo( value.apply( "o" ) ) ); assertThat( value.apply( "hello" ).substring( 1, 3 ), equalTo( value.apply( "ell" ) ) ); assertThat( value.apply( "hello" ).substring( 8, 5 ), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( "0123456789" ).substring( 1 ), equalTo( value.apply( "123456789" ) ) ); assertThat( value.apply( "0123456789" ).substring( 5 ), equalTo( value.apply( "56789" ) ) ); assertThat( value.apply( "0123456789" ).substring( 15 ), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( "\uD83D\uDE21\uD83D\uDE21\uD83D\uDE21" ).substring( 1, 1 ), <START> equalTo( value.apply( "\uD83D\uDE21" ) ) ); <END> assertThat( value.apply( "\uD83D\uDE21\uD83D\uDE21\uD83D\uDE21" ).substring( 1, 2 ), equalTo( value.apply( "\uD83D\uDE21\uD83D\uDE21" ) ) ); exception.expect( IndexOutOfBoundsException.class ); value.apply( "hello" ).substring( -4, 2 ); }</code><technical_language>This assert is powerful. char is repeated selected</technical_language>

Target:
public void substring() { assertThat( value.apply( "hello" ).substring( 2, 5 ), equalTo( value.apply( "llo" ) ) ); assertThat( value.apply( "hello" ).substring( 4, 5 ), equalTo( value.apply( "o" ) ) ); assertThat( value.apply( "hello" ).substring( 1, 3 ), equalTo( value.apply( "ell" ) ) ); assertThat( value.apply( "hello" ).substring( 8, 5 ), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( "0123456789" ).substring( 1 ), equalTo( value.apply( "123456789" ) ) ); assertThat( value.apply( "0123456789" ).substring( 5 ), equalTo( value.apply( "56789" ) ) ); assertThat( value.apply( "0123456789" ).substring( 15 ), equalTo( StringValue.EMTPY ) ); assertThat( value.apply( "\uD83D\uDE21\uD83D\uDCA9\uD83D\uDC7B" ).substring( 1, 1 ), equalTo( value.apply( "\uD83D\uDCA9" ) ) ); assertThat( value.apply( "\uD83D\uDE21\uD83D\uDCA9\uD83D\uDC7B" ).substring( 1, 2 ), equalTo( value.apply( "\uD83D\uDCA9\uD83D\uDC7B" ) ) ); exception.expect( IndexOutOfBoundsException.class ); value.apply( "hello" ).substring( -4, 2 ); }
Source:
<code>private void sendData(long timeStamp, Object[] data) { if (siddhiAppContext.isPlayback()) { <START> (this.siddhiAppContext.getTimestampGenerator()) <END> .setCurrentTimestamp(timeStamp); } if (throughputTracker != null && siddhiAppContext.isStatsEnabled()) { throughputTracker.eventIn(); } if (disruptor != null) { long sequenceNo = ringBuffer.next(); try { EventExchangeHolder eventExchangeHolder = ringBuffer.get(sequenceNo); eventExchangeHolder.getAndSetIsProcessed(false); eventExchangeHolder.getEvent().setTimestamp(timeStamp); eventExchangeHolder.getEvent().setIsExpired(false); System.arraycopy(data, 0, eventExchangeHolder.getEvent().getData(), 0, data.length); } finally { ringBuffer.publish(sequenceNo); } } else { for (Receiver receiver : receivers) { receiver.receive(timeStamp, data); } } }</code><technical_language>need ()</technical_language>

Target:
private void sendData(long timeStamp, Object[] data) { if (siddhiAppContext.isPlayback()) { this.siddhiAppContext.getTimestampGenerator().setCurrentTimestamp(timeStamp); } if (throughputTracker != null && siddhiAppContext.isStatsEnabled()) { throughputTracker.eventIn(); } if (disruptor != null) { long sequenceNo = ringBuffer.next(); try { EventExchangeHolder eventExchangeHolder = ringBuffer.get(sequenceNo); eventExchangeHolder.getAndSetIsProcessed(false); eventExchangeHolder.getEvent().setTimestamp(timeStamp); eventExchangeHolder.getEvent().setIsExpired(false); System.arraycopy(data, 0, eventExchangeHolder.getEvent().getData(), 0, data.length); } finally { ringBuffer.publish(sequenceNo); } } else { for (Receiver receiver : receivers) { receiver.receive(timeStamp, data); } } }
Source:
<code>public static int traverse(List<Task<? extends Serializable>> tasks, Function function) { List<Task<? extends Serializable>> listOfTasks = new ArrayList<>(tasks); int numTasks = 0; while (!listOfTasks.isEmpty()) { List<Task<? extends Serializable>> children = new ArrayList<>(); for (Task<? extends Serializable> task : listOfTasks) { if (function.skipProcessing(task)) { continue; } if (task.getDependentTasks() != null) { children.addAll(task.getDependentTasks()); } function.process(task); <START> numTasks++; <END> } listOfTasks = children; } return numTasks; }</code><technical_language>This ignore duplicate path. So, tasks count bloated up. Need relook</technical_language>

Target:
public static void traverse(List<Task<? extends Serializable>> tasks, Function function) { List<Task<? extends Serializable>> listOfTasks = new ArrayList<>(tasks); while (!listOfTasks.isEmpty()) { List<Task<? extends Serializable>> children = new ArrayList<>(); for (Task<? extends Serializable> task : listOfTasks) { if (function.skipProcessing(task)) { continue; } if (task.getDependentTasks() != null) { children.addAll(task.getDependentTasks()); } function.process(task); } listOfTasks = children; } }
Source:
<code>protected void build(UnitVmModel model, T vm) { vm.setMemSizeMb(model.getMemSize().getEntity()); vm.setMaxMemorySizeMb(model.getMaxMemorySize().getEntity()); if (model.getIoThreadsEnabled().getEntity()) { vm.setNumOfIoThreads(DEFAULT_NUM_OF_IOTHREADS); } else { vm.setNumOfIoThreads(0); } vm.setNumOfSockets(model.getNumOfSockets().getSelectedItem()); vm.setCpuPerSocket(model.getCoresPerSocket().getSelectedItem()); vm.setThreadsPerCpu(model.getThreadsPerCore().getSelectedItem()); vm.setDefaultDisplayType(model.getDisplayType().getSelectedItem()); vm.setNumOfMonitors(model.getNumOfMonitors().getSelectedItem()); vm.setSmartcardEnabled(model.getIsSmartcardEnabled().getEntity()); vm.setSsoMethod(model.extractSelectedSsoMethod()); vm.setMinAllocatedMem(model.getMinAllocatedMemory().getEntity()); vm.setDefaultBootSequence(model.getBootSequence()); vm.setSingleQxlPci(model.getIsSingleQxlEnabled().getEntity()); vm.setCustomEmulatedMachine(model.getEmulatedMachine().getSelectedItem()); vm.setBiosType(BiosType.I440FX_SEA_BIOS); <START> END> vm.setCustomCpuName(model.getCustomCpu().getSelectedItem()); }</code><technical_language>I mean, do need this - default in VmStatic, no</technical_language>

Target:
protected void build(UnitVmModel model, T vm) { vm.setMemSizeMb(model.getMemSize().getEntity()); vm.setMaxMemorySizeMb(model.getMaxMemorySize().getEntity()); if (model.getIoThreadsEnabled().getEntity()) { vm.setNumOfIoThreads(DEFAULT_NUM_OF_IOTHREADS); } else { vm.setNumOfIoThreads(0); } vm.setNumOfSockets(model.getNumOfSockets().getSelectedItem()); vm.setCpuPerSocket(model.getCoresPerSocket().getSelectedItem()); vm.setThreadsPerCpu(model.getThreadsPerCore().getSelectedItem()); vm.setDefaultDisplayType(model.getDisplayType().getSelectedItem()); vm.setNumOfMonitors(model.getNumOfMonitors().getSelectedItem()); vm.setSmartcardEnabled(model.getIsSmartcardEnabled().getEntity()); vm.setSsoMethod(model.extractSelectedSsoMethod()); vm.setMinAllocatedMem(model.getMinAllocatedMemory().getEntity()); vm.setDefaultBootSequence(model.getBootSequence()); vm.setSingleQxlPci(model.getIsSingleQxlEnabled().getEntity()); vm.setCustomEmulatedMachine(model.getEmulatedMachine().getSelectedItem()); vm.setCustomCpuName(model.getCustomCpu().getSelectedItem()); }
Source:
<code>public void setFilterContext(boolean isSelectedInUse, int[] selected, int selectedSize) { this.currBatchIsSelectedInUse = isSelectedInUse; this.currBatchSelected = selected; this.currBatchSelectedSize = selectedSize; for (int i = 0; i < selectedSize-1; i++) <START> assert selected[i] < selected[i+1]; <END> }</code><technical_language>move a method profiler show a separate cost</technical_language>

Target:
public void setFilterContext(boolean isSelectedInUse, int[] selected, int selectedSize) { this.currBatchIsSelectedInUse = isSelectedInUse; this.currBatchSelected = selected; this.currBatchSelectedSize = selectedSize; assert isValidSelected() : "Selected array may not contain duplicates or unordered values"; }