auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Task<String> tryAcquire(String lockNode, long deadline) { return _zkClient.getChildren(_lockPath) .flatMap(children -> { children = children.stream().map(child -> ZKUtil.noramlizeZKPath(_lockPath, child)) .collect(Collectors.toList()); String node = ZKUtil.findNodeWithNextLowestSN(children, lockNode); if (node.equals(lockNode)) { <START> return PlanLocal.put(getPlanLocalKey(), new LockInternal(lockNode)).map(unused -> lockNode); <END> } else { Task<Void> wait = Task.async(context -> { AtomicBoolean committed = new AtomicBoolean(false); SettablePromise<Void> promise = Promises.settable(); Task<Optional<Stat>> exists = _zkClient.exists(node).withWatcher(watchEvent -> { if (committed.compareAndSet(false, true)) { promise.done(null); } }).andThen(stat -> { if (!stat.isPresent() && committed.compareAndSet(false, true)) { promise.done(null); } }); context.run(exists); return promise; }); return wait.flatMap(unused -> tryAcquire(lockNode, deadline)); } }) .recoverWith(e -> retry(e, deadline, tryAcquire(lockNode, deadline))); }</code><technical_language>mind. read wrong</technical_language>

Target:
private Task<String> tryAcquire(String lockNode, long deadline) { return _zkClient.getChildren(_lockPath) .flatMap(children -> { children = children.stream().map(child -> ZKUtil.normalizeZKPath(_lockPath, child)) .collect(Collectors.toList()); String node = ZKUtil.findNodeWithNextLowestSN(children, lockNode); if (node.equals(lockNode)) { return PlanLocal.put(getPlanLocalKey(), new LockInternal(lockNode)).map(unused -> lockNode); } else { Task<Void> wait = Task.async(context -> { AtomicBoolean committed = new AtomicBoolean(false); SettablePromise<Void> promise = Promises.settable(); Task<Optional<Stat>> exists = _zkClient.exists(node).withWatcher(watchEvent -> { if (committed.compareAndSet(false, true)) { promise.done(null); } }).andThen(stat -> { if (!stat.isPresent() && committed.compareAndSet(false, true)) { promise.done(null); } }); context.run(exists); return promise; }); return wait.flatMap(unused -> tryAcquire(lockNode, deadline)); } }) .recoverWith(e -> retry(e, deadline, tryAcquire(lockNode, deadline))); }
Source:
<code>public void onMatch(RelOptRuleCall call) { final Project project = call.rel(0); VbuilderPAP vb = buildProcessor(call); RelNode newProject = vb.processProject(project); <START> if (newProject instanceof Project && ((Project) newProject).getChildExps().equals(project.getChildExps())) { <END> return; } else { call.transformTo(newProject); } }</code><technical_language>I this check done more efficiently, avoiding traversing expressions. need create a new project rewritings in RexNode expressions: 1) In for loop in processProject, check for expression modified ProcessShuttle (==). 2) create a new Project operator if of expressions changed. 3) Check newProject == project</technical_language>

Target:
public void onMatch(RelOptRuleCall call) { final Project project = call.rel(0); VbuilderPAP vb = buildProcessor(call); RelNode newProject = vb.processProject(project); if (newProject == project) { return; } else { call.transformTo(newProject); } }
Source:
<code>private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { try (PreparedStatement dc = currentConnection.prepareStatement(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, <START> NameNormaliserPostgres.normaliseName(queryParameters[i])); <END> } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) paramName = ""; String dataType = rs.getString(2); DbParameterAccessor dbp = createDbParameterAccessor( '"'+paramName+'"', Direction.INPUT, getSqlType(dataType), getJavaClass(dataType), position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } rs.close(); return allParams; } }</code><technical_language>convention for indentation is 4 spaces, tabs</technical_language>

Target:
private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { try (PreparedStatement dc = currentConnection.prepareStatement(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, NameNormaliserPostgres.normaliseName(queryParameters[i])); } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) paramName = ""; paramName = paramName.replace("\"","\"\""); String dataType = rs.getString(2); DbParameterAccessor dbp = createDbParameterAccessor( '"' + paramName + '"', Direction.INPUT, getSqlType(dataType), getJavaClass(dataType), position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } rs.close(); return allParams; } }
Source:
<code>public void equality() throws Exception { NotFilter filter = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01|web02")) .build(); NotFilter filter2 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01|web02")) .build(); NotFilter filter3 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("hostname", "web01|web02")) .build(); assertTrue(filter.equals(filter2)); assertTrue(!filter.equals(filter3)); assertEquals(filter.hashCode(), filter2.hashCode()); assertNotEquals(filter.hashCode(), filter3.hashCode()); filter3 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01")) .build(); assertTrue(!filter.equals(filter3)); assertNotEquals(filter.hashCode(), filter3.hashCode()); <START> <END> }</code><technical_language>Test case validate assertNotEquals(not_filter, not_filter.filter)</technical_language>

Target:
public void equality() throws Exception { NotFilter filter = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01|web02")) .build(); NotFilter filter2 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01|web02")) .build(); NotFilter filter3 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("hostname", "web01|web02")) .build(); assertTrue(filter.equals(filter2)); assertTrue(!filter.equals(filter3)); assertEquals(filter.hashCode(), filter2.hashCode()); assertNotEquals(filter.hashCode(), filter3.hashCode()); filter3 = NotFilter.newBuilder() .setFilter(new UTQueryFilter("host", "web01")) .build(); assertTrue(!filter.equals(filter3)); assertNotEquals(filter.hashCode(), filter3.hashCode()); assertNotEquals(filter, filter.getFilter()); }
Source:
<code>public void testFilterEmptySketch() { DoubleSummaryFactory factory = new DoubleSummaryFactory(DoubleSummary.Mode.Sum); Sketch<DoubleSummary> sketch = Sketches.createEmptySketch(); Filter<DoubleSummary> filter = new Filter<>(o -> true, factory); Sketch<DoubleSummary> filteredSketch = filter.filter(sketch); Assert.assertEquals(filteredSketch.getEstimate(), 0.0d); Assert.assertEquals(filteredSketch.getThetaLong(), sketch.getThetaLong()); <START> } <END></code><technical_language>expect if sketch.isEmpty() is true, filteredSketch.isEmpty() is true</technical_language>

