auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { if(subPattern.length() != (endExcl - startIncl)){ return false; } int i = 0; <START> for (; i < subPattern.length(); i++) { <END> char c1 = subPattern.charAt(i); char c2 = segment.charAt(i + startIncl); if(c1 != c2){ return false; } } return true; }</code><technical_language>initialize i in for-statement</technical_language>

Target:
public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { String s = subPattern; if (s.length() != (endExcl - startIncl)) return false; for (int i = 0; i < s.length(); i++) { char c1 = s.charAt(i); char c2 = segment.charAt(i + startIncl); if (c1 != c2) return false; } return true; }
Source:
<code>private void stopContainerScrub() { if (scrubber == null) { return; } <START> if (scrubber.isHalted()) { <END> scrubber.down(); } }</code><technical_language>is this if (!scrubber.isHalted()) halt is initially set false, is stopped is set true</technical_language>

Target:
private void stopContainerScrub() { if (scrubber == null) { return; } scrubber.down(); }
Source:
<code>public static EndpointRegistryInfo fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistryInfo registry = new EndpointRegistryInfo(); registry.setName(registryDTO.getName()); registry.setOwner(owner); <START> if (registryDTO.getType() != null) { <END> registry.setType(registryDTO.getType().toString()); } if (registryDTO.getMode() != null) { registry.setMode(registryDTO.getMode().toString()); } return registry; }</code><technical_language>set defaults if provided</technical_language>

Target:
public static EndpointRegistryInfo fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistryInfo registry = new EndpointRegistryInfo(); registry.setName(registryDTO.getName()); registry.setOwner(owner); if (registryDTO.getType() != null) { registry.setType(registryDTO.getType().toString()); } else { registry.setType(RegistryDTO.TypeEnum.WSO2.toString()); } if (registryDTO.getMode() != null) { registry.setMode(registryDTO.getMode().toString()); } else { registry.setMode(RegistryDTO.ModeEnum.READONLY.toString()); } return registry; }
Source:
<code>private UnaryTest createInUnaryTest() { return (c, o) -> { if (o == null) { return false; } Object val = value.evaluate( c ); if (val instanceof Range) { try { return ((Range) val).includes(o); } catch (Exception e) { c.notifyEvt(astEvent(Severity.ERROR, Msg.createMessage(Msg.EXPRESSION_IS_RANGE_BUT_VALUE_IS_NOT_COMPARABLE, o.toString(), val.toString()))); throw e; } <START> } else if (val instanceof List) { <END> return ((List) val).contains(o); } else { return false; } }; }</code><technical_language>consistent, check for instanceof Collection instead of List? place checking this, eventually audit code fix everywhere..</technical_language>

Target:
private UnaryTest createInUnaryTest() { return (c, o) -> { if (o == null) { return false; } Object val = value.evaluate( c ); if (val instanceof Range) { try { return ((Range) val).includes(o); } catch (Exception e) { c.notifyEvt(astEvent(Severity.ERROR, Msg.createMessage(Msg.EXPRESSION_IS_RANGE_BUT_VALUE_IS_NOT_COMPARABLE, o.toString(), val.toString()))); throw e; } } else if (val instanceof Collection) { return ((Collection) val).contains(o); } else { return false; } }; }
Source:
<code><START> public void keyVaultWithVirtualMachineMSI() throws Exception { <END> final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final MavenBasedProject app = new MavenBasedProject("../azure-spring-boot-test-application"); app.packageUp(); final File file = new File(app.artifact()); if (!file.exists()) { throw new FileNotFoundException("There's no app.jar file found."); } try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD); FileInputStream fis = new FileInputStream(file)) { LOGGER.info("Uploading jar file..."); sshShell.upload(fis, "app.jar", "", true, "4095"); } final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD)) { sshShell.runCommands(commands); } final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }</code><technical_language>Please remove unused import</technical_language>

Target:
public void keyVaultWithVirtualMachineMSI() throws Exception { final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final MavenBasedProject app = new MavenBasedProject("../azure-spring-boot-test-application"); app.packageUp(); final File file = new File(app.artifact()); if (!file.exists()) { throw new FileNotFoundException("There's no app.jar file found."); } final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD); FileInputStream fis = new FileInputStream(file)) { LOGGER.info("Uploading jar file..."); sshShell.upload(fis, "app.jar", "", true, "4095"); LOGGER.info("Running commands"); sshShell.runCommands(commands); } final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }
Source:
<code>public void testLongPathWithCloneOption() throws Exception { RandomStringGenerator generator = new RandomStringGenerator.Builder() .withinRange('a', 'z').build(); <START> String fileName = generator.generate(200); <END> File tempDir = Files.createTempDirectory(fileName).toFile(); if (isWindows()) { if (workspace.getGitFileDir().renameTo(tempDir)) { CloneCommand cmd = workspace.getGitClient().clone_().url(workspace.localMirror()).repositoryName("origin").longPath(true); cmd.execute(); } testGitClient.checkout().ref("origin/master").branch("master").execute(); check_remote_url(workspace, testGitClient, "origin"); assertBranchesExist(testGitClient.getBranches(), "master"); } }</code><technical_language>Increase likelihood of a temporary file name greater 259 characters. suggestion String fileName = generator.generate(230);</technical_language>

