auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void getProductRequirements(String product, Collection<String> requiredIds) { PDEExtensionRegistry registry = PDECore.getDefault().getExtensionsRegistry(); IExtension[] extensions = registry.findExtensions("org.eclipse.core.runtime.products", true); for (IExtension extension : extensions) { if (product.equals(extension.getUniqueIdentifier()) || product.equals(extension.getSimpleIdentifier())) { <START> requiredIds.add(extension.getNamespaceIdentifier()); <END> IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { String application = element.getAttribute("application"); if (application != null && application.length() > 0) { getApplicationRequirements(application, requiredIds); } } break; } } }</code><technical_language>this is error</technical_language>

Target:
private static void getProductRequirements(String product, Collection<String> requiredIds) { PDEExtensionRegistry registry = PDECore.getDefault().getExtensionsRegistry(); IExtension[] extensions = registry.findExtensions("org.eclipse.core.runtime.products", true); for (IExtension extension : extensions) { if (product.equals(extension.getUniqueIdentifier()) || product.equals(extension.getSimpleIdentifier())) { requiredIds.add(extension.getContributor().getName()); IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { String application = element.getAttribute("application"); if (application != null && application.length() > 0) { getApplicationRequirements(application, requiredIds); } } break; } } }
Source:
<code>void updateRestored(final Collection<TopicPartition> restored) { if (restored.isEmpty()) { return; } log.trace("Stream task changelog partitions that have completed restoring so far: {}", restored); restoredPartitions.addAll(restored); for (final Iterator<Map.Entry<TaskId, StreamTask>> it = restoring.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<TaskId, StreamTask> entry = it.next(); final StreamTask task = entry.getValue(); if (restoredPartitions.containsAll(task.changelogPartitions())) { transitionToRunning(task); it.remove(); restoringByPartition.keySet().removeAll(task.partitions()); restoringByPartition.keySet().removeAll(task.changelogPartitions()); log.debug("Stream task completed restoration as all its changelog partitions have been applied to restore state", task.id(), task.changelogPartitions()); } else { if (log.isTraceEnabled()) { final HashSet<TopicPartition> outstandingPartitions = new HashSet<>(task.changelogPartitions()); outstandingPartitions.removeAll(restoredPartitions); log.trace("Stream task cannot resume processing yet since some of its changelog partitions have not completed restoring: {}", task.id(), outstandingPartitions); } } } if (allTasksRunning()) { restoredPartitions.clear(); restoringByPartition.clear(); <START> restoring.clear(); <END> } }</code><technical_language>is this necessary? In for loop above, partition finished restoring removed vai it.remove(); -- hence, if allTasksRunning() return true restoring empty ? Similar for restoringByPartition new lines this PR adds</technical_language>

Target:
void updateRestored(final Collection<TopicPartition> restored) { if (restored.isEmpty()) { return; } log.trace("Stream task changelog partitions that have completed restoring so far: {}", restored); restoredPartitions.addAll(restored); for (final Iterator<Map.Entry<TaskId, StreamTask>> it = restoring.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<TaskId, StreamTask> entry = it.next(); final StreamTask task = entry.getValue(); if (restoredPartitions.containsAll(task.changelogPartitions())) { transitionToRunning(task); it.remove(); restoringByPartition.keySet().removeAll(task.partitions()); restoringByPartition.keySet().removeAll(task.changelogPartitions()); log.debug("Stream task completed restoration as all its changelog partitions have been applied to restore state", task.id(), task.changelogPartitions()); } else { if (log.isTraceEnabled()) { final HashSet<TopicPartition> outstandingPartitions = new HashSet<>(task.changelogPartitions()); outstandingPartitions.removeAll(restoredPartitions); log.trace("Stream task cannot resume processing yet since some of its changelog partitions have not completed restoring: {}", task.id(), outstandingPartitions); } } } if (allTasksRunning()) { restoredPartitions.clear(); if (!restoringByPartition.isEmpty()) { log.error("Finished restoring all tasks but found leftover partitions in restoringByPartition: {}", restoringByPartition); throw new IllegalStateException("Restoration is complete but not all partitions were cleared."); } } }
Source:
<code>private boolean isStudentContentCorrect(WebElement studentRow, StudentAttributes student) { String actualDetails = studentRow.findElement(By.xpath("td[2]")).getText(); String actualName = studentRow.findElement(By.xpath("td[3]")).getText(); String actualGoogleId = studentRow.findElement(By.xpath("td[4]")).getText(); String actualComment = studentRow.findElement(By.xpath("td[5]")).getText(); String expectedDetails = student.course + "\n" <START> + (student.section == null ? "None" : student.section) + "\n" <END> + student.team; String expectedName = student.name; String expectedGoogleId = StringHelper.convertToEmptyStringIfNull(student.googleId); String expectedComment = StringHelper.convertToEmptyStringIfNull(student.comments); return actualDetails.equals(expectedDetails) && actualName.equals(expectedName) && actualGoogleId.equals(expectedGoogleId) && actualComment.equals(expectedComment); }</code><technical_language>Replace "None" constant Const</technical_language>

