auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void anonUserOnMobileCanSeeAppPromotion() { Promoting promoting = findPromoting(); Assertion.assertTrue(promoting.isMobileBannerDisplayed()); <START> Assertion.assertStringContains(promoting.getPromotionAppMobileText(), MOBILE_PROMOTION_TEXT); <END> }</code><technical_language>static imports for form Assertion</technical_language>

Target:
public void anonUserOnMobileCanSeeAppPromotion() { Promoting promoting = findPromoting(); assertTrue(promoting.isMobileBannerDisplayed()); assertStringContains(promoting.getPromotionAppMobileText(), MOBILE_PROMOTION_TEXT); }
Source:
<code>public void run() { TestCasesConfig config = new TestCasesConfig("/cases-config.properties"); Map<String, TestCase> cases = new TestCasesProvider(config).getCases(); Map<String, TestCaseResult> results = new HashMap<>(); ClientConfig clientConfig = new ClientConfig(); clientConfig.register(new LoggingFilter(Logger.getLogger(getClass().getName()), true)); Client client = ClientBuilder.newClient(clientConfig); for (Map.Entry<String, TestCase> entry : cases.entrySet()) { results.put(entry.getKey(), entry.getValue().execute(client)); } for (Map.Entry<String, TestCaseResult> entry : results.entrySet()) { <START> System.out.println(String.format("%s: %s", entry.getKey(), entry.getValue().isSuccessful()? "OK":"FAILED")); <END> for (String errorMessage : entry.getValue().getErrorMessages()) { System.out.println(String.format(" %s", errorMessage)); } } }</code><technical_language>a logger</technical_language>

Target:
public void run() { TestCasesConfig config = new TestCasesConfig("/cases-config.properties"); Map<String, TestCase> cases = new TestCasesProvider(config).getCases(); Map<String, TestCaseResult> results = new HashMap<>(); ClientConfig clientConfig = new ClientConfig(); clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(getClass().getSimpleName()), true)); Client client = ClientBuilder.newClient(clientConfig); for (Map.Entry<String, TestCase> entry : cases.entrySet()) { results.put(entry.getKey(), entry.getValue().execute(client)); } for (Map.Entry<String, TestCaseResult> entry : results.entrySet()) { if (entry.getValue().isSuccessful()) { logger.info(String.format("%s: OK", entry.getKey())); } else { logger.error(String.format("%s: FAILED", entry.getKey())); for (String errorMessage : entry.getValue().getErrorMessages()) { logger.error(String.format(" %s", errorMessage)); } } } }
Source:
<code>public DistinctCountBufferAggregator( DimensionSelector selector ) { this.selector = selector; <START> this.idForNull = selector.nameLookupPossibleInAdvance() ? selector.idLookup().lookupId(null) : -1; <END> }</code><technical_language>in non-buffered aggregator</technical_language>

Target:
public DistinctCountBufferAggregator( DimensionSelector selector ) { this.selector = selector; Preconditions.checkArgument( selector.nameLookupPossibleInAdvance() || selector.getValueCardinality() != DimensionSelector.CARDINALITY_UNKNOWN, "DistinctCountBufferAggregator not supported for selector" ); this.idForNull = selector.nameLookupPossibleInAdvance() ? selector.idLookup().lookupId(null) : UNKNOWN; }
Source:
<code>public Response createDataset(@Auth AuthUser user, @Context UriInfo info, String json) { DataSetDTO ds = new Gson().fromJson(json, DataSetDTO.class); if (Objects.isNull(ds)) { throw new BadRequestException("Dataset is required"); } if (Objects.isNull(ds.getProperties())) { throw new BadRequestException("Dataset must contain required properties"); } List<DataSetPropertyDTO> invalidProperties = datasetService.findInvalidProperties(ds.getProperties()); if (invalidProperties.size() > 0) { List<String> invalidKeys = invalidProperties.stream().map(p -> p.getPropertyName()).collect( Collectors.toList()); <START> throw new BadRequestException("Dataset contains invalid properties that could not be recognized or associated with a key: " + invalidKeys.toString()); <END> } String name = ds.getPropertyValue("Dataset Name"); if (Objects.isNull(name)) { throw new BadRequestException("Dataset name is required"); } DataSet datasetNameAlreadyUsed = datasetService.getDatasetByName(name); if (Objects.nonNull(datasetNameAlreadyUsed)) { throw new NotFoundException("Dataset name: " + name + " is already in use"); } DataSet dataset = datasetService.createDataset(ds, name); URI uri = info.getRequestUriBuilder().replacePath("api/dataset/{datasetId}").build(ds.getDataSetId()); return Response.created(uri).entity(dataset).build(); }</code><technical_language>Nice error handling here</technical_language>

