auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMainDownloadWithNonExistentOutDir() throws Exception { val file = tmp.newFile(); <START> val outDir = new File("/tmp/foo"); <END> executeMain("download", "--manifest", file.getCanonicalPath(), "--output-dir", outDir.getCanonicalPath(), "--verify-connection", "false"); assertTrue(outDir.exists()); outDir.delete(); assertTrue(getExitCode() == 1); assertTrue(getOutput().contains(" is empty")); }</code><technical_language>@Rule TemporaryDir temp for this. other tests need this read-only, if assertion fails below, invalid stating state assumption</technical_language>

Target:
public void testMainDownloadWithNonExistentOutDir() throws Exception { val file = tmp.newFile(); val outDir = new File(tmp.getRoot(), "foo"); assertFalse(outDir.exists()); executeMain("download", "--manifest", file.getCanonicalPath(), "--output-dir", outDir.getCanonicalPath(), "--verify-connection", "false"); assertTrue(outDir.exists()); assertTrue(getExitCode() == 1); assertTrue(getOutput().contains(" is empty")); }
Source:
<code>public synchronized long commit() { Thread currentThread = Thread.currentThread(); Thread storeThread = currentStoreThread.get(); if (currentThread != storeThread) { <START> currentStoreThread.set(currentThread); <END> try { store(); } finally { currentStoreThread.set(storeThread); } } return currentVersion; }</code><technical_language>If storeThread == null concurrent tryCommit() deregisterVersionUsage() change get() set(), synchronized this commit() method. compareAndSet() instead of set() else changed</technical_language>

Target:
public long commit() { if(!storeLock.isHeldByCurrentThread() || currentStoreVersion < 0) { storeLock.lock(); try { store(); } finally { storeLock.unlock(); } } return currentVersion; }
Source:
<code>public void addTask(TaskType type, long delay, Object object){ try { if (AppConfig.getInstance().isJsonEvents()){ new JsonRpcNotification().fireEvents(type, delay, object); }else{ TaskProcessor.getInstance().addTask(new TaskRequest(type, delay, object)); } }catch (Exception e){ <START> log.error("wrapping task error {}", e.toString()); <END> } }</code><technical_language>good stack trace well</technical_language>

Target:
public void addTask(TaskType type, long delay, Object object){ try { if (AppConfig.getInstance().isJsonEvents()){ new JsonRpcNotification().fireEvents(type, delay, object); }else{ TaskProcessor.getInstance().addTask(new TaskRequest(type, delay, object)); } }catch (Exception e){ log.error("wrapping task error {}", e.toString()); log.error("{}", Arrays.toString(e.getStackTrace())); } }
Source:
<code>private boolean canGenerateTree(EntityRef rootEntity) { LogComponent logComponent = rootEntity.getComponent(LogComponent.class); RootComponent rootComponent = rootEntity.getComponent(RootComponent.class); TreeGrowthStage currentStage = rootComponent.growthStages.get(rootComponent.growthStage); Vector3i location = new Vector3i(logComponent.location).addY(1); int rootY = location.y; <START> for(; location.y-rootY < currentStage.height-1; location.addY(1)) { <END> if(!isValidBlock(location, rootEntity)) { return false; } } return true; }</code><technical_language>**A for loop fields is a code smell. This a while loop if want structure this this loop restructured simpler**</technical_language>

Target:
private boolean canGenerateTree(EntityRef rootEntity) { LogComponent logComponent = rootEntity.getComponent(LogComponent.class); RootComponent rootComponent = rootEntity.getComponent(RootComponent.class); TreeGrowthStage currentStage = rootComponent.growthStages.get(rootComponent.growthStage); Vector3i location = new Vector3i(logComponent.location).addY(1); int rootY = location.y; while(location.y-rootY < currentStage.height-1) { if(!isValidBlock(location, rootEntity)) { return false; } location.addY(1); } return true; }
Source:
<code>public void resourceChanged(IResourceChangeEvent event) { <START> if (event.getType() == IResourceChangeEvent.POST_CHANGE) { <END> state = true; } }</code><technical_language>style nit: braces single line</technical_language>

Target:
public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) state = true; }
Source:
<code>public void setContent(final String path, final String value) { <START> try { diagramServices.transform(value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { AbstractDMNDiagramEditor.this.open(diagram); } @Override public void onError(final ClientRuntimeError error) { AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); } }); } catch (Exception e) { getEditor().showError(e.getMessage()); } <END> }</code><technical_language>is clear, exception propagated this try catch. Jira open invalid content == open some empty content. I check transform implementation, I guess speak DMNClientDiagramServiceImpl.doTransformation try catch block wrapping code handling errors via, callback. I missing something</technical_language>

Target:
public void setContent(final String path, final String value) { superOnClose(); diagramServices.transform(path, value, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram diagram) { openDiagramMethodProxy = VALID_DIAGRAM_PROXY; AbstractDMNDiagramEditor.this.open(diagram); } @Override public void onError(final ClientRuntimeError error) { openDiagramMethodProxy = INVALID_DIAGRAM_PROXY; AbstractDMNDiagramEditor.this.getEditor().onLoadError(error); } }); }
Source:
<code>private void executeNextOperation() { switch (getParameters().getVmBackup().getPhase()) { case STARTING: lockDisks(); VmBackupInfo vmBackupInfo = startVmBackup(); if (vmBackupInfo != null && vmBackupInfo.getDisks() != null) { <START> TransactionSupport.executeInNewTransaction(() -> { <END> if (vmBackupInfo.getCheckpoint() != null) { vmCheckpointDao.updateCheckpointXml(getParameters().getVmBackup().getToCheckpointId(), vmBackupInfo.getCheckpoint()); } return null; }); storeBackupsUrls(vmBackupInfo.getDisks()); } else { setCommandStatus(CommandStatus.FAILED); } break; case READY: log.info("Ready to start image transfers using backup URLs"); break; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } }</code><technical_language>a single update, good a new transaction</technical_language>