Target:
private boolean isStudentContentCorrect(WebElement studentRow, StudentAttributes student) { String actualDetails = studentRow.findElement(By.xpath("td[2]")).getText(); String actualName = studentRow.findElement(By.xpath("td[3]")).getText(); String actualGoogleId = studentRow.findElement(By.xpath("td[4]")).getText(); String actualComment = studentRow.findElement(By.xpath("td[5]")).getText(); String expectedDetails = student.course + "\n" + (student.section == null ? Const.DEFAULT_SECTION : student.section) + "\n" + student.team; String expectedName = student.name; String expectedGoogleId = StringHelper.convertToEmptyStringIfNull(student.googleId); String expectedComment = StringHelper.convertToEmptyStringIfNull(student.comments); return actualDetails.equals(expectedDetails) && actualName.equals(expectedName) && actualGoogleId.equals(expectedGoogleId) && actualComment.equals(expectedComment); }
Source:
<code><START> public void setQualityGate(QualityGate g) { <END> requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = Optional.of(g); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this null-check of "Optional". [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public void setQualityGate(QualityGate g) { requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = g; }
Source:
<code>public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(TOPIC); options.add(TOPIC_PATTERN); options.add(PROPS_GROUP_ID); options.add(SCAN_STARTUP_MODE); options.add(SCAN_STARTUP_SPECIFIC_OFFSETS); options.add(SCAN_TOPIC_PARTITION_DISCOVERY); options.add(SCAN_STARTUP_TIMESTAMP_MILLIS); <START> options.add(SCAN_TOPIC_PARTITION_DISCOVERY); <END> options.add(SINK_PARTITIONER); options.add(SINK_SEMANTIC); return options; }</code><technical_language>duplicate</technical_language>

Target:
public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(TOPIC); options.add(TOPIC_PATTERN); options.add(PROPS_GROUP_ID); options.add(SCAN_STARTUP_MODE); options.add(SCAN_STARTUP_SPECIFIC_OFFSETS); options.add(SCAN_TOPIC_PARTITION_DISCOVERY); options.add(SCAN_STARTUP_TIMESTAMP_MILLIS); options.add(SINK_PARTITIONER); options.add(SINK_SEMANTIC); return options; }
Source:
<code>public static ClassReader classReaderFor(final byte[] b) { final byte[] originalVersion = new byte[] { b[4], b[5], b[6], b[7] }; <START> if (b[6] == 0x00 && b[7] == 0x39) { <END> b[4] = (byte) (Opcodes.V12 >>> 24); b[5] = (byte) (Opcodes.V12 >>> 16); b[6] = (byte) (Opcodes.V12 >>> 8); b[7] = (byte) Opcodes.V12; } final ClassReader classReader = new ClassReader(b); System.arraycopy(originalVersion, 0, b, 4, originalVersion.length); return classReader; }</code><technical_language>Magic number? intend more clear Opcodes.V12 + 1</technical_language>

Target:
public static ClassReader classReaderFor(final byte[] b) { final int originalVersion = getMajorVersion(b); if (originalVersion == Opcodes.V12 + 1) { setMajorVersion(Opcodes.V12, b); } final ClassReader classReader = new ClassReader(b); setMajorVersion(originalVersion, b); return classReader; }
Source:
<code>private String sourceEvents() throws Exception { MetaStoreEventSourcer defaultSourcer = null; String inputFilename = null; String lastEventsIdFile = FileUtils.DEFAULT_EVENT_STORE_PATH + File.separator <START> + inputOptions.getJobName() + "/" + inputOptions.getJobName() + ".id"; <END> Map<String, Long> lastEventsIdMap = getLastDBTableEvents(new Path(lastEventsIdFile)); try { HCatClient sourceMetastoreClient = HiveMetastoreUtils.initializeHiveMetaStoreClient( inputOptions.getSourceMetastoreUri(), inputOptions.getSourceMetastoreKerberosPrincipal(), inputOptions.getSourceHive2KerberosPrincipal()); defaultSourcer = new MetaStoreEventSourcer(sourceMetastoreClient, new DefaultPartitioner(drStore, eventSoucerUtil), eventSoucerUtil, lastEventsIdMap); inputFilename = defaultSourcer.sourceEvents(inputOptions); } finally { if (defaultSourcer != null) { defaultSourcer.cleanUp(); } } return inputFilename; }</code><technical_language>a format issue code change? File.separator instead of "/"</technical_language>

Target:
private String sourceEvents() throws Exception { MetaStoreEventSourcer defaultSourcer = null; String inputFilename = null; String lastEventsIdFile = FileUtils.DEFAULT_EVENT_STORE_PATH + File.separator + inputOptions.getJobName() + File.separator + inputOptions.getJobName() + ".id"; Map<String, Long> lastEventsIdMap = getLastDBTableEvents(new Path(lastEventsIdFile)); try { HCatClient sourceMetastoreClient = HiveMetastoreUtils.initializeHiveMetaStoreClient( inputOptions.getSourceMetastoreUri(), inputOptions.getSourceMetastoreKerberosPrincipal(), inputOptions.getSourceHive2KerberosPrincipal()); defaultSourcer = new MetaStoreEventSourcer(sourceMetastoreClient, new DefaultPartitioner(drStore, eventSoucerUtil), eventSoucerUtil, lastEventsIdMap); inputFilename = defaultSourcer.sourceEvents(inputOptions); } finally { if (defaultSourcer != null) { defaultSourcer.cleanUp(); } } return inputFilename; }
Source:
<code>public boolean processInvalidUrl(final WebView view, String url) { final String methodName = ":processInvalidUrl"; if (isBrokerRequest(getIntent()) && url.startsWith(AuthenticationConstants.Broker.REDIRECT_PREFIX)) { Logger.e(TAG + methodName, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl), "", ADALError.DEVELOPER_REDIRECTURI_INVALID); returnError(ADALError.DEVELOPER_REDIRECTURI_INVALID, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl)); view.stopLoading(); return true; } else if (url.startsWith("about:blank")) { Logger.v(TAG, "It is an blank page request"); return true; <START> } else if(!url.toLowerCase(Locale.US).startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX)){ <END> Logger.e(TAG + methodName, "The webview was redirected to an unsafe URL.", "", ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED); returnError(ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED, "The webview was redirected to an unsafe URL."); view.stopLoading(); return true; } else { return false; } }</code><technical_language>I a new method i.e. boolean isValidRedicectUrl(final String url) { return url.toLowerCase(Locale.US) .startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX) || url.equalsIgnoreCase("about:blank"); }</technical_language>

