auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Stream<T> fetchFromProvider(int offset, int limit) { Stream<T> stream = Stream.empty(); QueryTrace query = new QueryTrace(offset, pageSize, backEndSorting, inMemorySorting, filter); final int pages = (int) Math.ceil((double) limit / pageSize); if (limit > pageSize) { for (int page = 0; page < pages; page++) { final int newOffset = offset + page * pageSize; query = new QueryTrace(newOffset, pageSize, backEndSorting, inMemorySorting, filter); stream = Stream.concat(stream, getDataProvider().fetch(query)); } } else { stream = getDataProvider().fetch(query); } if (stream.isParallel()) { LoggerFactory.getLogger(DataCommunicator.class) .debug("Data provider has returned " + "parallel stream on 'fetch' call", getDataProvider().getClass()); stream = stream.collect(Collectors.toList()).stream(); assert !stream.isParallel(); } SizeVerifier verifier = new SizeVerifier<>(pages * pageSize); stream = stream.peek(verifier); <START> if (!query.isLimitCalled() && !query.isPageSizeCalled()) { <END> throw new IllegalStateException( getInvalidContractMessage("getLimit or getPageSize")); } if (!query.isOffsetCalled() && !query.isPageCalled()) { throw new IllegalStateException( getInvalidContractMessage("getOffset or getPage")); } return stream; }</code><technical_language>This related change in QueryTrace is obsolete methods basically aliases fine this well</technical_language>

Target:
protected Stream<T> fetchFromProvider(int offset, int limit) { Stream<T> stream = Stream.empty(); QueryTrace query = new QueryTrace(offset, pageSize, backEndSorting, inMemorySorting, filter); final int pages = (limit + pageSize - 1) / pageSize; if (limit > pageSize) { for (int page = 0; page < pages; page++) { final int newOffset = offset + page * pageSize; query = new QueryTrace(newOffset, pageSize, backEndSorting, inMemorySorting, filter); stream = Stream.concat(stream, getDataProvider().fetch(query)); } } else { stream = getDataProvider().fetch(query); } if (stream.isParallel()) { LoggerFactory.getLogger(DataCommunicator.class) .debug("Data provider has returned " + "parallel stream on 'fetch' call", getDataProvider().getClass()); stream = stream.collect(Collectors.toList()).stream(); assert !stream.isParallel(); } SizeVerifier verifier = new SizeVerifier<>(pages * pageSize); stream = stream.peek(verifier); if (!query.isLimitCalled()) { throw new IllegalStateException( getInvalidContractMessage("getLimit or getPageSize")); } if (!query.isOffsetCalled()) { throw new IllegalStateException( getInvalidContractMessage("getOffset or getPage")); } return stream; }
Source:
<code>public static String adHocSQLFromInvocationForDebug(StoredProcedureInvocation invocation) { assert(invocation.getProcName().startsWith("@AdHoc")); ParameterSet params = invocation.getParams(); assert(params.size() == 2 || params.size() == 3); byte[] serializedBatchData = (byte[]) params.getParam(params.size() - 1); Pair<Object[], AdHocPlannedStatement[]> data = decodeSerializedBatchData(serializedBatchData); Object[] userparams = data.getFirst(); AdHocPlannedStatement[] statements = data.getSecond(); StringBuilder sb = new StringBuilder(); if (statements.length == 0) { <START> sb.append("ONLYSLOW INVOCATION HAS NO SQL"); <END> } else if (statements.length == 1) { sb.append(adHocSQLStringFromPlannedStatement(statements[0], userparams)); } else { sb.append("BEGIN READONLYSLOW_SQL_BATCH {\n"); for (AdHocPlannedStatement stmt : statements) { sb.append(adHocSQLStringFromPlannedStatement(stmt, userparams)).append("\n"); } sb.append("} END READONLYSLOW_SQL_BATCH"); } return sb.toString(); }</code><technical_language>supposed READONLYSLOW</technical_language>

Target:
public static String adHocSQLFromInvocationForDebug(StoredProcedureInvocation invocation) { ParameterSet params = invocation.getParams(); assert(params.size() == 2 || params.size() == 3); byte[] serializedBatchData = (byte[]) params.getParam(params.size() - 1); Pair<Object[], AdHocPlannedStatement[]> data = decodeSerializedBatchData(serializedBatchData); Object[] userparams = data.getFirst(); AdHocPlannedStatement[] statements = data.getSecond(); StringBuilder sb = new StringBuilder(); if (statements.length == 0) { sb.append("READONLYSLOW INVOCATION HAS NO SQL"); } else if (statements.length == 1) { sb.append(adHocSQLStringFromPlannedStatement(statements[0], userparams)); } else { sb.append("BEGIN READONLYSLOW_SQL_BATCH {\n"); for (AdHocPlannedStatement stmt : statements) { sb.append(adHocSQLStringFromPlannedStatement(stmt, userparams)).append("\n"); } sb.append("} END READONLYSLOW_SQL_BATCH"); } return sb.toString(); }
Source:
<code>public boolean isIgnoringSundamage() { <START> return this.isPotionActive(ModPotions.sunscreen) || this.ignoreSundamageAction; <END> }</code><technical_language>Is potion for entity action instead of additional attribute here</technical_language>

Target:
public boolean isIgnoringSundamage() { return this.isPotionActive(ModPotions.sunscreen); }
Source:
<code>public CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params) throws LanguageServerException { String fileUri = params.getTextDocument().getUri(); FormattingOptions options = params.getOptions(); if (options == null) { options = new FormattingOptions(); params.setOptions(options); } <START> String projectPath = WsPathUtils.absolutize(extractProjectPath(fileUri)); <END> String formatterPathSuffix = CHE_FOLDER + SEPARATOR + CHE_FORMATTER_XML; Path projectFormatterPath = Paths.get(projectPath, formatterPathSuffix); Path wsFormatterPath = Paths.get(PROJECTS_ROOT, formatterPathSuffix); if (Files.exists(projectFormatterPath)) { updateFormatterOptions(params, getFormatSettingsFromFile(projectFormatterPath.toFile())); } else if (Files.exists(wsFormatterPath)) { updateFormatterOptions(params, getFormatSettingsFromFile(wsFormatterPath.toFile())); } return wrapped.formatting(params); }</code><technical_language>nice a private method update formatter options</technical_language>

