auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) { ArrayList<Integer> toRemove = new ArrayList<Integer>(); for (int id : unloadQueue) { Dimension dimension = dimensions.get(id); if (dimension.ticksWaited != dimension.delayToUnload) { dimension.ticksWaited++; continue; } WorldServer w = worlds.get(id); toRemove.add(id); dimension.ticksWaited = 0; if (w != null && (!ForgeChunkManager.getPersistentChunksFor(w).isEmpty() || !w.playerEntities.isEmpty()) || dimension.type.shouldLoadSpawn()) { <START> FMLLog.fine("Aborting unload for dimension %s as status changed", id); <END> continue; } try { if (w != null) { w.saveAllChunks(true, null); } else { FMLLog.warning("Unexpected world unload - world %d is already unloaded", id); } } catch (MinecraftException e) { e.printStackTrace(); } finally { if (w != null) { MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); w.flush(); setWorld(id, null, w.getMinecraftServer()); } } } unloadQueue.removeAll(toRemove); }</code><technical_language>This spammy</technical_language>

Target:
public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) { IntListIterator queueIterator = unloadQueue.iterator(); while (queueIterator.hasNext()) { int id = queueIterator.next(); Dimension dimension = dimensions.get(id); if (dimension.ticksWaited < ForgeModContainer.dimensionUnloadQueueDelay) { dimension.ticksWaited++; continue; } WorldServer w = worlds.get(id); queueIterator.remove(); dimension.ticksWaited = 0; if (w == null || !ForgeChunkManager.getPersistentChunksFor(w).isEmpty() || !w.playerEntities.isEmpty() || dimension.type.shouldLoadSpawn()) { FMLLog.fine("Aborting unload for dimension %s as status changed", id); continue; } try { w.saveAllChunks(true, null); } catch (MinecraftException e) { e.printStackTrace(); } finally { MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); w.flush(); setWorld(id, null, w.getMinecraftServer()); } } }
Source:
<code>public GoodDataHttpClient(final HttpClient httpClient, final SSTRetrievalStrategy sstStrategy) { notNull(httpClient); this.httpClient = httpClient; if (sstStrategy instanceof LoginSSTRetrievalStrategy) { this.sstStrategy = sstStrategy; <START> this.authHost = ((LoginSSTRetrievalStrategy) sstStrategy).getHttpHost(); <END> } else { throw new IllegalArgumentException("This constructor is deprecated and works with LoginSSTRetrievalStrategy argument only!"); } }</code><technical_language>add java notNull(authHost, "HTTP host null"); notNull(sstStrategy); consistent other constructors</technical_language>

Target:
public GoodDataHttpClient(final HttpClient httpClient, final SSTRetrievalStrategy sstStrategy) { notNull(httpClient); this.httpClient = httpClient; if (sstStrategy instanceof LoginSSTRetrievalStrategy) { this.sstStrategy = sstStrategy; this.authHost = ((LoginSSTRetrievalStrategy) sstStrategy).getHttpHost(); notNull(authHost, "HTTP host cannot be null"); } else { throw new IllegalArgumentException("This constructor is deprecated and works with LoginSSTRetrievalStrategy argument only!"); } }
Source:
<code>public ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId) { String fullTableName = NameUtil.formatTableName( requestContext.getProjectId(), requestContext.getInstanceId(), tableId); SampleRowKeysRequest requestProto = SampleRowKeysRequest.newBuilder().setTableName(fullTableName).build(); ListenableFuture<List<SampleRowKeysResponse>> responseProto = delegate.sampleRowKeysAsync(requestProto); return ApiFutureUtil.transformAndAdapt( responseProto, new Function<List<SampleRowKeysResponse>, List<KeyOffset>>() { @Override public List<KeyOffset> apply(List<SampleRowKeysResponse> rowKeysList) { if (rowKeysList == null || rowKeysList.isEmpty()) { return Collections.emptyList(); <START> } <END> ImmutableList.Builder<KeyOffset> keyOffsetBuilder = ImmutableList.builder(); for (SampleRowKeysResponse rowKeys : rowKeysList) { keyOffsetBuilder.add(KeyOffset.create(rowKeys.getRowKey(), rowKeys.getOffsetBytes())); } return keyOffsetBuilder.build(); } }); }</code><technical_language>I rowKeysList null if empty return empty ImmutableList below. I safe remove</technical_language>

Target:
public ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId) { String fullTableName = NameUtil.formatTableName( requestContext.getProjectId(), requestContext.getInstanceId(), tableId); SampleRowKeysRequest requestProto = SampleRowKeysRequest.newBuilder().setTableName(fullTableName).build(); ListenableFuture<List<SampleRowKeysResponse>> responseProto = delegate.sampleRowKeysAsync(requestProto); return ApiFutureUtil.transformAndAdapt( responseProto, new Function<List<SampleRowKeysResponse>, List<KeyOffset>>() { @Override public List<KeyOffset> apply(List<SampleRowKeysResponse> rowKeysList) { ImmutableList.Builder<KeyOffset> keyOffsetBuilder = ImmutableList.builder(); for (SampleRowKeysResponse rowKeys : rowKeysList) { keyOffsetBuilder.add(KeyOffset.create(rowKeys.getRowKey(), rowKeys.getOffsetBytes())); } return keyOffsetBuilder.build(); } }); }
Source:
<code>public StreamingRestClient streamingSearch() { URLConnection urlConnection = null; try { final WebTarget webTarget = client.target(baseUrl).path("search"); urlConnection = setParams(webTarget).getUri().toURL().openConnection(); setHeaders(urlConnection); setCookies(urlConnection); urlConnection.setReadTimeout(60 * 1000); return new StreamingRestClient(urlConnection.getInputStream()); <START> } catch (ConnectException ce) { <END> LOGGER.info("search failed: {}/search?{}", baseUrl, printParams()); LOGGER.error("Caught exception while connecting", ce); throw new RestClientException(503, ce); } catch (IOException e) { try (InputStream errorStream = ((HttpURLConnection) urlConnection).getErrorStream()) { final WhoisResources whoisResources = StreamingRestClient.unMarshalError(errorStream); throw new RestClientException(((HttpURLConnection) urlConnection).getResponseCode(), whoisResources.getErrorMessages()); } catch (IllegalArgumentException | StreamingException | IOException | NullPointerException e1) { LOGGER.info("search failed: {}/search?{}", baseUrl, printParams()); LOGGER.error("Initial IOException: ", e); LOGGER.error("Caught exception while unmarshalling error", e1); throw new RestClientException(500, e1); } } }</code><technical_language>urlConnection null, check 28b4a368f99f3384046d9c75a12bc1d78adbf5bc</technical_language>