Target:
public boolean processInvalidUrl(final WebView view, String url) { final String methodName = ":processInvalidUrl"; if (isBrokerRequest(getIntent()) && url.startsWith(AuthenticationConstants.Broker.REDIRECT_PREFIX)) { Logger.e(TAG + methodName, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl), "", ADALError.DEVELOPER_REDIRECTURI_INVALID); returnError(ADALError.DEVELOPER_REDIRECTURI_INVALID, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl)); view.stopLoading(); return true; } else if (url.toLowerCase(Locale.US).equals("about:blank")) { Logger.v(TAG, "It is an blank page request"); return true; } else if (!url.toLowerCase(Locale.US).startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX)) { Logger.e(TAG + methodName, "The webview was redirected to an unsafe URL.", "", ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED); returnError(ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED, "The webview was redirected to an unsafe URL."); view.stopLoading(); return true; } else { return false; } }
Source:
<code>public LocalPageStore(LocalPageStoreOptions options) throws IOException { mRoot = options.getRootDir(); mPageSize = options.getPageSize(); Path rootDir = Paths.get(mRoot); mPagePattern = Pattern.compile( String.format("%s/%d/(\\d+)/(\\d+)", Pattern.quote(rootDir.toString()), mPageSize)); try { boolean invalidPage = false; if (Files.exists(rootDir)) { <START> try (Stream<Path> pathStream = Files.walk(rootDir).filter(Files::isRegularFile)) { <END> invalidPage = pathStream.anyMatch(path -> { if (getPageId(path) == null) { LOG.warn("Invalid page path {}", path); return true; } try { mBytes.getAndAdd(Files.size(path)); } catch (IOException e) { LOG.warn("Fail to get file size {}", e.toString()); } mSize.incrementAndGet(); return false; }); } } if (invalidPage || mBytes.get() > options.getCacheSize()) { LOG.warn("Cannot recover from cached data: {}", invalidPage ? "Invalid page file found" : "Cached data size exceeded configured value"); FileUtils.cleanDirectory(new File(mRoot)); mSize.set(0); mBytes.set(0); } } catch (IOException e) { throw new IOException(String.format("can't initialize page store at %s", mRoot), e); } }</code><technical_language>Do mind filter of try? (See #getPages)</technical_language>

Target:
public LocalPageStore(LocalPageStoreOptions options) throws IOException { mRoot = options.getRootDir(); mPageSize = options.getPageSize(); Path rootDir = Paths.get(mRoot); mPagePattern = Pattern.compile( String.format("%s/%d/(\\d+)/(\\d+)", Pattern.quote(rootDir.toString()), mPageSize)); try { boolean invalidPage = false; if (Files.exists(rootDir)) { try (Stream<Path> stream = Files.walk(rootDir)) { invalidPage = stream .filter(Files::isRegularFile) .anyMatch(path -> { if (getPageId(path) == null) { LOG.warn("Invalid page path {}", path); return true; } try { mBytes.getAndAdd(Files.size(path)); } catch (IOException e) { LOG.warn("Fail to get file size {}", e.toString()); } mSize.incrementAndGet(); return false; }); } } if (invalidPage || mBytes.get() > options.getCacheSize()) { LOG.warn("Cannot recover from cached data: {}", invalidPage ? "Invalid page file found" : "Cached data size exceeded configured value"); FileUtils.cleanDirectory(new File(mRoot)); mSize.set(0); mBytes.set(0); } } catch (IOException e) { throw new IOException(String.format("can't initialize page store at %s", mRoot), e); } }
Source:
<code>public void send(EntityRef entity, Event event, Component component) { if (Thread.currentThread() != mainThread) { pendingEvents.offer(new PendingEvent(entity, event, component)); } else { SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(event.getClass()); if (handlers != null) { List<EventHandlerInfo> eventHandlers = Lists.newArrayList(handlers.get(component.getClass())); Collections.sort(eventHandlers, priorityComparator); eventHandlers.stream().filter(eventHandler -> eventHandler.isValidFor(entity)).forEach(eventHandler -> { eventHandler.invoke(entity, event); <START> }); <END> } } }</code><technical_language>This method is called often. I leave code as-is, I simple iteration is more performant conversion lambda-based filtering</technical_language>

Target:
public void send(EntityRef entity, Event event, Component component) { if (Thread.currentThread() != mainThread) { pendingEvents.offer(new PendingEvent(entity, event, component)); } else { SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(event.getClass()); if (handlers != null) { List<EventHandlerInfo> eventHandlers = Lists.newArrayList(handlers.get(component.getClass())); Collections.sort(eventHandlers, priorityComparator); for (EventHandlerInfo eventHandler : eventHandlers) { if (eventHandler.isValidFor(entity)) { eventHandler.invoke(entity, event); } } } } }
Source:
<code>protected final ResultAndError<AppInstallStatus> doInBackground(String... params) { profileRef = params[0]; setupUpdate(); try { return new ResultAndError<>(stageUpdate()); } catch (InvalidResourceStructureException e) { ResourceInstallUtils.logInstallError(e, "Structure error ocurred during install|"); <START> return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.resourceName + "==" + e.getMessage()); <END> } catch (Exception e) { ResourceInstallUtils.logInstallError(e, "Unknown error ocurred during install|"); return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.getMessage()); } }</code><technical_language>why'd change content of error message here? sense</technical_language>