Target:
private void executeNextOperation() { switch (getParameters().getVmBackup().getPhase()) { case STARTING: lockDisks(); VmBackupInfo vmBackupInfo = startVmBackup(); if (vmBackupInfo != null && vmBackupInfo.getDisks() != null) { if (vmBackupInfo.getCheckpoint() != null) { vmCheckpointDao.updateCheckpointXml(getParameters().getVmBackup().getToCheckpointId(), vmBackupInfo.getCheckpoint()); } storeBackupsUrls(vmBackupInfo.getDisks()); } else { setCommandStatus(CommandStatus.FAILED); } break; case READY: log.info("Ready to start image transfers using backup URLs"); break; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } }
Source:
<code>public void withKeyScan(String pattern, int count, Consumer<RedisScanResult> f) { CursorBasedResult<String> result = null; do { if (result == null) { <START> result = client.dyno_scan(count, pattern); <END> } else { result = client.dyno_scan(result, count, pattern); } final List<String> results = result.getResult(); f.accept(() -> results); } while (!result.isComplete()); }</code><technical_language>dyno_scan(int, String) calls dyno_scan(null, int, string) ok drop if statement call result = client.dyno_scan(result, count, pattern);</technical_language>

Target:
public void withKeyScan(String pattern, int count, Consumer<RedisScanResult> f) { CursorBasedResult<String> result = null; do { result = client.dyno_scan(result, count, pattern); final List<String> results = result.getResult(); f.accept(() -> results); } while (!result.isComplete()); }
Source:
<code>private void packSmallString(String s) throws IOException { <START> byte[] bytes = s.getBytes("UTF-8"); <END> packRawStringHeader(bytes.length); writePayload(bytes); }</code><technical_language>This involves a of character encoding type table. MessagePack.UTF8</technical_language>

Target:
private void packSmallString(String s) throws IOException { byte[] bytes = s.getBytes(MessagePack.UTF8); packRawStringHeader(bytes.length); writePayload(bytes); }
Source:
<code>public String toString() { String content = ""; for (Term term : contents) if (term != null) content += term + ",,"; <START> if (content.length() > 1) <END> content = content.substring(0, content.length() - 2); return "'amb(" + content + ")"; }</code><technical_language>This is safe of code behaves a risk of problems if changes. a constant representing KList separator in places here</technical_language>

Target:
public String toString() { String content = ""; for (Term term : contents) if (term != null) content += term + ","; if (content.length() > 1) content = content.substring(0, content.length() - 1); return "'amb(" + content + ")"; }
Source:
<code>private void findNewContact(BitBody body) { <START> BitPoint startCell = body.aabb.xy.floorDivideBy(tileSize, tileSize).minus(gridOffset); <END> int endX = (int) (startCell.x + Math.ceil(1.0 * body.aabb.width / tileSize)); int endY = (int) (startCell.y + Math.ceil(1.0 * body.aabb.height / tileSize)); for (int x = (int) startCell.x; x <= endX; x++) { if (!occupiedSpaces.containsKey(x)) { continue; } for (int y = (int) startCell.y; y <= endY; y++) { if (!occupiedSpaces.get(x).containsKey(y)) { continue; } for (BitBody otherBody : occupiedSpaces.get(x).get(y)) { BitRectangle insec = GeomUtils.intersection(body.aabb, otherBody.aabb); if (insec != null) { if (!contacts.get(body).contains(otherBody)) { contacts.get(body).add(otherBody); for (ContactListener listener : body.getContactListeners()) { listener.contactStarted(otherBody); } for (ContactListener listener : otherBody.getContactListeners()) { listener.contactStarted(body); } } } } } } }</code><technical_language>thinking for a while, I opposed coupling physics system tile based level stuff, I around. I need lean more. If physics system is coupled a specific level layout, needs impossible describe a physics world level information complain compile time, runtime</technical_language>

Target:
private void findNewContact(BitBody body) { BitPoint startCell = body.aabb.xy.floorDivideBy(tileSize, tileSize).minus(gridOffset); int endX = (int) (startCell.x + Math.ceil(1.0 * body.aabb.width / tileSize)); int endY = (int) (startCell.y + Math.ceil(1.0 * body.aabb.height / tileSize)); for (int x = (int) startCell.x; x <= endX; x++) { if (!occupiedSpaces.containsKey(x)) { continue; } for (int y = (int) startCell.y; y <= endY; y++) { if (!occupiedSpaces.get(x).containsKey(y)) { continue; } for (BitBody otherBody : occupiedSpaces.get(x).get(y)) { if (otherBody.bodyType == BodyType.KINETIC) { checkForNewCollision(body, otherBody); } checkContact(body, otherBody); } } } }
Source:
<code>public void setUp() throws Exception { testdir.ensureEmpty(); File testFile = testdir.getPathFile("file.txt").toFile(); try (OutputStream testOut = new BufferedOutputStream(new FileOutputStream(testFile))) { ByteArrayInputStream testIn = new ByteArrayInputStream(__content.getBytes("ISO8859_1")); IO.copy(testIn, testOut); } tester = new ServletTester("/context"); tester.getContext().setResourceBase(testdir.getPath().toString()); tester.getContext().addServlet(org.eclipse.jetty.servlet.DefaultServlet.class, "/"); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setMinGzipSize(16); <START> tester.getServer().insertHandler(gzipHandler); <END> tester.start(); }</code><technical_language>This is equivalent test. tester.getContext().insertHandler(gzipHandler);</technical_language>