Target:
public CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params) throws LanguageServerException { String fileUri = params.getTextDocument().getUri(); FormattingOptions options = params.getOptions(); if (options == null) { options = new FormattingOptions(); params.setOptions(options); } updateFormatterOptions(params, fileUri); return wrapped.formatting(params); }
Source:
<code>public boolean canHandle(Object source) { return (source!=null && source.getClass().isArray() && source.getClass().getComponentType().isPrimitive()) && byte.class.isAssignableFrom(source.getClass().getComponentType()); <START> } <END></code><technical_language>source != null && source.getClass().equals(byte[].class)</technical_language>

Target:
public boolean canHandle(Object source) { return (source != null && source.getClass().equals(byte[].class)); }
Source:
<code><START> public static boolean hasTag(Tag tag, String keyword) { <END> Pattern pattern = Pattern.compile(keyword, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); String value = getTranslatedPathToRoot(tag); return pattern.matcher(value).find(); }</code><technical_language>want search for translated tags only, search for tags translated tags</technical_language>

Target:
public static boolean hasTag(Tag tag, String keyword) { Pattern pattern = Pattern.compile(keyword, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); String translatedValue = getTranslatedPathToRoot(tag); String value = getPathToRoot(tag); return pattern.matcher(translatedValue).find() || pattern.matcher(value).find(); }
Source:
<code>CookiePageIterator() { try { dataStream = new DataInputStream(new FileInputStream(cookieFile)); dataStream.skipBytes((2 * SIZEOF_INT_BYTES) + (pageSizeArray.length * SIZEOF_INT_BYTES)); } catch (IOException ex) { <START> logger.log(Level.WARNING, "Error occured creating DataInputStream", new Object[]{cookieFile.getName(), ex}); END> closeStream(); } }</code><technical_language>place holders in message string for cookie file name exception. exception fourth argument method is logged causing exception a full stack trace - throw debugging data</technical_language>

Target:
CookiePageIterator() { if(pageSizeArray == null || pageSizeArray.length == 0) { return; } try { dataStream = new DataInputStream(new FileInputStream(cookieFile)); dataStream.skipBytes((2 * SIZEOF_INT_BYTES) + (pageSizeArray.length * SIZEOF_INT_BYTES)); } catch (IOException ex) { String errorMessage = String.format("An error occurred creating an input stream for %s", cookieFile.getName()); LOG.log(Level.WARNING, errorMessage, ex); closeStream(); } }
Source:
<code>public Set<String> deleteBundleAndDependenciesOlderThan(final Date olderThan, final User user) throws DotDataException { if(olderThan.after(new Date())){ throw new IllegalArgumentException("To avoid deleting bundles that publish in the future, the date can not be after the current date"); } final ImmutableSet.Builder<String> bundlesDeleted = new ImmutableSet.Builder<>(); final boolean isAdmin = this.userAPI.isCMSAdmin(user); final int bundleSleepCount = Config.getIntProperty ("bundle.sleep.count", 10); final long millisBundleSleep = Config.getLongProperty("bundle.sleep.millis", 25l); final MutableInt deletedCount = new MutableInt(0); try { Logger.info(this, "Deleting bundles older than: " + olderThan + " by the user :" + user.getUserId()); try (final Stream<String> bundleIds = this.getOlderBundleIds(olderThan, user.getUserId(), isAdmin)) { bundleIds.forEachOrdered(bundleId -> { this.internalDeleteBundleAndDependenciesThrowRuntime(bundleId, user, deletedCount.getValue(), bundleSleepCount, millisBundleSleep); bundlesDeleted.add(bundleId); deletedCount.increment(); }); } } catch (IOException e) { <START> <END> throw new DotDataException(e); } return bundlesDeleted.build(); }</code><technical_language>Please log debugging data here</technical_language>

Target:
public Set<String> deleteBundleAndDependenciesOlderThan(final Date olderThan, final User user) throws DotDataException { if(olderThan.after(new Date())){ Logger.error(this,"To avoid deleting bundles that publish in the future, the date can not be after the current date"); throw new IllegalArgumentException("To avoid deleting bundles that publish in the future, the date can not be after the current date"); } final ImmutableSet.Builder<String> bundlesDeleted = new ImmutableSet.Builder<>(); final boolean isAdmin = this.userAPI.isCMSAdmin(user); final int bundleSleepCount = Config.getIntProperty ("bundle.sleep.count", 10); final long millisBundleSleep = Config.getLongProperty("bundle.sleep.millis", 25l); final MutableInt deletedCount = new MutableInt(0); try { Logger.info(this, "Deleting bundles older than: " + olderThan + " by the user :" + user.getUserId()); try (final Stream<String> bundleIds = this.getOlderBundleIds(olderThan, user.getUserId(), isAdmin)) { bundleIds.forEachOrdered(bundleId -> { this.internalDeleteBundleAndDependenciesThrowRuntime(bundleId, user, deletedCount.getValue(), bundleSleepCount, millisBundleSleep); bundlesDeleted.add(bundleId); deletedCount.increment(); }); } } catch (IOException e) { Logger.error(this,"Error Removing bundles older than: " + olderThan + " by the user :" + user.getUserId(),e); throw new DotDataException(e); } return bundlesDeleted.build(); }
Source:
<code>public String toString() { <START> return String.format("Volume %s can only be used on host %s(%s)", volumeName, hostName, hostId); <END> }</code><technical_language>I put volume id in parentheses volume name</technical_language>