Target:
public StreamingRestClient streamingSearch() { URLConnection urlConnection = null; try { final WebTarget webTarget = client.target(baseUrl).path("search"); urlConnection = setParams(webTarget).getUri().toURL().openConnection(); setHeaders(urlConnection); setCookies(urlConnection); urlConnection.setReadTimeout(60 * 1000); return new StreamingRestClient(urlConnection.getInputStream()); } catch (ConnectException ce) { LOGGER.info("search failed: {}/search?{}", baseUrl, printParams()); LOGGER.error("Caught exception while connecting", ce); throw new RestClientException(Response.Status.SERVICE_UNAVAILABLE, ce); } catch (IOException e) { try (InputStream errorStream = ((HttpURLConnection) urlConnection).getErrorStream()) { final WhoisResources whoisResources = StreamingRestClient.unMarshalError(errorStream); throw new RestClientException(((HttpURLConnection) urlConnection).getResponseCode(), whoisResources.getErrorMessages()); } catch (IllegalArgumentException | StreamingException | IOException | NullPointerException e1) { LOGGER.info("search failed: {}/search?{}", baseUrl, printParams()); LOGGER.error("Initial IOException: ", e); LOGGER.error("Caught exception while unmarshalling error", e1); throw new RestClientException(Response.Status.INTERNAL_SERVER_ERROR, e1); } } }
Source:
<code>public ComputableCacheNode duplicate() { <START> if (cacheEvals && cachedValue != null && !cachedValue.isNull()) { <END> return new ComputableCacheNode(getKey(), getTags(), getParents(), func, true, cachedValue.deepCopy(), isCacheCurrent); } else { return new ComputableCacheNode(getKey(), getTags(), getParents(), func, cacheEvals, null, isCacheCurrent); } }</code><technical_language>this isStoredValueAvailable()</technical_language>

Target:
public ComputableCacheNode duplicate() { if (isStoredValueAvailable()) { return new ComputableCacheNode(getKey(), getTags(), getParents(), func, true, cachedValue.duplicate(), isCacheCurrent); } else { return new ComputableCacheNode(getKey(), getTags(), getParents(), func, cacheEvals, null, isCacheCurrent); } }
Source:
<code>public void bridge$placeEntity(net.minecraft.world.World world, Entity entity, float yaw) { boolean didPort; if (entity instanceof EntityPlayerMP) { this.placeInPortal(entity, yaw); didPort = true; } else { if (((WorldServerBridge) this.world).bridge$getDimensionId() == 1) { <START> didPort = true; <END> } else { didPort = this.placeInExistingPortal(entity, yaw); } } if (PhaseTracker.getInstance().getCurrentContext() instanceof InvokingTeleporterContext) { if (!((InvokingTeleporterContext) PhaseTracker.getInstance().getCurrentContext()).getDidPort()) { ((InvokingTeleporterContext) PhaseTracker.getInstance().getCurrentContext()).setDidPort(didPort); } } }</code><technical_language>Is guaranteed world is a WorldServer instance</technical_language>