Target:
public void testLongPathWithCloneOption() throws Exception { RandomStringGenerator generator = new RandomStringGenerator.Builder() .withinRange('a', 'z').build(); String fileName = generator.generate(133); String subDirName = generator.generate(80); File tempDir = Files.createTempDirectory(fileName).toFile(); File tempSubDir = new File(tempDir, subDirName); Path subDirectory = Paths.get(tempSubDir.getAbsolutePath()); Files.createDirectories(subDirectory); assertThat(tempSubDir.getAbsolutePath().length(), greaterThan(259)); WorkspaceWithRepo tempRepo = new WorkspaceWithRepo(tempSubDir, gitImplName, listener); if (Files.isDirectory(subDirectory)) { if (isWindows()) { CloneCommand cmd = tempRepo.getGitClient().clone_().url(tempRepo.localMirror()).repositoryName("origin").longPath(true); cmd.execute(); tempRepo.getGitClient().checkout().ref("origin/master").branch("master").execute(); check_remote_url(tempRepo, tempRepo.getGitClient(), "origin"); assertBranchesExist(tempRepo.getGitClient().getBranches(), "master"); } } }
Source:
<code>public EventDTO clone() { EventDTO copy = super.clone(); <START> copy.timestamp = timestamp != null ? new Date(timestamp.getTime()) : null; <END> return copy; }</code><technical_language>clone method new date</technical_language>

Target:
public EventDTO clone() { EventDTO copy = super.clone(); copy.timestamp = this.timestamp != null ? (Date) this.timestamp.clone() : null; return copy; }
Source:
<code>public static KLabelConstant of(String label, Definition definition) { synchronized (cache) { return cache.computeIfAbsent(Pair.of(definition.signaturesOf(label), definition.kLabelAttributesOf(label)), p -> Collections.synchronizedMap(new PatriciaTrie<>())) .computeIfAbsent(label, l -> new KLabelConstant( l, <START> cacheSize(), <END> definition.signaturesOf(l), definition.allSorts(), definition.kLabelAttributesOf(l))); } }</code><technical_language>I a good idea cacheSize for ordinal number; a dedicated AtomicLong</technical_language>

Target:
public static KLabelConstant of(String label, Definition definition) { return cache.computeIfAbsent(Pair.of(definition.signaturesOf(label), definition.kLabelAttributesOf(label)), p -> new ConcurrentHashMap<>()) .computeIfAbsent(label, l -> new KLabelConstant( l, maxOrdinal.getAndIncrement(), definition.signaturesOf(l), definition.allSorts(), definition.kLabelAttributesOf(l))); }
Source:
<code><START> public List<MrrtReportTemplate> getMrrtReportTemplateByTitle(String title) { <END> return mrrtReportTemplateDAO.getMrrtReportTemplateByTitle(title); }</code><technical_language>@ivange94 order in impl in service. getters together. getMrrtReportTemplateByTitle getMrrtReportTemplateByUuid</technical_language>

Target:
public List<MrrtReportTemplate> getMrrtReportTemplateByTitle(String title) { if (title == null) { throw new IllegalArgumentException("title cannot be null"); } return mrrtReportTemplateDAO.getMrrtReportTemplateByTitle(title); }
Source:
<code>private boolean tableExists(String tableName) { Connection conn = null; PreparedStatement stmt = null; String query; ResultSet rs = null; try { conn = getConnection(); query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY); stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName)); rs = stmt.executeQuery(); return true; } catch (SQLException e) { if (log.isDebugEnabled()) { <START> log.debug("Table '" + tableName + "' assumed to not exist since its existence check resulted " <END> + "in exception " + e.getMessage()); } return false; } finally { closeConnection(conn, stmt, rs); } }</code><technical_language>reason parameterized log messages (as in [above](<LINK_0></technical_language>

Target:
private boolean tableExists(String tableName) { Connection conn = null; PreparedStatement stmt = null; String query = null; ResultSet rs = null; try { conn = getConnection(); query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY); stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName)); rs = stmt.executeQuery(); return true; } catch (SQLException e) { log.debug("Table '{}' assumed to not exist since its existence check query resulted " + "in exception {}.", tableName, query, e.getMessage()); return false; } finally { closeConnection(conn, stmt, rs); } }
Source:
<code>public DBSSession(DBSRepository repository) { this.repository = repository; @SuppressWarnings("resource") DBSConnection connection = repository.getConnection(); <START> transaction = new DBSTransactionState(repository, connection, this); <END> FulltextConfiguration fulltextConfiguration = repository.getFulltextConfiguration(); fulltextSearchDisabled = fulltextConfiguration == null || fulltextConfiguration.fulltextSearchDisabled; changeTokenEnabled = repository.isChangeTokenEnabled(); saveTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "saves")); queryTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "queries")); LOG_MIN_DURATION_NS = Long.parseLong(Framework.getProperty(LOG_MIN_DURATION_KEY, "-1")) * 1000000; isLatestVersionDisabled = Framework.isBooleanPropertyTrue(DISABLED_ISLATESTVERSION_PROPERTY); }</code><technical_language>I find other instantiation of DBSTransactionState need change DBSTransactionState constructor do getConnection it, wdy</technical_language>

Target:
public DBSSession(DBSRepository repository) { this.repository = repository; transaction = new DBSTransactionState(repository, this); FulltextConfiguration fulltextConfiguration = repository.getFulltextConfiguration(); fulltextSearchDisabled = fulltextConfiguration == null || fulltextConfiguration.fulltextSearchDisabled; changeTokenEnabled = repository.isChangeTokenEnabled(); saveTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "saves")); queryTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "queries")); LOG_MIN_DURATION_NS = Long.parseLong(Framework.getProperty(LOG_MIN_DURATION_KEY, "-1")) * 1000000; isLatestVersionDisabled = Framework.isBooleanPropertyTrue(DISABLED_ISLATESTVERSION_PROPERTY); }
Source:
<code>private synchronized void initConnectStatusCheckCommand() { int reconnect = getReconnectParam(getUrl()); if (reconnect > 0 && (reconnectExecutorFuture == null || reconnectExecutorFuture.isCancelled())) { Runnable connectStatusCheckCommand = new Runnable() { @Override public void run() { try { <START> if(isClosed()) { <END> ScheduledFuture<?> future = reconnectExecutorFuture; if(future != null && !future.isCancelled()){ future.cancel(true); } return; } if (!isConnected()) { connect(); } else { lastConnectedTime = System.currentTimeMillis(); } } catch (Throwable t) { String errorMsg = "client reconnect to " + getUrl().getAddress() + " find error . url: " + getUrl(); if (System.currentTimeMillis() - lastConnectedTime > shutdown_timeout) { if (!reconnect_error_log_flag.get()) { reconnect_error_log_flag.set(true); logger.error(errorMsg, t); return; } } if (reconnect_count.getAndIncrement() % reconnect_warning_period == 0) { logger.warn(errorMsg, t); } } } }; reconnectExecutorFuture = reconnectExecutorService.scheduleWithFixedDelay(connectStatusCheckCommand, reconnect, reconnect, TimeUnit.MILLISECONDS); } }</code><technical_language>do feel refactoring extracting a method increase readability of code /** * If provider service is detected offline, * client attempt connect again. * * issue: <LINK_0> */ if(cancelFutureIfClientIsOffline(reconnectExecutorFuture)) { reconnectExecutorFuture.cancel(true); } private boolean cancelFutureIfClientIsOffline(ScheduledFuture future) { return isClosed()) ? (future != null && !future.isCancelled()) :false; }</technical_language>