Target:
public void testFilterEmptySketch() { Sketch<DoubleSummary> sketch = Sketches.createEmptySketch(); Filter<DoubleSummary> filter = new Filter<>(o -> true); Sketch<DoubleSummary> filteredSketch = filter.filter(sketch); Assert.assertEquals(filteredSketch.getEstimate(), 0.0d); Assert.assertEquals(filteredSketch.getThetaLong(), sketch.getThetaLong()); Assert.assertTrue(filteredSketch.isEmpty()); }
Source:
<code>public void verifyMonetizationModuleSlot() { List<WebElement> listWebElements = driver.findElements(MonetizationModuleList); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute("data-mon-slot"); switch (slotName) { case "above_title": verifyMonetizationModuleShownAboveTitle(); break; case "below_title": verifyMonetizationModuleShownBelowTitle(); break; case "in_content": verifyMonetizationModuleShownInContent(); break; case "below_category": verifyMonetizationModuleShownBelowCategory(); break; case "above_footer": verifyMonetizationModuleShownAboveFooter(); break; <START> } <END> } }</code><technical_language>Add default switch</technical_language>

Target:
public void verifyMonetizationModuleSlot() { List<WebElement> listWebElements = driver.findElements(MonetizationModuleListBy); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute(attributeNameSlot); switch (slotName) { case "above_title": verifyMonetizationModuleShownAboveTitle(); break; case "below_title": verifyMonetizationModuleShownBelowTitle(); break; case "in_content": verifyMonetizationModuleShownInContent(); break; case "below_category": verifyMonetizationModuleShownBelowCategory(); break; case "above_footer": verifyMonetizationModuleShownAboveFooter(); break; default: PageObjectLogging.log("verifyMonetizationModuleSlot", "Invalid slot name (Name: " + slotName + ")", true); break; } } }
Source:
<code>public void onResume() { super.onResume(); int productCount = sp.getInt("productCount", 0); <START> apiClient.getTotalProductCount(getString(R.string.app_name) + " " + Utils.getUserAgent("OTHERS")) <END> .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SingleObserver<Search>() { @Override public void onSubscribe(Disposable d) { disposable=d; if(isAdded()) { updateTextHome(productCount); } } @Override public void onSuccess(Search search) { if(isAdded()) { int totalProductCount = productCount; try { totalProductCount = Integer.parseInt(search.getCount()); } catch (NumberFormatException e) { Log.w(HomeFragment.class.getSimpleName(), "can parse " + search.getCount() + " as int", e); } updateTextHome(totalProductCount); SharedPreferences.Editor editor = sp.edit(); editor.putInt("productCount", totalProductCount); editor.apply(); } } @Override public void onError(Throwable e) { if(isAdded()) { updateTextHome(productCount); } } }); getTagline(); if (getActivity() instanceof AppCompatActivity) { ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(""); } } }</code><technical_language>a common build header. For instance in openfoodfacts.github.scrachx.openfood.network.OpenFoodAPIService#getProductByBarcodeSingle this info: client.getProductByBarcodeSingle(product.getCode(), fields, Utils.getUserAgent(Utils.HEADER_USER_AGENT_SEARCH)) I suggest remove getString(R.string.app_name) + " " change Utils.getUserAgent add a prefix if needed</technical_language>

Target:
public void onResume() { super.onResume(); int productCount = sp.getInt("productCount", 0); apiClient.getTotalProductCount(Utils.getUserAgent()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SingleObserver<Search>() { @Override public void onSubscribe(Disposable d) { disposable=d; if(isAdded()) { updateTextHome(productCount); } } @Override public void onSuccess(Search search) { if(isAdded()) { int totalProductCount = productCount; try { totalProductCount = Integer.parseInt(search.getCount()); } catch (NumberFormatException e) { Log.w(HomeFragment.class.getSimpleName(), "can parse " + search.getCount() + " as int", e); } updateTextHome(totalProductCount); SharedPreferences.Editor editor = sp.edit(); editor.putInt("productCount", totalProductCount); editor.apply(); } } @Override public void onError(Throwable e) { if(isAdded()) { updateTextHome(productCount); } } }); getTagline(); if (getActivity() instanceof AppCompatActivity) { ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(""); } } }
Source:
<code>public Object getPayload() { InputStream inputStream; try { inputStream = inputStream(); } catch (IOException e1) { <START> throw new UncheckedIOException(new SoftEndOfStreamException("Socket closed when getting input stream", e1)); <END> } try { return getDeserializer() .deserialize(inputStream); } catch (IOException e) { throw new UncheckedIOException(e); } }</code><technical_language>a SoftEndOfStreamException UncheckedIOException avoid this wrapping? i mind for other branches, for master. Thanks</technical_language>

