auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public RelNode convert(RelNode rel) { LogicalJoin join = (LogicalJoin) rel; List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : join.getInputs()) { if (!(input.getConvention() instanceof EnumerableConvention)) { input = convert( input, input.getTraitSet() .replace(EnumerableConvention.INSTANCE)); } newInputs.add(input); } final RelOptCluster cluster = join.getCluster(); final RelNode left = newInputs.get(0); final RelNode right = newInputs.get(1); final JoinInfo info = JoinInfo.of(left, right, join.getCondition()); if (!info.isEqui() && join.getJoinType() != JoinRelType.INNER) { return EnumerableNestedLoopJoin.create( left, right, join.getCondition(), join.getVariablesSet(), join.getJoinType()); } else { RelNode newRel; newRel = EnumerableHashJoin.create( left, right, info.getEquiCondition(left, right, cluster.getRexBuilder()), join.getVariablesSet(), join.getJoinType()); RexNode nonEqui = info.getRemaining(cluster.getRexBuilder()); <START> if (!nonEqui.isAlwaysTrue()) { <END> newRel = new EnumerableFilter(cluster, newRel.getTraitSet(), newRel, nonEqui); } return newRel; } }</code><technical_language>This if check is redundant</technical_language>

Target:
@Override public RelNode convert(RelNode rel) { LogicalJoin join = (LogicalJoin) rel; List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : join.getInputs()) { if (!(input.getConvention() instanceof EnumerableConvention)) { input = convert( input, input.getTraitSet() .replace(EnumerableConvention.INSTANCE)); } newInputs.add(input); } final RelOptCluster cluster = join.getCluster(); final RelNode left = newInputs.get(0); final RelNode right = newInputs.get(1); final JoinInfo info = join.analyzeCondition(); if (!info.isEqui() && join.getJoinType() != JoinRelType.INNER) { return EnumerableNestedLoopJoin.create( left, right, join.getCondition(), join.getVariablesSet(), join.getJoinType()); } else { RelNode newRel; newRel = EnumerableHashJoin.create( left, right, info.getEquiCondition(left, right, cluster.getRexBuilder()), join.getVariablesSet(), join.getJoinType()); if (!info.isEqui()) { RexNode nonEqui = RexUtil.composeConjunction(cluster.getRexBuilder(), info.getNonEquiConditions()); newRel = new EnumerableFilter(cluster, newRel.getTraitSet(), newRel, nonEqui); } return newRel; } }
Source:
<code>public void throw_exception_for_unknown_Java_class() { TypeUrl.of("unknown/JavaClass") <START> .toMessageClass(); <END> }</code><technical_language>of calls throws Exception? TypeUrl.of</technical_language>

Target:
public void throw_exception_for_unknown_Java_class() { final TypeUrl url = TypeUrl.of("unknown/JavaClass"); url.toMessageClass(); }
Source:
<code>protected void moveToMediaAdapter(String caseId) { Cursor cursor = this.managedQuery(Uri.parse("content://org.commcare.dalvik.case/casedb/attachment/" + caseId), null, null, null, null); cursor.moveToFirst(); <START> while (cursor.isAfterLast() == false) { <END> String filePath = cursor.getString(cursor.getColumnIndex("file-source")); if(!"invalid".equals(filePath)) { ImageView imageView = (ImageView) this.findViewById(R.id.image_view); Bitmap mBmp = BitmapFactory.decodeFile(filePath); if(mBmp != null) { imageView.setImageBitmap(mBmp); } } cursor.moveToNext(); } }</code><technical_language>!cursor.isAfterLast() instead</technical_language>

Target:
private void moveToMediaAdapter(String caseId) { Cursor cursor = this.managedQuery(Uri.parse(CASE_URI_ROOT + "attachment/" + caseId), null, null, null, null); cursor.moveToFirst(); while (!cursor.isAfterLast()) { String filePath = cursor.getString(cursor.getColumnIndex("file-source")); if(!"invalid".equals(filePath)) { ImageView imageView = (ImageView) this.findViewById(R.id.image_view); Bitmap mBmp = BitmapFactory.decodeFile(filePath); if(mBmp != null) { imageView.setImageBitmap(mBmp); } } cursor.moveToNext(); } }
Source:
<code>public int compare(EndpointMultiRank o1, EndpointMultiRank o2) { <START> int idealHeightDiff = o1.endpointConstraints.getIdealHeight() - o2.endpointConstraints.getIdealHeight(); <END> if (idealHeightDiff != 0) { return idealHeightDiff; } else { return o1.speakerRank - o2.speakerRank; } }</code><technical_language>Making I understand right: this ranking is specifically for bandwidth allocation, is prioritize ideal height, speaker rank</technical_language>

Target:
public int compare(EndpointMultiRank o1, EndpointMultiRank o2) { int preferredHeightDiff = o1.videoConstraints.getPreferredHeight() - o2.videoConstraints.getPreferredHeight(); if (preferredHeightDiff != 0) { return preferredHeightDiff; } else { int idealHeightDiff = o1.videoConstraints.getIdealHeight() - o2.videoConstraints.getIdealHeight(); if (idealHeightDiff != 0) { return idealHeightDiff; } return o2.speakerRank - o1.speakerRank; } }
Source:
<code>public void update(@Nonnull Block b) { Config blockData = BlockStorage.getLocationInfo(b.getLocation()); String id = blockData.getString("id"); SlimefunItem item = SlimefunItem.getByID(id); BlockMenu menu = BlockStorage.getInventory(b.getLocation()); if (item == null || menu == null) { clear(false); } else if (id.equals("CARGO_NODE_OUTPUT")) { clear(true); } else { this.items.clear(); this.checkLore = Objects.equals(blockData.getString("filter-lore"), "true"); <START> this.defaultValue = !Objects.equals(blockData.getString("filter-type"), "whitelist"); <END> for (int slot : CargoUtils.FILTER_SLOTS) { ItemStack stack = menu.getItemInSlot(slot); if (stack != null && stack.getType() != Material.AIR) { this.items.add(new ItemStackWrapper(stack)); } } } this.dirty = false; }</code><technical_language>issue cool Objects.equals :+1:</technical_language>

