auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ChannelInboundHandlerAdapter createHttpRequestHandler() { return new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { HttpRequest httpRequest = (HttpRequest) msg; httpRequest = (HttpRequest) msg; HttpHeaders headers = httpRequest.headers(); Span span = tracer.nextSpan(extractor, headers); <START> HttpNettyAdapter.parseClientAddress(httpRequest, span); <END> handler.handleReceive(httpRequest, span); try (Tracer.SpanInScope ws = tracer.withSpanInScope(span)) { super.channelRead(ctx, httpRequest); } catch (Exception e) { throw e; } } }; }</code><technical_language>HttpServerAdapter, handleReceive implicitly parses client address</technical_language>

Target:
public ChannelInboundHandlerAdapter createHttpRequestHandler() { return new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { HttpRequest httpRequest = (HttpRequest) msg; HttpHeaders httpHeaders = httpRequest.headers(); Span span = handler.handleReceive(extractor, httpHeaders, httpRequest); ctx.channel().attr(AttributeKey.valueOf(Span.class.getName())).set(span); try (Tracer.SpanInScope ws = tracer.withSpanInScope(span)) { ctx.channel().attr(AttributeKey.valueOf(Tracer.SpanInScope.class.getName())).set(ws); super.channelRead(ctx, httpRequest); } catch (Exception | Error e) { throw e; } } }; }
Source:
<code>public void testFiveRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); <START> TableName tableName = TableName.valueOf("TestTableWithFiveSplits"); <END> HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); byte[][] splitKeys = Bytes.split(startKey, endKey, 2); try { if (admin.tableExists(tableName)) { LOG.warn("Not creating the table since it exists: %s", tableName); } else { admin.createTable(descriptor, startKey, endKey, 5); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(5, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == regions.size() - 1) { Assert.assertEquals(Bytes.toString(endKey), start_key); } else { Assert.assertEquals(Bytes.toString(splitKeys[i-1]), start_key); Assert.assertEquals(Bytes.toString(splitKeys[i]), end_key); } } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }</code><technical_language>Please add UUID.randomUUID().toString()</technical_language>

Target:
public void testFiveRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); TableName tableName = TableName.valueOf("TestTable" + UUID.randomUUID().toString()); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); byte[][] splitKeys = Bytes.split(startKey, endKey, 2); try { admin.createTable(descriptor, startKey, endKey, 5); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(5, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == regions.size() - 1) { Assert.assertEquals(Bytes.toString(endKey), start_key); } else { Assert.assertEquals(Bytes.toString(splitKeys[i-1]), start_key); Assert.assertEquals(Bytes.toString(splitKeys[i]), end_key); } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }
Source:
<code>public void onTestStart(ITestResult iTestResult) { int percentage = iTestResult.getMethod().getSuccessPercentage(); int curCount = iTestResult.getMethod().getCurrentInvocationCount() + 1; int iCount = iTestResult.getMethod().getInvocationCount(); <START> String invoc = ""; <END> if(iCount>1) { invoc = ":" + curCount + "/" + iCount; if (percentage > 0) { invoc = invoc + " " + percentage + "%"; } } Description description = new Description().withValue(iTestResult.getMethod().getDescription()); TestCaseStartedEvent event = new TestCaseStartedEvent(getSuiteUid(iTestResult.getTestContext()), getName(iTestResult) + invoc); if (description.getValue() != null) { event.setDescription(description); } AnnotationManager am = new AnnotationManager(getMethodAnnotations(iTestResult)); am.setDefaults(getClassAnnotations(iTestResult)); am.update(event); getLifecycle().fire(event); fireAddParameterEvents(iTestResult); }</code><technical_language>please move this logic separated method</technical_language>

Target:
public void onTestStart(ITestResult iTestResult) { ITestNGMethod method = iTestResult.getMethod(); String suitePrefix = getCurrentSuitePrefix(iTestResult); String testName = getName(iTestResult); startedTestNames.add(testName); testName = testName.replace(suitePrefix, ""); String invoc = getMethodInvocationsAndSuccessPercentage(iTestResult); Description description = new Description().withValue(method.getDescription()); String suiteUid = getSuiteUid(iTestResult.getTestContext()); TestCaseStartedEvent event = new TestCaseStartedEvent(suiteUid, testName + invoc); if (description.getValue() != null) { event.setDescription(description); } AnnotationManager am = new AnnotationManager(getMethodAnnotations(iTestResult)); am.setDefaults(getClassAnnotations(iTestResult)); am.update(event); getLifecycle().fire(event); fireAddParameterEvents(iTestResult); }
Source:
<code>public void mount(CryptoFileSystem fs) throws VolumeException { String mountPath; if (vaultSettings.usesIndividualMountPath().get()) { mountPath = vaultSettings.individualMountPath().get(); } else if (!Strings.isNullOrEmpty(vaultSettings.winDriveLetter().get())) { mountPath = vaultSettings.winDriveLetter().get().charAt(0) + ":\\"; } else { if (!windowsDriveLetters.getAvailableDriveLetters().isEmpty()) { <START> mountPath = windowsDriveLetters.getAvailableDriveLetters().iterator().next() + ":\\"; <END> } else { throw new VolumeException("No free drive letter available."); } } String mountName = vaultSettings.mountName().get(); try { this.mount = mountFactory.mount(fs.getPath("/"), Paths.get(mountPath), mountName, FS_TYPE_NAME); } catch (MountFailedException e) { throw new VolumeException("Unable to mount Filesystem", e); } }</code><technical_language>A: fixed in meantime</technical_language>

Target:
public void mount(CryptoFileSystem fs) throws VolumeException { Path mountPath = Paths.get(getMountPathString()); String mountName = vaultSettings.mountName().get(); try { this.mount = mountFactory.mount(fs.getPath("/"), mountPath, mountName, FS_TYPE_NAME); } catch (MountFailedException e) { throw new VolumeException("Unable to mount Filesystem", e); } }
Source:
<code>public ValidationResult provisioningComputeResourceValid(boolean provisioned, ExternalComputeResource computeResource) { return ValidationResult.failWith(VdcBllMessages.VDS_PROVIDER_PROVISION_MISSING_COMPUTERESOURCE) .when(provisioned == true && computeResource == null); <START> } <END></code><technical_language>need compare 'true'. just: .when(provisioned && computeResource == null);</technical_language>

