auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createKey() { CreateKeyActivity activity = (CreateKeyActivity) getActivity(); if (activity == null) { return; } final boolean createSecurityToken = activity.mCreateSecurityToken; CryptoOperationHelper.Callback<SaveKeyringParcel, EditKeyResult> createKeyCallback = new CryptoOperationHelper.Callback<SaveKeyringParcel, EditKeyResult>() { @Override public SaveKeyringParcel createOperationInput() { return mSaveKeyringParcel; } @Override public void onCryptoOperationSuccess(EditKeyResult result) { BackupNotificationUtil.setBackupReminder(getContext(),result.mMasterKeyId, mNameEdit.getText().toString(), mEmailEdit.getText().toString()); if (createSecurityToken) { moveToCard(result); return; } if (result.mMasterKeyId != null && mUploadCheckbox.isChecked()) { uploadKey(result); return; } finishWithResult(result); } @Override public void onCryptoOperationCancelled() { } @Override public void onCryptoOperationError(EditKeyResult result) { displayResult(result); } @Override public boolean onCryptoSetProgress(String msg, int progress, int max) { return false; } }; mCreateOpHelper = new CryptoOperationHelper<>(1, this, createKeyCallback, R.string.progress_building_key); mCreateOpHelper.cryptoOperation(); }

Target:
private void createKey() { CreateKeyActivity activity = (CreateKeyActivity) getActivity(); if (activity == null) { return; } final boolean createSecurityToken = activity.mCreateSecurityToken; CryptoOperationHelper.Callback<SaveKeyringParcel, EditKeyResult> createKeyCallback = new CryptoOperationHelper.Callback<SaveKeyringParcel, EditKeyResult>() { @Override public SaveKeyringParcel createOperationInput() { return mSaveKeyringParcel; } @Override public void onCryptoOperationSuccess(EditKeyResult result) { if (result != null && getContext() != null) { BackupNotificationUtil.setBackupReminder(getContext(), result.mMasterKeyId, mNameEdit.getText().toString(), mEmailEdit.getText().toString()); } if (createSecurityToken) { moveToCard(result); return; } if (result.mMasterKeyId != null && mUploadCheckbox.isChecked()) { uploadKey(result); return; } finishWithResult(result); } @Override public void onCryptoOperationCancelled() { } @Override public void onCryptoOperationError(EditKeyResult result) { displayResult(result); } @Override public boolean onCryptoSetProgress(String msg, int progress, int max) { return false; } }; mCreateOpHelper = new CryptoOperationHelper<>(1, this, createKeyCallback, R.string.progress_building_key); mCreateOpHelper.cryptoOperation(); }
Source:
public void testCompileCharSeq() { applyCollection(chars -> CharSeq.of(new String(chars))); }

Target:
public void testCompileCharSeq() { applyCollection(chars -> CharSeq.ofAll(Iterator.ofAll(chars))); }
Source:
public void collectStaticAnnotatedFields(JClassType type, JClassType typeParameter, Class<? extends Annotation> annotation, List<JField> collection) throws UnableToCompleteException { for (JClassType classType : inspectedClass.getFlattenedSupertypeHierarchy()) { for (JField field : classType.getFields()) { if (field.getAnnotation(annotation) != null) { JParameterizedType parameterizedType = field.getType().isParameterized(); if (!field.isStatic() || (typeParameter != null && (parameterizedType == null || !type.isAssignableFrom(parameterizedType) || !typeParameter.isAssignableFrom(parameterizedType.getTypeArgs()[0])))) { logger.log( TreeLogger.ERROR, "Found the annotation @" + annotation.getSimpleName() + " on the invalid field '" + classType.getName() + "." + field.getName() + "'. Field must be static and its type must be " + type.getName() + "<" + typeParameter.getName() + ">.", null); throw new UnableToCompleteException(); } collection.add(field); } } } }

Target:
public void collectStaticAnnotatedFields(JClassType type, JClassType typeParameter, Class<? extends Annotation> annotation, List<JField> collection) throws UnableToCompleteException { for (JClassType classType : inspectedClass.getFlattenedSupertypeHierarchy()) { for (JField field : classType.getFields()) { if (field.getAnnotation(annotation) != null) { JParameterizedType parameterizedType = field.getType().isParameterized(); if (!field.isStatic() || parameterizedType == null || !type.isAssignableFrom(parameterizedType) || !typeParameter.isAssignableFrom(parameterizedType.getTypeArgs()[0])) { logger.log( TreeLogger.ERROR, "Found the annotation @" + annotation.getSimpleName() + " on the invalid field '" + classType.getName() + "." + field.getName() + "'. Field must be static and its type must be " + type.getName() + "<" + typeParameter.getName() + ">.", null); throw new UnableToCompleteException(); } collection.add(field); } } } }
Source:
public void uninstallPush(@NonNull String installationID) throws ThingIFException { thingIfApi.uninstallPush(installationID); }

Target:
public void uninstallPush(@NonNull String installationID) throws ThingIFException { this.thingIfApi.uninstallPush(installationID); }
Source:
public StatusDTO status() { StatusCache statusCache = candlepinCache.getStatusCache(); StatusDTO cached = statusCache.getStatus(); if (cached != null) { return cached; } CandlepinCapabilities caps = CandlepinCapabilities.getCapabilities(); RulesSourceEnum rulesSource = this.jsProvider.getRulesSource(); boolean good = true; try { rulesCurator.getUpdatedFromDB(); } catch (Exception e) { log.error("Error checking database connection", e); good = false; } Mode mode = this.modeManager.getCurrentMode(); ModeChangeReason mcr = this.getOldestReason(this.modeManager.getModeChangeReasons()); good = good && (mode == Mode.NORMAL); StatusDTO status = new StatusDTO() .result(good) .version(version) .release(release) .standalone(standalone) .rulesVersion(jsProvider.getRulesVersion()) .rulesSource(rulesSource != null ? rulesSource.toString() : null) .mode(mode != null ? mode.toString() : null) .modeReason(mcr != null ? mcr.toString() : null) .modeChangeTime(mcr != null ? mcr.getTime().toInstant().atOffset(ZoneOffset.UTC) : null) .managerCapabilities(caps.stream().collect(Collectors.toList())) .timeUTC(new Date().toInstant().atOffset(ZoneOffset.UTC)); if (keycloakEnabled) { AdapterConfig adapterConfig = keycloakConfig.getAdapterConfig(); status .keycloakResource(adapterConfig.getResource()) .keycloakAuthUrl(adapterConfig.getAuthServerUrl()) .keycloakRealm(adapterConfig.getRealm()); } statusCache.setStatus(status); return status; }

