auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean tick() { <START> SerializationBehavior serializationBehavior = ((WorldProperties) this.world.getWorldInfo()).getSerializationBehavior(); <END> if (serializationBehavior != SerializationBehaviors.AUTOMATIC) { return false; } if (this.canSave() && !((WorldBridge) this.world).bridge$isFake()) { ((WorldServerBridge) this.world).bridge$getTimingsHandler().doChunkUnload.startTiming(); final Iterator<Chunk> iterator = this.loadedChunks.values().iterator(); int chunksUnloaded = 0; final long now = System.currentTimeMillis(); while (chunksUnloaded < this.impl$maxChunkUnloads && iterator.hasNext()) { final Chunk chunk = iterator.next(); final ChunkBridge spongeChunk = (ChunkBridge) chunk; if (chunk != null && chunk.unloadQueued && !spongeChunk.bridge$isPersistedChunk()) { if (this.bridge$getChunkUnloadDelay() > 0) { if ((now - spongeChunk.bridge$getScheduledForUnload()) < this.impl$chunkUnloadDelay) { continue; } spongeChunk.bridge$setScheduledForUnload(-1); } chunk.onUnload(); this.saveChunkData(chunk); this.saveChunkExtraData(chunk); iterator.remove(); chunksUnloaded++; } } ((WorldServerBridge) this.world).bridge$getTimingsHandler().doChunkUnload.stopTiming(); } this.chunkLoader.chunkTick(); return false; }</code><technical_language>variable final</technical_language>

Target:
public boolean tick() { final SerializationBehavior behavior = ((WorldProperties) this.world.getWorldInfo()).getSerializationBehavior(); if (behavior != SerializationBehaviors.AUTOMATIC) { return false; } if (this.shadow$canSave() && !((WorldBridge) this.world).bridge$isFake()) { ((WorldServerBridge) this.world).bridge$getTimingsHandler().doChunkUnload.startTiming(); final Iterator<Chunk> iterator = this.loadedChunks.values().iterator(); int chunksUnloaded = 0; final long now = System.currentTimeMillis(); while (chunksUnloaded < this.impl$maxChunkUnloads && iterator.hasNext()) { final Chunk chunk = iterator.next(); final ChunkBridge spongeChunk = (ChunkBridge) chunk; if (chunk != null && chunk.unloadQueued && !spongeChunk.bridge$isPersistedChunk()) { if (this.bridge$getChunkUnloadDelay() > 0) { if ((now - spongeChunk.bridge$getScheduledForUnload()) < this.impl$chunkUnloadDelay) { continue; } spongeChunk.bridge$setScheduledForUnload(-1); } chunk.onUnload(); this.saveChunkData(chunk); this.saveChunkExtraData(chunk); iterator.remove(); chunksUnloaded++; } } ((WorldServerBridge) this.world).bridge$getTimingsHandler().doChunkUnload.stopTiming(); } this.chunkLoader.chunkTick(); return false; }
Source:
<code>ExecutionPath addEdge(ExplodedGraph.Edge edge) { ImmutableList.Builder<JavaFileScannerContext.Location> flowBuilder = ImmutableList.builder(); flowBuilder.addAll(flow); List<JavaFileScannerContext.Location> laFlow = learnedAssociation(edge) .map(la -> flowFromLearnedAssociation(la, edge.parent)) .orElse(ImmutableList.of()); flowBuilder.addAll(laFlow); Symbol newTrackSymbol = newTrackedSymbol(edge); Set<LearnedConstraint> learnedConstraints = learnedConstraints(edge); List<JavaFileScannerContext.Location> lcFlow = flowFromLearnedConstraints(edge, learnedConstraints); flowBuilder.addAll(lcFlow); <START> if (isMethodInvocationNode(edge.parent)) { <END> List<JavaFileScannerContext.Location> yieldsFlow = flowFromYields(edge); flowBuilder.addAll(yieldsFlow); } return new ExecutionPath(edge, visited.add(edge), newTrackSymbol, flowBuilder.build(), visitedAllParents(edge) || shouldTerminate(learnedConstraints)); }</code><technical_language>I this test flow yield method in fact, algorithm is pretty straightforward method compute flow yield do if required... (and return emtpy list otherwise). (In fact if correct need test all...)</technical_language>

