auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CuratorFramework makeCurator( CuratorConfig config, EnsembleProvider ensembleProvider, Lifecycle lifecycle) { final Builder builder = CuratorFrameworkFactory.builder(); if (null != config.getZkUser() && null != config.getZkPwd()) { builder.authorization(config.getAuthScheme(), <START> (config.getZkUser() + ":" + config.getZkPwd()).getBytes(StandardCharsets.UTF_8)); <END> } final CuratorFramework framework = builder .ensembleProvider(ensembleProvider) .sessionTimeoutMs(config.getZkSessionTimeoutMs()) .retryPolicy(new BoundedExponentialBackoffRetry( BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES)) .compressionProvider(new PotentiallyGzippedCompressionProvider(config.getEnableCompression())) .aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider()) .build(); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() { log.info("Starting Curator"); framework.start(); } @Override public void stop() { log.info("Stopping Curator"); framework.close(); } }); return framework; }</code><technical_language>wondering is specs string bytes</technical_language>

Target:
public CuratorFramework makeCurator( CuratorConfig config, EnsembleProvider ensembleProvider, Lifecycle lifecycle ) { final Builder builder = CuratorFrameworkFactory.builder(); if (!Strings.isNullOrEmpty(config.getZkUser()) && !Strings.isNullOrEmpty(config.getZkPwd())) { builder.authorization( config.getAuthScheme(), StringUtils.format("%s:%s", config.getZkUser(), config.getZkPwd()).getBytes(StandardCharsets.UTF_8) ); } final CuratorFramework framework = builder .ensembleProvider(ensembleProvider) .sessionTimeoutMs(config.getZkSessionTimeoutMs()) .retryPolicy(new BoundedExponentialBackoffRetry(BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES)) .compressionProvider(new PotentiallyGzippedCompressionProvider(config.getEnableCompression())) .aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider()) .build(); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() { log.info("Starting Curator"); framework.start(); } @Override public void stop() { log.info("Stopping Curator"); framework.close(); } } ); return framework; }
Source:
<code>public static Map<Integer, API> getAllApis() { <START> Map<Integer, API> apiMap = new HashMap<>(); <END> try ( Connection conn = APIMgtDBUtil.getConnection(); PreparedStatement ps = conn.prepareStatement(InMemorySubscriptionValidationConstants.APIS_LOAD_SQL); ResultSet resultSet = ps.executeQuery(); ) { while (resultSet.next()) { API api = new API(); api.setApiId(resultSet.getInt("API_ID")); api.setProvider(resultSet.getString("API_PROVIDER")); api.setName(resultSet.getString("API_NAME")); api.setPolicy(resultSet.getString("API_TIER")); api.setVersion(resultSet.getString("API_VERSION")); api.setContext(resultSet.getString("CONTEXT")); apiMap.put(api.getApiId(), api); } } catch (SQLException e) { log.error("Error in loading Applications : ", e); } return apiMap; }</code><technical_language>Integer-> String bring key context:version</technical_language>

Target:
public List<API> getAllApis() { List<API> apiList = new ArrayList<>(); try ( Connection conn = APIMgtDBUtil.getConnection(); PreparedStatement ps = conn.prepareStatement(SubscriptionValidationSQLConstants.GET_ALL_APIS_SQL); ResultSet resultSet = ps.executeQuery(); ) { populateAPIList(resultSet, apiList); } catch (SQLException e) { log.error("Error in loading Apis : ", e); } return apiList; }
Source:
<code>public UUID getIdOfFirstCastSpell(UUID playerId) { <START> return playerFirstSpellCast.getOrDefault(playerId, playerFirstSpellCast.get(playerId)); <END> }</code><technical_language>This code block pretty weird. get map, if map tryies get value? return playerFirstSpellCast.getOrDefault(playerId, null); is correct option</technical_language>

Target:
public UUID getIdOfFirstCastSpell(UUID playerId) { return playerFirstSpellCast.getOrDefault(playerId, playerFirstCastSpell.get(playerId)); }
Source:
<code>public void sitemapContentChanged() { for (SitemapSubscriptionCallback callback : distinctCallbacks) { <START> SitemapChangedEvent changeEvent = new SitemapChangedEvent(); <END> changeEvent.pageId = pageId; changeEvent.sitemapName = sitemapName; callback.onEvent(changeEvent); } }</code><technical_language>sense create a new event for callback create send of them</technical_language>

Target:
public void sitemapContentChanged() { SitemapChangedEvent changeEvent = new SitemapChangedEvent(); changeEvent.pageId = pageId; changeEvent.sitemapName = sitemapName; for (SitemapSubscriptionCallback callback : distinctCallbacks) { callback.onEvent(changeEvent); } }
Source:
<code>public static void main(String[] argv) throws IOException, InvalidArgumentException { int ret = 0; InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); conf.set(PropertyKey.USER_RPC_RETRY_MAX_DURATION, "5s", Source.DEFAULT); CollectInfo shell = new CollectInfo(conf); if (argv.length < 2) { shell.printUsage(); throw new InvalidArgumentException(ExceptionMessage.INVALID_ARGS_NUM_INSUFFICIENT .getMessage("collectInfo", 2, argv.length)); } String subCommand = argv[0]; String targetDirPath = argv[1]; List<File> filesToCollect = new ArrayList<>(); if (subCommand.equals("all")) { System.out.println("Execute all child commands"); for (Command cmd : shell.getCommands()) { System.out.format("Executing %s", cmd.getCommandName()); <START> String[] replacementArgv = (String[]) ArrayUtils.addAll(new String[]{cmd.getCommandName()}, ArrayUtils.subarray(argv, 1, argv.length)); <END> int childRet = shell.executeAndAddFile(replacementArgv, filesToCollect); if (ret == 0 && childRet != 0) { ret = childRet; } } } else { int childRet = shell.executeAndAddFile(argv, filesToCollect); if (ret == 0 && childRet != 0) { ret = childRet; } } System.out.format("Archiving dir %s", targetDirPath); String tarballPath = Paths.get(targetDirPath, TARBALL_NAME).toAbsolutePath().toString(); if (filesToCollect.size() == 0) { System.err.format("No files to add. Tarball %s will be empty!", tarballPath); } TarUtils.compress(tarballPath, filesToCollect.toArray(new File[0])); System.out.println("Archiving finished"); System.exit(ret); }</code><technical_language>String[] childArgs = Arrays.copyOf(argv, argv.length) set element command name? create array three. move this out of for loop update element loop</technical_language>