Target:
public Response createDataset(@Auth AuthUser user, @Context UriInfo info, String json) { DataSetDTO ds = new Gson().fromJson(json, DataSetDTO.class); if (Objects.isNull(ds)) { throw new BadRequestException("Dataset is required"); } if (Objects.isNull(ds.getProperties()) || ds.getProperties().isEmpty()) { throw new BadRequestException("Dataset must contain required properties"); } List<DataSetPropertyDTO> invalidProperties = datasetService.findInvalidProperties(ds.getProperties()); if (invalidProperties.size() > 0) { List<String> invalidKeys = invalidProperties.stream().map(p -> p.getPropertyName()).collect( Collectors.toList()); throw new BadRequestException("Dataset contains invalid properties that could not be recognized or associated with a key: " + invalidKeys.toString()); } String name = ds.getPropertyValue("Dataset Name"); if (Objects.isNull(name)) { throw new BadRequestException("Dataset name is required"); } DataSet datasetNameAlreadyUsed = datasetService.getDatasetByName(name); if (Objects.nonNull(datasetNameAlreadyUsed)) { throw new NotFoundException("Dataset name: " + name + " is already in use"); } DataSet dataset = datasetService.createDataset(ds, name); URI uri = info.getRequestUriBuilder().replacePath("api/dataset/{datasetId}").build(ds.getDataSetId()); return Response.created(uri).entity(dataset).build(); }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { if (skip || skipExec || skipTests) { getLog().info("Skipping tests"); return; } if (!"eclipse-test-plugin".equals(project.getPackaging())) { getLog().warn("Unsupported packaging type " + project.getPackaging()); return; } if (testSuite != null || testClass != null) { if (testSuite == null || testClass == null) { throw new MojoExecutionException("Both testSuite and testClass must be provided or both should be null"); } MavenProject suite = getTestSuite(testSuite); if (suite == null) { throw new MojoExecutionException("Cannot find test suite project with Bundle-SymbolicName " + testSuite); } if (!suite.equals(project)) { getLog().info("Not executing tests, testSuite=" + testSuite + " and project is not the testSuite"); return; } } EquinoxInstallation testRuntime; <START> if (provisionInstallation) { <END> testRuntime = createProvisionedInstallation(); } else { testRuntime = createEclipseInstallation(DefaultReactorProject.adapt(session)); } runTest(testRuntime); }</code><technical_language>IF for supporting 3 kinds of test runtime (minimal TP, provision product pre-existing provisioned product, interesting factorize installation of tests a provisioned product: if (provisionInstallation || provisionnedApplication != null) { if (provisionInstallation) { testRuntime = provisionInstallation(); // provision product } else if (provisionnedApplication != null) { testRuntime = getProvisionnedInstallationFacade(); } ((ProvisionnedEquinoxInstallation)testRuntime).installTestsAndDependencies(...); } else { testRuntime = createEclipseInstallation(DefaultReactorProject.adapt(session)); } Also, renaming "createEclipseInstallation" "createMinimalEclipseInstallation" clearer this is p2 provisioning</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip || skipExec || skipTests) { getLog().info("Skipping tests"); return; } if (!"eclipse-test-plugin".equals(project.getPackaging())) { getLog().warn("Unsupported packaging type " + project.getPackaging()); return; } if (testSuite != null || testClass != null) { if (testSuite == null || testClass == null) { throw new MojoExecutionException("Both testSuite and testClass must be provided or both should be null"); } MavenProject suite = getTestSuite(testSuite); if (suite == null) { throw new MojoExecutionException("Cannot find test suite project with Bundle-SymbolicName " + testSuite); } if (!suite.equals(project)) { getLog().info("Not executing tests, testSuite=" + testSuite + " and project is not the testSuite"); return; } } EquinoxInstallation testRuntime; if (provisionInstallation) { testRuntime = createProvisionedInstallation(); } else { testRuntime = createEclipseInstallation(); } runTest(testRuntime); }
Source:
<code>public void corruptedCustomMovesTest() { setSolverConfigCalculatorClass(TestdataDifferentValuesCalculator.class); switch (environmentMode) { case FULL_ASSERT: case FAST_ASSERT: setSolverConfigMoveListFactoryClassToCorrupted(TestdataChangeMoveWithCorruptedUndoMoveFactory.class); assertIllegalStateExceptionWhileSolving("corrupted undoMove"); break; case NON_INTRUSIVE_FULL_ASSERT: setSolverConfigMoveListFactoryClassToCorrupted(TestdataCorruptedEntityUndoMoveFactory.class); assertIllegalStateExceptionWhileSolving("not the uncorruptedScore"); break; case REPRODUCIBLE: case NON_REPRODUCIBLE: case PRODUCTION: break; default: <START> throw new AssertionError("Missing case for " + environmentMode); <END> } }</code><technical_language>Feel free Assertions.fail() for this purpose. Also, I tune of "Environment mode covered: {}"</technical_language>

Target:
public void corruptedCustomMovesTest() { setSolverConfigCalculatorClass(TestdataDifferentValuesCalculator.class); switch (environmentMode) { case FULL_ASSERT: case FAST_ASSERT: setSolverConfigMoveListFactoryClassToCorrupted(TestdataCorruptedUndoMoveFactory.class); assertIllegalStateExceptionWhileSolving("corrupted undoMove"); break; case NON_INTRUSIVE_FULL_ASSERT: setSolverConfigMoveListFactoryClassToCorrupted(TestdataCorruptedEntityUndoMoveFactory.class); assertIllegalStateExceptionWhileSolving("not the uncorruptedScore"); break; case REPRODUCIBLE: case NON_REPRODUCIBLE: case PRODUCTION: break; default: Assertions.fail("Environment mode not covered: " + environmentMode); } }
Source:
<code>public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) { <START> if (stack.hasTagCompound()) { <END> Binding binding = getBinding(stack); if (binding != null) { tooltip.add(new TextComponentTranslation("tooltip.bloodmagic.currentOwner", binding.getOwnerName()).getFormattedText()); } } }</code><technical_language>is reason for formatting changes</technical_language>

Target:
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) { if (!stack.hasTagCompound()) return; Binding binding = getBinding(stack); if (binding != null) tooltip.add(new TextComponentTranslation("tooltip.bloodmagic.currentOwner", binding.getOwnerName()).getFormattedText()); }
Source:
<code>public void refresh() { if (patchSet.getId().equals(diffBaseId)) { <START> if (patchTable != null) { <END> patchTable.setVisible(false); } if (actionsPanel != null) { actionsPanel.setVisible(false); } } else { if (patchTable != null) { if (patchTable.getBase() == null && diffBaseId == null || patchTable.getBase() != null && patchTable.getBase().equals(diffBaseId)) { actionsPanel.setVisible(true); patchTable.setVisible(true); return; } } AccountDiffPreference diffPrefs; if (patchTable == null) { diffPrefs = new ListenableAccountDiffPreference().get(); } else { diffPrefs = patchTable.getPreferences().get(); patchTable.setVisible(false); } Util.DETAIL_SVC.patchSetDetail2(diffBaseId, patchSet.getId(), diffPrefs, new GerritCallback<PatchSetDetail>() { @Override public void onSuccess(PatchSetDetail result) { if (actionsPanel != null) { actionsPanel.setVisible(true); } else { loadedActionPanel(result); } loadedPatchTable(result); } }); } }</code><technical_language>If in line 202 set patchTable in else block null, remove this if block? If a patchTable exists simply visible</technical_language>

Target:
public void refresh() { if (patchSet.getId().equals(diffBaseId)) { if (patchTable != null) { patchTable.setVisible(false); } if (actionsPanel != null) { actionsPanel.setVisible(false); } } else { if (patchTable != null) { if (patchTable.getBase() == null && diffBaseId == null || patchTable.getBase() != null && patchTable.getBase().equals(diffBaseId)) { actionsPanel.setVisible(true); patchTable.setVisible(true); return; } } AccountDiffPreference diffPrefs; if (patchTable == null) { diffPrefs = new ListenableAccountDiffPreference().get(); } else { diffPrefs = patchTable.getPreferences().get(); patchTable.setVisible(false); } Util.DETAIL_SVC.patchSetDetail2(diffBaseId, patchSet.getId(), diffPrefs, new GerritCallback<PatchSetDetail>() { @Override public void onSuccess(PatchSetDetail result) { if (actionsPanel != null) { actionsPanel.setVisible(true); } else { loadActionPanel(result); } loadPatchTable(result); } }); } }
Source:
<code>public void deleteServiceAccounts(Collection<ServiceAccount> serviceAccountsToDelete) { serviceAccountsToDelete.stream() .forEach( sa -> { serviceAccountDAO().delete(sa.getId()); try { if (fiatService.isPresent()) { fiatService.get().logoutUser(sa.getId()); } } catch (RetrofitError re) { <START> log.warn("Could not delete service account user $serviceAccountId", re); <END> } }); if (!serviceAccountsToDelete.isEmpty()) syncUsers(serviceAccountsToDelete); }</code><technical_language>Java string interpolation, I assume like: suggestion log.warn("Could delete service account user {}", sa.getId(), re);</technical_language>

Target:
public void deleteServiceAccounts(Collection<ServiceAccount> serviceAccountsToDelete) { serviceAccountsToDelete.stream() .forEach( sa -> { try { serviceAccountDAO.delete(sa.getId()); if (fiatService.isPresent()) { fiatService.get().logoutUser(sa.getId()); } } catch (Exception e) { log.warn("Could not delete service account user {}", sa.getId(), e); } }); if (!serviceAccountsToDelete.isEmpty()) { syncUsers(serviceAccountsToDelete); } }
Source:
<code>private static int findGroupStart(String pattern, int currentIndex, Character invalidWildgetCharacter) { <START> if (invalidWildgetCharacter != null && invalidWildgetCharacter == '\\') { <END> return pattern.indexOf('[', currentIndex); } return findNotEscapedCharacterPosition(pattern, currentIndex, '['); }</code><technical_language>style-nit; braces for simple single-statement constrcuts</technical_language>

Target:
private static int findGroupStart(String pattern, int currentIndex, Character invalidWildgetCharacter) { if (invalidWildgetCharacter != null && invalidWildgetCharacter == '\\') return pattern.indexOf('[', currentIndex); return findNotEscapedCharacterPosition(pattern, currentIndex, '['); }
Source:
<code>public List<TaskDTO> findOpenTasksForCurrentUser(String sort) throws DataException { <START> LoginForm login = (LoginForm) Helper.getManagedBeanValue("#{LoginForm}"); <END> if (login == null) { return new ArrayList<>(); } List<JSONObject> results = findByProcessingStatusAndUser(TaskStatus.INWORK, login.getMyBenutzer().getId(), sort); return convertJSONObjectsToDTOs(results, false); }</code><technical_language>Rebase error - Helper.getCurrentUser</technical_language>

Target:
public List<TaskDTO> findOpenTasksForCurrentUser(String sort) throws DataException { User user = Helper.getCurrentUser(); if (user == null) { return new ArrayList<>(); } List<JSONObject> results = findByProcessingStatusAndUser(TaskStatus.INWORK, user.getId(), sort); return convertJSONObjectsToDTOs(results, false); }
Source:
<code>public void leaveToken(DetailAST ast) { Map<String, DetailAST> scope = null; switch (ast.getType()) { case TokenTypes.OBJBLOCK: case TokenTypes.CTOR_DEF: case TokenTypes.METHOD_DEF: scope = scopeStack.pop().scope; break; case TokenTypes.SLIST: final PrevScopeUnitializedVariableData prevScopeUnitializedVariableData = prevScopeUninitializedVariableStack.peek(); if (ast.getParent().getType() != TokenTypes.CASE_GROUP || findLastChildWhichContainsSpecifiedToken(ast.getParent().getParent(), TokenTypes.CASE_GROUP, TokenTypes.SLIST) == ast.getParent()) { scope = scopeStack.pop().scope; prevScopeUninitializedVariableStack.pop(); } <START> <END> final DetailAST parent = ast.getParent(); if (!isTryCatchOrFinallyToken(parent) && (parent.getType() != TokenTypes.LITERAL_ELSE || findLastToken(parent.getParent(), TokenTypes.LITERAL_ELSE) != parent)) { updateUninitializedVariable(prevScopeUnitializedVariableData); } break; default: } if (scope != null) { for (DetailAST node : scope.values()) { log(node.getLineNo(), node.getColumnNo(), MSG_KEY, node.getText()); } } }</code><technical_language>@Bhavik3 I empty space here, close case</technical_language>

Target:
public void leaveToken(DetailAST ast) { Map<String, DetailAST> scope = null; switch (ast.getType()) { case TokenTypes.OBJBLOCK: case TokenTypes.CTOR_DEF: case TokenTypes.METHOD_DEF: scope = scopeStack.pop().scope; break; case TokenTypes.SLIST: final Deque<DetailAST> prevScopeUnitializedVariableData = prevScopeUninitializedVariables.peek(); if (ast.getParent().getType() != TokenTypes.CASE_GROUP || findLastChildWhichContainsSpecifiedToken(ast.getParent().getParent(), TokenTypes.CASE_GROUP, TokenTypes.SLIST) == ast.getParent()) { scope = scopeStack.pop().scope; prevScopeUninitializedVariables.pop(); } final DetailAST parent = ast.getParent(); if (shouldUpdateUninitializedVariables(parent)) { updateUninitializedVariables(prevScopeUnitializedVariableData); } break; default: } if (scope != null) { for (DetailAST node : scope.values()) { log(node.getLineNo(), node.getColumnNo(), MSG_KEY, node.getText()); } } }
Source:
<code>private void enableAllFields() { languageLabel.setEnabled(true); <START> if(algorithmGroup != null) algorithmGroup.setEnabled(true); <END> commentLabel.setEnabled(true); commentText.setEnabled(true); languageCombo.setEnabled(true); }</code><technical_language>methods protected move algorithmGroup soly algorithmgroup class override methods is</technical_language>

Target:
protected void enableAllFields() { languageLabel.setEnabled(true); algorithmGroup.setEnabled(true); commentLabel.setEnabled(true); commentText.setEnabled(true); languageCombo.setEnabled(true); }
Source:
<code>public <T extends Descriptor> List<T> getDescriptors(String target, String xp) { Map<String, List<Descriptor>> descriptorsByXP = descriptors.getOrDefault(target, Collections.emptyMap()) .getOrDefault(xp, Collections.emptyMap()); List<T> result = new ArrayList<>(descriptorsByXP.size()); <START> descriptorsByXP.values() <END> .stream() .forEachOrdered(l -> { T o = (T) merge(l); if (o != null) { result.add(o); } }); Collections.sort(result); return result; }</code><technical_language>slow do merge time call getDescriptor. I prefer if merge result cached cache invalidated if a descriptor this id added/removed</technical_language>

Target:
public <T extends Descriptor> List<T> getDescriptors(String target, String xp) { return (List<T>) descriptors.getOrDefault(target, Collections.emptyMap()) .getOrDefault(xp, Collections.emptyMap()) .values() .stream() .map(this::merge) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
<code>public ImmutableSpongeGravityData(boolean value) { <START> super(ImmutableGravityData.class, value, Keys.ENTITY_HAS_GRAVITY, SpongeGravityData.class, false); <END> }</code><technical_language>DataConstants for default values</technical_language>

Target:
public ImmutableSpongeGravityData(boolean value) { super(ImmutableGravityData.class, value, Keys.HAS_GRAVITY, SpongeGravityData.class, DataConstants.DEFAULT_HAS_GRAVITY); }
Source:
<code>public void changeQuestionAnswer(User u, String question, String answer) throws DAOException { log.info("Updating secret question and answer for " + u.getUsername()); LoginCredential credentials = getLoginCredential(u); credentials.setSecretQuestion(question); <START> String hashedAnswer = Security.encodeString(answer + credentials.getSalt()); <END> credentials.setSecretAnswer(hashedAnswer); credentials.setDateChanged(new Date()); credentials.setChangedBy(u); updateLoginCredential(credentials); }</code><technical_language>I suggest answer.toLowerCase() secret answer validation case insensitive</technical_language>

Target:
public void changeQuestionAnswer(User u, String question, String answer) throws DAOException { log.info("Updating secret question and answer for " + u.getUsername()); LoginCredential credentials = getLoginCredential(u); credentials.setSecretQuestion(question); String hashedAnswer = Security.encodeString(answer.toLowerCase() + credentials.getSalt()); credentials.setSecretAnswer(hashedAnswer); credentials.setDateChanged(new Date()); credentials.setChangedBy(u); updateLoginCredential(credentials); }
Source:
<code><START> public void afterEach(ExtensionContext context) throws Exception { <END> BrokerRunningSupport brokerRunning = BROKER_RUNNING_HOLDER.get(); if (brokerRunning != null && brokerRunning.isPurgeAfterEach()) { brokerRunning.purgeTestQueues(); } }</code><technical_language>Exception is redundant</technical_language>

Target:
public void afterEach(ExtensionContext context) { BrokerRunningSupport brokerRunning = BROKER_RUNNING_HOLDER.get(); if (brokerRunning != null && brokerRunning.isPurgeAfterEach()) { brokerRunning.purgeTestQueues(); } }
Source:
<code>public List<WorkspaceImpl> getByNamespace(String namespace, boolean includeRuntimes) throws ServerException { requireNonNull(namespace, "Required non-null namespace"); final List<WorkspaceImpl> workspaces = workspaceDao.getByNamespace(namespace); <START> if (includeRuntimes) { <END> for (WorkspaceImpl workspace : workspaces) { normalizeState(workspace); } } else { for (WorkspaceImpl workspace : workspaces) { workspace.setStatus(runtimes.getStatus(workspace.getId())); } } return workspaces; }</code><technical_language>logic if rewrite code for (WorkspaceImpl workspace : workspaces) { normalizeState(workspace, includeRuntimes); }</technical_language>

Target:
public List<WorkspaceImpl> getByNamespace(String namespace, boolean includeRuntimes) throws ServerException { requireNonNull(namespace, "Required non-null namespace"); final List<WorkspaceImpl> workspaces = workspaceDao.getByNamespace(namespace); for (WorkspaceImpl workspace : workspaces) { normalizeState(workspace, includeRuntimes); } return workspaces; }
Source:
<code>private SortBuffer getSortBuffer() { if (currentSortBuffer != null) { return currentSortBuffer; <START> } <END> currentSortBuffer = new PartitionSortedBuffer(bufferPool, numSubpartitions, networkBufferSize); return currentSortBuffer; }</code><technical_language>I logic is easily understand some overheads in practice. if (!sortBuffer.hasRemaining()) { // record appended free sort buffer is large releaseCurrentSortBuffer(); writeLargeRecord(record, targetSubpartition, dataType); return; } flushCurrentSortBuffer(); emit(record, targetSubpartition, dataType); flush current buffer call emit try out unfilled sort buffer hold large record not. sortBuffer.append request segments LocalBufferPool exhausted return false decide flush large record. I of options for improvement here. - SortMergeResultPartition more light-weight component dispatch record/events, SortBuffer decide append records in cache, flush flush large records internally. need expose interfaces interact SortMergeResultPartition. - SortBuffer provide another method expose cache threshold, easily internal LocalBufferPool. SortMergeResultPartition decide flush large record avoid unnecessary requesting segments</technical_language>

Target:
private SortBuffer getSortBuffer() { if (currentSortBuffer != null && !currentSortBuffer.isFinished()) { return currentSortBuffer; } currentSortBuffer = new PartitionSortedBuffer( lock, bufferPool, numSubpartitions, networkBufferSize, null); return currentSortBuffer; }
Source:
<code>private double computeKappa(HullWhiteOneFactorPiecewiseConstantParametersProvider hwProvider, double[] discountedCashFlow, double[] alpha, double omega) { double kappa = 0d; if (DoubleArrayMath.fuzzyEqualsZero(alpha, SMALL)) { double totalPv = DoubleArrayMath.sum(discountedCashFlow); kappa = totalPv * omega > 0d ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY; } else { <START> kappa = hwProvider.getModel().kappa(DoubleArray.copyOf(discountedCashFlow), DoubleArray.copyOf(alpha)); <END> } return kappa; }</code><technical_language>Do need a copy of data</technical_language>

Target:
private double computeKappa(HullWhiteOneFactorPiecewiseConstantParametersProvider hwProvider, double[] discountedCashFlow, double[] alpha, double omega) { double kappa = 0d; if (DoubleArrayMath.fuzzyEqualsZero(alpha, SMALL)) { double totalPv = DoubleArrayMath.sum(discountedCashFlow); kappa = totalPv * omega > 0d ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY; } else { kappa = hwProvider.getModel().kappa(DoubleArray.ofUnsafe(discountedCashFlow), DoubleArray.ofUnsafe(alpha)); } return kappa; }
Source:
<code>public <T, F extends Future<T>> Callable<T> decorateFutureSupplier(Supplier<F> futureSupplier) { return () -> { Future<T> future = futureSupplier.get(); try { T result = future.get(getTimeLimiterConfig().getTimeoutDuration().toMillis(), TimeUnit.MILLISECONDS); onSuccess(); return result; } catch (TimeoutException e) { <START> TimeoutException timeoutException = createdTimeoutExceptionWithName(name); <END> onError(timeoutException); if (getTimeLimiterConfig().shouldCancelRunningFuture()) { future.cancel(true); } throw timeoutException; } catch (ExecutionException e) { Throwable t = e.getCause(); if (t == null) { onError(e); throw e; } onError(t); if (t instanceof Error) { throw (Error) t; } throw (Exception) t; } }; }</code><technical_language>copy source stacktrace of original TimeoutException</technical_language>

Target:
public <T, F extends Future<T>> Callable<T> decorateFutureSupplier(Supplier<F> futureSupplier) { return () -> { Future<T> future = futureSupplier.get(); try { T result = future.get(getTimeLimiterConfig().getTimeoutDuration().toMillis(), TimeUnit.MILLISECONDS); onSuccess(); return result; } catch (TimeoutException e) { TimeoutException timeoutException = createdTimeoutExceptionWithName(name); timeoutException.setStackTrace(e.getStackTrace()); onError(timeoutException); if (getTimeLimiterConfig().shouldCancelRunningFuture()) { future.cancel(true); } throw timeoutException; } catch (ExecutionException e) { Throwable t = e.getCause(); if (t == null) { onError(e); throw e; } onError(t); if (t instanceof Error) { throw (Error) t; } throw (Exception) t; } }; }
Source:
<code>public void testDeleteOpenProjectLinux() throws <START> IOException { <END> if (!Platform.getOS().equals(Platform.OS_LINUX)) { return; } IProject project = null; File projectRoot = null; IFolder folder = null; try { IWorkspace workspace = getWorkspace(); project = workspace.getRoot().getProject(getUniqueString()); folder = project.getFolder("a_folder"); IFile file1 = folder.getFile("file1.txt"); IFile file2 = project.getFile("file2.txt"); ensureExistsInWorkspace(new IResource[] {file1, file2}, true); projectRoot = project.getLocation().toFile(); setReadOnly(folder, true); IFile projectFile = project.getFile(".project"); assertTrue("1.2", projectFile.exists()); assertTrue("1.3", projectFile.isSynchronized(IResource.DEPTH_INFINITE)); try { project.delete(IResource.FORCE, getMonitor()); } catch (CoreException ce) { ce.printStackTrace(); fail("2.0 - shouldn't have failed: " + ce.getMessage(), ce); } assertTrue("5.1", !project.exists()); assertTrue("5.2", !file1.exists()); assertTrue("5.3", file1.isSynchronized(IResource.DEPTH_INFINITE)); assertTrue("5.4", project.isSynchronized(IResource.DEPTH_INFINITE)); assertTrue("6.0", !projectRoot.exists()); } finally { if (folder != null && folder.exists()) setReadOnly(folder, false); if (projectRoot != null) ensureDoesNotExistInFileSystem(projectRoot); } }</code><technical_language>Better: throws Exception simplifies future evolution of code</technical_language>

Target:
public void testDeleteOpenProjectLinux() throws Exception { if (!Platform.getOS().equals(Platform.OS_LINUX)) { return; } IProject project = null; File projectRoot = null; IFolder folder = null; try { IWorkspace workspace = getWorkspace(); project = workspace.getRoot().getProject(getUniqueString()); folder = project.getFolder("a_folder"); IFile file1 = folder.getFile("file1.txt"); IFile file2 = project.getFile("file2.txt"); ensureExistsInWorkspace(new IResource[] {file1, file2}, true); projectRoot = project.getLocation().toFile(); setReadOnly(folder, true); IFile projectFile = project.getFile(".project"); assertTrue("1.2", projectFile.exists()); assertTrue("1.3", projectFile.isSynchronized(IResource.DEPTH_INFINITE)); try { project.delete(IResource.FORCE, getMonitor()); } catch (CoreException ce) { ce.printStackTrace(); fail("2.0 - shouldn't have failed: " + ce.getMessage(), ce); } assertTrue("5.1", !project.exists()); assertTrue("5.2", !file1.exists()); assertTrue("5.3", file1.isSynchronized(IResource.DEPTH_INFINITE)); assertTrue("5.4", project.isSynchronized(IResource.DEPTH_INFINITE)); assertTrue("6.0", !projectRoot.exists()); } finally { if (folder != null && folder.exists()) setReadOnly(folder, false); if (projectRoot != null) ensureDoesNotExistInFileSystem(projectRoot); } }
Source:
<code><START> public synchronized long getReservedRevocableBytes() <END> { return operatorMemoryContext.getRevocableMemory(); }</code><technical_language>remove synchronized</technical_language>

Target:
public long getReservedRevocableBytes() { return operatorMemoryContext.getRevocableMemory(); }
Source:
<code>StatsManager(StorageManager storageManager, List<? extends ReplicaId> replicaIds, MetricRegistry registry, StatsManagerConfig config, Time time) throws IOException { this.storageManager = storageManager; statsOutputFile = new File(config.outputFilePath); publishPeriodInSecs = config.publishPeriodInSecs; initialDelayInSecs = config.initialDelayUpperBoundInSecs; metrics = new StatsManagerMetrics(registry); mapper.setVisibilityChecker(mapper.getVisibilityChecker().withFieldVisibility(JsonAutoDetect.Visibility.ANY)); totalPartitionIds = new ArrayList<>(); partitionToReplicaMap = new HashMap<>(); PartitionId partitionId; for (ReplicaId replicaId : replicaIds) { partitionId = replicaId.getPartitionId(); totalPartitionIds.add(partitionId); <START> partitionToReplicaMap.put(partitionId, replicaId); <END> } this.time = time; }</code><technical_language>is totalPartitionIds needed? partitionToReplicaMap.keySet() iterate partitions? If need map do java partitionToReplicaMap = replicaIds.stream().collect(Collectors.toMap(ReplicaId::getPartitionId, Function.identity()));</technical_language>

Target:
StatsManager(StorageManager storageManager, List<? extends ReplicaId> replicaIds, MetricRegistry registry, StatsManagerConfig config, Time time) throws IOException { this.storageManager = storageManager; statsOutputFile = new File(config.outputFilePath); publishPeriodInSecs = config.publishPeriodInSecs; initialDelayInSecs = config.initialDelayUpperBoundInSecs; metrics = new StatsManagerMetrics(registry); partitionToReplicaMap = replicaIds.stream().collect(Collectors.toMap(ReplicaId::getPartitionId, Function.identity())); this.time = time; }
Source:
<code>public ValidationResult initialize(RuntimeContainer container, ComponentProperties properties) { <START> CouchbaseOutputProperties outputProperties = (CouchbaseOutputProperties) properties; <END> this.bootstrapNodes = outputProperties.bootstrapNodes.getStringValue(); this.bucket = outputProperties.bucket.getStringValue(); this.password = outputProperties.password.getStringValue(); this.idFieldName = outputProperties.idFieldName.getStringValue(); return ValidationResult.OK; }</code><technical_language>add instanceof additional check, return Result.ERROR if failed avoid ClassCastException</technical_language>

Target:
public ValidationResult initialize(RuntimeContainer container, ComponentProperties properties) { if (properties instanceof CouchbaseOutputProperties) { CouchbaseOutputProperties outputProperties = (CouchbaseOutputProperties) properties; this.bootstrapNodes = outputProperties.bootstrapNodes.getStringValue(); this.bucket = outputProperties.bucket.getStringValue(); this.password = outputProperties.password.getStringValue(); this.idFieldName = outputProperties.idFieldName.getStringValue(); this.dieOnError = outputProperties.dieOnError.getValue(); return ValidationResult.OK; } return new ValidationResult(Result.ERROR, "Wrong component properties, must be instanceof CouchbaseOutputProperties class"); }
Source:
<code>public List<String> getJavaOptsArray() { <START> return javaOptsArray == null ? ImmutableList.<String>of() : javaOptsArray; <END> }</code><technical_language>nan</technical_language>

Target:
public List<String> getJavaOptsArray() { return javaOptsArray; }
Source:
<code>protected void activate(ComponentContext context) { context.getBundleContext().registerService(EventHandler.class.getName(), new AccountLockEventHandler(), null); context.getBundleContext().registerService(TenantMgtListener.class.getName(), new TenantCreationEventListener(), null); init(); listener = new IdentityMgtEventListener(); serviceRegistration = context.getBundleContext().registerService(UserOperationEventListener.class.getName(), listener, null); <START> log.debug("Identity Management Listener is enabled"); <END> }</code><technical_language>check isDebugEnabled() debug log a practice</technical_language>

Target:
protected void activate(ComponentContext context) { context.getBundleContext().registerService(EventHandler.class.getName(), new AccountLockEventHandler(), null); context.getBundleContext().registerService(TenantMgtListener.class.getName(), new TenantCreationEventListener(), null); init(); listener = new IdentityMgtEventListener(); serviceRegistration = context.getBundleContext().registerService(UserOperationEventListener.class.getName(), listener, null); if(log.isDebugEnabled()){ log.debug("Identity Management Listener is enabled"); } }
Source:
<code>public void before() { CacheEventListenerConfigurationBuilder cacheEventListenerConfiguration = CacheEventListenerConfigurationBuilder .newEventListenerConfiguration((CacheEventListener<Long, String>) expirations::add, EventType.EXPIRED) .unordered() .synchronous(); CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .withLoaderWriter(new CacheLoaderWriter<Long, String>() { @Override public String load(Long key) throws Exception { sleep(latency.get()); return sor.get(key); } @Override public void write(Long key, String value) { sor.put(key, value); } @Override public void delete(Long key) { sor.remove(key); } }) .withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofMillis(TIME_TO_EXPIRATION))) <START> .add(cacheEventListenerConfiguration) <END> .build(); cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(new TimeSourceConfiguration(timeSource)) .build(true); cache = (InternalCache<Long, String>) cacheManager.getCache("aCache", Long.class, String.class); cacheStatistics = new DefaultCacheStatistics(cache, new DefaultStatisticsServiceConfiguration() .withLatencyHistorySize(2) .withLatencyHistoryWindow(400, MILLISECONDS), timeSource); }</code><technical_language>I please explain need a loader-writer here</technical_language>

Target:
public void before() { CacheEventListenerConfigurationBuilder cacheEventListenerConfiguration = CacheEventListenerConfigurationBuilder .newEventListenerConfiguration((CacheEventListener<Long, String>) expirations::add, EventType.EXPIRED) .unordered() .synchronous(); CacheLoaderWriter<Long, String> loaderWriter = new CacheLoaderWriter<Long, String>() { @Override public String load(Long key) throws Exception { sleep(latency.get()); return sor.get(key); } @Override public void write(Long key, String value) { sor.put(key, value); } @Override public void delete(Long key) { sor.remove(key); } }; CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .withLoaderWriter(loaderWriter) .withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofMillis(TIME_TO_EXPIRATION))) .add(cacheEventListenerConfiguration) .build(); cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(new TimeSourceConfiguration(timeSource)) .build(true); cache = (InternalCache<Long, String>) cacheManager.getCache("aCache", Long.class, String.class); cacheStatistics = new DefaultCacheStatistics(cache, new DefaultStatisticsServiceConfiguration() .withLatencyHistorySize(2) .withLatencyHistoryWindow(400, MILLISECONDS), timeSource); }
Source:
<code><START> public IndexMappingLoader(final Settings settings) { <END> try { }catch(Exception e){ } appMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_APP,DEFAULT_APPLICATIONS_MAPPING); opsMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_OPERATIONS,DEFAULT_OPERATIONS_MAPPING); emptyProjectMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_EMPTY,DEFAULT_EMPTY_MAPPING); }</code><technical_language>is this constructor called</technical_language>