Target:
public StatusDTO status() { StatusCache statusCache = candlepinCache.getStatusCache(); StatusDTO cached = statusCache.getStatus(); if (cached != null) { return cached; } CandlepinCapabilities caps = CandlepinCapabilities.getCapabilities(); RulesSourceEnum rulesSource = this.jsProvider.getRulesSource(); boolean good = true; try { rulesCurator.getUpdatedFromDB(); } catch (Exception e) { log.error("Error checking database connection", e); good = false; } Mode mode = this.modeManager.getCurrentMode(); ModeChangeReason mcr = this.getOldestReason(this.modeManager.getModeChangeReasons()); good = good && (mode == Mode.NORMAL); StatusDTO status = new StatusDTO() .result(good) .version(version) .release(release) .standalone(standalone) .rulesVersion(jsProvider.getRulesVersion()) .rulesSource(rulesSource != null ? rulesSource.toString() : null) .mode(mode != null ? mode.toString() : null) .modeReason(mcr != null ? mcr.toString() : null) .modeChangeTime(mcr != null ? mcr.getTime().toInstant().atOffset(ZoneOffset.UTC) : null) .managerCapabilities(caps.stream().collect(Collectors.toList())) .timeUTC(OffsetDateTime.now()); if (keycloakEnabled) { AdapterConfig adapterConfig = keycloakConfig.getAdapterConfig(); status .keycloakResource(adapterConfig.getResource()) .keycloakAuthUrl(adapterConfig.getAuthServerUrl()) .keycloakRealm(adapterConfig.getRealm()); } statusCache.setStatus(status); return status; }
Source:
synchronized RuntimeException handleException(InvocationTargetException rethrow) { try { throw rethrow.getCause(); } catch (TransactionLockWatchFailedException e) { throw e; } catch (Throwable t) { if (delegate.equals(fallbackCache)) { throw new RuntimeException(t); } else { log.warn("Unexpected failure occurred when trying to use the default cache. " + "Switching to the fallback implementation", t); fallbackCacheSelectedCounter.inc(); delegate = fallbackCache; throw new TransactionLockWatchFailedException("Unexpected failure in the default lock watch cache", t); } } }

Target:
synchronized RuntimeException handleException(InvocationTargetException rethrow) { try { throw rethrow.getCause(); } catch (TransactionLockWatchFailedException e) { throw e; } catch (Throwable t) { if (delegate == fallbackCache) { throw new RuntimeException(t); } else { log.warn("Unexpected failure occurred when trying to use the default cache. " + "Switching to the fallback implementation", t); fallbackCacheSelectedCounter.inc(); delegate = fallbackCache; throw new TransactionLockWatchFailedException("Unexpected failure in the default lock watch cache", t); } } }
Source:
public Object apply(RevisionResource revision, Input input) throws AuthException, BadRequestException, ResourceConflictException, Exception { final Change.Id changeId = revision.getChange().getId(); final ChangeControl control = revision.getControl(); if (!control.getProjectControl().controlForRef(input.destination) .canUpload()) { throw new AuthException("Not allowed to cherry pick " + changeId.toString() + " to " + input.destination); } final PatchSet.Id patchSetId = revision.getPatchSet().getId(); try { Change.Id cherryPickedChangeId = cherryPickChange.cherryPick(patchSetId, input.message, input.destination); return json.format(cherryPickedChangeId); } catch (InvalidChangeOperationException e ) { throw new BadRequestException(e.getMessage()); } }

Target:
public Object apply(RevisionResource revision, Input input) throws AuthException, BadRequestException, ResourceConflictException, Exception { final ChangeControl control = revision.getControl(); ReviewDb db = dbProvider.get(); if (!control.isVisible(db)) { throw new AuthException("Cherry pick not permitted"); } if (!control.getProjectControl().controlForRef(input.destination) .canUpload()) { throw new AuthException("Not allowed to cherry pick " + revision.getChange().getId().toString() + " to " + input.destination); } final PatchSet.Id patchSetId = revision.getPatchSet().getId(); try { Change.Id cherryPickedChangeId = cherryPickChange.cherryPick(patchSetId, input.message, input.destination); return json.format(cherryPickedChangeId); } catch (InvalidChangeOperationException e) { throw new BadRequestException(e.getMessage()); } }
Source:
public void setCheckbox(WebBrowserConfig webBrowserConfig, String url) throws MalformedURLException { UICheckbox saveHostName = find("saveHostName", UICheckbox.class); if (saveHostName != null && webBrowserConfig != null) { saveHostName.setChecked(false); String hostName = new URL(url).getHost(); saveHostName.subscribe(checkbox -> { boolean isTrustedHostName = saveHostName.isChecked(); if (isTrustedHostName) { webBrowserConfig.addTrustedHostName(hostName); } else { webBrowserConfig.removeTrustedHostName(hostName); } }); UICheckbox saveUrl = find("saveUrl", UICheckbox.class); if (saveUrl != null && webBrowserConfig != null) { saveUrl.setChecked(false); saveUrl.subscribe(checkbox -> { boolean isTrustedUrl = saveUrl.isChecked(); if (isTrustedUrl) { webBrowserConfig.addTrustedUrls(url); } else { webBrowserConfig.removeTrustedUrl(url); } }); } } }