Target:
public void bridge$placeEntity(net.minecraft.world.World world, Entity entity, float yaw) { boolean didPort; if (entity instanceof EntityPlayerMP) { this.placeInPortal(entity, yaw); didPort = true; } else { if (((WorldServerBridge) this.world).bridge$getDimensionId() == Constants.World.END_DIMENSION_ID) { didPort = true; } else { didPort = this.placeInExistingPortal(entity, yaw); } } if (didPort) { ((IPhaseState) PhaseTracker.getInstance().getCurrentState()).markTeleported(PhaseTracker.getInstance().getCurrentContext()); } }
Source:
<code>public void testParameterCollectionAndPositional() { <START> final Item item = new Item( "Mouse", "Micro$oft mouse" ); <END> final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in ?1 and item.descr = ?2" ); q.setHint( "org.hibernate.fetchSize", 10 ); q.setHint( "org.hibernate.fetchSize", "10" ); List params = new ArrayList(); params.add( item.getName() ); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }</code><technical_language>neutral Microsoft</technical_language>

Target:
public void testParameterCollectionAndPositional() { final Item item = new Item( "Mouse", "Microsoft mouse" ); final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in ?1 and item.descr = ?2" ); List params = new ArrayList(); params.add( item.getName() ); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }
Source:
<code>public void testNoUpdatesIfHidden() throws Exception { openProgressView(); IWorkbenchPage activePage = window.getActivePage(); <START> activePage.setPartState(activePage.getActivePartReference(), IWorkbenchPage.STATE_MINIMIZED); <END> assertFalse("Progress view still visible.", activePage.isPartVisible(progressView)); Job job1 = runDummyJob(); Job job2 = runDummyJob(); processEventsUntil(() -> false, 1000); int count1 = countJobs(job1); assertEquals(0, count1); int count2 = countJobs(job2); assertEquals(0, count2); openProgressView(); count1 = countJobs(job1); assertEquals(1, count1); count2 = countJobs(job2); assertEquals(1, count2); FinishedJobs.getInstance().clearAll(); processEventsUntil(() -> false, 1000); count1 = countJobs(job1); assertEquals(0, count1); count2 = countJobs(job2); assertEquals(0, count2); }</code><technical_language>please add 'processEvents();' changing state checking visibility, ensure changes propagated workbench</technical_language>

Target:
public void testNoUpdatesIfHidden() throws Exception { openProgressView(); IWorkbenchPage activePage = window.getActivePage(); activePage.setPartState(activePage.getActivePartReference(), IWorkbenchPage.STATE_MINIMIZED); processEvents(); assertFalse("Progress view still visible.", activePage.isPartVisible(progressView)); Job job1 = runDummyJob(); Job job2 = runDummyJob(); processEventsUntil(() -> false, 1000); int count1 = countJobs(job1); assertEquals(0, count1); int count2 = countJobs(job2); assertEquals(0, count2); openProgressView(); count1 = countJobs(job1); assertEquals(1, count1); count2 = countJobs(job2); assertEquals(1, count2); FinishedJobs.getInstance().clearAll(); processEventsUntil(() -> false, 1000); count1 = countJobs(job1); assertEquals(0, count1); count2 = countJobs(job2); assertEquals(0, count2); }
Source:
<code>public Context startScopedSpan(String spanName, Context context) { Span span; if (context.getData(SPAN_CONTEXT).isPresent()) { span = startSpanWithRemoteParent(spanName, context); <START> } else { <END> SpanBuilder spanBuilder = startSpanWithExplicitParent(spanName, context); span = spanBuilder.setSpanKind(Span.Kind.SERVER).startSpan(); } return context.addData(OPENTELEMETRY_SPAN_KEY, span).addData("scope", TRACER.withSpan(span)); }</code><technical_language>this is obvious distinguish 'process' span others. If a more explicit rely presence of context span name</technical_language>

Target:
private Context startScopedSpan(String spanName, Context context) { Span span; Optional<Object> optionalSpanContext = context.getData(SPAN_CONTEXT); if (optionalSpanContext.isPresent() && optionalSpanContext.get() instanceof SpanContext) { span = startSpanWithRemoteParent(spanName, (SpanContext) optionalSpanContext.get()); } else { SpanBuilder spanBuilder = startSpanWithExplicitParent(spanName, context); span = spanBuilder.setSpanKind(Span.Kind.SERVER).startSpan(); } return context.addData(OPENTELEMETRY_SPAN_KEY, span).addData("scope", TRACER.withSpan(span)); }
Source:
<code>private boolean ignoreRegionMoveFailure(ExecutionException e) { <START> boolean ignoreFailure; <END> if (e.getCause() instanceof UnknownRegionException) { ignoreFailure = true; } else if (e.getCause() instanceof DoNotRetryRegionException && e.getCause().getMessage() != null && e.getCause().getMessage() .contains(AssignmentManager.UNEXPECTED_STATE_REGION + "state=SPLIT,")) { ignoreFailure = true; } else { ignoreFailure = false; } return ignoreFailure; }</code><technical_language>nit: initialize false drop final else clause</technical_language>

Target:
private boolean ignoreRegionMoveFailure(ExecutionException e) { boolean ignoreFailure = false; if (e.getCause() instanceof UnknownRegionException) { ignoreFailure = true; } else if (e.getCause() instanceof DoNotRetryRegionException && e.getCause().getMessage() != null && e.getCause().getMessage() .contains(AssignmentManager.UNEXPECTED_STATE_REGION + "state=SPLIT,")) { ignoreFailure = true; } return ignoreFailure; }
Source:
<code>public void actionOpen(HomeActivity activity, IndexedItem with, IOnResult<Boolean> listener) { if (!(with instanceof IndexedFile)) { return; } IndexedFile file = (IndexedFile) with; Uri uri = Uri.fromFile(file.getUnlockedFile()); Intent newIntent = new Intent(android.content.Intent.ACTION_VIEW); MimeTypeMap myMime = MimeTypeMap.getSingleton(); String mimeType = myMime.getMimeTypeFromExtension(file.getExtension().substring(1)); newIntent.setDataAndType(uri, mimeType); newIntent.setFlags(newIntent.FLAG_ACTIVITY_NEW_TASK); try { activity.setRequestedActivity(true); activity.startActivity(newIntent); } catch (android.content.ActivityNotFoundException e) { Toast.makeText(activity, "No handler for file " + file.getUnlockedFilename(), 4000).show(); } <START> finishActionMode(); <END> if (listener != null) { listener.onResult(true); } }</code><technical_language>Indentation problem (again tabs spaces)</technical_language>

Target:
public void actionOpen(HomeActivity activity, IndexedItem with, IOnResult<Boolean> listener) { if (!(with instanceof IndexedFile)) { return; } IndexedFile file = (IndexedFile) with; Uri uri = Uri.fromFile(file.getUnlockedFile()); Intent newIntent = new Intent(android.content.Intent.ACTION_VIEW); MimeTypeMap myMime = MimeTypeMap.getSingleton(); String mimeType = myMime.getMimeTypeFromExtension(file.getExtension().substring(1)); newIntent.setDataAndType(uri, mimeType); newIntent.setFlags(newIntent.FLAG_ACTIVITY_NEW_TASK); try { activity.setRequestedActivity(true); activity.startActivity(newIntent); } catch (android.content.ActivityNotFoundException e) { Toast.makeText(activity, "No handler for file " + file.getUnlockedFilename(), 4000).show(); activity.setRequestedActivity(false); } finishActionMode(); if (listener != null) { listener.onResult(true); } }
Source:
<code>protected <T extends RassXmlObject, R extends PersistableBusinessObject> MaintenanceDocument createAndRouteMaintenanceDocument( Pair<R, R> businessObjects, String maintenanceAction, RassObjectTranslationDefinition<T, R> objectDefinition) { try { return GlobalVariables.doInNewGlobalVariables( buildSessionForSystemUser(), () -> createAndRouteMaintenanceDocumentInternal(businessObjects, maintenanceAction, objectDefinition)); } catch(ValidationException ve) { <START> throw new RuntimeException(ve.getMessage()); <END> } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>immediately clear caught ValidationException message forcibly constructed methods below. Is some a clearer (perhaps a variable name), future change reviewers accidentally MessageMap errors this error message setup? Also, "catch" block start line closing curly brace, a space "catch" keyword</technical_language>

Target:
protected <T extends RassXmlObject, R extends PersistableBusinessObject> MaintenanceDocument createAndRouteMaintenanceDocument(Pair<R, R> businessObjects, String maintenanceAction, RassObjectTranslationDefinition<T, R> objectDefinition) { try { return GlobalVariables.doInNewGlobalVariables(buildSessionForSystemUser(), () -> createAndRouteMaintenanceDocumentInternal(businessObjects, maintenanceAction, objectDefinition)); } catch (ValidationException validationExceptionWithGlobalErrorMessages) { throw new RuntimeException(validationExceptionWithGlobalErrorMessages.getMessage()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public void testGetLife() { levels.add(l); Player p = new Player(po); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); <START> assertTrue(p.getLives() == 3); <END> p.setLives(2); assertTrue(p.getLives() == 2); p.loseLife(); assertTrue(p.getLives() == 1); p.addLife(); assertTrue(p.getLives() == 2); }</code><technical_language>Preferably assertEquals. < testing</technical_language>

Target:
public void testGetLife() { levels.add(level); Player p = new Player(point, map); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); assertEquals(p.getLives(), 3); p.setLives(2); assertEquals(p.getLives(), 2); p.loseLife(); assertEquals(p.getLives(), 1); p.addLife(); assertEquals(p.getLives(), 2); }
Source:
<code>private void startLogin( StartActivityDelegate startActivityDelegate, LoginClient.Request request ) throws FacebookException { this.pendingLoginRequest = request; this.pendingLoggingExtras = new HashMap<>(); this.context = startActivityDelegate.getActivityContext(); logStartLogin(); CallbackManagerImpl.registerStaticCallback( CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(), new CallbackManagerImpl.Callback() { @Override public boolean onActivityResult(int resultCode, Intent data) { return LoginManager.this.onActivityResult(resultCode, data); } } ); boolean started = tryLoginActivity(startActivityDelegate, request); pendingLoggingExtras.put( LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY, started ? AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO ); if (!started) { FacebookException exception = new FacebookException( "Log in attempt failed: FacebookActivity could not be started." <START> + "Have you added FacebookActivity to your AndroidManifest?"); <END> logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception); this.pendingLoginRequest = null; throw exception; } }</code><technical_language>Please add a space beginning, update to: + " Please added FacebookActivity AndroidManifest."</technical_language>

Target:
private void startLogin( StartActivityDelegate startActivityDelegate, LoginClient.Request request ) throws FacebookException { this.pendingLoginRequest = request; this.pendingLoggingExtras = new HashMap<>(); this.context = startActivityDelegate.getActivityContext(); logStartLogin(); CallbackManagerImpl.registerStaticCallback( CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(), new CallbackManagerImpl.Callback() { @Override public boolean onActivityResult(int resultCode, Intent data) { return LoginManager.this.onActivityResult(resultCode, data); } } ); boolean started = tryLoginActivity(startActivityDelegate, request); pendingLoggingExtras.put( LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY, started ? AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO ); if (!started) { FacebookException exception = new FacebookException( "Log in attempt failed: FacebookActivity could not be started." + " Please make sure you added FacebookActivity to the AndroidManifest."); logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception); this.pendingLoginRequest = null; throw exception; } }
Source:
<code>private void initCloudServiceTracking() { String selectedCloudServicePid = this.options.getCloudServicePid(); String filterString = String.format("(&(%s=%s)(kura.service.pid=%s))", Constants.OBJECTCLASS, CloudService.class.getName(), selectedCloudServicePid); Filter filter = null; try { <START> filter = this.componentContext.getBundleContext().createFilter(filterString); <END> } catch (InvalidSyntaxException e) { logger.error("Filter setup exception " + ThrowableUtil.stackTraceAsString(e)); } this.cloudServiceTracker = new ServiceTracker<CloudService, CloudService>( this.componentContext.getBundleContext(), filter, this.customizer); this.cloudServiceTracker.open(); }</code><technical_language>extract bundle context in instance member variable save processing getBundleContext ComponentContext multiple times</technical_language>

Target:
private void initCloudServiceTracking() { String selectedCloudServicePid = this.cloudSubscriberOptions.getCloudServicePid(); String filterString = String.format("(&(%s=%s)(kura.service.pid=%s))", Constants.OBJECTCLASS, CloudService.class.getName(), selectedCloudServicePid); Filter filter = null; try { filter = this.bundleContext.createFilter(filterString); } catch (InvalidSyntaxException e) { logger.error("Filter setup exception " + ThrowableUtil.stackTraceAsString(e)); } this.cloudServiceTracker = new ServiceTracker<>(this.bundleContext, filter, this.cloudServiceTrackerCustomizer); this.cloudServiceTracker.open(); }
Source:
<code><START> @Override public final int describeContents() { <END> return 0; }</code><technical_language>Annotations top please</technical_language>

Target:
public final int describeContents() { return 0; }
Source:
<code>public void testThrowingNullPointerExceptionOnNullGetWithClass() throws Exception { <START> cache.get(null, (Class<Object>) null); <END> }</code><technical_language>Class<?></technical_language>

Target:
public void testThrowingNullPointerExceptionOnNullGetWithClass() throws Exception { cache.get(null, (Class<?>) null); }
Source:
<code>public Shell(String command) { <START> this(command, 0); <END> }</code><technical_language>compatible: Existing shell steps report UNSTABLE instead of SUCCESS</technical_language>

Target:
public Shell(String command) { this(command, null); }
Source:
<code>private void assertCallbackFailure(@NonNull Call<RbPageSummary> call, <START> @NonNull Callback cb) { <END> verify(cb, never()).onSuccess(any(Call.class), any(PageTitle.class)); verify(cb).onError(eq(call), any(Throwable.class)); }</code><technical_language>I isA() check Exceptions thrown client. This lets validate error scenario paths Exception types</technical_language>

Target:
private void assertCallbackFailure(@NonNull Call<RbPageSummary> call, @NonNull Callback cb) { verify(cb, never()).onSuccess(any(Call.class), any(PageTitle.class)); verify(cb).onError(eq(call), isA(IOException.class)); }
Source:
<code>public CompletableFuture<Void> unsubscribe() { <START> logger.debug("Unsubscrbing.."); <END> final OpcUaSubscriptionManager manager = client.getSubscriptionManager(); manager.removeSubscriptionListener(SubscriptionManager.this); for (final MonitoredItemHandler handler : monitoredItemHandlers.values()) { handler.close(); } monitoredItemHandlers.clear(); return manager.deleteSubscription(subscription.getSubscriptionId()).handle((ok, e) -> { if (e != null) { logger.debug("Failed to delete subscription", e); } logger.debug("Unsubscrbing..done"); synchronized (SubscriptionManager.this) { state = new Unsubscribed(); } return (Void) null; }); }</code><technical_language>unsubscribing</technical_language>

Target:
public CompletableFuture<Void> unsubscribe() { logger.debug("Unsubscribing.."); final OpcUaSubscriptionManager manager = client.getSubscriptionManager(); manager.removeSubscriptionListener(SubscriptionManager.this); for (final MonitoredItemHandler handler : monitoredItemHandlers.values()) { handler.close(); } monitoredItemHandlers.clear(); return manager.deleteSubscription(subscription.getSubscriptionId()).handle((ok, e) -> { if (e != null) { logger.debug("Failed to delete subscription", e); } logger.debug("Unsubscribing..done"); synchronized (SubscriptionManager.this) { state = new Unsubscribed(); } return (Void) null; }); }
Source:
<code>public void onPartitionStateChangeToStandbyFromLeader(String partitionName) { <START> logger.debug("Partition state change notification from Leader to Standby received for partition {}", <END> partitionName); synchronized (notificationLock) { try { removeCloudReplica(partitionName); } catch (ReplicationException rex) { logger.error("Exception on removing Partition from {}: ", partitionName, dataNodeId, rex); } } }</code><technical_language>Do in case, throw exception</technical_language>

Target:
public void onPartitionStateChangeToStandbyFromLeader(String partitionName) { logger.info("Partition state change notification from Leader to Standby received for partition {}", partitionName); synchronized (notificationLock) { removeCloudReplica(partitionName); } }
Source:
<code>private static void assertWhitelistedUrlHost(String urlString) { URL url; try { url = new URL(urlString); } catch (MalformedURLException e) { throw new RuntimeException(urlString + " is not a valid URL."); } String host = url.getHost(); boolean isURLWhitelisted = false; for (Pattern urlPattern : WHITELISTED_URL_HOSTS_REGEX) { if (urlPattern.matcher(host).find()) { isURLWhitelisted = true; break; } } if (!isURLWhitelisted) { <START> throw new RuntimeException(url + " is not an approved URL."); <END> } }</code><technical_language>Woah, caught this, throw a notification for this, a runtime exception (or throw a typed exception catch/raise notification later). I prevent phone able start CommCare sending invalid URL SMS, crash startup</technical_language>

Target:
private static void assertWhitelistedUrlHost(String urlString) { URL url; try { url = new URL(urlString); } catch (MalformedURLException e) { throw new RuntimeException(urlString + " is not a valid URL."); } String host = url.getHost(); if (!WHITELISTED_URL_HOSTS_REGEX.matcher(host).find()) { throw new DisallowedSMSInstallURLException(url + " is not an approved URL."); } }
Source:
<code><START> public void testConstructorOrAnd() throws SearchException, IOException { <END> final ExtendedSearchSequence searchSeq = new ExtendedSearchSequence(); final BodyTerm bodyTerm = new BodyTerm("test"); final AndTerm andTerm = new AndTerm(bodyTerm, bodyTerm); final OrTerm orTerm = new OrTerm(andTerm, andTerm); final Argument args = new Argument(); args.append(searchSeq.generateSequence(orTerm, null)); final String searchStr = args.toString(); Assert.assertEquals(searchStr, "OR (BODY test BODY test) (BODY test BODY test)", "result mismatched."); }</code><technical_language>Mix ExtendedModifiedSinceTerm other SearchTerm test</technical_language>

Target:
public void testConstructorOrAnd() throws SearchException, IOException { final ExtendedSearchSequence searchSeq = new ExtendedSearchSequence(); final BodyTerm bodyTerm = new BodyTerm("test"); final AndTerm andTerm = new AndTerm(bodyTerm, bodyTerm); final OrTerm orTerm = new OrTerm(andTerm, andTerm); final Argument args = new Argument(); args.append(searchSeq.generateSequence(orTerm, null)); final String searchStr = args.toString(); Assert.assertEquals(searchStr, "OR (BODY test BODY test) (BODY test BODY test)", "generateSequence() mismatched."); }
Source:
<code>public void run(String... args) throws Exception { List<ModuleLaunchRequest> launchRequests = generateModuleLaunchRequests(); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : launchRequests) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } <START> this.moduleLauncher.launch(launchRequests, moduleLauncherProperties.isAggregate(), filterSpringProperties(args)); <END> }</code><technical_language>I understand. spring. props get special treatment</technical_language>