Target:
public static void main(String[] argv) throws IOException { CommandLineParser parser = new DefaultParser(); CommandLine cmd; try { cmd = parser.parse(OPTIONS, argv, true ); } catch (ParseException e) { return; } String[] args = cmd.getArgs(); InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); conf.set(PropertyKey.USER_RPC_RETRY_MAX_DURATION, "5s", Source.DEFAULT); CollectInfo shell = new CollectInfo(conf); if (args.length < 2) { System.out.format("Command %s requires at least %s arguments (%s provided)%n", 2, argv.length); shell.printUsage(); System.exit(-1); } int ret; if (cmd.hasOption(LOCAL_OPTION_NAME)) { System.out.println("Executing collectInfo locally"); ret = shell.collectInfoLocal(cmd); } else { System.out.println("Executing collectInfo on all nodes in the cluster"); ret = shell.collectInfoRemote(cmd); } shell.close(); System.exit(ret); }
Source:
<code>private static boolean storedInStaticFinal(MethodInvocationTree mit) { Tree tree = mit.parent(); <START> while (!tree.is(Kind.VARIABLE, Kind.CLASS, Kind.ASSIGNMENT, Kind.METHOD, Kind.ENUM)) { <END> tree = tree.parent(); } return isConstant(tree); }</code><technical_language>I feeling careful check for interfaces annotations (Tree.Kind.INTERFACE, Tree.Kind.ANNOTATION_TYPE, of ClassTrees). pure defensive programming, I manage write a compiling example</technical_language>

Target:
private static boolean storedInStaticFinal(MethodInvocationTree mit) { Tree tree = mit.parent(); while (!tree.is(Kind.VARIABLE, Kind.ASSIGNMENT, Kind.COMPILATION_UNIT)) { tree = tree.parent(); } return isConstant(tree); }
Source:
<code>private String getCurrentKnownLeader(final boolean cached) throws IOException { final String leader = currentKnownLeader.accumulateAndGet( null, (current, given) -> current == null || !cached ? pickOneHost() : current ); if (leader == null) { <START> throw new IOE("No known leader"); <END> } else { return leader; } }</code><technical_language>"No server" . pickOneHost() is supposed find a server necessarily leader... is finding leader keeping ServerDiscoverySelector for compatibility. removed in next release rely list of overlord/coordinator servers in internal-discovery</technical_language>