Target:
public void setCheckbox(WebBrowserConfig webBrowserConfig, String url) { UICheckbox saveUrl = find("saveUrl", UICheckbox.class); if (saveUrl != null && webBrowserConfig != null) { saveUrl.setChecked(false); saveUrl.subscribe(checkbox -> { boolean isTrustedUrl = saveUrl.isChecked(); if (isTrustedUrl) { webBrowserConfig.addTrustedUrls(url); } else { webBrowserConfig.removeTrustedUrl(url); } }); } }
Source:
public boolean matches(@Nullable final String s) { if (s == null) { return prefix == null && (suffixStyle == SuffixStyle.MATCH_ANY || suffixStyle == SuffixStyle.MATCH_EMPTY || suffixPattern.matcher("").matches()); } final String suffix; if (prefix == null) { suffix = s; } else if (s.startsWith(prefix)) { suffix = s.substring(prefix.length()); } else { return false; } if (suffixStyle == SuffixStyle.MATCH_ANY) { return true; } else if (suffixStyle == SuffixStyle.MATCH_EMPTY) { return suffix.isEmpty(); } else { return suffixPattern.matcher(suffix).matches(); } }

Target:
public boolean matches(@Nullable final String s) { return pattern.matcher(Strings.nullToEmpty(s)).matches(); }
Source:
public String toString(boolean explicit) { if (fFilter instanceof ITmfFilterTreeNode) { return ((ITmfFilterTreeNode) fFilter).toString(explicit); } return fFilter.toString(); }

Target:
public String toString(boolean explicit) { if (fFilter instanceof ITmfFilterTreeNode) { return ((ITmfFilterTreeNode) fFilter).toString(explicit); } if (isNot()) { return "not " + fFilter.toString(); } return fFilter.toString(); }
Source:
private static void insertEventsInTable(int numEvents) { try { Cluster cluster = Cluster.builder().addContactPoint(NODE).build(); Session session = cluster.connect(KEYSPACE); String insert = "INSERT INTO " + KEYSPACE + "." + TABLE_NAME + " (ID,lastname,age)" + " VALUES (?,?,?);"; PreparedStatement stmt = session.prepare(insert); BoundStatement boundStatement = new BoundStatement(stmt); for (int i = 0; i < numEvents; i++) { ids.add(UUID.randomUUID()); mapNames.put(i, "test" + i); mapAge.put(i, i + 10); session.execute(boundStatement.bind(ids.get(i), "test" + i, i + 10)); } } catch (DriverException e) { throw new RuntimeException(e); } }

Target:
private static void insertEventsInTable(int numEvents) { try { Cluster cluster = Cluster.builder().addContactPoint(NODE).build(); Session session = cluster.connect(KEYSPACE); String insert = "INSERT INTO " + KEYSPACE + "." + TABLE_NAME + " (ID,lastname,age)" + " VALUES (?,?,?);"; PreparedStatement stmt = session.prepare(insert); BoundStatement boundStatement = new BoundStatement(stmt); for (int i = 0; i < numEvents; i++) { ids.add(UUID.randomUUID()); mapNames.put(i, "test" + i); mapAge.put(i, i + 10); session.execute(boundStatement.bind(ids.get(i), mapNames.get(i), mapAge.get(i))); } } catch (DriverException e) { throw new RuntimeException(e); } }
Source:
public void remove(final K key) { removeObserver.begin(); checkNonNull(key); try { store.remove(key); } catch (CacheAccessException e) { } finally { removeObserver.end(RemoveOutcome.SUCCESS); } }

Target:
public void remove(final K key) { statusTransitioner.checkAvailable(); checkNonNull(key); try { store.remove(key); } catch (CacheAccessException e) { } }
Source:
public List<MySearchResult> search(String query) { query = query.toLowerCase(); List<MySearchResult> results = new ArrayList<>(); for (Task t : getProject().getTaskManager().getTasks()) { String snippet = ""; String snippetText = ""; boolean matched = false; if (isNotEmptyAndContains(t.getName(), query)) { matched = true; } for (CustomProperty c : t.getCustomValues().getCustomProperties()) { if (isNotEmptyAndContains(c.getValueAsString(), query)) { matched = true; snippet = c.getDefinition().getName(); snippetText = c.getValueAsString(); break; } } if (isNotEmptyAndContains(t.getNotes(), query)) { matched = true; snippet = GanttLanguage.getInstance().getText("notes"); snippetText = t.getNotes(); } if (isNotEmptyAndContains(String.valueOf(t.getTaskID()), query)) { matched = true; snippet = "Id"; snippetText = String.valueOf(t.getTaskID()); } if (matched) { results.add(new MySearchResult(t, this, query, snippet, snippetText)); } } return results; }

Target:
public List<MySearchResult> search(String query) { query = query.toLowerCase(); List<MySearchResult> results = new ArrayList<>(); for (Task t : getProject().getTaskManager().getTasks()) { String snippet = ""; String snippetText = ""; boolean matched = false; if (isNotEmptyAndContains(t.getName(), query)) { matched = true; } for (CustomProperty c : t.getCustomValues().getCustomProperties()) { if (isNotEmptyAndContains(c.getValueAsString(), query)) { matched = true; snippet = c.getDefinition().getName(); snippetText = c.getValueAsString(); break; } } if (isNotEmptyAndContains(t.getNotes(), query)) { matched = true; snippet = GanttLanguage.getInstance().getText("notes"); snippetText = t.getNotes(); } if (isNotEmptyAndContains(String.valueOf(t.getTaskID()), query)) { matched = true; snippet = GanttLanguage.getInstance().getText("id"); snippetText = String.valueOf(t.getTaskID()); } if (matched) { results.add(new MySearchResult(t, this, query, snippet, snippetText)); } } return results; }
Source:
public void run() { logger.info("Participant consistency checker is initiated. Participants count = {}", participants.size()); try { ClusterParticipant clusterParticipant = participants.get(0); Set<String> sealedReplicas1 = new HashSet<>(clusterParticipant.getSealedReplicas()); Set<String> stoppedReplicas1 = new HashSet<>(clusterParticipant.getStoppedReplicas()); for (int i = 1; i < participants.size(); ++i) { logger.info("Checking sealed replica list"); Set<String> sealedReplicas2 = new HashSet<>(participants.get(i).getSealedReplicas()); if (!sealedReplicas1.equals(sealedReplicas2)) { logger.warn("Mismatch in sealed replicas. Set is different from set {}", sealedReplicas1, sealedReplicas2); metrics.sealedReplicasMismatchCount.inc(); } logger.info("Checking stopped replica list"); Set<String> stoppedReplicas2 = new HashSet<>(participants.get(i).getStoppedReplicas()); if (!stoppedReplicas1.equals(stoppedReplicas2)) { logger.warn("Mismatch in stopped replicas. Set is different from set {}", stoppedReplicas1, stoppedReplicas2); metrics.stoppedReplicasMismatchCount.inc(); } } } catch (Throwable t) { logger.error("Exception occurs when running consistency checker ", t); } }