Target:
private synchronized void initConnectStatusCheckCommand() { int reconnect = getReconnectParam(getUrl()); if (reconnect > 0 && (reconnectExecutorFuture == null || reconnectExecutorFuture.isCancelled())) { Runnable connectStatusCheckCommand = new Runnable() { @Override public void run() { try { if (cancelFutureIfOffline()) return; if (!isConnected()) { connect(); } else { lastConnectedTime = System.currentTimeMillis(); } } catch (Throwable t) { String errorMsg = "client reconnect to " + getUrl().getAddress() + " find error . url: " + getUrl(); if (System.currentTimeMillis() - lastConnectedTime > shutdown_timeout) { if (!reconnect_error_log_flag.get()) { reconnect_error_log_flag.set(true); logger.error(errorMsg, t); return; } } if (reconnect_count.getAndIncrement() % reconnect_warning_period == 0) { logger.warn(errorMsg, t); } } } private boolean cancelFutureIfOffline() { if(isClosed()) { ScheduledFuture<?> future = reconnectExecutorFuture; if(future != null && !future.isCancelled()){ future.cancel(true); } return true; } return false; } }; reconnectExecutorFuture = reconnectExecutorService.scheduleWithFixedDelay(connectStatusCheckCommand, reconnect, reconnect, TimeUnit.MILLISECONDS); } }
Source:
<code>private String extractVmIpsFromGuestAgentInterfaces(List<VmGuestAgentInterface> nics) { if (nics == null || nics.isEmpty()) { return null; } List<String> ips = new ArrayList<String>(); for (VmGuestAgentInterface nic : nics) { <START> if (nic.getIpv4Addresses() != null && !nic.getIpv4Addresses().isEmpty()) { <END> ips.addAll(nic.getIpv4Addresses()); } } return ips.isEmpty() ? null : StringUtils.join(ips, " "); }</code><technical_language>need check 'is empty'</technical_language>

Target:
private String extractVmIpsFromGuestAgentInterfaces(List<VmGuestAgentInterface> nics) { if (nics == null || nics.isEmpty()) { return null; } List<String> ips = new ArrayList<String>(); for (VmGuestAgentInterface nic : nics) { if (nic.getIpv4Addresses() != null) { ips.addAll(nic.getIpv4Addresses()); } } return ips.isEmpty() ? null : StringUtils.join(ips, " "); }
Source:
<code><START> protected <END> void gtk_widget_set_align(long widget, int hAlign, int vAlign) { OS.gtk_widget_set_halign (widget, hAlign); OS.gtk_widget_set_valign (widget, vAlign); }</code><technical_language>Remove protected prevent access package place method other gtk_widget methods in this class</technical_language>

Target:
void gtk_widget_set_align(long widget, int hAlign, int vAlign) { OS.gtk_widget_set_halign (widget, hAlign); OS.gtk_widget_set_valign (widget, vAlign); }
Source:
<code>public ResultIterator getPSIterator(String name, int fetchSize) throws DatabaseEngineException, ConnectionResetException { final PreparedStatementCapsule ps = stmts.get(name); if (ps == null) { throw new DatabaseEngineRuntimeException(String.format("PreparedStatement named '%s' does not exist", name)); } try { ps.ps.setFetchSize(fetchSize); } catch (final SQLException e) { throw new DatabaseEngineException("Error creating PS Iterator", e); } try { return createResultIterator(ps.ps); } catch (final DatabaseEngineException e2) { reconnectExceptionally("Connection is down"); <START> throw new ConnectionResetException("Connection was lost and reset, you must reset the prepared statement parameters and re-execute the statement"); <END> } }</code><technical_language>do "...was lost *and reset*, reset..."</technical_language>

Target:
public ResultIterator getPSIterator(String name, int fetchSize) throws DatabaseEngineException, ConnectionResetException { final PreparedStatementCapsule ps = stmts.get(name); if (ps == null) { throw new DatabaseEngineRuntimeException(String.format("PreparedStatement named '%s' does not exist", name)); } try { ps.ps.setFetchSize(fetchSize); } catch (final SQLException e) { throw new DatabaseEngineException("Error creating PS Iterator", e); } try { return createResultIterator(ps.ps); } catch (final DatabaseEngineException e2) { reconnectExceptionally("Connection is down"); throw new ConnectionResetException("Connection was lost and restablished. You need to reset the prepared statement parameters and re-execute the statement"); } }
Source:
<code>private TransactionalDocumentAuthorizer createMockAuthorizer() { TransactionalDocumentAuthorizer documentAuthorizer = Mockito.mock(TransactionalDocumentAuthorizer.class); Mockito.when(documentAuthorizer.canEdit(Mockito.any(), Mockito.any())).then(this::determineEditCall); <START> Mockito.when(documentAuthorizer.getEditModes(Mockito.any(), Mockito.any(),Mockito.any())).thenReturn(authorizationEditModes); <END> return documentAuthorizer; }</code><technical_language>mock of this method checking for a stricter set of arguments. new code do so</technical_language>