Target:
private String getCurrentKnownLeader(final boolean cached) throws IOException { final String leader = currentKnownLeader.accumulateAndGet( null, (current, given) -> current == null || !cached ? pickOneHost() : current ); if (leader == null) { throw new IOE("No known server"); } else { return leader; } }
Source:
<code>private static Response wrap(final Response res, final Fallback fbk, final Request req) { <START> return new RsOf( <END> () -> { final long start = System.currentTimeMillis(); Iterable<String> head; try { head = res.head(); } catch (final Throwable ex) { try { head = fbk.route( TkFallback.fallback( req, start, ex, new TkFallback.HtErrCodeOf(ex).get() ) ).get().head(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } return head; }, () -> { final long start = System.currentTimeMillis(); InputStream body; try { body = res.body(); } catch (final Throwable ex) { try { body = fbk.route( TkFallback.fallback( req, start, ex, new TkFallback.HtErrCodeOf(ex).get() ) ).get().body(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } return body; } ); }</code><technical_language>@fanifieiev ResponseOf is a name RsOf</technical_language>

Target:
private static Response wrap(final Response res, final Fallback fbk, final Request req) { return new ResponseOf( () -> { final long start = System.currentTimeMillis(); Iterable<String> head; try { head = res.head(); } catch (final HttpException ex) { try { head = fbk.route( TkFallback.fallback(req, start, ex, ex.code()) ).get().head(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } catch (final Throwable ex) { try { head = fbk.route( TkFallback.fallback( req, start, ex, HttpURLConnection.HTTP_INTERNAL_ERROR ) ).get().head(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } return head; }, () -> { final long start = System.currentTimeMillis(); InputStream body; try { body = res.body(); } catch (final HttpException ex) { try { body = fbk.route( TkFallback.fallback(req, start, ex, ex.code()) ).get().body(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } catch (final Throwable ex) { try { body = fbk.route( TkFallback.fallback( req, start, ex, HttpURLConnection.HTTP_INTERNAL_ERROR ) ).get().body(); } catch (final Exception exx) { throw (IOException) new IOException(exx).initCause(ex); } } return body; } ); }
Source:
<code>public void stateTransition(Status from, Status to) { switch (to) { case AVAILABLE: { ManagementAgentEntity managementAgentEntity; try { managementAgentEntity = managementAgentEntityFactory.retrieve(); } catch (EntityNotFoundException e) { try { managementAgentEntityFactory.create(); } catch (EntityAlreadyExistsException ignored) { } try { managementAgentEntity = managementAgentEntityFactory.retrieve(); } catch (EntityNotFoundException bigFailure) { <START> throw new AssertionError(bigFailure); <END> } } managementAgentService = new ManagementAgentService(managementAgentEntity); managementAgentService.setTags(managementRegistryService.getConfiguration().getTags()); managementRegistryService.addManagementProvider(new ManagementProviderAdapter<Object>(DefaultClusteringManagementService.class.getSimpleName(), Object.class) { @Override public void register(Object managedObject) { ManagementAgentService service = managementAgentService; ManagementRegistryService registry = managementRegistryService; if (service != null && registry != null) { service.setCapabilities(registry.getContextContainer(), registry.getCapabilities()); } } @Override public void unregister(Object managedObject) { ManagementAgentService service = managementAgentService; ManagementRegistryService registry = managementRegistryService; if (service != null && registry != null) { service.setCapabilities(registry.getContextContainer(), registry.getCapabilities()); } } }); managementAgentService.setCapabilities(managementRegistryService.getContextContainer(), managementRegistryService.getCapabilities()); break; } case UNINITIALIZED: { this.cacheManager.deregisterListener(this); break; } case MAINTENANCE: break; default: throw new AssertionError(to); } }</code><technical_language>AssertionError means bug, include a human-readable error message a rough idea of exception thrown in case run bug</technical_language>

Target:
public void stateTransition(Status from, Status to) { switch (to) { case AVAILABLE: { ManagementAgentEntity managementAgentEntity; try { managementAgentEntity = managementAgentEntityFactory.retrieve(); } catch (EntityNotFoundException e) { try { managementAgentEntityFactory.create(); } catch (EntityAlreadyExistsException ignored) { } try { managementAgentEntity = managementAgentEntityFactory.retrieve(); } catch (EntityNotFoundException bigFailure) { throw (AssertionError) new AssertionError("Entity " + ManagementAgentEntity.class.getSimpleName() + " cannot be retrieved even after being created.").initCause(bigFailure.getCause()); } } managementAgentService = new ManagementAgentService(managementAgentEntity); managementAgentService.bridge(managementRegistryService); managementAgentService.setTags(managementRegistryService.getConfiguration().getTags()); break; } case UNINITIALIZED: { this.cacheManager.deregisterListener(this); break; } case MAINTENANCE: break; default: throw new AssertionError("Unsupported state: " + to); } }
Source:
<code>private static void validatePropertySectionPropertyTokens(String fileName, String sectionName, AbstractCheck check, List<Node> columns) { assertEquals("tokens to check", columns.get(1).getTextContent(), fileName + " section '" + sectionName + "' should have the basic token description"); String acceptableTokenText = columns.get(2).getTextContent().trim(); final int removePrefixIdx = "subset of tokens".length(); acceptableTokenText = acceptableTokenText.substring(removePrefixIdx); assertFalse(isInvalidTokenPunctuation(acceptableTokenText), ", & . should be placed at beginning of the next corresponding lines " + "in " + fileName + " acceptable token section: " + sectionName); assertEquals(CheckUtil.getTokenText(check.getAcceptableTokens(), check.getRequiredTokens()).replaceAll("\\s+", ""), acceptableTokenText.replaceAll("\\s+", ""), fileName + " section '" + sectionName + "' should have all the acceptable tokens"); final String defaultTokenText = columns.get(3).getTextContent().trim(); assertFalse(isInvalidTokenPunctuation(defaultTokenText), <START> ", & . should be placed at beginning of the next corresponding lines " <END> + "in " + fileName + " default token section: " + sectionName); assertEquals(CheckUtil.getTokenText(check.getDefaultTokens(), check.getRequiredTokens()).replaceAll("\\s+", ""), defaultTokenText.replaceAll("\\s+", ""), fileName + " section '" + sectionName + "' should have all the default tokens"); }</code><technical_language>Please follow other assertions fileName + " section '" + sectionName first</technical_language>

Target:
private static void validatePropertySectionPropertyTokens(String fileName, String sectionName, AbstractCheck check, List<Node> columns) { assertEquals("tokens to check", columns.get(1).getTextContent(), fileName + " section '" + sectionName + "' should have the basic token description"); final String acceptableTokenText = columns.get(2).getTextContent().trim(); assertEquals("subset of tokens " + CheckUtil.getTokenText(check.getAcceptableTokens(), check.getRequiredTokens()), acceptableTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the acceptable tokens"); assertFalse(isInvalidTokenPunctuation(acceptableTokenText), fileName + "'s acceptable token section: " + sectionName + "should have ',' & '.' at beginning of the next corresponding lines."); final String defaultTokenText = columns.get(3).getTextContent().trim(); assertEquals(CheckUtil.getTokenText(check.getDefaultTokens(), check.getRequiredTokens()), defaultTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the default tokens"); assertFalse(isInvalidTokenPunctuation(defaultTokenText), fileName + "'s default token section: " + sectionName + "should have ',' & '.' at beginning of the next corresponding lines."); }
Source:
<code>private List<JSONObject> getOutgoingRelationshipsPerNode(final Integer nodeId) { <START> List<JSONObject> outgoingRelationshipsPerNode = new ArrayList<>(); <END> String outgoingRelationshipsPerNodeJsonString = _requestWrapper.executeRestRequest(new HttpGet(_serviceRoot + "/node/" + nodeId + "/relationships/out")); JSONArray outgoingRelationshipsPerNodeJsonArray; try { outgoingRelationshipsPerNodeJsonArray = new JSONArray(outgoingRelationshipsPerNodeJsonString); for (int i = 0; i < outgoingRelationshipsPerNodeJsonArray.length(); i++) { JSONObject relationship = outgoingRelationshipsPerNodeJsonArray.getJSONObject(i); if (!outgoingRelationshipsPerNode.contains(relationship)) { outgoingRelationshipsPerNode.add(relationship); } } return outgoingRelationshipsPerNode; } catch (JSONException e) { logger.error("Error occured in parsing JSON while detecting outgoing relationships for node: " + nodeId, e); throw new IllegalStateException(e); } }</code><technical_language>If improve this line of code, variable final too</technical_language>

Target:
private List<JSONObject> getOutgoingRelationshipsPerNode(final Integer nodeId) { final List<JSONObject> outgoingRelationshipsPerNode = new ArrayList<>(); final String outgoingRelationshipsPerNodeJsonString = _requestWrapper.executeRestRequest( new HttpGet(_serviceRoot + "/node/" + nodeId + "/relationships/out")); final JSONArray outgoingRelationshipsPerNodeJsonArray; try { outgoingRelationshipsPerNodeJsonArray = new JSONArray(outgoingRelationshipsPerNodeJsonString); for (int i = 0; i < outgoingRelationshipsPerNodeJsonArray.length(); i++) { final JSONObject relationship = outgoingRelationshipsPerNodeJsonArray.getJSONObject(i); if (!outgoingRelationshipsPerNode.contains(relationship)) { outgoingRelationshipsPerNode.add(relationship); } } return outgoingRelationshipsPerNode; } catch (final JSONException e) { logger.error("Error occurred in parsing JSON while detecting outgoing relationships for node: " + nodeId, e); throw new IllegalStateException(e); } }
Source:
<code>private static void instantiateTemplateRule(String projectKey, String ruleTemplateKey, String instantiationKey, String params) { SonarClient sonarClient = orchestrator.getServer().adminWsClient(); sonarClient.post("/api/rules/create", ImmutableMap.<String, Object>builder() .put("name", instantiationKey) .put("markdown_description", instantiationKey) .put("severity", "INFO") .put("status", "READY") .put("template_key", "javascript:" + ruleTemplateKey) .put("custom_key", instantiationKey) .put("prevent_reactivation", "true") .put("params", "name=\"" + instantiationKey + "\";key=\"" + instantiationKey + "\";markdown_description=\"" + instantiationKey + "\";" + params) .build()); String post = sonarClient.get("api/qualityprofiles/search?projectKey=" + projectKey); String profileKey = null; Map profilesForProject = new Gson().fromJson(post, Map.class); for (Map profileDescription : (List<Map>) profilesForProject.get("profiles")) { if ("rules".equals(profileDescription.get("name"))) { profileKey = (String) profileDescription.get("key"); break; } } if (profileKey != null) { String response = sonarClient.post("api/qualityprofiles/activate_rule", ImmutableMap.of( "profile_key", profileKey, "rule_key", "javascript:" + instantiationKey, "severity", "INFO", "params", "")); <START> LoggerFactory.getLogger(JavaScriptRulingTest.class).warn(response); <END> } else { LoggerFactory.getLogger(JavaScriptRulingTest.class).error("Could not retrieve profile key : Template rule " + ruleTemplateKey + " has not been activated"); } }</code><technical_language>removed static LOG field</technical_language>

Target:
private static void instantiateTemplateRule(String projectKey, String ruleTemplateKey, String instantiationKey, String params) { SonarClient sonarClient = orchestrator.getServer().adminWsClient(); sonarClient.post("/api/rules/create", ImmutableMap.<String, Object>builder() .put("name", instantiationKey) .put("markdown_description", instantiationKey) .put("severity", "INFO") .put("status", "READY") .put("template_key", "javascript:" + ruleTemplateKey) .put("custom_key", instantiationKey) .put("prevent_reactivation", "true") .put("params", "name=\"" + instantiationKey + "\";key=\"" + instantiationKey + "\";markdown_description=\"" + instantiationKey + "\";" + params) .build()); String post = sonarClient.get("api/qualityprofiles/search?projectKey=" + projectKey); String profileKey = null; Map profilesForProject = new Gson().fromJson(post, Map.class); for (Map profileDescription : (List<Map>) profilesForProject.get("profiles")) { if ("rules".equals(profileDescription.get("name"))) { profileKey = (String) profileDescription.get("key"); break; } } if (profileKey != null) { String response = sonarClient.post("api/qualityprofiles/activate_rule", ImmutableMap.of( "profile_key", profileKey, "rule_key", "javascript:" + instantiationKey, "severity", "INFO", "params", "")); LOG.warn(response); } else { LOG.error("Could not retrieve profile key : Template rule " + ruleTemplateKey + " has not been activated"); } }
Source:
<code>public String combineIt() { <START> StringBuffer stringBuffer = new StringBuffer(); <END> for (String string : field) { stringBuffer.append(string); } return stringBuffer.toString(); }</code><technical_language>StringBuilder - StringBuffer is synchronized a lock</technical_language>

Target:
public String combineIt() { StringBuilder stringBuilder = new StringBuilder(); for (String string : field) { stringBuilder.append(string); } return stringBuilder.toString(); }
Source:
<code>public void init() throws Exception { super.init(); <START> <END> API_BASE_URL = getGatewayServerURLHttp() + "/"; USER_NAME1 = apimContext.getContextTenant().getContextUser().getUserName(); String publisherURLHttp = getPublisherServerURLHttp(); String storeURLHttp = getStoreServerURLHttp(); apiPublisherClientUser1 = new APIPublisherRestClient(publisherURLHttp); apiStoreClientUser1 = new APIStoreRestClient(storeURLHttp); apiPublisherClientUser2 = new APIPublisherRestClient(publisherURLHttp); apiStoreClientUser2 = new APIStoreRestClient(storeURLHttp); apiPublisherClientUser1.login(apimContext.getContextTenant().getContextUser().getUserName(), apimContext.getContextTenant().getContextUser().getPassword()); apiStoreClientUser1.login(apimContext.getContextTenant().getContextUser().getUserName(), apimContext.getContextTenant().getContextUser().getPassword()); USER_NAME2 = apimContext.getContextTenant().getTenantUser(USER_KEY_USER2).getUserName(); String user2PassWord = apimContext.getContextTenant().getTenantUser(USER_KEY_USER2).getPassword(); apiPublisherClientUser2.login(USER_NAME2, user2PassWord); apiStoreClientUser2.login(USER_NAME2, user2PassWord); }</code><technical_language>spaces in lines</technical_language>

Target:
public void init() throws APIManagerIntegrationTestException { super.init(); GATEWAY_WEB_APP_URL = gatewayUrls.getWebAppURLNhttp(); }
Source:
<code>public void setQueue(List<FeedItem> queue) { ContentValues values = new ContentValues(); long[] ids = new long[queue.size()]; db.beginTransaction(); db.delete(TABLE_NAME_QUEUE, null, null); for (int i = 0; i < queue.size(); i++) { FeedItem item = queue.get(i); <START> ids[i] = item.getId(); <END> values.put(KEY_ID, i); values.put(KEY_FEEDITEM, item.getId()); values.put(KEY_FEED, item.getFeed().getId()); db.insertWithOnConflict(TABLE_NAME_QUEUE, null, values, SQLiteDatabase.CONFLICT_REPLACE); } db.setTransactionSuccessful(); db.endTransaction(); }</code><technical_language>purpose of this 'ids' array? used</technical_language>

Target:
public void setQueue(List<FeedItem> queue) { ContentValues values = new ContentValues(); db.beginTransaction(); db.delete(TABLE_NAME_QUEUE, null, null); for (int i = 0; i < queue.size(); i++) { FeedItem item = queue.get(i); values.put(KEY_ID, i); values.put(KEY_FEEDITEM, item.getId()); values.put(KEY_FEED, item.getFeed().getId()); db.insertWithOnConflict(TABLE_NAME_QUEUE, null, values, SQLiteDatabase.CONFLICT_REPLACE); } db.setTransactionSuccessful(); db.endTransaction(); }
Source:
<code>protected void copyValues(RegularStatement that) { if (!that.hasValues()) return; <START> Preconditions.checkArgument(parameterMode != ParameterMode.NAMED && that.usesPositionalValues()); <END> int offset = values.isEmpty() ? 0 : (Integer)(values.lastEntry().getKey()) + 1; for (ValueDefinition definition : that.getValueDefinitions()) { int thatIndex = definition.getIndex(); assert thatIndex >= 0; int thisIndex = offset + thatIndex; setInternal(thisIndex, new Value(new ValueDefinition(thisIndex, definition.getType()), that.getBytesUnsafe(thatIndex))); } }</code><technical_language>of name collisions</technical_language>

Target:
protected void copyValues(RegularStatement that) { if (!that.hasValues()) return; Preconditions.checkArgument(parameterMode != ParameterMode.NAMED && that.usesPositionalValues()); int offset = values.isEmpty() ? 0 : (Integer)(values.lastEntry().getKey()) + 1; for (ValueDefinition definition : that.getValueDefinitions()) { int thatIndex = definition.getIndex(); assert thatIndex >= 0; int thisIndex = offset + thatIndex; setInternal(thisIndex, new Value(thisIndex, definition.getType(), that.getBytesUnsafe(thatIndex))); } }
Source:
<code>private File getTrustStorePkcs12File() throws IOException { if (trustStorePkcs12File == null) { try { File trustStorePkcs12File = File.createTempFile( TRUST_STORE_PREFIX, KeyStoreFileType.PKCS12.getDefaultFileExtension(), tempDir); trustStorePkcs12File.deleteOnExit(); <START> final FileOutputStream trustStoreOutputStream = new FileOutputStream(trustStorePkcs12File); <END> try { byte[] bytes = X509TestHelpers.certToPKCS12TrustStoreBytes(trustStoreCertificate, trustStorePassword); trustStoreOutputStream.write(bytes); trustStoreOutputStream.flush(); } finally { trustStoreOutputStream.close(); } this.trustStorePkcs12File = trustStorePkcs12File; } catch (GeneralSecurityException e) { throw new IOException(e); } } return trustStorePkcs12File; }</code><technical_language>try-with-resources (change file)</technical_language>

Target:
private File getTrustStorePkcs12File() throws IOException { if (trustStorePkcs12File == null) { File trustStorePkcs12File = File.createTempFile( TRUST_STORE_PREFIX, KeyStoreFileType.PKCS12.getDefaultFileExtension(), tempDir); trustStorePkcs12File.deleteOnExit(); try (final FileOutputStream trustStoreOutputStream = new FileOutputStream(trustStorePkcs12File)) { byte[] bytes = X509TestHelpers.certToPKCS12TrustStoreBytes(trustStoreCertificate, trustStorePassword); trustStoreOutputStream.write(bytes); trustStoreOutputStream.flush(); } catch (GeneralSecurityException e) { throw new IOException(e); } this.trustStorePkcs12File = trustStorePkcs12File; } return trustStorePkcs12File; }
Source:
<code>public static LockAwareTransactionManager setupTxManager(KeyValueService kvs, TimestampService tsService, SweepStrategyManager ssm, TransactionService txService) { LockClient lockClient = LockClient.of("sweep client"); LockService lockService = LockServiceImpl.create(new LockServerOptions() { @Override public boolean isStandaloneServer() { return false; } }); Supplier<AtlasDbConstraintCheckingMode> constraints = () -> AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING; ConflictDetectionManager cdm = ConflictDetectionManagers.createWithoutWarmingCache(kvs); Cleaner cleaner = new NoOpCleaner(); LockAwareTransactionManager txManager = new SerializableTransactionManager(kvs, tsService, lockClient, <START> lockService, txService, constraints, cdm, ssm, cleaner, false, 16, java.time.Duration.ofMinutes(1)); <END> setupTables(kvs); return txManager; }</code><technical_language>Observation: kinda sucks add random parameters constructors care range requests. do it, though; tackling is scope of this already-very-large PR</technical_language>

Target:
public static LockAwareTransactionManager setupTxManager(KeyValueService kvs, TimestampService tsService, SweepStrategyManager ssm, TransactionService txService) { LockClient lockClient = LockClient.of("sweep client"); LockService lockService = LockServiceImpl.create( LockServerOptions.builder().isStandaloneServer(false).build()); Supplier<AtlasDbConstraintCheckingMode> constraints = () -> AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING; ConflictDetectionManager cdm = ConflictDetectionManagers.createWithoutWarmingCache(kvs); Cleaner cleaner = new NoOpCleaner(); LockAwareTransactionManager txManager = new SerializableTransactionManager(kvs, tsService, lockClient, lockService, txService, constraints, cdm, ssm, cleaner, false, 16); setupTables(kvs); return txManager; }
Source:
<code><START> public void beforeParamAndAfterParamAreRun() { <END> fLog = ""; final Result result = JUnitCore.runClasses(BeforeParamAndAfterParam.class); assertEquals(0, result.getFailureCount()); assertEquals("beforeClass before(A) first(A) second(A) afterParam " + "before(B) first(B) second(B) afterParam afterClass ", fLog); }</code><technical_language>great tests for 1. Multiple @BeforeParam methods 1. Multiple @AfterParam methods 1. @AfterParam methods parameters 1. @BeforeParam methods parameters 1. Parameterized tests more parameter</technical_language>

Target:
public void beforeParamAndAfterParamAreRun() { fLog = ""; Result result = JUnitCore.runClasses(BeforeParamAndAfterParam.class); assertEquals(0, result.getFailureCount()); assertEquals("beforeClass before(A) first(A) second(A) afterParam " + "before(B) first(B) second(B) afterParam afterClass ", fLog); }
Source:
<code><START> public static String get() { return props.getOrDefault(VERSION_RELEASE_KEY, "unset"); } <END></code><technical_language>getOrDefault is in Java 7</technical_language>

Target:
public static String get() { return props.get(VERSION_RELEASE_KEY); }
Source:
<code>private static Schema getSchema(String typeName, int sqlType, int precision, int scale, String columnName) throws SQLException { Schema.Type type = Schema.Type.STRING; switch (sqlType) { case Types.NULL: type = Schema.Type.NULL; break; case Types.ROWID: break; case Types.BOOLEAN: case Types.BIT: type = Schema.Type.BOOLEAN; break; case Types.TINYINT: case Types.SMALLINT: type = Schema.Type.INT; break; case Types.INTEGER: type = "int unsigned".equalsIgnoreCase(typeName) ? Schema.Type.LONG : Schema.Type.INT; break; case Types.BIGINT: type = Schema.Type.LONG; break; case Types.REAL: case Types.FLOAT: type = Schema.Type.FLOAT; break; case Types.NUMERIC: case Types.DECIMAL: <START> return Schema.decimalOf(2,scale); <END> case Types.DOUBLE: type = Schema.Type.DOUBLE; break; case Types.DATE: return Schema.of(Schema.LogicalType.DATE); case Types.TIME: return Schema.of(Schema.LogicalType.TIME_MICROS); case Types.TIMESTAMP: return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.BLOB: type = Schema.Type.BYTES; break; case Types.ARRAY: case Types.DATALINK: case Types.DISTINCT: case Types.JAVA_OBJECT: case Types.OTHER: case Types.REF: case Types.SQLXML: case Types.STRUCT: throw new SQLException(new UnsupportedTypeException(String.format("Column %s has unsupported SQL type of %s." , columnName, sqlType))); } return Schema.of(type); }</code><technical_language>precision is 2</technical_language>

Target:
private static Schema getSchema(String typeName, int sqlType, int precision, int scale, String columnName) throws SQLException { Schema.Type type = Schema.Type.STRING; switch (sqlType) { case Types.NULL: type = Schema.Type.NULL; break; case Types.ROWID: break; case Types.BOOLEAN: case Types.BIT: type = Schema.Type.BOOLEAN; break; case Types.TINYINT: case Types.SMALLINT: type = Schema.Type.INT; break; case Types.INTEGER: type = "int unsigned".equalsIgnoreCase(typeName) ? Schema.Type.LONG : Schema.Type.INT; break; case Types.BIGINT: type = Schema.Type.LONG; break; case Types.REAL: case Types.FLOAT: type = Schema.Type.FLOAT; break; case Types.NUMERIC: type = scale != 0 ? Schema.Type.DOUBLE : precision > 9 ? Schema.Type.LONG : Schema.Type.INT; break; case Types.DECIMAL: return Schema.decimalOf(precision, scale); case Types.DOUBLE: type = Schema.Type.DOUBLE; break; case Types.DATE: return Schema.of(Schema.LogicalType.DATE); case Types.TIME: return Schema.of(Schema.LogicalType.TIME_MICROS); case Types.TIMESTAMP: return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.BLOB: type = Schema.Type.BYTES; break; case Types.ARRAY: case Types.DATALINK: case Types.DISTINCT: case Types.JAVA_OBJECT: case Types.OTHER: case Types.REF: case Types.SQLXML: case Types.STRUCT: throw new SQLException(new UnsupportedTypeException(String.format("Column %s has unsupported SQL type of %s." , columnName, sqlType))); } return Schema.of(type); }
Source:
<code>private void parseProperties() { for(String arg : getPrefixArguments()) { Argument argument = new Argument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Invalid configuration. Parameter '%1$s' has no name", arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setValue( getArgAttrValue(arg, "value") ); argument.setMultivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( Argument.Type.valueOfIgnoreCase( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setValueType( Class.forName( <START> getArgAttrValue(arg, "convert"), <END> true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check convert class in properties file.", arg) ); } if (argument.isMandatory()) { mandatory.add(argument.getName()); } arguments.put(argument.getName(), argument); } }</code><technical_language>this changed valueType in order consistent</technical_language>

Target:
private void parseProperties() { for(String arg : getPrefixArguments()) { Argument argument = new Argument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Invalid configuration. Parameter '%1$s' has no name", arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setValue( getArgAttrValue(arg, "value") ); argument.setMultivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( Argument.Type.valueOfIgnoreCase( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setValueType( Class.forName( getArgAttrValue(arg, "valuetype"), true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check valuetype in properties file.", arg) ); } if (argument.isMandatory()) { mandatory.add(argument.getName()); } arguments.put(argument.getName(), argument); } }
Source:
<code>public boolean isSideBand() throws RequestNotYetReadException { <START> if (currentRequest == null) <END> throw new RequestNotYetReadException(); Set<String> cc = currentRequest.getClientCapabilities(); return cc.contains(OPTION_SIDE_BAND) || cc.contains(OPTION_SIDE_BAND_64K); }</code><technical_language>optional: opportunity add braces</technical_language>

Target:
public boolean isSideBand() throws RequestNotYetReadException { if (currentRequest == null) { throw new RequestNotYetReadException(); } Set<String> caps = currentRequest.getClientCapabilities(); return caps.contains(OPTION_SIDE_BAND) || caps.contains(OPTION_SIDE_BAND_64K); }
Source:
<code>public Message.Request request() { <START> Message.Request request = callback.request(); <END> if (retryConsistencyLevel != null && retryConsistencyLevel != request.consistency()) return request.copy(retryConsistencyLevel); else return request; }</code><technical_language>Is idea copy request in a Retry (independent of a speculative execution executed?)</technical_language>

Target:
public Message.Request request() { if (retryConsistencyLevel != null && retryConsistencyLevel != request.consistency()) return request.copy(retryConsistencyLevel); else return request; }
Source:
<code>public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { if (modelAndView != null) { PluginController molgenisPlugin = validateHandler(handler); String pluginId = molgenisPlugin.getId(); if (!modelAndView.getModel().containsKey(PluginAttributes.KEY_PLUGIN_ID)) { modelAndView.addObject(PluginAttributes.KEY_PLUGIN_ID, pluginId); } Entity pluginSettings = molgenisPlugin.getPluginSettings(); Boolean pluginSettingsCanWrite; if (pluginSettings != null) { String pluginSettingsEntityName = pluginSettings.getEntityType().getId(); pluginSettingsCanWrite = permissionService.hasPermissionOnEntityType(pluginSettingsEntityName, Permission.WRITE); } else { pluginSettingsCanWrite = null; } modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS, pluginSettings); modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS_CAN_WRITE, pluginSettingsCanWrite); modelAndView.addObject(PluginAttributes.KEY_MOLGENIS_UI, molgenisUi); modelAndView.addObject(PluginAttributes.KEY_AUTHENTICATED, SecurityUtils.currentUserIsAuthenticated()); modelAndView.addObject(PluginAttributes.KEY_PLUGIN_ID_WITH_QUERY_STRING, getPluginIdWithQueryString(request, pluginId)); <START> modelAndView.addObject(PluginAttributes.KEY_PLUGIN_DESCRIPTION, molgenisPlugin.getDescription(pluginId)); <END> } }</code><technical_language>plugin id plugin description is plugin label</technical_language>

Target:
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { if (modelAndView != null) { PluginController molgenisPlugin = validateHandler(handler); String pluginId = molgenisPlugin.getId(); if (!modelAndView.getModel().containsKey(PluginAttributes.KEY_PLUGIN_ID)) { modelAndView.addObject(PluginAttributes.KEY_PLUGIN_ID, pluginId); } Entity pluginSettings = molgenisPlugin.getPluginSettings(); Boolean pluginSettingsCanWrite; if (pluginSettings != null) { String pluginSettingsEntityName = pluginSettings.getEntityType().getId(); pluginSettingsCanWrite = permissionService.hasPermissionOnEntityType(pluginSettingsEntityName, Permission.WRITE); } else { pluginSettingsCanWrite = null; } modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS, pluginSettings); modelAndView.addObject(PluginAttributes.KEY_PLUGIN_SETTINGS_CAN_WRITE, pluginSettingsCanWrite); modelAndView.addObject(PluginAttributes.KEY_MOLGENIS_UI, molgenisUi); modelAndView.addObject(PluginAttributes.KEY_AUTHENTICATED, SecurityUtils.currentUserIsAuthenticated()); modelAndView.addObject(PluginAttributes.KEY_PLUGIN_ID_WITH_QUERY_STRING, getPluginIdWithQueryString(request, pluginId)); } }
Source:
<code>public void execute(Runnable task) { if (task == null) { throw new NullPointerException("task"); } boolean inEventLoop = inEventLoop(); if (!inEventLoop) { <START> if (isShutdown()) { <END> reject(); } addTask(task); startThread(); if (isShutdown() && removeTask(task)) { reject(); } } else { addTask(task); } if (!addTaskWakesUp && wakesUpForTask(task)) { wakeup(inEventLoop); } }</code><technical_language>this racy. a CAS loop racy (especially a volatile field updater available)? overkill I grant</technical_language>

Target:
public void execute(Runnable task) { if (task == null) { throw new NullPointerException("task"); } boolean inEventLoop = inEventLoop(); addTask(task); if (!inEventLoop) { startThread(); if (isShutdown()) { boolean reject = false; try { if (removeTask(task)) { reject = true; } } catch (UnsupportedOperationException e) { } if (reject) { reject(); } } } if (!addTaskWakesUp && wakesUpForTask(task)) { wakeup(inEventLoop); } }
Source:
<code>protected boolean isVmTemplateWithSameNameExist() { <START> return DbFacade.getInstance() <END> .getVmTemplateDao() .getByName(getParameters().getVmTemplate().getName(), getParameters().getStoragePoolId(), null, false) != null; }</code><technical_language>please inject DAO</technical_language>

Target:
protected boolean isVmTemplateWithSameNameExist() { return vmTemplateDao.getByName(getParameters().getVmTemplate().getName(), getParameters().getStoragePoolId(), null, false) != null; }
Source:
<code>private int getSelectedIndex(List<PickerMilestone> milestones) { for (int i = 0; i < milestones.size(); i++) { if (milestones.get(i).isSelected()) { return i; } } <START> return -1; <END> }</code><technical_language>Is is selected? If so, return type optional (-1 is kind of ad hoc). If possible, assertion failure</technical_language>

Target:
private Optional<Integer> getSelectedIndex(List<PickerMilestone> milestones) { for (int i = 0; i < milestones.size(); i++) { if (milestones.get(i).isSelected()) { return Optional.of(i); } } return Optional.empty(); }
Source:
<code>public void simpleEvidenceSearch() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); <START> request.setEvidence("imatinib"); <END> SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response).isNotNull(); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations().get(0)).isNotNull() ; }</code><technical_language>Magic constant</technical_language>