Target:
public void run() { logger.debug("Participant consistency checker is initiated. Participants count = {}", participants.size()); try { ClusterParticipant clusterParticipant = participants.get(0); Set<String> sealedReplicas1 = new HashSet<>(clusterParticipant.getSealedReplicas()); Set<String> stoppedReplicas1 = new HashSet<>(clusterParticipant.getStoppedReplicas()); for (int i = 1; i < participants.size(); ++i) { logger.debug("Checking sealed replica list"); Set<String> sealedReplicas2 = new HashSet<>(participants.get(i).getSealedReplicas()); if (!sealedReplicas1.equals(sealedReplicas2)) { logger.warn("Mismatch in sealed replicas. Set is different from set {}", sealedReplicas1, sealedReplicas2); metrics.sealedReplicasMismatchCount.inc(); } logger.debug("Checking stopped replica list"); Set<String> stoppedReplicas2 = new HashSet<>(participants.get(i).getStoppedReplicas()); if (!stoppedReplicas1.equals(stoppedReplicas2)) { logger.warn("Mismatch in stopped replicas. Set is different from set {}", stoppedReplicas1, stoppedReplicas2); metrics.stoppedReplicasMismatchCount.inc(); } } } catch (Throwable t) { logger.error("Exception occurs when running consistency checker ", t); } }
Source:
private void paintTextLine(TextGroup textGroup, int lineNum, Map<String, Object> styles) { List<Text> line = textGroup.getLine(lineNum); int leftX = textGroup.getLeftX(); int bottomY = textGroup.getBottomY(lineNum); if (line.isEmpty()) { return; } else if (line.size() == 1) { paintWithMinLabel(line, leftX, bottomY, styles); } else { List<Text> middle = line.subList(1, line.size() - 1); OptionalInt minLabel = paintWithMinLabel(middle, leftX, bottomY, styles); Text first = line.get(0); paintBorderLabel(first, minLabel, leftX, bottomY, styles); Text last = line.get(line.size() - 1); if (first != last) { paintBorderLabel(last, minLabel, leftX, bottomY, styles); } } }

Target:
private void paintTextLine(TextGroup textGroup, int lineNum, Map<String, Object> styles) { List<Text> line = textGroup.getLine(lineNum); int leftX = textGroup.getLeftX(); int bottomY = textGroup.getBottomY(lineNum); if (line.isEmpty()) { return; } else if (line.size() == 1) { paintWithMinLabel(line, leftX, bottomY, styles); } else { List<Text> middle = line.subList(1, line.size() - 1); OptionalInt minLabel = paintWithMinLabel(middle, leftX, bottomY, styles); Text first = line.get(0); paintBorderLabel(first, minLabel, leftX, bottomY, styles); Text last = line.get(line.size() - 1); paintBorderLabel(last, minLabel, leftX, bottomY, styles); } }
Source:
public QueryRequest process(QueryRequest input) throws PluginExecutionException, StopProcessingException { return null; }

Target:
public QueryRequest process(QueryRequest input) throws PluginExecutionException, StopProcessingException { final String subjectIdentifier = getSubjectIdentifier(); final Set<String> roles = new HashSet<>(getSubjectRoles()); if (CollectionUtils.isNotEmpty(Sets.intersection(rolesThatCanSeeEverything, roles))) { LOGGER.debug( "Will not modify filter; subject ({}) had at least one role that was exempt [{}]", subjectIdentifier, roles, rolesThatCanSeeEverything); return input; } final TagAggregationVisitor visitor = new TagAggregationVisitor(); final Query query = input.getQuery(); query.accept(visitor, null); final Set<String> discoveredTags = visitor.getTags(); if (CollectionUtils.isEmpty(discoveredTags)) { LOGGER.debug( "Will not modify filter; subject's ({}) query specified no tags", subjectIdentifier, query); return input; } Set<String> tagsNotInCollaborationSet = Sets.filter(discoveredTags, tag -> !collaborationTags.contains(tag)); if (CollectionUtils.isNotEmpty(tagsNotInCollaborationSet)) { LOGGER.debug( "Will not modify filter; subject's ({}) query referenced tags not in collab set [{}]", subjectIdentifier, query, collaborationTags); return input; } Filter policyBranch = createBakedInSecurityPolicySubset(subjectIdentifier, roles); Filter combined = filterBuilder.allOf(query, policyBranch); return new QueryRequestImpl( new QueryImpl(combined), input.isEnterprise(), input.getSourceIds(), input.getProperties()); }
Source:
public ActivityCommentMessage getSenderCopyMessage() { return (this.senderCopyMessageList == null || this.senderCopyMessageList.isEmpty()) ? null : this.senderCopyMessageList.get(0); }