Target:
public IndexMappingLoader(final Settings settings) { appMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_APP,DEFAULT_APPLICATIONS_MAPPING); opsMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_OPERATIONS,DEFAULT_OPERATIONS_MAPPING); emptyProjectMappingsTemplate = loadMapping(settings, OPENSHIFT_ES_KIBANA_SEED_MAPPINGS_EMPTY,DEFAULT_EMPTY_MAPPING); }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; <END> if (o == null || getClass() != o.getClass()) return false; Role role = (Role) o; return Objects.equal(name, role.name); }</code><technical_language>please curly braces bodies of if statements, if one-liners</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Role role = (Role) o; return Objects.equal(name, role.name); }
Source:
<code>protected List<Annotation> getTypeAnnotations(Mapper mapper) { if ( mapper.getDecorator() == null ) { return Arrays.asList( singleton(), named() ); } else { <START> return Collections.singletonList( namedDelegate( mapper ) ); <END> } }</code><technical_language>need add annotation well, delegate (i.e. actual mapper implementation) for a decorator get @Singleton annotation</technical_language>

Target:
protected List<Annotation> getTypeAnnotations(Mapper mapper) { if ( mapper.getDecorator() == null ) { return Arrays.asList( singleton(), named() ); } else { return Arrays.asList( singleton(), namedDelegate( mapper ) ); } }
Source:
<code>private DbSpace(EnvironmentImpl envImpl) { this.envImpl = envImpl; UtilizationProfile profile = this.envImpl.getUtilizationProfile(); SortedMap<Long, FileSummary> map = profile.getFileSummaryMap(true); Map<Long, FileSummary> recalcMap = (this.recalc) ? UtilizationFileReader.calcFileSummaryMap(this.envImpl) : null; int fileIndex = 0; totals = new Summary(); summaries = new Summary[map.size()]; Iterator<Map.Entry<Long, FileSummary>> iter = map.entrySet().iterator(); while(iter.hasNext()) { Map.Entry<Long, FileSummary> entry = iter.next(); Long fileNum = entry.getKey(); FileSummary fs = entry.getValue(); FileSummary recalcFs = null; if(recalcMap != null) { recalcFs = recalcMap.get(fileNum); } Summary summary = new Summary(fileNum, fs, recalcFs); <START> if(summaries != null) { <END> summaries[fileIndex] = summary; } totals.add(summary); fileIndex++; } if(summaries != null) { summaryDetails.append((this.recalc) ? " File Size (KB) % Used % Used (recalculated)\n-------- --------- ------ ------\n" : " File Size (KB) % Used\n-------- --------- ------\n"); for(int i = 0; i < summaries.length; ++i) { summaryDetails.append(summaries[i].toString()); summaryDetails.append("\n"); } } summaryDetails.append(totals.toString()); }</code><technical_language>summaries null "new"</technical_language>