Target:
public Object getPayload() { InputStream inputStream; try { inputStream = inputStream(); } catch (IOException e1) { throw new SoftEndOfStreamException("Socket closed when getting input stream", e1); } try { return getDeserializer() .deserialize(inputStream); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>public RGBValues createRGBValues() { return new <START> RGBValues(209, 209, 209); <END> }</code><technical_language>precise default here</technical_language>

Target:
public RGBValues createRGBValues() { return new RGBValues(0, 0, 0); }
Source:
<code>public CompletionStage<RestResponse> synchronizeData(Integer readBatch, Integer threads) { Request.Builder builder = new Request.Builder(); StringBuilder sb = new StringBuilder(cacheUrl + "?action=sync-data"); if (readBatch != null) { <START> sb.append("&read-batch=" + readBatch); <END> } if (threads != null) { sb.append("&threads=" + threads); } builder.url(sb.toString()).get(); return client.execute(builder); }</code><technical_language>nitpick: string concatenation avoided StringBuilder? suggestion sb.append("&read-batch=").append(readBatch); below... above..</technical_language>

Target:
public CompletionStage<RestResponse> synchronizeData(Integer readBatch, Integer threads) { Request.Builder builder = new Request.Builder(); StringBuilder sb = new StringBuilder(cacheUrl + "?action=sync-data"); if (readBatch != null) { sb.append("&read-batch=").append(readBatch); } if (threads != null) { sb.append("&threads=").append(threads); } builder.url(sb.toString()).get(); return client.execute(builder); }
Source:
<code>private Task createTaskForEventsWithName(List<EventBase> events, String taskName) { <START> final Task overallTask; <END> if (!events.isEmpty()) { Collections.sort(events); overallTask = new Task(taskName, events.get(0).getTimestamp(), addDeltaTo(events.get(events.size() - 1).getTimestamp())); for (EventBase event : events) { overallTask.addSubtask( new Task(event.toString(), event.getTimestamp(), addDeltaTo(event.getTimestamp()))); } } else { overallTask = new Task(taskName, new Date(), addDeltaTo(new Date())); } return overallTask; }</code><technical_language>final variable? :-)</technical_language>

Target:
private Task createTaskForEventsWithName(List<EventBase> events, String taskName) { Task overallTask; if (!events.isEmpty()) { Collections.sort(events); overallTask = new Task(taskName, events.get(0).getTimestamp(), addDeltaTo(events.get(events.size() - 1).getTimestamp())); for (EventBase event : events) { overallTask.addSubtask( new Task(event.toString(), event.getTimestamp(), addDeltaTo(event.getTimestamp()))); } } else { overallTask = new Task(taskName, new Date(), addDeltaTo(new Date())); } return overallTask; }
Source:
<code>private ParseTree parseAssignment(Expression expressionIn, boolean mayHaveColonType) { if (peek(TokenType.YIELD) && inGeneratorContext()) { return parseYield(expressionIn); } SourcePosition start = getTreeStartLocation(); <START> GenericTypeListTree generics = maybeParseGenericTypes(); <END> ParseTree left = parseConditional(expressionIn); ParseTree returnType = null; if (peek(TokenType.COLON) && mayHaveColonType) { returnType = parseTypeAnnotation(); } if (peek(TokenType.ARROW)) { FormalParameterListTree params = transformArrowFunctionParameters(start, left); if (peek(TokenType.COLON)) { parseTypeAnnotation(); } return parseArrowFunctionTail(start, generics, params, returnType, expressionIn); } if (left.type == ParseTreeType.FORMAL_PARAMETER_LIST) { reportError("invalid paren expression"); } if (peekAssignmentOperator()) { left = transformLeftHandSideExpression(left); if (!left.isValidAssignmentTarget()) { reportError("invalid assignment target"); } Token operator = nextToken(); ParseTree right = parseAssignment(expressionIn, mayHaveColonType); return new BinaryOperatorTree(getTreeLocation(start), left, operator, right); } return left; }</code><technical_language>I a similar issue for COLON below</technical_language>

Target:
private ParseTree parseAssignment(Expression expressionIn, boolean mayHaveColonType) { if (peek(TokenType.YIELD) && inGeneratorContext()) { return parseYield(expressionIn); } SourcePosition start = getTreeStartLocation(); GenericTypeListTree generics = maybeParseGenericTypes(); ParseTree left = parseConditional(expressionIn); ParseTree returnType = null; if (peek(TokenType.COLON) && mayHaveColonType) { colonTypeTokens.add(peekToken()); returnType = parseTypeAnnotation(); } if (peek(TokenType.ARROW)) { FormalParameterListTree params = transformArrowFunctionParameters(start, left); colonTypeTokens.clear(); if (peek(TokenType.COLON)) { parseTypeAnnotation(); } return parseArrowFunctionTail(start, generics, params, returnType, expressionIn); } if (generics != null) { reportError("invalid location for generics"); } if (left.type == ParseTreeType.FORMAL_PARAMETER_LIST) { reportError("invalid paren expression"); } if (peekAssignmentOperator()) { left = transformLeftHandSideExpression(left); if (!left.isValidAssignmentTarget()) { reportError("invalid assignment target"); } Token operator = nextToken(); ParseTree right = parseAssignment(expressionIn, mayHaveColonType); return new BinaryOperatorTree(getTreeLocation(start), left, operator, right); } if (peek(TokenType.CLOSE_PAREN)) { if (!peek(1, TokenType.ARROW) && !peek(1, TokenType.COLON)) { reportInvalidColonTypes(); } } else if (!peek(TokenType.COMMA)) { reportInvalidColonTypes(); } return left; }
Source:
<code><START> public String name() { <END> return "db"; }</code><technical_language>This method protected</technical_language>

Target:
protected String name() { return "db"; }
Source:
<code>public void stopServer() throws CommandFailedException, IOException { offlineClient.apply(CONFIGURATION_BACKUP.restore()); <START> controller.stop(ManualTests.ARQUILLIAN_CONTAINER); <END> }</code><technical_language>- stop server, restore</technical_language>

Target:
public void stopServer() throws CommandFailedException, IOException { controller.stop(ManualTests.ARQUILLIAN_CONTAINER); offlineClient.apply(CONFIGURATION_BACKUP.restore()); }
Source:
<code>public static boolean checkSpaces(String s) { boolean isPrevNum = false; boolean isPrevSpace = false; for (int i = 0; i < s.length(); ++i) { char c = s.charAt(i); if ((isPrevNum) && (isPrevSpace) && (Character.isDigit(c))) { return false; } else { <START> if ((isPrevNum) && ((c == ' ') || (c == ' '))) { <END> isPrevSpace = true; } else { if ((!isPrevNum) && (Character.isDigit(c))) { isPrevNum = true; isPrevSpace = false; } else { if ((c != ' ') && (c != ' ')) { isPrevSpace = false; } } } } if ((!Character.isDigit(c)) && (c != ' ') && (c != ' ')) { isPrevNum = false; } } return true; }</code><technical_language>Character.isWhitespace</technical_language>

Target:
public static boolean checkSpaces(String s) { boolean isPrevNum = false; boolean isPrevSpace = false; for (int i = 0; i < s.length(); ++i) { char c = s.charAt(i); if ((isPrevNum) && (isPrevSpace) && (Character.isDigit(c))) { return false; } else { if ((isPrevNum) && (Character.isWhitespace(c))) { isPrevSpace = true; } else { if ((!isPrevNum) && (Character.isDigit(c))) { isPrevNum = true; isPrevSpace = false; } else { if (!Character.isWhitespace(c)) { isPrevSpace = false; } } } } if ((!Character.isDigit(c)) && (!Character.isWhitespace(c))) { isPrevNum = false; } } return true; }
Source:
<code>public abstract void checkApiRateLimit(@NonNull TaskListener listener, GitHub github) throws IOException, InterruptedException; private static void waitUntilRateLimit(@NonNull TaskListener listener, GitHub github, GHRateLimit rateLimit, long expiration) throws InterruptedException, IOException { <START> long nextNotify = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(3); <END> while (expiration > System.currentTimeMillis()) { if (Thread.interrupted()) { throw new InterruptedException(); } long sleep = Math.min(expiration, nextNotify) - System.currentTimeMillis(); if (sleep > 0) { Thread.sleep(sleep); } nextNotify += TimeUnit.SECONDS.toMillis(180); long now = System.currentTimeMillis(); if (now < expiration) { GHRateLimit current = github.getRateLimit(); if (current.remaining > rateLimit.remaining || current.getResetDate().getTime() > rateLimit.getResetDate().getTime()) { listener.getLogger().println(GitHubConsoleNote.create(now, "GitHub API Usage: The quota may have been refreshed earlier than expected, rechecking..." )); break; } listener.getLogger().println(GitHubConsoleNote.create(now, String.format( "GitHub API Usage: Still sleeping, now only %s remaining.", Util.getTimeSpanString(expiration - now) ))); } } }</code><technical_language>this a package private static waitNotificationMillis (like expirationWaitMillis), test wait scenarios waiting 3 minutes</technical_language>

Target:
public abstract void checkApiRateLimit(@NonNull TaskListener listener, GitHub github) throws IOException, InterruptedException; static int calculateBuffer(int limit) { return Math.max(15, limit / 20); }
Source:
<code>public void handleException(HttpServletRequest httpRequest, HttpServletResponse httpResponse, Exception e) throws IOException { SecurityContext context = SecurityContextHolder.getContext(); String message = "There was an error authenticating you. Please check the server logs, or contact your the go administrator."; httpRequest.getSession().setAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY, new RuntimeException(message)); httpRequest.setAttribute(SessionDenialAwareAuthenticationProcessingFilterEntryPoint.SESSION_DENIED, true); context.setAuthentication(null); <START> httpResponse.sendRedirect("/go/auth/login?login_error=1"); <END> LOG.error(e.getMessage()); LOG.trace(e.getMessage(), e); }</code><technical_language>this respond a content-type aware response</technical_language>