Target:
public void update(@Nonnull Block b) { Config blockData = BlockStorage.getLocationInfo(b.getLocation()); String id = blockData.getString("id"); SlimefunItem item = SlimefunItem.getByID(id); BlockMenu menu = BlockStorage.getInventory(b.getLocation()); if (item == null || menu == null) { clear(false); } else if (id.equals("CARGO_NODE_OUTPUT")) { clear(true); } else { this.items.clear(); this.checkLore = Objects.equals(blockData.getString("filter-lore"), "true"); this.rejectOnMatch = !Objects.equals(blockData.getString("filter-type"), "whitelist"); for (int slot : CargoUtils.FILTER_SLOTS) { ItemStack stack = menu.getItemInSlot(slot); if (stack != null && stack.getType() != Material.AIR) { this.items.add(new ItemStackWrapper(stack)); } } } this.dirty = false; }
Source:
<code>public MenuItem menu(String textToShow, List<String> menuItems, String defaultValue) { <START> final List<String> copiedMenuItems = new ArrayList<>(menuItems); <END> return messageSender.runAndWait(message -> setupUi.showMenuStep(message, textToShow, copiedMenuItems, defaultValue)); }</code><technical_language>I replace new ArrayList<>(...) constructs List.copyOf(...) especially list is immutable</technical_language>

Target:
public MenuItem menu(String textToShow, List<String> menuItems, String defaultValue) { final List<String> copiedMenuItems = List.copyOf(menuItems); return messageSender .runAndWait(message -> setupUi.showMenuStep(message, textToShow, copiedMenuItems, defaultValue)); }
Source:
<code>private Lock tryCreateLock(final LockOptions lockOptions) throws IOException { Object payload = redisClientDelegate.withScriptingClient(c -> { return c.eval( ACQUIRE_SCRIPT, Collections.singletonList(lockKey(lockOptions.getLockName())), Arrays.asList( Long.toString(lockOptions.getLeaseDuration().toMillis()), ownerName, Long.toString(clock.millis()), String.valueOf(lockOptions.getVersion()) ) ); }); if (payload == null) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions)); } <START> return objectMapper.readValue(payload.toString(), Lock.class); <END> }</code><technical_language>this instead: try { return objectMapper.readValue(payload.toString(), Lock.class); } catch(IOException e) { throw new LockNotAcquiredException(String.format("Lock acquired %s", lockOptions), e); } callers of this need deal LockNotAcquiredException. IOException is implementation detail of Jackson</technical_language>

Target:
private Lock tryCreateLock(final LockOptions lockOptions) { try { List<String> attributes = Optional.ofNullable(lockOptions.getAttributes()).orElse(Collections.emptyList()); Object payload = redisClientDelegate.withScriptingClient(c -> { return c.eval( ACQUIRE_SCRIPT, Collections.singletonList(lockKey(lockOptions.getLockName())), Arrays.asList( Long.toString(Duration.ofMillis(leaseDurationMillis).toMillis()), ownerName, Long.toString(clock.millis()), String.valueOf(lockOptions.getVersion()), lockOptions.getLockName(), String.join(";", attributes) )); }); if (payload == null) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions)); } return objectMapper.readValue(payload.toString(), Lock.class); } catch (IOException e) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions), e); } }
Source:
<code>private void allocateMacsMissingInMacPool(MacPool macPool, Map<String, Long> preexistingMacsUsageFrequency, Map<String, Long> macsFromRequestUsageFrequency) { List<String> macsToAcquire = new LinkedList<>(); for (Map.Entry<String, Long> entry : macsFromRequestUsageFrequency.entrySet()) { String mac = entry.getKey(); Long targetUsage = entry.getValue(); Long currentUsage = preexistingMacsUsageFrequency.get(mac); long macToAcquire = currentUsage == null ? targetUsage : targetUsage - currentUsage; LongStream.range(0, macToAcquire).forEach(e -> macsToAcquire.add(mac)); } <START> macPool.addMacs(macsToAcquire); <END> }</code><technical_language>handle case 'addMacs' fails for some of macs. Currently, error macPool wrong data. discuss this fixed. Please schedule a meeting</technical_language>

Target:
private List<String> allocateMacsMissingInMacPool(MacPool macPool, Map<String, Long> preexistingMacsUsageFrequency, Map<String, Long> macsFromRequestUsageFrequency) { List<String> macsToAcquire = new LinkedList<>(); for (Map.Entry<String, Long> entry : macsFromRequestUsageFrequency.entrySet()) { String mac = entry.getKey(); Long targetUsage = entry.getValue(); Long currentUsage = preexistingMacsUsageFrequency.get(mac); long macToAcquire = currentUsage == null ? targetUsage : targetUsage - currentUsage; LongStream.range(0, macToAcquire).forEach(e -> macsToAcquire.add(mac)); } return macPool.addMacs(macsToAcquire); }
Source:
<code>public synchronized void updateTo(ArrayList<BoxItem> items){ final HashMap<String, Integer> oldPositionMap = mItemsPositionMap; <START> final Set<String> oldIds = oldPositionMap.keySet(); <END> mItemsPositionMap = new HashMap<String, Integer>(items.size()); mItems.clear(); addAll(items); if (oldPositionMap.size() > mItems.size() ){ Iterator<Map.Entry<String,Integer>> iterator = oldPositionMap.entrySet().iterator(); while (iterator.hasNext()){ Map.Entry<String,Integer> entry = iterator.next(); if (mItemsPositionMap.containsKey(entry.getKey())){ iterator.remove(); } } mHandler.post(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer> entry : oldPositionMap.entrySet()){ notifyItemRemoved(entry.getValue()); } notifyItemRangeChanged(0, mItems.size()); } }); } else { notifyChange(0, mItems.size()); } }</code><technical_language>used</technical_language>