Target:
public ValidationResult provisioningComputeResourceValid(boolean provisioned, ExternalComputeResource computeResource) { return ValidationResult.failWith(VdcBllMessages.VDS_PROVIDER_PROVISION_MISSING_COMPUTERESOURCE) .when(provisioned && computeResource == null); }
Source:
<code>public void close() { synchronized (producerClosingLock) { kafkaProducer.close(); <START> LOG.debug("Closed internal KafkaProducer {}. Stacktrace: {}", System.identityHashCode(this), Joiner.on("\n").join(Thread.currentThread().getStackTrace())); <END> closed = true; } }</code><technical_language>This eager string concatenation in a lazy parameter, is typically a blocker. Now, this is a performance critical path, I suggest avoid this, sets a bad example for other contributors immitate (in more critical parts)</technical_language>

Target:
public void close() { synchronized (producerClosingLock) { kafkaProducer.close(); if (LOG.isDebugEnabled()) { LOG.debug( "Closed internal KafkaProducer {}. Stacktrace: {}", System.identityHashCode(this), Joiner.on("\n").join(Thread.currentThread().getStackTrace())); } closed = true; } }
Source:
<code>public String toString() { <START> return "DataInfoImpl{" + <END> "dataType='" + dataType + '\'' + ", numUnits=" + numUnits + '}'; }</code><technical_language>StringBuilder</technical_language>

Target:
public String toString() { final StringBuilder sb = new StringBuilder("DataInfoImpl{"); sb.append("dataType='").append(dataType).append('\''); sb.append(", numUnits=").append(numUnits); sb.append('}'); return sb.toString(); }
Source:
<code>public void onResume() { super.onResume(); Log_OC.v(TAG, "onResume"); <START> if ((Util.SDK_INT <= 23 || player == null)) { <END> preparePlayer(); } }</code><technical_language>difference depending API level? curious</technical_language>

Target:
public void onResume() { super.onResume(); Log_OC.v(TAG, "onResume"); preparePlayer(); }
Source:
<code>public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("liskbnb".equalsIgnoreCase(walletType)) { String address = st.nextToken(); <START> String bnbapikey = st.nextToken(); <END> String bnbapisecret = st.nextToken(); if ( address != null && bnbapikey !=null && bnbapisecret != null ) { return new Lskwallet(address,bnbapikey,bnbapisecret); } } } return null; }</code><technical_language>camel-case</technical_language>

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("liskBinance".equalsIgnoreCase(walletType)) { String address = st.nextToken(); String binanceApiKey = st.nextToken(); String binanceApiSecret = st.nextToken(); if (address != null && binanceApiKey !=null && binanceApiSecret != null ) { return new LskWallet(address,binanceApiKey,binanceApiSecret); } } } return null; }
Source:
<code>public void onRestoreInstanceState(Bundle savedInstanceStateBundle) { if (savedInstanceStateBundle == null) { return; } if (!savedInstanceStateBundle.containsKey(STABLE_ID_MAP)) { return; } mStableIdMap = (HashMap<Long, Boolean>) savedInstanceStateBundle.getSerializable(STABLE_ID_MAP); int i = 0; while (i < mHelperItemList.size()) { <START> if (getHelperItem(i) instanceof ParentWrapper) { <END> ParentWrapper parentWrapper = (ParentWrapper) getHelperItem(i); if (mStableIdMap.containsKey(parentWrapper.getStableId())) { parentWrapper.setExpanded(mStableIdMap.get(parentWrapper.getStableId())); if (parentWrapper.isExpanded() && !parentWrapper.getParentObject().isInitiallyExpanded()) { List<Object> childObjectList = parentWrapper.getParentObject().getChildObjectList(); if (childObjectList != null) { for (int j = 0; j < childObjectList.size(); j++) { i++; mHelperItemList.add(i, childObjectList.get(j)); } } } else if (!parentWrapper.isExpanded() && parentWrapper.getParentObject().isInitiallyExpanded()) { List<Object> childObjectList = parentWrapper.getParentObject().getChildObjectList(); for (int j = 0; j < childObjectList.size(); j++) { mHelperItemList.remove(i + 1); } } } else { parentWrapper.setExpanded(false); } } i++; } notifyDataSetChanged(); }</code><technical_language>Object helperItem = getHelperItem(i); reduce calls getHelperItem</technical_language>