Target:
protected final ResultAndError<AppInstallStatus> doInBackground(String... params) { profileRef = params[0]; setupUpdate(); try { return new ResultAndError<>(stageUpdate()); } catch (InvalidResourceException e) { ResourceInstallUtils.logInstallError(e, "Structure error ocurred during install|"); String combinedMessage = e.resourceName + "==" + e.getMessage(); return new ResultAndError<>(AppInstallStatus.UnknownFailure, combinedMessage); } catch (Exception e) { ResourceInstallUtils.logInstallError(e, "Unknown error ocurred during install|"); return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.getMessage()); } }
Source:
<code>private void scanCounterBlock(Tree counterBlock) { if (counterBlock instanceof VariableDeclarationTree) { for (IdentifierTree identifierTree : ((VariableDeclarationTreeImpl) counterBlock).variableIdentifiers()) { if (identifierTree.symbol() != null) { currentLoopCounters.add(identifierTree.symbol()); } } } else if (counterBlock instanceof AssignmentExpressionTree) { scanCounterBlock(((AssignmentExpressionTree) counterBlock).variable()); } else if (counterBlock instanceof IdentifierTree) { IdentifierTree identifier = (IdentifierTree) counterBlock; <START> if (identifier.symbol() != null) { <END> currentLoopCounters.add(identifier.symbol()); } } }</code><technical_language>@vilchik-elena This pattern duplicated 3 times in this class</technical_language>

Target:
private void scanCounterBlock(Tree counterBlock) { if (counterBlock instanceof VariableDeclarationTree) { for (IdentifierTree identifierTree : ((VariableDeclarationTreeImpl) counterBlock).variableIdentifiers()) { addCurrentLoopCounter(identifierTree); } } else if (counterBlock instanceof AssignmentExpressionTree) { scanCounterBlock(((AssignmentExpressionTree) counterBlock).variable()); } else { addCurrentLoopCounter(counterBlock); } }
Source:
<code>private static ExpressionTree getObject(Tree element) { if (element.is(Kind.BRACKET_MEMBER_EXPRESSION, Kind.DOT_MEMBER_EXPRESSION)) { return ((MemberExpressionTree) element).object(); } <START> if (element.is(Kind.IDENTIFIER_REFERENCE) && ((JavaScriptTree) element).getParent().is(Kind.FOR_OF_STATEMENT)) { <END> return (ExpressionTree) element; } return null; }</code><technical_language>@inverno skip element.is(Kind.IDENTIFIER_REFERENCE) done line 67</technical_language>

Target:
private static ExpressionTree getObject(Tree element) { if (element.is(Kind.BRACKET_MEMBER_EXPRESSION, Kind.DOT_MEMBER_EXPRESSION)) { return ((MemberExpressionTree) element).object(); } final JavaScriptTree parent = ((JavaScriptTree) element).getParent(); if (parent.is(Kind.FOR_OF_STATEMENT) && element == ((ForObjectStatementTree) parent).expression()) { return (ExpressionTree) element; } return null; }
Source:
<code>Directory open( File dir ) throws IOException; @Override void close(); static DirectoryFactory newDirectoryFactory( PageCache pageCache, Config config ) { boolean isEphemeral = config.get( GraphDatabaseFacadeFactory.Configuration.ephemeral ); boolean isUsingCustomIOConfig = CustomIOConfigValidator.customIOConfigUsed( config ); if ( isEphemeral ) { <START> assert !isUsingCustomIOConfig : "Can't both be in ephemeral mode and use block storage, that makes no sense."; <END> return new PagedDirectoryFactory( pageCache ); } DirectoryFactory factory; switch ( DEFAULT_FACTORY ) { case "heap": factory = new HeapDirectoryFactory(); break; case "paged": if ( !isUsingCustomIOConfig ) { factory = new PagedDirectoryFactory( pageCache ); break; } System.err.println( "WARN: Paged indexes are not available when custom IO is in use. " + "Most likely this is because you're running on special hardware. Falling back to memory-mapped indexes." ); case "niofs": factory = new MemoryMappedDirectoryFactory(); break; default: System.err.printf( "WARN: Unknown index IO implementation '%s', using default.\n", DEFAULT_FACTORY ); factory = new MemoryMappedDirectoryFactory(); } return new NRTCachingDirectoryFactory( factory ); }</code><technical_language>I responsibility check this here</technical_language>

Target:
Directory open( File dir ) throws IOException; @Override void close(); static DirectoryFactory newDirectoryFactory( PageCache pageCache, Config config, Log log ) { boolean isEphemeral = config.get( GraphDatabaseFacadeFactory.Configuration.ephemeral ); boolean isUsingCustomIOConfig = CustomIOConfigValidator.customIOConfigUsed( config ); if ( isEphemeral ) { return new PagedDirectoryFactory( pageCache ); } DirectoryFactory factory; switch ( DEFAULT_FACTORY ) { case "heap": factory = new HeapDirectoryFactory(); break; case "paged": if ( !isUsingCustomIOConfig ) { factory = new PagedDirectoryFactory( pageCache ); break; } log.warn( "Paged indexes are not available when custom IO is in use. Most likely this is because you're " + "running on special hardware. Falling back to memory-mapped indexes." ); case "mmap": factory = new MemoryMappedDirectoryFactory(); break; default: log.warn( "Unknown index IO implementation '%s', using default.\n", DEFAULT_FACTORY ); factory = new MemoryMappedDirectoryFactory(); } return new NRTCachingDirectoryFactory( factory ); }
Source:
<code><START> public void suspend() { <END> SuspendActionDto suspendAction = dtoFactory.createDto(SuspendActionDto.class); suspendAction.setType(Action.TYPE.SUSPEND); service.suspend(debugSessionDto.getId(), suspendAction).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { notificationManager.notify(arg.getMessage(), FAIL, FLOAT_MODE); } }); }</code><technical_language>if (!isConnected()) { return; }</technical_language>

