auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void logQueryKill(QueryId killedQueryId, List<MemoryInfo> nodes) { if (!log.isDebugEnabled()) { return; } log.debug("Query Kill Decision: Killed %s", killedQueryId); for (MemoryInfo node : nodes) { MemoryPoolInfo memoryPoolInfo = node.getPools().get(GENERAL_POOL); if (memoryPoolInfo == null) { continue; } StringBuilder nodeDescription = new StringBuilder(); nodeDescription.append("Query Kill Scenario: "); nodeDescription.append("MaxBytes ").append(memoryPoolInfo.getMaxBytes()); nodeDescription.append("FreeBytes ").append(memoryPoolInfo.getFreeBytes() + memoryPoolInfo.getReservedRevocableBytes()); nodeDescription.append("Queries "); for (Map.Entry<QueryId, Long> entry : memoryPoolInfo.getQueryMemoryReservations().entrySet()) { nodeDescription.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } nodeDescription.setLength(nodeDescription.length() - 1); <START> log.debug(nodeDescription.toString()); <END> } }</code><technical_language>I want log a single entry newlines, similar stack traces logged. Logging multiple entries logging messages get mixed this harder search for</technical_language>

Target:
private void logQueryKill(QueryId killedQueryId, List<MemoryInfo> nodes) { if (!log.isInfoEnabled()) { return; } StringBuilder nodeDescription = new StringBuilder(); nodeDescription.append("Query Kill Decision: Killed ").append(killedQueryId).append("\n"); for (MemoryInfo node : nodes) { MemoryPoolInfo memoryPoolInfo = node.getPools().get(GENERAL_POOL); if (memoryPoolInfo == null) { continue; } nodeDescription.append("Query Kill Scenario: "); nodeDescription.append("MaxBytes ").append(memoryPoolInfo.getMaxBytes()).append(' '); nodeDescription.append("FreeBytes ").append(memoryPoolInfo.getFreeBytes() + memoryPoolInfo.getReservedRevocableBytes()).append(' '); nodeDescription.append("Queries "); Joiner.on(",").withKeyValueSeparator("=").appendTo(nodeDescription, memoryPoolInfo.getQueryMemoryReservations()); nodeDescription.append('\n'); } log.info(nodeDescription.toString()); }
Source:
<code>private void dropOrLogOrphanViews(PhoenixConnection phoenixConnection, Configuration configuration, Key key) throws Exception { if (outputPath != null) { writer[VIEW].write(key.serialize()); writer[VIEW].newLine(); } else if (!clean) { <START> System.out.println(key.serialize()); <END> return; } if (!clean) { return; } gracefullyDropView(phoenixConnection, configuration, key); }</code><technical_language>suggestion: create a map (link-type <-> PTable.LinkType) reverse-map (PTable.LinkType <-> link-type) that. converting link-type enum suggested earlier do AssertionError, enums provide compile time checking</technical_language>

Target:
private void dropOrLogOrphanViews(PhoenixConnection phoenixConnection, Configuration configuration, Key key) throws Exception { if (outputPath != null) { writer[VIEW].write(key.getSerializedValue()); writer[VIEW].newLine(); } else if (!clean) { System.out.println(key.getSerializedValue()); return; } if (!clean) { return; } gracefullyDropView(phoenixConnection, configuration, key); }
Source:
<code>public <START> ImportVmParameters( <END> Collection<ExternalVnicProfileMapping> externalVnicProfileMappings, boolean reassignBadMacs) { this(); this.externalVnicProfileMappings = Objects.requireNonNull(externalVnicProfileMappings); this.reassignBadMacs = reassignBadMacs; }</code><technical_language>better, in situation constructors initialized data, specific constructors calls more specific one, is sole setting data fields. done place, uniformly. otherwise. Data in this constructor partly set here, partly in no-arg constructor. no-arg constructor partly set data in constructor partly in field definition. This definition meaning instantiations, of overwrites it. So, please: 1.) move #39,#40 this constructor. 2.) delegate ImportVmParameters() this constructor, passing Collections.emptyList() false. 3.) remove call this() parameterized constructor</technical_language>

Target:
public ImportVmParameters( Collection<ExternalVnicProfileMapping> externalVnicProfileMappings, boolean reassignBadMacs) { this.sourceDomainId = Guid.Empty; this.destDomainId = Guid.Empty; this.externalVnicProfileMappings = Objects.requireNonNull(externalVnicProfileMappings); this.reassignBadMacs = reassignBadMacs; }
Source:
<code><START> public void testDisableReverseDNSProcessor() throws Exception { <END> try { filter.monitor.config.props.put("ignorePostProcessors", "reverseDNS"); Object principal = new User("username", "", Collections.<GrantedAuthority>emptyList()); RequestData data = testRemoteUser(principal); assertNull(data.getRemoteHost()); } finally { filter.monitor.config.props.remove("ignorePostProcessors"); } }</code><technical_language>Good, assertion checks remote host is there, post processor is disabled</technical_language>

Target:
public void testDisableReverseDNSProcessor() throws Exception { Object principal = new User("username", "", Collections.<GrantedAuthority>emptyList()); RequestData data = testRemoteUser(principal); assertNotNull(data.getRemoteHost()); try { filter = new MonitorFilter(new Monitor(dao), new MonitorRequestFilter()); filter.monitor.config.props.put("ignorePostProcessors", "reverseDNS"); chain = new MockFilterChain( new HttpServlet() { @Override public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { req.getInputStream().read(new byte[LONG_BODY_SIZE]); res.getOutputStream().write(new byte[0]); } }); principal = new User("username", "", Collections.<GrantedAuthority>emptyList()); data = testRemoteUser(principal); assertNull(data.getRemoteHost()); } finally { filter.monitor.config.props.remove("ignorePostProcessors"); } }
Source:
<code>public void testDelayWithToken() throws InterruptedException { CancellationTokenSource cts = new CancellationTokenSource(); final Task<Void> delayed = Task.delay(200, cts.getToken()); cts.cancel(); <START> Thread.sleep(250); <END> assertTrue(delayed.isCancelled()); }</code><technical_language>need this sleep anymore, right</technical_language>