Target:
public void handleException(HttpServletRequest httpRequest, HttpServletResponse httpResponse, Exception e) throws IOException { String message = "There was an error authenticating you. Please check the server logs, or contact your the go administrator."; if (hasAccept(httpRequest, "text/html") || hasAccept(httpRequest, "application/xhtml")) { SecurityContext context = SecurityContextHolder.getContext(); httpRequest.getSession().setAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY, new RuntimeException(message)); httpRequest.setAttribute(SessionDenialAwareAuthenticationProcessingFilterEntryPoint.SESSION_DENIED, true); context.setAuthentication(null); httpResponse.sendRedirect("/go/auth/login?login_error=1"); LOG.error(e.getMessage()); LOG.trace(e.getMessage(), e); return; } if (hasAccept(httpRequest, "application/vnd.go.cd.v1+json") || hasAccept(httpRequest, "application/json")) { String msg = String.format("{\n \"message\": \"%s\"\n}\n", message); generateResponse(httpResponse, "application/vnd.go.cd.v1+json; charset=utf-8", msg); return; } if (hasAccept(httpRequest, "application/xml")) { String msg = String.format("<message>%s</message>\n", message); generateResponse(httpResponse, "application/xml; charset=utf-8", msg); return; } httpResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); }
Source:
<code>private Lane getLaneNodeById(Diagram<Graph, Metadata> diagram, String id) { Node<? extends Definition, ?> node = getNodebyId(diagram, id); <START> return Lane.class.cast(node.getContent().getDefinition()); <END> }</code><technical_language>I guess return (Lane) node.getContent().getDefinition(); more clear here</technical_language>