Target:
public ActivityCommentMessage getSenderCopyMessage() { return getFromHolder(this.senderCopyMessageHolder); }
Source:
private void readRecoveredChannelState() throws IOException, InterruptedException { SequentialChannelStateReader reader = getEnvironment().getTaskStateManager().getSequentialChannelStateReader(); if (reader.hasChannelStates()) { reader.readOutputData(getEnvironment().getAllWriters()); channelIOExecutor.execute(() -> { try { reader.readInputData(getEnvironment().getAllInputGates()); } catch (Exception e) { asyncExceptionHandler.handleAsyncException("Unable to read channel state", e); } }); for (InputGate inputGate : getEnvironment().getAllInputGates()) { inputGate .getStateConsumedFuture() .thenRun(() -> mainMailboxExecutor.execute(inputGate::requestPartitions, "Input gate request partitions")); } } else { requestPartitions(); } }

Target:
private void readRecoveredChannelState() throws IOException, InterruptedException { SequentialChannelStateReader reader = getEnvironment().getTaskStateManager().getSequentialChannelStateReader(); reader.readOutputData(getEnvironment().getAllWriters()); channelIOExecutor.execute(() -> { try { reader.readInputData(getEnvironment().getAllInputGates()); } catch (Exception e) { asyncExceptionHandler.handleAsyncException("Unable to read channel state", e); } }); for (InputGate inputGate : getEnvironment().getAllInputGates()) { inputGate .getStateConsumedFuture() .thenRun(() -> mainMailboxExecutor.execute(inputGate::requestPartitions, "Input gate request partitions")); } }
Source:
private static String generate(FileText fileText, DetailAST detailAST, int lineNumber, int columnNumber, int tabWidth) { final XpathQueryGenerator queryGenerator = new XpathQueryGenerator(detailAST, lineNumber, columnNumber, fileText, tabWidth); final List<String> suppressions = queryGenerator.generate(); final StringBuilder result = new StringBuilder(256); for (int i = 0; i < suppressions.size(); i++) { if (i > 0) { result.append('\n'); } result.append(suppressions.get(i)); } return result.toString(); }

Target:
private static String generate(FileText fileText, DetailAST detailAST, int lineNumber, int columnNumber, int tabWidth) { final XpathQueryGenerator queryGenerator = new XpathQueryGenerator(detailAST, lineNumber, columnNumber, fileText, tabWidth); final List<String> suppressions = queryGenerator.generate(); return suppressions.stream().collect(Collectors.joining(LINE_SEPARATOR, "", LINE_SEPARATOR)); }
Source:
private void prepareReplication() { try { if (m_producerDRGateway != null) { m_producerDRGateway.initialize(m_catalogContext.cluster.getDrproducerenabled(), VoltDB.getReplicationPort(m_catalogContext.cluster.getDrproducerport()), VoltDB.getDefaultReplicationInterface()); } if (m_consumerDRGateway != null) { m_consumerDRGateway.initialize(m_config.m_startAction.doesRecover() || m_config.m_startAction.doesRejoin()); } } catch (Exception ex) { MiscUtils.printPortsInUse(hostLog); VoltDB.crashLocalVoltDB("Failed to initialize DR", false, ex); } }

Target:
private void prepareReplication() { try { if (m_producerDRGateway != null) { m_producerDRGateway.initialize(m_catalogContext.cluster.getDrproducerenabled(), VoltDB.getReplicationPort(m_catalogContext.cluster.getDrproducerport()), VoltDB.getDefaultReplicationInterface()); } if (m_consumerDRGateway != null) { m_consumerDRGateway.initialize(m_config.m_startAction != StartAction.CREATE); } } catch (Exception ex) { MiscUtils.printPortsInUse(hostLog); VoltDB.crashLocalVoltDB("Failed to initialize DR", false, ex); } }
Source:
public void listTopicsTest() { if(AdminUtils.topicExists(kafka_utils.getZkUtils(),"testList")){ kafka_utils.deleteTopic("testList"); } kafka_utils.createTopic("testList"); kafka_utils.createTopic("testList2"); assertThat(kafka_utils.listTopics()).contains("testList"); System.out.println(kafka_utils.listTopics()); assertThat(kafka_utils.listTopics()).contains("testList2"); kafka_utils.deleteTopic("testList"); kafka_utils.deleteTopic("testList2"); }

Target:
public void listTopicsTest() { if(AdminUtils.topicExists(kafka_utils.getZkUtils(),"testList")){ kafka_utils.deleteTopic("testList"); } kafka_utils.createTopic("testList"); kafka_utils.createTopic("testList2"); assertThat(kafka_utils.listTopics()).contains("testList"); logger.error("Kafka contains next topics: " +Joiner.on(",").join(kafka_utils.listTopics())); assertThat(kafka_utils.listTopics()).contains("testList2"); kafka_utils.deleteTopic("testList"); kafka_utils.deleteTopic("testList2"); }
Source:
private void render(SafeHtmlBuilder sb, int row, ChangeAndCommit info) { sb.openTr(); sb.openTd().setStyleName(FileTable.R.css().pointer()).closeTd(); sb.openTd().addStyleName(Gerrit.RESOURCES.css().relatedChangesSubject()); String url = url(info); if (url != null) { sb.openAnchor().setAttribute("href", url); if (url.startsWith("#")) { sb.setAttribute("onclick", OPEN + "(event," + row + ")"); } sb.append((showBranches ? info.branch() + ": " : "") + info.commit().subject()); sb.closeAnchor(); } else { sb.append(info.commit().subject()); } sb.closeTd(); sb.closeTr(); }

Target:
private void render(SafeHtmlBuilder sb, int row, ChangeAndCommit info) { sb.openTr(); sb.openTd().setStyleName(FileTable.R.css().pointer()).closeTd(); sb.openTd().addStyleName(Gerrit.RESOURCES.css().relatedChangesSubject()); String url = url(info); if (url != null) { sb.openAnchor().setAttribute("href", url); if (url.startsWith("#")) { sb.setAttribute("onclick", OPEN + "(event," + row + ")"); } if (showBranches) { sb.append(info.branch()).append(": "); } sb.append(info.commit().subject()); sb.closeAnchor(); } else { sb.append(info.commit().subject()); } sb.closeTd(); sb.closeTr(); }
Source:
public ArrayList<CategoryPill.Data> execute(final CreateCategoryContext context) { String response = null; try { response = remoteOperation.execute(buildUrl(context)); } catch(RemoteException e) { PageObjectLogging.logError("error: ", e); } return getCategories(response, context); }