Target:
public void testDelayWithToken() throws InterruptedException { CancellationTokenSource cts = new CancellationTokenSource(); final Task<Void> delayed = Task.delay(200, cts.getToken()); assertFalse(delayed.isCancelled()); cts.cancel(); assertTrue(delayed.isCancelled()); }
Source:
<code>protected void doMove(FeatureMapChange diff, Comparison comparison, EObject expectedContainer, FeatureMap.Entry expectedValue, boolean rightToLeft) { final EStructuralFeature attribute = diff.getAttribute(); if (attribute.isMany()) { int insertionIndex = findInsertionIndex(comparison, diff, rightToLeft); final List<Object> targetList = (List<Object>)safeEGet(expectedContainer, attribute); final int currentIndex = targetList.indexOf(expectedValue); if (insertionIndex > currentIndex && currentIndex >= 0) { insertionIndex--; } if (currentIndex == -1) { <START> if (insertionIndex < 0 || insertionIndex > targetList.size()) { <END> ((BasicFeatureMap)(Object)targetList).addUnique(expectedValue); } else { ((BasicFeatureMap)(Object)targetList).addUnique(insertionIndex, expectedValue); } } else { if (insertionIndex < 0 && insertionIndex > targetList.size()) { ((BasicFeatureMap)(Object)targetList).move(targetList.size() - 1, expectedValue); } else { ((BasicFeatureMap)(Object)targetList).move(insertionIndex, expectedValue); } } } else { safeESet(expectedContainer, attribute, expectedValue); } }</code><technical_language>nice catch</technical_language>

Target:
protected void doMove(FeatureMapChange diff, Comparison comparison, EObject expectedContainer, FeatureMap.Entry expectedValue, boolean rightToLeft) { final EStructuralFeature attribute = diff.getAttribute(); if (attribute.isMany()) { int insertionIndex = findInsertionIndex(comparison, diff, rightToLeft); final List<Object> targetList = (List<Object>)safeEGet(expectedContainer, attribute); final int currentIndex = targetList.indexOf(expectedValue); if (insertionIndex > currentIndex && currentIndex >= 0) { insertionIndex--; } if (currentIndex == -1) { if (insertionIndex < 0 || insertionIndex > targetList.size()) { ((BasicFeatureMap)(Object)targetList).addUnique(expectedValue); } else { ((BasicFeatureMap)(Object)targetList).addUnique(insertionIndex, expectedValue); } } else { if (insertionIndex < 0 || insertionIndex > targetList.size()) { ((BasicFeatureMap)(Object)targetList).move(targetList.size() - 1, expectedValue); } else { ((BasicFeatureMap)(Object)targetList).move(insertionIndex, expectedValue); } } } else { safeESet(expectedContainer, attribute, expectedValue); } }
Source:
<code>public void waitSelectedElementInFindUsagesPanel(String nameElement) { <START> webDriverWaitFactory <END> .get(LOAD_PAGE_TIMEOUT_SEC) .until( (ExpectedCondition<Boolean>) driver -> getHighlightedItem(nameElement) .getCssValue("background-image") .contains(HIGHLIGHTED_IMAGE)); }</code><technical_language>shorten code SeleniumWebDriverHelper#waitSuccessCondition(expression) method instead</technical_language>

Target:
public void waitSelectedElementInFindUsagesPanel(String nameElement) { seleniumWebDriverHelper.waitSuccessCondition( driver -> getHighlightedItem(nameElement) .getCssValue("background-image") .contains(HIGHLIGHTED_IMAGE)); }
Source:
<code>public void postTrackBlock(BlockSnapshot snapshot, BlockTickContext context) { <START> if (false) { <END> TrackingUtil.processBlockCaptures(context.getCapturedBlockSupplier(), this, context); context.getCapturedBlockSupplier().prune(snapshot); } }</code><technical_language>add todo</technical_language>

Target:
public void postTrackBlock(BlockSnapshot snapshot, BlockTickContext context) { }
Source:
<code>private DbException getSingleSortKeyException() { String sql = getSQL(); <START> return DbException.getSyntaxError(sql, sql.length() - 1, "single sort key is required for RANGE units"); <END> }</code><technical_language>sort key is required for RANGE units</technical_language>

Target:
private DbException getSingleSortKeyException() { String sql = getSQL(); return DbException.getSyntaxError(sql, sql.length() - 1, "exactly one sort key is required for RANGE units"); }
Source:
<code>public synchronized void save() throws IOException { if (BulkChange.contains(this)) { return; } getStateFile().write(this); <START> SaveableListener.fireOnChange(this, getStateFile()); <END> }</code><technical_language>Fire event of monitor</technical_language>

Target:
public void save() throws IOException { synchronized (this) { if (BulkChange.contains(this)) { return; } getStateFile().write(this); } SaveableListener.fireOnChange(this, getStateFile()); }
Source:
<code>public boolean hasKafkaKey() { <START> return this.mKafkaKey.length != 0; <END> }</code><technical_language>check null zero length</technical_language>

Target:
public boolean hasKafkaKey() { return this.mKafkaKey != null && this.mKafkaKey.length != 0; }
Source:
<code>private void replaceFile(Path from, Path to) throws IOException { try { <START> Files.move(from, to, StandardCopyOption.ATOMIC_MOVE); <END> } catch (AtomicMoveNotSupportedException e) { Files.move(from, to, StandardCopyOption.REPLACE_EXISTING); } }</code><technical_language>Files.move(from, to, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); I pass parameters for try</technical_language>