Target:
public void run(String... args) throws Exception { List<ModuleLaunchRequest> launchRequests = generateModuleLaunchRequests(); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : launchRequests) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } this.moduleLauncher.launch(launchRequests, moduleLauncherProperties.isAggregate(), moduleLauncherProperties.isAggregate() ? extractAggregateProperties(args) : new String[0]); }
Source:
<code>protected void encode(ChannelHandlerContext ctx, DefaultDnsQuery msg, List<Object> out) throws Exception { ByteBuf byteBuf = ctx.alloc().buffer(); encoder.encode(msg, byteBuf); FullHttpRequest fullHttpRequest; if (get) { <START> ByteBuf encodedDNS = Base64.encode(byteBuf); <END> fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, url.getPath() + "?dns=" + encodedDNS.toString(CharsetUtil.UTF_8)); encodedDNS.release(); } else { fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url.getPath(), byteBuf); fullHttpRequest.headers().add(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes()); } fullHttpRequest.headers() .add(HttpHeaderNames.HOST, url.getHost()) .add(HttpHeaderNames.CONTENT_TYPE, "application/dns-message") .add(HttpHeaderNames.ACCEPT, "application/dns-message"); if (http2) { fullHttpRequest.headers().add(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text(), HttpScheme.HTTPS.name()); } out.add(fullHttpRequest); }</code><technical_language>omit padding of '=' characters. base64url, this regular base64</technical_language>