Target:
public synchronized void updateTo(ArrayList<BoxItem> items){ final HashMap<String, Integer> oldPositionMap = mItemsPositionMap; mItemsPositionMap = new HashMap<String, Integer>(items.size()); mItems.clear(); addAll(items); if (oldPositionMap.size() > mItems.size() ){ Iterator<Map.Entry<String,Integer>> iterator = oldPositionMap.entrySet().iterator(); while (iterator.hasNext()){ Map.Entry<String,Integer> entry = iterator.next(); if (mItemsPositionMap.containsKey(entry.getKey())){ iterator.remove(); } } mHandler.post(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer> entry : oldPositionMap.entrySet()){ notifyItemRemoved(entry.getValue()); } notifyItemRangeChanged(0, mItems.size()); } }); } else { notifyChange(0, mItems.size()); } }
Source:
<code>public void onInteractItem(PlayerInteractEvent.RightClickItem event) { if (!event.getEntityPlayer().isSneaking()) return; <START> if (event.getItemStack().func_190926_b()) return; <END> if (event.getItemStack().getItem() != Items.STICK) return; if (event.getItemStack().hasCapability(TEST_CAP, null)) { IExampleCapability cap = event.getItemStack().getCapability(TEST_CAP, null); cap.toggleVal(); System.out.println("Test value is now: " + (cap.getVal() ? "TRUE" : "FALSE")); } }</code><technical_language>Is this isEmpty()? This is necessary of check in line below</technical_language>

Target:
public void onInteractItem(PlayerInteractEvent.RightClickItem event) { if (!event.getEntityPlayer().isSneaking()) return; if (event.getItemStack().getItem() != Items.STICK) return; if (event.getItemStack().hasCapability(TEST_CAP, null)) { IExampleCapability cap = event.getItemStack().getCapability(TEST_CAP, null); cap.toggleVal(); System.out.println("Test value is now: " + (cap.getVal() ? "TRUE" : "FALSE")); } }
Source:
<code>public void binaryExcludedFalse() throws SQLException { <START> boolean original = P6LogOptions.getActiveInstance().getExcludebinary(); <END> try { P6LogOptions.getActiveInstance().setExcludebinary(false); String paramValName = "param_val"; String paramIntName = "param_id"; String resultParamName = "result_param"; if( "HSQLDB".equals(db) ) { paramValName = "@p1"; paramIntName = "@p2"; resultParamName = "@p3"; } String query = "{call TEST_PROC_BINARY(?,?,?)}"; CallableStatement call = connection.prepareCall(query); call.setBytes(paramValName, "foo".getBytes(StandardCharsets.UTF_8)); call.setInt(paramIntName, TEST_IMG_ID); call.registerOutParameter(resultParamName, Types.BLOB); call.execute(); call.close(); assertTrue(getLastLogEntry().contains("{call TEST_PROC_BINARY(?,?,?)} @p2:2000, @p1:'666F6F'")); } finally { P6LogOptions.getActiveInstance().setExcludebinary(original); } }</code><technical_language>Put @Before method</technical_language>

Target:
public void binaryExcludedFalse() throws SQLException { P6LogOptions.getActiveInstance().setExcludebinary(false); String paramValName = "param_val"; String paramIntName = "param_id"; String resultParamName = "result_param"; if( "HSQLDB".equals(db) ) { paramValName = "@p1"; paramIntName = "@p2"; resultParamName = "@p3"; } String query = "{call test_proc_binary(?,?,?)}"; CallableStatement call = connection.prepareCall(query); call.setBytes(paramValName, "foo".getBytes(StandardCharsets.UTF_8)); call.setInt(paramIntName, TEST_IMG_ID); call.registerOutParameter(resultParamName, Types.INTEGER); call.execute(); call.close(); assertTrue( getLastLogEntry().contains("{call test_proc_binary(?,?,?)} " + paramIntName + ":2000, " + paramValName + ":'666F6F'") || getLastLogEntry().contains("{call test_proc_binary(?,?,?)} " + paramValName + ":'666F6F', " + paramIntName + ":2000")); }
Source:
<code>public Property getProperty(String name) { <START> Property reservedProperty = getReservedProperty(name); <END> if (reservedProperty != null) { return reservedProperty; } Iterator<Property> propertiesWithName = getProperties(name).iterator(); if (propertiesWithName.hasNext()) { return propertiesWithName.next(); } return null; }</code><technical_language>This check for reservedProperty care of in call getProperties(name) below</technical_language>

Target:
public Property getProperty(String name) { Iterator<Property> propertiesWithName = getProperties(name).iterator(); if (propertiesWithName.hasNext()) { return propertiesWithName.next(); } return null; }
Source:
<code>public void loadFromUrl(URL url, boolean force, ProcessContext processContext) { try { Watch watch = Watch.start(); if (loadFromUrl(url, force)) { processContext.addTiming(NLS.get("VirtualFile.fileDownloaded"), watch.elapsedMillis()); } else { processContext.addTiming(NLS.get("VirtualFile.fileDownloadSkipped"), watch.elapsedMillis()); } } catch (IOException e) { processContext.log(ProcessLog.error() <START> .withNLSKey("#<N XXCS XM") <END> .withContext("url", url.toString())); } }</code><technical_language>wrong</technical_language>