Target:
private void replaceFile(Path from, Path to) throws IOException { try { Files.move(from, to, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); } catch (AtomicMoveNotSupportedException e) { Files.move(from, to, StandardCopyOption.REPLACE_EXISTING); } }
Source:
<code>public void deleteFromTableTest0() throws InterruptedException { <START> log.info("deleteFromTableTest1"); <END> SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream DeleteStockStream (symbol string, price float, volume long); " + "define table StockTable (symbol string, price float, volume long); "; String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from DeleteStockStream " + "delete StockTable " + " on symbol=='IBM' ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query); InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream"); InputHandler deleteStockStream = siddhiAppRuntime.getInputHandler("DeleteStockStream"); siddhiAppRuntime.start(); stockStream.send(new Object[]{"WSO2", 55.6f, 100L}); stockStream.send(new Object[]{"IBM", 75.6f, 100L}); stockStream.send(new Object[]{"WSO2", 57.6f, 100L}); Event[] events = new Event[2]; events[0] = new Event(System.currentTimeMillis(), new Object[]{"WSO2", 55.6f, 100L}); events[1] = new Event(System.currentTimeMillis(), new Object[]{"IBM", 75.6f, 100L}); deleteStockStream.send(events); Thread.sleep(500); siddhiAppRuntime.shutdown(); }</code><technical_language>name test consistency else hard debug this deleteFromTableTest0</technical_language>

Target:
public void deleteFromTableTest0() throws InterruptedException { log.info("deleteFromTableTest0"); SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream DeleteStockStream (symbol string, price float, volume long); " + "define table StockTable (symbol string, price float, volume long); "; String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from DeleteStockStream " + "delete StockTable " + " on symbol=='IBM' ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query); InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream"); InputHandler deleteStockStream = siddhiAppRuntime.getInputHandler("DeleteStockStream"); siddhiAppRuntime.start(); stockStream.send(new Object[]{"WSO2", 55.6f, 100L}); stockStream.send(new Object[]{"IBM", 75.6f, 100L}); stockStream.send(new Object[]{"WSO2", 57.6f, 100L}); Event[] events = new Event[2]; events[0] = new Event(System.currentTimeMillis(), new Object[]{"WSO2", 55.6f, 100L}); events[1] = new Event(System.currentTimeMillis(), new Object[]{"IBM", 75.6f, 100L}); deleteStockStream.send(events); Thread.sleep(500); siddhiAppRuntime.shutdown(); }
Source:
<code>public boolean isSessionInUse(long sessionSeqId) { CommandStatus cmdStatus; for (Guid cmdId : CommandCoordinatorUtil.getCommandIdsBySessionSeqId(sessionSeqId)) { cmdStatus = CommandCoordinatorUtil.getCommandStatus(cmdId); if (cmdStatus == CommandStatus.NOT_STARTED || cmdStatus == CommandStatus.ACTIVE) { return true; } } <START> if (!jobDao.getJobsBySessionSeqIdAndStatus(sessionSeqId, JobExecutionStatus.STARTED).isEmpty()) { <END> return true; } return false; }</code><technical_language>lines 25-29 simplified to: return !jobDao.getJobsBySessionSeqIdAndStatus(sessionSeqId, JobExecutionStatus.STARTED).isEmpty();</technical_language>

Target:
public boolean isSessionInUse(long sessionSeqId) { CommandStatus cmdStatus; for (Guid cmdId : CommandCoordinatorUtil.getCommandIdsBySessionSeqId(sessionSeqId)) { cmdStatus = CommandCoordinatorUtil.getCommandStatus(cmdId); if (cmdStatus == CommandStatus.NOT_STARTED || cmdStatus == CommandStatus.ACTIVE) { return true; } } return !jobDao.getJobsBySessionSeqIdAndStatus(sessionSeqId, JobExecutionStatus.STARTED).isEmpty(); }
Source:
<code>public EventConsumer createEventConsumer(final String topic, final Map<String, String> cursors) throws ServiceUnavailableException { final List<KafkaCursor> kafkaCursors = Lists.newArrayListWithCapacity(cursors.size()); <START> for (Map.Entry<String, String> entry : cursors.entrySet()) { <END> final String offset = entry.getValue(); final String partition = entry.getKey(); final long kafkaOffset; if (Cursor.BEFORE_OLDEST_OFFSET.equals(offset)) { final TopicPartition tp = getPartition(topic, partition); kafkaOffset = toKafkaOffset(tp.getOldestAvailableOffset()); } else { kafkaOffset = toKafkaOffset(offset) + 1L; } final KafkaCursor kafkaCursor = kafkaCursor(toKafkaPartition(partition), kafkaOffset); kafkaCursors.add(kafkaCursor); } return kafkaFactory.createNakadiConsumer(topic, kafkaCursors, settings.getKafkaPollTimeoutMs()); }</code><technical_language>entry final</technical_language>