Target:
public void suspend() { if (!isConnected()) { return; } SuspendActionDto suspendAction = dtoFactory.createDto(SuspendActionDto.class); suspendAction.setType(Action.TYPE.SUSPEND); service.suspend(debugSessionDto.getId(), suspendAction).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { notificationManager.notify(arg.getMessage(), FAIL, FLOAT_MODE); } }); }
Source:
<code>private IInternationalizationPreferenceModelProvider createDefaultInternationalizationPrefModelProvider() { return new AbstractInternationalizationPreferenceModelProvider() { @Override public URI getInternationalizationPreferenceModelURI(final URI userModelURI) { assert <START> userModelURI != <END> null; final IPath internationalizationWorkspaceLocation = Activator.getDefault().getStateLocation(); final URI modelURI = userModelURI.trimFileExtension(); URI internationalizationModelURI = null; if (modelURI.isPlatform()) { internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toPlatformString(true)).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } else if (modelURI.isFile()) { final String workspaceURI = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().toString(); internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toString().replaceFirst(workspaceURI, "")).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } return internationalizationModelURI; } }; }</code><technical_language>I prefer this : org.eclipse.core.runtime.Assert.isNotNull(userModelURI)</technical_language>

Target:
private IInternationalizationPreferenceModelProvider createDefaultInternationalizationPrefModelProvider() { return new AbstractInternationalizationPreferenceModelProvider() { @Override public URI getInternationalizationPreferenceModelURI(final URI userModelURI) { Assert.isNotNull(userModelURI); final IPath internationalizationWorkspaceLocation = Activator.getDefault().getStateLocation(); final URI modelURI = userModelURI.trimFileExtension(); URI internationalizationModelURI = null; if (modelURI.isPlatform()) { internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toPlatformString(true)).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } else if (modelURI.isFile()) { final String workspaceURI = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().toString(); internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toString().replaceFirst(workspaceURI, "")).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } return internationalizationModelURI; } }; }
Source:
<code>public void testList() throws Exception { for (String regionId : regions) { ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, containerName); ObjectList response = objectApi.list(); assertEquals(response.getContainer(), api.containerApiInRegion(regionId).get(containerName)); <START> assertNotNull(response); <END> for (SwiftObject object : response) { checkObject(object); } } }</code><technical_language>need this assertion</technical_language>

Target:
public void testList() throws Exception { for (String regionId : regions) { ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, containerName); ObjectList response = objectApi.list(); assertEquals(response.getContainer(), api.containerApiInRegion(regionId).get(containerName)); for (SwiftObject object : response) { checkObject(object); } } }
Source:
<code>public static Depgraph parseFrom(List<String> fileContents) { if (fileContents.isEmpty()) { return new Depgraph(Collections.<String>emptyList()); } List<String> roots = new ArrayList<>(); for (String depgraph : fileContents) { try { List<List> list = new Gson().fromJson(depgraph, new TypeToken<List<List>>(){}.getType()); for (List outer : list) { <START> Iterator i = outer.iterator(); <END> if ("roots".equals(i.next())) { List<List> rootsList = (List<List>) i.next(); for (List rootDescriptor : rootsList) { String filename = (String) rootDescriptor.iterator().next(); if (!filename.endsWith("-bootstrap.js")) { roots.add(filename); } } } } } catch (Exception e) { throw new RuntimeException("malformed depgraphs content:\n" + depgraph, e); } } if (roots.isEmpty()) { throw new IllegalStateException("No roots were found in the provided depgraphs files"); } return new Depgraph(roots); }</code><technical_language>add generic types for of these</technical_language>

Target:
public static Depgraph parseFrom(List<String> fileContents) { if (fileContents.isEmpty()) { return new Depgraph(Collections.<String>emptyList()); } List<String> roots = new ArrayList<>(); for (String depgraph : fileContents) { try { List<List<?>> list = new Gson().fromJson(depgraph, new TypeToken<List<List>>(){}.getType()); for (List<?> outer : list) { Iterator i = outer.iterator(); if ("roots".equals(i.next())) { List<List<?>> rootsList = (List<List<?>>) i.next(); for (List<?> rootDescriptor : rootsList) { String filename = (String) rootDescriptor.iterator().next(); if (!filename.endsWith("-bootstrap.js")) { roots.add(filename); } } } } } catch (Exception e) { throw new RuntimeException("malformed depgraphs content:\n" + depgraph, e); } } if (roots.isEmpty()) { throw new IllegalStateException("No roots were found in the provided depgraphs files"); } return new Depgraph(roots); }
Source:
<code><START> public List<Datastream> getAllDatastreams(int start, int count) throws DatastreamException { <END> GetAllRequest<Datastream> request = _builders.getAll().paginate(0, 1).build(); ResponseFuture<CollectionResponse<Datastream>> datastreamResponseFuture = _restClient.sendRequest(request); try { return datastreamResponseFuture.getResponse().getEntity().getElements(); } catch (RemoteInvocationException e) { throw new DatastreamException("Get All Datastreams failed with error.", e); } }</code><technical_language>I "start" "count" used. purpose of them</technical_language>

