auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String processSVG(KieServerConnectionInfo connectionInfo, String containerId, String processId) { Client client = ClientBuilder.newClient(); Optional<String> location = connectionInfo.getLocation(); if (location.isPresent()) { WebTarget target = client.target(location.get()) .path(PROCESS_SVG_URI) .resolveTemplate(CONTAINER_ID_PARAM, containerId) .resolveTemplate(PROCESS_ID_PARAM, processId); addAuth(connectionInfo, target); String svg = target.request().get(String.class); client.close(); return svg; } <START> <END> throw new RuntimeException("Location for Kie Server is required. Check configuration."); }</code><technical_language>Do need a client.close() here</technical_language>

Target:
public String processSVG(KieServerConnectionInfo connectionInfo, String containerId, String processId) { Optional<String> location = connectionInfo.getLocation(); if (location.isPresent()) { Client client = ClientBuilder.newClient(); WebTarget target = client.target(location.get()) .path(PROCESS_SVG_URI) .resolveTemplate(CONTAINER_ID_PARAM, containerId) .resolveTemplate(PROCESS_ID_PARAM, processId); addAuth(connectionInfo, target); String svg = target.request().get(String.class); client.close(); return svg; } throw new RuntimeException("Location for Kie Server is required. Check configuration."); }
Source:
<code><START> public void open(DeserializationSchema.InitializationContext context) throws Exception; <END> public void deserialize(Envelope envelope, AMQP.BasicProperties properties, byte[] body, RMQCollector collector) throws IOException; boolean isEndOfStream(T nextElement); public TypeInformation<T> getProducedType(); public interface RMQCollector<T> extends Collector<T> { public void collect(List<T> records); public void setMessageIdentifiers(String correlationId, long deliveryTag); }</code><technical_language>of schemas do need open method. nice add empty default method</technical_language>

Target:
default void open(DeserializationSchema.InitializationContext context) throws Exception { }
Source:
<code>public void setDistribution(T[] values, double[] scores) { if (values.length == 0) { throw new RuntimeException("No values supplied"); } if (values.length != scores.length) { throw new RuntimeException("Number of scores and values must be identical"); } double[] exponents = new double[scores.length]; double shift = -Double.MAX_VALUE; for (int i = 0; i < scores.length; ++i) { exponents[i] = 0.5d * epsilon * scores[i]; shift = Math.max(shift, exponents[i]); } BigDecimal divisor = new BigDecimal(0d, mc); BigDecimal[] enumerators = new BigDecimal[scores.length]; for (int i = 0; i < scores.length; ++i) { enumerators[i] = exp(exponents[i] - shift); divisor = divisor.add(enumerators[i], mc); } List<Pair<T, Double>> pmf = new ArrayList<>(); for (int i = 0; i < scores.length; ++i) { BigDecimal enumerator = enumerators[i]; BigDecimal probability = enumerator.divide(divisor, mc); <START> pmf.add(new Pair<T, Double>(values[i], probability.doubleValue())); <END> } this.distribution = new EnumeratedDistribution<T>(this.random, pmf); }</code><technical_language>rounding here</technical_language>

Target:
public void setDistribution(T[] values, double[] scores) { if (values.length == 0) { throw new RuntimeException("No values supplied"); } if (values.length != scores.length) { throw new RuntimeException("Number of scores and values must be identical"); } double[] exponents = new double[scores.length]; double shift = -Double.MAX_VALUE; for (int i = 0; i < scores.length; ++i) { exponents[i] = 0.5d * epsilon * scores[i]; shift = Math.max(shift, exponents[i]); } List<Pair<T, Double>> pmf = new ArrayList<>(); for (int i = 0; i < scores.length; ++i) { double prob = Math.exp(exponents[i] - shift); pmf.add(new Pair<T, Double>(values[i], prob)); } this.distribution = new EnumeratedDistribution<T>(this.random, pmf); }
Source:
<code>private void remove() { if (getWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().removeAffinityLabelsTitle()); model.setHelpTag(HelpTag.remove_affinity_groups); model.setHashName("remove_affinity_labels"); ArrayList<String> list = new ArrayList<>(); for (Label affinityLabel : getSelectedItems()) { list.add(affinityLabel.getName()); } model.setItems(list); UICommand <START> command = <END> UICommand.createDefaultOkUiCommand("OnRemove", this); model.getCommands().add(command); model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); }</code><technical_language>inline this local variable</technical_language>