Target:
public void simpleEvidenceSearch() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setEvidence(TestData.EVIDENCE_NAME); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations()).isNotEmpty() ; }
Source:
<code><START> public CommentService() { <END> super(new CommentDAO()); }</code><technical_language>Constructor needs private</technical_language>

Target:
private CommentService() { super(new CommentDAO()); }
Source:
<code>private void runAlgo() { double currWeightToGoal, estimationFullWeight; while (true) { visitedNodes++; if (isMaxVisitedNodesExceeded() || finished()) break; int currNode = currEdge.adjNode; EdgeIterator iter = edgeExplorer.setBaseNode(currNode); while (iter.next()) { if (!accept(iter, currEdge.edge)) continue; <START> double tmpWeight = !outEdgeFilter.accept(iter) ? Double.POSITIVE_INFINITY : weighting.calcWeight(iter, false, currEdge.edge) + currEdge.weightOfVisitedPath; <END> if (Double.isInfinite(tmpWeight)) { continue; } int traversalId = traversalMode.createTraversalId(iter, false); AStarEntry ase = fromMap.get(traversalId); if (ase == null || ase.weightOfVisitedPath > tmpWeight) { int neighborNode = iter.getAdjNode(); currWeightToGoal = weightApprox.approximate(neighborNode); estimationFullWeight = tmpWeight + currWeightToGoal; if (ase == null) { ase = new AStarEntry(iter.getEdge(), neighborNode, estimationFullWeight, tmpWeight); fromMap.put(traversalId, ase); } else { fromHeap.remove(ase); ase.edge = iter.getEdge(); ase.weight = estimationFullWeight; ase.weightOfVisitedPath = tmpWeight; } ase.parent = currEdge; fromHeap.add(ase); updateBestPath(iter, ase, traversalId); } } if (fromHeap.isEmpty()) break; currEdge = fromHeap.poll(); if (currEdge == null) throw new AssertionError("Empty edge cannot happen"); } }</code><technical_language>For clarity better: java !outEdgeFilter.accept(iter) ? Double.POSITIVE_INFINITY : (weighting.calcWeight(iter, false, currEdge.edge) + currEdge.weightOfVisitedPath);</technical_language>