Target:
public void setUp() throws Exception { testdir.ensureEmpty(); File testFile = testdir.getPathFile("file.txt").toFile(); try (OutputStream testOut = new BufferedOutputStream(new FileOutputStream(testFile))) { ByteArrayInputStream testIn = new ByteArrayInputStream(__content.getBytes("ISO8859_1")); IO.copy(testIn, testOut); } tester = new ServletTester("/context"); tester.getContext().setResourceBase(testdir.getPath().toString()); tester.getContext().addServlet(org.eclipse.jetty.servlet.DefaultServlet.class, "/"); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setMinGzipSize(16); tester.getContext().insertHandler(gzipHandler); tester.start(); }
Source:
<code>public Boolean call() throws NoSuchProjectException, OrmException { final ProjectControl projectControl = projectControlFactory.controlFor(projectName); boolean result = false; if (user.isAdministrator() || projectControl.isOwner()) { result = repoManager.deleteRepository(projectName.get()); for (final RefRight k : db.refRights().byProject(projectName)) { db.refRights().delete(Collections.singleton(k)); } for (final AccountProjectWatch a : db.accountProjectWatches().byProject( projectName)) { db.accountProjectWatches().delete(Collections.singleton(a)); } db.projects().deleteKeys(Collections.singleton(projectName)); replication.replicateProjectDeletion(projectName); <START> projectCache.evictAll(); <END> } if (!result) { log.error("Cannot delete " + projectName.get()); } return new Boolean(result); }</code><technical_language>add evict(Project.NameKey) method project cache this method remove deleted project cache invalidating complete project cache</technical_language>

Target:
public Boolean call() throws NoSuchProjectException, OrmException { final ProjectControl projectControl = projectControlFactory.controlFor(projectName); boolean result = false; if (user.isAdministrator() || projectControl.isOwner()) { result = repoManager.deleteRepository(projectName.get()); for (final RefRight k : db.refRights().byProject(projectName)) { db.refRights().delete(Collections.singleton(k)); } for (final AccountProjectWatch a : db.accountProjectWatches().byProject( projectName)) { db.accountProjectWatches().delete(Collections.singleton(a)); } for (final Project j : db.projects().getChildren(projectName.get())) { j.setParent(null); db.projects().update(Collections.singleton(j)); projectCache.evict(j); } db.projects().deleteKeys(Collections.singleton(projectName)); replication.replicateProjectDeletion(projectName); projectCache.evict(projectControl.getProject()); } if (!result) { log.error("Cannot delete " + projectName.get()); } return new Boolean(result); }
Source:
<code>GPUInfo(String index) { <START> this.index = Preconditions.checkNotNull(index); <END> }</code><technical_language>I check for empty whitespace strings</technical_language>

Target:
GPUInfo(String index) { Preconditions.checkArgument(!StringUtils.isNullOrWhitespaceOnly(index)); this.index = index; }
Source:
<code>public static String generateSaltOfLength(int length) { StringBuilder salt = new StringBuilder(); Random rnd = new Random(); while (salt.length() < length) { <START> int index = (int) (rnd.nextFloat() * UPPERCASE_ALPHANUMERIC_CHARS.length()); <END> salt.append(UPPERCASE_ALPHANUMERIC_CHARS.charAt(index)); } return salt.toString(); }</code><technical_language>rnd.nextInt(UPPERCASE_ALPHANUMERIC_CHARS.length())</technical_language>

Target:
public static String generateSaltOfLength(int length) { StringBuilder salt = new StringBuilder(); Random rnd = new Random(); while (salt.length() < length) { int index = rnd.nextInt(UPPERCASE_ALPHANUMERIC_CHARS.length()); salt.append(UPPERCASE_ALPHANUMERIC_CHARS.charAt(index)); } return salt.toString(); }
Source:
<code>private KeyValue createKeyValue(Namespace namespace, String key, Object value) { KeyValue keyvalue = new KeyValue(); keyvalue.setNamespace(namespace.toString()); keyvalue.setKey(key); keyvalue.setData(SerializationUtils.serialize(value)); <START> keyvalue.setSessionId(namespace.getValues().get(0)); <END> return keyvalue; }</code><technical_language>decide rule - pass session Id Namespace parameter, nice namespace.getSessionId() method</technical_language>

Target:
private KeyValue createKeyValue(Namespace namespace, String key, Object value) { KeyValue keyvalue = new KeyValue(); keyvalue.setNamespace(namespace.toString()); keyvalue.setKey(key); keyvalue.setData(SerializationUtils.serialize(value)); keyvalue.setSessionId(sessionIdProvider.getSessionId()); return keyvalue; }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletResponse r = (HttpServletResponse) response; responses.set(r); <START> chain.doFilter(request, response); <END> responses.remove(); }</code><technical_language>this wrapped in a try... finally block</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { HttpServletResponse r = (HttpServletResponse) response; responses.set(r); chain.doFilter(request, response); } finally { responses.remove(); } }
Source:
<code>public InferredType type() { if (is(Kind.AND, Kind.OR)) { return InferredTypes.or(leftOperand.type(), rightOperand.type()); } if (is(Kind.PLUS)) { <START> if (leftOperand.type() == INT && rightOperand.type() == INT) { <END> return INT; } if (leftOperand.type() == STR && rightOperand.type() == STR) { return STR; } } return InferredTypes.anyType(); }</code><technical_language>== replaced .equals(...) a lines below</technical_language>