Target:
public String toString() { return String.format("Volume %s(%s) can only be used on host %s(%s)", volumeName, volumeId, hostName, hostId); }
Source:
<code>public void checkDebug() { <START> if(getVertexId().toString().equals("AGACCCATGCAGCGGGTCAGG")) <END> System.out.println("stop"); debug = getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS) != null; if (problemKmers == null) { problemKmers = new ArrayList<VKmer>(); if (getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS) != null) { for (String kmer : getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS).split(",")) { problemKmers.add(new VKmer(kmer)); } Node.problemKmers = problemKmers; } } verbose = false; for (VKmer problemKmer : problemKmers) { verbose |= debug && (getVertexValue().getNode().findEdge(problemKmer) != null || getVertexId().equals(problemKmer)); } }</code><technical_language>please commit this kind of stuff (feel free in machine, selective committed!)</technical_language>

Target:
public void checkDebug() { debug = getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS) != null; if (problemKmers == null) { problemKmers = new ArrayList<VKmer>(); if (getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS) != null) { for (String kmer : getContext().getConfiguration().get(GenomixJobConf.DEBUG_KMERS).split(",")) { problemKmers.add(new VKmer(kmer)); } Node.problemKmers = problemKmers; } } verbose = false; for (VKmer problemKmer : problemKmers) { verbose |= debug && (getVertexValue().getNode().findEdge(problemKmer) != null || getVertexId().equals(problemKmer)); } }
Source:
<code>public Optional<String> explainExtras() { <START> final StringBuilder sb = new StringBuilder(); <END> sb.append("METADATA"); if (metadataAlias != null) { sb.append(" FROM "); sb.append(metadataAlias); } if (isVirtual) { sb.append(" VIRTUAL"); } return Optional.of(sb.toString()); }</code><technical_language>Add a single quote metadataAlias</technical_language>

Target:
public Optional<String> explainExtras() { final StringBuilder sb = new StringBuilder(); sb.append("METADATA"); if (metadataAlias != null) { sb.append(" FROM "); sb.append("'"); sb.append(metadataAlias); sb.append("'"); } if (isVirtual) { sb.append(" VIRTUAL"); } return Optional.of(sb.toString()); }
Source:
<code><START> public InDbTimestampBoundStore getStore() { <END> return InDbTimestampBoundStore.create( kvs.getConnectionManager(), AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE, DbkvsPostgresTestSuite.getKvsConfig().ddl().tablePrefix()); }</code><technical_language>Move tests</technical_language>

Target:
public InDbTimestampBoundStore getStore() { return InDbTimestampBoundStore.create( kvs.getConnectionManager(), AtlasDbConstants.TIMESTAMP_TABLE, DbkvsPostgresTestSuite.getKvsConfig().ddl().tablePrefix()); }
Source:
<code>Predicate<Entry<Key,Value>> getScanPredicate() { final Range range = getRange(); <START> return input -> { if (range != null && !range.contains(input.getKey())) return false; return true; }; <END> }</code><technical_language>this simplified to: java return input -> range == null || range.contains(input.getKey());</technical_language>

Target:
Predicate<Entry<Key,Value>> getScanPredicate() { final Range range = getRange(); return input -> range == null || range.contains(input.getKey()); }
Source:
<code>public void testReadValidFile() { Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C1_1, PASSING_CBCL_C2_1), <START> filters, new int[]{2}, 1101, locs, new int[]{1, 2}, false); <END> int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { String actual = new String(new byte[]{bv.bases[cluster][cycle]}); String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }</code><technical_language>a test fails if barcode files found? a test if tiles found? apologies if there</technical_language>

Target:
public void testReadValidFile() { final Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); final LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); final List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C1_1, PASSING_CBCL_C2_1), filters, new int[]{2}, 1101, locs, new int[]{1, 2}, false); int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { final String actual = new String(new byte[]{bv.bases[cluster][cycle]}); final String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }
Source:
<code>public void stream() throws InterruptedException { <START> Runtime.getRuntime().addShutdownHook(new Thread(() -> onShutdown())); <END> streamInternal(new StartingState()); }</code><technical_language>Actually, target of test is function onShutdown. I test if changes in future, a test verify it</technical_language>

Target:
public void stream() throws InterruptedException { Runtime.getRuntime().addShutdownHook(new Thread(() -> onNodeShutdown())); streamInternal(new StartingState()); }
Source:
<code>public boolean sourceStatus(String servicePID) { try { List<Source> sources = helper.getSources(); for (Source source : sources) { if (source instanceof ConfiguredService) { ConfiguredService cs = (ConfiguredService) source; try { Configuration config = helper.getConfiguration(cs); if (config != null && config.getProperties().get("service.pid").equals(servicePID)) { final String sourceId = source.getId(); <START> return sourceIsAvailable(sourceId); <END> } } catch (IOException e) { LOGGER.info("Couldn't find configuration for source '{}'", source.getId()); } } else { LOGGER.info("Source '{}' not a configured service", source.getId()); } } } catch (InvalidSyntaxException e) { LOGGER.info("Could not get service reference list"); } return false; }</code><technical_language>this sourceIsAvailable(source.getId());</technical_language>

Target:
public int sourceStatus(String servicePID) { try { List<Source> sources = helper.getSources(); for (Source source : sources) { if (source instanceof ConfiguredService) { ConfiguredService cs = (ConfiguredService) source; try { Configuration config = helper.getConfiguration(cs); if (config != null && config.getProperties().get("service.pid").equals(servicePID)) { return sourceIsAvailable(source.getId()); } } catch (IOException e) { LOGGER.info("Couldn't find configuration for source '{}'", source.getId()); } } else { LOGGER.info("Source '{}' not a configured service", source.getId()); } } } catch (InvalidSyntaxException e) { LOGGER.info("Could not get service reference list"); } return UNAVAILABLE; }
Source:
<code>public void start() throws StoreException { <START> verifyConfigs(); <END> logger.info("Starting store manager"); for (ReplicaId replica : replicas) { File file = new File(replica.getMountPath()); if (!file.exists()) { throw new IllegalStateException("Mount path does not exist " + replica.getMountPath()); } Store store = new BlobStore(config, scheduler, registry, replica.getReplicaPath(), replica.getCapacityInBytes(), factory, recovery, hardDelete, time); store.start(); stores.put(replica.getPartitionId(), store); } logger.info("Starting store manager complete"); }</code><technical_language>I strongly suggest configs verified in constructor. weird construction of object succeeds accepts config. Failing start is intuitive do config callers point of view</technical_language>