Target:
private DbSpace(EnvironmentImpl envImpl) { this.envImpl = envImpl; UtilizationProfile profile = this.envImpl.getUtilizationProfile(); SortedMap<Long, FileSummary> map = profile.getFileSummaryMap(true); int fileIndex = 0; totals = new Summary(); summaries = new Summary[map.size()]; Iterator<Map.Entry<Long, FileSummary>> iter = map.entrySet().iterator(); while(iter.hasNext()) { Map.Entry<Long, FileSummary> entry = iter.next(); Long fileNum = entry.getKey(); FileSummary fs = entry.getValue(); Summary summary = new Summary(fileNum, fs); summaries[fileIndex] = summary; totals.add(summary); fileIndex++; } summaryDetails.append(" File Size (KB) % Used\n-------- --------- ------\n"); for(int i = 0; i < summaries.length; ++i) { summaryDetails.append(summaries[i].toString()); summaryDetails.append("\n"); } summaryDetails.append(totals.toString()); }
Source:
<code>public String getDataSharingNotificationForCurrentUser(Request request, Response response) { boolean shouldAllow = dataSharingNotification.allowNotificationFor(currentUsername()); <START> return jsonizeAsTopLevelObject(request, writer -> writer.add("allow", shouldAllow)); <END> }</code><technical_language>show_notification instead of allow</technical_language>