Target:
protected void encode(ChannelHandlerContext ctx, DefaultDnsQuery msg, List<Object> out) throws Exception { ByteBuf byteBuf = ctx.alloc().buffer(); encoder.encode(msg, byteBuf); FullHttpRequest fullHttpRequest; if (get) { ByteBuf encodedDNS = Base64.encode(byteBuf, Base64Dialect.URL_SAFE); fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, url.getPath() + "?dns=" + encodedDNS.toString(CharsetUtil.UTF_8)); encodedDNS.release(); } else { fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url.getPath(), byteBuf); fullHttpRequest.headers().add(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes()); } fullHttpRequest.headers() .add(HttpHeaderNames.HOST, url.getHost()) .add(HttpHeaderNames.CONTENT_TYPE, "application/dns-message") .add(HttpHeaderNames.ACCEPT, "application/dns-message"); if (http2) { fullHttpRequest.headers().add(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text(), HttpScheme.HTTPS.name()); } out.add(fullHttpRequest); }
Source:
<code>public static void cleanupStaleTestDatabases(DatabaseManager client) { logger.info("Cleaning stale test databases ..."); List<SqlParameter> sqlParameterList = new ArrayList<>(); sqlParameterList.add(new SqlParameter("@PREFIX", CosmosDatabaseForTest.SHARED_DB_ID_PREFIX)); List<CosmosDatabaseProperties> dbs = client.queryDatabases( new SqlQuerySpec("SELECT * FROM c WHERE STARTSWITH(c.id, @PREFIX)", sqlParameterList)).collectList().block(); for (CosmosDatabaseProperties db : dbs) { <START> assertThat(ModelBridgeInternal.getResource(db).getId()).startsWith(CosmosDatabaseForTest.SHARED_DB_ID_PREFIX); <END> CosmosDatabaseForTest dbForTest = CosmosDatabaseForTest.from(client.getDatabase(ModelBridgeInternal.getResource(db).getId())); if (db != null && dbForTest.isStale()) { logger.info("Deleting database {}", ModelBridgeInternal.getResource(db).getId()); dbForTest.deleteDatabase(ModelBridgeInternal.getResource(db).getId()); } } }</code><technical_language>getId() is added undo this change getId required method in CosmosDatabaseProperties</technical_language>