Target:
public List<Datastream> getAllDatastreams(int start, int count) throws DatastreamException { return getAllDatastreams(_builders.getAll().paginate(start, count).build()); }
Source:
<code>public void onSuccess(String provider) { if (provider == null) { throw new IllegalStateException( "User has no providers even though we got a collision."); } <START> if (provider.equalsIgnoreCase(EmailAuthProvider.PROVIDER_ID)) { <END> setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackPasswordPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_FLOW ))); } else if (provider.equalsIgnoreCase(EMAIL_LINK_PROVIDER)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackEmailLinkPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EMAIL_LINK_PROVIDER, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_LINK_FLOW ))); } else { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackIdpPrompt.createIntent( getApplication(), getArguments(), new User.Builder(provider, mEmail).build()), RequestCodes.WELCOME_BACK_IDP_FLOW ))); } }</code><technical_language>This switched back. Avoids chance of a NullPointerException if static constant left hand side. (below well)</technical_language>

Target:
public void onSuccess(String provider) { if (provider == null) { throw new IllegalStateException( "User has no providers even though we got a collision."); } if (EmailAuthProvider.PROVIDER_ID.equalsIgnoreCase(provider)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackPasswordPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_FLOW ))); } else if (EMAIL_LINK_PROVIDER.equalsIgnoreCase(provider)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackEmailLinkPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EMAIL_LINK_PROVIDER, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_LINK_FLOW ))); } else { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackIdpPrompt.createIntent( getApplication(), getArguments(), new User.Builder(provider, mEmail).build()), RequestCodes.WELCOME_BACK_IDP_FLOW ))); } }
Source:
<code>private IAction createResetHeaderAction() { return new <START> Action(Messages.TmfEventsTable_showAll) <END> { @Override public void run() { for (TableColumn column : fTable.getColumns()) { final Object widthVal = column.getData(Key.WIDTH); if (widthVal instanceof Integer) { Integer width = (Integer) widthVal; if (!column.getResizable()) { column.setWidth(width); column.setResizable(true); if (IS_LINUX) { column.pack(); } } } } for (MenuItem menuItem : fHeaderMenu.getItems()) { menuItem.setSelection(true); } } }; }</code><technical_language>Minor thing, message constant this file a label start a capital letter. If change it, while remove extra blank line in Messages.java. Also, UI guidelines text "Show All" "Show all"</technical_language>

Target:
private IAction createResetHeaderAction() { return new Action(Messages.TmfEventsTable_ShowAll) { @Override public void run() { for (TableColumn column : fTable.getColumns()) { final Object widthVal = column.getData(Key.WIDTH); if (widthVal instanceof Integer) { Integer width = (Integer) widthVal; if (!column.getResizable()) { column.setWidth(width); column.setResizable(true); if (IS_LINUX) { column.pack(); } } } } } }; }
Source:
<code>private Constants.RealmFieldType getRealmType(VariableElement field) { String fieldTypeCanonicalName = field.asType().toString(); Constants.RealmFieldType type = Constants.JAVA_TO_REALM_TYPES.get(fieldTypeCanonicalName); if (type != null) { return type; } if (Utils.isMutableRealmInteger(field)) { return Constants.RealmFieldType.REALM_INTEGER; } if (Utils.isRealmModel(field)) { return Constants.RealmFieldType.OBJECT; } <START> if (Utils.isRealmList(field)) { <END> final TypeMirror elementTypeMirror = Utils.getRealmListElementTypeMirror(field); if (Utils.isRealmModel(elementTypeMirror)) { return Constants.RealmFieldType.LIST; } else { final Constants.RealmFieldType fieldType = Constants.LIST_ELEMENT_TYPE_TO_REALM_TYPES.get(elementTypeMirror.toString()); if (fieldType == null) { return Constants.RealmFieldType.NOTYPE; } return fieldType; } } return Constants.RealmFieldType.NOTYPE; }</code><technical_language>Field.isList() is needed</technical_language>

Target:
private Constants.RealmFieldType getRealmType(VariableElement field) { String fieldTypeCanonicalName = field.asType().toString(); Constants.RealmFieldType type = Constants.JAVA_TO_REALM_TYPES.get(fieldTypeCanonicalName); if (type != null) { return type; } if (Utils.isMutableRealmInteger(field)) { return Constants.RealmFieldType.REALM_INTEGER; } if (Utils.isRealmModel(field)) { return Constants.RealmFieldType.OBJECT; } if (Utils.isRealmModelList(field)) { return Constants.RealmFieldType.LIST; } if (Utils.isRealmValueList(field)) { final TypeMirror elementTypeMirror = Utils.getRealmListElementTypeMirror(field); final Constants.RealmFieldType fieldType = Constants.LIST_ELEMENT_TYPE_TO_REALM_TYPES.get(elementTypeMirror.toString()); if (fieldType == null) { return Constants.RealmFieldType.NOTYPE; } return fieldType; } return Constants.RealmFieldType.NOTYPE; }
Source:
<code>public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (targetColsSymbolsExclPartition == null) { out.writeBoolean(false); } else { out.writeBoolean(true); Symbols.toStream(targetColsSymbolsExclPartition, out); } if (targetColsExclPartitionCols == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(targetColsExclPartitionCols.size()); for (Reference columnIdent : targetColsExclPartitionCols) { Reference.toStream(columnIdent, out); } } out.writeBoolean(ignoreDuplicateKeys); if (onDuplicateKeyAssignments == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(onDuplicateKeyAssignments.size()); for (Map.Entry<Reference, Symbol> entry : onDuplicateKeyAssignments.entrySet()) { Reference.toStream(entry.getKey(), out); Symbols.toStream(entry.getValue(), out); } } <START> if (out.getVersion().onOrAfter(Version.V_4_1_0)) { <END> out.write(allTargetColumns.size()); for (var ref : allTargetColumns) { Symbols.toStream(ref, out); } } }</code><technical_language>V_4_2_0</technical_language>