Target:
private Lane getLaneNodeById(Diagram<Graph, Metadata> diagram, String id) { Node<? extends Definition, ?> node = getNodebyId(diagram, id); return (Lane) node.getContent().getDefinition(); }
Source:
<code>private void registerWithZooKeeper(CuratorFramework client) { try { String jvmName = containerMetadata.getJvmName(); String tokens[] = jvmName.split("@"); StringBuilder builder = new StringBuilder() .append("pid=").append(tokens[0]) <START> .append(System.lineSeparator()) <END> .append("host=").append(tokens[1]); client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath( Paths.CONTAINERS + "/" + containerMetadata.getId(), builder.toString().getBytes("UTF-8")); logger.info("Started container " + containerMetadata.getId() + " with attributes: " + builder); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>remove System.lineSeparator() - compatible java 1.6</technical_language>

Target:
private void registerWithZooKeeper(CuratorFramework client) { try { String jvmName = containerMetadata.getJvmName(); String tokens[] = jvmName.split("@"); StringBuilder builder = new StringBuilder() .append("pid=").append(tokens[0]) .append(System.getProperty("line.separator")) .append("host=").append(tokens[1]); client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath( Paths.CONTAINERS + "/" + containerMetadata.getId(), builder.toString().getBytes("UTF-8")); logger.info("Started container " + containerMetadata.getId() + " with attributes: " + builder); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private void assertWarnings(@Language("SQL") String sql, Map<String, String> sessionProperties, List<WarningCode> expectedWarnings) throws Exception { Session.SessionBuilder sessionBuilder = testSessionBuilder() .setSystemProperty("task_concurrency", "1"); sessionProperties.forEach(sessionBuilder::setSystemProperty); queryRunner.execute(sessionBuilder.build(), sql); generatedEvents.waitForEvents(10); <START> assertEquals(generatedEvents.getQueryCompletedEvents().size(), 1, String.join("\n", generatedEvents.getQueryCompletedEvents().stream() <END> .map(event -> String.format("%s: %s", event.getMetadata().getQueryId(), event.getMetadata().getQuery())) .collect(toImmutableList()))); Set<WarningCode> warnings = generatedEvents.getQueryCompletedEvents() .stream() .flatMap(event -> event.getWarnings().stream()) .map(PrestoWarning::getCode) .collect(toImmutableSet()); for (WarningCode warningCode : expectedWarnings) { if (!warnings.contains(warningCode)) { fail("Expected warning: " + warningCode); } } }</code><technical_language>This is complicated, please extract a variable for 3rd argument of assertEquals call, try simplify it</technical_language>

Target:
private void assertWarnings(@Language("SQL") String sql, Map<String, String> sessionProperties, List<WarningCode> expectedWarnings) throws InterruptedException { SessionBuilder sessionBuilder = testSessionBuilder() .setSystemProperty("task_concurrency", "1"); sessionProperties.forEach(sessionBuilder::setSystemProperty); queryRunner.execute(sessionBuilder.build(), sql); generatedEvents.waitForEvents(10); Set<WarningCode> warnings = getOnlyElement(generatedEvents.getQueryCompletedEvents()) .getWarnings() .stream() .map(PrestoWarning::getWarningCode) .collect(toImmutableSet()); for (WarningCode warningCode : expectedWarnings) { if (!warnings.contains(warningCode)) { fail("Expected warning: " + warningCode); } } }
Source:
<code>private void persistRadioStation(RadioStation station) { persistString(station.stream); <START> Settings settings = new Settings(getContext()); <END> settings.setRadioStation(station); }</code><technical_language>getSharedPreferences() access prefs in a is independent of nightdream package. Derive a key key of preference. SharedPreferences prefs = getSharedPreferences(); String key = String.format("%s_json", getKey());</technical_language>

Target:
private void persistRadioStation(RadioStation station) { persistString(station.stream); try { String json = station.toJson(); SharedPreferences prefs = getSharedPreferences(); SharedPreferences.Editor prefEditor = prefs.edit(); prefEditor.putString(jsonKey(), json); prefEditor.commit(); } catch (JSONException e) { Log.e(TAG, "error converting station to json", e); } }
Source:
<code>private Map<String, DashboardInfo> allDashboardsFor(ProjectState projectState) { final Project.NameKey projectName = projectState.getProject().getNameKey(); Project.NameKey parent; Map<String, DashboardInfo> dashboards = Maps.newTreeMap(); Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(projectName); do { dashboards = addProjectDashboards(projectState, dashboards); parent = projectState.getProject().getParent(); if (parent == null || !seen.add(parent)) { break; } projectState = projectCache.get(parent); } while (projectState != null); projectState = projectCache.getAllProjects(); parent = projectState.getProject().getNameKey(); if (seen.add(parent)) { dashboards = addProjectDashboards(projectState, dashboards); } for (String id : dashboards.keySet()) { DashboardInfo info = dashboards.get(id); <START> info.parameters = info.parameters.replaceAll("[$][{]project[}]", projectName.get()); <END> } return dashboards; }</code><technical_language>[optional] a method this, instead of this code in places. ok this line duplicated, image in future more patterns want replace</technical_language>

Target:
private Map<String, DashboardInfo> allDashboardsFor(ProjectState projectState) { final Project.NameKey projectName = projectState.getProject().getNameKey(); Project.NameKey parent; Map<String, DashboardInfo> dashboards = Maps.newTreeMap(); Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(projectName); do { dashboards = addProjectDashboards(projectState, dashboards); parent = projectState.getProject().getParent(); if (parent == null || !seen.add(parent)) { break; } projectState = projectCache.get(parent); } while (projectState != null); projectState = projectCache.getAllProjects(); parent = projectState.getProject().getNameKey(); if (seen.add(parent)) { dashboards = addProjectDashboards(projectState, dashboards); } for (String id : dashboards.keySet()) { replaceTokens(dashboards.get(id), projectName.get()); } return dashboards; }
Source:
<code>public JSONObject listWatchOverview(HttpSession session, JSONObject json) { final Long overviewId = json.getLong("overviewId"); final StringBuilder sb = new StringBuilder(); final JSONObject j = new JSONObject(); try { final ProjectOverview overview = requestManager.getProjectOverviewById(overviewId); sb.append("<ul class='bullets' style='margin-left: -30px;'>"); <START> for (final User theUser : overview.getProject().getWatchers()) { <END> sb.append("<li>"); sb.append(theUser.getFullName()); sb.append("</li>"); } sb.append("</ul>"); j.put("watchers", sb.toString()); return j; } catch (final IOException e) { log.error("list watch overview", e); } return JSONUtils.SimpleJSONError("Unable to list watchers"); }</code><technical_language>Overview watchers, this project (bad merge in ProjectOverview)</technical_language>

Target:
public JSONObject listWatchOverview(HttpSession session, JSONObject json) { final Long overviewId = json.getLong("overviewId"); final StringBuilder sb = new StringBuilder(); final JSONObject j = new JSONObject(); try { final ProjectOverview overview = requestManager.getProjectOverviewById(overviewId); sb.append("<ul class='bullets' style='margin-left: -30px;'>"); for (final User theUser : overview.getWatchers()) { sb.append("<li>"); sb.append(theUser.getFullName()); sb.append("</li>"); } sb.append("</ul>"); j.put("watchers", sb.toString()); return j; } catch (final IOException e) { log.error("list watch overview", e); } return JSONUtils.SimpleJSONError("Unable to list watchers"); }
Source:
<code>public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(GET).path("/v2/server/").handleWith(this::info) .invocation().methods(GET).path("/v2/server/config").handleWith(this::config) .invocation().methods(GET).path("/v2/server/env").handleWith(this::env) .invocation().methods(GET).path("/v2/server/memory").handleWith(this::memory) .invocation().methods(GET).path("/v2/server/stop").handleWith(this::stop) <START> .invocation().methods(GET).path("/v2/server/stop-cluster").handleWith(this::stopCluster) <END> .invocation().methods(GET).path("/v2/server/threads").handleWith(this::threads) .invocation().methods(GET).path("/v2/server/cache-managers").handleWith(this::cacheManagers) .invocation().methods(GET).path("/v2/server/ignored-caches/{cache-manager}").handleWith(this::listIgnored) .invocation().methods(POST, DELETE).path("/v2/server/ignored-caches/{cache-manager}/{cache}").handleWith(this::doIgnoreOp) .create(); }</code><technical_language>I thinking in REST operations involves multiple servers a separate resource: /rest/v2/cluster server resource target individual server @karesti some ops need affect servers gather info. <LINK_0></technical_language>

Target:
public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(GET).path("/v2/server/").handleWith(this::info) .invocation().methods(GET).path("/v2/server/config").handleWith(this::config) .invocation().methods(GET).path("/v2/server/env").handleWith(this::env) .invocation().methods(GET).path("/v2/server/memory").handleWith(this::memory) .invocation().methods(GET).path("/v2/server/stop").handleWith(this::stop) .invocation().methods(GET).path("/v2/server/threads").handleWith(this::threads) .invocation().methods(GET).path("/v2/server/cache-managers").handleWith(this::cacheManagers) .invocation().methods(GET).path("/v2/server/ignored-caches/{cache-manager}").handleWith(this::listIgnored) .invocation().methods(POST, DELETE).path("/v2/server/ignored-caches/{cache-manager}/{cache}").handleWith(this::doIgnoreOp) .create(); }
Source:
<code>private void removeDirectMember(PerunSession sess, Group group, Member member) throws InternalErrorException, NotGroupMemberException, GroupNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException { member.setSourceGroupId(group.getId()); getGroupsManagerImpl().removeMember(sess, group, member); if (this.getGroupsManagerImpl().isGroupMember(sess, group, member)) { getPerunBl().getAuditer().log(sess, "{} was removed from {}.", member, group); return; } else { notifyMemberRemovalFromGroup(sess, group, member); try { getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, member, group); } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } getPerunBl().getAuditer().log(sess, "{} was removed from totally.", member, group); } List<Integer> relations = groupsManagerImpl.getResultGroupsIds(sess, group.getId()); for (Integer groupId : relations) { removeRelationMembers(sess, groupsManagerImpl.getGroupById(sess, groupId), Collections.singletonList(member), group.getId()); } <START> recalculateMemberGroupStatusRecursively(sess, member, group); <END> }</code><technical_language>is exception for "addDirectMember" group is Members group. this exception here</technical_language>