Target:
public EventConsumer createEventConsumer(final String topic, final Map<String, String> cursors) throws ServiceUnavailableException { final List<KafkaCursor> kafkaCursors = Lists.newArrayListWithCapacity(cursors.size()); for (final Map.Entry<String, String> entry : cursors.entrySet()) { final String offset = entry.getValue(); final String partition = entry.getKey(); final long kafkaOffset; if (Cursor.BEFORE_OLDEST_OFFSET.equals(offset)) { final TopicPartition tp = getPartition(topic, partition); kafkaOffset = toKafkaOffset(tp.getOldestAvailableOffset()); } else { kafkaOffset = toKafkaOffset(offset) + 1L; } final KafkaCursor kafkaCursor = kafkaCursor(toKafkaPartition(partition), kafkaOffset); kafkaCursors.add(kafkaCursor); } return kafkaFactory.createNakadiConsumer(topic, kafkaCursors, settings.getKafkaPollTimeoutMs()); }
Source:
<code>public List<NetInterface<? extends NetInterfaceAddress>> getActiveNetworkInterfaces() throws KuraException { List<NetInterface<? extends NetInterfaceAddress>> interfaces = getNetworkInterfaces(); int i = 0; <START> while (i < interfaces.size()) { <END> NetInterface<? extends NetInterfaceAddress> iface = interfaces.get(i); if (LinuxNetworkUtil.hasAddress(iface.getName())) { i++; } else { logger.debug("removing interface because it is not up", iface.getName()); interfaces.remove(i); } } return interfaces; }</code><technical_language>a foreach? I like: for (NetInterface<? extends NetInterfaceAddress> iface : interfaces) { work</technical_language>

Target:
public List<NetInterface<? extends NetInterfaceAddress>> getActiveNetworkInterfaces() throws KuraException { List<NetInterface<? extends NetInterfaceAddress>> activeInterfaces = new ArrayList<>(); List<NetInterface<? extends NetInterfaceAddress>> interfaces = getNetworkInterfaces(); for (NetInterface<? extends NetInterfaceAddress> iface : interfaces) { if (LinuxNetworkUtil.hasAddress(iface.getName())) { activeInterfaces.add(iface); } } return activeInterfaces; }
Source:
<code>public static Uri buildSearchUri(List<Attribute> attributes) { AttributeMap metadataMap = new AttributeMap(); metadataMap.addAll(attributes); Uri.Builder searchUri = new Uri.Builder() .scheme("search") .authority("hentoid"); <START> for (Map.Entry<AttributeType,List<Attribute>> entry : metadataMap.entrySet()) { <END> AttributeType attrType = entry.getKey(); List<Attribute> list = entry.getValue(); for (Attribute attr : list) searchUri.appendQueryParameter(attrType.name(), attr.getId() + ";" + attr.getName()); } return searchUri.build(); }</code><technical_language>Sonar's recommendations longer write</technical_language>

Target:
public static Uri buildSearchUri(List<Attribute> attributes) { AttributeMap metadataMap = new AttributeMap(); metadataMap.addAll(attributes); Uri.Builder searchUri = new Uri.Builder() .scheme("search") .authority("hentoid"); for (AttributeType attrType : metadataMap.keySet()) { List<Attribute> attrs = metadataMap.get(attrType); for (Attribute attr : attrs) searchUri.appendQueryParameter(attrType.name(), attr.getId() + ";" + attr.getName()); } return searchUri.build(); }
Source:
<code>public void fill() { Set<String> matched; try { matched = getMatchedStores(); } catch ( IndyDataException e ) { logger.error( "Failed to get matched stores", e ); return; } if ( matched.isEmpty() ) { logger.info( "No matched stores" ); return; } logger.info( "Fill cache, matched stores: {}", matched ); Set<String> scanned = getScannedStores(); List<String> notScanned = new ArrayList<>( matched ); notScanned.removeAll( scanned ); if ( !notScanned.isEmpty() ) { <START> List<List<String>> batches = Lists.partition( notScanned, 100 ); <END> batches.forEach( batch -> { boolean success = scanAndUpdate( batch ); if ( !success ) { logger.warn( "Scan failed for: {}", batch ); } } ); scanned = getScannedStores(); } Set<String> deleted = new HashSet<>( scanned ); deleted.removeAll( matched ); if ( !deleted.isEmpty() ) { logger.info( "Find deleted stores, deleted: {}", deleted ); reduce( SCANNED_STORES, deleted ); } }</code><technical_language>Magic number constant? configurable</technical_language>

Target:
public void fill() { Set<String> matched; try { matched = getMatchedStores(); } catch ( IndyDataException e ) { logger.error( "Failed to get matched stores", e ); return; } if ( matched.isEmpty() ) { logger.info( "No matched stores" ); return; } logger.info( "Fill cache, matched stores: {}", matched ); Set<String> scanned = getScannedStores(); List<String> notScanned = new ArrayList<>( matched ); notScanned.removeAll( scanned ); if ( !notScanned.isEmpty() ) { List<List<String>> batches = Lists.partition( notScanned, SCAN_BATCH_SIZE ); batches.forEach( batch -> { boolean success = scanAndUpdate( batch ); if ( !success ) { logger.warn( "Scan failed for: {}", batch ); } } ); scanned = getScannedStores(); } Set<String> deleted = new HashSet<>( scanned ); deleted.removeAll( matched ); if ( !deleted.isEmpty() ) { logger.info( "Find deleted stores, deleted: {}", deleted ); reduce( SCANNED_STORES, deleted ); } }
Source:
<code>private void onDone(boolean enabled) { setTabEnabled(tabInfo, enabled); outstandingCallbacks--; if (outstandingCallbacks == 0 || (enabled && tabInfo == Tab.RELATED_CHANGES)) { outstandingCallbacks = 0; boolean show = false; for (int i = 0; i < getTabBar().getTabCount(); i++) { if (getTabBar().isTabEnabled(i)) { selectTab(i); show = true; break; } } if (show && !isVisible()) { <START> setVisible(true); <END> applyMaxHeight(); } } }</code><technical_language>move this loop, executes once</technical_language>

Target:
private void onDone(boolean enabled) { setTabEnabled(tabInfo, enabled); outstandingCallbacks--; if (outstandingCallbacks == 0 || (enabled && tabInfo == Tab.RELATED_CHANGES)) { outstandingCallbacks = 0; for (int i = 0; i < getTabBar().getTabCount(); i++) { if (getTabBar().isTabEnabled(i)) { selectTab(i); setVisible(true); applyMaxHeight(); break; } } } }
Source:
<code>public void testDelete() { boolean result = api().deleteVault(vaultName); assertTrue(result); <START> Object[] args = { resourceGroupName, vaultName, true }; <END> checkState(deletedVaultStatus.create(resourceGroupName, true).apply(vaultName), "vault was not deleted before timeout"); }</code><technical_language>Unused args</technical_language>

Target:
public void testDelete() { boolean result = api().deleteVault(vaultName); assertTrue(result); checkState(deletedVaultStatus.create(resourceGroupName, true).apply(vaultName), "vault was not deleted before timeout"); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CouponIborFxReset)) { return false; } CouponIborFxReset other = (CouponIborFxReset) obj; if (Double.doubleToLongBits(_fixingAccrualFactor) != Double.doubleToLongBits(other._fixingAccrualFactor)) { return false; } if (Double.doubleToLongBits(_fixingPeriodEndTime) != Double.doubleToLongBits(other._fixingPeriodEndTime)) { return false; } if (Double.doubleToLongBits(_fixingPeriodStartTime) != Double.doubleToLongBits(other._fixingPeriodStartTime)) { return false; } if (Double.doubleToLongBits(_fixingTime) != Double.doubleToLongBits(other._fixingTime)) { return false; } if (Double.doubleToLongBits(_fxDeliveryTime) != Double.doubleToLongBits(other._fxDeliveryTime)) { return false; } if (Double.doubleToLongBits(_fxFixingTime) != Double.doubleToLongBits(other._fxFixingTime)) { return false; } if (_index == null) { if (other._index != null) { return false; } } else if (!_index.equals(other._index)) { return false; <START> } <END> if (_referenceCurrency == null) { if (other._referenceCurrency != null) { return false; } } else if (!_referenceCurrency.equals(other._referenceCurrency)) { return false; } if (Double.doubleToLongBits(_spread) != Double.doubleToLongBits(other._spread)) { return false; } return true; }</code><technical_language>ObjectUtils for non-primitive variables</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CouponIborFxReset)) { return false; } CouponIborFxReset other = (CouponIborFxReset) obj; if (Double.doubleToLongBits(_iborIndexFixingAccrualFactor) != Double .doubleToLongBits(other._iborIndexFixingAccrualFactor)) { return false; } if (Double.doubleToLongBits(_iborIndexFixingPeriodEndTime) != Double .doubleToLongBits(other._iborIndexFixingPeriodEndTime)) { return false; } if (Double.doubleToLongBits(_iborIndexFixingPeriodStartTime) != Double .doubleToLongBits(other._iborIndexFixingPeriodStartTime)) { return false; } if (Double.doubleToLongBits(_iborIndexFixingTime) != Double.doubleToLongBits(other._iborIndexFixingTime)) { return false; } if (Double.doubleToLongBits(_fxDeliveryTime) != Double.doubleToLongBits(other._fxDeliveryTime)) { return false; } if (Double.doubleToLongBits(_fxFixingTime) != Double.doubleToLongBits(other._fxFixingTime)) { return false; } if (!ObjectUtils.equals(_index, other._index)) { return false; } if (!ObjectUtils.equals(_referenceCurrency, other._referenceCurrency)) { return false; } if (Double.doubleToLongBits(_spread) != Double.doubleToLongBits(other._spread)) { return false; } return true; }
Source:
<code>public MessageHandler getMessageHandler() { this.dlvWorkerLock(); try { <START> return msgHandler; <END> } finally { this.dlvWorkerUnlock(); } }</code><technical_language>Nitpick: Generally IMO try/finally for unlocking is a good pattern, need here. a big deal though..</technical_language>