Target:
public void loadFromUrl(URL url, boolean force, ProcessContext processContext) { try { Watch watch = Watch.start(); if (loadFromUrl(url, force)) { processContext.addTiming(NLS.get("VirtualFile.fileDownloaded"), watch.elapsedMillis()); } else { processContext.addTiming(NLS.get("VirtualFile.fileDownloadSkipped"), watch.elapsedMillis()); } } catch (IOException e) { processContext.log(ProcessLog.error() .withNLSKey("VirtualFile.downloadFailed") .withContext("url", url.toString())); } }
Source:
<code>private static String getTemplateFromQuery(String template, String templateType) { SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); SrampClientQuery query = createQuery(client, template, templateType); QueryResultSet resultSet = null; try { resultSet = query.query(); } catch (SrampClientException e) { logger.error( Messages.i18n.format("NotificationResourceUtil.query.client.error", query.toString()), e); } catch (SrampAtomException e) { logger.error(Messages.i18n.format("NotificationResourceUtil.query.atom.error", query.toString()), e); } if (resultSet != null && resultSet.size() == 1) { ArtifactSummary artifactSummary = resultSet.get(0); InputStream is = null; try { is = client.getArtifactContent(artifactSummary); } catch (SrampClientException e) { logger.error(Messages.i18n.format( "NotificationResourceUtil.query.client.getArtifactContent.error", artifactSummary), e); } catch (SrampAtomException e) { logger.error(Messages.i18n.format( "NotificationResourceUtil.query.atom.getArtifactContent.error", artifactSummary), e); } if (is != null) { try { return IOUtils.toString(is); } catch (IOException e) { logger.error(Messages.i18n.format("NotificationResourceUtil.query.ioutils.to.string"), e); } } } else { logger.error(Messages.i18n.format("NotificationResourceUtil.query.no.result", template, <START> templateType)); <END> } return null; }</code><technical_language>Change this 'warning' instead of 'error'</technical_language>

Target:
private static String getTemplateFromQuery(String template, String templateType) { SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); SrampClientQuery query = client.buildQuery("/s-ramp/ext/DtgovEmailTemplate[@template = ? and @template-type = ?]") .parameter(template).parameter(templateType); QueryResultSet resultSet = null; try { resultSet = query.query(); } catch (SrampClientException e) { logger.warn( Messages.i18n.format("NotificationResourceUtil.query.client.error", query.toString()), e); } catch (SrampAtomException e) { logger.warn(Messages.i18n.format("NotificationResourceUtil.query.atom.error", query.toString()), e); } if (resultSet != null && resultSet.size() == 1) { ArtifactSummary artifactSummary = resultSet.get(0); InputStream is = null; try { is = client.getArtifactContent(artifactSummary); } catch (SrampClientException e) { logger.warn(Messages.i18n.format( "NotificationResourceUtil.query.client.getArtifactContent.error", artifactSummary), e); } catch (SrampAtomException e) { logger.warn(Messages.i18n.format( "NotificationResourceUtil.query.atom.getArtifactContent.error", artifactSummary), e); } if (is != null) { try { return IOUtils.toString(is); } catch (IOException e) { logger.warn(Messages.i18n.format("NotificationResourceUtil.query.ioutils.to.string"), e); } } } else { logger.warn(Messages.i18n.format("NotificationResourceUtil.query.no.result", template, templateType)); } return null; }
Source:
<code>public void exitQuery(@NotNull final se.tre.freki.query.SelectParser.QueryContext ctx) { super.exitQuery(ctx); try { predicateBuilder.metric(metric.get()); } catch (ExecutionException e) { throw new QueryException("Error while fetching metric", e); } catch (InterruptedException e) { throw new QueryException("Interrupted while waiting for metric", e); } List<TimeSeriesIdPredicate> predicateList; try { predicateList = allAsList(futurePredicateList).get(); } catch (InterruptedException e) { throw new QueryException("Interrupted while waiting for tags", e); } catch (ExecutionException e) { throw new QueryException("Error while fetching tags", e); } <START> for (int i = 0; i < predicateList.size() / 2; i++) { <END> final TimeSeriesIdPredicate key = predicateList.get(i * 2); final TimeSeriesIdPredicate value = predicateList.get(i * 2 + 1); if (operatorList.get(i)) { predicateBuilder.addTagPredicate(TimeSeriesTagPredicate.eq(key, value)); } else { predicateBuilder.addTagPredicate(TimeSeriesTagPredicate.neq(key, value)); } } final TimeSeriesQueryPredicate predicate = predicateBuilder.build(); query = queryBuilder.predicate(predicate).build(); }</code><technical_language>iterator call #next instead of working indexes this. iterator is more defensive iterate elements throw exception if is missing</technical_language>

Target:
public void exitQuery(@NotNull final se.tre.freki.query.SelectParser.QueryContext ctx) { super.exitQuery(ctx); try { predicateBuilder.metric(metric.get()); } catch (ExecutionException e) { throw new QueryException("Error while fetching metric", e); } catch (InterruptedException e) { throw new QueryException("Interrupted while waiting for metric", e); } List<TimeSeriesIdPredicate> predicateList; try { predicateList = allAsList(futurePredicateList).get(); } catch (InterruptedException e) { throw new QueryException("Interrupted while waiting for tags", e); } catch (ExecutionException e) { throw new QueryException("Error while fetching tags", e); } final Iterator<TimeSeriesIdPredicate> predicateIterator = predicateList.iterator(); final Iterator<Boolean> operatorIterator = operatorList.iterator(); while (predicateIterator.hasNext()) { final TimeSeriesIdPredicate key = predicateIterator.next(); final TimeSeriesIdPredicate value = predicateIterator.next(); final boolean operator = operatorIterator.next(); if (operator) { predicateBuilder.addTagPredicate(TimeSeriesTagPredicate.eq(key, value)); } else { predicateBuilder.addTagPredicate(TimeSeriesTagPredicate.neq(key, value)); } } final TimeSeriesQueryPredicate predicate = predicateBuilder.build(); query = queryBuilder.predicate(predicate).build(); }
Source:
<code>protected Object receive(String queue, boolean expectNull) throws Exception { RedisTemplate<String, Object> template = createTemplate(); <START> byte[] bytes = (byte[]) template.boundListOps("queue." + queue).rightPop(); <END> if (bytes == null) { return null; } ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); int headerCount = byteBuffer.get(); for (int i = 0; i < headerCount; i++) { int len = byteBuffer.get(); byteBuffer.position(byteBuffer.position() + len); len = byteBuffer.get(); byteBuffer.position(byteBuffer.position() + len); } return new String(bytes, byteBuffer.position(), byteBuffer.remaining(), "UTF-8"); }</code><technical_language>this a brpop a short delay? (just thinking in terms of consistency RabbitMQ version)</technical_language>