Target:
private void remove() { if (getWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().removeAffinityLabelsTitle()); model.setHelpTag(HelpTag.remove_affinity_groups); model.setHashName("remove_affinity_labels"); ArrayList<String> list = new ArrayList<>(); for (Label affinityLabel : getSelectedItems()) { list.add(affinityLabel.getName()); } model.setItems(list); model.getCommands().add(UICommand.createDefaultOkUiCommand("OnRemove", this)); model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); }
Source:
<code>protected Query doBuild(LuceneSearchPredicateContext context) { if ( queryBuilder != null ) { QueryBuilder effectiveQueryBuilder; if ( maxEditDistance != null ) { effectiveQueryBuilder = new FuzzyQueryBuilder( getAnalyzer(), maxEditDistance, prefixLength ); } else { queryBuilder.setAnalyzer( getAnalyzer() ); effectiveQueryBuilder = queryBuilder; } <START> Query analyzed = effectiveQueryBuilder.createBooleanQuery( absoluteFieldPath, value ); <END> if ( analyzed == null ) { analyzed = new MatchNoDocsQuery( "No tokens after analysis of the value to match" ); } return analyzed; } else { Term term = new Term( absoluteFieldPath, codec.normalize( absoluteFieldPath, value ) ); if ( maxEditDistance != null ) { return new FuzzyQuery( term, maxEditDistance, prefixLength ); } else { return new TermQuery( term ); } } }</code><technical_language>I ignore analyzer override if query builder is null, i.e. field is tokenized. I understand rationale: if overriding analyzer tokenizes input, match anyway. However, silently ignoring user-provided parameters feels wrong me. I options: 1. Throw exception in .analyzer if queryBuilder is null, explaining override analyzer for predicates targeting normalized fields. 2. support analyzer override in case. line if ( analyzer != null ) In cases, some testing is required, of course</technical_language>

Target:
protected Query doBuild(LuceneSearchPredicateContext context) { if ( analyzer != null ) { QueryBuilder effectiveQueryBuilder; if ( maxEditDistance != null ) { effectiveQueryBuilder = new FuzzyQueryBuilder( analyzer, maxEditDistance, prefixLength ); } else { effectiveQueryBuilder = new QueryBuilder( analyzer ); } Query analyzed = effectiveQueryBuilder.createBooleanQuery( absoluteFieldPath, value ); if ( analyzed == null ) { analyzed = new MatchNoDocsQuery( "No tokens after analysis of the value to match" ); } return analyzed; } else { Term term = new Term( absoluteFieldPath, codec.normalize( absoluteFieldPath, value ) ); if ( maxEditDistance != null ) { return new FuzzyQuery( term, maxEditDistance, prefixLength ); } else { return new TermQuery( term ); } } }
Source:
<code>public void testCreateSymlinkOverrideExisting() throws IOException { <START> FS fs = FS.DETECTED; File file = new File(trash, "x"); try { fs.createSymLink(file, "y"); } catch (IOException e) { if (fs.supportsSymlinks()) { fail("FS claims to support symlinks but attempt to create symlink failed"); } else { Assume.assumeTrue(false); } return; } assertTrue(fs.supportsSymlinks()); <END> String target = fs.readSymLink(file); assertEquals("y", target); fs.createSymLink(file, "z"); target = fs.readSymLink(file); assertEquals("z", target); }</code><technical_language>Do want this tests run if fs is telling is supporting symlinks? I I propose: FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); File file = new File(trash, "x"); try { fs.createSymLink(file, "y"); } catch (IOException e) { fail("FS claims support symlinks attempt create symlink failed"); } shorter: FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); File file = new File(trash, "x"); fs.createSymLink(file, "y");</technical_language>

Target:
public void testCreateSymlinkOverrideExisting() throws IOException { FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); File file = new File(trash, "x"); fs.createSymLink(file, "y"); assertTrue(fs.supportsSymlinks()); String target = fs.readSymLink(file); assertEquals("y", target); fs.createSymLink(file, "z"); target = fs.readSymLink(file); assertEquals("z", target); }
Source:
<code>public void after() { <START> UserFactory.logoutAllUsers(); <END> }</code><technical_language>in this file, tests running in looper thread. Logging out flaky</technical_language>

Target:
public void after() { if (!looperThread.isRuleUsed() || looperThread.isTestComplete()) { UserFactory.logoutAllUsers(); } else { looperThread.runAfterTest(new Runnable() { @Override public void run() { UserFactory.logoutAllUsers(); } }); } }
Source:
<code>public static void execute(String[] args, Configuration conf) { LOG.info("arguments : " + Arrays.toString(args)); try { CommandLine cmdline = new GnuParser().parse(getOptions(), args); if (cmdline.hasOption(ChaosServiceName.chaosagent.toString())) { String actionStr = cmdline.getOptionValue(ChaosServiceName.chaosagent.toString()); try { ExecutorAction action = ExecutorAction.valueOf(actionStr.toLowerCase()); if (action == ExecutorAction.start) { ChaosServiceStart(conf, ChaosServiceName.chaosagent); } else if (action == ExecutorAction.stop) { ChaosServiceStop(); } } catch (IllegalArgumentException e) { <START> LOG.error("action passed:" + actionStr + " . Unexpected action. Please provide only start/stop."); <END> throw new RuntimeException(e); } } else { LOG.error("Invalid Options"); } } catch (Exception e) { LOG.error("Error while starting ChaosService : " + e); } }</code><technical_language>nit: placeholders Exception argument i.e: LOG.error("action passed: . Unexpected action. Please provide start/stop.", actionStr, e);</technical_language>