Target:
public MessageHandler getMessageHandler() { this.dlvWorkerLock(); MessageHandler mh = msgHandler; this.dlvWorkerUnlock(); return mh; }
Source:
<code>public long calculateEndTime() { if (endTime == 0) { <START> return TimeUnit.NANOSECONDS.toMicros(System.nanoTime()); <END> } else if (endTime < 0) { return TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - endTime; } return endTime; }</code><technical_language>nanoTime a replacement for currentTimeMillis - is a true timestamp. in nanoTime docs This method measure elapsed time is related other notion of system wall-clock time.</technical_language>

Target:
public long calculateEndTime() { if (endTime == 0) { return System.currentTimeMillis(); } else if (endTime < 0) { return System.currentTimeMillis() - endTime; } return endTime; }
Source:
<code>Next invoke(Env caller, SourceLocation loc, Object receiver, List<?> args, Continuation k) { Env e = new ClosureCallEnv(caller, k, loc, capture, self, args.size()); assignArguments(args, e); if (e instanceof DepthTrackingEnv && ((DepthTrackingEnv)e).getDepth() > DepthTrackingEnv.MAX_LEGAL_DEPTH) { StackOverflowError err; int depth = ((DepthTrackingEnv) e).getDepth(); <START> if (loc != null) { <END> err = new StackOverflowError("Excessively nested closures/functions at "+loc+" - look for unbounded recursion - call depth: "+depth); } else { err = new StackOverflowError("Excessively nested closures/functions - look for unbounded recursion - call depth: "+depth); } return e.getExceptionHandler(StackOverflowError.class).receive(err); } return new Next(body, e, k); }</code><technical_language>extract a utility function out of this (@CheckForNull Next)</technical_language>

Target:
Next invoke(Env caller, SourceLocation loc, Object receiver, List<?> args, Continuation k) { ClosureCallEnv e = new ClosureCallEnv(caller, k, loc, capture, self, args.size()); assignArguments(args, e); if (e.getDepth() > DepthTrackingEnv.MAX_LEGAL_DEPTH) { StackOverflowError err; if (loc != null) { err = new StackOverflowError("Excessively nested closures/functions at "+loc+" - look for unbounded recursion - call depth: "+e.getDepth()); } else { err = new StackOverflowError("Excessively nested closures/functions - look for unbounded recursion - call depth: "+e.getDepth()); } return e.getExceptionHandler(StackOverflowError.class).receive(err); } return new Next(body, e, k); }
Source:
<code>public int[] execute() { if (parts.size() == 0) { return new int[] {}; } Statement stmt; try { try { stmt = getHandle().getStatementBuilder().create(getHandle().getConnection(), getContext()); addCleanable(stmt::close); } catch (SQLException e) { throw new UnableToCreateStatementException(e, getContext()); } LOG.trace("Execute batch ["); try { for (String part : parts) { final String sql = getConfig(SqlStatements.class).getTemplateEngine().render(part, getContext()); LOG.trace(" {}", sql); stmt.addBatch(sql); } } catch (SQLException e) { throw new UnableToExecuteStatementException("Unable to configure JDBC statement", e, getContext()); } try { getConfig(SqlStatements.class).getSqlLogger().logBeforeExecution(getContext()); final long start = System.nanoTime(); final int[] rs = stmt.executeBatch(); final long elapsedTime = System.nanoTime() - start; LOG.trace("] executed in {}ms", elapsedTime / 1000000L); getConfig(SqlStatements.class).getTimingCollector().collect(elapsedTime, getContext()); getConfig(SqlStatements.class).getSqlLogger().logAfterExecution(getContext(), elapsedTime); return rs; } catch (SQLException e) { <START> getConfig(SqlStatements.class).getSqlLogger().logException(getContext(), e); <END> throw new UnableToExecuteStatementException(mungeBatchException(e), getContext()); } } finally { close(); } }</code><technical_language>Elapsed time desirable for errors too</technical_language>