Target:
public static void cleanupStaleTestDatabases(DatabaseManager client) { logger.info("Cleaning stale test databases ..."); List<SqlParameter> sqlParameterList = new ArrayList<>(); sqlParameterList.add(new SqlParameter("@PREFIX", CosmosDatabaseForTest.SHARED_DB_ID_PREFIX)); List<CosmosDatabaseProperties> dbs = client.queryDatabases( new SqlQuerySpec("SELECT * FROM c WHERE STARTSWITH(c.id, @PREFIX)", sqlParameterList)).collectList().block(); for (CosmosDatabaseProperties db : dbs) { assertThat(db.getId()).startsWith(CosmosDatabaseForTest.SHARED_DB_ID_PREFIX); CosmosDatabaseForTest dbForTest = CosmosDatabaseForTest.from(client.getDatabase(db.getId())); if (db != null && dbForTest.isStale()) { logger.info("Deleting database {}", db.getId()); dbForTest.deleteDatabase(db.getId()); } } }
Source:
<code>static Iterator<Double> rangeBy(double from, double toExclusive, double step) { final BigDecimal fromDecimal = asDecimal(from), toDecimal = asDecimal(toExclusive), stepDecimal = asDecimal(step); <START> return rangeBy(fromDecimal, toDecimal, stepDecimal); <END> }</code><technical_language>return rangeBy(fromDecimal, toDecimal, stepDecimal).map(BigDecimal::doubleValue)</technical_language>