Target:
protected Object receive(String queue, boolean expectNull) throws Exception { RedisTemplate<String, Object> template = createTemplate(); byte[] bytes = (byte[]) template.boundListOps("queue." + queue).rightPop(50, TimeUnit.MILLISECONDS); if (bytes == null) { return null; } ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); int headerCount = byteBuffer.get(); for (int i = 0; i < headerCount; i++) { int len = byteBuffer.get(); byteBuffer.position(byteBuffer.position() + len); len = byteBuffer.get(); byteBuffer.position(byteBuffer.position() + len); } return new String(bytes, byteBuffer.position(), byteBuffer.remaining(), "UTF-8"); }
Source:
<code>public final byte[] getCompressedMessage() { <START> return compressedMessage; <END> }</code><technical_language>This needs return compressedMessage.clone(). clone code calls getCompressedMessage() mutate message text (as arrays inherently mutable), of Message classes immutable</technical_language>

Target:
public final byte[] getCompressedMessage() { return compressedMessage.clone(); }
Source:
<code>public ExternalImage(String id, IModel<Serializable> srcModel) { <START> this(id, srcModel, (IModel<List<Serializable>>)null); <END> }</code><technical_language>Idem null list</technical_language>

Target:
public ExternalImage(String id, IModel<Serializable> srcModel) { this(id, srcModel, Model.ofList(Collections.<Serializable> emptyList())); }
Source:
<code>private void setEmptyValidMongoOnlyWithIntentResult(){ <START> jsonConfig = "{\"mongo\":{}"; <END> fakeActivityResult(); }</code><technical_language>Need extra }</technical_language>

Target:
private void setEmptyValidMongoOnlyWithIntentResult(){ jsonConfig = "{'mongo':{}}"; fakeActivityResult(); }
Source:
<code>public void initialContentShouldEndUpInSecondBackupFileAfterTwoBackupRuns() throws IOException { String contentOne = "Test One."; <START> final int kNumberOfBackups = 2; <END> Process process = new Process(); process.setId(2); process.setProcessBaseUri(URI.create("2")); URI resolve = fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); writeFile(resolve, contentOne); runBackup(kNumberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".1", contentOne); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(kNumberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".2", contentOne); }</code><technical_language>Rename of this variable is needed. Add of _k_ letter is coding guideline _k_ meaning here</technical_language>

Target:
public void initialContentShouldEndUpInSecondBackupFileAfterTwoBackupRuns() throws IOException { String contentOne = "Test One."; final int numberOfBackups = 2; Process process = new Process(); process.setId(2); process.setProcessBaseUri(URI.create("2")); URI resolve = fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); writeFile(resolve, contentOne); runBackup(numberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".1", contentOne); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(numberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".2", contentOne); }
Source:
<code>public int hashCode() { int h = 0; h = h * 31 + aId.hashCode(); h = h * 31 + bId.hashCode(); <START> h = h * 31 + ignoreWhitespace.hashCode(); <END> return h; }</code><technical_language>h = h * 31 + (ignoreWhitespace ? 1 : 0)</technical_language>