Target:
public int[] execute() { if (parts.size() == 0) { return new int[] {}; } Statement stmt; try { try { stmt = getHandle().getStatementBuilder().create(getHandle().getConnection(), getContext()); addCleanable(stmt::close); } catch (SQLException e) { throw new UnableToCreateStatementException(e, getContext()); } LOG.trace("Execute batch ["); try { for (String part : parts) { final String sql = getConfig(SqlStatements.class).getTemplateEngine().render(part, getContext()); LOG.trace(" {}", sql); stmt.addBatch(sql); } } catch (SQLException e) { throw new UnableToExecuteStatementException("Unable to configure JDBC statement", e, getContext()); } try { return getConfig(SqlStatements.class).getSqlLogger().wrap(stmt::executeBatch, getContext()); } catch (SQLException e) { throw new UnableToExecuteStatementException(mungeBatchException(e), getContext()); } } finally { close(); } }
Source:
<code>public I18nEmailMgtConfigServiceClient(String cookie, String url, ConfigurationContext configContext) throws Exception { try { stub = new I18NEmailMgtConfigServiceStub(configContext, url + "I18nEmailMgtConfigService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty( org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); <START> } catch (java.lang.Exception e) { <END> handleException(e.getMessage(), e); } }</code><technical_language>well</technical_language>

Target:
public I18nEmailMgtConfigServiceClient(String cookie, String url, ConfigurationContext configContext) throws Exception { try { stub = new I18NEmailMgtConfigServiceStub(configContext, url + "I18nEmailMgtConfigService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty( org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (Exception e) { handleException(e.getMessage(), e); } }
Source:
<code>public Collection<BinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<BinaryFile> files = new TreeSet<>(); try { ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); files.add(new BinaryFile(filePath, buildId)); } } } catch (AttributeNotFoundException e) { <START> throw new IllegalStateException(e); <END> } return files; }</code><technical_language>wrap this? debugging harder, it</technical_language>

Target:
public Collection<UstDebugInfoBinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<UstDebugInfoBinaryFile> files = new TreeSet<>(); try { ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); files.add(new UstDebugInfoBinaryFile(filePath, buildId)); } } } catch (AttributeNotFoundException e) { throw new IllegalStateException(e); } return files; }
Source:
<code>public void default_telemetry_properties() { assertThat(underTest.getBoolean("sonar.telemetry.enable")).contains(true); assertThat(underTest.getInt("sonar.telemetry.frequencyInSeconds")).contains(6 * 60 * 60); <START> assertThat(underTest.get("sonar.telemetry.url")).contains("<LINK_0>"); <END> }</code><technical_language>3 contains replaced isEqualTo</technical_language>

Target:
public void default_telemetry_properties() { assertThat(underTest.getBoolean("sonar.telemetry.enable")).hasValue(true); assertThat(underTest.getInt("sonar.telemetry.frequencyInSeconds")).hasValue(6 * 60 * 60); assertThat(underTest.get("sonar.telemetry.url")).hasValue("<LINK_0>"); }
Source:
<code>public AsyncFuture<FetchData> fetch( final FetchData.Request request, final FetchQuotaWatcher watcher ) { if (!watcher.mayReadData()) { throw new IllegalArgumentException("query violated data limit"); } final int limit = watcher.getReadDataQuota(); return connection.doto(c -> { final QueryTrace.Watch w = QueryTrace.watch(); final List<PreparedFetch> prepared = c.schema.ranges(request.getSeries(), request.getRange()); if (request.getType() == MetricType.POINT) { <START> List<AsyncFuture<FetchData>> fetches = <END> fetchDataPoints(w, limit, request.getOptions(), prepared, c); return async.collect(fetches, FetchData.collect(FETCH)); } return async.resolved(FetchData.error(w.end(FETCH), QueryError.fromMessage("unsupported source: " + request.getType()))); }); }</code><technical_language>final</technical_language>

Target:
public AsyncFuture<FetchData> fetch( final FetchData.Request request, final FetchQuotaWatcher watcher ) { if (!watcher.mayReadData()) { throw new IllegalArgumentException("query violated data limit"); } final int limit = watcher.getReadDataQuota(); return connection.doto(c -> { final QueryTrace.Watch w = QueryTrace.watch(); final List<PreparedFetch> prepared = c.schema.ranges(request.getSeries(), request.getRange()); if (request.getType() == MetricType.POINT) { final List<AsyncFuture<FetchData>> fetches = fetchDataPoints(w, limit, request.getOptions(), prepared, c); return async.collect(fetches, FetchData.collect(FETCH)); } return async.resolved(FetchData.error(w.end(FETCH), QueryError.fromMessage("unsupported source: " + request.getType()))); }); }
Source:
<code>public void customizeDocumentCommand(IDocument document, DocumentCommand command) { String text= command.text; if (text == null) return; <START> if (text.isEmpty()) { <END> deleteSpaces(document, command); } else if (text.indexOf('\t') > -1) { StringBuilder buffer= new StringBuilder(); fLineTracker.set(command.text); int lines= fLineTracker.getNumberOfLines(); try { for (int i= 0; i < lines; i++) { int offset= fLineTracker.getLineOffset(i); int endOffset= offset + fLineTracker.getLineLength(i); String line= text.substring(offset, endOffset); int position= 0; if (i == 0) { IRegion firstLine= document.getLineInformationOfOffset(command.offset); position= command.offset - firstLine.getOffset(); } int length= line.length(); for (int j= 0; j < length; j++) { char c= line.charAt(j); if (c == '\t') { position += insertTabString(buffer, position); } else { buffer.append(c); ++ position; } } } command.text= buffer.toString(); } catch (BadLocationException x) { } } }</code><technical_language>trigger a behavior, need check that: * text.isEmpty (is a deletion) * length == 0 (this is requesting delete a selecting range) * fDeleteTabsAsSpace is enabled * 2 chars command offset spaces. In other cases, default behavior is preferred, please refine condition accordingly</technical_language>