Target:
Stream<ExecutionPath> addEdge(ExplodedGraph.Edge edge) { ImmutableList.Builder<JavaFileScannerContext.Location> flowBuilder = ImmutableList.builder(); flowBuilder.addAll(flow); List<JavaFileScannerContext.Location> laFlow = learnedAssociation(edge) .map(la -> flowFromLearnedAssociation(la, edge.parent)) .orElse(ImmutableList.of()); flowBuilder.addAll(laFlow); Symbol newTrackSymbol = newTrackedSymbol(edge); Set<LearnedConstraint> learnedConstraints = learnedConstraints(edge); List<JavaFileScannerContext.Location> lcFlow = flowFromLearnedConstraints(edge, learnedConstraints); flowBuilder.addAll(lcFlow); boolean endOfPath = visitedAllParents(edge) || shouldTerminate(learnedConstraints); List<JavaFileScannerContext.Location> currentFlow = flowBuilder.build(); Set<List<JavaFileScannerContext.Location>> yieldsFlows = flowFromYields(edge); return yieldsFlows.stream() .map(yieldFlow -> ImmutableList.<JavaFileScannerContext.Location>builder().addAll(currentFlow).addAll(yieldFlow).build()) .map(f -> new ExecutionPath(edge, visited.add(edge), newTrackSymbol, f, endOfPath)); }
Source:
<code>private void requestReadMoreItems(final LayoutInflater layoutInflater) { new SuggestionsTask(app.getAPIForSite(pageTitle.getSite()), pageTitle.getSite(), pageTitle.getPrefixedText()) { @Override public void onFinish(FullSearchResults results) { readMoreItems = results; if (readMoreItems.getResults().size() > 0) { <START> setupReadMoreSection(layoutInflater, readMoreItems); <END> } else { readMoreContainer.setVisibility(View.GONE); } layoutContent(); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while fetching Read More titles.", caught); layoutContent(); } }.execute(); }</code><technical_language>container visible here. for user refresh page, a nonzero amount of "read more" items returned next time, in case show them</technical_language>

Target:
private void requestReadMoreItems(final LayoutInflater layoutInflater) { new SuggestionsTask(app.getAPIForSite(pageTitle.getSite()), pageTitle.getSite(), pageTitle.getPrefixedText()) { @Override public void onFinish(FullSearchResults results) { readMoreItems = results; if (readMoreItems.getResults().size() > 0) { setupReadMoreSection(layoutInflater, readMoreItems); readMoreContainer.setVisibility(View.VISIBLE); } else { readMoreContainer.setVisibility(View.GONE); } layoutContent(); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while fetching Read More titles.", caught); layoutContent(); } }.execute(); }
Source:
<code>public CompletableFuture<byte[]> renderPngForPanel(Dashboard dashboard, Panel panel, int width, int height, long from, long to, Map<String, String> variables) { final HttpUrl.Builder builder = baseUrl.newBuilder() .addPathSegment("render") .addPathSegment("d-solo") .addPathSegment(dashboard.getUid()) <START> .addPathSegments("z"); END> builder.addQueryParameter("panelId", Integer.toString(panel.getId())) .addQueryParameter("from", Long.toString(from)) .addQueryParameter("to", Long.toString(to)) .addQueryParameter("width", Integer.toString(width)) .addQueryParameter("height", Integer.toString(height)) .addQueryParameter("theme", "light"); variables.forEach((k,v) -> builder.addQueryParameter("var-"+ k, v)); final Request request = new Request.Builder() .url(builder.build()) .addHeader("Authorization", "Bearer " + config.getApiKey()) .build(); final CompletableFuture<byte[]> future = new CompletableFuture<>(); client.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { future.completeExceptionally(e); } @Override public void onResponse(Call call, Response response) { try (ResponseBody responseBody = response.body()) { if (!response.isSuccessful()) { future.completeExceptionally(new IOException("Request failed: " + response)); } try (InputStream is = responseBody.byteStream()) { future.complete(inputStreamToByteArray(is)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }</code><technical_language>Yeah right, I remember this work, get dashboard rendering it. Generally official render is slug instead of UID. I guess hoping for this break? (-:</technical_language>

Target:
public CompletableFuture<byte[]> renderPngForPanel(Dashboard dashboard, Panel panel, int width, int height, long from, long to, Map<String, String> variables) { final HttpUrl.Builder builder = baseUrl.newBuilder() .addPathSegment("render") .addPathSegment("d-solo") .addPathSegment(dashboard.getUid()) .addPathSegments(dashboard.getMeta().getSlug()); builder.addQueryParameter("panelId", Integer.toString(panel.getId())) .addQueryParameter("from", Long.toString(from)) .addQueryParameter("to", Long.toString(to)) .addQueryParameter("width", Integer.toString(width)) .addQueryParameter("height", Integer.toString(height)) .addQueryParameter("theme", "light"); variables.forEach((k,v) -> builder.addQueryParameter("var-"+ k, v)); final Request request = new Request.Builder() .url(builder.build()) .addHeader("Authorization", "Bearer " + config.getApiKey()) .build(); final CompletableFuture<byte[]> future = new CompletableFuture<>(); client.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { future.completeExceptionally(e); } @Override public void onResponse(Call call, Response response) { try (ResponseBody responseBody = response.body()) { if (!response.isSuccessful()) { future.completeExceptionally(new IOException("Request failed: " + response)); } try (InputStream is = responseBody.byteStream()) { future.complete(inputStreamToByteArray(is)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
Source:
<code>protected void onDisplay(NavigateEvent navigateEvent) { isHandlingEvent = true; try { if (navigateEvent instanceof OpenCustomGamesEvent) { playRootTabPane.getSelectionModel().select(customGamesTab); customGamesController.display(navigateEvent); lastTab = customGamesController; } else if (navigateEvent instanceof Open1v1Event) { playRootTabPane.getSelectionModel().select(ladderTab); ladderController.display(navigateEvent); lastTab = ladderController; } else if (navigateEvent instanceof OpenCoopEvent) { playRootTabPane.getSelectionModel().select(coopTab); coopController.display(navigateEvent); lastTab = coopController; } else if (Objects.equals(navigateEvent.getClass(), NavigateEvent.class)) { <START> lastTab.display(navigateEvent); <END> } } finally { isHandlingEvent = false; } }</code><technical_language>null check</technical_language>

Target:
protected void onDisplay(NavigateEvent navigateEvent) { isHandlingEvent = true; try { if (navigateEvent instanceof OpenCustomGamesEvent) { playRootTabPane.getSelectionModel().select(customGamesTab); customGamesController.display(navigateEvent); } if (navigateEvent instanceof Open1v1Event) { playRootTabPane.getSelectionModel().select(ladderTab); ladderController.display(navigateEvent); } if (navigateEvent instanceof OpenCoopEvent) { playRootTabPane.getSelectionModel().select(coopTab); coopController.display(navigateEvent); } } finally { isHandlingEvent = false; } }
Source:
<code>public void apply(final Project project) { project.getTasks().create("release"); <START> final ReleaseWorkflowExtension ext = project.getExtensions().create("releaseWorkflow", ReleaseWorkflowExtension.class, project); <END> project.getGradle().addListener(new TaskExecutionListener() { public void beforeExecute(Task task) public void afterExecute(Task task, TaskState taskState) { if (taskState.getFailure() != null && ext.steps.contains(task)) { for (Task rollback : ext.rollbacks) { rollback.setEnabled(true); } } } }); GitTool gitTool = Git.gitTool(Exec.getProcessRunner(project.getProjectDir())); project.getExtensions().getExtraProperties().set("gitTool", gitTool); }</code><technical_language>constants</technical_language>

Target:
public void apply(final Project project) { project.getTasks().create("release"); final ReleaseWorkflowExtension ext = project.getExtensions().create("releaseWorkflow", ReleaseWorkflowExtension.class, project); project.getGradle().addListener(new PostStepTaskEnabler(ext)); GitTool gitTool = Git.gitTool(Exec.getProcessRunner(project.getProjectDir())); project.getExtensions().getExtraProperties().set("gitTool", gitTool); }
Source:
<code>private void initializeMacPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { List<String> macsForMacPool = macPoolDao.getAllMacsForMacPool(macPool.getId()); final MacPool pool = createPoolInternal(macPool); log.debug("Initializing with macs: {}", pool, macsForMacPool); <START> pool.addMacs(macsForMacPool); <END> }</code><technical_language>A scenario needs checked - 1. Create a mac pool allows duplicated. 2. Add duplicate mac pool. 3. Change mac pool allowing duplicates (is possible?) If point 3 is or. if is allowed 4. Stop engine. 5. Start engine. If I understand correctly, get exception add duplicate mac address a mac pool allow it</technical_language>

Target:
private void initializeMacPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { List<String> macsForMacPool = macPoolDao.getAllMacsForMacPool(macPool.getId()); final MacPool pool = createPoolInternal(macPool); log.debug("Initializing with macs: {}", pool, macsForMacPool); List<String> notAddedMacs = pool.addMacs(macsForMacPool); if (!notAddedMacs.isEmpty()) { throw new EngineException(EngineError.MAC_POOL_INITIALIZATION_FAILED, "Unable to initialize MAC pool due to existing duplicates"); } }
Source:
<code>public DiskImage getDiskImageByDiskAndImageIds(Guid diskId, Guid imageId) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() <START> .addValue("disk_id", diskId) .addValue("image_id", imageId); <END> return getCallsHandler().executeRead("GetDiskImageByDiskAndImageIds", DiskImageRowMapper.instance, parameterSource); }</code><technical_language>pass user_id is_filtered - example in getAncestor</technical_language>

Target:
public DiskImage getDiskImageByDiskAndImageIds(Guid diskId, Guid imageId) { return getDiskImageByDiskAndImageIds(diskId, imageId, null, false); }
Source:
<code>public void deleteEntriesUsingCachePolicy(int numRowsToDelete) { try { IndexEventHolder indexEventHolder = (IndexEventHolder) stateHolder.getState().getEventHolder(); Set<Object> keys = indexEventHolder.getAllPrimaryKeyValues(); int[] minCountArray = new int[numRowsToDelete]; Arrays.fill(minCountArray, Integer.MAX_VALUE); Object[] keyOfMinCountArray = new Object[numRowsToDelete]; for (Object key: keys) { <START> Object[] data = indexEventHolder.getEvent(key).getOutputData(); <END> int count = (int) data[cachePolicyAttributePosition]; for (int i = 0; i < numRowsToDelete; i++) { if (count < minCountArray[i]) { minCountArray[i] = count; keyOfMinCountArray[i] = key; } } } for (Object deleteKey: keyOfMinCountArray) { if (deleteKey != null) { indexEventHolder.deleteEvent(deleteKey); } } } catch (ClassCastException e) { log.error(siddhiAppContext + ": " + e.getMessage()); } }</code><technical_language>recheck this logic</technical_language>

Target:
public void deleteEntriesUsingCachePolicy(int numRowsToDelete) { IndexEventHolder indexEventHolder = (IndexEventHolder) stateHolder.getState().getEventHolder(); if (numRowsToDelete >= indexEventHolder.size()) { indexEventHolder.deleteAll(); } else { Set<Object> keys = indexEventHolder.getAllPrimaryKeyValues(); TreeMap<Integer, Object> toDelete = new TreeMap<>(); for (Object key : keys) { if (toDelete.size() < numRowsToDelete) { toDelete.put((Integer) indexEventHolder.getEvent(key).getOutputData()[cachePolicyAttributePosition], key); } else { Integer count = (Integer) indexEventHolder.getEvent(key). getOutputData()[cachePolicyAttributePosition]; Integer firstKey = toDelete.firstKey(); if (count < firstKey) { toDelete.remove(firstKey); toDelete.put(count, key); } } } for (Object deleteKey: toDelete.values()) { if (deleteKey != null) { indexEventHolder.deleteEvent(deleteKey); } } } }
Source:
<code>public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException { <START> InetAddress listeningAddress = socket.getInetAddress(); <END> SSLSocket s = (SSLSocket) getTunnelSSLSocketFactory(targethost, listeningAddress).createSocket(socket, socket .getInetAddress().getHostAddress(), socket.getPort(), true); s.setUseClientMode(false); s.startHandshake(); return s; }</code><technical_language>This call getLocalAddress(), generating cert remote address</technical_language>

Target:
public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException { InetAddress listeningAddress = socket.getLocalAddress(); SSLSocket s = (SSLSocket) getTunnelSSLSocketFactory(targethost, listeningAddress).createSocket(socket, socket .getInetAddress().getHostAddress(), socket.getPort(), true); s.setUseClientMode(false); s.startHandshake(); return s; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof NetworkCluster)) { return false; } NetworkCluster other = (NetworkCluster) obj; return display == other.display && Objects.equals(status, other.status) && Objects.equals(id, other.id) <START> && required == other.required && Objects.equals(migration, other.migration) && Objects.equals(management, other.management) && Objects.equals(gluster, other.gluster); <END> }</code><technical_language>Please '==' for booleans do for required</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof NetworkCluster)) { return false; } NetworkCluster other = (NetworkCluster) obj; return display == other.display && status == other.status && Objects.equals(id, other.id) && required == other.required && migration == other.migration && management == other.management && gluster == other.gluster; }
Source:
<code>private Object deleteObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("DELETE must not include data argument"); } if (!context.ids.isPresent()) { throw new BadRequestException("DELETE must include ids argument"); } ConnectionContainer connection = (ConnectionContainer) fetchObjects(context); Set<PersistentResource> toDelete = connection.getPersistentResources(); toDelete.forEach(PersistentResource::deleteResource); return new ConnectionContainer( <START> Sets.difference(connection.getPersistentResources(), toDelete), <END> Optional.empty(), connection.getTypeName() ); }</code><technical_language>This correct. I tests work deleted everything. However, toDelete = connection.getPersistentResources() Sets.difference() empty. If want return _current_ state, need fetch of objects id fields first</technical_language>

Target:
private Object deleteObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("DELETE must not include data argument"); } if (!context.ids.isPresent()) { throw new BadRequestException("DELETE must include ids argument"); } ConnectionContainer connection = (ConnectionContainer) fetchObjects(context); Set<PersistentResource> toDelete = connection.getPersistentResources(); toDelete.forEach(PersistentResource::deleteResource); return new ConnectionContainer( Collections.emptySet(), Optional.empty(), connection.getTypeName() ); }
Source:
<code>public DefaultLocalPersistenceService(final PersistenceConfiguration persistenceConfiguration) { if(persistenceConfiguration != null) { rootDirectory = persistenceConfiguration.getRootDirectory(); } else { <START> throw new IllegalArgumentException("PersistenceConfiguration cannot be null"); <END> } diskStorePathManager = new DiskStorePathManager(rootDirectory.getAbsolutePath()); }</code><technical_language>a NPE</technical_language>

Target:
public DefaultLocalPersistenceService(final PersistenceConfiguration persistenceConfiguration) { if(persistenceConfiguration != null) { rootDirectory = persistenceConfiguration.getRootDirectory(); } else { throw new NullPointerException("PersistenceConfiguration cannot be null"); } diskStorePathManager = new DiskStorePathManager(rootDirectory.getAbsolutePath()); }
Source:
<code>private static File[] getFilesInFolderByRegex(File folder, final String regex) throws FileNotFoundException { if (!folder.exists()) { throw new FileNotFoundException(); } if (!folder.isDirectory()) { throw new IllegalStateException( "execution jar is suppose to be in this folder, but the object present is not a directory: " + folder); } File[] matchingFiles = folder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.matches(regex)) return true; else return false; } }); if (matchingFiles == null) { throw new IllegalStateException( <START> "the ls command in ResolveExecutionJarName threw an IOException"); <END> } return matchingFiles; }</code><technical_language>This error message is useful. "no matching files for folder regex: " + regex</technical_language>

Target:
private static File[] getFilesInFolderByRegex(File folder, final String regex) throws FileNotFoundException { if (!folder.exists()) { throw new FileNotFoundException(); } if (!folder.isDirectory()) { throw new IllegalStateException( "execution jar is suppose to be in this folder, but the object present is not a directory: " + folder); } File[] matchingFiles = folder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.matches(regex)) return true; else return false; } }); if (matchingFiles == null) { throw new IllegalStateException( "the File[] matchingFiles variable is null. This means an IOException occured while doing listFiles. Please check disk availability and retry again"); } return matchingFiles; }
Source:
<code>public Response deactivate(Action action) { boolean forceMaintenance = <START> action.isForce() == null ? false : action.isForce(); <END> return doAction(ActionType.DeactivateStorageDomainWithOvfUpdate, new DeactivateStorageDomainWithOvfUpdateParameters(guid, dataCenterId, forceMaintenance), action); }</code><technical_language>usage of force aligned rest of backend commands: action.isSetForce() ? action.isForce() : false</technical_language>