Target:
public String getDataSharingNotificationForCurrentUser(Request request, Response response) { boolean shouldAllow = dataSharingNotification.allowNotificationFor(currentUsername()); return jsonizeAsTopLevelObject(request, writer -> writer.add("show_notification", shouldAllow)); }
Source:
<code>public String index(Request request, Response response) throws IOException { List<CombinedPluginInfo> pluginInfos = new ArrayList<>(); String pluginType = request.queryParams("type"); Boolean includeBad = Boolean.valueOf(request.queryParams("include_bad")); try { Collection<CombinedPluginInfo> validPluginInfos = this.pluginInfoFinder.allPluginInfos(pluginType).stream() .filter(pluginInfo -> !hasUnsupportedExtensionType(pluginInfo)) .collect(Collectors.toList()); pluginInfos.addAll(validPluginInfos); } catch (InvalidPluginTypeException exception) { throw new UnprocessableEntityException(String.format("Invalid plugins type - `%s` !", pluginType)); } if (includeBad) { List<BadPluginInfo> badPluginInfos = defaultPluginManager.plugins().stream() .filter(GoPluginDescriptor::isInvalid) .map(BadPluginInfo::new) .collect(toList()); pluginInfos.addAll(badPluginInfos); } <START> String etag = etagFor(pluginInfos); <END> if (fresh(request, etag)) { return notModified(response); } setEtagHeader(response, etag); return writerForTopLevelObject(request, response, writer -> PluginInfosRepresenter.toJSON(writer, pluginInfos)); }</code><technical_language>order of pluginInfos is in scenarios Etag change event if plugininfos is</technical_language>