Target:
public void onRestoreInstanceState(Bundle savedInstanceStateBundle) { if (savedInstanceStateBundle == null) { return; } if (!savedInstanceStateBundle.containsKey(STABLE_ID_MAP)) { return; } mStableIdMap = (HashMap<Long, Boolean>) savedInstanceStateBundle.getSerializable(STABLE_ID_MAP); int i = 0; while (i < mHelperItemList.size()) { Object helperItem = getHelperItem(i); if (helperItem instanceof ParentWrapper) { ParentWrapper parentWrapper = (ParentWrapper) helperItem; if (mStableIdMap.containsKey(parentWrapper.getStableId())) { parentWrapper.setExpanded(mStableIdMap.get(parentWrapper.getStableId())); if (parentWrapper.isExpanded() && !parentWrapper.getParentObject().isInitiallyExpanded()) { List<Object> childObjectList = parentWrapper.getParentObject().getChildObjectList(); if (childObjectList != null) { for (int j = 0; j < childObjectList.size(); j++) { i++; mHelperItemList.add(i, childObjectList.get(j)); } } } else if (!parentWrapper.isExpanded() && parentWrapper.getParentObject().isInitiallyExpanded()) { List<Object> childObjectList = parentWrapper.getParentObject().getChildObjectList(); for (int j = 0; j < childObjectList.size(); j++) { mHelperItemList.remove(i + 1); } } } else { parentWrapper.setExpanded(false); } } i++; } notifyDataSetChanged(); }
Source:
<code>protected boolean checkDisksNotInBackupStorage() { Map<Guid, Guid> diskIdToDestSdId = getVm().getDiskMap() .values() .stream() .collect(Collectors.toMap(Disk::getId, disk -> disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getStorageIds().get(0) : Guid.Empty)); for (Map.Entry diskToSd : diskIdToDestSdId.entrySet()) { StorageDomainStatic destDomain = <START> storageDomainStaticDao.get(((DiskImage) diskToSd).getStorageIds().get(0)); <END> if (destDomain.isBackup()) { return false; } } return true; }</code><technical_language>try cast a Map.Entry DiskImage, this error try run a VM. simply use: for (Guid sdId : diskIdToDestSdId.values()) { StorageDomainStatic destDomain = storageDomainStaticDao.get(sdId); if (destDomain.isBackup()) { return false; } } or, if want, do in stream filter command (without additional for loop), this: Disk disk = getVm().getDiskMap() .values() .stream() .filter(vmDisk -> vmDisk.getDiskStorageType() == DiskStorageType.IMAGE && storageDomainStaticDao.get(((DiskImage) vmDisk).getStorageIds().get(0)).isBackup()) .findFirst() .orElse(null); if (disk != null) { return false; } return true;</technical_language>

Target:
protected boolean checkDisksNotInBackupStorage() { Disk disk = getVm().getDiskMap() .values() .stream() .filter(vmDisk -> vmDisk.getDiskStorageType() == DiskStorageType.IMAGE && storageDomainStaticDao.get(((DiskImage) vmDisk).getStorageIds().get(0)).isBackup()) .findFirst() .orElse(null); if (disk != null) { return false; } return true; }
Source:
<code>public MantaClient(final ConfigContext config) { dumpConfig(config); final String mantaURL = config.getMantaURL(); final String account = config.getMantaUser(); ConfigContext.validate(config); this.url = mantaURL; this.config = config; this.home = ConfigContext.deriveHomeDirectoryFromUser(account); final KeyPairFactory keyPairFactory = new KeyPairFactory(config); final KeyPair keyPair = keyPairFactory.createKeyPair(); final Signer.Builder builder = new Signer.Builder(keyPair); <START> if (ObjectUtils.firstNonNull(config.disableNativeSignatures(), false)) { <END> builder.providerCode("stdlib"); } final ThreadLocalSigner signer = new ThreadLocalSigner(builder); this.connectionFactory = new MantaConnectionFactory(config, keyPair, signer); this.connectionContext = new MantaApacheHttpClientContext(this.connectionFactory); if (BooleanUtils.isTrue(config.isClientEncryptionEnabled())) { this.httpHelper = new EncryptionHttpHelper(connectionContext, connectionFactory, config); } else { this.httpHelper = new StandardHttpHelper(connectionContext, connectionFactory, config); } this.uriSigner = new UriSigner(this.config, keyPair, signer); }</code><technical_language>I suggest add a constant field DefaultsConfigContext, reference default explicitly set here</technical_language>

Target:
public MantaClient(final ConfigContext config) { dumpConfig(config); final String mantaURL = config.getMantaURL(); final String account = config.getMantaUser(); ConfigContext.validate(config); this.url = mantaURL; this.config = config; this.home = ConfigContext.deriveHomeDirectoryFromUser(account); final KeyPairFactory keyPairFactory = new KeyPairFactory(config); final KeyPair keyPair = keyPairFactory.createKeyPair(); final Signer.Builder builder = new Signer.Builder(keyPair); if (ObjectUtils.firstNonNull( config.disableNativeSignatures(), DefaultsConfigContext.DEFAULT_DISABLE_NATIVE_SIGNATURES)) { builder.providerCode("stdlib"); } final ThreadLocalSigner signer = new ThreadLocalSigner(builder); this.connectionFactory = new MantaConnectionFactory(config, keyPair, signer); this.connectionContext = new MantaApacheHttpClientContext(this.connectionFactory); if (BooleanUtils.isTrue(config.isClientEncryptionEnabled())) { this.httpHelper = new EncryptionHttpHelper(connectionContext, connectionFactory, config); } else { this.httpHelper = new StandardHttpHelper(connectionContext, connectionFactory, config); } this.uriSigner = new UriSigner(this.config, keyPair, signer); }
Source:
<code>public InfoboxChoiceModal openInfoboxChoiceModal() { <START> infoboxButton.click(); <END> return new InfoboxChoiceModal(webDriver); }</code><technical_language>wait.forElementClickable</technical_language>

Target:
public InfoboxChoiceModal openInfoboxChoiceModal() { webDriverWait.until(ExpectedConditions.elementToBeClickable(infoboxButton)); infoboxButton.click(); return new InfoboxChoiceModal(webDriver); }
Source:
<code>private static long nanosBetween(long start, long end) { <START> return Math.abs(end - start); <END> }</code><technical_language>Is start > end? IIRC System.nanoTime safe, getCurrentThreadCpuTime(). If get start > end, abs of start-end a junk/incorrect measurement, do want that? do want omit measurements? (I prefer btw)</technical_language>

Target:
private static long nanosBetween(long start, long end) { return max(0, end - start); }
Source:
<code>private boolean passCheck() { if (G.enableDeviceCheck()) { deviceCheck(); } else { switch (G.protectionLevel()) { case "p0": return true; case "p1": final String oldpwd = G.profile_pwd(); if (oldpwd.length() == 0) { return true; } else { requestPassword(); } break; case "p2": final String pwd = G.sPrefs.getString("LockPassword", ""); if (pwd.length() == 0) { return true; } else { requestPassword(); } <START> case "p3": <END> if(FingerprintUtil.isAndroidSupport() && G.isFingerprintEnabled()){ requestFingerprint(); } } } return false; }</code><technical_language>I guess need break statement, existing "p2" option break;</technical_language>