Target:
public void start() throws StoreException { logger.info("Starting store manager"); for (ReplicaId replica : replicas) { File file = new File(replica.getMountPath()); if (!file.exists()) { throw new IllegalStateException("Mount path does not exist " + replica.getMountPath()); } Store store = new BlobStore(config, scheduler, registry, replica.getReplicaPath(), replica.getCapacityInBytes(), factory, recovery, hardDelete, time); store.start(); stores.put(replica.getPartitionId(), store); } logger.info("Starting store manager complete"); }
Source:
<code>public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { String mimeType; try { mimeType = getMimeTypeFromMessage(mail.getMessage()); } catch (MimeTypeParseException e) { mimeType = null; } <START> return (content_types.contains(mimeType)) ? mail.getRecipients() : null; <END> }</code><technical_language>avoid returning null. empty list is :-)</technical_language>

Target:
public Collection<MailAddress> match(Mail mail) throws javax.mail.MessagingException { Optional<String> mimeTypes = getMimeTypeFromMessage(mail.getMessage()); return mimeTypes.filter(acceptedContentTypes::contains) .map(any -> mail.getRecipients()) .orElse(ImmutableList.of()); }
Source:
<code>void execute() throws AzureBlobFileSystemException { String latencyHeader = this.client.getAbfsPerfTracker().getClientLatency(); if (latencyHeader != null && !latencyHeader.isEmpty()) { <START> requestHeaders.add(new AbfsHttpHeader("x-ms-abfs-client-latency", latencyHeader)); <END> } int retryCount = 0; while (!executeHttpOperation(retryCount++)) { try { Thread.sleep(client.getRetryPolicy().getRetryInterval(retryCount)); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } if (result.getStatusCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { throw new AbfsRestOperationException(result.getStatusCode(), result.getStorageErrorCode(), result.getStorageErrorMessage(), null, result); } }</code><technical_language>String constants? Extract header too</technical_language>

Target:
void execute() throws AzureBlobFileSystemException { String latencyHeader = this.client.getAbfsPerfTracker().getClientLatency(); if (latencyHeader != null && !latencyHeader.isEmpty()) { AbfsHttpHeader httpHeader = new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_ABFS_CLIENT_LATENCY, latencyHeader); requestHeaders.add(httpHeader); } int retryCount = 0; while (!executeHttpOperation(retryCount++)) { try { Thread.sleep(client.getRetryPolicy().getRetryInterval(retryCount)); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } if (result.getStatusCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { throw new AbfsRestOperationException(result.getStatusCode(), result.getStorageErrorCode(), result.getStorageErrorMessage(), null, result); } }
Source:
<code>public void shouldCallAdviceForAnnotatedBean() throws Throwable { this.annotatedTestBean.testMethod(); List<Span> spans = new ArrayList<>(this.accumulator.getSpans()); <START> then(new ListOfSpans(spans)).hasSize(1).hasASpanWithName("testMethod"); <END> then(ExceptionUtils.getLastException()).isNull(); }</code><technical_language>Hm yes. idea get created spans :D</technical_language>

Target:
public void shouldCallAdviceForAnnotatedBean() throws Throwable { this.annotatedTestBean.testMethod(); List<Span> spans = new ArrayList<>(this.accumulator.getSpans()); then(new ListOfSpans(spans)).hasSize(1).hasASpanWithName("test-method"); then(ExceptionUtils.getLastException()).isNull(); }
Source:
<code>public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params) { if ((lastKillTime + period) < System.currentTimeMillis()) { lastKillTime = System.currentTimeMillis(); DatasourceWhitelist whitelist = whitelistRef.get(); for (DruidDataSource dataSource : params.getDataSources()) { if (whitelist == null || whitelist.contains(dataSource.getName())) { <START> indexingServiceClient.killSegments(dataSource.getName(), UBER_INTERVAL); <END> } } } return params; }</code><technical_language>This block datasource. If fails post for reason, attempt other kill tasks. calls helper.run catch exceptions helper either, failure in helper others fail. catch errors killSegments submission datasource here</technical_language>

Target:
public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params) { Set<String> whitelist = params.getCoordinatorDynamicConfig().getKillDataSourceWhitelist(); if (whitelist != null && whitelist.size() > 0 && (lastKillTime + period) < System.currentTimeMillis()) { lastKillTime = System.currentTimeMillis(); for (String dataSource : whitelist) { final Interval intervalToKill = findIntervalForKillTask(dataSource, maxSegmentsToKill); if (intervalToKill != null) { try { indexingServiceClient.killSegments(dataSource, intervalToKill); } catch (Exception ex) { log.error(ex, "Failed to submit kill task for dataSource [%s]", dataSource); if (Thread.currentThread().isInterrupted()) { log.warn("skipping kill task scheduling because thread is interrupted."); break; } } } } } return params; }
Source:
<code>public StreamingPropertyValueRef put(String elementId, String key, String name, Visibility visibility, long timestamp, StreamingPropertyValue value) { StreamAndLength streamAndLength = streamAndLength(value.getInputStream(), value.getLength()); String id = makeId(elementId, key, name, visibility, timestamp); try (Handle handle = dbi.open()) { int count = handle.createQuery(String.format( "select count(*) from %s where %s = ?", tableName, KEY_COLUMN_NAME)) .bind(0, id) .map(IntegerMapper.FIRST) .first(); if (count == 0) { handle.execute(String.format( "insert into %s (%s, %s, %s, %s) values (?, ?, ?, ?)", tableName, KEY_COLUMN_NAME, VALUE_COLUMN_NAME, VALUE_TYPE_COLUMN_NAME, VALUE_LENGTH_COLUMN_NAME), id, streamAndLength.inputStream, value.getValueType().getName(), streamAndLength.length); } else { handle.execute(String.format( "update %s set %s = ?, %s = ? where %s = ?", tableName, VALUE_COLUMN_NAME, VALUE_LENGTH_COLUMN_NAME, KEY_COLUMN_NAME), streamAndLength.inputStream, streamAndLength.length, id); } return new SqlStreamingPropertyValueRef(value, elementId, key, name, visibility, timestamp); } finally { try { streamAndLength.inputStream.close(); } catch (IOException ex) { <START> Throwables.propagate(ex); <END> } } }</code><technical_language>throw a VertexiumException instead a message "could close input stream". a fan of Throwables.propagate end a raw RuntimeException</technical_language>

Target:
public StreamingPropertyValueRef put(String elementId, String key, String name, Visibility visibility, long timestamp, StreamingPropertyValue value) { StreamAndLength streamAndLength = streamAndLength(value.getInputStream(), value.getLength()); String id = makeId(elementId, key, name, visibility, timestamp); try (Handle handle = dbi.open()) { int count = handle.createQuery(String.format( "select count(*) from %s where %s = ?", tableName, KEY_COLUMN_NAME)) .bind(0, id) .map(IntegerMapper.FIRST) .first(); if (count == 0) { handle.execute(String.format( "insert into %s (%s, %s, %s, %s) values (?, ?, ?, ?)", tableName, KEY_COLUMN_NAME, VALUE_COLUMN_NAME, VALUE_TYPE_COLUMN_NAME, VALUE_LENGTH_COLUMN_NAME), id, streamAndLength.inputStream, value.getValueType().getName(), streamAndLength.length); } else { handle.execute(String.format( "update %s set %s = ?, %s = ? where %s = ?", tableName, VALUE_COLUMN_NAME, VALUE_LENGTH_COLUMN_NAME, KEY_COLUMN_NAME), streamAndLength.inputStream, streamAndLength.length, id); } return new SqlStreamingPropertyValueRef(value, elementId, key, name, visibility, timestamp); } finally { try { streamAndLength.inputStream.close(); } catch (IOException ex) { throw new VertexiumException(ex); } } }
Source:
<code>private static Color createColor(String symbolicName) { IPreferenceStore store = getPreferenceStore(); RGB rgb = null; if (store.contains(symbolicName)) { <START> if (store.isDefault(symbolicName)) rgb = PreferenceConverter.getDefaultColor(store, symbolicName); else rgb = PreferenceConverter.getColor(store, symbolicName); <END> if (rgb != null) { JFaceResources.getColorRegistry().put(symbolicName, rgb); return JFaceResources.getColorRegistry().get(symbolicName); } } return null; }</code><technical_language>if/else {}!! Please add braces</technical_language>

Target:
private static Color createColor(String symbolicName) { IPreferenceStore store = getPreferenceStore(); if (store.contains(symbolicName)) { RGB rgb = (store.isDefault(symbolicName)) ? PreferenceConverter.getDefaultColor(store, symbolicName) : PreferenceConverter.getColor(store, symbolicName); if (null != rgb) { JFaceResources.getColorRegistry().put(symbolicName, rgb); return JFaceResources.getColorRegistry().get(symbolicName); } } return null; }
Source:
<code>private void mapProject(final IProject source, final IProjectDescription description, final IProgressMonitor monitor, IPath gitDir) throws CoreException, TeamException { IProject destination = source.getWorkspace().getRoot() .getProject(description.getName()); RepositoryMapping repositoryMapping = RepositoryMapping.create(destination, gitDir.toFile()); if (repositoryMapping != null) { GitProjectData projectData = new GitProjectData(destination); projectData.setRepositoryMappings(Arrays.asList(repositoryMapping)); projectData.store(); GitProjectData.add(destination, projectData); RepositoryProvider.map(destination, GitProvider.class.getName()); destination.refreshLocal(IResource.DEPTH_INFINITE, <START> SubMonitor.convert(monitor, 50)); <END> } }</code><technical_language>this is place this method monitor all, pass through. callers properly SubMonitor.convert() newChild() appropriate</technical_language>

Target:
private void mapProject(final IProject source, final IProjectDescription description, final IProgressMonitor monitor, IPath gitDir) throws CoreException, TeamException { IProject destination = source.getWorkspace().getRoot() .getProject(description.getName()); RepositoryMapping repositoryMapping = RepositoryMapping.create(destination, gitDir.toFile()); if (repositoryMapping != null) { GitProjectData projectData = new GitProjectData(destination); projectData.setRepositoryMappings(Arrays.asList(repositoryMapping)); projectData.store(); GitProjectData.add(destination, projectData); RepositoryProvider.map(destination, GitProvider.class.getName()); destination.refreshLocal(IResource.DEPTH_INFINITE, monitor); } }
Source:
<code>private void updateSmudgedEntries() throws IOException { TreeWalk walk = new TreeWalk(repository); <START> List<String> pathes = new ArrayList<String>(128); <END> try { for (int i = 0; i < entryCnt; i++) if (sortedEntries[i].isSmudged()) pathes.add(sortedEntries[i].getPathString()); if (pathes.isEmpty()) return; walk.setFilter(PathFilterGroup.createFromStrings(pathes)); DirCacheIterator iIter = new DirCacheIterator(this); FileTreeIterator fIter = new FileTreeIterator(repository); walk.addTree(iIter); walk.addTree(fIter); walk.setRecursive(true); while (walk.next()) { iIter = walk.getTree(0, DirCacheIterator.class); if (iIter == null) continue; fIter = walk.getTree(1, FileTreeIterator.class); if (fIter == null) continue; DirCacheEntry entry = iIter.getDirCacheEntry(); if (entry.isSmudged() && iIter.idEqual(fIter)) { entry.setLength(fIter.getEntryLength()); entry.setLastModified(fIter.getEntryLastModified()); } } } finally { walk.release(); } }</code><technical_language>paths instead of pathes</technical_language>

Target:
private void updateSmudgedEntries() throws IOException { TreeWalk walk = new TreeWalk(repository); List<String> paths = new ArrayList<String>(128); try { for (int i = 0; i < entryCnt; i++) if (sortedEntries[i].isSmudged()) paths.add(sortedEntries[i].getPathString()); if (paths.isEmpty()) return; walk.setFilter(PathFilterGroup.createFromStrings(paths)); DirCacheIterator iIter = new DirCacheIterator(this); FileTreeIterator fIter = new FileTreeIterator(repository); walk.addTree(iIter); walk.addTree(fIter); walk.setRecursive(true); while (walk.next()) { iIter = walk.getTree(0, DirCacheIterator.class); if (iIter == null) continue; fIter = walk.getTree(1, FileTreeIterator.class); if (fIter == null) continue; DirCacheEntry entry = iIter.getDirCacheEntry(); if (entry.isSmudged() && iIter.idEqual(fIter)) { entry.setLength(fIter.getEntryLength()); entry.setLastModified(fIter.getEntryLastModified()); } } } finally { walk.release(); } }
Source:
<code>public boolean isValidVariableName(final String source) { <START> return FEELParser.checkVariableName(source).isEmpty(); <END> }</code><technical_language>I FEELParser.isVariableNameValid(source) is implemented DMNValidationServiceImpl.isVariableNameValid(source)</technical_language>

Target:
public boolean isValidVariableName(final String source) { return FEELParser.isVariableNameValid(source); }
Source:
<code>public void offsetSerDeTest() throws IOException { String name = UtilsTest.getRandomString(10); long offset = Utils.getRandomLong(new Random(), Long.MAX_VALUE); Offset logOffset = new Offset(name, offset); byte[] serialized = logOffset.toBytes(); Offset deserializedOffset = Offset.fromBytes(new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(serialized)))); assertEquals("Original offset 'name' does not match with the deserialized offset", logOffset.getName(), deserializedOffset.getName()); <START> assertEquals("Original offset 'offset' does not match with the deserialized offset", logOffset.getName(), <END> deserializedOffset.getName()); assertEquals("Original offset does not match with the deserialized offset", logOffset, deserializedOffset); assertEquals("Hashcode doesn't match", logOffset.hashCode(), deserializedOffset.hashCode()); }</code><technical_language>getOffset()</technical_language>