Target:
public InferredType type() { if (is(Kind.AND, Kind.OR)) { return InferredTypes.or(leftOperand.type(), rightOperand.type()); } if (is(Kind.PLUS)) { if (leftOperand.type().equals(INT) && rightOperand.type().equals(INT)) { return INT; } if (leftOperand.type().equals(STR) && rightOperand.type().equals(STR)) { return STR; } } return InferredTypes.anyType(); }
Source:
<code>boolean needsUpdate(@Nonnull Resource ensureDefinition, @Nonnull Resource oakIndex) throws IOException, RepositoryException { final Session session = ensureDefinition.getResourceResolver().adaptTo(Session.class); final ChecksumGenerator checksumGenerator = this.ensureOakIndex.getChecksumGenerator(); final CustomChecksumGeneratorOptions ensureDefinitionOptions = new CustomChecksumGeneratorOptions(); ensureDefinitionOptions.addIncludedNodeTypes(new String[]{NT_OAK_UNSTRUCTURED}); ensureDefinitionOptions.addExcludedProperties(this.ignoreProperties); <START> ensureDefinitionOptions.addExcludedSubTrees(this.excludeSubTrees); <END> ensureDefinitionOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> srcChecksum = checksumGenerator.generateChecksums(session, ensureDefinition.getPath(), ensureDefinitionOptions); final CustomChecksumGeneratorOptions oakIndexOptions = new CustomChecksumGeneratorOptions(); oakIndexOptions.addIncludedNodeTypes(new String[]{NT_OAK_QUERY_INDEX_DEFINITION}); oakIndexOptions.addExcludedProperties(this.ignoreProperties); final Map<String, String> destChecksum = checksumGenerator.generateChecksums(session, oakIndex.getPath(), oakIndexOptions); return !StringUtils.equals(srcChecksum.get(ensureDefinition.getPath()), destChecksum.get(oakIndex.getPath())); }</code><technical_language>lines added oakIndexOptions? notice this.excludeSubTrees is based NT_OAK_QUERY_INDEX_DEFINITION, is meant for oakIndexOptions if I mistaken. Essentially excludeSubTrees based NT_OAK_UNSTRUCTURED NT_OAK_QUERY_INDEX_DEFINITION added options respectively</technical_language>

Target:
boolean needsUpdate(@Nonnull Resource ensureDefinition, @Nonnull Resource oakIndex) throws IOException, RepositoryException { final Session session = ensureDefinition.getResourceResolver().adaptTo(Session.class); final ChecksumGenerator checksumGenerator = this.ensureOakIndex.getChecksumGenerator(); final CustomChecksumGeneratorOptions ensureDefinitionOptions = new CustomChecksumGeneratorOptions(); ensureDefinitionOptions.addIncludedNodeTypes(new String[]{NT_OAK_UNSTRUCTURED}); ensureDefinitionOptions.addExcludedProperties(this.ignoreProperties); ensureDefinitionOptions.addExcludedSubTrees(this.excludeSubTrees); ensureDefinitionOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> srcChecksum = checksumGenerator.generateChecksums(session, ensureDefinition.getPath(), ensureDefinitionOptions); final CustomChecksumGeneratorOptions oakIndexOptions = new CustomChecksumGeneratorOptions(); oakIndexOptions.addIncludedNodeTypes(new String[]{NT_OAK_QUERY_INDEX_DEFINITION}); oakIndexOptions.addExcludedProperties(this.ignoreProperties); oakIndexOptions.addExcludedSubTrees(this.excludeSubTrees); oakIndexOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> destChecksum = checksumGenerator.generateChecksums(session, oakIndex.getPath(), oakIndexOptions); return !StringUtils.equals(srcChecksum.get(ensureDefinition.getPath()), destChecksum.get(oakIndex.getPath())); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); Map<String, String> values = new HashMap<>(); values.put(Analytics.Keys.TOPIC_ID, discussionThread.getTopicId()); values.put(Analytics.Keys.THREAD_ID, discussionThread.getIdentifier()); <START> values.put(Analytics.Keys.AUTHOR, discussionThread.getAuthor()); <END> analyticsRegistry.trackScreenView(Analytics.Screens.FORUM_VIEW_THREAD, courseData.getCourse().getId(), discussionThread.getTitle(), values); }</code><technical_language>In case of anonymous posts, "anonymous" in author key, sounds me</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); Map<String, String> values = new HashMap<>(); values.put(Analytics.Keys.TOPIC_ID, discussionThread.getTopicId()); values.put(Analytics.Keys.THREAD_ID, discussionThread.getIdentifier()); if (!discussionThread.isAuthorAnonymous()) { values.put(Analytics.Keys.AUTHOR, discussionThread.getAuthor()); } analyticsRegistry.trackScreenView(Analytics.Screens.FORUM_VIEW_THREAD, courseData.getCourse().getId(), discussionThread.getTitle(), values); }
Source:
<code>public void testGetAllOfTypesWithUnrepresentedTypes() { List<VDS> result = dao <START> .getAllOfTypes(new VDSType[] { VDSType.forValue(-1) }); <END> assertIncorrectGetResult(result); }</code><technical_language>above: .getAllOfTypes(new VDSType[] { null });</technical_language>

Target:
public void testGetAllOfTypesWithUnrepresentedTypes() { List<VDS> result = dao .getAllOfTypes(new VDSType[] { null }); assertIncorrectGetResult(result); }
Source:
<code>public ResponseBuilder run(JsonNode params, ResponseBuilder builder) { Object result = null; try { Map apiResult = activateApi(params); if (fieldName() != null) { result = apiResult.get(fieldName()); } else { result = apiResult; } } catch (Exception e) { log.error("Can't run api call", e); return builder.withError((Map<String, Object>) Collections.EMPTY_MAP); } <START> if (result instanceof Map) { <END> builder = builder.withResult((Map) result); } else if (result instanceof List) { builder = builder.withResult((List) result); } else if (result instanceof String) { builder = builder.withResult((String) result); } else { log.error("Unknown response data --> " + result, new Exception()); } return builder; }</code><technical_language>change do need check type cast</technical_language>