Target:
public String index(Request request, Response response) throws IOException { List<CombinedPluginInfo> pluginInfos = new ArrayList<>(); String pluginType = request.queryParams("type"); Boolean includeBad = Boolean.valueOf(request.queryParams("include_bad")); if (StringUtils.isNotBlank(pluginType) && !extensionsRegistry.allRegisteredExtensions().contains(pluginType)) { throw new UnprocessableEntityException(String.format("Invalid plugin type '%s'. It has to be one of '%s'.", pluginType, String.join(", ", extensionsRegistry.allRegisteredExtensions()))); } Collection<CombinedPluginInfo> validPluginInfos = this.pluginInfoFinder.allPluginInfos(pluginType).stream() .filter(pluginInfo -> !hasUnsupportedExtensionType(pluginInfo)) .collect(Collectors.toList()); pluginInfos.addAll(validPluginInfos); if (includeBad) { List<BadPluginInfo> badPluginInfos = defaultPluginManager.plugins().stream() .filter(GoPluginDescriptor::isInvalid) .map(BadPluginInfo::new) .collect(toList()); pluginInfos.addAll(badPluginInfos); } pluginInfos.sort(Comparator.comparing((CombinedPluginInfo pluginInfos1) -> pluginInfos1.getDescriptor().id())); String etag = etagFor(pluginInfos); if (fresh(request, etag)) { return notModified(response); } setEtagHeader(response, etag); return writerForTopLevelObject(request, response, writer -> PluginInfosRepresenter.toJSON(writer, pluginInfos)); }
Source:
<code>public List<StoredEntry> getCompressedBitmaps() { while (!searchOffset.isEmpty()) { StoredEntry <START> writeEntry = <END> generateStoredEntry( searchOffset.pollFirst()); bitmapsToWrite.add(writeEntry); } Collections.reverse(bitmapsToWrite); return bitmapsToWrite; }</code><technical_language>Please inline this variable</technical_language>