Target:
public static void execute(String[] args, Configuration conf) { LOG.info("arguments : " + Arrays.toString(args)); try { CommandLine cmdline = new GnuParser().parse(getOptions(), args); if (cmdline.hasOption(ChaosServiceName.CHAOSAGENT.toString().toLowerCase())) { String actionStr = cmdline.getOptionValue(ChaosServiceName.CHAOSAGENT.toString().toLowerCase()); try { ExecutorAction action = ExecutorAction.valueOf(actionStr.toUpperCase()); if (action == ExecutorAction.START) { ChaosServiceStart(conf, ChaosServiceName.CHAOSAGENT); } else if (action == ExecutorAction.STOP) { ChaosServiceStop(); } } catch (IllegalArgumentException e) { LOG.error("action passed: Unexpected action. Please provide only start/stop.", actionStr, e); throw new RuntimeException(e); } } else { LOG.error("Invalid Options"); } } catch (Exception e) { LOG.error("Error while starting ChaosService : ", e); } }
Source:
<code>public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); if (Token.PINYIN == token.type) { keyPinyin.insert(0, token.target); if (i == tokenCount - 1) { keyInitial.insert(0, token.target); } else { keyInitial.insert(0, token.target.charAt(0)); } } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } keyPinyin.insert(0, token.source); if (i == tokenCount - 1) { keyInitial.insert(0, token.source); } else { keyInitial.insert(0, token.source.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); <START> keys.add(keyInitial.toString()); <END> } return keys.iterator(); }</code><technical_language>keyInitial keyPinyin i == tokenCount - 1, add key explicitly</technical_language>

Target:
public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); String tokenString = null; if (Token.PINYIN == token.type) { tokenString = token.target; } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } tokenString = token.source; } if (tokenString != null) { keyPinyin.insert(0, tokenString); if (i == tokenCount - 1 && tokenCount > 1) { keyInitial.insert(0, tokenString); } else { keyInitial.insert(0, tokenString.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); keys.add(keyInitial.toString()); } return keys.iterator(); }
Source:
<code>public PaginationOptions pageNumber(int pageNumber) { checkState(pageNumber > 0, "pageSize must be > 0"); <START> checkState(pageNumber <= 10000, "limit must be <= 50"); <END> this.queryParameters.put(PAGE_NUMBER, Integer.toString(pageNumber)); return this; }</code><technical_language>Precondition message match</technical_language>

Target:
public PaginationOptions pageNumber(int pageNumber) { checkState(pageNumber > 0, "pageSize must be > 0"); checkState(pageNumber <= 50, "limit must be <= 50"); this.queryParameters.put(PAGE_NUMBER, Integer.toString(pageNumber)); return this; }
Source:
<code>public void epsgTest() throws Exception { Envelope bounds = null; String[] testArray = {"EPSG:4326","EPSG:26910","EPSG:3857","EPSG:3412","EPSG:3411", "EPSG:3031"}; Envelope[] testEnvelopes = new Envelope[6]; testEnvelopes[0] = new Envelope(-180.0, 180.0, -90.0, 90.0); testEnvelopes[1] = new Envelope(212172.22206537757, 788787.632995196, 3378624.2031936757, 9083749.435906317); testEnvelopes[2] = new Envelope(-2.0037508342789244E7, 2.0037508342789244E7, -2.00489661040146E7, 2.0048966104014594E7); testEnvelopes[3] = new Envelope(-3323231.542684214, 3323231.542684214, -3323231.542684214, 3323231.542684214); testEnvelopes[4] = new Envelope(-2349879.5592850395, 2349879.5592850395, -2349879.5592850395, 2349879.5592850395); testEnvelopes[5] = new Envelope(-3333134.027630277, 3333134.027630277, -3333134.027630277, 3333134.027630277); for (int i = 0; i < testArray.length; i++) { <START> try { <END> bounds = new EPSGBoundsCalc().findCode(testArray[i]); } catch (Exception e) { e.printStackTrace(); } assertEquals(bounds, testEnvelopes[i]); } }</code><technical_language>remove try - if exception test case fail</technical_language>

Target:
public void epsgTest() throws Exception { Envelope bounds = null; String[] testArray = {"EPSG:4326","EPSG:26910","EPSG:3857","EPSG:3412","EPSG:3411", "EPSG:3031"}; Envelope[] testEnvelopes = new Envelope[6]; testEnvelopes[0] = new Envelope(-180.0, 180.0, -90.0, 90.0); testEnvelopes[1] = new Envelope(212172.22206537757, 788787.632995196, 3378624.2031936757, 9083749.435906317); testEnvelopes[2] = new Envelope(-2.0037508342789244E7, 2.0037508342789244E7, -2.00489661040146E7, 2.0048966104014594E7); testEnvelopes[3] = new Envelope(-3323231.542684214, 3323231.542684214, -3323231.542684214, 3323231.542684214); testEnvelopes[4] = new Envelope(-2349879.5592850395, 2349879.5592850395, -2349879.5592850395, 2349879.5592850395); testEnvelopes[5] = new Envelope(-3333134.027630277, 3333134.027630277, -3333134.027630277, 3333134.027630277); for (int i = 0; i < testArray.length; i++) { bounds = new EPSGBoundsCalc().findCode(testArray[i]); assertEquals(bounds, testEnvelopes[i]); } }
Source:
<code>public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute, resource, "This attribute can't be empty"); } Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource); Attribute facilityAttr = null; try { facilityAttr = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":homeMountPoints"); } catch (AttributeNotExistsException ex) { throw new InternalErrorException(ex); } if(facilityAttr.getValue() == null) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, "Reference attribute has null value."); } <START> if (!((List<String>) facilityAttr.getValue()).containsAll((List<String>) attribute.getValue())) { <END> throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "ReplicaSourcePath has to be the same as one of the F:D:homeMountPoints"); } }</code><technical_language>attribute.getValue() returns String, List<String></technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute, resource, "This attribute can't be empty"); } Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource); Attribute facilityAttr = null; try { facilityAttr = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":homeMountPoints"); } catch (AttributeNotExistsException ex) { throw new InternalErrorException(ex); } if(facilityAttr.getValue() == null) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "Reference attribute has null value."); } if (!((List<String>) facilityAttr.getValue()).contains((String) attribute.getValue())) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "ReplicaSourcePath has to be the same as one of the F:D:homeMountPoints"); } }
Source:
<code>public void write(T entity, K partitionKey) throws IOException { DataStoreWriter<T> writer = null; Path path = null; if (partitionKey != null) { path = partitionStrategy.getPartitionResolver().resolvePath(partitionKey); writer = writers.get(path); <START> } else if (fallbackWriter == null){ <END> writer = createWriter(getConfiguration(), null, getCodec()); } if (writer == null) { writer = createWriter(getConfiguration(), path, getCodec()); writers.put(path, writer); } writer.write(entity); }</code><technical_language>fallbackWriter null, logic is create a new writer a 'null" basePath if partitionKey=null. creating a "null" basePath mean</technical_language>