Target:
public int hashCode() { int h = 0; h = h * 31 + aId.hashCode(); h = h * 31 + bId.hashCode(); h = h * 31 + (ignoreWhitespace ? 1 : 0); return h; }
Source:
<code>private LogicalPlan tryApplyRules(LogicalPlan plan) { LogicalPlan node = plan; boolean done = false; while (!done) { done = true; for (Rule rule : rules) { Match match = rule.pattern().accept(node, Captures.empty()); if (match.isPresent()) { <START> if (LOGGER.isTraceEnabled()) { <END> LOGGER.trace("Rule '" + rule.getClass().getName() + "' matched"); } @SuppressWarnings("unchecked") LogicalPlan transformedPlan = rule.apply(match.value(), match.captures()); if (transformedPlan != null) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Rule '" + rule.getClass().getName() + "' transformed the logical plan"); } node = transformedPlan; done = false; } } } } return node; }</code><technical_language>store result while avoid repeated checks. account for config changes a tryApplyRules call</technical_language>

Target:
private LogicalPlan tryApplyRules(LogicalPlan plan) { final boolean isTraceEnabled = LOGGER.isTraceEnabled(); LogicalPlan node = plan; boolean done = false; while (!done) { done = true; for (Rule rule : rules) { Match match = rule.pattern().accept(node, Captures.empty()); if (match.isPresent()) { if (isTraceEnabled) { LOGGER.trace("Rule '" + rule.getClass().getName() + "' matched"); } @SuppressWarnings("unchecked") LogicalPlan transformedPlan = rule.apply(match.value(), match.captures()); if (transformedPlan != null) { if (isTraceEnabled) { LOGGER.trace("Rule '" + rule.getClass().getName() + "' transformed the logical plan"); } node = transformedPlan; done = false; } } } } return node; }
Source:
<code>protected boolean processNonDuplicateVendorDetail(PaymentWorksVendor paymentWorksVendor, StringBuffer documentNumbers, VendorDetail oldVendor, VendorDetail newVendor) { boolean isRouted; VendorDetail vendorDetail = new PaymentWorksVendorUpdateConversionUtil().createVendorDetailForEdit(newVendor, oldVendor, paymentWorksVendor); try { MaintenanceDocument vendorMaintDoc = buildVendorMaintenanceDocument(paymentWorksVendor, oldVendor, vendorDetail); boolean isVendorLocked = checkForLockingDocument(vendorMaintDoc); <START> if (!isVendorLocked) { <END> isRouted = processUnlockedVendorMaintenanceDocument(documentNumbers, vendorMaintDoc); } else { LOG.error("Failed to route Vendor Edit document due to lock"); GlobalVariables.getMessageMap().putError("vendorDetail", KFSKeyConstants.ERROR_CUSTOM, "Failed to route Vendor Edit document due to lock"); isRouted = false; } } catch (Exception e) { LOG.error("Failed to route Vendor document due to error(s): " + e.getMessage()); isRouted = false; } return isRouted; }</code><technical_language>do need this variable for else, prior method call inlined here</technical_language>

Target:
protected boolean processNonDuplicateVendorDetail(PaymentWorksVendor paymentWorksVendor, StringBuffer documentNumbers, VendorDetail oldVendor, VendorDetail newVendor) { boolean routed = false; VendorDetail vendorDetail = new PaymentWorksVendorUpdateConversionUtil().createVendorDetailForEdit(newVendor, oldVendor, paymentWorksVendor); try { MaintenanceDocument vendorMaintDoc = buildVendorMaintenanceDocument(paymentWorksVendor, oldVendor, vendorDetail); if (!checkForLockingDocument(vendorMaintDoc)) { routed = processUnlockedVendorMaintenanceDocument(documentNumbers, vendorMaintDoc); } else { LOG.error("Failed to route Vendor Edit document due to lock"); GlobalVariables.getMessageMap().putError("vendorDetail", KFSKeyConstants.ERROR_CUSTOM, "Failed to route Vendor Edit document due to lock"); } } catch (Exception e) { LOG.error("Failed to route Vendor document due to error(s): " + e.getMessage()); } return routed; }
Source:
<code>public ActiveResourceManager( ResourceManagerDriver<WorkerType> resourceManagerDriver, Configuration flinkConfig, RpcService rpcService, ResourceID resourceId, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, SlotManager slotManager, ResourceManagerPartitionTrackerFactory clusterPartitionTrackerFactory, JobLeaderIdService jobLeaderIdService, ClusterInformation clusterInformation, FatalErrorHandler fatalErrorHandler, ResourceManagerMetricGroup resourceManagerMetricGroup) { super( rpcService, resourceId, highAvailabilityServices, heartbeatServices, slotManager, clusterPartitionTrackerFactory, jobLeaderIdService, clusterInformation, fatalErrorHandler, resourceManagerMetricGroup, AkkaUtils.getTimeoutAsTime(Preconditions.checkNotNull(flinkConfig))); <START> this.flinkConfig = flinkConfig; this.resourceManagerDriver = Preconditions.checkNotNull(resourceManagerDriver); <END> this.workerNodeMap = new HashMap<>(); this.pendingWorkerCounter = new PendingWorkerCounter(); this.currentAttemptUnregisteredWorkers = new HashMap<>(); }</code><technical_language>null checks a bit inconsistent here</technical_language>

Target:
public ActiveResourceManager( ResourceManagerDriver<WorkerType> resourceManagerDriver, Configuration flinkConfig, RpcService rpcService, ResourceID resourceId, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, SlotManager slotManager, ResourceManagerPartitionTrackerFactory clusterPartitionTrackerFactory, JobLeaderIdService jobLeaderIdService, ClusterInformation clusterInformation, FatalErrorHandler fatalErrorHandler, ResourceManagerMetricGroup resourceManagerMetricGroup) { super( rpcService, resourceId, highAvailabilityServices, heartbeatServices, slotManager, clusterPartitionTrackerFactory, jobLeaderIdService, clusterInformation, fatalErrorHandler, resourceManagerMetricGroup, AkkaUtils.getTimeoutAsTime(Preconditions.checkNotNull(flinkConfig))); this.flinkConfig = flinkConfig; this.resourceManagerDriver = resourceManagerDriver; this.workerNodeMap = new HashMap<>(); this.pendingWorkerCounter = new PendingWorkerCounter(); this.currentAttemptUnregisteredWorkers = new HashMap<>(); }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.contribution_activity_notification_menu, menu); if (!isThereUnreadNotifications) { menu.findItem(R.id.notifications).setIcon(ContextCompat.getDrawable(this, R.drawable.ic_notification_white_clip_art)); } else { final View notification=menu.findItem(R.id.notifications).getActionView(); txtViewCount=notification.findViewById(R.id.notification_count_badge); <START> txtViewCount.setText(String.valueOf(1)); <END> } this.menu = menu; updateMenuItem(); return true; }</code><technical_language>is this hardcoded</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.contribution_activity_notification_menu, menu); notificationsMenuItem = menu.findItem(R.id.notifications); final View notification = notificationsMenuItem.getActionView(); notificationCount = notification.findViewById(R.id.notification_count_badge); notification.setOnClickListener(view -> NotificationActivity.startYourself(MainActivity.this)); this.menu = menu; updateMenuItem(); setNotificationCount(); return true; }
Source:
<code>public Long getTimestamp(MessageAndMetadata<byte[], byte[]> kafkaMessage) { <START> return null; <END> }</code><technical_language>If return null, caller deal situation</technical_language>

Target:
public long getTimestamp(MessageAndMetadata<byte[], byte[]> kafkaMessage) { return 0l; }
Source:
<code>private void waitMoveTasksToFinish(ExecutorService moveRegionsPool, List<Future<Boolean>> taskList, long timeoutInSeconds) throws Exception { try { if (!moveRegionsPool.awaitTermination(timeoutInSeconds, TimeUnit.SECONDS)) { moveRegionsPool.shutdownNow(); } } catch (InterruptedException e) { moveRegionsPool.shutdownNow(); Thread.currentThread().interrupt(); } for (Future<Boolean> future : taskList) { try { if (!future.get(5, TimeUnit.SECONDS)) { LOG.error("Was Not able to move region....Exiting Now"); throw new Exception("Could not move region Exception"); } } catch (InterruptedException e) { LOG.error("Interrupted while waiting for Thread to Complete " + e.getMessage(), e); throw e; } catch (ExecutionException e) { if (e.getCause() instanceof UnknownRegionException) { <START> LOG.debug("Ignore unknown region, it might have been split/merged."); <END> } else { LOG.error("Got Exception From Thread While moving region {}", e.getMessage(), e); throw e; } } catch (CancellationException e) { LOG.error("Thread for moving region cancelled. Timeout for cancellation:" + timeoutInSeconds + "secs", e); throw e; } } }</code><technical_language>this logged more prominent level</technical_language>