Target:
public Response deactivate(Action action) { boolean forceMaintenance = action.isSetForce() ? action.isForce() : false; return doAction(ActionType.DeactivateStorageDomainWithOvfUpdate, new DeactivateStorageDomainWithOvfUpdateParameters(guid, dataCenterId, forceMaintenance), action); }
Source:
<code><START> public LocalDateTime toLocalDateTimeBin(TimeZone tz, byte[] bytes) throws PSQLException { <END> ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(null, bytes, true); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return LocalDateTime.MAX; } else if (parsedTimestamp.infinity == Infinity.NEGATIVE) { return LocalDateTime.MAX; } return LocalDateTime.ofEpochSecond(parsedTimestamp.millis / 1000L, parsedTimestamp.nanos, ZoneOffset.UTC); }</code><technical_language>Is this change required</technical_language>

Target:
public LocalDateTime toLocalDateTimeBin(TimeZone tz, byte[] bytes) throws PSQLException { ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(tz, bytes, true); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return LocalDateTime.MAX; } else if (parsedTimestamp.infinity == Infinity.NEGATIVE) { return LocalDateTime.MAX; } return LocalDateTime.ofEpochSecond(parsedTimestamp.millis / 1000L, parsedTimestamp.nanos, ZoneOffset.UTC); }
Source:
<code>private List<String> relationPK(RelationModel rm) throws <START> OrmException, SQLException { <END> Collection<ColumnModel> cols = rm.getPrimaryKeyColumns(); List<String> pk = new ArrayList<>(cols.size()); for (ColumnModel cm : cols) { pk.add(cm.getColumnName().toUpperCase(Locale.US)); } return pk; }</code><technical_language>thrown</technical_language>