Target:
public void write(T entity, K partitionKey) throws IOException { DataStoreWriter<T> writer = null; Path path = null; if (partitionKey != null) { path = partitionStrategy.getPartitionResolver().resolvePath(partitionKey); writer = writers.get(path); } else if (fallbackWriter == null){ fallbackWriter = writer = createWriter(getConfiguration(), null, getCodec()); } if (writer == null) { writer = createWriter(getConfiguration(), path, getCodec()); writers.put(path, writer); } writer.write(entity); }
Source:
<code>private void testSequenceNextval() throws SQLException { checkSequenceTypeWithMode("REGULAR", Types.BIGINT); <START> checkSequenceTypeWithMode("Oracle", Types.DECIMAL); <END> }</code><technical_language>Oracle's JDBC driver returns Types.NUMERIC, it? I said, H2 returns Types.NUMERIC Types.DECIMAL depending settings. I Java SysProperties.BIG_DECIMAL_IS_DECIMAL ? Types.DECIMAL : Types.NUMERIC avoid failure test suit is launched non-default settings</technical_language>

Target:
private void testSequenceNextval() throws SQLException { checkSequenceTypeWithMode("REGULAR", Types.BIGINT); checkSequenceTypeWithMode("Oracle", SysProperties.BIG_DECIMAL_IS_DECIMAL ? Types.DECIMAL : Types.NUMERIC); }
Source:
<code>public Map<String,String> getAttributes(ExtSource extSource) { Map<String, String> attributes = new HashMap<>(); <START> SqlRowSet srs = jdbc.queryForRowSet("select attr_name, attr_value from ext_sources_attributes where ext_sources_id = " + extSource.getId()); <END> while (srs.next()) { attributes.put(srs.getString("attr_name"), srs.getString("attr_value")); } return attributes; }</code><technical_language>queryForRowSet() is unsafe for HSQL DB (used in tests), default publish renamed column names. I know, columns renamed in this sql query, standard jdbc.query(). select multiple-lines object ResultSetExtractor implementing extractData() method. e.g. AttributeRightsExtractor defined AttributesManagerImpl. Thanks</technical_language>

Target:
public Map<String,String> getAttributes(ExtSource extSource) { return jdbc.query("select attr_name, attr_value from ext_sources_attributes where ext_sources_id = " + extSource.getId(), new AttributesExtractor()); }
Source:
<code>public StreamEdge( StreamNode sourceVertex, StreamNode targetVertex, int typeNumber, List<String> selectedNames, StreamPartitioner<?> outputPartitioner, OutputTag outputTag) { this( sourceVertex, targetVertex, typeNumber, <START> 0, <END> selectedNames, outputPartitioner, outputTag, ShuffleMode.UNDEFINED); }</code><technical_language>nit: define constant, e.g. FLUSH_ALWAYS</technical_language>

Target:
public StreamEdge( StreamNode sourceVertex, StreamNode targetVertex, int typeNumber, List<String> selectedNames, StreamPartitioner<?> outputPartitioner, OutputTag outputTag) { this( sourceVertex, targetVertex, typeNumber, ALWAYS_FLUSH_BUFFER_TIMEOUT, selectedNames, outputPartitioner, outputTag, ShuffleMode.UNDEFINED); }
Source:
<code>public boolean startsWith(Bytes prefix) { for (int i = 0; i < prefix.length; i++) { <START> if (this.byteAt(i) != prefix.byteAt(i)) <END> return false; } return true; }</code><technical_language>mvn clean verify fails checkstyle. Fluo prefers braces, for one-line if blocks</technical_language>