Target:
private TransactionalDocumentAuthorizer createMockAuthorizer() { TransactionalDocumentAuthorizer documentAuthorizer = Mockito.mock(TransactionalDocumentAuthorizer.class); Mockito.when(documentAuthorizer.canEdit(Mockito.any(CuDisbursementVoucherDocument.class), Mockito.any())).then(this::determineEditCall); Mockito.when(documentAuthorizer.getEditModes(Mockito.any(CuDisbursementVoucherDocument.class), Mockito.any(),Mockito.any())).thenReturn(authorizationEditModes); return documentAuthorizer; }
Source:
<code>protected void appendCriteria(Map<String, Object> parameters) { parameters.put(ScmMaterialConfig.URL, url.forCommandline()); parameters.put("branch", branch); <START> parameters.put("shallowClone", shallowClone); <END> }</code><technical_language>Umm, ok. Changing fingerprint is done possible, big implications fan-in, etc. show easily upgrade. This needs @jyotisingh's expertise. CCing her. need part of fingerprint? stored in DB, part of fingerprint? Anyway, @jyotisingh more/better</technical_language>

Target:
protected void appendCriteria(Map<String, Object> parameters) { parameters.put(ScmMaterialConfig.URL, url.forCommandline()); parameters.put("branch", branch); }
Source:
<code>public Term parseInModule(StringToken input, StringToken startSymbol, StringToken moduleName, TermContext termContext) { try { org.kframework.kil.Term kast = programLoader.parseInModule( input.stringValue(), new GeneratedSource(this.getClass()), Sort.of(startSymbol.stringValue()), moduleName.stringValue(), context); Term term = kilTransformer.transformAndEval(kast); term = term.evaluate(termContext); return term; } catch (ParseFailedException e) { String line = "" + e.getKException().getLocation().lineStart; String col = "" + e.getKException().getLocation().columnStart; <START> return processIOException("noparse", StringToken.of(e.getMessage() + " Line: " + line + " Column: " + col), termContext); <END> } }</code><technical_language>if change syntax of #noparse need modify IO server tcp.k</technical_language>

Target:
public Term parseInModule(StringToken input, StringToken startSymbol, StringToken moduleName, TermContext termContext) { try { org.kframework.kil.Term kast = programLoader.parseInModule( input.stringValue(), Sources.generatedBy(this.getClass()), Sort.of(startSymbol.stringValue()), moduleName.stringValue(), context); Term term = kilTransformer.transformAndEval(kast); term = term.evaluate(termContext); return term; } catch (ParseFailedException e) { return processIOException("noparse", termContext); } }
Source:
<code>public void elementShouldNotContain(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, StringUtils.EMPTY); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); String actual = getText(locator); <START> if (!textContains(actual, text, ignoreCase)) { <END> if (StringUtils.isEmpty(message)) { message = String.format("Element should not have contained text '%s', but its text was %s.", text, actual); } logging.info(String.format("Element Should Not Contain: %s => FAILED", text)); throw new SeleniumLibraryNonFatalException(message); } else { logging.info(String.format("Element Should Not Contain: %s => OK", text)); } }</code><technical_language>copy&paste mistake -- textContains() here</technical_language>

Target:
public void elementShouldNotContain(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, StringUtils.EMPTY); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); String actual = getText(locator); if (textContains(actual, text, ignoreCase)) { if (StringUtils.isEmpty(message)) { message = String.format("Element should not have contained text '%s', but its text was %s.", text, actual); } logging.info(String.format("Element Should Not Contain: %s => FAILED", text)); throw new SeleniumLibraryNonFatalException(message); } else { logging.info(String.format("Element Should Not Contain: %s => OK", text)); } }
Source:
<code>public void createIndexOverTwoFields() { String indexName = im.ensureIndexed(Arrays.<Object>asList("name", "age"), "basic"); assertThat(indexName, is(notNullValue())); <START> assertThat(indexName, is("basic")); <END> Map<String, Object> indexes = im.listIndexes(); assertThat(indexes, hasKey("basic")); @SuppressWarnings("unchecked") Map<String, Object> index = (Map<String, Object>) indexes.get("basic"); @SuppressWarnings("unchecked") List<String> fields = (List<String>) index.get("fields"); assertThat(fields, containsInAnyOrder("_id", "_rev", "name", "age")); }</code><technical_language>Again, throughout, assertThat(indexName, is("basic")) implies assertThat(indexName, is(notNullValue())). Delete null checks</technical_language>

Target:
public void createIndexOverTwoFields() { String indexName = im.ensureIndexed(Arrays.<Object>asList("name", "age"), "basic"); assertThat(indexName, is("basic")); Map<String, Object> indexes = im.listIndexes(); assertThat(indexes, hasKey("basic")); @SuppressWarnings("unchecked") Map<String, Object> index = (Map<String, Object>) indexes.get("basic"); @SuppressWarnings("unchecked") List<String> fields = (List<String>) index.get("fields"); assertThat(fields, containsInAnyOrder("_id", "_rev", "name", "age")); }
Source:
<code>public static Func1<? super Object, Boolean> isEqualTo(@Nonnull final Object... values) { checkNotNull(values, "Values cannot be null"); checkState(values.length > 0, "You need to specify at least one object."); return new Func1<Object, Boolean>() { @Override public Boolean call(final Object o) { for (final Object value : values) { <START> if (Objects.equals(o, value)) { <END> return true; } } return false; } }; }</code><technical_language>this method... Objects.equals is supported older android versions.. need Objects.equal guava .. I is backported in internal</technical_language>