Target:
private boolean passCheck() { if (G.enableDeviceCheck()) { deviceCheck(); } else { switch (G.protectionLevel()) { case "p0": return true; case "p1": final String oldpwd = G.profile_pwd(); if (oldpwd.length() == 0) { return true; } else { requestPassword(); } break; case "p2": final String pwd = G.sPrefs.getString("LockPassword", ""); if (pwd.length() == 0) { return true; } else { requestPassword(); } break; case "p3": if(FingerprintUtil.isAndroidSupport() && G.isFingerprintEnabled()){ requestFingerprint(); } } } return false; }
Source:
<code>protected DataObjectSupport(Storage storage, Configuration configuration, Path path, InputSplit inputSplit) { Assert.notNull(storage, "Storage must be set"); <START> Assert.notNull(storage, "Configuration must be set"); <END> Assert.isTrue(!(path == null && inputSplit == null), "Either path or input split must be set"); Assert.isTrue(!(path == null && inputSplit == null), "Either path or input split must be set"); this.storage = storage; this.configuration = configuration; this.path = path; this.inputSplit = inputSplit; }</code><technical_language>checking 'configuration' 2nd assert (copy-and-paste error: storage)</technical_language>

Target:
protected DataObjectSupport(Storage storage, Configuration configuration, Path path, InputSplit inputSplit) { Assert.notNull(storage, "Storage must be set"); Assert.notNull(configuration, "Configuration must be set"); Assert.isTrue(!(path == null && inputSplit == null), "Either path or input split must be set"); Assert.isTrue(!(path != null && inputSplit != null), "Either path or input split must be set"); this.storage = storage; this.configuration = configuration; this.path = path; this.inputSplit = inputSplit; }
Source:
<code>protected void startTransferThread() { try { final byte[] keyBytes = key.getBytes("UTF-8"); Runnable transferFromQueueToSystem = () -> { while (!Thread.currentThread().isInterrupted()) { try { byte[] serializedLogEvent = logQueue.take(); metrics.logMessagesBytes.inc(serializedLogEvent.length); metrics.logMessagesCount.inc(); OutgoingMessageEnvelope outgoingMessageEnvelope = new OutgoingMessageEnvelope(systemStream, keyBytes, serializedLogEvent); systemProducer.send(SOURCE, outgoingMessageEnvelope); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (Throwable t) { <START> log.error("Error sending " + appenderName +" event to SystemProducer", t); <END> } } }; transferThread = new Thread(transferFromQueueToSystem); transferThread.setDaemon(true); transferThread.setName("Samza " + appenderName + " Producer " + transferThread.getName()); transferThread.start(); } catch (UnsupportedEncodingException e) { throw new SamzaException(String.format( "Container name: %s could not be encoded to bytes. %s cannot proceed.", key, appenderName), e); } }</code><technical_language>add a metric count number of logging errors</technical_language>

Target:
private void startTransferThread() { try { final byte[] keyBytes = key.getBytes("UTF-8"); Runnable transferFromQueueToSystem = () -> { while (!Thread.currentThread().isInterrupted()) { try { byte[] serializedLogEvent = logQueue.take(); metrics.logMessagesBytesSent.inc(serializedLogEvent.length); metrics.logMessagesCountSent.inc(); OutgoingMessageEnvelope outgoingMessageEnvelope = new OutgoingMessageEnvelope(systemStream, keyBytes, serializedLogEvent); systemProducer.send(SOURCE, outgoingMessageEnvelope); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (Throwable t) { metrics.logMessagesErrors.inc(); log.error("Error sending " + getName() + " event to SystemProducer", t); } } }; transferThread = new Thread(transferFromQueueToSystem); transferThread.setDaemon(true); transferThread.setName("Samza " + getName() + " Producer " + transferThread.getName()); transferThread.start(); } catch (UnsupportedEncodingException e) { throw new SamzaException(String.format( "Container name: %s could not be encoded to bytes. %s cannot proceed.", key, getName()), e); } }
Source:
<code>public void testEquals() { String value = "someValue"; String type = "someType"; float confidenceLevel = 0.9f; TypedId typedId = new TypedId(value, type, confidenceLevel); <START> assertNotEquals(null, typedId); <END> assertNotEquals("string", typedId); assertNotEquals(typedId, new TypedId("otherValue", type, confidenceLevel)); assertNotEquals(typedId, new TypedId(value, "otherType", confidenceLevel)); assertNotEquals(typedId, new TypedId(value, type, 0.8f)); assertEquals(typedId, new TypedId(value, type, confidenceLevel)); }</code><technical_language>Again, assertNotNull more readable</technical_language>

Target:
public void testEquals() { String value = "someValue"; String type = "someType"; float confidenceLevel = 0.9f; TypedId typedId = new TypedId(value, type, confidenceLevel); assertNotNull(typedId); assertNotEquals("string", typedId); assertNotEquals(typedId, new TypedId("otherValue", type, confidenceLevel)); assertNotEquals(typedId, new TypedId(value, "otherType", confidenceLevel)); assertNotEquals(typedId, new TypedId(value, type, 0.8f)); assertEquals(typedId, new TypedId(value, type, confidenceLevel)); }
Source:
<code>void showNotification(Notification notification) { Platform.runLater(() -> { triggerTimeoutAction(); notificationPane.setGraphic(notification.getIcon()); notificationPane.setText(notification.getMessage()); notificationPane.getActions().clear(); notificationPane.getActions().add(new Action(notification.getButtonLabel(), actionEvent -> { notification.getButtonRunnable().run(); hideNotification(); })); notificationPaneTimer = new TickingTimer("Notification Timer", notification.getTimeoutDuration(), integer -> {}, () -> Platform.runLater(this::triggerTimeoutAction), TimeUnit.SECONDS); <START> notificationPane.setOnHiding(event -> Platform.runLater(() -> { <END> if (this.notification.isPresent()) { determineAndRunTimeoutAction(); hideNotification(); } })); notificationPane.show(); notificationPaneTimer.start(); this.notification = Optional.of(notification); }); }</code><technical_language>hiding event originate UI thread, Platform.runLater needed. factor callback out method? kind of similar triggerTimeoutAction merged</technical_language>

Target:
void showNotification(Notification notification) { Platform.runLater(() -> { if (notificationPane.isShowing()) { triggerTimeoutAction(); } notificationPane.setGraphic(notification.getIcon()); notificationPane.setText(notification.getMessage()); notificationPane.getActions().clear(); notificationPane.getActions().add(new Action(notification.getButtonLabel(), actionEvent -> { notification.getButtonRunnable().run(); hideNotification(); })); notificationPaneTimer = new TickingTimer("Notification Timer", notification.getTimeoutDuration(), integer -> {}, () -> Platform.runLater(this::triggerTimeoutAction), TimeUnit.SECONDS); notificationPane.setOnHiding(event -> triggerTimeoutAction()); notificationPane.show(); notificationPaneTimer.start(); this.notification = Optional.of(notification); }); }
Source:
<code>protected boolean onOK(Metadata trailers) { ProcessingStatus status = requestManager.onOK(); if (status == ProcessingStatus.INLALID) { onError(INVALID_RESPONSE, trailers); return true; } <START> if (status == ProcessingStatus.SUCCESS || status == ProcessingStatus.NOT_RETRYABLE) { <END> completionFuture.set(Arrays.asList(requestManager.buildResponse())); return true; } long nextBackOff = getNextBackoff(); if (nextBackOff == BackOff.STOP) { rpc.getRpcMetrics().markRetriesExhasted(); completionFuture.set(Arrays.asList(requestManager.buildResponse())); operationSpan.addAnnotation("MutationCount", ImmutableMap.of("failureCount", AttributeValue.longAttributeValue(requestManager.getRetryRequest().getEntriesCount()))); return true; } performRetry(nextBackOff); operationSpan.addAnnotation("MutationCount", ImmutableMap.of("retryCount", AttributeValue.longAttributeValue(requestManager.getRetryRequest().getEntriesCount()))); return false; }</code><technical_language>cleaner add a method hasMoreAttempts() requestManager</technical_language>

Target:
protected boolean onOK(Metadata trailers) { ProcessingStatus status = requestManager.onOK(); if (status == ProcessingStatus.INVALID) { onError(INVALID_RESPONSE, trailers); return true; } if (status == ProcessingStatus.SUCCESS || status == ProcessingStatus.NOT_RETRYABLE) { completionFuture.set(Arrays.asList(requestManager.buildResponse())); return true; } long nextBackOff = getNextBackoff(); if (nextBackOff == BackOff.STOP) { rpc.getRpcMetrics().markRetriesExhasted(); completionFuture.set(Arrays.asList(requestManager.buildResponse())); operationSpan.addAnnotation("MutationCount", ImmutableMap.of("failureCount", AttributeValue.longAttributeValue(requestManager.getRetryRequest().getEntriesCount()))); return true; } performRetry(nextBackOff); operationSpan.addAnnotation("MutationCount", ImmutableMap.of("retryCount", AttributeValue.longAttributeValue(requestManager.getRetryRequest().getEntriesCount()))); return false; }
Source:
<code>private void registerRequestMetrics(MeterRegistry registry, IEventBus eventBus) { FunctionCounter.builder("requests.completed", eventBus, bus -> bus.getFinishedMessages(Request.TAG)) <START> .description("The approximate total number of requests that have completed execution") <END> .register(registry); Gauge.builder("requests.processing", eventBus, bus -> bus.getProcessingMessages(Request.TAG)) .description("The approximate number of requests that are currently under execution") .register(registry); Gauge.builder("requests.queued", eventBus, bus -> bus.getInQueueMessages(Request.TAG)) .description("The approximate number of requests that are queued for execution") .register(registry); }</code><technical_language>Is this approximate metric exact? exact me. for others</technical_language>

Target:
private void registerRequestMetrics(MeterRegistry registry, IEventBus eventBus) { FunctionCounter.builder("requests.completed", eventBus, bus -> bus.getCompletedMessages(Request.TAG)) .description("The total number of requests that have completed execution") .register(registry); Gauge.builder("requests.processing", eventBus, bus -> bus.getProcessingMessages(Request.TAG)) .description("The approximate number of requests that are currently under execution") .register(registry); Gauge.builder("requests.queued", eventBus, bus -> bus.getInQueueMessages(Request.TAG)) .description("The approximate number of requests that are queued for execution") .register(registry); FunctionCounter.builder("requests.succeeded", eventBus, bus -> bus.getSucceededMessages(Request.TAG)) .description("The total number of requests that have successfully completed execution") .register(registry); FunctionCounter.builder("requests.failed", eventBus, bus -> bus.getFailedMessages(Request.TAG)) .description("The total number of requests that have failed execution") .register(registry); }
Source:
<code>public void setConfig(Map<String, Object> config) { if (config instanceof RubyHashMapDecorator) { this.config.clear(); this.config.putAll(config); } else { this.config = config; <START> } <END> }</code><technical_language>cut if can. configuration done in constructor (or sooner)</technical_language>

Target:
public final void setConfig(Map<String, Object> config) { if (configFinalized) { throw new IllegalStateException("It is only allowed to set the config in the constructor!"); } this.config = config; }
Source:
<code><START> protected void handleResponse(CommandContext ctx, OperationResponse response, boolean composite) throws CommandLineException { <END> displayResponseHeaders(ctx, response); handleAttachedFile(ctx, response); }</code><technical_language>Please ping Alexey Joe Wertz this. I concern API change I displayResponseHeaders, this a bigger issue method is overridden a bit. add this method leave existing one, call existing calling handleAttachedFile. a more complicated API break anyone. done evolve controller classes AbstractAddStepHandler</technical_language>

Target:
protected void handleResponse(CommandContext ctx, OperationResponse response, boolean composite) throws CommandLineException { handleResponse(ctx, response.getResponseNode(), composite); handleAttachedFile(ctx, response); }
Source:
<code>private Collection<Key> getRegisteredKeys() { List<Key> result = new ArrayList<Key>(); <START> for (Iterator<Key> i = cacheMap.keySet().iterator(); i.hasNext();) { result.add(i.next()); } return result; <END> }</code><technical_language>not: return result.addAll(cacheMap.keySet());</technical_language>

Target:
private Collection<Key> getRegisteredKeys() { return new ArrayList<Key>(cacheMap.keySet()); }
Source:
<code>public int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer) { Preconditions.checkArgument(pageOffset <= mPageSize, "Read exceeds page boundary: offset=%s size=%s", pageOffset, mPageSize); Preconditions.checkArgument(bytesToRead <= buffer.length - offsetInBuffer, "buffer does not have enough space: bufferLength=%s offsetInBuffer=%s bytesToRead=%s", buffer.length, offsetInBuffer, bytesToRead); LOG.debug("get({},pageOffset={}) enters", pageId, pageOffset); if (mState.get() == NOT_IN_USE) { Metrics.GET_NOT_READY_ERRORS.inc(); Metrics.GET_ERRORS.inc(); <START> return 0; <END> } boolean hasPage; ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.readLock())) { try (LockResource r2 = new LockResource(mMetaLock.readLock())) { hasPage = mMetaStore.hasPage(pageId); } if (!hasPage) { LOG.debug("get({},pageOffset={}) fails due to page not found", pageId, pageOffset); return 0; } int bytesRead = getPage(pageId, pageOffset, bytesToRead, buffer, offsetInBuffer); if (bytesRead <= 0) { Metrics.GET_ERRORS.inc(); Metrics.GET_STORE_READ_ERRORS.inc(); try (LockResource r2 = new LockResource(mMetaLock.writeLock())) { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { Metrics.CLEANUP_GET_ERRORS.inc(); } return -1; } LOG.debug("get({},pageOffset={}) exits", pageId, pageOffset); return bytesRead; } }</code><technical_language>this return -1 if this counts error page found</technical_language>