Target:
public boolean startsWith(Bytes prefix) { Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter"); if (prefix.length > this.length) { return false; } else { int end = this.offset + prefix.length; for (int i = this.offset, j = prefix.offset; i < end; i++, j++) { if (this.data[i] != prefix.data[j]) { return false; } } } return true; }
Source:
<code>public synchronized String toString(LocalTime localTime) { sbuf.setLength(0); <START> if (localTime == LocalTime.MAX) { <END> return "24:00:00"; } appendTime(sbuf, localTime); return sbuf.toString(); }</code><technical_language>@davecramer do LocalTime.MAX.equals(localTime) here, instead of reference equality? a difference in write behavior a LocalTime a of 23:59:59.999999999 LocalTime.MAX, value-equal</technical_language>

Target:
public synchronized String toString(LocalTime localTime) { sbuf.setLength(0); if (localTime.equals( LocalTime.MAX )) { return "24:00:00"; } appendTime(sbuf, localTime); return sbuf.toString(); }
Source:
<code>protected LdapProviderType getLdapProviderType(CLIParser parser) throws ManageDomainsResult { try { <START> return LdapProviderType.valueOf(parser.getArg(Arguments.type.name())); <END> } catch (IllegalArgumentException i) { } catch (NullPointerException e) { } StringBuffer sb = new StringBuffer(); sb.append(parser.getArg(Arguments.type.name()) + ". Supported provider types are:\n"); for (LdapProviderType t : LdapProviderType.values()) { sb.append(" " + t.name() + "\n"); } throw new ManageDomainsResult(ManageDomainsResultEnum.INVALID_ARGUMENT_FOR_COMMAND, sb.toString()); }</code><technical_language>I guess case sensitive. case-insensitive</technical_language>

Target:
protected LdapProviderType getLdapProviderType(CLIParser parser) throws ManageDomainsResult { try { return LdapProviderType.valueOfIgnoreCase(parser.getArg(Arguments.provider.name())); } catch (IllegalArgumentException i) { } catch (NullPointerException e) { } StringBuffer sb = new StringBuffer(); sb.append(parser.getArg(Arguments.provider.name()) + ". Supported provider types are:\n"); for (LdapProviderType t : LdapProviderType.values()) { sb.append(" " + t.name() + "\n"); } throw new ManageDomainsResult(ManageDomainsResultEnum.INVALID_ARGUMENT_FOR_COMMAND, sb.toString()); }
Source:
<code>private String handleMatchingPatternAttribute(Pattern pattern, String attrValue) { String unescapedValue = StringEscapeUtils.unescapeHtml(attrValue); Matcher m = pattern.matcher(unescapedValue); StringBuffer sb = new StringBuffer(unescapedValue.length()); while (m.find()) { String url = m.group(1); for (String prefix : prefixes) { if (url.startsWith(prefix)) { url = prependHostName(url); <START> if (BooleanUtils.isTrue(this.replaceHost)) { <END> int index = attrValue.indexOf("://"); sb.setLength(0); sb.append(attrValue,0, index + 1); sb.append(url); } else { m.appendReplacement(sb, Matcher.quoteReplacement(url)); } break; } } } if (BooleanUtils.isFalse(this.replaceHost)) { m.appendTail(sb); } return sb.toString(); }</code><technical_language>- if (this.replaceHost) if replaceHost is a primitive</technical_language>

Target:
private String handleMatchingPatternAttribute(Pattern pattern, String attrValue) { String unescapedValue = StringEscapeUtils.unescapeHtml(attrValue); Matcher m = pattern.matcher(unescapedValue); StringBuffer sb = new StringBuffer(unescapedValue.length()); while (m.find()) { String url = m.group(1); for (String prefix : prefixes) { if (url.startsWith(prefix)) { url = prependHostName(url); if (this.replaceHost) { int index = attrValue.indexOf("://"); sb.setLength(0); sb.append(attrValue,0, index + 1); sb.append(url); } else { m.appendReplacement(sb, Matcher.quoteReplacement(url)); } break; } } } if (!this.replaceHost) { m.appendTail(sb); } return sb.toString(); }
Source:
<code><START> public Observable<Configuration> load(String id) { <END> return session.executeAndFetch(findConfiguration.bind(id)) .map(row -> { Map<String, String> map = new HashMap<>(); map.put(row.getString(0), row.getString(1)); return map; }) .reduce((m1, m2) -> { m2.putAll(m1); return m2; }) .map(map -> new Configuration(id, map)); }</code><technical_language>If this is a single returned value, Single<Configuration> instead of Observable. This introduced in some RxJava post-1.0 release. <LINK_0></technical_language>

Target:
public Observable<Configuration> load(String id) { return session.executeAndFetch(findConfiguration.bind(id)) .toMap(row -> row.getString(0), row -> row.getString(1)) .map(map -> new Configuration(id, map)); }
Source:
<code>Cookie[] convertCookies(HttpEntity<?> httpEntity) { final List<Cookie> cookies = new LinkedList<>(); <START> List<String> inboundCookies = httpEntity.getHeaders().get("Set-Cookie"); <END> if (inboundCookies != null) { for (String cookieString : inboundCookies) { Cookie cookie = convertCookieString(cookieString); cookies.add(cookie); } } return cookies.toArray(new Cookie[0]); }</code><technical_language>HttpHeaders.SET_COOKIE constant instead of a String</technical_language>

Target:
Cookie[] convertCookies(HttpEntity<?> httpEntity) { final List<Cookie> cookies = new LinkedList<>(); List<String> inboundCookies = httpEntity.getHeaders().get(HttpHeaders.SET_COOKIE); if (inboundCookies != null) { for (String cookieString : inboundCookies) { Cookie cookie = convertCookieString(cookieString); cookies.add(cookie); } } return cookies.toArray(new Cookie[0]); }
Source:
<code>protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final YqlConfiguration configuration = new YqlConfiguration(); configuration.setQuery(remaining); <START> configuration.setFormat((String) parameters.getOrDefault("format", "json")); <END> configuration.setDiagnostics(Boolean.getBoolean((String) parameters.getOrDefault("diagnostics", "false"))); configuration.setCallback((String) parameters.getOrDefault("callback", "")); final Endpoint endpoint = new YqlEndpoint(uri, this, configuration); YqlConfigurationValidator.validateProperties(configuration); setProperties(configuration, parameters); return endpoint; }</code><technical_language>Camel do this automatic in setProperties(configuration, parameters) do below. If want set default values set configuration class instead</technical_language>