Target:
public static Func1<? super Object, Boolean> isEqualTo(@Nonnull final Object... values) { checkNotNull(values, "Values cannot be null"); checkState(values.length > 0, "You need to specify at least one object."); return new Func1<Object, Boolean>() { @Override public Boolean call(final Object o) { for (final Object value : values) { if (Objects.equal(o, value)) { return true; } } return false; } }; }
Source:
<code>public int compare(String o1, String o2) { String name1 = tocNames.get(o1); String name2 = tocNames.get(o2); if (name1 == null) { return <START> -1; <END> } if (name2 == null) { return 1; } return Collator.getInstance().compare(name1, name2); }</code><technical_language>case handled null name2 != null ? -1 : 0</technical_language>

Target:
public int compare(String o1, String o2) { String name1 = tocNames.get(o1); String name2 = tocNames.get(o2); if (name1 == null) { return (name2 != null) ? -1 : 0; } if (name2 == null) { return 1; } return Collator.getInstance().compare(name1, name2); }
Source:
<code><START> Set<ObjectId> getShallowCommits() throws IOException { <END> final File shallow = shallowFile; if (!shallow.isFile()) return Collections.emptySet(); final BufferedReader reader = new BufferedReader( new FileReader(shallow)); try { final Set<ObjectId> ids = new HashSet<ObjectId>(); String line; while ((line = reader.readLine()) != null) ids.add(ObjectId.fromString(line)); return ids; } finally { reader.close(); } }</code><technical_language>This is accessed often, alternates change calls. I if is a noticeable performance difference reading file time snapshot code. I suspect is, especially Windows if repository is NFS. snapshots in reference handling avoid reading loose reference files updated read. a good idea too</technical_language>

Target:
Set<ObjectId> getShallowCommits() throws IOException { if (shallowFile == null || !shallowFile.isFile()) return Collections.emptySet(); if (shallowFileSnapshot == null || shallowFileSnapshot.isModified(shallowFile)) { shallowCommitsIds = new HashSet<ObjectId>(); final BufferedReader reader = open(shallowFile); try { String line; while ((line = reader.readLine()) != null) shallowCommitsIds.add(ObjectId.fromString(line)); } finally { reader.close(); } shallowFileSnapshot = FileSnapshot.save(shallowFile); } return shallowCommitsIds; }
Source:
<code>public void apply(Queryable.QueryBuilder builder) { <START> if (path != null) { <END> resolvedPath = new Queryable.SelectExpression(path); } if (aggregatedPath != null) { resolvedPath = aggregatedPath.toSelectExpression(); } if (resolvedPath == null) { throw new IllegalStateException("You need to specify a target path for the condition!"); } }</code><technical_language>enforce of path/aggregatedPath is used</technical_language>