Target:
private void removeDirectMember(PerunSession sess, Group group, Member member) throws InternalErrorException, NotGroupMemberException, GroupNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException { member.setSourceGroupId(group.getId()); getGroupsManagerImpl().removeMember(sess, group, member); if (this.getGroupsManagerImpl().isGroupMember(sess, group, member)) { getPerunBl().getAuditer().log(sess, "{} was removed from {}.", member, group); return; } else { notifyMemberRemovalFromGroup(sess, group, member); try { getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, member, group); } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } getPerunBl().getAuditer().log(sess, "{} was removed from totally.", member, group); } List<Integer> relations = groupsManagerImpl.getResultGroupsIds(sess, group.getId()); for (Integer groupId : relations) { removeRelationMembers(sess, groupsManagerImpl.getGroupById(sess, groupId), Collections.singletonList(member), group.getId()); } if (!VosManager.MEMBERS_GROUP.equals(group.getName())) { recalculateMemberGroupStatusRecursively(sess, member, group); } }
Source:
<code>public synchronized void register(String streamName) { LOG.info("Trying to register {}.", streamName); if (isStarted) { String msg = "Cannot register once the producer is started."; LOG.error(msg); throw new SamzaException(msg); } EventHubClientWrapper ehClient = eventHubClientWrapperFactory <START> .getEventHubClientWrapper(config.getStreamNamespace(streamName), config.getStreamEntityPath(streamName), <END> config.getStreamSasKeyName(streamName), config.getStreamSasToken(streamName), config); ehClient.init(); eventHubClients.put(streamName, ehClient); streamPartitionSenders.put(streamName, new HashMap<>()); }</code><technical_language>Extract variables. Formatting: instances inlining verbose method calls line wrapping half-way statement. IMHO more readable extract variables instead</technical_language>

Target:
public synchronized void register(String streamName) { LOG.debug("Trying to register {}.", streamName); if (isStarted) { String msg = "Cannot register once the producer is started."; throw new SamzaException(msg); } if (eventHubClients.containsKey(streamName)) { LOG.warn("Already registered stream {}.", streamName); return; } EventHubClientManager ehClient = eventHubClientManagerFactory.getEventHubClientManager(systemName, streamName, config); ehClient.init(); eventHubClients.put(streamName, ehClient); }
Source:
<code>public Cursor searchItems(long feedID, String searchQuery) { String[] queryWords = prepareSearchQuery(searchQuery); String queryFeedId; if (feedID != 0) { queryFeedId = KEY_FEED + " = " + feedID; } else { queryFeedId = "1 = 1"; } String queryStart = SELECT_FEED_ITEMS_AND_MEDIA_WITH_DESCRIPTION + " WHERE " + queryFeedId + " AND ("; StringBuilder sb = new StringBuilder(queryStart); for (int i = 0; i < queryWords.length; i++) { sb .append(KEY_DESCRIPTION + " LIKE '%").append(queryWords[i]) .append("%' OR ") .append(KEY_CONTENT_ENCODED).append(" LIKE '%").append(queryWords[i]) .append("%' OR ") .append(KEY_TITLE).append(" LIKE '%").append(queryWords[i]) .append("%' "); if (i != queryWords.length - 1) { <START> sb.append("OR "); <END> } } sb.append(") ORDER BY " + KEY_PUBDATE + " DESC LIMIT 300"); return db.rawQuery(sb.toString(), null); }</code><technical_language>I this "AND" (and "()" "OR" parts). search feature return episodes keywords, of</technical_language>