Target:
public void customizeDocumentCommand(IDocument document, DocumentCommand command) { String text= command.text; if (text == null) return; if (text.isEmpty()) { replaceDeleteSpaceByDeleteTab(document, command); } else if (text.indexOf('\t') > -1) { StringBuilder buffer= new StringBuilder(); fLineTracker.set(command.text); int lines= fLineTracker.getNumberOfLines(); try { for (int i= 0; i < lines; i++) { int offset= fLineTracker.getLineOffset(i); int endOffset= offset + fLineTracker.getLineLength(i); String line= text.substring(offset, endOffset); int position= 0; if (i == 0) { IRegion firstLine= document.getLineInformationOfOffset(command.offset); position= command.offset - firstLine.getOffset(); } int length= line.length(); for (int j= 0; j < length; j++) { char c= line.charAt(j); if (c == '\t') { position += insertTabString(buffer, position); } else { buffer.append(c); ++ position; } } } command.text= buffer.toString(); } catch (BadLocationException x) { throw new IllegalArgumentException("should never happen", x); } } }
Source:
<code>public Element getSelect(Hook hook, int index) throws CandybeanException { logger.info("Getting select: " + hook.toString() + " from element: " + this.toString() + " with index: " + index); <START> return new WebDriverSelector(hook, this.wd); <END> }</code><technical_language>accepting index argument, determine selector return. Please update this index find a specific selector in a manner similar getElement it</technical_language>

Target:
public Element getSelect(Hook hook, int index) throws CandybeanException { logger.info("Getting select: " + hook.toString() + " from element: " + this.toString() + " with index: " + index); WebElement childWe = this.we.findElements(WebDriverSelector.By(hook)).get(index); return new WebDriverSelector(hook, index, this.wd, childWe); }
Source:
<code>public void testDropPKColumn() throws Exception { long ts = nextTimestamp(); String tenantId = getOrganizationId(); <START> initATableValues("aTable", tenantId, getDefaultSplits(tenantId), null, ts, getUrl()); <END> Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); Connection conn1 = DriverManager.getConnection(getUrl(), props); try { conn1.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " DROP COLUMN entity_id"); fail(); } catch (SQLException e) { assertTrue(e.getMessage(), e.getMessage().contains("ERROR 506 (42817): Primary key column may not be dropped.")); } conn1.close(); }</code><technical_language>static constant for "aTable" in BaseTest</technical_language>

Target:
public void testDropPKColumn() throws Exception { long ts = nextTimestamp(); String tenantId = getOrganizationId(); initATableValues(ATABLE_NAME, tenantId, getDefaultSplits(tenantId), null, ts, getUrl()); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); Connection conn1 = DriverManager.getConnection(getUrl(), props); try { conn1.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " DROP COLUMN entity_id"); fail(); } catch (SQLException e) { assertTrue(e.getMessage(), e.getMessage().contains("ERROR 506 (42817): Primary key column may not be dropped.")); } conn1.close(); }
Source:
<code>private TagItemTextCell(ApplicationResources resources, ApplicationTemplates templates) { <START> super(new AbstractCell<SafeHtml>("click", "mouseover", "mouseout") { END> @Override public void render(Context context, SafeHtml value, SafeHtmlBuilder sb) { TagModel tagModel = (TagModel) context.getKey(); tagModel.setIsAvailable(false); if (value != null) { sb.append(value); } } private void updateTagElement(boolean showOver, Element tagItem, Element tagBtn) { tagItem.getStyle().setBorderColor(showOver ? TAG_INNER_BORDER_COLOR : TAG_BORDER_UNSELECTED); tagBtn.getStyle().setVisibility(showOver ? Visibility.VISIBLE : Visibility.HIDDEN); } @Override public void onBrowserEvent(Context context, Element parent, SafeHtml value, NativeEvent event, ValueUpdater<SafeHtml> valueUpdater) { TagModel tagModel = (TagModel) context.getKey(); Element tagItemElement = parent.getFirstChildElement(); Element tagButtonElement = parent.getNextSiblingElement().getFirstChildElement(); if (event.getType().equals("mouseover") && tagModel.getType() != TagModelType.Root) { updateTagElement(true, tagItemElement, tagButtonElement); } else if (event.getType().equals("mouseout") && !tagModel.getSelection()) { updateTagElement(false, tagItemElement, tagButtonElement); } } }); this.resources = resources; this.templates = templates; }</code><technical_language>'click', 'mouseover', 'mouseout' in locations in this file. sense constants for those</technical_language>