Target:
public void apply(Queryable.QueryBuilder builder) { if (path != null) { resolvedPath = new Queryable.SelectExpression(path); } if (aggregatedPath != null) { resolvedPath = aggregatedPath.toSelectExpression(); } if (path != null && aggregatedPath != null) { throw new IllegalStateException("Condition can only have a single target path!"); } if (resolvedPath == null) { throw new IllegalStateException("You need to specify a target path for the condition!"); } }
Source:
<code>public void testEnvironmentII () { Tier tier = new Tier("name1", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region1"); tier.addNetwork(new Network("uno2", VDC, REGION)); Tier tier3 = new Tier("name3", new Integer(1), new Integer(5), new Integer(1), null); tier3.setRegion("region3"); tier3.addNetwork(new Network("uno2", VDC, REGION)); Tier tier2 = new Tier("name2", new Integer(1), new Integer(5), new Integer(1), null); tier2.setRegion("region2"); tier2.addNetwork(new Network("uno", VDC, REGION)); Set<Tier> tiers = new HashSet<Tier>(); tiers.add(tier); Environment envResult = new Environment("environemntName", tiers); assertEquals (envResult.getTiers().size(), 1); envResult.addTier(tier2); assertEquals (envResult.getTiers().size(), 2); envResult.deleteTier(tier); envResult.updateTier(tier2, tier3); <START> <END> }</code><technical_language>test result</technical_language>

Target:
public void testEnvironmentII () { Tier tier = new Tier("name1", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region1"); tier.addNetwork(new Network("uno2", VDC, REGION)); Tier tier3 = new Tier("name3", new Integer(1), new Integer(5), new Integer(1), null); tier3.setRegion("region3"); tier3.addNetwork(new Network("uno2", VDC, REGION)); Tier tier2 = new Tier("name2", new Integer(1), new Integer(5), new Integer(1), null); tier2.setRegion("region2"); tier2.addNetwork(new Network("uno", VDC, REGION)); Set<Tier> tiers = new HashSet<Tier>(); tiers.add(tier); Environment envResult = new Environment("environemntName", tiers); assertEquals (envResult.getTiers().size(), 1); envResult.addTier(tier2); assertEquals (envResult.getTiers().size(), 2); envResult.deleteTier(tier); assertEquals (envResult.getTiers().size(), 1); envResult.updateTier(tier2, tier3); for (Tier t: envResult.getTiers() ) { assertEquals (t.getName(), "name3"); } }
Source:
<code>Optional<String> containFlow(List<AnalyzerMessage> actual) { List<Integer> actualLines = flowToLines(actual, AnalyzerMessage::getLine); <START> List<Map.Entry<String, SortedSet<FlowComment>>> expectedFlows = Multimaps.asMap(flows).entrySet().stream() <END> .filter(e -> flowToLines(e.getValue(), FlowComment::line).equals(actualLines)) .collect(toList()); if (expectedFlows.isEmpty()) { return Optional.empty(); } if (expectedFlows.size() == 1) { String flowId = expectedFlows.get(0).getKey(); seenFlowIds.add(flowId); return Optional.of(flowId); } List<String> actualMessages = actual.stream().map(AnalyzerMessage::getMessage).collect(toList()); return expectedFlows.stream() .filter(e -> e.getValue().stream().map(FlowComment::message).collect(toList()).equals(actualMessages)) .filter(e -> !seenFlowIds.contains(e.getKey())) .limit(1) .map(Map.Entry::getKey) .peek(flowId -> seenFlowIds.add(flowId)) .findFirst(); }</code><technical_language>ugly (and a huge pain follow). a dedicated type encode that</technical_language>

Target:
Optional<String> containFlow(List<AnalyzerMessage> actual) { List<Integer> actualLines = flowToLines(actual, AnalyzerMessage::getLine); Set<String> expectedFlows = flows.keySet().stream() .filter(flowId -> !seenFlowIds.contains(flowId)) .filter(flowId -> flowToLines(flows.get(flowId), FlowComment::line).equals(actualLines)) .collect(Collectors.toSet()); if (expectedFlows.isEmpty()) { return Optional.empty(); } if (expectedFlows.size() == 1) { String flowId = Iterables.getOnlyElement(expectedFlows); seenFlowIds.add(flowId); return Optional.of(flowId); } List<String> actualMessages = actual.stream().map(AnalyzerMessage::getMessage).collect(toList()); Optional<String> foundFlow = expectedFlows.stream().filter(flowId -> hasSameMessages(flowId, actualMessages)).findFirst(); foundFlow.ifPresent(flowId -> seenFlowIds.add(flowId)); return foundFlow; }
Source:
<code>public String getLabel() { String label = fLabel; if (label == null) { StringJoiner sj = new StringJoiner(", "); getValues().forEach((Long value) -> sj.add(NumberFormat.getNumberInstance(Locale.getDefault()).format(value))); label = sj.toString(); <START> fLabel = label; <END> } return label; }</code><technical_language>addValue() is called (or if user changes list returned getValues()), label is changed inconsistent</technical_language>

Target:
public String getLabel() { String label = fLabel; if (label == null) { StringJoiner sj = new StringJoiner(", "); getValues().forEach((Long value) -> sj.add(value == null ? String.valueOf(value) : NumberFormat.getNumberInstance(Locale.getDefault()).format(value))); label = sj.toString(); fLabel = label; } return label; }
Source:
<code>void put(final K key, final V value) { clusterRegistry.put(scope, key, value); <START> System.out.println("putting key "+key+" ffrom thread "+Thread.currentThread().getName()); <END> localCacheInsert(key, value); }</code><technical_language>This is a leftover removed</technical_language>

Target:
void put(final K key, final V value) { clusterRegistry.put(scope, key, value); localCacheInsert(key, value); }
Source:
<code>private void initVncKeyboardLayout() { final List<String> layouts = (List<String>) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.VncKeyboardLayoutValidValues); <START> final ArrayList<String> vncKeyboardLayoutItems = new ArrayList<String>(); <END> vncKeyboardLayoutItems.add(null); vncKeyboardLayoutItems.addAll(layouts); getVncKeyboardLayout().setItems(vncKeyboardLayoutItems); getVncKeyboardLayout().setIsChangable(false); }</code><technical_language>final? please stick a single type (List/ArrayList)</technical_language>

Target:
private void initVncKeyboardLayout() { List<String> layouts = (List<String>) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.VncKeyboardLayoutValidValues); List<String> vncKeyboardLayoutItems = new ArrayList<String>(); vncKeyboardLayoutItems.add(null); vncKeyboardLayoutItems.addAll(layouts); getVncKeyboardLayout().setItems(vncKeyboardLayoutItems); getVncKeyboardLayout().setIsChangable(false); }
Source:
<code>public String toString() { <START> switch(this) { <END> case FILE: return "file"; case BLOCK: return "block"; default: throw new IllegalArgumentException(); } }</code><technical_language>This sense. is enum, able "instantiate" constants. simply return this.name.toLowerCase, if want name of enum in case</technical_language>

Target:
public String toString() { return name().toLowerCase(); }
Source:
<code>public void onActionModeFinished(android.view.ActionMode mode) { nullifyActionMode(); searchBarHideHandler.setForceNoFade(false); <START> super.onActionModeFinished(mode); <END> }</code><technical_language>call super in onActionModeStarted(), call (last in, out)</technical_language>

Target:
public void onActionModeFinished(android.view.ActionMode mode) { super.onActionModeFinished(mode); nullifyActionMode(); searchBarHideHandler.setForceNoFade(false); }
Source:
<code>private boolean isJodaTimeInClasspath() { if ( jodaTimeInClassPath != null ) { return jodaTimeInClassPath.booleanValue(); } <START> jodaTimeInClassPath = isClassPresent( JODA_TIME_CLASS_NAME ); <END> return jodaTimeInClassPath.booleanValue(); }</code><technical_language>Some nitpicking (for a change!); I this pattern written way: if ( jodaTimeInClassPath == null ) { jodaTimeInClassPath = isClassPresent( JODA_TIME_CLASS_NAME ); } return jodaTimeInClassPath.booleanValue();</technical_language>

Target:
private boolean isJodaTimeInClasspath() { if ( jodaTimeInClassPath == null ) { jodaTimeInClassPath = isClassPresent( JODA_TIME_CLASS_NAME ); } return jodaTimeInClassPath.booleanValue(); }
Source:
<code><START> protected IRemoteManager createRemoteManager() { <END> GerritConnector connector = (GerritConnector) TasksUi.getRepositoryConnector(getConnectorKind()); GerritClient client = connector.getClient(getTaskRepository()); return new GerritRemoteManager(client); }</code><technical_language>This API in core, e.g. in a review connector coupled editor</technical_language>

Target:
protected RemoteServiceBroker createRemoteManager() { GerritConnector connector = (GerritConnector) TasksUi.getRepositoryConnector(getConnectorKind()); GerritClient client = connector.getClient(getTaskRepository()); return new GerritRemoteBroker(client); }
Source:
<code>private int extractWorkFromLine(String line) { int pos1 = line.indexOf(DLTK_TOTAL_WORK_START); int pos2 = line.indexOf(DLTK_TOTAL_WORK_END); if (pos1 != -1 && pos2 != -1) { String totalWork = line.substring(pos1 + DLTK_TOTAL_WORK_START.length(), pos2); <START> int intValue = Integer.valueOf(totalWork).intValue(); <END> if (intValue == -1) { return IProgressMonitor.UNKNOWN; } return intValue; } return NOT_WORK_COUNT; }</code><technical_language>parseInt()</technical_language>

Target:
private int extractWorkFromLine(String line) { int pos1 = line.indexOf(DLTK_TOTAL_WORK_START); int pos2 = line.indexOf(DLTK_TOTAL_WORK_END); if (pos1 != -1 && pos2 != -1) { String totalWork = line.substring(pos1 + DLTK_TOTAL_WORK_START.length(), pos2); int intValue = Integer.parseInt(totalWork); if (intValue == -1) { return IProgressMonitor.UNKNOWN; } return intValue; } return NOT_WORK_COUNT; }
Source:
<code>public void run(Duration timeout) { Preconditions.checkState(app != null, "TestRunner should run for Low Level Task api or High Level Application Api"); Preconditions.checkState(!timeout.isZero() || !timeout.isNegative(), "Timeouts should be positive"); final LocalApplicationRunner runner = new LocalApplicationRunner(app, new MapConfig(configs)); runner.run(); boolean timedOut = !runner.waitForFinish(timeout); Assert.assertFalse("Timed out waiting for application to finish", timedOut); ApplicationStatus status = runner.status(); if (status.getStatusCode() == ApplicationStatus.StatusCode.UnsuccessfulFinish) { throw new SamzaException(ExceptionUtils.getStackTrace(status.getThrowable())); } Path stateDir = Paths.get(configs.get(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR())); <START> if (!Files.exists(stateDir)) return; <END> try { Files.walk(stateDir).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); } catch (IOException e) { throw new SamzaException("Could not delete the JOB_NON_LOGGED_STORE_BASE_DIR due to: \n" + e.getMessage()); } }</code><technical_language>a good practice enclose single line if-blocks {, }</technical_language>

Target:
public void run(Duration timeout) { Preconditions.checkNotNull(app); Preconditions.checkState(!timeout.isZero() || !timeout.isNegative(), "Timeouts should be positive"); deleteStoreDirectories(); final LocalApplicationRunner runner = new LocalApplicationRunner(app, new MapConfig(configs)); runner.run(); if (!runner.waitForFinish(timeout)) { throw new SamzaException("Timed out waiting for application to finish"); } ApplicationStatus status = runner.status(); deleteStoreDirectories(); if (status.getStatusCode() == ApplicationStatus.StatusCode.UnsuccessfulFinish) { throw new SamzaException("Application could not finish successfully", status.getThrowable()); } }
Source:
<code>public void handleJobExecution(final ISchedulerJob job, final TickSignal signal) throws ProcessingException { final String jobName = "Scheduler." + job.getGroupId() + "." + job.getJobId(); JobEx serverJob = m_serverJobFactory.create(jobName, new ITransactionRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws ProcessingException { job.run(Scheduler.this, signal); return Status.OK_STATUS; } }); serverJob.schedule(); try { serverJob.join(); } catch (InterruptedException ie) { throw new ProcessingException("Interrupted", ie); } <START> serverJob.throwOnError(); <END> }</code><technical_language>runNow of factory</technical_language>