Target:
public Cursor searchItems(long feedID, String searchQuery) { String[] queryWords = prepareSearchQuery(searchQuery); String queryFeedId; if (feedID != 0) { queryFeedId = KEY_FEED + " = " + feedID; } else { queryFeedId = "1 = 1"; } String queryStart = SELECT_FEED_ITEMS_AND_MEDIA_WITH_DESCRIPTION + " WHERE " + queryFeedId + " AND ("; StringBuilder sb = new StringBuilder(queryStart); for (int i = 0; i < queryWords.length; i++) { sb .append("(") .append(KEY_DESCRIPTION + " LIKE '%").append(queryWords[i]) .append("%' OR ") .append(KEY_CONTENT_ENCODED).append(" LIKE '%").append(queryWords[i]) .append("%' OR ") .append(KEY_TITLE).append(" LIKE '%").append(queryWords[i]) .append("%') "); if (i != queryWords.length - 1) { sb.append("AND "); } } sb.append(") ORDER BY " + KEY_PUBDATE + " DESC LIMIT 300"); return db.rawQuery(sb.toString(), null); }
Source:
<code>private String getSolverConfigResource(final Path resourcePath, final KieModule kieWorkbenchModule) { final Path convertedResourcePath = Paths.convert(Paths.convert(resourcePath)); final Path convertedModuleRootPath = Paths.convert(Paths.convert(kieWorkbenchModule.getRootPath())); <START> final String result = convertedResourcePath.toURI().substring(getUriLength(convertedModuleRootPath) + "/src/main/resources/".length()); <END> return result; }</code><technical_language>Yes, I understand double convert is a sort of necessary evil this point. of Path.normalize() get rid of "/"? groovy> java.nio.file.Paths.get("/home/jlocker/").normalize() Result: /home/jlocker is a unit test a couple of input/output sample values for getSolverConfigResource() method. safely experiment approaches cases work</technical_language>

Target:
private String getSolverConfigResource(final Path resourcePath, final KieModule kieWorkbenchModule) { return PathUtil.removePrefix(resourcePath, kieWorkbenchModule.getRootPath()).substring("src/main/resources/".length()); }
Source:
<code>public DsfGdbAdaptor(GdbTrace trace, String gdbExec, String traceFile, String tracedExecutable) { this.fGdbTrace = trace; this.gdb72Executable = gdbExec; this.fTraceFilePath = traceFile; this.fTraceFile = traceFile.substring(traceFile.lastIndexOf(IPath.SEPARATOR) + 1); this.tracedExecutable = tracedExecutable; try { launchDGBPostMortemTrace(); } catch (CoreException e) { <START> GdbTraceCorePlugin.logError(CORE_EXCEPTION, e); <END> } }</code><technical_language>e.getMessage()</technical_language>

Target:
public DsfGdbAdaptor(GdbTrace trace, String gdbExec, String traceFile, String tracedExecutable) { this.fGdbTrace = trace; this.gdb72Executable = gdbExec; this.fTraceFilePath = traceFile; this.fTraceFile = traceFile.substring(traceFile.lastIndexOf(IPath.SEPARATOR) + 1); this.tracedExecutable = tracedExecutable; try { launchDGBPostMortemTrace(); } catch (CoreException e) { GdbTraceCorePlugin.logError(e.getMessage(), e); } }
Source:
<code>private static Map<Identifier, VariableReferenceExpression> buildIdentifierToVariableMap(FunctionMetadata functionMetadata, Expression sqlFunction, SqlFunctionProperties sqlFunctionProperties, Metadata metadata, PlanVariableAllocator variableAllocator) { Map<String, Type> argumentTypes = getFunctionArgumentTypes(functionMetadata, metadata); Map<NodeRef<Expression>, Type> expressionTypes = getSqlFunctionExpressionTypes(metadata, sqlFunctionProperties, sqlFunction, argumentTypes); <START> Map<Identifier, VariableReferenceExpression> variables = new LinkedHashMap(); <END> for (Map.Entry<NodeRef<Expression>, Type> entry : expressionTypes.entrySet()) { Expression node = entry.getKey().getNode(); if (node instanceof LambdaArgumentDeclaration) { LambdaArgumentDeclaration lambdaArgumentDeclaration = (LambdaArgumentDeclaration) node; if (!variables.containsKey(lambdaArgumentDeclaration.getName())) { variables.put(lambdaArgumentDeclaration.getName(), variableAllocator.newVariable(lambdaArgumentDeclaration.getName(), entry.getValue())); } } else if (node instanceof Identifier && argumentTypes.containsKey(((Identifier) node).getValue())) { if (!variables.containsKey(node)) { variables.put((Identifier) node, variableAllocator.newVariable(node, entry.getValue())); } } } return variables; }</code><technical_language>new LinkedHashMap<>();</technical_language>