Target:
protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final YqlConfiguration configuration = new YqlConfiguration(); configuration.setQuery(remaining); setProperties(configuration, parameters); YqlConfigurationValidator.validateProperties(configuration); final HttpClientConnectionManager connectionManager = createConnectionManager(); return new YqlEndpoint(uri, this, configuration, connectionManager); }
Source:
<code>public static File createTemporaryIndexedFile(final String prefix, final String suffix) throws IOException { final File out = File.createTempFile(prefix, suffix); out.deleteOnExit(); String indexFileExtension = null; if (suffix.endsWith(FileExtensions.COMPRESSED_VCF)) { indexFileExtension = FileExtensions.TABIX_INDEX; } else if (suffix.endsWith(FileExtensions.VCF)) { indexFileExtension = FileExtensions.VCF_INDEX; } else if (suffix.endsWith(FileExtensions.BAM)) { indexFileExtension = FileExtensions.BAM_INDEX; } else if (suffix.endsWith(FileExtensions.CRAM)) { indexFileExtension = FileExtensions.CRAM_INDEX; } if (indexFileExtension != null) { <START> final File indexOut = new File(out.getAbsolutePath() + indexFileExtension); <END> indexOut.deleteOnExit(); } return out; }</code><technical_language>Oh, I this, need careful extension replacement here? some of follow replacement rules instead of additive rules. I.e. bam.bai is ok, .crai instead of .cram.crai</technical_language>

Target:
public static File createTemporaryIndexedFile(final String prefix, final String suffix) throws IOException { final File out = File.createTempFile(prefix, suffix); out.deleteOnExit(); String indexFileExtension = null; if (suffix.endsWith(FileExtensions.COMPRESSED_VCF)) { indexFileExtension = FileExtensions.TABIX_INDEX; } else if (suffix.endsWith(FileExtensions.VCF)) { indexFileExtension = FileExtensions.VCF_INDEX; } else if (suffix.endsWith(FileExtensions.BAM)) { indexFileExtension = FileExtensions.BAM_BAI_INDEX; } else if (suffix.endsWith(FileExtensions.CRAM)) { indexFileExtension = FileExtensions.BAM_BAI_INDEX; } if (indexFileExtension != null) { final File indexOut = new File(out.getAbsolutePath() + indexFileExtension); indexOut.deleteOnExit(); } return out; }
Source:
<code>public void testBasicAuthHeaderAddedToRequestWhenUserInfoPresentInUri() throws Exception { final URI mesosUri = URI.create("http://testuser:testpassword@localhost:12345/api/v1/scheduler"); final MesosSchedulerClient<Protos.Call, Protos.Event> client = MesosSchedulerClient.usingProtos(mesosUri, "testing"); final HttpClientRequest<ByteBuf> request = client.createPost.call(ACK) .toBlocking() .first(); final Map<String, String> headers = headersToMap(request.getHeaders()); assertThat(headers).containsKeys("Authorization"); final String authorization = headers.get("Authorization"); assertThat(authorization).isEqualTo("Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk"); <START> final String base64UserPass = authorization.substring("Begin ".length()); <END> final String userPass = new String(Base64.getDecoder().decode(base64UserPass)); assertThat(userPass).isEqualTo("testuser:testpassword"); }</code><technical_language>guessing meant "Basic ".length() here</technical_language>

Target:
public void testBasicAuthHeaderAddedToRequestWhenUserInfoPresentInUri() throws Exception { final MesosSchedulerClient<Protos.Call, Protos.Event> client = MesosSchedulerClient.usingProtos( URI.create("http://testuser:testpassword@localhost:12345/api/v1/scheduler"), literal("testing", "latest") ); final HttpClientRequest<ByteBuf> request = client.createPost.call(ACK) .toBlocking() .first(); final Map<String, String> headers = headersToMap(request.getHeaders()); assertThat(headers).containsKeys("Authorization"); final String authorization = headers.get("Authorization"); assertThat(authorization).isEqualTo("Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk"); final String base64UserPass = authorization.substring("Basic ".length()); final String userPass = new String(Base64.getDecoder().decode(base64UserPass)); assertThat(userPass).isEqualTo("testuser:testpassword"); }
Source:
<code>public void blockedUserShouldBeAbleToChangeEmail() { <START> final String newEmailAddress = "myAwesomeEmail@email.co.uk"; <END> EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); editPrefPage.changeEmail(Configuration.getCredentials().email); editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), Configuration.getCredentials().email); }</code><technical_language>if is final is static? if is final static move this field class field</technical_language>