Target:
public int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer) { Preconditions.checkArgument(pageOffset <= mPageSize, "Read exceeds page boundary: offset=%s size=%s", pageOffset, mPageSize); Preconditions.checkArgument(bytesToRead <= buffer.length - offsetInBuffer, "buffer does not have enough space: bufferLength=%s offsetInBuffer=%s bytesToRead=%s", buffer.length, offsetInBuffer, bytesToRead); LOG.debug("get({},pageOffset={}) enters", pageId, pageOffset); if (mState.get() == NOT_IN_USE) { Metrics.GET_NOT_READY_ERRORS.inc(); Metrics.GET_ERRORS.inc(); return -1; } boolean hasPage; ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.readLock())) { try (LockResource r2 = new LockResource(mMetaLock.readLock())) { hasPage = mMetaStore.hasPage(pageId); } if (!hasPage) { LOG.debug("get({},pageOffset={}) fails due to page not found", pageId, pageOffset); return 0; } int bytesRead = getPage(pageId, pageOffset, bytesToRead, buffer, offsetInBuffer); if (bytesRead <= 0) { Metrics.GET_ERRORS.inc(); Metrics.GET_STORE_READ_ERRORS.inc(); try (LockResource r2 = new LockResource(mMetaLock.writeLock())) { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { Metrics.CLEANUP_GET_ERRORS.inc(); } return -1; } LOG.debug("get({},pageOffset={}) exits", pageId, pageOffset); return bytesRead; } }
Source:
<code><START> @Override default Stream<T> shuffle() { <END> return Collections.shuffle(this, Stream::ofAll); }</code><technical_language>do a newline annotations (in 99.9% of cases). please leave as-is. I reformat codebase soon formatter. I opportunity customize Sputnik/Checkstyle rules then</technical_language>

