auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean checkPermission(String permission) { int res = this.ctx.checkCallingOrSelfPermission(permission); return (res == PackageManager.PERMISSION_GRANTED); }

Target:
private boolean checkPermission(String permission) { int res = ctx.checkCallingOrSelfPermission(permission); return (res == PackageManager.PERMISSION_GRANTED); }
Source:
protected void doAsyncAddEntry(final PendingAddOp op) { if (throttler != null) { throttler.acquire(); } boolean wasClosed = false; synchronized (this) { if (getLedgerMetadata().isClosed() || closing) { wasClosed = true; } else { long currentLength = addToLength(op.payload.readableBytes()); op.setLedgerLength(currentLength); pendingAddOps.add(op); } } if (wasClosed) { try { clientCtx.getMainWorkerPool().submit(new SafeRunnable() { @Override public void safeRun() { LOG.warn("Attempt to add to closed ledger: {}", ledgerId); op.cb.addCompleteWithLatency(BKException.Code.LedgerClosedException, LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } @Override public String toString() { return String.format("AsyncAddEntryToClosedLedger(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { op.cb.addCompleteWithLatency(BookKeeper.getReturnRc(clientCtx.getBookieClient(), BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } return; } if (!waitForWritable(distributionSchedule.getWriteSet(op.getEntryId()), op.getEntryId(), 0, clientCtx.getConf().waitForWriteSetMs)) { op.allowFailFastOnUnwritableChannel(); } try { clientCtx.getMainWorkerPool().executeOrdered(ledgerId, op); } catch (RejectedExecutionException e) { op.cb.addCompleteWithLatency(BookKeeper.getReturnRc(clientCtx.getBookieClient(), BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } }

Target:
protected void doAsyncAddEntry(final PendingAddOp op) { if (throttler != null) { throttler.acquire(); } boolean wasClosed = false; synchronized (this) { if (isHandleWritable()) { long currentLength = addToLength(op.payload.readableBytes()); op.setLedgerLength(currentLength); pendingAddOps.add(op); } else { wasClosed = true; } } if (wasClosed) { try { clientCtx.getMainWorkerPool().submit(new SafeRunnable() { @Override public void safeRun() { LOG.warn("Attempt to add to closed ledger: {}", ledgerId); op.cb.addCompleteWithLatency(BKException.Code.LedgerClosedException, LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } @Override public String toString() { return String.format("AsyncAddEntryToClosedLedger(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { op.cb.addCompleteWithLatency(BookKeeper.getReturnRc(clientCtx.getBookieClient(), BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } return; } if (!waitForWritable(distributionSchedule.getWriteSet(op.getEntryId()), op.getEntryId(), 0, clientCtx.getConf().waitForWriteSetMs)) { op.allowFailFastOnUnwritableChannel(); } try { clientCtx.getMainWorkerPool().executeOrdered(ledgerId, op); } catch (RejectedExecutionException e) { op.cb.addCompleteWithLatency(BookKeeper.getReturnRc(clientCtx.getBookieClient(), BKException.Code.InterruptedException), LedgerHandleAdv.this, op.getEntryId(), 0, op.ctx); } }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((MifosBaseActivity) getActivity()).getActivityComponent().inject(this); getActivity().registerReceiver(this.broadCastNewMessage, new IntentFilter("report")); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((MifosBaseActivity) getActivity()).getActivityComponent().inject(this); getActivity().registerReceiver(this.broadCastNewMessage, new IntentFilter(Constants.ACTION_REPORT)); }
Source:
public void useMaster() { boolean legacyMetricsEnabled = cluster.getSiteConfiguration().getBoolean(Property.GENERAL_LEGACY_METRICS); assertTrue(legacyMetricsEnabled); List<SlowOps> tables = new ArrayList<>(); for (int i = 0; i < tableCount; i++) { String uniqueName = getUniqueNames(1)[0] + "_" + i; SlowOps gen = new SlowOps(getConnector(), uniqueName, maxWait, tableCount); tables.add(gen); gen.startCompactTask(); } try { getConnector().instanceOperations().waitForBalance(); Map<String,String> configs = getConnector().instanceOperations().getSystemConfiguration(); assertTrue("master config should not be empty", !configs.isEmpty()); } catch (AccumuloException | AccumuloSecurityException ex) { fail("Could not get config from master"); } for (SlowOps t : tables) { try { getConnector().tableOperations().cancelCompaction(t.getTableName()); boolean cancelled = t.blockWhileCompactionRunning(); if (!cancelled) { log.info("Failed to cancel compaction during multiple compaction test clean-up for {}", t.getTableName()); } } catch (AccumuloSecurityException | TableNotFoundException | AccumuloException ex) { log.debug("Exception thrown during multiple table test clean-up", ex); } } }

Target:
public void useMaster() { boolean legacyMetricsEnabled = cluster.getSiteConfiguration().getBoolean(Property.GENERAL_LEGACY_METRICS); assertTrue(legacyMetricsEnabled); List<String> tables = new ArrayList<>(); int tableCount = 4; for (int i = 0; i < tableCount; i++) { String uniqueName = getUniqueNames(1)[0] + "_" + i; tables.add(uniqueName); try { getConnector().tableOperations().create(uniqueName); } catch (AccumuloException | AccumuloSecurityException | TableExistsException ex) { log.debug("Failed to create table: {}", uniqueName, ex); fail("failed to create table: " + uniqueName); } } try { getConnector().instanceOperations().waitForBalance(); Map<String,String> configs = getConnector().instanceOperations().getSystemConfiguration(); assertFalse("master config should not be empty", configs.isEmpty()); } catch (AccumuloException | AccumuloSecurityException ex) { fail("Could not get config from master"); } for (String t : tables) { try { log.debug("Delete test table: {}", t); getConnector().tableOperations().delete(t); } catch (AccumuloSecurityException | TableNotFoundException | AccumuloException ex) { log.debug("Exception thrown deleting table during test clean-up", ex); } } }
Source:
private static double estimateMinorAlleleFraction(final int a, final int r, final double bias) { final double altFraction = (double) a / (a + r); final double initialEstimate = altFraction < 0.5 ? altFraction : 1. - altFraction; final Function<Double, Double> objective = f -> { final double logf = Math.log(f); final double logOneMinusf = Math.log(1. - f); final double logBias = Math.log(bias); final double logAltMinorDenominatorTerm = Math.log(f + (1. - f)*bias); final double logRefMinorDenominatorTerm = Math.log(1. - f + f*bias); final double altMinorLogLikelihood = a * logf + r * (logOneMinusf + logBias) - (a + r) * logAltMinorDenominatorTerm; final double refMinorLogLikelihood = r * (logf + logBias) + a * logOneMinusf - (a + r) * logRefMinorDenominatorTerm; return GATKProtectedMathUtils.logSumExp(altMinorLogLikelihood, refMinorLogLikelihood); }; return OptimizationUtils.argmax(objective, 0.0, 0.5, initialEstimate); }

Target:
private static double estimateMinorAlleleFraction(final int a, final int r, final double bias) { final double altFraction = (double) a / (a + r); final double initialEstimate = altFraction < 0.5 ? altFraction : 1. - altFraction; final Function<Double, Double> objective = f -> { final double logf = Math.log(f); final double logOneMinusf = Math.log(1. - f); final double logBias = Math.log(bias); final double logAltMinorDenominatorTerm = Math.log(f + (1. - f)*bias); final double logRefMinorDenominatorTerm = Math.log(1. - f + f*bias); final double altMinorLogLikelihood = a * logf + r * (logOneMinusf + logBias) - (a + r) * logAltMinorDenominatorTerm; final double refMinorLogLikelihood = r * (logf + logBias) + a * logOneMinusf - (a + r) * logRefMinorDenominatorTerm; return GATKProtectedMathUtils.logSumExp(altMinorLogLikelihood, refMinorLogLikelihood); }; return OptimizationUtils.argmax(objective, AlleleFractionState.MIN_MINOR_FRACTION, AlleleFractionState.MAX_MINOR_FRACTION, initialEstimate); }
Source:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Object o = node.getChildValue("exterior"); LinearRing exterior = null; if(o instanceof String){ LineString ls =(LineString)(((Node)node.getChildren().get(0)).getChildValue(LineString.class)); return gFactory.createPolygon(ls.getCoordinateSequence()); }else{ exterior = (LinearRing) node.getChildValue("exterior"); } LinearRing[] interior = null; if (node.hasChild("interior")) { List list = node.getChildValues("interior"); List interiors = new ArrayList(); for (int i = 0; i < list.size(); i++) { Object obj = list.get(i); LinearRing lr = null; if (obj instanceof String) { LineString ls = (LineString) (((Node) node.getChildren().get(i+1)).getChildValue(LineString.class)); lr = gFactory.createLinearRing(ls.getCoordinateSequence()) ; } else { lr = (LinearRing)obj; } interiors.add(lr); } interior = (LinearRing[]) interiors.toArray(new LinearRing[interiors.size()]); } if(exterior == null && interior == null){ return null; }else{ return gFactory.createPolygon(exterior, interior); } }

Target:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { LinearRing exterior = (LinearRing) node.getChildValue("exterior"); LinearRing[] interior = null; if (node.hasChild("interior")) { List list = node.getChildValues("interior"); interior = (LinearRing[]) list.toArray(new LinearRing[list.size()]); } return gFactory.createPolygon(exterior, interior); }
Source:
private void uploadToRPubs(RSConnectPublishInput input, RSConnectPublishResult result, final ProgressIndicator indicator) { if (input.getContentType() == CONTENT_TYPE_DOCUMENT && (!input.hasDocOutput() || !supportedRPubsDocExtension(input.getDocOutput()))) { display_.showErrorMessage("Publish Document", "Only rendered R Markdown documents can be published to RPubs. " + "To publish this document, click Knit to render it to HTML, then " + "click the Publish button above the rendered document."); indicator.onCompleted(); return; } RPubsUploader uploader = new RPubsUploader(rpubsServer_, display_, events_, "rpubs-" + rpubsCount_++); String contentType = contentTypeDesc(input.getContentType()); indicator.onProgress("Uploading " + contentType); uploader.setOnUploadComplete(new CommandWithArg<Boolean>() { @Override public void execute(Boolean arg) { indicator.onCompleted(); } }); uploader.performUpload(contentType, input.getSourceRmd() == null ? null : input.getSourceRmd().getPath(), input.getOriginatingEvent().getHtmlFile(), input.getOriginatingEvent().getFromPrevious() == null ? "" : input.getOriginatingEvent().getFromPrevious().getBundleId(), false); }

Target:
private void uploadToRPubs(RSConnectPublishInput input, RSConnectPublishResult result, final ProgressIndicator indicator) { if (input.getContentType() == CONTENT_TYPE_DOCUMENT) { if (!input.hasDocOutput()) { display_.showErrorMessage("Publish Document", "Only rendered documents can be published to RPubs. " + "To publish this document, click Knit or Preview to render it to HTML, then " + "click the Publish button above the rendered document."); indicator.onCompleted(); return; } else if (!supportedRPubsDocExtension(input.getDocOutput())) { showUnsupportedRPubsFormatMessage(); indicator.onCompleted(); return; } } RPubsUploader uploader = new RPubsUploader(rpubsServer_, display_, events_, "rpubs-" + rpubsCount_++); String contentType = contentTypeDesc(input.getContentType()); indicator.onProgress("Uploading " + contentType); uploader.setOnUploadComplete(new CommandWithArg<Boolean>() { @Override public void execute(Boolean arg) { indicator.onCompleted(); } }); uploader.performUpload(contentType, input.getSourceRmd() == null ? null : input.getSourceRmd().getPath(), input.getOriginatingEvent().getHtmlFile(), input.getOriginatingEvent().getFromPrevious() == null ? "" : input.getOriginatingEvent().getFromPrevious().getBundleId(), false); }
Source:
protected void commitSingleEntry(CacheEntry entry, Metadata metadata, FlagAffectedCommand command, InvocationContext ctx, Flag trackFlag, boolean l1Invalidation) { boolean created = entry.isCreated(); boolean removed = entry.isRemoved(); boolean expired; if (entry instanceof MVCCEntry) { expired = ((MVCCEntry) entry).isExpired(); } else { expired = false; } InternalCacheEntry previousEntry = dataContainer.peek(entry.getKey()); Object previousValue = null; Metadata previousMetadata = null; if (previousEntry != null) { previousValue = previousEntry.getValue(); previousMetadata = previousEntry.getMetadata(); } commitManager.commit(entry, metadata, trackFlag, l1Invalidation); notifyCommitEntry(created, removed, expired, entry, ctx, command, previousValue, previousMetadata); }

Target:
protected void commitSingleEntry(CacheEntry entry, Metadata metadata, FlagAffectedCommand command, InvocationContext ctx, Flag trackFlag, boolean l1Invalidation) { boolean created = entry.isCreated(); boolean removed = entry.isRemoved(); boolean expired; if (removed && entry instanceof MVCCEntry) { expired = ((MVCCEntry) entry).isExpired(); } else { expired = false; } InternalCacheEntry previousEntry = dataContainer.peek(entry.getKey()); Object previousValue = null; Metadata previousMetadata = null; if (previousEntry != null) { previousValue = previousEntry.getValue(); previousMetadata = previousEntry.getMetadata(); } commitManager.commit(entry, metadata, trackFlag, l1Invalidation); notifyCommitEntry(created, removed, expired, entry, ctx, command, previousValue, previousMetadata); }
Source:
public void setValue(Number value) { checkForLock(); if (value == null) { _actual_type = IntegerType.INT; doSetValue(0, true); } else { if (value instanceof BigInteger) { _actual_type = IntegerType.BIG_INTEGER; BigInteger big = (BigInteger) value; doSetValue(big); } else if (value instanceof BigDecimal) { _actual_type = IntegerType.BIG_INTEGER; BigDecimal bd = (BigDecimal) value; doSetValue(bd.toBigInteger()); } else { _actual_type = IntegerType.LONG; doSetValue(value.longValue(), false); } } }

Target:
public void setValue(Number value) { checkForLock(); if (value == null) { doSetValue(0, true); } else if (value instanceof BigInteger) { BigInteger big = (BigInteger) value; doSetValue(big); } else if (value instanceof BigDecimal) { BigDecimal bd = (BigDecimal) value; doSetValue(bd.toBigInteger()); } else { doSetValue(value.longValue(), false); } }
Source:
public Object invoke(StaplerRequest request, StaplerResponse response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, ServletException { if (!request.getMethod().equals("POST")) { for (ErrorCustomizer handler : ServiceLoader.load(ErrorCustomizer.class)) { ForwardToView forwardToView = handler.getForwardView(); if (forwardToView != null) { throw new InvocationTargetException(forwardToView.with("requestURL", request.getRequestURLWithQueryString().toString())); } } throw new InvocationTargetException(new HttpResponses.HttpResponseException() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); rsp.addHeader("Allow", "POST"); rsp.setContentType("text/html"); PrintWriter w = rsp.getWriter(); w.println("<html><head><title>POST required</title></head><body>"); w.println("POST is required for " + target.getQualifiedName() + "<br>"); w.println("<form method='POST'><input type='submit' value='Try POSTing'></form>"); w.println("</body></html>"); } }); } return target.invoke(request, response, instance, arguments); }

Target:
public Object invoke(StaplerRequest request, StaplerResponse response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, ServletException { if (!request.getMethod().equals("POST")) { for (ErrorCustomizer handler : ServiceLoader.load(ErrorCustomizer.class, request.getWebApp().getClassLoader())) { ForwardToView forwardToView = handler.getForwardView(); if (forwardToView != null) { throw new InvocationTargetException(forwardToView.with("requestURL", request.getRequestURLWithQueryString().toString())); } } throw new InvocationTargetException(new HttpResponses.HttpResponseException() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); rsp.addHeader("Allow", "POST"); rsp.setContentType("text/html"); PrintWriter w = rsp.getWriter(); w.println("<html><head><title>POST required</title></head><body>"); w.println("POST is required for " + target.getQualifiedName() + "<br>"); w.println("<form method='POST'><input type='submit' value='Try POSTing'></form>"); w.println("</body></html>"); } }); } return target.invoke(request, response, instance, arguments); }
Source:
public MapsforgeOSMTileSource(final Context context, final String name, final String attribution, final boolean upSize) { name_ = name; attribution_ = attribution; tileSize_ = upSize ? 512 : 256; displayModel_ = new FixedTileSizeDisplayModel(tileSize_); if (firstTime) { Application app = (Application)context.getApplicationContext(); AndroidGraphicFactory.createInstance(app); firstTime = false; } }

Target:
public MapsforgeOSMTileSource(final Context context, final String name, final String attribution, final boolean upSize) { name_ = name; attribution_ = attribution; tileSize_ = upSize ? 512 : 256; displayModel_ = new FixedTileSizeDisplayModel(tileSize_); setupGraphicsFactory(context); }
Source:
public void testTSVBundle() throws Exception { ServiceReference refs[] = m_bundle.getRegisteredServices(); ServiceReference<AbstractFormatterFactory> reference = refs[0]; AbstractFormatterFactory o = m_bundle.getBundleContext().getService(reference); Properties prop = new Properties(); prop.setProperty("format", "tsv"); AbstractFormatter formatter = o.create(prop); Object[] results = formatter.transform("12\t10.05\ttest"); assertEquals(results.length, 3); }

Target:
public void testTSVBundle() throws Exception { ServiceReference refs[] = m_bundle.getRegisteredServices(); ServiceReference<AbstractFormatterFactory> reference = refs[0]; AbstractFormatterFactory o = m_bundle.getBundleContext().getService(reference); Properties prop = new Properties(); Formatter formatter = o.create("tsv", prop); Object[] results = formatter.transform("12\t10.05\ttest"); assertEquals(results.length, 3); assertEquals(results[0], "12"); assertEquals(results[1], "10.05"); assertEquals(results[2], "test"); }
Source:
private void cleanup(File execDir) { if (execDir != null) { try { FileUtils.deleteDirectory(execDir); } catch (IOException e) { Throwables.propagate(e); } } }

Target:
private void cleanup(File execDir) { if (execDir != null) { try { FileUtils.deleteDirectory(execDir); } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); for (Entry<SchemaTableName, ElasticsearchTableDescription> entry : tableDescriptions.entrySet()) { ElasticsearchTableDescription table = entry.getValue(); if (table.getColumns() == null) { buildColumns(table); } if (!table.isMetadataSet()) { table.setColumnsMetadata(table.getColumns().stream() .map(ElasticsearchColumnMetadata::new) .collect(Collectors.toList())); } } return tableDescriptions.get(new SchemaTableName(schemaName, tableName)); }

Target:
public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); ElasticsearchTableDescription table = tableDescriptions.get(new SchemaTableName(schemaName, tableName)); if (table == null) { return null; } if (table.getColumns().isPresent()) { return table; } List<ElasticsearchColumn> columns = buildColumns(table); ElasticsearchTableDescription result = new ElasticsearchTableDescription( table.getTableName(), table.getSchemaName(), table.getHost(), table.getPort(), table.getClusterName(), table.getIndex(), table.getIndexExactMatch(), table.getType(), Optional.of(columns)); return result; }
Source:
public void setUp() throws Exception { if (repl == null) { intpGroup = new InterpreterGroup(); intpGroup.put("note", new LinkedList<Interpreter>()); repl = new ScioInterpreter(getScioTestProperties()); repl.setInterpreterGroup(intpGroup); intpGroup.get("note").add(repl); repl.open(); } context = new InterpreterContext("note", "id", "title", "text", new AuthenticationInfo(), new HashMap<String, Object>(), new GUI(), new AngularObjectRegistry(intpGroup.getId(), null), new LocalResourcePool("id"), new LinkedList<InterpreterContextRunner>(), new InterpreterOutput(new InterpreterOutputListener() { @Override public void onAppend(InterpreterOutput out, byte[] line) @Override public void onUpdate(InterpreterOutput out, byte[] output) })); }

Target:
public void setUp() throws Exception { if (repl == null) { intpGroup = new InterpreterGroup(); intpGroup.put("note", new LinkedList<Interpreter>()); repl = new ScioInterpreter(new Properties()); repl.setInterpreterGroup(intpGroup); intpGroup.get("note").add(repl); repl.open(); } context = getNewContext(); }
Source:
public boolean performDrop(Object data) { final Object target = getCurrentTarget(); IPath targetNode = null; if (target == null) targetNode = Path.ROOT; if (target instanceof Variable) return false; else if (target instanceof IPath) targetNode = (IPath) target; final AbstractTreeViewer viewer = (AbstractTreeViewer) super.getViewer(); final IStructuredSelection selection = (IStructuredSelection) data; final VariablesTreeContentProvider treeContentProvider = (VariablesTreeContentProvider) viewer.getContentProvider(); for (final Object element : selection.toArray()) { if (element instanceof Variable) { final Variable currentVariable = (Variable) element; if (currentVariable != null) currentVariable.setPath(targetNode); } else if (element instanceof IPath) { final IPath node = (IPath) element; final List<Variable> variables = fModel.getVariables(); targetNode = targetNode.append(node.lastSegment()); treeContentProvider.updatePathGroup(variables, targetNode, node); treeContentProvider.moveSelectedPath(targetNode.makeRelative(), node); } } final Object[] elements = viewer.getExpandedElements(); viewer.refresh(); viewer.setExpandedElements(elements); return true; }

Target:
public boolean performDrop(Object data) { final Object target = getCurrentTarget(); IPath targetNode = null; if (target == null) targetNode = Path.ROOT; if (target instanceof Variable) return false; else if (target instanceof IPath) targetNode = (IPath) target; final AbstractTreeViewer viewer = (AbstractTreeViewer) super.getViewer(); final IStructuredSelection selection = (IStructuredSelection) data; final VariablesTreeContentProvider treeContentProvider = (VariablesTreeContentProvider) viewer.getContentProvider(); for (final Object element : selection.toArray()) { if (element instanceof Variable) { final Variable currentVariable = (Variable) element; currentVariable.setPath(targetNode); } else if (element instanceof IPath) { final IPath node = (IPath) element; final List<Variable> variables = fModel.getVariables(); targetNode = targetNode.append(node.lastSegment()); VariablesTreeContentProvider.updatePathGroup(variables, targetNode, node); treeContentProvider.moveSelectedPath(targetNode.makeRelative(), node); } } final Object[] elements = viewer.getExpandedElements(); viewer.refresh(); viewer.setExpandedElements(elements); return true; }
Source:
public synchronized void updateVariables(Map<String, String> variablesToUpdate) throws IOException { Map<String, String> rollBackVariables = new HashMap<>(variablesToUpdate.size()); try { for (Map.Entry<String, String> entry : variablesToUpdate.entrySet()) { String oldValue = updateVariableInternal(entry.getKey(), entry.getValue()); rollBackVariables.putIfAbsent(entry.getKey(), oldValue); } refreshCache(); } catch (NoResultException ex) { logger.log(Level.WARNING, "Error while updating variables", ex); for (Map.Entry<String, String> rollback : rollBackVariables.entrySet()) { updateVariableInternal(rollback.getKey(), rollback.getValue()); } throw new IOException(ex); } }

Target:
public synchronized void updateVariables(Map<String, String> variablesToUpdate) { for (Map.Entry<String, String> entry : variablesToUpdate.entrySet()) { updateVariableInternal(entry.getKey(), entry.getValue()); } refreshCache(); }
Source:
public void testDatastaxDriverConfig() { when(mockConfiguration.getStringProperty(eq(CoreConfig.CASSANDRA_DRIVER))).thenReturn("datastax"); when(mockConfiguration.getBooleanProperty(eq(CoreConfig.STRING_METRICS_DROPPED))).thenReturn(Boolean.TRUE); when(mockConfiguration.getListProperty(eq(CoreConfig.TENANTIDS_TO_KEEP))).thenReturn(new ArrayList<String>()); when(mockConfiguration.getStringProperty(eq(CoreConfig.DELAYED_METRICS_STORAGE_GRANULARITY))).thenReturn("20m"); IOContainer.resetInstance(); IOContainer ioContainer = IOContainer.fromConfig(); ShardStateIO shardStateIO = ioContainer.getShardStateIO(); assertTrue("ShardStateIO instance is Datastax", shardStateIO instanceof DShardStateIO); MetadataIO metadataIO = ioContainer.getMetadataIO(); assertTrue("MetadataIO instance is Datastax", metadataIO instanceof DMetadataIO); }

Target:
public void testDatastaxDriverConfig() { when(mockConfiguration.getStringProperty(eq(CoreConfig.CASSANDRA_DRIVER))).thenReturn("datastax"); when(mockConfiguration.getBooleanProperty(eq(CoreConfig.STRING_METRICS_DROPPED))).thenReturn(Boolean.TRUE); when(mockConfiguration.getListProperty(eq(CoreConfig.TENANTIDS_TO_KEEP))).thenReturn(new ArrayList<String>()); IOContainer.resetInstance(); IOContainer ioContainer = IOContainer.fromConfig(); ShardStateIO shardStateIO = ioContainer.getShardStateIO(); assertTrue("ShardStateIO instance is Datastax", shardStateIO instanceof DShardStateIO); MetadataIO metadataIO = ioContainer.getMetadataIO(); assertTrue("MetadataIO instance is Datastax", metadataIO instanceof DMetadataIO); }
Source:
private Resource getPom(PutOptions options, ReleaseDTO instructions, Jar binary) throws Exception, IOException { Resource pom = null; if (instructions.pom.path != null) { if (instructions.pom.path.equals("JAR")) { pom = binary.getPomXmlResources() .findFirst() .orElse(null); } else { pom = createPomFromFile(options.context.getFile(instructions.pom.path)); if (pom == null) { logger.warn( "A pom path was set in the -maven-release instuction, but no file could be found in (base path: {}) ", instructions.pom.path, options.context.getBaseURI() .toString()); } } } else { if (!configuration.ignore_metainf_maven()) { if (options.context.is(Constants.POM)) { pom = binary.getPomXmlResources() .findFirst() .orElse(null); } else { pom = createPomFromFirstMavenPropertiesInJar(binary, options.context); } } if (pom == null) { logger.info("No properties in binary or invalid GAV"); pom = createPomFromContextAndManifest(binary.getManifest(), options.context); } if (pom == null) { pom = createPomFromFirstMavenPropertiesInJar(binary, options.context); } } return pom; }

Target:
private Resource getPom(PutOptions options, ReleaseDTO instructions, Jar binary) throws Exception, IOException { Resource pom = null; if (instructions.pom.path != null) { if (instructions.pom.path.equals("JAR")) { pom = binary.getPomXmlResources() .findFirst() .orElse(null); } else { pom = createPomFromFile(options.context.getFile(instructions.pom.path)); if (pom == null) { logger.warn( "A pom path was set in the -maven-release instuction, but no file could be found in (base path: {}) ", instructions.pom.path, options.context.getBase()); } } } else { if (!configuration.ignore_metainf_maven()) { if (options.context.is(Constants.POM)) { pom = binary.getPomXmlResources() .findFirst() .orElse(null); } else { pom = createPomFromFirstMavenPropertiesInJar(binary, options.context); } } if (pom == null) { logger.info("No properties in binary or invalid GAV"); pom = createPomFromContextAndManifest(binary.getManifest(), options.context); } if (pom == null) { pom = createPomFromFirstMavenPropertiesInJar(binary, options.context); } } return pom; }
Source:
public boolean sendCommand(Command command) throws Exception { long deviceId = command.getDeviceId(); if (command.getId() != 0) { command = getById(command.getId()).clone(); command.setDeviceId(deviceId); } if (command.getTextChannel()) { Position lastPosition = Context.getIdentityManager().getLastPosition(deviceId); String phone = Context.getIdentityManager().getById(deviceId).getPhone(); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); protocol.sendTextCommand(phone, command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { if (Context.getSmppManager() != null) { Context.getSmppManager().sendMessageSync(phone, command.getString(Command.KEY_DATA), true); } else { throw new RuntimeException("SMPP client is not enabled"); } } else { throw new RuntimeException("Command " + command.getType() + " is not supported"); } } else { ActiveDevice activeDevice = Context.getConnectionManager().getActiveDevice(deviceId); if (activeDevice != null) { activeDevice.sendCommand(command); } else if (!queueing) { throw new RuntimeException("Commands queueing is not enabled"); } else { getDeviceQueue(deviceId).add(command); return false; } } return true; }

Target:
public boolean sendCommand(Command command) throws Exception { long deviceId = command.getDeviceId(); if (command.getId() != 0) { command = getById(command.getId()).clone(); command.setDeviceId(deviceId); } if (command.getTextChannel()) { Position lastPosition = Context.getIdentityManager().getLastPosition(deviceId); String phone = Context.getIdentityManager().getById(deviceId).getPhone(); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); protocol.sendTextCommand(phone, command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { if (Context.getSmppManager() != null) { Context.getSmppManager().sendMessageSync(phone, command.getString(Command.KEY_DATA), true); } else { throw new RuntimeException("SMPP client is not enabled"); } } else { throw new RuntimeException("Command " + command.getType() + " is not supported"); } } else { ActiveDevice activeDevice = Context.getConnectionManager().getActiveDevice(deviceId); if (activeDevice != null) { activeDevice.sendCommand(command); } else if (!queueing) { throw new RuntimeException("Device is not online"); } else { getDeviceQueue(deviceId).add(command); return false; } } return true; }
Source:
public boolean equals(Object object) { if (object == null && object.getClass() != getClass()) { return false; } if (object == this) { return true; } TestData rhs = (TestData) object; return new EqualsBuilder() .append(this.syntaxId, rhs.syntaxId) .append(this.prefix, rhs.prefix) .append(this.syntaxExtension, rhs.syntaxExtension) .append(this.ctsExtension, rhs.ctsExtension) .append(this.isSyntaxInputTest, rhs.isSyntaxInputTest) .append(this.ctsData, rhs.ctsData) .append(this.syntaxData, rhs.syntaxData) .append(this.configuration, rhs.configuration) .isEquals(); }

Target:
public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof TestData)) { return false; } TestData rhs = (TestData) object; return new EqualsBuilder() .append(this.syntaxId, rhs.syntaxId) .append(this.prefix, rhs.prefix) .append(this.syntaxExtension, rhs.syntaxExtension) .append(this.ctsExtension, rhs.ctsExtension) .append(this.isSyntaxInputTest, rhs.isSyntaxInputTest) .append(this.ctsData, rhs.ctsData) .append(this.syntaxData, rhs.syntaxData) .append(this.configuration, rhs.configuration) .isEquals(); }
Source:
public void handleRegularMessage(final Message msg) { if (waitDialog != null) { if (msg.what == UPDATE_PROGRESS) { final int secondsElapsed = (int) ((System.currentTimeMillis() - detailProgressTime) / 1000); assert detailProgress > 0; final int secondsRemaining = (detailTotal - detailProgress) * secondsElapsed / detailProgress; waitDialog.setProgress(detailProgress); if (secondsRemaining < 40) { waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getString(R.string.caches_eta_ltm)); } else { final int minsRemaining = secondsRemaining / 60; waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getQuantityString(R.plurals.caches_eta_mins, minsRemaining, minsRemaining)); } } else if (msg.what == FINISHED_LOADING_DETAILS) { waitDialog.dismiss(); waitDialog.setOnCancelListener(null); } } }

Target:
public void handleRegularMessage(final Message msg) { if (waitDialog != null) { if (msg.what == UPDATE_PROGRESS) { final int secondsElapsed = (int) ((System.currentTimeMillis() - detailProgressTime) / 1000); final int secondsRemaining = (detailTotal - detailProgress) * secondsElapsed / detailProgress; waitDialog.setProgress(detailProgress); if (secondsRemaining < 40) { waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getString(R.string.caches_eta_ltm)); } else { final int minsRemaining = secondsRemaining / 60; waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getQuantityString(R.plurals.caches_eta_mins, minsRemaining, minsRemaining)); } } else if (msg.what == FINISHED_LOADING_DETAILS) { waitDialog.dismiss(); waitDialog.setOnCancelListener(null); } } }
Source:
public Response updateCredentials(UserCredentials userCredentialChange) { User user = userSchoolDataController.findUser(sessionController.getLoggedUserSchoolDataSource(), sessionController.getLoggedUserIdentifier()); try { userSchoolDataController.updateUserCredentials(user, userCredentialChange.getOldPassword(), userCredentialChange.getUsername(), userCredentialChange.getNewPassword()); return Response.noContent().build(); } catch (SchoolDataBridgeUnauthorizedException e) { return Response.status(Status.FORBIDDEN).build(); } catch (SchoolDataBridgeException e) { return Response.status(Status.BAD_REQUEST).build(); } }

Target:
public Response updateCredentials(UserCredentials userCredentialChange) { User user = userSchoolDataController.findUser(sessionController.getLoggedUserSchoolDataSource(), sessionController.getLoggedUserIdentifier()); try { userSchoolDataController.updateUserCredentials(user, userCredentialChange.getOldPassword(), userCredentialChange.getUsername(), userCredentialChange.getNewPassword()); return Response.noContent().build(); } catch (SchoolDataBridgeException e) { return Response.status(e.getStatusCode()).build(); } }
Source:
public ObjectColumnSelector makeObjectColumnSelector( DimensionSpec spec, IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Double.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { return 0.0; } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }

Target:
public ObjectColumnSelector makeObjectColumnSelector( DimensionSpec spec, IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Double.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { return DimensionHandlerUtils.ZERO_DOUBLE; } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }
Source:
public LocalDate getEnd() { return LocalDate.of(2019, 4, 10); }

Target:
public LocalDate getEnd() { return LocalDate.of(2019, 12, 31); }
Source:
public static final void assertJenkinsNotInQuietMode(final JenkinsRule j) { await().pollInterval(250, TimeUnit.MILLISECONDS) .atMost(10, TimeUnit.SECONDS) .until(() -> !j.jenkins.get().getQueue().isBlockedByShutdown(task)); }

Target:
public static final void assertJenkinsNotInQuietMode(final JenkinsRule j) { await().pollInterval(250, TimeUnit.MILLISECONDS) .atMost(10, TimeUnit.SECONDS) .until(() -> !j.jenkins.getQueue().isBlockedByShutdown(task)); }
Source:
private MapSqlParameterSource createBrickParams(GlusterBrickEntity brick) { return getCustomMapSqlParameterSource().addValue("id", brick.getId()) .addValue("volume_id", brick.getVolumeId()) .addValue("server_id", brick.getServerId()) .addValue("brick_dir", brick.getBrickDirectory()) .addValue("brick_order", (brick.getBrickOrder() == null) ? new Integer(0) : brick.getBrickOrder()) .addValue("status", EnumUtils.nameOrNull(brick.getStatus())); }

Target:
private MapSqlParameterSource createBrickParams(GlusterBrickEntity brick) { return getCustomMapSqlParameterSource().addValue("id", brick.getId()) .addValue("volume_id", brick.getVolumeId()) .addValue("server_id", brick.getServerId()) .addValue("brick_dir", brick.getBrickDirectory()) .addValue("brick_order", (brick.getBrickOrder() == null) ? Integer.valueOf(0) : brick.getBrickOrder()) .addValue("status", EnumUtils.nameOrNull(brick.getStatus())); }
Source:
public XAResourceRecovery createXAResourceRecovery(ResourceAdapter rar, ActivationSpec as, String productName, String productVersion) { throw new UnsupportedOperationException("Operation is not supported!"); }

Target:
public XAResourceRecovery createXAResourceRecovery(ResourceAdapter rar, ActivationSpec as, String productName, String productVersion) { throw ROOT_LOGGER.noSupportedOperation("createXAResourceRecovery"); }
Source:
public Button(String name, Controller controller, int id) { this.name = name; this.controller = controller; this.id = id; String skn = Options.get("joyb_"+controller.getIndex()+"_"+id); if (skn != null) { try { Keys keys = MojamComponent.instance.keys; for (Keys.Key key : keys.getAll()) { if (simulKey != null) continue; if (key.name.equals(skn)) { simulKey = key; } } } catch (NullPointerException e) { e.printStackTrace(); } } }

Target:
public Button(String name, Controller controller, int id) { this.name = name; this.controller = controller; this.id = id; String skn = Options.get("joyb_"+controller.getIndex()+"_"+id); if (skn != null) { try { Keys keys = MojamComponent.instance.keys; for (Keys.Key key : keys.getAll()) { if (key.name.equals(skn)) { simulKey = key; break; } } } catch (NullPointerException e) { e.printStackTrace(); } } }
Source:
public String getTermNameFromOntology(final OntologyDataManager ontologyDataManager) { if (this.termId != null) { final Term term = ontologyDataManager.getTermById(this.termId.getId()); if (term != null && !StringUtil.isEmpty(term.getName())) { return term.getName(); } else { return this.name; } } else { return this.name; } }

Target:
public String getTermNameFromOntology(final OntologyDataManager ontologyDataManager) { if (this.termId != null) { final Term term = ontologyDataManager.getTermById(this.termId.getId()); if (term != null && !StringUtil.isEmpty(term.getName())) { return term.getName(); } } return this.name; }
Source:
public synchronized byte[] getEventPayLoad() { if (count >=2 && this.buf[count-2] == this.buf[count-1]) { return Arrays.copyOf(buf, count -1); } if (count >= 2 && buf[count-2] == '\r' && buf[count-1] == '\n') { Arrays.copyOf(buf, count-2); } return Arrays.copyOf(buf, count); }

Target:
public synchronized byte[] getEventPayLoad() { if (count >=2 && this.buf[count-2] == this.buf[count-1]) { return Arrays.copyOf(buf, count -1); } if (count >= 2 && buf[count-2] == '\r' && buf[count-1] == '\n') { return Arrays.copyOf(buf, count-2); } return Arrays.copyOf(buf, count); }
Source:
public static String formatDateWithNoYear(long millis) { try { return new SimpleDateFormat("MMMM d").format(millis); } catch (Exception e) { logger.error(e); return null; } }

Target:
public static String formatDateWithNoYear(long millis) { try { return new SimpleDateFormat("MMMM d").format(millis); } catch (IllegalArgumentException e) { logger.error(e); return null; } }
Source:
public static void requestName(Team team) { sendMsg(team, NAME); String s = null; long start = System.currentTimeMillis(); while((System.currentTimeMillis() - start < 5000) && team.getLastInput() == null) { s = team.read().substring(0, 5); team.setLastInput(s); team.setName(s); } if(team.getLastInput() == null) { } team.setLastInput(null); }

Target:
public static void requestName(Team team) { team.setLastInput(null); sendMsg(team, NAME); String s = null; long start = System.currentTimeMillis(); while((System.currentTimeMillis() - start < 5000) && team.getLastInput() == null) { s = team.read().substring(0, 5); team.setLastInput(s); team.setName(s); } if(team.getLastInput() == null) { } }
Source:
private void installSyntheticModules( @NotNull PantsCompileOptionsExecutor executor, @NotNull DataNode<ProjectData> projectDataNode, @NotNull Map<String, DataNode<ModuleData>> modules ) { Path projectPath = Paths.get(executor.getBuildRoot().getAbsolutePath()); Set<String> replaced = executor.getOptions().getSelectedTargetSpecs().stream() .map(x -> x.replaceFirst("/?:.*", "")) .collect(Collectors.toSet()); Set<String> replacedWithoutChildren = removeChildren(replaced); Set<String> allContentRoots = modules.values().stream() .flatMap(x -> x.getChildren() .stream()) .map(x -> x.getData(ProjectKeys.CONTENT_ROOT)) .filter(Objects::nonNull) .map(x -> x.getRootPath()) .collect(Collectors.toSet()); replacedWithoutChildren.removeAll(allContentRoots); for (String path: replaced) { String moduleName = projectPath.relativize(Paths.get(path)).toString().replaceAll("/", "_") + "-project-root"; final ModuleData moduleData = new ModuleData( moduleName, PantsConstants.SYSTEM_ID, ModuleTypeId.JAVA_MODULE, moduleName, path, new File(path).getAbsolutePath() ); DataNode<ModuleData> moduleDataNode = projectDataNode.createChild(ProjectKeys.MODULE, moduleData); modules.put(moduleName , moduleDataNode); final ContentRootData contentRoot = new ContentRootData(PantsConstants.SYSTEM_ID, path); moduleDataNode.createChild(ProjectKeys.CONTENT_ROOT, contentRoot); } }

Target:
private void installSyntheticModules( @NotNull PantsCompileOptionsExecutor executor, @NotNull DataNode<ProjectData> projectDataNode, @NotNull Map<String, DataNode<ModuleData>> modules ) { Path projectPath = Paths.get(executor.getBuildRoot().getAbsolutePath()); Set<String> targetSpecPaths = executor.getOptions().getSelectedTargetSpecs().stream() .map(x -> x.replaceFirst("/?:.*", "")) .map(x -> Paths.get(x).isAbsolute() ? projectPath.relativize(Paths.get(x)).toString() : x) .collect(Collectors.toSet()); Set<String> targetSpecPathsWithoutChildren = removeChildren(targetSpecPaths); Set<String> allContentRoots = modules.values().stream() .flatMap(x -> x.getChildren() .stream()) .map(x -> x.getData(ProjectKeys.CONTENT_ROOT)) .filter(Objects::nonNull) .map(x -> x.getRootPath()) .collect(Collectors.toSet()); targetSpecPathsWithoutChildren.removeIf(targetSpec -> allContentRoots.stream().anyMatch(contentRoot -> projectPath.resolve(targetSpec).startsWith(contentRoot))); for (String targetPath: targetSpecPathsWithoutChildren) { String relativePath = targetPath; String moduleName = relativePath.replaceAll("/", "_") + "-project-root"; final ModuleData moduleData = new ModuleData( moduleName, PantsConstants.SYSTEM_ID, ModuleTypeId.JAVA_MODULE, moduleName, targetPath, new File(executor.getBuildRoot(), relativePath).getAbsolutePath() ); DataNode<ModuleData> moduleDataNode = projectDataNode.createChild(ProjectKeys.MODULE, moduleData); modules.put(moduleName , moduleDataNode); final ContentRootData contentRoot = new ContentRootData(PantsConstants.SYSTEM_ID, targetPath); moduleDataNode.createChild(ProjectKeys.CONTENT_ROOT, contentRoot); } }
Source:
public Object getPropertyValue(Object id) { if (id instanceof String) { String id2 = (String) id; final ITmfEventField content = fEvent.getContent(); switch (id2) { case ID_EVENT_SOURCE: String source = fEvent.getSource(); ITmfEventField sourceInstance = content.getField(BtfColumnNames.SOURCE_INSTANCE.toString()); return sourceInstance == null ? null : new EntityPropertySource(source, sourceInstance.getValue().toString()); case ID_EVENT_TYPE: return new TypePropertySource(fEvent.getType().getName(), fEvent.getEventDescription()); case ID_EVENT_TARGET: String target = fEvent.getTarget(); ITmfEventField targetInstance = content.getField(BtfColumnNames.TARGET_INSTANCE.toString()); return targetInstance == null ? null : new EntityPropertySource(target, targetInstance.getValue().toString()); case ID_EVENT_EVENT: ITmfEventField event = content.getField(BtfColumnNames.EVENT.toString()); return event == null ? null : new EventPropertySource(event); case ID_EVENT_NOTES: ITmfEventField notes = content.getField(BtfColumnNames.NOTES.toString()); return notes == null ? null : notes.getValue(); default: break; } } return super.getPropertyValue(id); }

Target:
public Object getPropertyValue(Object id) { if (id instanceof String) { String id2 = (String) id; final ITmfEventField content = fEvent.getContent(); switch (id2) { case ID_EVENT_SOURCE: String source = fEvent.getSource(); ITmfEventField sourceInstance = content.getField(BtfColumnNames.SOURCE_INSTANCE.toString()); return sourceInstance == null ? "null" : new EntityPropertySource(source, sourceInstance.getValue().toString()); case ID_EVENT_TYPE: return new TypePropertySource(fEvent.getType().getName(), fEvent.getEventDescription()); case ID_EVENT_TARGET: String target = fEvent.getTarget(); ITmfEventField targetInstance = content.getField(BtfColumnNames.TARGET_INSTANCE.toString()); return targetInstance == null ? "null" : new EntityPropertySource(target, targetInstance.getValue().toString()); case ID_EVENT_EVENT: ITmfEventField event = content.getField(BtfColumnNames.EVENT.toString()); return event == null ? null : new EventPropertySource(event); case ID_EVENT_NOTES: ITmfEventField notes = content.getField(BtfColumnNames.NOTES.toString()); return notes == null ? null : notes.getValue(); default: break; } } return super.getPropertyValue(id); }
Source:
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); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, TIME_SPENT_BETWEEN_POLLS_MS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, PER_EVENT_PROCESSING_TIME_NANOS); } if (_kafkaConsumerMetricsRegistered) { DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION); } }

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); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION); if (_pollDurationMsMetric != null) { DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, POLL_DURATION_MS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, TIME_SPENT_BETWEEN_POLLS_MS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, PER_EVENT_PROCESSING_TIME_NANOS); } }