Target:
private List<String> relationPK(RelationModel rm) { Collection<ColumnModel> cols = rm.getPrimaryKeyColumns(); List<String> pk = new ArrayList<>(cols.size()); for (ColumnModel cm : cols) { pk.add(cm.getColumnName().toLowerCase(Locale.US)); } return pk; }
Source:
<code>public void testMetadataContentRecordV1() throws IOException, MessageFormatException { List<String> keys = getKeys(60, 5); ByteBuffer metadataContent = getMetadataContent(keys); List<String> outKeys = deserializeMetadataContent(metadataContent); compareLists(outKeys, keys); metadataContent.flip(); byte currentRandomByte = metadataContent.get(16); metadataContent.put(16, (byte) (currentRandomByte + 1)); try { deserializeMetadataContent(metadataContent); <START> Assert.assertEquals(true, false); <END> } catch (MessageFormatException e) { Assert.assertEquals(e.getErrorCode(), MessageFormatErrorCodes.Data_Corrupt); } }</code><technical_language>fail() pass some message it</technical_language>

Target:
public void testMetadataContentRecordV1() throws IOException, MessageFormatException { List<StoreKey> keys = getKeys(60, 5); ByteBuffer metadataContent = getSerializedMetadataContent(keys); List<StoreKey> outKeys = deserializeMetadataContent(metadataContent, new MockIdFactory()); Assert.assertEquals("List of keys dont match", keys, outKeys); }
Source:
<code>public static void assumeKafkaEnabled() { if ("true".equals(System.getProperty("kafka")) || STREAM_KAFKA.equals(System.getProperty(STREAM_PROPERTY))) { if (!KafkaUtils.kafkaDetected()) { fail("Kafka is enabled, but no Kafka server found."); } } else { <START> Assume.assumeTrue("Kafka not enabled", false); <END> } }</code><technical_language>imported statically</technical_language>