Target:
public void blockedUserShouldBeAbleToChangeEmail() { final String newEmailAddress = "myAwesomeEmail@email.co.uk"; final String oldEmailAddress = Configuration.getCredentials().email; EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); editPrefPage.changeEmail(oldEmailAddress); editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), oldEmailAddress); }
Source:
<code>boolean add(RevFlag flag) { if (sourceCommit.has(flag)) return false; <START> else { <END> sourceCommit.add(flag); return true; } }</code><technical_language>style nit: early return avoid need for else for statements in else case</technical_language>

Target:
boolean add(RevFlag flag) { if (sourceCommit.has(flag)) return false; sourceCommit.add(flag); return true; }
Source:
<code>public void getUserContactsShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserContacts(new RetrofitPromise<List<Contact>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/contacts", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }</code><technical_language>Add newline return</technical_language>

Target:
public void getUserContactsShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserContacts(new RetrofitPromise<List<Contact>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/contacts", MOCK_URL)); }
Source:
<code>public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); <START> logger.info("Bye"); <END> System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { logger.info("Bye"); System.exit(0); } } }</code><technical_language>exiting, STDERR</technical_language>

Target:
public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); System.err.println("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { System.err.println("Bye"); System.exit(0); } } }
Source:
<code>public void loginLogoutResumeSyncing() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(config); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SyncManager.getSession(config).uploadAllLocalChanges(); user.logout(); realm.close(); <START> user = SyncUser.login(SyncCredentials.usernamePassword(username, password, false), Constants.AUTH_URL); <END> SyncConfiguration config2 = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm2 = Realm.getInstance(config2); SyncManager.getSession(config2).downloadAllServerChanges(); realm2.refresh(); assertEquals(1, realm2.where(StringOnly.class).count()); }</code><technical_language>logging in user path disk same. I this test syncing works uploaded changes is created server in meantime</technical_language>

Target:
public void loginLogoutResumeSyncing() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(config); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SyncManager.getSession(config).uploadAllLocalChanges(); user.logout(); realm.close(); assertTrue(Realm.deleteRealm(config)); user = SyncUser.login(SyncCredentials.usernamePassword(username, password, false), Constants.AUTH_URL); SyncConfiguration config2 = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm2 = Realm.getInstance(config2); SyncManager.getSession(config2).downloadAllServerChanges(); realm2.refresh(); assertEquals(1, realm2.where(StringOnly.class).count()); realm2.close(); }
Source:
<code>public MigratableTableTranslation<DBOVerificationState, DBOVerificationState> getTranslator() { return new BasicMigratableTableTranslation<DBOVerificationState>() { @Override <START> public DBOVerificationState createDatabaseObjectFromBackup(DBOVerificationState backup) { <END> if (backup.getEtag() == null) { backup.setEtag(UUID.randomUUID().toString()); } return backup; } }; }</code><technical_language>remove</technical_language>

Target:
public MigratableTableTranslation<DBOVerificationState, DBOVerificationState> getTranslator() { return new BasicMigratableTableTranslation<>(); }
Source:
<code>public void unknown_method() { Expression.Variable arg = UCFGBuilder.variableWithId("arg"); UCFG expectedUCFG = UCFGBuilder.createUCFGForMethod("A#method(Ljava/util/Set;)V").addMethodParam(arg) .addBasicBlock(newBasicBlock("0") .ret(constant("implicit return"), new LocationInFile(FILE_KEY, 9, 2, 9, 3))) .build(); assertCodeToUCfg("import java.util.Set;\n" + "import java.util.Collection;\n" + "import java.util.stream.Collectors;\n" + "public class A {\n" + " void method(Set<String> arg) { \n" + " arg.stream()\n" + " .flatMap(Collection::stream)\n" + " .collect(Collectors.toCollection(LinkedHashSet::new)); \n" + " }\n" + <START> "}", expectedUCFG); <END> }</code><technical_language>This is unreliable test : fix improvement of semantic this unrelated test fail. A nicest test is invoke a method named "__unknown" is defined in source</technical_language>

Target:
public void unknown_method() { Expression.Variable arg = UCFGBuilder.variableWithId("arg"); UCFG expectedUCFG = UCFGBuilder.createUCFGForMethod("A#method(Ljava/util/Set;)V").addMethodParam(arg) .addBasicBlock(newBasicBlock("0") .ret(constant("implicit return"), new LocationInFile(FILE_KEY, 9, 2, 9, 3))) .build(); String source = "import java.util.Set;\n" + "import java.util.Collection;\n" + "import java.util.stream.Collectors;\n" + "public class A {\n" + " void method(Set<String> arg) { \n" + " arg.stream()\n" + " .flatMap(Collection::stream)\n" + " .collect(Collectors.toCollection(LinkedHashSet::new)); \n" + " }\n" + "}"; assertUnknownMethodCalled(source); assertCodeToUCfg(source, expectedUCFG); }
Source:
<code>protected void fireLabelProviderChanged( final LabelProviderChangedEvent event) { Object[] theListeners = getListeners(); for (Object <START> theListener : <END> theListeners) { final ILabelProviderListener l = (ILabelProviderListener) theListener; SafeRunner.run(new SafeRunnable() { @Override public void run() { l.labelProviderChanged(event); } }); } }</code><technical_language>rename</technical_language>