Target:
static Iterator<Double> rangeBy(double from, double toExclusive, double step) { final BigDecimal fromDecimal = asDecimal(from), toDecimal = asDecimal(toExclusive), stepDecimal = asDecimal(step); return rangeBy(fromDecimal, toDecimal, stepDecimal).map(BigDecimal::doubleValue); }
Source:
<code>public org.ovirt.engine.api.model.Cluster update(org.ovirt.engine.api.model.Cluster incoming) { MacPool macPool = incoming.getMacPool(); <START> macPool.setId(MacPoolIdByIdOrName.get(macPool.getId(), <END> macPool.getName(), this)); return performUpdate(incoming, new QueryIdResolver<>(VdcQueryType.GetClusterById, IdQueryParameters.class), VdcActionType.UpdateCluster, new UpdateParametersProvider()); }</code><technical_language>Please non-static, similar is done ManagementNetworkFinder</technical_language>

Target:
public org.ovirt.engine.api.model.Cluster update(org.ovirt.engine.api.model.Cluster incoming) { return performUpdate(incoming, new QueryIdResolver<>(VdcQueryType.GetClusterById, IdQueryParameters.class), VdcActionType.UpdateCluster, new UpdateParametersProvider(this)); }
Source:
<code>public void initializeCapacityUsedMetric(final Log log, final long capacityInBytes) { currentCapacityUsed = new Gauge<Long>() { @Override public Long getValue() { return log.getLogEndOffset(); } }; registry.register(MetricRegistry.name(Log.class, name + "-currentCapacityUsed"), currentCapacityUsed); <START> ratioOfCurrentToTotalCapacity = new Gauge<Double>() { <END> @Override public Double getValue() { return ((double) log.getLogEndOffset() / capacityInBytes); } }; registry.register(MetricRegistry.name(Log.class, name + "-ratioOfCurrentToTotalCapacity"), ratioOfCurrentToTotalCapacity); }</code><technical_language>a percent</technical_language>

Target:
public void initializeCapacityUsedMetric(final Log log, final long capacityInBytes) { currentCapacityUsed = new Gauge<Long>() { @Override public Long getValue() { return log.getLogEndOffset(); } }; registry.register(MetricRegistry.name(Log.class, name + "-currentCapacityUsed"), currentCapacityUsed); precentageUsedCapacity = new Gauge<Double>() { @Override public Double getValue() { return ((double) log.getLogEndOffset() / capacityInBytes) * 100; } }; registry.register(MetricRegistry.name(Log.class, name + "-precentageUsedCapacity"), precentageUsedCapacity); }
Source:
<code>public ExecutorService get() { if (executorService == null) { <START> super.get(); <END> executorService = ExecutorServiceMetrics.monitor( meterRegistry, super.get(), CheMinorWebSocketEndpointConfiguration.EXECUTOR_NAME, Tags.empty()); } return executorService; }</code><technical_language>do need it? :smile_cat:</technical_language>

Target:
public synchronized ExecutorService get() { if (executorService == null) { executorService = ExecutorServiceMetrics.monitor( meterRegistry, super.get(), CheMinorWebSocketEndpointConfiguration.EXECUTOR_NAME, Tags.empty()); } return executorService; }
Source:
<code>public void executeScaffolder(List<File> ramlFiles, File appDir, File domainDir, String muleVersion) { List<String> ramlsWithExtensionEnabledPaths = processDataModelFiles(ramlFiles); List<String> ramlFilePaths = ramlsWithExtensionEnabledPaths; List<String> muleXmlFiles = retrieveFilePaths(appDir, appExtensions); SystemStreamLog log = new SystemStreamLog(); String domain = null; if (domainDir != null) { List<String> domainFiles = retrieveFilePaths(domainDir, appExtensions); if (domainFiles.size() > 0) { domain = domainFiles.get(0); if (domainFiles.size() > 1) { log.info("There is more than one domain file inside of the domain folder. The domain: " + domain + " will be used."); } } } Scaffolder scaffolder; try { <START> scaffolder = Scaffolder.createScaffolder(log, appDir, ramlFilePaths, muleXmlFiles, domain, muleVersion, null, ramlsWithExtensionEnabledPaths); <END> } catch (Exception e) { throw new RuntimeException("Error executing scaffolder", e); } scaffolder.run(); }</code><technical_language>impact of passing null here</technical_language>

Target:
public void executeScaffolder(List<File> ramlFiles, File appDir, File domainDir, String muleVersion) { List<String> ramlsWithExtensionEnabledPaths = processDataModelFiles(ramlFiles); List<String> ramlFilePaths = ramlsWithExtensionEnabledPaths; List<String> muleXmlFiles = retrieveFilePaths(appDir, appExtensions); SystemStreamLog log = new SystemStreamLog(); String domain = null; if (domainDir != null) { List<String> domainFiles = retrieveFilePaths(domainDir, appExtensions); if (domainFiles.size() > 0) { domain = domainFiles.get(0); if (domainFiles.size() > 1) { log.info("There is more than one domain file inside of the domain folder. The domain: " + domain + " will be used."); } } } Scaffolder scaffolder; try { scaffolder = Scaffolder.createScaffolder(log, appDir, ramlFilePaths, muleXmlFiles, domain, muleVersion, null, ramlsWithExtensionEnabledPaths, ParserType.defaultType()); } catch (Exception e) { throw new RuntimeException("Error executing scaffolder", e); } scaffolder.run(); }
Source:
<code>public void VideosPageTest_003() { SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver); YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY); specialVideos.addVideoViaAjax(video.getUrl()); specialVideos.isNewVideoAdded(); <START> ADDED_VIDEO_TITLE = specialVideos.getNewestVideoTitle(); <END> specialVideos.deleteNewestVideo(); Assertion.assertTrue(specialVideos.getBannerNotifications().isNotificationMessageVisible(), "Banner notification is not visible"); Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), ADDED_VIDEO_TITLE, "Video is still visible as newest video"); }</code><technical_language>Local method variable enough (instead of a static class member)</technical_language>