Target:
public static void assumeKafkaEnabled() { if ("true".equals(System.getProperty("kafka")) || STREAM_KAFKA.equals(System.getProperty(STREAM_PROPERTY))) { if (!KafkaUtils.kafkaDetected()) { fail("Kafka is enabled, but no Kafka server found."); } } else { assumeTrue("Kafka not enabled", false); } }
Source:
<code><START> private Transaction startTransaction(PreCommitCondition preCommitCondition, ConflictHandler conflictHandler) { <END> ImmutableMap<TableReference, ConflictHandler> tablesToWriteWrite = ImmutableMap.of( TEST_TABLE, conflictHandler, TransactionConstants.TRANSACTION_TABLE, ConflictHandler.IGNORE_ALL); return new SerializableTransaction( MetricsManagers.createForTests(), keyValueService, new LegacyTimelockService(timestampService, lockService, lockClient), transactionService, NoOpCleaner.INSTANCE, Suppliers.ofInstance(timestampService.getFreshTimestamp()), TestConflictDetectionManagers.createWithStaticConflictDetection(tablesToWriteWrite), SweepStrategyManagers.createDefault(keyValueService), 0L, Optional.empty(), preCommitCondition, AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING, null, TransactionReadSentinelBehavior.THROW_EXCEPTION, true, timestampCache, AtlasDbConstants.DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS, AbstractTransactionTest.GET_RANGES_EXECUTOR, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, MultiTableSweepQueueWriter.NO_OP, MoreExecutors.newDirectExecutorService(), CommitProfileProcessor.createNonLogging(metricsManager)) { @Override protected Map<Cell, byte[]> transformGetsForTesting(Map<Cell, byte[]> map) { return Maps.transformValues(map, input -> input.clone()); } }; }</code><technical_language>Sad times, I easily work this</technical_language>

Target:
private Transaction startTransaction(PreCommitCondition preCommitCondition, ConflictHandler conflictHandler) { ImmutableMap<TableReference, ConflictHandler> tablesToWriteWrite = ImmutableMap.of( TEST_TABLE, conflictHandler, TransactionConstants.TRANSACTION_TABLE, ConflictHandler.IGNORE_ALL); return new SerializableTransaction( MetricsManagers.createForTests(), keyValueService, timelockService, transactionService, NoOpCleaner.INSTANCE, Suppliers.ofInstance(timestampService.getFreshTimestamp()), TestConflictDetectionManagers.createWithStaticConflictDetection(tablesToWriteWrite), SweepStrategyManagers.createDefault(keyValueService), 0L, Optional.empty(), preCommitCondition, AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING, null, TransactionReadSentinelBehavior.THROW_EXCEPTION, true, timestampCache, AtlasDbConstants.DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS, AbstractTransactionTest.GET_RANGES_EXECUTOR, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, MultiTableSweepQueueWriter.NO_OP, MoreExecutors.newDirectExecutorService(), CommitProfileProcessor.createNonLogging(metricsManager)) { @Override protected Map<Cell, byte[]> transformGetsForTesting(Map<Cell, byte[]> map) { return Maps.transformValues(map, input -> input.clone()); } }; }
Source:
<code><START> public AccessToken ensureAccessToken() { <END> try { Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); return this; } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } }</code><technical_language>clear me. If this instance is instantiated this Object other a Access Token. If underlying logic is creating AccessToken JWT is access token is a bug. This class check anything. return true if asked "are access token"? If is a chance this code returns false this is a bug. I this method removed. I do (if necessary) is constructor asserting JWT, this object created jwt is access token</technical_language>

Target:
private void ensureAccessToken() { try { Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } }
Source:
<code>public void run() { if (!isPlanExecuting.compareAndSet(false, true)) { LOG.log(Level.INFO, "Skipping Optimization, because it is already under optimization process"); return; } optimizationThreadPool.submit(new Runnable() { @Override public void run() { LOG.log(Level.INFO, "Optimization start. Start calculating the optimal plan"); final Collection<EvaluatorParameters> serverEvalParams = serverEM.generateEvalParams(DATA_TYPE_SERVER).values(); final Collection<EvaluatorParameters> workerEvalParams = workerEM.generateEvalParams(DATA_TYPE_WORKER).values(); final Map<String, List<EvaluatorParameters>> evaluatorParameters = new HashMap<>(2); evaluatorParameters.put(NAMESPACE_SERVER, new ArrayList<>(serverEvalParams)); evaluatorParameters.put(NAMESPACE_WORKER, new ArrayList<>(workerEvalParams)); final Plan plan = optimizer.optimize(evaluatorParameters, maxNumEvals); LOG.log(Level.INFO, "Calculating the optimal plan is finished. Start executing plan: {0}", plan); final Future<PlanResult> planExecutionResultFuture = planExecutor.execute(plan); try { final PlanResult planResult = planExecutionResultFuture.get(); LOG.log(Level.INFO, "Result of plan execution: {0}", planResult); <START> Thread.sleep(10000); END> } catch (final InterruptedException | ExecutionException e) { LOG.log(Level.WARNING, "Exception while waiting for the plan execution to be completed"); } isPlanExecuting.set(false); } }); }</code><technical_language>Please move this magic number a static variable</technical_language>