Target:
public List<CategoryPill.Data> execute(final CreateCategoryContext context) { try { return getCategories(remoteOperation.execute(buildUrl(context)), context); } catch(RemoteException e) { PageObjectLogging.logError("error: ", e); throw new CategoriesNotFetched("Could not fetch categories.", e); } }
Source:
public List<BasicDocumentRevision> getDocumentsWithIds(final List<String> docIds) throws DocumentException { Preconditions.checkState(this.isOpen(), "Database is closed"); Preconditions.checkNotNull(docIds, "Input document id list can not be null"); try { return queue.submit(new SQLQueueCallable<List<BasicDocumentRevision>>(){ @Override public List<BasicDocumentRevision> call(SQLDatabase db) throws Exception { String sql = String.format("SELECT " + FULL_DOCUMENT_COLS + " FROM revs, docs" + " WHERE docid IN ( %1$s ) AND current = 1 AND docs.doc_id = revs.doc_id " + " ORDER BY docs.doc_id ", DatabaseUtils.makePlaceholders(docIds.size())); String[] args = docIds.toArray(new String[docIds.size()]); List<BasicDocumentRevision> docs = getRevisionsFromRawQuery(db,sql, args); return sortDocumentsAccordingToIdList(docIds, docs); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE,"Failed to get documents with ids",e); throw new DocumentException("Failed to get documents with ids", e); } catch (ExecutionException e) { logger.log(Level.SEVERE, "Failed to get documents with ids", e); throw new DocumentException("Failed to get documents with ids", e); } }

Target:
public List<DocumentRevision> getDocumentsWithIds(final List<String> docIds) throws DocumentException { Preconditions.checkState(this.isOpen(), "Database is closed"); Preconditions.checkNotNull(docIds, "Input document id list cannot be null"); try { return queue.submit(new SQLQueueCallable<List<DocumentRevision>>(){ @Override public List<DocumentRevision> call(SQLDatabase db) throws Exception { String sql = String.format("SELECT " + FULL_DOCUMENT_COLS + " FROM revs, docs" + " WHERE docid IN ( %1$s ) AND current = 1 AND docs.doc_id = revs.doc_id " + " ORDER BY docs.doc_id ", DatabaseUtils.makePlaceholders(docIds.size())); String[] args = docIds.toArray(new String[docIds.size()]); List<DocumentRevision> docs = getRevisionsFromRawQuery(db,sql, args); return sortDocumentsAccordingToIdList(docIds, docs); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Failed to get documents with ids", e); throw new DocumentException("Failed to get documents with ids", e); } catch (ExecutionException e) { logger.log(Level.SEVERE, "Failed to get documents with ids", e); throw new DocumentException("Failed to get documents with ids", e); } }
Source:
public void validate(ValidationContext validationContext) { if (isEnabled()) { if (!validationContext.systemEnvironment().get(SystemEnvironment.INBUILT_LDAP_PASSWORD_AUTH_ENABLED)) { errors.add("base", "'ldap' tag has been deprecated in favour of bundled LDAP plugin. Use that instead."); } basesConfig.validateBases(); for (BaseConfig baseConfig : basesConfig) { baseConfig.validateBase(); } } }

Target:
public void validate(ValidationContext validationContext) { if (isEnabled()) { if (!validationContext.systemEnvironment().inbuiltLdapPasswordAuthEnabled()) { errors.add("base", "'ldap' tag has been deprecated in favour of bundled LDAP plugin. Use that instead."); return; } basesConfig.validateBases(); for (BaseConfig baseConfig : basesConfig) { baseConfig.validateBase(); } } }
Source:
public void testResponseIncluded() throws AuthenticationException, InvalidRequestException, APIException, APIConnectionException, CardException { String idempotencyKey = Long.toString(System.currentTimeMillis()); RequestOptions includeResponseRequestOptions = RequestOptions.builder() .setStripeVersion(Stripe.apiVersion) .setIdempotencyKey(idempotencyKey) .build(); Customer cus = Customer.create(defaultCustomerParams, includeResponseRequestOptions); cus = Customer.retrieve(cus.getId(), includeResponseRequestOptions); StripeResponse resp = cus.getLastResponse(); assertThat(resp, instanceOf(StripeResponse.class)); assertEquals(200, resp.code()); assertEquals(idempotencyKey, resp.idempotencyKey()); assertTrue(resp.requestId().startsWith("req_")); assertTrue(resp.body().length() > 0); }

Target:
public void testResponseIncluded() throws AuthenticationException, InvalidRequestException, APIException, APIConnectionException, CardException { String idempotencyKey = Long.toString(System.currentTimeMillis()); RequestOptions requestOptions = RequestOptions.builder() .setStripeVersion(Stripe.apiVersion) .setIdempotencyKey(idempotencyKey) .build(); Customer cus = Customer.create(defaultCustomerParams, requestOptions); cus = Customer.retrieve(cus.getId(), requestOptions); StripeResponse resp = cus.getLastResponse(); assertThat(resp, instanceOf(StripeResponse.class)); assertEquals(200, resp.code()); assertEquals(idempotencyKey, resp.idempotencyKey()); assertTrue(resp.requestId().startsWith("req_")); assertTrue(resp.body().length() > 0); }
Source:
public SymbolMetadata metadata() { return new SymbolMetadata() { @Override public List<SymbolMetadata.AnnotationValue> valuesForAnnotation(String fullyQualifiedNameOfAnnotation) { return null; } @Override public boolean isAnnotatedWith(String fullyQualifiedName) { return false; } @Override public List<SymbolMetadata.AnnotationInstance> annotations() { return Collections.emptyList(); } }; }

Target:
public SymbolMetadata metadata() { throw new UnsupportedOperationException(); }
Source:
public @NonNull ITmfStateValue getOngoingAggregatedState() { List<ITmfStateValue> potentialValues = getQuarkStream() .map(quark -> { try { return getStateSystem().queryOngoingState(quark.intValue()); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Bad aggregation rule"); } }) .collect(Collectors.toList()); for (ITmfStateValue value : potentialValues) { if (!value.isNull()) { return value; } } return TmfStateValue.nullValue(); }

Target:
public ITmfStateValue getOngoingAggregatedState() { Optional<ITmfStateValue> possibleValue = getQuarkStream() .map(quark -> { try { return getStateSystem().queryOngoingState(quark.intValue()); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Bad aggregation rule"); } }) .filter(value -> !value.isNull()) .findFirst(); return possibleValue.orElse(TmfStateValue.nullValue()); }
Source:
public void test() throws Exception { final AtomicReference<Object> payload = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); this.inbound.addInterceptor(new ChannelInterceptor() { @Override public Message<?> preSend(Message<?> message, MessageChannel channel) { payload.set(message.getPayload()); latch.countDown(); return message; } }); this.mqttOutFlow.getInputChannel().send(new GenericMessage<>("foo")); assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(payload.get()).isEqualTo("foo sent to MQTT, received from MQTT"); }

Target:
public void test() throws Exception { ArgumentCaptor<Message<?>> captor = messageArgumentCaptor(); MessageHandler mockMessageHandler = mockMessageHandler(captor).handleNext(m -> { }); this.mockIntegrationContext .substituteMessageHandlerFor( "mqttInFlow.org.springframework.integration.config.ConsumerEndpointFactoryBean#1", mockMessageHandler); this.mqttOutFlow.getInputChannel().send(new GenericMessage<>("foo")); verify(mockMessageHandler).handleMessage(any()); assertThat(captor.getValue().getPayload()) .isEqualTo("foo sent to MQTT, received from MQTT"); }
Source:
private boolean isGerrit() throws MalformedURLException, IOException { final String GERRIT_XSSI_MAGIC_STRING = ")]}\'\n"; if (uri.startsWith("https://") || uri.startsWith("http://")) { String u = uri; int protocolEnd = uri.indexOf("://") + 3; HttpURLConnection httpConnection = null; try { while (true) { InputStream in = null; try { httpConnection = (HttpURLConnection) new URL(u + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: int slash = u.lastIndexOf('/'); if (slash <= protocolEnd) { return false; } u = u.substring(0, u.lastIndexOf('/')); break; default: return false; } } finally { if (in != null) { in.close(); } } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } } } return false; }

Target:
private boolean isGerrit() throws MalformedURLException, IOException, URISyntaxException { if (uri.startsWith(ECLIPSE_GERRIT_SERVER)) { return true; } URIish u = new URIish(uri); String s = u.getScheme(); if (s.equals("http") || s.equals("https")) { String baseURL = uri.substring(0, uri.lastIndexOf(u.getPath())); String path = ""; HttpURLConnection httpConnection = null; try { while (true) { int slash = 1; InputStream in = null; try { httpConnection = (HttpURLConnection) new URL(baseURL + path + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: String p = u.getPath(); slash = p.indexOf('/', slash); if (slash == p.length()) { return false; } else if (slash == -1) { slash = p.length() - 1; } path = p.substring(0, slash); break; default: return false; } } finally { if (in != null) { in.close(); } } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } } } return false; }
Source:
public void equalsWithNullUserTest() throws ComponentLookupException { Collaborator c = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(c)); Assert.assertFalse(c.equals(null)); AccessLevel otherAccess = mock(AccessLevel.class); Collaborator other = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(other)); other = new DefaultCollaborator(null, otherAccess, this.helper); Assert.assertFalse(c.equals(other)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), this.access, this.helper); Assert.assertFalse(c.equals(other)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(c.equals("other")); }

Target:
public void equalsWithNullUserTest() throws ComponentLookupException { Collaborator c = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(c)); Assert.assertFalse(c.equals(null)); Collaborator other = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(other)); Assert.assertTrue(other.equals(c)); AccessLevel otherAccess = mock(AccessLevel.class); other = new DefaultCollaborator(null, otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), this.access, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); Assert.assertFalse(c.equals("other")); }
Source:
protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name) { if (name == null) { return getJsonSignatureValidator(); } return new JSONSignatureValidator(name); }

Target:
protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name) { if (name == null) { name = signatureValidatorPrefix + " '" + id + "'"; } return new JSONSignatureValidator(name); }
Source:
public static void main(String[] args) throws InterruptedException, ExecutionException { if (args.length != 4) { throw new IllegalArgumentException("Should accept 4 parameters: [mode], " + "[number of partitions], [number of instances], [number of records]"); } String mode = args[0]; int numPartitions = Integer.valueOf(args[1]); int numInstances = Integer.valueOf(args[2]); int numRecords = Integer.valueOf(args[3]); recreateTopics(numPartitions); CountDownLatch prePopulateLatch = new CountDownLatch(1); final boolean isAsync = false; final boolean enableIdempotency = true; Producer producerThread = new Producer(INPUT_TOPIC, isAsync, null, enableIdempotency, numRecords, prePopulateLatch); producerThread.start(); prePopulateLatch.await(5, TimeUnit.MINUTES); CountDownLatch transactionalCopyLatch = new CountDownLatch(numInstances); for (int instanceIdx = 0; instanceIdx < numInstances; instanceIdx++) { ExactlyOnceMessageProcessor messageProcessor = new ExactlyOnceMessageProcessor(mode, INPUT_TOPIC, OUTPUT_TOPIC, numPartitions, numInstances, instanceIdx, transactionalCopyLatch); messageProcessor.start(); } transactionalCopyLatch.await(5, TimeUnit.MINUTES); CountDownLatch consumeLatch = new CountDownLatch(1); Consumer consumerThread = new Consumer(OUTPUT_TOPIC, "Verify-consumer", true, numRecords, consumeLatch); consumerThread.start(); consumeLatch.await(5, TimeUnit.MINUTES); consumerThread.shutdown(); System.out.println("All finished!"); }

Target:
public static void main(String[] args) throws InterruptedException, ExecutionException { if (args.length != 4) { throw new IllegalArgumentException("Should accept 4 parameters: [mode], " + "[number of partitions], [number of instances], [number of records]"); } String mode = args[0]; int numPartitions = Integer.valueOf(args[1]); int numInstances = Integer.valueOf(args[2]); int numRecords = Integer.valueOf(args[3]); recreateTopics(numPartitions); CountDownLatch prePopulateLatch = new CountDownLatch(1); Producer producerThread = new Producer(INPUT_TOPIC, false, null, true, numRecords, prePopulateLatch); producerThread.start(); prePopulateLatch.await(5, TimeUnit.MINUTES); CountDownLatch transactionalCopyLatch = new CountDownLatch(numInstances); for (int instanceIdx = 0; instanceIdx < numInstances; instanceIdx++) { ExactlyOnceMessageProcessor messageProcessor = new ExactlyOnceMessageProcessor(mode, INPUT_TOPIC, OUTPUT_TOPIC, numPartitions, numInstances, instanceIdx, transactionalCopyLatch); messageProcessor.start(); } transactionalCopyLatch.await(5, TimeUnit.MINUTES); CountDownLatch consumeLatch = new CountDownLatch(1); Consumer consumerThread = new Consumer(OUTPUT_TOPIC, "Verify-consumer", true, numRecords, consumeLatch); consumerThread.start(); consumeLatch.await(5, TimeUnit.MINUTES); consumerThread.shutdown(); System.out.println("All finished!"); }
Source:
private void checkWalCanSync(ServerContext context) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironmentImpl(VolumeChooserEnvironment.ChooserScope.LOGGER, context); String logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.WAL_DIR; if (!fs.canSyncAndFlush(new Path(logPath))) { try { Thread.sleep(5000); } catch (Exception ignored) { } log.warn("WAL directory ({}) implementation does not support sync or flush." + " Data loss may occur.", logPath); } }

Target:
private void checkWalCanSync(ServerContext context) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironmentImpl(VolumeChooserEnvironment.ChooserScope.LOGGER, context); String logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.WAL_DIR; if (!fs.canSyncAndFlush(new Path(logPath))) { UtilWaitThread.sleep(5000); log.warn("WAL directory ({}) implementation does not support sync or flush." + " Data loss may occur.", logPath); } }
Source:
public void newNetwork() { if (getWindow() != null) { return; } final NetworkModel networkModel = new NewNetworkModel(this); setWindow(networkModel); networkModel.startProgress(null); initDcList(networkModel); }

Target:
public void newNetwork() { if (getWindow() != null) { return; } final NetworkModel networkModel = new NewNetworkModel(this); setWindow(networkModel); initDcList(networkModel); }
Source:
public OpaqueObjectsNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); worldRenderer = context.get(WorldRenderer.class); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); }

Target:
public OpaqueObjectsNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); worldRenderer = context.get(WorldRenderer.class); Camera playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); }
Source:
public static synchronized List<SingleThreadMonitor> getThreadMonitors(List<SingleThreadMonitor> output, boolean aliveThreadsOnly) { Preconditions.checkNotNull(output, "The parameter 'output' must not be null"); output.clear(); output.addAll(THREAD_INFO_BY_ID.values().stream().filter(entry -> !aliveThreadsOnly || entry.isAlive()).collect(Collectors.toList())); return output; }