Target:
public void handleJobExecution(final ISchedulerJob job, final TickSignal signal) throws ProcessingException { final String jobName = "Scheduler." + job.getGroupId() + "." + job.getJobId(); m_serverJobFactory.runNow(jobName, new ITransactionRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws ProcessingException { job.run(Scheduler.this, signal); return Status.OK_STATUS; } }); }
Source:
<code><START> private static boolean configKeyShouldBePrintedInSeconds(String configKey) { <END> return RegistrationRequest.BROWSER_TIME_OUT.equals(configKey) || RegistrationRequest.TIME_OUT.equals(configKey); }</code><technical_language>a private Set check if contains instead? easier add more keys if need be</technical_language>

Target:
private static boolean configKeyShouldBePrintedInSeconds(String configKey) { return CONFIG_KEYS_TO_BE_PRINTED_IN_SECONDS.contains(configKey); }
Source:
<code>public void removeConflicts(@Nullable String namespace) { Optional<File> file = findOrCreateConflictsFile(namespace); if (file.isPresent()) { File f = file.get(); <START> synchronized (f.getAbsolutePath().intern()) { <END> f.delete(); } } }</code><technical_language>Do need synchronize .isPresent check well</technical_language>

Target:
public void removeConflicts(@Nullable String namespace) { final Object monitor = resolveConflictsMonitor(namespace); checkState(monitor != null, "Either not inside a repository directory or the staging area is closed"); synchronized (monitor) { File file = resolveConflictsFile(namespace); if (file != null && file.exists()) { checkState(file.delete(), "Unable to delete conflicts file %s", file); } } }
Source:
<code>public static String getDefaultMapping() throws IOException { <START> InputStream mappingSourceStream = Indexer.class.getResourceAsStream("/search/default-mapping.json"); <END> String mappingSource = IOUtils.toString(mappingSourceStream); elasticSearchLog("defaultMapping").addParameter("mappingSource", mappingSource).log(); return mappingSource; }</code><technical_language>this stream in a try-with-resources block? I want leave this open</technical_language>

Target:
public static String getDefaultMapping() throws IOException { try (InputStream mappingSourceStream = ZebedeeContentIndexer.class.getResourceAsStream("/search/default-mapping.json")) { String mappingSource = IOUtils.toString(mappingSourceStream); elasticSearchLog("defaultMapping").addParameter("mappingSource", mappingSource).log(); return mappingSource; } }
Source:
<code>protected VmAndTemplatesGenerationsDAO getVmAndTemplatesGenerationsDao() { <START> return DbFacade.getInstance().getVmAndTemplatesGenerationsDAO(); <END> }</code><technical_language>/s/getVmAndTemplatesGenerationsDao/getVmAndTemplatesGenerationDAO</technical_language>