Target:
public void run() { if (!isPlanExecuting.compareAndSet(false, true)) { LOG.log(Level.INFO, "Skipping Optimization, because it is already under optimization process"); return; } optimizationThreadPool.submit(new Runnable() { @Override public void run() { LOG.log(Level.INFO, "Optimization start. Start calculating the optimal plan"); final Collection<EvaluatorParameters> serverEvalParams = serverEM.generateEvalParams(DATA_TYPE_SERVER).values(); final Collection<EvaluatorParameters> workerEvalParams = workerEM.generateEvalParams(DATA_TYPE_WORKER).values(); final Map<String, List<EvaluatorParameters>> evaluatorParameters = new HashMap<>(2); evaluatorParameters.put(NAMESPACE_SERVER, new ArrayList<>(serverEvalParams)); evaluatorParameters.put(NAMESPACE_WORKER, new ArrayList<>(workerEvalParams)); final Plan plan = optimizer.optimize(evaluatorParameters, maxNumEvals); LOG.log(Level.INFO, "Calculating the optimal plan is finished. Start executing plan: {0}", plan); final Future<PlanResult> planExecutionResultFuture = planExecutor.execute(plan); try { final PlanResult planResult = planExecutionResultFuture.get(); LOG.log(Level.INFO, "Result of plan execution: {0}", planResult); Thread.sleep(MARGIN_TIME_MS); } catch (final InterruptedException | ExecutionException e) { LOG.log(Level.WARNING, "Exception while waiting for the plan execution to be completed"); } isPlanExecuting.set(false); } }); }
Source:
<code>public void run(ToolConfig config, SystemAccess system) { this.config = config; this.system = system; PromptPomMigrationService promptService = new PromptPomMigrationService(system, config); String jsonPath = promptService.promptForExternalConfiguration(); Path niogitDir = config.getTarget(); system.out().println("Starting POMs migration"); if (projectMigrationWasExecuted()) { try { MigrationSetup.configureProperties(system, niogitDir); weldContainer = new Weld().initialize(); cdiWrapper = weldContainer.instance().select(ServiceCDIWrapper.class).get(); if (systemMigrationWasExecuted()) { WorkspaceProjectService service = weldContainer.instance().select(WorkspaceProjectService.class).get(); Collection<WorkspaceProject> projects = service.getAllWorkspaceProjects(); for(WorkspaceProject prj : projects){ processWorkspaceProject(prj, jsonPath); } } String userHome = System.getProperty("user.home"); <START> system.out().println("End POMs migration, detailed log available on "+userHome + "/migration_tool.log"); <END> }finally { if (weldContainer != null) { try { cdiWrapper = null; weldContainer.close(); } catch (Exception ex) { } } } } }</code><technical_language>"End POMs migration" -> Finished POMs migration</technical_language>

Target:
public void run(ToolConfig config, SystemAccess system) { this.config = config; this.system = system; if (projectMigrationWasExecuted()) { system.out().println("Starting POMs migration"); migrate(); system.out().println("Finished POMs migration, detailed log available in " + System.getProperty("user.dir") + "/migration_tool.log"); } }
Source:
<code>public void end() { set(Value.IS_CURRENT, false); set(Value.WALLTIME_END, ScoreBoardClock.getInstance().getCurrentWalltime()); <START> if (getTeam().hasFieldingAdvancePending() && getCurrentFielding().getTeamJam().isRunningOrUpcoming()) { <END> getCurrentFielding().setSkater(null); remove(Child.FIELDING, getCurrentFielding()); } set(Value.END_FIELDING, get(Value.CURRENT_FIELDING)); set(Value.END_BETWEEN_JAMS, !scoreBoard.isInJam() && !getTeam().hasFieldingAdvancePending()); set(Value.END_AFTER_S_P, getEndFielding().getTeamJam().isStarPass()); set(Value.JAM_CLOCK_END, endedBetweenJams() ? 0L : scoreBoard.getClock(Clock.ID_JAM).getTimeElapsed()); getCurrentFielding().updateBoxTripSymbols(); if (getStartFielding() == getEndFielding() && endedBetweenJams()) { unlink(); } }</code><technical_language>more broken this, this needs unittests. start I wrote, covers corner cases I found</technical_language>