Target:
public ResponseBuilder run(JsonNode params, ResponseBuilder builder) { Object result = null; try { Map apiResult = activateApi(params); if (fieldName() != null) { result = apiResult.get(fieldName()); } else { result = apiResult; } } catch (Exception e) { log.error("Can't run api call", e); return builder.withError((Map<String, Object>) Collections.EMPTY_MAP); } if (result instanceof Map) { builder = builder.withResult((Map) result); } else if (result instanceof List) { builder = builder.withResult((List) result); } else if (result instanceof String) { builder = builder.withResult((String) result); } else if (result != null && result.getClass().isArray()) { builder = builder.withResult((Object[]) result); } else { log.error("Unknown response data --> " + result, new Exception()); } return builder; }
Source:
<code>private void watchDefaultStorage() { try { curator.getData().usingWatcher((CuratorWatcher) event -> { final byte[] defaultStorageId = curator.getData().forPath(ZK_TIMELINES_DEFAULT_STORAGE); if (defaultStorageId != null) { final Result<Storage> storageResult = getStorage(new String(defaultStorageId)); if (storageResult.isSuccessful()) { defaultStorage.setStorage(storageResult.getValue()); } } <START> watchDefaultStorage(); <END> }).forPath(ZK_TIMELINES_DEFAULT_STORAGE); } catch (final Exception e) { LOG.warn(e.getMessage(), e); } }</code><technical_language>calls itself</technical_language>

Target:
private void watchDefaultStorage() { try { curator.getData().usingWatcher((CuratorWatcher) event -> { final byte[] defaultStorageId = curator.getData().forPath(ZK_TIMELINES_DEFAULT_STORAGE); if (defaultStorageId != null) { final Result<Storage> storageResult = getStorage(new String(defaultStorageId)); if (storageResult.isSuccessful()) { defaultStorage.setStorage(storageResult.getValue()); } } watchDefaultStorage(); }).forPath(ZK_TIMELINES_DEFAULT_STORAGE); } catch (final Exception e) { LOG.warn("Error while creating watcher for default storage updates {}", e.getMessage(), e); } }
Source:
<code>private String extractJavaVersionFromPath(String path) { path = path.substring(0, path.length()-4); <START> File jdkReleasePropertiesFile = new File(path, "release"); <END> InputStream in; try { in = new FileInputStream(jdkReleasePropertiesFile); } catch (FileNotFoundException e) { throw new IllegalStateException("JVM release properties file not found at: \"" + path + "/" + "release" + "\""); } Properties jdkReleaseProperties = new Properties(); try { jdkReleaseProperties.load(in); } catch (IOException e) { throw new IllegalStateException("Failed to load properties from file"); } String result = jdkReleaseProperties.getProperty("JAVA_VERSION").replaceAll("\"", ""); return result; }</code><technical_language>correct. execute 'java -version' processbuilder get version</technical_language>

Target:
private String extractJavaVersionFromPath(String path) { List<String> commands = new ArrayList<>(); commands.add("./java"); commands.add("-version"); ProcessBuilder processBuilder = new ProcessBuilder(commands); processBuilder.redirectErrorStream(true); processBuilder.environment().put("JAVA_HOME", path); processBuilder.directory(new File(path.replace("/jre","/bin"))); String result = null; try { final Process process = processBuilder.start(); BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); result = stdInput.readLine(); } catch (IOException e) { throw new RuntimeException("Failed to fetch Java version from \"" + path + "\""); } Pattern p = Pattern.compile(".*\\\"(.*)\\\".*"); Matcher m = p.matcher(result); if (m.find()) { return m.group(1); } else { return null; } }
Source:
<code><START> public Vector shuffle(){ <END> return self.shuffle(); }</code><technical_language>Missed space {</technical_language>

Target:
public Vector shuffle() { return self.shuffle(factory); }
Source:
<code>public void echoRuntimeFail() throws TException { try { client.echoRuntimeFail(KITTY_MSG); <START> Assert.fail(); <END> } catch (Exception e) { Assert.assertEquals(TApplicationException.class.getName(), e.getClass().getName()); } echoPass(); }</code><technical_language>Failure message, please</technical_language>

Target:
public void echoRuntimeFail() throws TException { try { client.echoRuntimeFail(KITTY_MSG); Assert.fail("Thrift client did not throw an expected exception"); } catch (Exception e) { Assert.assertEquals(TApplicationException.class.getName(), e.getClass().getName()); } echoPass(); }
Source:
<code>private Map<DetailAST, String> getInvalidReturnTypes(DetailAST typeToken) { <START> Map<DetailAST, String> invalidReturnTypeMap = new HashMap<>(); <END> final int typeCount = typeToken.getChildCount(); if (typeCount == 1) { final String returnTypeName = typeToken.getFirstChild().getText(); if (classPathMap.containsKey(returnTypeName) && !isValidLibrary(classPathMap.get(returnTypeName))) { invalidReturnTypeMap.put(typeToken, returnTypeName); } } else { invalidReturnTypeMap = getInvalidTypeFromTypeArguments(typeToken); } return invalidReturnTypeMap; }</code><technical_language>A return type "IDENT" TYPE_ARGUMENTS. duplicating logic for checking IDENT. Example: Mono<String> foo() { } 1. a token type IDENT "Mono" 1. a TYPE_ARGUMENTS child node a TYPE_PARAMETER. Example: EventHubProducer createProducer() 1. a token type IDENT "EventHubProducer"</technical_language>

Target:
private Map<DetailAST, String> getInvalidReturnTypes(DetailAST typeToken) { final Map<DetailAST, String> invalidReturnTypeMap = new HashMap<>(); final DetailAST identToken = typeToken.findFirstToken(TokenTypes.IDENT); if (identToken == null) { return invalidReturnTypeMap; } final String typeName = identToken.getText(); if (!isValidClassDependency(typeName)) { invalidReturnTypeMap.put(typeToken, typeName); } final DetailAST typeArgumentsToken = typeToken.findFirstToken(TokenTypes.TYPE_ARGUMENTS); if (typeArgumentsToken != null) { invalidReturnTypeMap.putAll(getInvalidTypeFromTypeArguments(typeArgumentsToken)); } return invalidReturnTypeMap; }
Source:
<code>public void testValidateCodeWithCodeAndCoding() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("code").setValue(new CodeType("8452-5")); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-1"))); try { <START> myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); <END> } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: $validate-code can only validate (code) OR (coding) OR (codeableConcept)",e.getMessage()); } }</code><technical_language>Suggestion: include a JUnit fail() statement this statement, in case exception is thrown expected</technical_language>