Target:
protected VmAndTemplatesGenerationsDAO getVmAndTemplatesGenerationsDao() { return DbFacade.getInstance().getVmAndTemplatesGenerationsDao(); }
Source:
<code><START> protected void createIndex(Connection conn, String indexExt, String columnName) throws PersistenceException { <END> if (metaData.isIndexingDisabled()) return; boolean indexExists = indexExists(getIndexName(false, indexExt), conn); if (!indexExists) { String ddl = String.format("CREATE INDEX %s ON %s (%s)", getIndexName(true, indexExt), getTableName(), columnName); if (log.isTraceEnabled()) { log.tracef("Adding index with following DDL: '%s'.", ddl); } executeUpdateSql(conn, ddl); } }</code><technical_language>this private</technical_language>

Target:
private void createIndex(Connection conn, String indexExt, String columnName) throws PersistenceException { if (metaData.isIndexingDisabled()) return; boolean indexExists = indexExists(getIndexName(false, indexExt), conn); if (!indexExists) { String ddl = String.format("CREATE INDEX %s ON %s (%s)", getIndexName(true, indexExt), getTableName(), columnName); if (log.isTraceEnabled()) { log.tracef("Adding index with following DDL: '%s'.", ddl); } executeUpdateSql(conn, ddl); } }
Source:
<code>public ContiguousIntervalUsageInArrear build(final boolean closedInterval) { Preconditions.checkState(!isBuilt.get()); Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) || (closedInterval && billingEvents.size() >= 2)); final LocalDate startDate = internalTenantContext.toLocalDate(billingEvents.get(0).getEffectiveDate()); if (targetDate.isBefore(startDate)) { return this; } final LocalDate endDate = closedInterval ? internalTenantContext.toLocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate()) : targetDate; if (startDate.compareTo(rawUsageStartDate) >= 0) { transitionTimes.add(startDate); } for (int i = 0; i < billingEvents.size(); i++) { final BillingEvent billingEvent = billingEvents.get(i); if (i == billingEvents.size() - 1) { addTransitionTimesForBillingEvent(startDate, endDate, billingEvent.getBillCycleDayLocal()); } else { final BillingEvent nextBillingEvent = billingEvents.get(i + 1); final LocalDate nextEndDate = internalTenantContext.toLocalDate(nextBillingEvent.getEffectiveDate()); <START> addTransitionTimesForBillingEvent(startDate, nextEndDate, billingEvent.getBillCycleDayLocal()); <END> } } if (closedInterval && transitionTimes.size() > 0 && endDate.isAfter(transitionTimes.get(transitionTimes.size() - 1))) { transitionTimes.add(endDate); } isBuilt.set(true); return this; }</code><technical_language>I confused reuse startDate iteration though: addTransitionTimesForBillingEvent return new startDate for next iteration? gonna end duplicate transitions -- worst incorrect transitions BCD change</technical_language>

Target:
public ContiguousIntervalUsageInArrear build(final boolean closedInterval) { Preconditions.checkState(!isBuilt.get()); Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) || (closedInterval && billingEvents.size() >= 2)); final LocalDate startDate = internalTenantContext.toLocalDate(billingEvents.get(0).getEffectiveDate()); if (targetDate.isBefore(startDate)) { return this; } final LocalDate endDate = closedInterval ? internalTenantContext.toLocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate()) : targetDate; if (startDate.compareTo(rawUsageStartDate) >= 0) { transitionTimes.add(startDate); } for (int i = 0; i < billingEvents.size(); i++) { final BillingEvent billingEvent = billingEvents.get(i); final LocalDate transitionStartDate = internalTenantContext.toLocalDate(billingEvent.getEffectiveDate()); if (i == billingEvents.size() - 1) { addTransitionTimesForBillingEvent(transitionStartDate, endDate, billingEvent.getBillCycleDayLocal()); } else { final BillingEvent nextBillingEvent = billingEvents.get(i + 1); final LocalDate nextEndDate = internalTenantContext.toLocalDate(nextBillingEvent.getEffectiveDate()); addTransitionTimesForBillingEvent(transitionStartDate, nextEndDate, billingEvent.getBillCycleDayLocal()); } } if (closedInterval && transitionTimes.size() > 0 && endDate.isAfter(transitionTimes.get(transitionTimes.size() - 1))) { transitionTimes.add(endDate); } isBuilt.set(true); return this; }
Source:
<code>private void printCacheContents() { log.debugf("------------------------- %d cache manager(s) -------------------------", getCacheManagers().size()); for (int i = 0; i < getCacheManagers().size(); i++) { log.debugf(" Contents of Cache with CacheManager #%d (%s, all members: %s", i, address(i), <START> manager(i).getMembers() + ")"); <END> Cache<String, String> testCache = manager(i).getCache(testCacheName); Set<String> keySet = testCache.keySet(); log.debugf(" keySet = %s", keySet); for (String key : keySet) { log.debugf(" key: %s value: %s", key, testCache.get(key)); } } }</code><technical_language>) moved main log message avoid +</technical_language>

Target:
private void printCacheContents() { log.debugf("%d cache manager(s)", getCacheManagers().size()); for (int i = 0; i < getCacheManagers().size(); i++) { Cache<String, String> testCache = manager(i).getCache(testCacheName); log.debugf(" Contents of Cache with CacheManager #%d (%s, all members: %s)", i, address(i), testCache.getAdvancedCache().getRpcManager().getMembers()); Set<String> keySet = testCache.keySet(); log.debugf(" keySet = %s", keySet); for (String key : keySet) { log.debugf(" key: %s value: %s", key, testCache.get(key)); } } }