Target:
public List<StoredEntry> getCompressedBitmaps() { while (!bitmapsToWriteXorBuffer.isEmpty()) { bitmapsToWrite.add( generateStoredEntry(bitmapsToWriteXorBuffer.pollFirst())); } Collections.reverse(bitmapsToWrite); return bitmapsToWrite; }
Source:
<code>public void reset() { this.sequenceIndex = -1; this.in.close(); if (getPath() != null) { <START> this.in = new FastLineReader(IOUtil.openFileForReading(getPath())); <END> } else { try { this.seekableStream.seek(0); } catch (IOException e) { throw new SAMException("Problem seeking to start of stream during reset", e); } this.in = new FastLineReader(this.seekableStream); } }</code><technical_language>This if clause removed if Path in open construction a SeekableStream</technical_language>

Target:
public void reset() { this.sequenceIndex = -1; if (getPath() != null) { this.in.close(); this.in = new FastLineReader(IOUtil.openFileForReading(getPath())); } else { try { this.seekableStream.seek(0); } catch (IOException e) { throw new SAMException("Problem seeking to start of stream during reset", e); } this.in = new FastLineReader(this.seekableStream); } }
Source:
<code><START> public BUILDER removeAlternatives(String... alternatives) { <END> if (this.alternatives == null) { return (BUILDER) this; } else { for (String alternative : alternatives) { if (isAlternativePresent(alternative)) { int length = this.alternatives.length; String[] newAlternatives = new String[length - 1]; int k = 0; for (String alt : this.alternatives) { if (alt != alternative) { newAlternatives[k] = alt; k++; } } this.alternatives = newAlternatives; } } } return (BUILDER) this; }</code><technical_language>Please this final. A lot of methods in this class final aren't, this is a new lock down</technical_language>