Target:
private void waitMoveTasksToFinish(ExecutorService moveRegionsPool, List<Future<Boolean>> taskList, long timeoutInSeconds) throws Exception { try { if (!moveRegionsPool.awaitTermination(timeoutInSeconds, TimeUnit.SECONDS)) { moveRegionsPool.shutdownNow(); } } catch (InterruptedException e) { moveRegionsPool.shutdownNow(); Thread.currentThread().interrupt(); } for (Future<Boolean> future : taskList) { try { if (!future.get(5, TimeUnit.SECONDS)) { LOG.error("Was Not able to move region....Exiting Now"); throw new Exception("Could not move region Exception"); } } catch (InterruptedException e) { LOG.error("Interrupted while waiting for Thread to Complete " + e.getMessage(), e); throw e; } catch (ExecutionException e) { boolean ignoreFailure = ignoreRegionMoveFailure(e); if (ignoreFailure) { LOG.debug("Ignore region move failure, it might have been split/merged.", e); } else { LOG.error("Got Exception From Thread While moving region {}", e.getMessage(), e); throw e; } } catch (CancellationException e) { LOG.error("Thread for moving region cancelled. Timeout for cancellation:" + timeoutInSeconds + "secs", e); throw e; } } }
Source:
<code>protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), <START> getParameters().isFiltered()); <END> ArrayList<Disk> filteredDiskList = new ArrayList<Disk>(); VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId()); List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); List<DiskInterface> supportedDiskInterfaces = new ArrayList<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { } } for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }</code><technical_language>If this list is empty return - reason additional (expensive) DB call</technical_language>

Target:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (diskList == null || diskList.isEmpty()) { setReturnValue(Collections.emptyList()); return; } ArrayList<Disk> filteredDiskList = new ArrayList<Disk>(); VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { setReturnValue(Collections.emptyList()); return; } List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); HashSet<DiskInterface> supportedDiskInterfaces = new HashSet<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }
Source:
<code>public void addUnspentTransactionOutput(StoredTransactionOutput out) throws BlockStoreException { maybeConnect(); PreparedStatement s = null; String dbAddress = ""; int type = 0; Script outputScript = null; try <START> { <END> outputScript = new Script(out.getScriptBytes()); } catch (ScriptException e) { log.info("Could not parse script for output: " + out.getHash().toString()); } if (outputScript != null && (outputScript.isSentToAddress() || outputScript.isSentToRawPubKey() || outputScript.isPayToScriptHash())) { if (outputScript.isSentToAddress()) { Address targetAddr = new Address(params, outputScript.getPubKeyHash()); dbAddress = targetAddr.toString(); type = 1; } else if (outputScript.isSentToRawPubKey()) { dbAddress = outputScript.getFromAddress(params).toString(); type = 2; } else { dbAddress = Address.fromP2SHHash(params, outputScript.getPubKeyHash()).toString(); type = 3; } } try { s = conn.get().prepareStatement(getInsertOpenoutputsSQL()); s.setBytes(1, out.getHash().getBytes()); s.setInt(2, (int) out.getIndex()); s.setInt(3, out.getHeight()); s.setBytes(4, BigInteger.valueOf(out.getValue().value).toByteArray()); s.setBytes(5, out.getScriptBytes()); s.setString(6, dbAddress); s.setInt(7, type); s.executeUpdate(); s.close(); } catch (SQLException e) { if (!(e.getSQLState().equals(getDuplicateKeyErrorCode()))) throw new BlockStoreException(e); } finally { if (s != null) try { s.close(); } catch (SQLException e) { throw new BlockStoreException(e); } } }</code><technical_language>Curly brace try in new line (multiple occurences)</technical_language>

Target:
public void addUnspentTransactionOutput(StoredTransactionOutput out) throws BlockStoreException { maybeConnect(); PreparedStatement s = null; String dbAddress = ""; int type = 0; Script outputScript = null; try { outputScript = new Script(out.getScriptBytes()); } catch (ScriptException e) { log.info("Could not parse script for output: " + out.getHash().toString()); } if (outputScript != null && (outputScript.isSentToAddress() || outputScript.isSentToRawPubKey() || outputScript.isPayToScriptHash())) { if (outputScript.isSentToAddress()) { Address targetAddr = new Address(params, outputScript.getPubKeyHash()); dbAddress = targetAddr.toString(); type = 1; } else if (outputScript.isSentToRawPubKey()) { dbAddress = outputScript.getFromAddress(params).toString(); type = 2; } else { dbAddress = Address.fromP2SHHash(params, outputScript.getPubKeyHash()).toString(); type = 3; } } try { s = conn.get().prepareStatement(getInsertOpenoutputsSQL()); s.setBytes(1, out.getHash().getBytes()); s.setInt(2, (int) out.getIndex()); s.setInt(3, out.getHeight()); s.setLong(4, out.getValue().value); s.setBytes(5, out.getScriptBytes()); s.setString(6, dbAddress); s.setInt(7, type); s.setBoolean(8, out.isCoinbase()); s.executeUpdate(); s.close(); } catch (SQLException e) { if (!(e.getSQLState().equals(getDuplicateKeyErrorCode()))) throw new BlockStoreException(e); } finally { if (s != null) { try { s.close(); } catch (SQLException e) { throw new BlockStoreException(e); } } } }
Source:
<code>public RequestTemplate create(Object[] argv) { RequestTemplate mutable = new RequestTemplate(metadata.template()); if (metadata.urlIndex() != null) { int urlIndex = metadata.urlIndex(); checkArgument(argv[urlIndex] != null, "URI parameter %s was null", urlIndex); mutable.insert(0, String.valueOf(argv[urlIndex])); } Map<String, Object> varBuilder = new LinkedHashMap<String, Object>(); for (Entry<Integer, Collection<String>> entry : metadata.indexToName().entrySet()) { int i = entry.getKey(); Object value = argv[entry.getKey()]; if (value != null) { if (indexToExpander.containsKey(i)) { value = indexToExpander.get(i).expand(value); } for (String name : entry.getValue()) { varBuilder.put(name, value); } } } RequestTemplate template = resolve(argv, mutable, varBuilder); <START> return addQueryMapQueryParameters(argv, template); <END> }</code><technical_language>if this method in resolve not.. a bit random here</technical_language>