Target:
public void testValidateCodeWithCodeAndCoding() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("code").setValue(new CodeType("8452-5")); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-1"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: $validate-code can only validate (code) OR (coding) OR (codeableConcept)",e.getMessage()); } }
Source:
<code>public MetaStreamEvent clone() { MetaStreamEvent metaStreamEvent = new MetaStreamEvent(); <START> for (Attribute attribute: this.getOutputData()) { <END> metaStreamEvent.addOutputData(attribute); } for (Attribute attribute: this.getOnAfterWindowData()) { metaStreamEvent.addOnAfterWindowData(attribute); } for (Attribute attribute: this.getBeforeWindowData()) { metaStreamEvent.addBeforeWindowData(attribute); } for (AbstractDefinition abstractDefinition: this.getInputDefinitions()) { metaStreamEvent.addInputDefinition(abstractDefinition); } metaStreamEvent.setInputReferenceId(this.getInputReferenceId()); metaStreamEvent.setOutputDefinition(this.getOutputStreamDefinition()); metaStreamEvent.setEventType(this.getEventType()); return metaStreamEvent; }</code><technical_language>access privete variables assign values</technical_language>

Target:
public MetaStreamEvent clone() { MetaStreamEvent metaStreamEvent = new MetaStreamEvent(); if (outputData != null) { for (Attribute attribute : outputData) { metaStreamEvent.addOutputData(attribute); } } if (this.onAfterWindowData != null) { metaStreamEvent.onAfterWindowData = new ArrayList<>(onAfterWindowData); } metaStreamEvent.beforeWindowData = new ArrayList<>(beforeWindowData); for (AbstractDefinition abstractDefinition: this.getInputDefinitions()) { metaStreamEvent.addInputDefinition(abstractDefinition); } metaStreamEvent.setInputReferenceId(this.getInputReferenceId()); metaStreamEvent.setOutputDefinition(this.getOutputStreamDefinition()); metaStreamEvent.setEventType(this.getEventType()); return metaStreamEvent; }
Source:
<code>public AccumuloBulkMergeException(final Throwable cause) { <START> super(Msg, cause); <END> }</code><technical_language>suggestion super(MSG, cause);</technical_language>

Target:
public AccumuloBulkMergeException(final Throwable cause) { super(MSG, cause); }
Source:
<code>public AirGoogleMapFragment build() { if (options == null) { options = new AirGoogleMapOptions(new GoogleMapOptions()); } <START> return AirGoogleMapFragment.newInstance(options); <END> }</code><technical_language>hmm do rename AirGoogleMapFragment include Native in name? I this Builder a native map created, AirGoogleMapFragment obvious provides a native map</technical_language>

Target:
public NativeGoogleMapFragment build() { if (options == null) { options = new AirGoogleMapOptions(new GoogleMapOptions()); } return NativeGoogleMapFragment.newInstance(options); }
Source:
<code>public void onSuccess() { int currentNumOfAttempts = numOfAttempts.get(); if (currentNumOfAttempts > 0 && currentNumOfAttempts < maxAttempts) { succeededAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()).getOrElse(lastRuntimeException.get()); publishRetryEvent(() -> new RetryOnSuccessEvent(getName(), currentNumOfAttempts, throwable)); } else { if (currentNumOfAttempts >= maxAttempts) { <START> failedAfterRetryCounter.increment(); <END> Throwable throwable = Option.of(lastException.get()).getOrElse(lastRuntimeException.get()); publishRetryEvent(() -> new RetryOnErrorEvent(name, currentNumOfAttempts, throwable != null ? throwable : new MaxRetriesExceeded("max retries is reached out for the result predicate check"))); } else { succeededWithoutRetryCounter.increment(); } } }</code><technical_language>a bit weird is a branch onSuccess method emits error event. more consistent rename onSuccess onOperationFinished onRetriesStopped etc</technical_language>

Target:
public void onSuccess() { onComplete(); }
Source:
<code>public void testRetrieveKeyAndValueNull() { JdbcCodeList jdbcCodeList = new JdbcCodeList(); jdbcCodeList.setDataSource(dataSource); jdbcCodeList.setLabelColumn("valueColumn"); jdbcCodeList.setValueColumn("labelColumn"); jdbcCodeList.setQuerySql("Select code_id, code_name from codelist"); Map<String, String> mapOutput = jdbcCodeList.retrieveMap(); assertThat(mapOutput.size(), is(0)); assertNull(mapOutput.get("valueColumn")); <START> assertNull(mapOutput.get("labelColumn")); <END> }</code><technical_language>[x] unnecessary, mapOutput.size is zero. assertNull(mapOutput.get("valueColumn")); assertNull(mapOutput.get("labelColumn")); --- removed. 059df0362e3fc35b1ec81490950162cfbd065425</technical_language>