Target:
public void end() { set(Value.IS_CURRENT, false); set(Value.WALLTIME_END, ScoreBoardClock.getInstance().getCurrentWalltime()); if (!scoreBoard.isInJam() && getCurrentFielding().getTeamJam().isRunningOrUpcoming()) { if (getTeam().hasFieldingAdvancePending()) { getCurrentFielding().setSkater(null); } remove(Child.FIELDING, getCurrentFielding()); } if (getCurrentFielding() == null) { unlink(); } else { set(Value.END_FIELDING, get(Value.CURRENT_FIELDING)); set(Value.END_BETWEEN_JAMS, !scoreBoard.isInJam() && !getTeam().hasFieldingAdvancePending() && getEndFielding().getTeamJam().isRunningOrEnded()); set(Value.END_AFTER_S_P, getEndFielding().getTeamJam().isStarPass() && getEndFielding().isCurrent()); set(Value.JAM_CLOCK_END, endedBetweenJams() ? 0L : scoreBoard.getClock(Clock.ID_JAM).getTimeElapsed()); getCurrentFielding().updateBoxTripSymbols(); } }
Source:
<code>public void invoke() { for (int x = 0; x < retry; x++) { try { Optional<ManagementClient> orchestrator = getOrchestrator(); if(orchestrator.isPresent()){ UUID workflowId = sendRequest(orchestrator.get()); waitForWorkflow(workflowId, orchestrator.get(), timeout, pollPeriod); } else{ throw new IllegalStateException("Orchestrator can not be selected"); } } catch(RuntimeException e) { log.warn("WorkflowRequest: Additional handling of the exception wrapped herein." + <START> " Running on attempt {}, cause:", this, x, e); <END> } catch (NetworkException | TimeoutException | IllegalStateException e) { log.warn("WorkflowRequest: Error while running on attempt {}, cause:", this, x, e); } for (int y = 0; y < runtime.getParameters().getInvalidateRetry(); y++) { runtime.invalidateLayout(); Layout layoutToVerify = new Layout(runtime.getLayoutView().getLayout()); if (verifyRequest(layoutToVerify)) { log.info("WorkflowRequest: Successfully completed {}", this); return; } } log.warn("WorkflowRequest: Retrying on attempt {}", this, x); } throw new WorkflowResultUnknownException(); }</code><technical_language>This catch mask next catch block, NetworkException IllegalStateException RuntimeException, need put next catch block. Please check @PavelZaytsev if initially intentionally wanted retry other runtime exceptions, some edge cases</technical_language>

Target:
public void invoke() { for (int retryIteration = 0; retryIteration < retry; retryIteration++) { try { Optional<ManagementClient> orchestrator = getOrchestrator(); if(orchestrator.isPresent()){ UUID workflowId = sendRequest(orchestrator.get()); waitForWorkflow(workflowId, orchestrator.get(), timeout, pollPeriod); } else { log.warn("Orchestrator can not be selected"); } } catch (TimeoutException e) { log.warn("WorkflowRequest: Error while running on attempt {}, cause:", this, retryIteration, e); } catch (RuntimeException e) { handleException(e); } for (int y = 0; y < runtime.getParameters().getInvalidateRetry(); y++) { runtime.invalidateLayout(); Layout layoutToVerify = new Layout(runtime.getLayoutView().getLayout()); if (verifyRequest(layoutToVerify)) { log.info("WorkflowRequest: Successfully completed {}", this); return; } } log.warn("WorkflowRequest: Retrying on attempt {}", this, retryIteration); } throw new WorkflowResultUnknownException(); }
Source:
<code>public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final Period p = getChunkPeriod(query); if (p.toStandardDuration().getMillis() == 0) { return baseRunner.run(query, responseContext); } List<Interval> chunkIntervals = Lists.newArrayList(FunctionalIterable .create(query.getIntervals()) .transformCat( new Function<Interval, Iterable<Interval>>() { @Override public Iterable<Interval> apply(Interval input) { return splitInterval(input, p); } } )); <START> if(chunkIntervals.size() <= 1) { <END> return baseRunner.run(query, responseContext); } final QueryRunner<T> finalQueryRunner = new AsyncQueryRunner<T>( toolChest.mergeResults( new MetricsEmittingQueryRunner<T>( emitter, new Function<Query<T>, ServiceMetricEvent.Builder>() { @Override public ServiceMetricEvent.Builder apply(Query<T> input) { return toolChest.makeMetricBuilder(query); } }, baseRunner ).withWaitMeasuredFromNow()), executor, queryWatcher); return Sequences.concat( Lists.newArrayList(FunctionalIterable.create(chunkIntervals).transform( new Function<Interval, Sequence<T>>() { @Override public Sequence<T> apply(Interval singleInterval) { return finalQueryRunner.run( query.withQuerySegmentSpec(new MultipleIntervalSegmentSpec(Arrays.asList(singleInterval))), responseContext ); } } )) ); }</code><technical_language>style problems</technical_language>

Target:
public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final Period chunkPeriod = getChunkPeriod(query); if (chunkPeriod.toStandardDuration().getMillis() == 0) { return baseRunner.run(query, responseContext); } List<Interval> chunkIntervals = Lists.newArrayList(FunctionalIterable .create(query.getIntervals()) .transformCat( new Function<Interval, Iterable<Interval>>() { @Override public Iterable<Interval> apply(Interval input) { return splitInterval(input, chunkPeriod); } } )); if(chunkIntervals.size() <= 1) { return baseRunner.run(query, responseContext); } final QueryRunner<T> finalQueryRunner = new AsyncQueryRunner<T>( toolChest.mergeResults( new MetricsEmittingQueryRunner<T>( emitter, new Function<Query<T>, ServiceMetricEvent.Builder>() { @Override public ServiceMetricEvent.Builder apply(Query<T> input) { return toolChest.makeMetricBuilder(input); } }, baseRunner ).withWaitMeasuredFromNow()), executor, queryWatcher); return Sequences.concat( Lists.newArrayList(FunctionalIterable.create(chunkIntervals).transform( new Function<Interval, Sequence<T>>() { @Override public Sequence<T> apply(Interval singleInterval) { return finalQueryRunner.run( query.withQuerySegmentSpec(new MultipleIntervalSegmentSpec(Arrays.asList(singleInterval))), responseContext ); } } )) ); }
Source:
<code>private void addAffinityLabels() { List<Label> affinityLabels = getParameters().getAffinityLabels(); for (Label label : affinityLabels) { label.addVm(getVm()); <START> labelDao.update(label); <END> } }</code><technical_language>Hmm, I do better, hard create a bulk update call</technical_language>

Target:
private void addAffinityLabels() { List<Label> affinityLabels = getParameters().getAffinityLabels(); List<Guid> labelIds = affinityLabels.stream() .map(Label::getId) .collect(Collectors.toList()); labelDao.addVmToLabels(getVmId(), labelIds); }
Source:
<code>private boolean shouldUpdateImageProperties() { <START> if (getOldDisk().getDiskStorageType() == DiskStorageType.IMAGE) { <END> return false; } Guid oldQuotaId = ((DiskImage) getOldDisk()).getQuotaId(); return !ObjectUtils.objectsEqual(oldQuotaId, getQuotaId()); }</code><technical_language>IIUC, this "!= DiskStorageType.IMAGE", no</technical_language>