Target:
public void offsetSerDeTest() throws IOException { String name = UtilsTest.getRandomString(10); long offset = Utils.getRandomLong(new Random(), Long.MAX_VALUE); Offset logOffset = new Offset(name, offset); byte[] serialized = logOffset.toBytes(); Offset deserializedOffset = Offset.fromBytes(new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(serialized)))); assertEquals("Original offset 'name' does not match with the deserialized offset", name, deserializedOffset.getName()); assertEquals("Original offset 'offset' does not match with the deserialized offset", offset, deserializedOffset.getOffset()); assertEquals("Original offset does not match with the deserialized offset", logOffset, deserializedOffset); assertEquals("Hashcode doesn't match", logOffset.hashCode(), deserializedOffset.hashCode()); }
Source:
<code>public String getInvalidityInfoForEmail(String email) { Assumption.assertTrue("Non-null value expected", email != null); String sanitizedValue = SanitizationHelper.sanitizeForHtml(email); if (email.isEmpty()) { <START> return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE_EMPTY_STRING, email, EMAIL_FIELD_NAME, REASON_EMPTY, <END> EMAIL_MAX_LENGTH); } else if (isUntrimmed(email)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", EMAIL_FIELD_NAME); } else if (email.length() > EMAIL_MAX_LENGTH) { return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, REASON_TOO_LONG, EMAIL_MAX_LENGTH); } else if (!StringHelper.isMatching(email, REGEX_EMAIL)) { return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, REASON_INCORRECT_FORMAT, EMAIL_MAX_LENGTH); } return ""; }</code><technical_language>Create a new method populate fields for empty string error messages</technical_language>

Target:
public String getInvalidityInfoForEmail(String email) { Assumption.assertTrue("Non-null value expected", email != null); String sanitizedValue = SanitizationHelper.sanitizeForHtml(email); if (email.isEmpty()) { return getPopulatedEmptyStringErrorMessage(EMAIL_ERROR_MESSAGE_EMPTY_STRING, EMAIL_FIELD_NAME, EMAIL_MAX_LENGTH); } else if (isUntrimmed(email)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", EMAIL_FIELD_NAME); } else if (email.length() > EMAIL_MAX_LENGTH) { return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, REASON_TOO_LONG, EMAIL_MAX_LENGTH); } else if (!StringHelper.isMatching(email, REGEX_EMAIL)) { return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, REASON_INCORRECT_FORMAT, EMAIL_MAX_LENGTH); } return ""; }
Source:
<code>private File guessWorkTreeOrFail() throws IOException { final Config cfg = getConfig(); String path = cfg.getString(CONFIG_CORE_SECTION, null, CONFIG_KEY_WORKTREE); if (path != null) return safeFS().resolve(getGitDir(), path).getCanonicalFile(); if (cfg.getString(CONFIG_CORE_SECTION, null, CONFIG_KEY_BARE) != null) { if (cfg.getBoolean(CONFIG_CORE_SECTION, CONFIG_KEY_BARE, true)) { setBare(); return null; } return getGitDir().getParentFile(); } if (getGitDir().getName().equals(DOT_GIT)) { return getGitDir().getParentFile(); } <START> <END> setBare(); return null; }</code><technical_language>/* * Bug 477475 - git 2.5 worktree support * * Andre Bossert <anb0s@anbos.de> * * <LINK_0> * based at: <LINK_1> * * in .git ($GIT_DIR) folder of worktree * "...\.git\worktrees\<worktree-name>" * want get worktree path * link "gitdir" showing * ".git" file located in worktree * read convert absolute path if relative */ if (getGitDir() != null) { File gitDirFile = new File(getGitDir(), "gitdir"); if (gitDirFile.isFile()) { String workDirPath = new String(IO.readFully(gitDirFile)).trim(); File workTreeDotGitFile = new File(workDirPath); if (!workTreeDotGitFile.isAbsolute()) { workTreeDotGitFile = new File(getGitDir(), workDirPath).getCanonicalFile(); } if (workTreeDotGitFile != null) { return workTreeDotGitFile.getParentFile(); } } }</technical_language>

Target:
private File guessWorkTreeOrFail() throws IOException { final Config cfg = getConfig(); String path = cfg.getString(CONFIG_CORE_SECTION, null, CONFIG_KEY_WORKTREE); if (path != null) return safeFS().resolve(getGitDir(), path).getCanonicalFile(); if (cfg.getString(CONFIG_CORE_SECTION, null, CONFIG_KEY_BARE) != null) { if (cfg.getBoolean(CONFIG_CORE_SECTION, CONFIG_KEY_BARE, true)) { setBare(); return null; } return getGitDir().getParentFile(); } if (getGitDir().getName().equals(DOT_GIT)) { return getGitDir().getParentFile(); } if (getGitDir() != null) { File gitDirFile = new File(getGitDir(), "gitdir"); if (gitDirFile.isFile()) { String workDirPath = new String(IO.readFully(gitDirFile)).trim(); File workTreeDotGitFile = new File(workDirPath); if (!workTreeDotGitFile.isAbsolute()) { workTreeDotGitFile = new File(getGitDir(), workDirPath) .getCanonicalFile(); } if (workTreeDotGitFile != null) { return workTreeDotGitFile.getParentFile(); } } } setBare(); return null; }
Source:
<code>public void onDisable() { <START> this.getServer().getMessenger().unregisterIncomingPluginChannel(this, "vanishStatus"); <END> this.getServer().getMessenger().unregisterOutgoingPluginChannel(this, "vanishStatus"); for (final Player player : VanishPlugin.this.getServer().getOnlinePlayers()) { if (player != null) { if (this.manager.isVanished(player)) { player.sendMessage(ChatColor.DARK_AQUA + "[Vanish] You have been forced visible by a reload."); } } } VanishNoPacket.setInstance(null); this.hookManager.onDisable(); this.manager.onPluginDisable(); this.getServer().getScheduler().cancelTasks(this); Debuggle.nah(); this.getLogger().info("v${project.version} unloaded."); }</code><technical_language>Unnecessary. Channels unregistered disable. reason unregister events</technical_language>

Target:
public void onDisable() { for (final Player player : VanishPlugin.this.getServer().getOnlinePlayers()) { if (player != null) { if (this.manager.isVanished(player)) { player.sendMessage(ChatColor.DARK_AQUA + "[Vanish] You have been forced visible by a reload."); } } } VanishNoPacket.setInstance(null); this.hookManager.onDisable(); this.manager.onPluginDisable(); this.getServer().getScheduler().cancelTasks(this); Debuggle.nah(); this.getLogger().info("v${project.version} unloaded."); }
Source:
<code><START> public DataTable transpose() { <END> List<List<String>> transposed = new ArrayList<List<String>>(); for (int i = 0; i < gherkinRows.size(); i++) { Row gherkinRow = gherkinRows.get(i); for (int j = 0; j < gherkinRow.getCells().size(); j++) { List<String> row = null; if (j < transposed.size()) { row = transposed.get(j); } if (row == null) { row = new ArrayList<String>(); transposed.add(row); } while (i > row.size()) { row.add(new String()); } row.add(gherkinRow.getCells().get(j)); } } return new DataTable(this.gherkinRows, transposed, this.tableConverter); }</code><technical_language>coding conventions in CONTRIBUTING.md</technical_language>

Target:
public DataTable transpose() { List<List<String>> transposed = new ArrayList<List<String>>(); for (int i = 0; i < gherkinRows.size(); i++) { Row gherkinRow = gherkinRows.get(i); for (int j = 0; j < gherkinRow.getCells().size(); j++) { List<String> row = null; if (j < transposed.size()) { row = transposed.get(j); } if (row == null) { row = new ArrayList<String>(); transposed.add(row); } row.add(gherkinRow.getCells().get(j)); } } return new DataTable(this.gherkinRows, transposed, this.tableConverter); }
Source:
<code>protected CommunicationGroup createAndStoreGroup(final Node representative, final int index) { final boolean isSingleton = sccInformationProvider.sccs.getPartition(representative).size() == 1; final boolean isReceiver = representative instanceof Receiver; <START> final boolean isDefault = isReceiver && ((Receiver) representative).getMailbox() instanceof AdaptiveMailbox; <END> final boolean isInDREDMode = representative instanceof RederivableNode && ((RederivableNode) representative).isInDREDMode(); CommunicationGroup group = null; if (isSingleton && (isDefault || !isReceiver) && !isInDREDMode) { group = new CommunicationGroup.Singleton(this, representative, index); } else { group = new CommunicationGroup.Recursive(this, representative, index); } addToGroup(representative, group); return group; }</code><technical_language>need a term "default" - poset-indifferent</technical_language>

Target:
protected CommunicationGroup createAndStoreGroup(final Node representative, final int index) { final boolean isSingleton = sccInformationProvider.sccs.getPartition(representative).size() == 1; final boolean isReceiver = representative instanceof Receiver; final boolean isPosetIndifferent = isReceiver && ((Receiver) representative).getMailbox() instanceof AdaptiveMailbox; final boolean isInDRedMode = representative instanceof RederivableNode && ((RederivableNode) representative).isInDRedMode(); CommunicationGroup group = null; if (isSingleton && (isPosetIndifferent || !isReceiver) && !isInDRedMode) { group = new CommunicationGroup.Singleton(this, representative, index); } else { group = new CommunicationGroup.Recursive(this, representative, index); } addToGroup(representative, group); return group; }
Source:
<code>public void required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError() throws Throwable { optionalMultipleSubscribersTest(2, new Function<Long,TestSetup>() { @Override public TestSetup apply(Long aLong) throws Throwable { return new TestSetup(env, processorBufferSize) {{ final ManualSubscriberWithErrorCollection<T> sub1 = new ManualSubscriberWithErrorCollection<T>(env); env.subscribe(processor, sub1); final ManualSubscriberWithErrorCollection<T> sub2 = new ManualSubscriberWithErrorCollection<T>(env); env.subscribe(processor, sub2); final Exception ex = new RuntimeException("Test exception"); if (doesCoordinatedEmission()) { sub1.request(1); sub2.request(1); final T x = sendNextTFromUpstream(); expectNextElement(sub1, x); expectNextElement(sub2, x); sub1.request(1); sub2.request(1); <START> sendError(ex); <END> } else { sub1.request(1); expectRequest(); final T x = sendNextTFromUpstream(); expectNextElement(sub1, x); sub1.request(1); sendError(ex); } sub1.expectError(ex); sub2.expectError(ex); env.verifyNoAsyncErrorsNoDelay(); }}; } }); }</code><technical_language>put sendError(ex); branch (since is statement in "leg" of branch</technical_language>

Target:
public void required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError() throws Throwable { optionalMultipleSubscribersTest(2, new Function<Long,TestSetup>() { @Override public TestSetup apply(Long aLong) throws Throwable { return new TestSetup(env, processorBufferSize) {{ final ManualSubscriberWithErrorCollection<T> sub1 = new ManualSubscriberWithErrorCollection<T>(env); env.subscribe(processor, sub1); final ManualSubscriberWithErrorCollection<T> sub2 = new ManualSubscriberWithErrorCollection<T>(env); env.subscribe(processor, sub2); final Exception ex = new RuntimeException("Test exception"); if (doesCoordinatedEmission()) { sub1.request(1); sub2.request(1); expectRequest(); final T x = sendNextTFromUpstream(); expectNextElement(sub1, x); expectNextElement(sub2, x); sub1.request(1); sub2.request(1); } else { sub1.request(1); expectRequest(env.defaultTimeoutMillis(), "If the Processor coordinates requests/emissions when having multiple Subscribers" + " at once, please override doesCoordinatedEmission() to return true in this " + "IdentityProcessorVerification to allow this test to pass."); final T x = sendNextTFromUpstream(); expectNextElement(sub1, x, "If the Processor coordinates requests/emissions when having multiple Subscribers" + " at once, please override doesCoordinatedEmission() to return true in this " + "IdentityProcessorVerification to allow this test to pass."); sub1.request(1); } sendError(ex); sub1.expectError(ex); sub2.expectError(ex); env.verifyNoAsyncErrorsNoDelay(); }}; } }); }
Source:
<code>boolean isTscFrequencyNeeded() { return vm.getClusterArch().getFamily().equals(ArchitectureType.x86) && vm.getVmType().equals(VmType.HighPerformance) <START> && vm.getMigrationSupport() == MigrationSupport.MIGRATABLE; <END> }</code><technical_language>actually, I if this is right approach. +invtsc require fixed TSC. is a new constraint. limiting is, I if a usecase for +invtsc for non-migratable VMs (e.g. guest SAP HANA is for flag). sense add a checkbox for - checked default for HP VMs</technical_language>

Target:
boolean isTscFrequencyNeeded() { return vm.getClusterArch().getFamily().equals(ArchitectureType.x86) && vm.getVmType().equals(VmType.HighPerformance) && vm.getMigrationSupport() == MigrationSupport.MIGRATABLE && cpuFlagsSupplier.get().contains("nonstop_tsc"); }
Source:
<code>public static void main(String[] args) throws Exception { List<ObjectName> objectNames = new LinkedList<ObjectName>(); objectNames.add(null); if (args.length > 0) { <START> new JmxScraper(args[0], args[1], args[2], objectNames, new LinkedList<ObjectName>(), new StdoutWriter()).doScrape(); <END> } else { new JmxScraper("", "", "", objectNames, new LinkedList<ObjectName>(), new StdoutWriter()).doScrape(); } }</code><technical_language>This fail out of bounds if argument</technical_language>

Target:
public static void main(String[] args) throws Exception { List<ObjectName> objectNames = new LinkedList<ObjectName>(); objectNames.add(null); if (args.length > 0){ new JmxScraper(args[0], "", "", objectNames, new LinkedList<ObjectName>(), new StdoutWriter()).doScrape(); } else if (args.length >= 3){ new JmxScraper(args[0], args[1], args[2], objectNames, new LinkedList<ObjectName>(), new StdoutWriter()).doScrape(); } else { new JmxScraper("", "", "", objectNames, new LinkedList<ObjectName>(), new StdoutWriter()).doScrape(); } }
Source:
<code>public CTFStreamInputReader(CTFStreamInput streamInput) throws CTFException { fStreamInput = streamInput; fFile = fStreamInput.getFile(); try { <START> fFileChannel = NonNullUtils.checkNotNull(FileChannel.open(fFile.toPath(), StandardOpenOption.READ)); <END> } catch (IOException e) { throw new CTFIOException(e); } try { fPacketReader = new CTFStreamInputPacketReader(this); fPacketIndex = 0; goToNextPacket(); } catch (Exception e) { try { close(); } catch (IOException e1) { } throw e; } }</code><technical_language>checkNotNull needed</technical_language>

Target:
public CTFStreamInputReader(CTFStreamInput streamInput) throws CTFException { fStreamInput = streamInput; fFile = fStreamInput.getFile(); try { fFileChannel = FileChannel.open(fFile.toPath(), StandardOpenOption.READ); } catch (IOException e) { throw new CTFIOException(e); } try { fPacketReader = new CTFStreamInputPacketReader(this); fPacketIndex = 0; goToNextPacket(); } catch (Exception e) { try { close(); } catch (IOException e1) { } throw e; } }