Target:
private void runAlgo() { double currWeightToGoal, estimationFullWeight; while (true) { visitedNodes++; if (isMaxVisitedNodesExceeded() || finished()) break; int currNode = currEdge.adjNode; EdgeIterator iter = edgeExplorer.setBaseNode(currNode); while (iter.next()) { if (!accept(iter, currEdge.edge)) continue; double tmpWeight = !outEdgeFilter.accept(iter) ? Double.POSITIVE_INFINITY : (weighting.calcWeight(iter, false, currEdge.edge) + currEdge.weightOfVisitedPath); if (Double.isInfinite(tmpWeight)) { continue; } int traversalId = traversalMode.createTraversalId(iter, false); AStarEntry ase = fromMap.get(traversalId); if (ase == null || ase.weightOfVisitedPath > tmpWeight) { int neighborNode = iter.getAdjNode(); currWeightToGoal = weightApprox.approximate(neighborNode); estimationFullWeight = tmpWeight + currWeightToGoal; if (ase == null) { ase = new AStarEntry(iter.getEdge(), neighborNode, estimationFullWeight, tmpWeight); fromMap.put(traversalId, ase); } else { fromHeap.remove(ase); ase.edge = iter.getEdge(); ase.weight = estimationFullWeight; ase.weightOfVisitedPath = tmpWeight; } ase.parent = currEdge; fromHeap.add(ase); updateBestPath(iter, ase, traversalId); } } if (fromHeap.isEmpty()) break; currEdge = fromHeap.poll(); if (currEdge == null) throw new AssertionError("Empty edge cannot happen"); } }
Source:
<code>private void updateSubscribedTopics(final Set<String> topics, final String logPrefix) { final Collection<String> existingTopics = subscriptionUpdates(); <START> if (usesPatternSubscription() && !existingTopics.equals(topics)) { <END> topics.addAll(existingTopics); subscriptionUpdates.clear(); subscriptionUpdates.addAll(topics); log.debug("{}found topics possibly matching subscription", logPrefix, topics.size()); setRegexMatchedTopicsToSourceNodes(); setRegexMatchedTopicToStateStore(); } }</code><technical_language>callers conditioned usesPatternSubscription() already</technical_language>

Target:
private void updateSubscribedTopics(final Set<String> topics, final String logPrefix) { final Collection<String> existingTopics = subscriptionUpdates(); if (!existingTopics.equals(topics)) { topics.addAll(existingTopics); subscriptionUpdates.clear(); subscriptionUpdates.addAll(topics); log.debug("{}found topics possibly matching subscription", logPrefix, topics.size()); setRegexMatchedTopicsToSourceNodes(); setRegexMatchedTopicToStateStore(); } }