Target:
public static synchronized List<SingleThreadMonitor> getThreadMonitors(List<SingleThreadMonitor> output, boolean aliveThreadsOnly) { Preconditions.checkNotNull(output, "The parameter 'output' must not be null"); output.clear(); for (SingleThreadMonitor entry : THREAD_INFO_BY_ID.values()) { if (!aliveThreadsOnly || entry.isAlive()) { output.add(entry); } } return output; }
Source:
public void registerKafkaConsumerMetrics(Consumer<?, ?> consumer, String clientId) { if (consumer == null || StringUtils.isBlank(clientId)) { _errorLogger.warn("Cannot register the Kafka consumer metrics, either the consumer is null or the client.id is blank"); return; } Supplier<Double> watermarkSpanSupplier = () -> getConsumerOffsetWatermarkSpanMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN, watermarkSpanSupplier); Supplier<Double> offsetResetSupplier = () -> getConsumerLiclosestDataLossEstimationMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION, offsetResetSupplier); _kafkaConsumerMetricsRegistered = true; }

Target:
public void registerKafkaConsumerMetrics(Consumer<?, ?> consumer, String clientId) { if (StringUtils.isBlank(clientId)) { _errorLogger.warn("Cannot register the Kafka consumer metrics, the client.id is blank"); return; } Supplier<Double> watermarkSpanSupplier = () -> getConsumerOffsetWatermarkSpanMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN, watermarkSpanSupplier); Supplier<Double> offsetResetSupplier = () -> getConsumerLiclosestDataLossEstimationMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION, offsetResetSupplier); }
Source:
public boolean onCreate() { mDatabaseAdapter = new DataBaseAdapter(getContext(), SharedData.getInstance()); return true; }

Target:
public boolean onCreate() { mDatabaseAdapter = new DataBaseAdapter(getContext()); return true; }
Source:
public <T> T evalExpression(String expression, Class<T> expectedType) throws ELException { ValueExpressionDetails veDetails = getValueExpressionDetails(expression, Boolean.class); return (T) veDetails.valueExpression.getValue(veDetails.context); }

Target:
public <T> T evalExpression(String expression, Class<T> expectedType) throws ELException { ExpressionDetails veDetails = getExpressionDetails(expression, Boolean.class); return (T) veDetails.valueExpression.getValue(veDetails.context); }