Target:
public void testRetrieveKeyAndValueNull() { JdbcCodeList jdbcCodeList = new JdbcCodeList(); jdbcCodeList.setDataSource(dataSource); jdbcCodeList.setLabelColumn("valueColumn"); jdbcCodeList.setValueColumn("labelColumn"); jdbcCodeList.setQuerySql("Select code_id, code_name from codelist"); Map<String, String> mapOutput = jdbcCodeList.retrieveMap(); assertThat(mapOutput.size(), is(0)); }
Source:
<code>public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = new ArrayList<Account.Id>(); ChangeControl ctl = changeControlFactory.validateFor(changeId); if (ctl.canRemoveReviewer(reviewerId)) { Iterable<PatchSetApproval> patchSets = db.patchSetApprovals().byChange(changeId); List<PatchSetApproval> toDelete = new ArrayList<PatchSetApproval>(); for (PatchSetApproval psa : patchSets) { <START> if (psa.getAccountId().equals(reviewerId)) { <END> toDelete.add(psa); } } try { db.patchSetApprovals().delete(toDelete); } catch(OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } } else { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Not allowed to remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }</code><technical_language>permit deleting blocking negative scores user is administrator</technical_language>

Target:
public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = new ArrayList<Account.Id>(); ChangeControl ctl = changeControlFactory.validateFor(changeId); boolean permitted = true; List<PatchSetApproval> toDelete = new ArrayList<PatchSetApproval>(); for (PatchSetApproval psa : db.patchSetApprovals().byChange(changeId)) { if (psa.getAccountId().equals(reviewerId)) { if (ctl.canRemoveReviewer(psa)) { toDelete.add(psa); } else { permitted = false; break; } } } if (permitted) { try { db.patchSetApprovals().delete(toDelete); } catch (OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } } else { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Not allowed to remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }
Source:
<code><START> private static boolean isCountCall(ExpressionTree testedValue) { <END> return testedValue.is(Tree.Kind.FUNCTION_CALL) && "count".equals(((FunctionCallTree) testedValue).callee().toString()); }</code><technical_language>No, I for moment. Feel free create it. Note function names case insensitive: <?php echo count([42, 43]) . "\n"; echo coUNt([42, 43]) . "\n"; // ok! function greet($name) { echo "Hello $name\n"; } greet("john"); GrEet("jack"); // ok! $a = 42; echo $A; // fails</technical_language>

Target:
private static boolean isCountCall(ExpressionTree testedValue) { return testedValue.is(Tree.Kind.FUNCTION_CALL) && "count".equalsIgnoreCase(((FunctionCallTree) testedValue).callee().toString()); }
Source:
<code>private void registerBlockFamily(BlockFamily family) { familyByUri.put(family.getURI(), family); for (Block block : family.getBlocks()) { byte id = idByUri.get(block.getURI()); if (id == 0) { id = (byte) nextId++; idByUri.put(block.getURI(), id); } block.setId(id); blocksById.put(block.getId(), block); blocksByUri.put(block.getURI(), block); <START> if( block.getEntityPrefab().length() > 0 ){ <END> blocksByPrefabName.put(block.getEntityPrefab(), block); } } }</code><technical_language>minor point (not worth changing), isEmpty() here. :P More generally, assumption block prefab is incorrect - prefab supplies functionality block, multiple blocks prefab get functionality. I reconsider find blocks prefabs - this tie stand-alone recipe prefabs</technical_language>

Target:
private void registerBlockFamily(BlockFamily family) { familyByUri.put(family.getURI(), family); for (Block block : family.getBlocks()) { byte id = idByUri.get(block.getURI()); if (id == 0) { id = (byte) nextId++; idByUri.put(block.getURI(), id); } block.setId(id); blocksById.put(block.getId(), block); blocksByUri.put(block.getURI(), block); if( !block.getEntityPrefab().isEmpty() ){ blocksByPrefabName.put(block.getEntityPrefab(), block); } } }
Source:
<code>public static Candidate convertRichMemberToCandidate(RichMember richMember, UserExtSource primaryUserExtSource) { if(richMember == null) throw new InternalErrorException("RichMember can't be null when converting to Candidate."); if(primaryUserExtSource == null) throw new InternalErrorException("PrimaryUserExtSource can't be null when converting to Candidate."); <START> List<UserExtSource> additionalUserExtSources = new ArrayList<>(); if(richMember.getUserExtSources() != null) additionalUserExtSources = new ArrayList<>(richMember.getUserExtSources()); <END> additionalUserExtSources.remove(primaryUserExtSource); List<Attribute> allAttributes = new ArrayList<>(); if(richMember.getMemberAttributes() != null) allAttributes.addAll(richMember.getMemberAttributes()); if(richMember.getUserAttributes() != null) allAttributes.addAll(richMember.getUserAttributes()); Map<String, String> candidateAttributes = new HashMap<>(); for(Attribute attribute: allAttributes) { candidateAttributes.put(attribute.getName(), attributeValueToString(attribute)); } Candidate candidate = new Candidate(richMember.getUser(), primaryUserExtSource); candidate.setAdditionalUserExtSources(additionalUserExtSources); candidate.setAttributes(candidateAttributes); return candidate; }</code><technical_language>instantiating list twice. ternary if in line replace new Arraylist<>(..) adAll(..) in line</technical_language>