Target:
public final BUILDER removeAlternatives(String... alternatives) { if (this.alternatives == null) { return (BUILDER) this; } else { for (String alternative : alternatives) { if (isAlternativePresent(alternative)) { int length = this.alternatives.length; String[] newAlternatives = new String[length - 1]; int k = 0; for (String alt : this.alternatives) { if (alt != alternative) { newAlternatives[k] = alt; k++; } } this.alternatives = newAlternatives; } } } return (BUILDER) this; }
Source:
<code>private static void oneProducer1Consumer(int prodBatchSz) { <START> JCQueue q1 = new JCQueue("q1", null, 50_000, 0, prodBatchSz, new WaitStrategyPark(100), "test", "test", <END> Collections.singletonList(1000), 1000, new StormMetricRegistry()); final Producer prod1 = new Producer(q1); final Consumer cons1 = new Consumer(q1); runAllThds(prod1, cons1); }</code><technical_language>is this null (Although I guess matter)</technical_language>

Target:
private static void oneProducer1Consumer(int prodBatchSz) { JCQueue q1 = new JCQueue("q1", "q1", 50_000, 0, prodBatchSz, new WaitStrategyPark(100), "test", "test", Collections.singletonList(1000), 1000, new StormMetricRegistry()); final Producer prod1 = new Producer(q1); final Consumer cons1 = new Consumer(q1); runAllThds(prod1, cons1); }
Source:
<code>private boolean shouldBypassThrottling(HttpServletRequest request) { if (enableThrottlingIfHeader == null <START> || enableThrottlingIfHeader.length() == 0) { <END> return false; } return request.getHeader(enableThrottlingIfHeader) == null; }</code><technical_language>A HTTP header named "" treated invalid, I refuse construction, try coerce here</technical_language>

Target:
private boolean shouldBypassThrottling(HttpServletRequest request) { if (enableThrottlingIfHeader == null) return false; return request.getHeader(enableThrottlingIfHeader) == null; }