Target:
private TagItemTextCell(ApplicationResources resources, ApplicationTemplates templates) { super(new AbstractCell<SafeHtml>(CLICK, MOUSEOVER, MOUSEOUT) { @Override public void render(Context context, SafeHtml value, SafeHtmlBuilder sb) { TagModel tagModel = (TagModel) context.getKey(); tagModel.setIsAvailable(false); if (value != null) { sb.append(value); } } private void updateTagElement(boolean showOver, Element tagItem, Element tagBtn) { tagItem.getStyle().setBorderColor(showOver ? TAG_INNER_BORDER_COLOR : TAG_BORDER_UNSELECTED); tagBtn.getStyle().setVisibility(showOver ? Visibility.VISIBLE : Visibility.HIDDEN); } @Override public void onBrowserEvent(Context context, Element parent, SafeHtml value, NativeEvent event, ValueUpdater<SafeHtml> valueUpdater) { TagModel tagModel = (TagModel) context.getKey(); Element tagItemElement = parent.getFirstChildElement(); Element tagButtonElement = parent.getNextSiblingElement().getFirstChildElement(); if (event.getType().equals(MOUSEOVER) && tagModel.getType() != TagModelType.Root) { updateTagElement(true, tagItemElement, tagButtonElement); } else if (event.getType().equals(MOUSEOUT) && !tagModel.getSelection()) { updateTagElement(false, tagItemElement, tagButtonElement); } } }); this.resources = resources; this.templates = templates; }
Source:
<code>private void peerProbeAlternateInterfaces(VDS host) { Network glusterNetwork = findGlusterNetwork(host); GlusterServer glusterServer = DbFacade.getInstance().getGlusterServerDao().get(host.getId()); if (glusterNetwork != null && host.getStatus() == VDSStatus.Up && glusterServer != null) { List<VdsNetworkInterface> interfaces = DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(host.getId()); for (VdsNetworkInterface iface : interfaces) { if (glusterNetwork.getName().equals(iface.getNetworkName()) && !StringUtils.isBlank(iface.getAddress()) && !glusterServer.getKnownAddresses().contains(iface.getAddress())) { VDS upServer = getAlternateUpServerInCluster(host.getVdsGroupId(), host.getId()); if (upServer != null) { Boolean peerProbed = glusterPeerProbe(upServer.getId(), iface.getAddress()); if (peerProbed) <START> { <END> glusterServer.getKnownAddresses().add(iface.getAddress()); DbFacade.getInstance() .getGlusterServerDao() .updateKnownAddresses(host.getId(), glusterServer.getKnownAddresses()); } } } } } }</code><technical_language>GlusterServerDao.addKnownAddress()</technical_language>

Target:
private void peerProbeAlternateInterfaces(VDS host) { Network glusterNetwork = findGlusterNetwork(host); GlusterServer glusterServer = DbFacade.getInstance().getGlusterServerDao().get(host.getId()); if (glusterNetwork != null && host.getStatus() == VDSStatus.Up && glusterServer != null) { List<VdsNetworkInterface> interfaces = DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(host.getId()); for (VdsNetworkInterface iface : interfaces) { if (glusterNetwork.getName().equals(iface.getNetworkName()) && !StringUtils.isBlank(iface.getAddress()) && !glusterServer.getKnownAddresses().contains(iface.getAddress())) { VDS upServer = getAlternateUpServerInCluster(host.getVdsGroupId(), host.getId()); if (upServer != null) { Boolean peerProbed = glusterPeerProbeAdditionalInterface(upServer.getId(), iface.getAddress()); if (peerProbed) { DbFacade.getInstance() .getGlusterServerDao().addKnownAddress(host.getId(), iface.getAddress()); } } } } } }
Source:
<code>private Article populateArticleFromXml(Document doc, Optional<ManifestXml> manifestXml, int xmlDataLength) { ArticleXml xml = new ArticleXml(doc); ArticleIdentity doi; try { doi = xml.readDoi(); } catch (XmlContentException e) { throw complainAboutXml(e); } Article article = findArticleById(doi); final boolean creating = (article == null); <START> if (creating) { <END> article = new Article(); article.setDoi(doi.getKey()); } try { article = xml.build(article); } catch (XmlContentException e) { throw complainAboutXml(e); } relateToJournals(article); populateCategories(article, doc); initializeAssets(article, manifestXml, xml, xmlDataLength); populateRelatedArticles(article, xml); return article; }</code><technical_language>avoid 'creating' variable definition validate (article == null) if statement</technical_language>

Target:
private Article populateArticleFromXml(Document doc, Optional<ManifestXml> manifestXml, int xmlDataLength) { ArticleXml xml = new ArticleXml(doc); ArticleIdentity doi; try { doi = xml.readDoi(); } catch (XmlContentException e) { throw complainAboutXml(e); } Article article = findArticleById(doi); if (article == null) { article = new Article(); article.setDoi(doi.getKey()); } try { article = xml.build(article); } catch (XmlContentException e) { throw complainAboutXml(e); } relateToJournals(article); populateCategories(article, doc); initializeAssets(article, manifestXml, xml, xmlDataLength); populateRelatedArticles(article, xml); return article; }
Source:
<code>private static void queryData(Dataset ds) { <START> JenaTextExample1.queryData(ds); <END> }</code><technical_language>This calls JenaTextExample1.java which, reverted it, Lucene. I need ES version of class well, JenaTextESExample1.java, call instead here</technical_language>

Target:
private static void queryData(Dataset ds) { queryDataWithoutProperty(ds); }
Source:
<code>public void internalReceiveCommand(String itemName, Command command) { super.internalReceiveCommand(itemName, command); logger.debug("MyQ binding received command '{}' for item '{}'", command, itemName); if (myqOnlineData != null) { computeCommandForItem(command, itemName); <START> } <END> }</code><technical_language>want log a WARN if drop command due myqOnlineData</technical_language>

Target:
public void internalReceiveCommand(String itemName, Command command) { super.internalReceiveCommand(itemName, command); logger.debug("MyQ binding received command '{}' for item '{}'", command, itemName); if (myqOnlineData != null) { computeCommandForItem(command, itemName); } else { logger.warn("Command '{}' for item '{}' not sent", command, itemName); } }
Source:
<code>public boolean equals(Object obj) { if (! super.equals(obj)) { return false; } InternalObservableList lObj = (InternalObservableList) obj; <START> if (internalList.equals(lObj.internalList)) { <END> return true; } return false; }</code><technical_language>Replace if-then statement by: java return internalList.equals(lObj.internalList);</technical_language>

Target:
public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } final InternalObservableList lObj = (InternalObservableList) obj; if (internalList.equals(lObj.internalList)) { return internalList.equals(lObj.internalList); } return false; }