Target:
default Stream<T> shuffle() { return Collections.shuffle(this, Stream::ofAll); }
Source:
<code>public MultipleCurrencyParameterSensitivity presentValueCurveSensitivity( final Swap<? extends Payment, ? extends Payment> swap, final CurveBuildingBlockBundle blockBundle, final GeneralSmileInterpolator interpolator) { <START> <END> MultipleCurrencyParameterSensitivity firstSense; MultipleCurrencyParameterSensitivity secondSense; if (swap.getFirstLeg().getNthPayment(0) instanceof CouponIbor) { firstSense = presentValueCurveSensitivity((CouponIbor) swap.getFirstLeg() .getNthPayment(0), interpolator); for (int j = 1; j < swap.getFirstLeg().getNumberOfPayments(); j++) { firstSense = firstSense .plus(presentValueCurveSensitivity((CouponIbor) swap.getFirstLeg().getNthPayment(j), interpolator)); } } else { firstSense = MQSBC.fromInstrument(swap.getFirstLeg(), _curves, blockBundle); } if (swap.getSecondLeg().getNthPayment(0) instanceof CouponIbor) { secondSense = presentValueCurveSensitivity((CouponIbor) swap.getSecondLeg() .getNthPayment(0), interpolator); for (int j = 1; j < swap.getSecondLeg().getNumberOfPayments(); j++) { secondSense = secondSense.plus(presentValueCurveSensitivity((CouponIbor) swap.getSecondLeg().getNthPayment(j), interpolator)); } } else { secondSense = MQSBC.fromInstrument(swap.getSecondLeg(), _curves, blockBundle); } MultipleCurrencyParameterSensitivity res = firstSense.plus(secondSense); return res; }</code><technical_language>Check args</technical_language>