Target:
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (targetColsSymbolsExclPartition == null) { out.writeBoolean(false); } else { out.writeBoolean(true); Symbols.toStream(targetColsSymbolsExclPartition, out); } if (targetColsExclPartitionCols == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(targetColsExclPartitionCols.size()); for (Reference columnIdent : targetColsExclPartitionCols) { Reference.toStream(columnIdent, out); } } out.writeBoolean(ignoreDuplicateKeys); if (onDuplicateKeyAssignments == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(onDuplicateKeyAssignments.size()); for (Map.Entry<Reference, Symbol> entry : onDuplicateKeyAssignments.entrySet()) { Reference.toStream(entry.getKey(), out); Symbols.toStream(entry.getValue(), out); } } if (out.getVersion().onOrAfter(Version.V_4_2_0)) { out.write(allTargetColumns.size()); for (var ref : allTargetColumns) { Symbols.toStream(ref, out); } } }
Source:
<code>private Optional<Field> selectByContentTypeFieldRelationTypeInDb(String id, String fieldRelationType) throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL(sql.findByContentTypeAndRelationType).addParam(id).addParam(fieldRelationType); <START> List<Map<String, Object>> results; <END> results = dc.loadObjectResults(); if (results.size() == 0) { return Optional.empty(); } return Optional.of(new DbFieldTransformer(results.get(0)).from()); }</code><technical_language>reduce final List<Map<String, Object>> results = dc.loadObjectResults(); return results.isEmpty()? Optional.empty():Optional.of(new DbFieldTransformer(results.get(0)).from());</technical_language>

Target:
private Optional<Field> selectByContentTypeFieldRelationTypeInDb(String id, String fieldRelationType) throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL(sql.findByContentTypeAndRelationType).addParam(id).addParam(fieldRelationType); final List<Map<String, Object>> results = dc.loadObjectResults(); return results.isEmpty()? Optional.empty():Optional.of(new DbFieldTransformer(results.get(0)).from()); }
Source:
<code>private void adjustQuestionNumbersAndCreateQuestion( FeedbackQuestionAttributes question, <START> int oldQuestionNumber) <END> throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { fqDb.saveQuestionAndAdjustQuestionNumbers(question, false, oldQuestionNumber); }</code><technical_language>This previous line. indentation aligned throws</technical_language>

Target:
private void adjustQuestionNumbersAndCreateQuestion( FeedbackQuestionAttributes question, int oldQuestionNumber) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { if (fsLogic.getFeedbackSession(question.feedbackSessionName, question.courseId) == null) { throw new EntityDoesNotExistException("Session disappeared"); } fqDb.saveQuestionAndAdjustQuestionNumbers(question, false, oldQuestionNumber); }
Source:
<code>public ArticlePageObject savePage() { waitForElementInViewPort(editSummary); waitForElementInViewPort(reviewChangesButton); waitForElementVisibleByElement(savePanel); publishButton.click(); <START> PageObjectLogging.log("savePage", "The 2nd Publish Button is clicked", true); <END> return new ArticlePageObject(driver); }</code><technical_language>Global listener catch click. need log it</technical_language>

Target:
public ArticlePageObject savePage() { waitForElementInViewPort(editSummary); waitForElementInViewPort(reviewChangesButton); waitForElementVisibleByElement(savePanel); publishButton.click(); return new ArticlePageObject(driver); }
Source:
<code>public void setup() { fTrace = new <START> TmfXmlTraceStubNs(); assertNotNull(fTrace); <END> try { fTrace.initTrace(null, COUNTER_FILE, ITmfEvent.class); } catch (TmfTraceException e) { fail(e.getMessage()); } fTrace.addEventAspect(new TmfContentFieldAspect("aspect")); fTrace.addEventAspect(new CounterAspect("counter", "counter")); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class) { @Override public boolean isCumulative() { return true; } }); fStateProvider = CounterStateProvider.create(fTrace); IStateHistoryBackend backend = StateHistoryBackendFactory.createInMemoryBackend("", 0); fSsb = StateSystemFactory.newStateSystem(backend); fStateProvider.assignTargetStateSystem(fSsb); }</code><technical_language>objects null constructor. (write if (fTrace == null), get a compiler error)</technical_language>