Target:
public static Candidate convertRichMemberToCandidate(RichMember richMember, UserExtSource primaryUserExtSource) { if(richMember == null) throw new InternalErrorException("RichMember can't be null when converting to Candidate."); if(primaryUserExtSource == null) throw new InternalErrorException("PrimaryUserExtSource can't be null when converting to Candidate."); List<UserExtSource> additionalUserExtSources = new ArrayList<>(); if(richMember.getUserExtSources() != null) additionalUserExtSources.addAll(richMember.getUserExtSources()); additionalUserExtSources.remove(primaryUserExtSource); List<Attribute> allAttributes = new ArrayList<>(); if(richMember.getMemberAttributes() != null) allAttributes.addAll(richMember.getMemberAttributes()); if(richMember.getUserAttributes() != null) allAttributes.addAll(richMember.getUserAttributes()); Map<String, String> candidateAttributes = new HashMap<>(); for(Attribute attribute: allAttributes) { candidateAttributes.put(attribute.getName(), attributeValueToString(attribute)); } Candidate candidate = new Candidate(richMember.getUser(), primaryUserExtSource); candidate.setAdditionalUserExtSources(additionalUserExtSources); candidate.setAttributes(candidateAttributes); return candidate; }
Source:
<code>public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } <START> else if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContextQueue().isEmpty()) { <END> getCallerThreadPoolExecutor().shutdown(); } return true; }</code><technical_language>reflection, I expect need shutdown work phase is interrupted. risk removing test phase altogether line 215 testing queue is empty</technical_language>

Target:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } else if(bulkExecCallerImpl.getCallContextQueue().isEmpty() && getCallerThreadPoolExecutor().getActiveCount() == 0) { getCallerThreadPoolExecutor().shutdown(); } return true; }
Source:
<code>public PoolListModel() { setTitle(ConstantsManager.getInstance().getConstants().poolsTitle()); setDefaultSearchString("Pools:"); setSearchString(getDefaultSearchString()); setSearchObjects(new String[] { SearchObjects.VDC_POOL_OBJ_NAME, SearchObjects.VDC_POOL_PLU_OBJ_NAME }); setAvailableInModes(ApplicationMode.VirtOnly); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); UpdateActionAvailability(); getSearchNextPageCommand().setIsAvailable(true); getSearchPreviousPageCommand().setIsAvailable(true); if (getCustomPropertiesKeysList() == null) { AsyncDataProvider.GetCustomPropertiesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { PoolListModel model = (PoolListModel) target; if (returnValue != null) { model.setCustomPropertiesKeysList(new HashMap<Version, ArrayList<String>>()); HashMap<Version, String> dictionary = (HashMap<Version, String>) returnValue; for (Map.Entry<Version, String> keyValuePair : dictionary.entrySet()) { <START> String[] split = keyValuePair.getValue().split("[;]", -1); END> if (split.length == 1 && (split[0] == null || split[0].isEmpty())) { model.getCustomPropertiesKeysList().put(keyValuePair.getKey(), null); } else { model.getCustomPropertiesKeysList().put(keyValuePair.getKey(), new ArrayList<String>()); for (String s : split) { model.getCustomPropertiesKeysList().get(keyValuePair.getKey()).add(s); } } } } } })); } }</code><technical_language>* splitting in UI instead of adding OptionBehaviourAttribute annotation PredefinedVMProperties/UserDefinedVMProperties (e.g. OptionBehaviour.CommaSeparatedStringArray) ? * Configuration Values cached in UI - retrieve cache instead of query</technical_language>

Target:
public PoolListModel() { setTitle(ConstantsManager.getInstance().getConstants().poolsTitle()); setDefaultSearchString("Pools:"); setSearchString(getDefaultSearchString()); setSearchObjects(new String[] { SearchObjects.VDC_POOL_OBJ_NAME, SearchObjects.VDC_POOL_PLU_OBJ_NAME }); setAvailableInModes(ApplicationMode.VirtOnly); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); UpdateActionAvailability(); getSearchNextPageCommand().setIsAvailable(true); getSearchPreviousPageCommand().setIsAvailable(true); if (getCustomPropertiesKeysList() == null) { AsyncDataProvider.GetCustomPropertiesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { PoolListModel model = (PoolListModel) target; if (returnValue != null) { model.setCustomPropertiesKeysList((HashMap<Version, ArrayList<String>>) returnValue); } } })); } }
Source:
<code>public void deregisterMetrics() { super.deregisterMetrics(); updateNumTopics(0); updateNumAutoPausedPartitionsAwaitingDestTopic(0); updateNumAutoPausedPartitionsOnError(0); updateNumConfigPausedPartitions(0); updateNumAutoPausedPartitionsOnInFlightMessages(0); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_CONFIG_PAUSED_PARTITIONS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_ERROR); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_INFLIGHT_MESSAGES); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_WAITING_FOR_DEST_TOPIC); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_TOPICS); <START> if (_enablePollDurationMillisMetric) { <END> DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, POLL_DURATION_MS); } }</code><technical_language>nit:Can _pollDurationMs _enablePollDurationMillisMetric local</technical_language>

Target:
public void deregisterMetrics() { super.deregisterMetrics(); updateNumTopics(0); updateNumAutoPausedPartitionsAwaitingDestTopic(0); updateNumAutoPausedPartitionsOnError(0); updateNumConfigPausedPartitions(0); updateNumAutoPausedPartitionsOnInFlightMessages(0); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_CONFIG_PAUSED_PARTITIONS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_ERROR); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_INFLIGHT_MESSAGES); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_WAITING_FOR_DEST_TOPIC); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_TOPICS); if (_pollDurationMsMetric != null) { DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, POLL_DURATION_MS); } }