Target:
public RequestTemplate create(Object[] argv) { RequestTemplate mutable = new RequestTemplate(metadata.template()); if (metadata.urlIndex() != null) { int urlIndex = metadata.urlIndex(); checkArgument(argv[urlIndex] != null, "URI parameter %s was null", urlIndex); mutable.insert(0, String.valueOf(argv[urlIndex])); } Map<String, Object> varBuilder = new LinkedHashMap<String, Object>(); for (Entry<Integer, Collection<String>> entry : metadata.indexToName().entrySet()) { int i = entry.getKey(); Object value = argv[entry.getKey()]; if (value != null) { if (indexToExpander.containsKey(i)) { value = indexToExpander.get(i).expand(value); } for (String name : entry.getValue()) { varBuilder.put(name, value); } } } RequestTemplate template = resolve(argv, mutable, varBuilder); if (metadata.queryMapIndex() != null) { template = addQueryMapQueryParameters(argv, template); } return template; }
Source:
<code>public boolean perform(AbstractBuild<?, ?> build, BuildListener listener, long effectiveTimeout) { long effectiveTimeoutMinutes = MINUTES.convert(effectiveTimeout,MILLISECONDS); listener.getLogger().println(hudson.plugins.build_timeout.Messages.Timeout_Message( effectiveTimeoutMinutes, hudson.plugins.build_timeout.Messages.Timeout_Aborted()) ); Executor e = build.getExecutor(); if (e != null) { e.interrupt(Result.ABORTED); } <START> build.setResult(Result.ABORTED); <END> return true; }</code><technical_language>if add this? (You e.interrupt work?)</technical_language>

Target:
public boolean perform(AbstractBuild<?, ?> build, BuildListener listener, long effectiveTimeout) { long effectiveTimeoutMinutes = MINUTES.convert(effectiveTimeout,MILLISECONDS); listener.getLogger().println(hudson.plugins.build_timeout.Messages.Timeout_Message( effectiveTimeoutMinutes, hudson.plugins.build_timeout.Messages.Timeout_Aborted()) ); Executor e = build.getExecutor(); if (e != null) { e.interrupt(Result.ABORTED); } return true; }
Source:
<code>private String extractDefinitionLine(String typeDeclaration) { String typeLine = ""; String[] lines = typeDeclaration.split("\n"); for (String line : lines) { typeLine = typeLine + "\n" + line; if (line.contains("{")) { break; } } return typeLine; <START> } <END></code><technical_language>I is ok, I I feel including "\n"</technical_language>

Target:
private String extractDefinitionLine(String typeDeclaration) { String typeLine = ""; String[] lines = typeDeclaration.split("\n"); for (String line : lines) { typeLine = line; if (line.contains("{")) { break; } } return typeLine; }
Source:
<code>void process() throws Exception { processCount.inc(); <START> if (receiveBuffer == null) { <END> logger.warning("No receiving buffer configured. Skipping inbound processing."); return; } lastReadTime = currentTimeMillis(); int readBytes = socketChannel.read(receiveBuffer); if (readBytes == -1) { throw new EOFException("Remote socket closed!"); } bytesRead.inc(readBytes); InboundHandler[] localHandlers = handlers; boolean cleanPipeline; boolean unregisterRead; do { cleanPipeline = true; unregisterRead = false; for (int handlerIndex = 0; handlerIndex < localHandlers.length; handlerIndex++) { InboundHandler handler = localHandlers[handlerIndex]; HandlerStatus handlerStatus = handler.onRead(); if (localHandlers != handlers) { handlerIndex = -1; localHandlers = handlers; continue; } switch (handlerStatus) { case CLEAN: break; case DIRTY: cleanPipeline = false; break; case BLOCKED: cleanPipeline = true; unregisterRead = true; break; default: throw new IllegalStateException(); } } } while (!cleanPipeline); if (unregisterRead) { unregisterOp(OP_READ); } }</code><technical_language>I this is good. Process called receive buffer is null. I checks for exceptional cases fast path</technical_language>

Target:
void process() throws Exception { processCount.inc(); lastReadTime = currentTimeMillis(); int readBytes = socketChannel.read(receiveBuffer); if (readBytes == -1) { throw new EOFException("Remote socket closed!"); } bytesRead.inc(readBytes); InboundHandler[] localHandlers = handlers; boolean cleanPipeline; boolean unregisterRead; do { cleanPipeline = true; unregisterRead = false; for (int handlerIndex = 0; handlerIndex < localHandlers.length; handlerIndex++) { InboundHandler handler = localHandlers[handlerIndex]; HandlerStatus handlerStatus = handler.onRead(); if (localHandlers != handlers) { handlerIndex = -1; localHandlers = handlers; continue; } switch (handlerStatus) { case CLEAN: break; case DIRTY: cleanPipeline = false; break; case BLOCKED: cleanPipeline = true; unregisterRead = true; break; default: throw new IllegalStateException(); } } } while (!cleanPipeline); if (unregisterRead) { unregisterOp(OP_READ); } }