Target:
public MultipleCurrencyParameterSensitivity presentValueCurveSensitivity( final Swap<? extends Payment, ? extends Payment> swap, final CurveBuildingBlockBundle blockBundle, final GeneralSmileInterpolator interpolator) { ArgumentChecker.notNull(swap, "swap"); ArgumentChecker.notNull(blockBundle, "blockBundle"); ArgumentChecker.notNull(interpolator, "interpolator"); MultipleCurrencyParameterSensitivity firstSense; MultipleCurrencyParameterSensitivity secondSense; if (swap.getFirstLeg().getNthPayment(0) instanceof CouponIbor) { firstSense = presentValueCurveSensitivity((CouponIbor) swap.getFirstLeg() .getNthPayment(0), interpolator); for (int j = 1; j < swap.getFirstLeg().getNumberOfPayments(); j++) { firstSense = firstSense .plus(presentValueCurveSensitivity((CouponIbor) swap.getFirstLeg().getNthPayment(j), interpolator)); } } else { firstSense = MQSBC.fromInstrument(swap.getFirstLeg(), _curves, blockBundle); } if (swap.getSecondLeg().getNthPayment(0) instanceof CouponIbor) { secondSense = presentValueCurveSensitivity((CouponIbor) swap.getSecondLeg() .getNthPayment(0), interpolator); for (int j = 1; j < swap.getSecondLeg().getNumberOfPayments(); j++) { secondSense = secondSense.plus(presentValueCurveSensitivity((CouponIbor) swap.getSecondLeg().getNthPayment(j), interpolator)); } } else { secondSense = MQSBC.fromInstrument(swap.getSecondLeg(), _curves, blockBundle); } MultipleCurrencyParameterSensitivity res = firstSense.plus(secondSense); return res; }
Source:
<code>public void normalOperationShouldNotReconfigureKafkaConsumer() { final PartitionData pd = new PartitionData(null, 100L); for (long i = 0; i < 100; ++i) { <START> pd.addEventFromKafka(100L + i + 1, ("test_" + i).getBytes()); <END> } pd.takeEventsToStream(currentTimeMillis(), 1000, 0L); assertEquals(100L, pd.getUnconfirmed()); for (long i = 0; i < 10; ++i) { final PartitionData.CommitResult cr = pd.onCommitOffset(110L + i * 10L); assertEquals(10L, cr.committedCount); assertFalse(cr.seekOnKafka); assertEquals(90L - i * 10L, pd.getUnconfirmed()); } }</code><technical_language>UTF-8</technical_language>

Target:
public void normalOperationShouldNotReconfigureKafkaConsumer() { final PartitionData pd = new PartitionData(null, 100L); for (long i = 0; i < 100; ++i) { pd.addEventFromKafka(100L + i + 1, ("test_" + i).getBytes(UTF_8)); } pd.takeEventsToStream(currentTimeMillis(), 1000, 0L); assertEquals(100L, pd.getUnconfirmed()); for (long i = 0; i < 10; ++i) { final PartitionData.CommitResult cr = pd.onCommitOffset(110L + i * 10L); assertEquals(10L, cr.committedCount); assertFalse(cr.seekOnKafka); assertEquals(90L - i * 10L, pd.getUnconfirmed()); } }
Source:
<code>protected By buildMobileNativeBy() { AnnotatedElement annotatedElement = annotatedElementContainer.getAnnotated(); HowToUseLocators howToUseLocators = annotatedElement.getAnnotation(HowToUseLocators.class); Optional<HowToUseLocators> howToUseLocatorsOptional = ofNullable(howToUseLocators); <START> By result = null; <END> if (isAndroid()) { return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::androidAutomation).orElse(null), getBys(AndroidFindBy.class, AndroidFindBys.class, AndroidFindAll.class)); } if (isIOSXcuit() || isIOS()) { result = buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::iOSXCUITAutomation).orElse(null), getBys(iOSXCUITFindBy.class, iOSXCUITFindBys.class, iOSXCUITFindAll.class)); } if (isWindows()) { return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::windowsAutomation).orElse(null), getBys(WindowsFindBy.class, WindowsFindBys.class, WindowsFindAll.class)); } return ofNullable(result).orElse(null); }</code><technical_language>is this variable used</technical_language>

Target:
protected By buildMobileNativeBy() { AnnotatedElement annotatedElement = annotatedElementContainer.getAnnotated(); HowToUseLocators howToUseLocators = annotatedElement.getAnnotation(HowToUseLocators.class); Optional<HowToUseLocators> howToUseLocatorsOptional = ofNullable(howToUseLocators); if (isAndroid()) { return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::androidAutomation).orElse(null), getBys(AndroidFindBy.class, AndroidFindBys.class, AndroidFindAll.class)); } if (isIOSXcuit() || isIOS()) { return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::iOSXCUITAutomation).orElse(null), getBys(iOSXCUITFindBy.class, iOSXCUITFindBys.class, iOSXCUITFindAll.class)); } if (isWindows()) { return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::windowsAutomation).orElse(null), getBys(WindowsFindBy.class, WindowsFindBys.class, WindowsFindAll.class)); } return null; }
Source:
<code>protected String[] getRequiredUpdateFields() { <START> return new String[] { "action", "model" }; <END> }</code><technical_language>mandatory? i updating "action" *only* sense, no?,</technical_language>

Target:
protected String[] getRequiredUpdateFields() { return new String[] {}; }
Source:
<code>public void test_setUrl_remote_with_post() { secondsToWaitTillFail = 35; String url = "<LINK_0>"; assumeTrue("Skipping test due to bad internet connection", checkInternet(url)); testLog.append("checkInternet() passed"); String expectedTitle = "Bug List"; Runnable browserSetFunc = () -> { testLog.append("Setting Browser url to:" + url); boolean opSuccess = browser.setUrl( <START> url, "emailassigned_to1=foo&bug_severity=enhancement&bug_status=NEW", <END> null); assertTrue("Expecting setUrl() to return true", opSuccess); }; validateTitleChanged(expectedTitle, browserSetFunc); int numChars = browser.getText().length(); assertTrue("Response data contained " + numChars + " chars.", numChars > 10000); }</code><technical_language>I suggest instead? bug_severity=enhancement&bug_status=NEW&email1=rgrunber&emailassigned_to1=1&emailtype1=substring is faster query returns a smaller result bugzilla optimizes queries better</technical_language>