Target:
private boolean shouldUpdateImageProperties() { if (getOldDisk().getDiskStorageType() != DiskStorageType.IMAGE) { return false; } Guid oldQuotaId = ((DiskImage) getOldDisk()).getQuotaId(); return !ObjectUtils.objectsEqual(oldQuotaId, getQuotaId()); }
Source:
<code>private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debug("Check if ISO compatible: '{}'", iso); for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { try { Matcher matcher = info.isoPattern.matcher( iso.getCanonicalFile().getName() ); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debug("ISO version: '{}' '{}' '{}'", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debug("ISO compatible '{}'", iso); ret = true; break; } } } catch (IOException e) { log.error( <START> "Cannot get canonical path to '{}' with error {}", <END> iso.getName(), ExceptionUtils.getMessage(e) ); } } } return ret; }</code><technical_language>s/ error/:/</technical_language>

Target:
private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debug("Check if ISO compatible: '{}'", iso); for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { try { Matcher matcher = info.isoPattern.matcher( iso.getCanonicalFile().getName() ); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debug("ISO version: '{}' '{}' '{}'", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debug("ISO compatible '{}'", iso); ret = true; break; } } } catch (IOException e) { log.error( "Cannot get canonical path to '{}': {}", iso.getName(), ExceptionUtils.getMessage(e) ); log.debug("Exception", e); } } } return ret; }
Source:
<code>private void launchVerificationActivity() { Intent i = new Intent(this, CommCareVerificationActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); <START> this.startActivityForResult(i, DispatchActivity.MISSING_MEDIA_ACTIVITY); <END> }</code><technical_language>this reference SingleAppManagerActivity.MISSING_MEDIA_ACTIVITY</technical_language>

Target:
private void launchVerificationActivity() { Intent i = new Intent(this, CommCareVerificationActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); this.startActivityForResult(i, MISSING_MEDIA_ACTIVITY); }
Source:
<code><START> private MethodSpec createConstructor(StorIOSQLiteTypeMeta storIOSQLiteTypeMeta) { <END> final ClassName putResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, PutResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName getResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, GetResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName deleteResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, DeleteResolverGenerator.generateName(storIOSQLiteTypeMeta)); return MethodSpec.constructorBuilder() .addModifiers(PUBLIC) .addStatement("super(new $T(), new $T(), new $T())", putResolver, getResolver, deleteResolver) .build(); }</code><technical_language>Nullability annotations</technical_language>

Target:
private MethodSpec createConstructor(StorIOSQLiteTypeMeta storIOSQLiteTypeMeta) { final ClassName putResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, PutResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName getResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, GetResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName deleteResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, DeleteResolverGenerator.generateName(storIOSQLiteTypeMeta)); return MethodSpec.constructorBuilder() .addModifiers(PUBLIC) .addStatement("super(new $T(),\nnew $T(),\nnew $T())", putResolver, getResolver, deleteResolver) .build(); }
Source:
<code>private void dispatchFromQueue() { while (true) { try { <START> RATE_LIMITED_LOGGER.trace("Asking dispatch queue for the next entry..."); <END> Map.Entry<String, S> messageEntry = dispatchQueue.dequeue(); RATE_LIMITED_LOGGER.trace("Received message entry from dispatch queue {}", messageEntry); activeDispatchers.incrementAndGet(); RATE_LIMITED_LOGGER.trace("Sending message via sync dispatcher", messageEntry); syncDispatcher.send(messageEntry.getValue()); RATE_LIMITED_LOGGER.trace("Successfully sent message {}", messageEntry); if (messageEntry.getKey() != null) { RATE_LIMITED_LOGGER.trace("Attempting to complete future for message {}", messageEntry); CompletableFuture<DispatchStatus> messageFuture = futureMap.remove(messageEntry.getKey()); if (messageFuture != null) { messageFuture.complete(DispatchStatus.DISPATCHED); RATE_LIMITED_LOGGER.trace("Completed future for message {}", messageEntry); } else { RATE_LIMITED_LOGGER.warn("No future found for message {}", messageEntry); } } else { RATE_LIMITED_LOGGER.trace("Dequeued an entry with a null key"); } activeDispatchers.decrementAndGet(); } catch (InterruptedException e) { break; } catch (Exception e) { RATE_LIMITED_LOGGER.warn("Encountered exception while taking from dispatch queue", e); } } }</code><technical_language>standard logger for instead of RATE_LIMITED_LOGGER. RATE_LIMITED_LOGGER is intended avoid flooding log error messages</technical_language>

Target:
private void dispatchFromQueue() { while (true) { try { LOG.trace("Asking dispatch queue for the next entry..."); Map.Entry<String, S> messageEntry = dispatchQueue.dequeue(); LOG.trace("Received message entry from dispatch queue {}", messageEntry); activeDispatchers.incrementAndGet(); LOG.trace("Sending message via sync dispatcher", messageEntry); syncDispatcher.send(messageEntry.getValue()); LOG.trace("Successfully sent message {}", messageEntry); if (messageEntry.getKey() != null) { LOG.trace("Attempting to complete future for message {}", messageEntry); CompletableFuture<DispatchStatus> messageFuture = futureMap.remove(messageEntry.getKey()); if (messageFuture != null) { messageFuture.complete(DispatchStatus.DISPATCHED); LOG.trace("Completed future for message {}", messageEntry); } else { RATE_LIMITED_LOGGER.warn("No future found for message {}", messageEntry); } } else { LOG.trace("Dequeued an entry with a null key"); } activeDispatchers.decrementAndGet(); } catch (InterruptedException e) { break; } catch (Exception e) { RATE_LIMITED_LOGGER.warn("Encountered exception while taking from dispatch queue", e); } } }