Target:
public void setup() throws TmfTraceException { fTrace = new TmfXmlTraceStubNs(); fTrace.initTrace(null, COUNTER_FILE, ITmfEvent.class); fTrace.addEventAspect(new TmfContentFieldAspect("aspect")); fTrace.addEventAspect(new CounterAspect("counter", "counter")); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class) { @Override public boolean isCumulative() { return true; } }); assertEquals(8, Iterables.size(fTrace.getEventAspects())); if (fTrace != null) { fStateProvider = CounterStateProvider.create(fTrace); } IStateHistoryBackend backend = StateHistoryBackendFactory.createInMemoryBackend("CounterStateSystem", 0); fSsb = StateSystemFactory.newStateSystem(backend); fStateProvider.assignTargetStateSystem(fSsb); }
Source:
<code>public void run() { try (SingleLockService compactorLock = createSimpleLocks()) { log.info("Starting background compactor"); while (true) { if (Thread.currentThread().isInterrupted()) { log.warn("Shutting down background compactor because someone interrupted its thread"); Thread.currentThread().interrupt(); return; } compactorLock.lockOrRefresh(); <START> if (compactorLock.haveLocks()) { <END> Optional<String> tableToCompactOptional = transactionManager.runTaskReadOnly( this::selectTableToCompact); if (!tableToCompactOptional.isPresent()) { log.info("No table to compact"); Thread.sleep(SLEEP_TIME_WHEN_NO_TABLE_TO_COMPACT_MILLIS); continue; } String tableToCompact = tableToCompactOptional.get(); log.info("Compacting table {}", LoggingArgs.safeInternalTableName(tableToCompact)); compactTable(tableToCompact); log.info("Compacted table {}", LoggingArgs.safeInternalTableName(tableToCompact)); registerCompactedTable(tableToCompact); } } } catch (InterruptedException e) { log.warn("Shutting down background compactor due to InterruptedException", e); Thread.currentThread().interrupt(); } }</code><technical_language>Do need do if haveLocks()</technical_language>

Target:
public void run() { try (SingleLockService compactorLock = createSimpleLocks()) { log.info("Starting background compactor"); while (true) { if (Thread.currentThread().isInterrupted()) { log.warn("Shutting down background compactor because someone interrupted its thread"); Thread.currentThread().interrupt(); return; } compactorLock.lockOrRefresh(); if (compactorLock.haveLocks()) { Optional<String> tableToCompactOptional = transactionManager.runTaskReadOnly( this::selectTableToCompact); if (!tableToCompactOptional.isPresent()) { log.info("No table to compact"); Thread.sleep(SLEEP_TIME_WHEN_NO_TABLE_TO_COMPACT_MILLIS); continue; } String tableToCompact = tableToCompactOptional.get(); log.info("Compacting table {}", LoggingArgs.safeInternalTableName(tableToCompact)); compactTable(tableToCompact); log.info("Compacted table {}", LoggingArgs.safeInternalTableName(tableToCompact)); registerCompactedTable(tableToCompact); } else { log.info("Failed to get the compaction lock. Probably, another host is running compaction."); Thread.sleep(SLEEP_TIME_WHEN_NO_LOCK_MILLIS); continue; } } } catch (InterruptedException e) { log.warn("Shutting down background compactor due to InterruptedException", e); Thread.currentThread().interrupt(); } }
Source:
<code>protected RiakFuture<ResponseType, List<Location>> executeAsync(final RiakCluster cluster) { List<BaseCommand> operations = buildOperations(); MultiFuture future = new MultiFuture(locations); Submitter submitter = new Submitter(operations, maxInFlight, cluster, future); Thread t = new Thread(submitter); <START> t.setDaemon(true); <END> t.start(); return future; }</code><technical_language>I modified Python client _not_ daemon threads, hide programming errors (not closing client correctly, for instance). setDaemon(false) here</technical_language>

Target:
protected RiakFuture<ResponseType, List<Location>> executeAsync(final RiakCluster cluster) { List<BaseCommand> operations = buildOperations(); MultiFuture future = new MultiFuture(locations); Submitter submitter = new Submitter(operations, maxInFlight, cluster, future); Thread worker = new Thread(submitter); worker.setDaemon(true); worker.start(); return future; }
Source:
<code>protected String getKuraServicePid() throws KuraException { <START> String kuraServicePid = (String) this.properties.get(ConfigurationService.KURA_SERVICE_PID); <END> if (kuraServicePid == null) { throw new KuraException(KuraErrorCode.CONFIGURATION_REQUIRED_ATTRIBUTE_MISSING); } return kuraServicePid; }</code><technical_language>cache Kura Service PID everytime map lookup occurs for emit, retrieval of Kura Service PID properties happen</technical_language>

Target:
protected String getKuraServicePid() throws KuraException { if (kuraServicePid == null) { throw new KuraException(KuraErrorCode.CONFIGURATION_REQUIRED_ATTRIBUTE_MISSING); } return kuraServicePid; }
Source:
<code>private void addTree(TreeWalk tw, ObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (id==null) <START> tw.addTree(new CanonicalTreeParser()); <END> else tw.addTree(id); }</code><technical_language>For empty tree thing, new EmptyTreeIterator() instead. ask for this slot a CanonicalTreeParser type get a null pointer. (TreeWalk internally creates EmptyTreeIterator dives non-existent subdirectories.)</technical_language>

Target:
private void addTree(TreeWalk tw, ObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (id == null) tw.addTree(new EmptyTreeIterator()); else tw.addTree(id); }
Source:
<code>private synchronized void removeTimedOutStreams() { for (String streamId : multiTimeStreams.keySet()) { if (streamTimeouts.get(streamId) < System.currentTimeMillis()) { FixedLengthAudioStream stream = multiTimeStreams.remove(streamId); streamTimeouts.remove(streamId); IOUtils.closeQuietly(stream); <START> stream = null; <END> logger.debug("Removed timed out stream {}", streamId); } } }</code><technical_language>is need set local scope reference null, if prefer..</technical_language>

Target:
private synchronized void removeTimedOutStreams() { for (String streamId : multiTimeStreams.keySet()) { if (streamTimeouts.get(streamId) < System.nanoTime()) { FixedLengthAudioStream stream = multiTimeStreams.remove(streamId); streamTimeouts.remove(streamId); IOUtils.closeQuietly(stream); stream = null; logger.debug("Removed timed out stream {}", streamId); } } }