Target:
public void test_setUrl_remote_with_post() { secondsToWaitTillFail = 35; String url = "<LINK_0>"; assumeTrue("Skipping test due to bad internet connection", checkInternet(url)); testLog.append("checkInternet() passed"); String expectedTitle = "Bug List"; Runnable browserSetFunc = () -> { testLog.append("Setting Browser url to:" + url); boolean opSuccess = browser.setUrl( url, "bug_severity=enhancement&bug_status=NEW&email1=rgrunber&emailassigned_to1=1&emailtype1=substring", null); assertTrue("Expecting setUrl() to return true", opSuccess); }; validateTitleChanged(expectedTitle, browserSetFunc); System.out.println("Debugging on remote : " + browser.getText()); int numChars = browser.getText().length(); assertTrue("Response data contained " + numChars + " chars.", numChars > 10000); }
Source:
<code>protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sSel = (IStructuredSelection) selection; if (sSel.getFirstElement() instanceof ITimeGraphEntry) { Object entryObject = sSel.toArray()[1]; if (entryObject instanceof ITimeEvent) { ITimeGraphEntry entry = (ITimeGraphEntry) sSel.getFirstElement(); while (!(entry instanceof TraceEntry)) { entry = entry.getParent(); if (entry == null) { return; } } <START> TraceEntry tEntry = (TraceEntry) entry; ITmfTrace trace = tEntry.getTrace(); <END> Iterable<@NonNull ITmfCallsiteResolver> analyses = TmfTraceUtils.getAnalysisModulesOfClass(trace, ITmfCallsiteResolver.class); for (ITmfCallsiteResolver analysis : analyses) { long timestamp = getTimeGraphViewer().getSelectionBegin(); IContributionItem contribItem = createOpenSouceCodeAction(analysis, getDiscriminator((ITimeEvent)(entryObject), timestamp), timestamp); if (contribItem != null) { menuManager.add(contribItem); } } } } } }</code><technical_language>this works long trace provides source code lookup. However, if is another trace provides need a find right trace (or experiment) get ITmfCallsiteResolver. API client implementation override. getCallsiteTrace() getCallsiteResolver(). data provider interface for that, provides a list of callsite for row time range</technical_language>

Target:
protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sSel = (IStructuredSelection) selection; if (sSel.getFirstElement() instanceof ITimeGraphEntry) { Object entryObject = sSel.toArray()[1]; if (entryObject instanceof TimeEvent) { TimeEvent timeEvent = (TimeEvent) entryObject; ITimeGraphEntry entry = (ITimeGraphEntry) sSel.getFirstElement(); while (!(entry instanceof TraceEntry)) { entry = entry.getParent(); if (entry == null) { return; } } TraceEntry tEntry = (TraceEntry) entry; ITmfTrace trace = tEntry.getTrace(); CallsiteDataProvider csdp = DataProviderManager.getInstance().getDataProvider(trace, CallsiteDataProvider.ID, CallsiteDataProvider.class); if(csdp == null) { return; } long timestamp = getTimeGraphViewer().getSelectionBegin(); Map<String, Object> map = new HashMap<>(); map.put(DataProviderParameterUtils.REQUESTED_TIME_KEY, Collections.singletonList(timestamp)); map.put(DataProviderParameterUtils.REQUESTED_ITEMS_KEY, Collections.singletonList(getCpu(timeEvent, timestamp))); Map<@NonNull String, @NonNull String> model = csdp.fetchTooltip(map, new NullProgressMonitor()).getModel(); IContributionItem contribItem = createOpenSouceCodeAction(model); if (contribItem != null) { menuManager.add(contribItem); } } } } }
Source:
<code>public boolean isSlaveAggregatorIdsValid(VdsNetworkInterface bond, List<VdsNetworkInterface> interfaces) { Integer bondAggregatorId = bond.getAdAggregatorId(); if (bondAggregatorId == null) { return true; } <START> String bondName = bond.getName(); for (VdsNetworkInterface slave : interfaces) { if (bondName.equals(slave.getBondName())) { if (!bondAggregatorId.equals(slave.getAdAggregatorId())) { return false; } } } return true; <END> }</code><technical_language>this extracted separate method simplifying this method. Do if want, I do insist it</technical_language>

Target:
private boolean isSlaveAggregatorIdsValid(VdsNetworkInterface bond, List<VdsNetworkInterface> interfaces) { Integer bondAggregatorId = bond.getAdAggregatorId(); if (bondAggregatorId == null) { return true; } return isAggregatorsEqual(bond, interfaces); }
Source:
<code>private Set<EnumFacing> floodFill(int pos) { Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class); Queue<Integer> queue = Queues.<Integer>newArrayDeque(); queue.add(IntegerCache.getInteger(pos)); this.opaqueBlocksBitSet.set(pos, true); while (!queue.isEmpty()) { <START> int i = ((Integer) queue.poll()).intValue(); <END> RenderVariables.addEdges(i, set); for (EnumFacing enumfacing : EnumFacing.values()) { int j = RenderVariables.getNeighborIndexAtFace(i, enumfacing); if (j >= 0 && !this.opaqueBlocksBitSet.get(j)) { this.opaqueBlocksBitSet.set(j, true); queue.add(IntegerCache.getInteger(j)); } } } return set; }</code><technical_language>really? rely autoboxing/autounboxing</technical_language>

Target:
private Set<EnumFacing> floodFill(int pos) { Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class); Queue<Integer> queue = Queues.<Integer>newArrayDeque(); queue.add(IntegerCache.getInteger(pos)); this.opaqueBlocksBitSet.set(pos, true); while (!queue.isEmpty()) { int i = queue.poll(); RenderVariables.addEdges(i, set); for (EnumFacing enumfacing : EnumFacing.values()) { int j = RenderVariables.getNeighborIndexAtFace(i, enumfacing); if (j >= 0 && !this.opaqueBlocksBitSet.get(j)) { this.opaqueBlocksBitSet.set(j, true); queue.add(IntegerCache.getInteger(j)); } } } return set; }