Target:
private static Map<Identifier, VariableReferenceExpression> buildIdentifierToVariableMap(FunctionMetadata functionMetadata, Expression sqlFunction, SqlFunctionProperties sqlFunctionProperties, Metadata metadata, PlanVariableAllocator variableAllocator) { Map<String, Type> argumentTypes = getFunctionArgumentTypes(functionMetadata, metadata); Map<NodeRef<Expression>, Type> expressionTypes = getSqlFunctionExpressionTypes(metadata, sqlFunctionProperties, sqlFunction, argumentTypes); Map<Identifier, VariableReferenceExpression> variables = new LinkedHashMap<>(); for (Map.Entry<NodeRef<Expression>, Type> entry : expressionTypes.entrySet()) { Expression node = entry.getKey().getNode(); if (node instanceof LambdaArgumentDeclaration) { LambdaArgumentDeclaration lambdaArgumentDeclaration = (LambdaArgumentDeclaration) node; if (!variables.containsKey(lambdaArgumentDeclaration.getName())) { variables.put(lambdaArgumentDeclaration.getName(), variableAllocator.newVariable(lambdaArgumentDeclaration.getName(), entry.getValue())); } } else if (node instanceof Identifier && argumentTypes.containsKey(((Identifier) node).getValue())) { if (!variables.containsKey(node)) { variables.put((Identifier) node, variableAllocator.newVariable(node, entry.getValue())); } } } return variables; }
Source:
<code>public void mergeValue(StructuredRecord record) { if (record.get(fieldName) != null) { String value = Objects <START> .requireNonNull(record.get(fieldName)).toString(); <END> if (firstString) { concatString = value; firstString = false; return; } concatString = String.format("%s, %s", concatString, value); } }</code><technical_language>nit: this line move line</technical_language>

Target:
public void mergeValue(StructuredRecord record) { if (record.get(fieldName) != null) { String value = record.get(fieldName); if (firstString) { concatString = value; firstString = false; return; } concatString = String.format("%s, %s", concatString, value); } }
Source:
<code><START> private void ensureCapacity(final IsaacEventPageDTO event, final List<RegisteredUserDTO> users) throws <END> SegueDatabaseException, EventIsFullException { final boolean isStudentEvent = event.getTags().contains("student"); Long numberOfPlaces = getPlacesAvailable(event); if (numberOfPlaces != null) { long numberOfRequests = users.stream().filter(user -> !isStudentEvent || !Role.TEACHER.equals(user.getRole())).count(); if (numberOfPlaces - numberOfRequests < 0) { throw new EventIsFullException(String.format("Unable to book batch (%s) onto event (%s) as there are " + "not enough places available", users, event.getId())); } } }</code><technical_language>assuming reservations interval elapsed count capacity</technical_language>

Target:
private void ensureCapacity(final IsaacEventPageDTO event, final List<RegisteredUserDTO> users) throws SegueDatabaseException, EventIsFullException { final boolean isStudentEvent = event.getTags().contains("student"); Long numberOfPlaces = getPlacesAvailable(event); if (numberOfPlaces != null) { long numberOfRequests = users.stream() .filter(user -> !isStudentEvent || !Role.TEACHER.equals(user.getRole())) .count(); if (numberOfPlaces - numberOfRequests < 0) { throw new EventIsFullException( String.format("Unable to book %s (%s) onto event (%s) as there are not enough places available", users.size() > 1 ? "batch" : "user", users, event.getId())); } } }
Source:
<code>SuggestReviewers(AccountVisibility av, AccountInfo.Loader.Factory accountLoaderFactory, AccountControl.Factory accountControlFactory, AccountCache accountCache, GroupMembers.Factory groupMembersFactory, IdentifiedUser.GenericFactory identifiedUserFactory, Provider<CurrentUser> currentUser, Provider<ReviewDb> dbProvider, @GerritServerConfig Config cfg, GroupBackend groupBackend) { this.accountLoaderFactory = accountLoaderFactory; this.accountControlFactory = accountControlFactory; this.accountCache = accountCache; this.groupMembersFactory = groupMembersFactory; this.dbProvider = dbProvider; this.identifiedUserFactory = identifiedUserFactory; this.currentUser = currentUser; this.groupBackend = groupBackend; <START> this.cfg = cfg; <END> String suggest = cfg.getString("suggest", null, "accounts"); if ("OFF".equalsIgnoreCase(suggest) || "false".equalsIgnoreCase(suggest)) { this.suggestAccounts = false; } else { this.useFullTextSearch = cfg.getBoolean("suggest", "fulltextsearch", false); this.suggestAccounts = (av != AccountVisibility.NONE); } this.suggestFrom = cfg.getInt("suggest", null, "from", 0); this.maxAllowed = cfg.getInt("addreviewer", "maxAllowed", PostReviewers.DEFAULT_MAX_REVIEWERS); }</code><technical_language>config values read in ctor</technical_language>

Target:
SuggestReviewers(AccountVisibility av, AccountInfo.Loader.Factory accountLoaderFactory, AccountControl.Factory accountControlFactory, AccountCache accountCache, GroupMembers.Factory groupMembersFactory, IdentifiedUser.GenericFactory identifiedUserFactory, Provider<CurrentUser> currentUser, Provider<ReviewDb> dbProvider, @GerritServerConfig Config cfg, GroupBackend groupBackend) { this.accountLoaderFactory = accountLoaderFactory; this.accountControlFactory = accountControlFactory; this.accountCache = accountCache; this.groupMembersFactory = groupMembersFactory; this.dbProvider = dbProvider; this.identifiedUserFactory = identifiedUserFactory; this.currentUser = currentUser; this.groupBackend = groupBackend; this.maxSuggestedReviewers = cfg.getInt("suggest", "maxsuggestedreviewers", DEFAULT_MAX_SUGGESTED); this.fullTextMaxMatches = cfg.getInt("suggest", "fulltextsearchmaxmatches", DEFAULT_MAX_MATCHES); String suggest = cfg.getString("suggest", null, "accounts"); if ("OFF".equalsIgnoreCase(suggest) || "false".equalsIgnoreCase(suggest)) { this.suggestAccounts = false; } else { this.useFullTextSearch = cfg.getBoolean("suggest", "fulltextsearch", false); this.suggestAccounts = (av != AccountVisibility.NONE); } this.suggestFrom = cfg.getInt("suggest", null, "from", 0); this.maxAllowed = cfg.getInt("addreviewer", "maxAllowed", PostReviewers.DEFAULT_MAX_REVIEWERS); }