Target:
public void VideosPageTest_003() { SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver); YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY); specialVideos.addVideoViaAjax(video.getUrl()); specialVideos.isNewVideoAdded(); String addedVideoTitle = specialVideos.getNewestVideoTitle(); specialVideos.deleteNewestVideo(); Assertion.assertTrue(specialVideos.getBannerNotifications().isNotificationMessageVisible(), "Banner notification is not visible"); Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), addedVideoTitle, "Video is still visible as newest video"); }
Source:
<code>public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){ FilterTextField field = getFirstPanelField(); clearField(); type("is:-open"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("--"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); <START> type("is:-open & has:assignee"); <END> assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("(is:closed"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("is:invalid").push(KeyCode.ENTER); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("is:invalid & hello").push(KeyCode.ENTER); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); }</code><technical_language>This kind of one. this cover new</technical_language>

Target:
public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){ testInvalidFilterStyleApplied("is:-open"); testInvalidFilterStyleApplied("--"); testInvalidFilterStyleApplied("("); testInvalidFilterStyleApplied("incomplete &"); testInvalidFilterStyleAppliedAfterEnter("is:invalid"); }
Source:
<code>public void subscribeToConnection(ConnectionSubscriber subscriber) { BufferedReader receiver = null; try { receiver = new BufferedReader( new InputStreamReader(mSocket.getInputStream())); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } if(receiver != null) { while (!mSocket.isInputShutdown()) { try { String pushMessage = receiver.readLine(); Response response = new Response(pushMessage); subscriber.updateOn(response); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); <START> Log.d("DEBUG", e.getMessage()); <END> } catch (JSONException e) { subscriber.updateOnParsingProblem(e); Log.d("DEBUG", e.getMessage()); } } } }</code><technical_language>Please logs more explicit</technical_language>

Target:
public void subscribeToConnection(ConnectionSubscriber subscriber) { BufferedReader receiver = null; try { receiver = new BufferedReader( new InputStreamReader(mSocket.getInputStream())); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } if(receiver != null) { while (!mSocket.isInputShutdown()) { try { String pushMessage = receiver.readLine(); Response response = new Response(pushMessage); subscriber.updateOn(response); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } catch (JSONException e) { subscriber.updateOnParsingProblem(e); } } } }
Source:
<code>public void clickOpenPinTitle() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); <START> poiArticleLink.click(); <END> }</code><technical_language>a good practice is driver is switching defaultContent reset driver's state. way, next method is called this method need this method</technical_language>

Target:
public void clickOpenPinTitle() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); poiArticleLink.click(); driver.switchTo().defaultContent(); }
Source:
<code>public PagedResources<JobDefinitionResource> list(Pageable pageable, PagedResourcesAssembler<JobDefinition> assembler) { PagedResources<JobDefinitionResource> pagedResources = listValues(pageable, assembler); final List<JobDefinitionResource> maskedContents = new ArrayList<JobDefinitionResource>( pagedResources.getContent().size()); for (JobDefinitionResource jobDefinitionResource : pagedResources.getContent()) { jobDefinitionResource.getDefinition(); JobDefinitionResource maskedJobDefinitionResource = new JobDefinitionResource(jobDefinitionResource.getName(), <START> StreamUtils.maskPasswordsInStreamDefinition(jobDefinitionResource.getDefinition())); <END> maskedJobDefinitionResource.setDeployed(jobDefinitionResource.isDeployed()); maskedContents.add(maskedJobDefinitionResource); } return new PagedResources<JobDefinitionResource>(maskedContents, pagedResources.getMetadata(), pagedResources.getLinks()); }</code><technical_language>I need rename StreamUtils class method maskPasswordsInStreamDefinition generic operate stream/job definition</technical_language>

Target:
public PagedResources<JobDefinitionResource> list(Pageable pageable, PagedResourcesAssembler<JobDefinition> assembler) { PagedResources<JobDefinitionResource> pagedResources = listValues(pageable, assembler); final List<JobDefinitionResource> maskedContents = new ArrayList<JobDefinitionResource>( pagedResources.getContent().size()); for (JobDefinitionResource jobDefinitionResource : pagedResources.getContent()) { jobDefinitionResource.getDefinition(); JobDefinitionResource maskedJobDefinitionResource = new JobDefinitionResource(jobDefinitionResource.getName(), PasswordUtils.maskPasswordsInDefinition(jobDefinitionResource.getDefinition())); maskedJobDefinitionResource.setDeployed(jobDefinitionResource.isDeployed()); maskedContents.add(maskedJobDefinitionResource); } return new PagedResources<JobDefinitionResource>(maskedContents, pagedResources.getMetadata(), pagedResources.getLinks()); }
Source:
<code>protected void acceptRows( List<T> rows ) { try { acceptingRowsSemaphore.acquire(); waitForSubscribers(); for ( T row : rows ) { streamStep.getSubtransExecutor().acquireBufferPermit(); streamStep.incrementLinesInput(); publishProcessor.onNext( row ); } } catch ( InterruptedException e ) { <START> logChannel <END> .logError( getString( PKG, "BlockingQueueStream.AcceptRowsInterrupt", Arrays.toString( rows.toArray() ) ) ); } finally { acceptingRowsSemaphore.release(); } }</code><technical_language>need reset interrupt flag if rethrowing InterruptedException. Thread.currentThread().interrupt();</technical_language>

Target:
protected void acceptRows( List<T> rows ) { try { acceptingRowsSemaphore.acquire(); waitForSubscribers(); for ( T row : rows ) { streamStep.getSubtransExecutor().acquireBufferPermit(); streamStep.incrementLinesInput(); publishProcessor.onNext( row ); } } catch ( InterruptedException e ) { logChannel .logError( getString( PKG, "BlockingQueueStream.AcceptRowsInterrupt", Arrays.toString( rows.toArray() ) ) ); Thread.currentThread().interrupt(); } finally { acceptingRowsSemaphore.release(); } }