Target:
protected void fireLabelProviderChanged( final LabelProviderChangedEvent event) { for (Object listener : getListeners()) { final ILabelProviderListener labelProviderListener = (ILabelProviderListener) listener; SafeRunner.run(new SafeRunnable() { @Override public void run() { labelProviderListener.labelProviderChanged(event); } }); } }
Source:
<code><START> PropertyMapper(Class<?> baseClass, String propertyName, String alias, Field field, PropertyDescriptor property) { <END> this.propertyName = propertyName; this.alias = alias; this.field = field; getter = ReflectionUtils.findGetter(property); setter = ReflectionUtils.findSetter(baseClass, property); annotations = ReflectionUtils.scanPropertyAnnotations(field, property); if (field != null) ReflectionUtils.tryMakeAccessible(field); if (getter != null) ReflectionUtils.tryMakeAccessible(getter); if (setter != null) ReflectionUtils.tryMakeAccessible(setter); if (!isTransient()) { checkState((field != null && field.isAccessible()) || (getter != null && getter.isAccessible()), "Property '%s' is not readable", propertyName); checkState((field != null && field.isAccessible()) || (setter != null && setter.isAccessible()), "Property '%s' is not writable", propertyName); } columnName = inferColumnName(); position = inferPosition(); javaType = inferJavaType(); customCodec = createCustomCodec(); }</code><technical_language>in code for Field PropertyDescriptor defined null, separate constructors, 2 separate subtypes? I in getters/setters a lot of null checking, if types separate implementations</technical_language>

Target:
PropertyMapper(Class<?> baseClass, String propertyName, String alias, Field field, PropertyDescriptor property) { this.propertyName = propertyName; this.alias = alias; this.field = field; getter = ReflectionUtils.findGetter(property); setter = ReflectionUtils.findSetter(baseClass, property); annotations = ReflectionUtils.scanPropertyAnnotations(field, property); if (field != null) ReflectionUtils.tryMakeAccessible(field); if (getter != null) ReflectionUtils.tryMakeAccessible(getter); if (setter != null) ReflectionUtils.tryMakeAccessible(setter); if (!isTransient()) { checkArgument((field != null && field.isAccessible()) || (getter != null && getter.isAccessible()), "Property '%s' is not readable", propertyName); checkArgument((field != null && field.isAccessible()) || (setter != null && setter.isAccessible()), "Property '%s' is not writable", propertyName); } columnName = inferColumnName(); position = inferPosition(); javaType = inferJavaType(); customCodec = createCustomCodec(); }
Source:
<code>public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { <START> functionNamespaces = ImmutableMap.of(); <END> this.typeManager = requireNonNull(typeManager, "typeManager is null"); this.blockEncodingSerde = requireNonNull(blockEncodingSerde, "blockEncodingSerde is null"); this.featuresConfig = requireNonNull(featuresConfig, "featuresConfig is null"); operatorNamespace = new StaticFunctionNamespace(typeManager, blockEncodingSerde, featuresConfig); }</code><technical_language>nit: this consistent change order a bit this.typeManager = requireNonNull(typeManager, "typeManager is null"); this.blockEncodingSerde = requireNonNull(blockEncodingSerde, "blockEncodingSerde is null"); this.featuresConfig = requireNonNull(featuresConfig, "featuresConfig is null"); this.functionNamespaces = ImmutableMap.of(); this.operatorNamespace = new StaticFunctionNamespace(typeManager, blockEncodingSerde, featuresConfig);</technical_language>

Target:
public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { FunctionRegistry functionRegistry = new FunctionRegistry(typeManager, blockEncodingSerde, featuresConfig, this); this.globalFunctionNamespace = new FunctionNamespace(functionRegistry); this.functionInvokerProvider = new FunctionInvokerProvider(functionRegistry); if (typeManager instanceof TypeRegistry) { ((TypeRegistry) typeManager).setFunctionManager(this); } }
Source:
<code>public String toString() { if (namespaceURI.equals(QName.NULL_NS_URI)) { return localPart; } else { <START> return prefix + ":" + localPart; <END> } }</code><technical_language>Sorry, do this :-( formatting is in accordance <LINK_0> states a formal standard commonly used</technical_language>

Target:
public String toString() { if (namespaceURI.equals(QName.NULL_NS_URI)) { return localPart; } else { return "{" + namespaceURI + "}" + localPart; } }
Source:
<code>public void emitTuples() { try { String line = reader.readLine(); if (line == null) { reader.close(); initReader(); } else { this.output.emit(line); } Thread.sleep(500); } catch (IOException ex) { throw new RuntimeException(ex); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Please fix exception handling</technical_language>

Target:
public void emitTuples() { try { String line = reader.readLine(); if (line == null) { done = true; reader.close(); Thread.sleep(1000); } else { this.output.emit(line); } Thread.sleep(50); } catch (IOException ex) { throw new RuntimeException(ex); } catch (InterruptedException e) { } }
Source:
<code>public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); <START> Thread.sleep(100); <END> ZkHelixClusterVerifier _clusterVerifier = new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); Assert.assertTrue(_clusterVerifier.verifyByPolling()); }</code><technical_language>This necessary anymore</technical_language>

Target:
public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); ZkHelixClusterVerifier _clusterVerifier = new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); Assert.assertTrue(_clusterVerifier.verifyByPolling()); }