auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void validate() { if (!containsMacro("path")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Path cannot be empty."); } if (!containsMacro("nodePath")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(nodePath), "Node path cannot be empty."); } if (!containsMacro("temporaryFolder")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(temporaryFolder), "Temporary folder cannot be empty."); <START> } <END> boolean onlyOneActionRequired = !actionAfterProcess.equalsIgnoreCase("NONE") && isReprocessingRequired(); Preconditions.checkArgument(!onlyOneActionRequired, "Please select either 'After Processing Action' or " + "'Reprocessing Required'; both cannot be applied at the same time."); boolean targetFolderEmpty = (actionAfterProcess.equalsIgnoreCase("ARCHIVE") || actionAfterProcess.equalsIgnoreCase("MOVE")) && Strings.isNullOrEmpty(targetFolder); Preconditions.checkArgument(!targetFolderEmpty, "Target folder cannot be empty for Action = '" + actionAfterProcess + "'."); }</code><technical_language>add a check verify tableExpiryPeriod is > 0 if is null a macro</technical_language>

Target:
void validate() { if (!containsMacro("path")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Path cannot be empty."); } if (!containsMacro("nodePath")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(nodePath), "Node path cannot be empty."); } if (!containsMacro("tableExpiryPeriod") && tableExpiryPeriod != null && tableExpiryPeriod < 0) { throw new IllegalArgumentException("Value for Table expiry period should either be empty or greater than 0."); } if (!containsMacro("temporaryFolder")) { Preconditions.checkArgument(!Strings.isNullOrEmpty(temporaryFolder), "Temporary folder cannot be empty."); } boolean onlyOneActionRequired = !actionAfterProcess.equalsIgnoreCase("NONE") && isReprocessingRequired(); Preconditions.checkArgument(!onlyOneActionRequired, "Please select either 'After Processing Action' or " + "'Reprocessing Required'; both cannot be applied at the same time."); boolean targetFolderEmpty = (actionAfterProcess.equalsIgnoreCase("ARCHIVE") || actionAfterProcess.equalsIgnoreCase("MOVE")) && Strings.isNullOrEmpty(targetFolder); Preconditions.checkArgument(!targetFolderEmpty, "Target folder cannot be empty for Action = '" + actionAfterProcess + "'."); }
Source:
<code>public Optional<String> getItemData(ItemStack item) { <START> if (item.getItemMeta() == null) { <END> return Optional.empty(); } return getItemData(item.getItemMeta()); }</code><technical_language>do .hasItemMeta() (and add a null-check for ItemStack parameter pointed out before), gain performance benefit this here, #getItemMeta() (for normal ItemStacks) create a new instance of ItemMeta perform a clone operation is costly. Walshy pointed out, for ItemStackWrappers this throw UnsupportedOperationException now..</technical_language>

Target:
public Optional<String> getItemData(ItemStack item) { if (item == null || !item.hasItemMeta()) { return Optional.empty(); } return getItemData(item.getItemMeta()); }
Source:
<code>protected boolean shouldWrapLines() { return !(FileUtils.isMarkdown(mPath) && !mViewRawText) && super.shouldWrapLines(); <START> } <END></code><technical_language>boolean displayingMarkdown = FileUtils.isMarkdown(mPath) && !mViewRawText; return !displayingMarkdown && super.shouldWrapLines();</technical_language>

Target:
protected boolean shouldWrapLines() { boolean displayingMarkdown = FileUtils.isMarkdown(mPath) && !mViewRawText; return !displayingMarkdown && super.shouldWrapLines(); }
Source:
<code>void handleResponse(ResponseInfo responseInfo) { GetRequest getRequest = (GetRequest) responseInfo.getRequest(); GetOperation getOperation = correlationIdToGetOperation.remove(getRequest.getCorrelationId()); if (getOperations.contains(getOperation)) { getOperation.handleResponse(responseInfo); if (getOperation.isOperationComplete()) { getOperations.remove(getOperation); <START> routerMetrics.operationDequeuingRate.mark(); <END> } } }</code><technical_language>is double count if close() removed operation already</technical_language>

Target:
void handleResponse(ResponseInfo responseInfo) { GetRequest getRequest = (GetRequest) responseInfo.getRequest(); GetOperation getOperation = correlationIdToGetOperation.remove(getRequest.getCorrelationId()); if (getOperations.contains(getOperation)) { getOperation.handleResponse(responseInfo); if (getOperation.isOperationComplete()) { remove(getOperation); } } }
Source:
<code>public Iterator<E> iterator(){ <START> return new ArrayList<E>(backingList).iterator(); <END> }</code><technical_language>copy</technical_language>

Target:
public Iterator<E> iterator(){ return list.iterator(); }
Source:
<code>protected void initBaseTestConfig( CoreServerFixture fixture ) throws IOException { writeConfigFile( "conf.d/storage.conf", "[storage-default]\nstorage.dir=" + fixture.getBootOptions().getHomeDir() + "/var/lib/indy/storage" ); if ( isSchedulerEnabled() ) { writeConfigFile( "conf.d/scheduler.conf", readTestResource( "default-test-scheduler.conf" ) ); writeConfigFile( "conf.d/threadpools.conf", "[threadpools]\nenabled=false" ); <START> writeConfigFile( "conf.d/ssl_validation.conf", "[ssl_validation]\n_internal.store.validation.enabled=false" ); <END> } else { writeConfigFile( "conf.d/scheduler.conf", "[scheduler]\nenabled=false" ); } }</code><technical_language>If rename internal feature flag stuff, this need renamed too</technical_language>

Target:
protected void initBaseTestConfig( CoreServerFixture fixture ) throws IOException { writeConfigFile( "conf.d/storage.conf", "[storage-default]\nstorage.dir=" + fixture.getBootOptions().getHomeDir() + "/var/lib/indy/storage" ); if ( isSchedulerEnabled() ) { writeConfigFile( "conf.d/scheduler.conf", readTestResource( "default-test-scheduler.conf" ) ); writeConfigFile( "conf.d/threadpools.conf", "[threadpools]\nenabled=false" ); writeConfigFile( "conf.d/internal_validation.conf", "[internal]\n_internal.store.validation.enabled=false" ); } else { writeConfigFile( "conf.d/scheduler.conf", "[scheduler]\nenabled=false" ); } }
Source:
<code>public void ensureValid(String name, Object value) { <START> String strValue = (String) value; if (strValue.isEmpty()) { return; } <END> String[] configs = StringUtil.csvSplit(strValue); Arrays.stream(configs).forEach(config -> validateHttpResponseHeaderConfig(config)); }</code><technical_language>add this bit in this method: suggestion String strValue = (String) value; if (value == null || strValue.trim().isEmpty()) { return; }</technical_language>

Target:
public void ensureValid(String name, Object value) { String strValue = (String) value; if (strValue == null || strValue.trim().isEmpty()) { return; } String[] configs = StringUtil.csvSplit(strValue); Arrays.stream(configs).forEach(WorkerConfig::validateHttpResponseHeaderConfig); }
Source:
<code>public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; <START> if (isRequestUrlExcluded(request)) { <END> logger.debug("Request is ignored."); filterChain.doFilter(request, response); return; } if (!preFilter(servletRequest, servletResponse, filterChain)) { return; } final String ticket = retrieveTicketFromRequest(request); if (CommonUtils.isNotBlank(ticket)) { logger.debug("Attempting to validate ticket: {}", ticket); try { final Assertion assertion = this.ticketValidator.validate(ticket, constructServiceUrl(request, response)); logger.debug("Successfully authenticated user: {}", assertion.getPrincipal().getName()); request.setAttribute(CONST_CAS_ASSERTION, assertion); if (this.useSession) { request.getSession().setAttribute(CONST_CAS_ASSERTION, assertion); } onSuccessfulValidation(request, response, assertion); if (this.redirectAfterValidation) { logger.debug("Redirecting after successful ticket validation."); response.sendRedirect(constructServiceUrl(request, response)); return; } } catch (final TicketValidationException e) { logger.debug(e.getMessage(), e); onFailedValidation(request, response); if (this.exceptionOnValidationFailure) { throw new ServletException(e); } response.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage()); return; } } filterChain.doFilter(request, response); }</code><technical_language>this is duplicated logic abstracted a common workflow. Otherwise, repeated time needed</technical_language>

Target:
public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { if (!preFilter(servletRequest, servletResponse, filterChain)) { return; } final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; final String ticket = retrieveTicketFromRequest(request); if (CommonUtils.isNotBlank(ticket)) { logger.debug("Attempting to validate ticket: {}", ticket); try { final Assertion assertion = this.ticketValidator.validate(ticket, constructServiceUrl(request, response)); logger.debug("Successfully authenticated user: {}", assertion.getPrincipal().getName()); request.setAttribute(CONST_CAS_ASSERTION, assertion); if (this.useSession) { request.getSession().setAttribute(CONST_CAS_ASSERTION, assertion); } onSuccessfulValidation(request, response, assertion); if (this.redirectAfterValidation) { logger.debug("Redirecting after successful ticket validation."); response.sendRedirect(constructServiceUrl(request, response)); return; } } catch (final TicketValidationException e) { logger.debug(e.getMessage(), e); onFailedValidation(request, response); if (this.exceptionOnValidationFailure) { throw new ServletException(e); } response.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage()); return; } } filterChain.doFilter(request, response); }
Source:
<code>public SqlInputSource( @JsonProperty("sqls") List<String> sqls, @JsonProperty("foldCase") boolean foldCase, @JsonProperty("database") SQLFirehoseDatabaseConnector sqlFirehoseDatabaseConnector, @JacksonInject @Smile ObjectMapper objectMapper ) { <START> Preconditions.checkArgument(sqls.size() > 0, "No SQL queries provided"); <END> this.sqls = sqls; this.foldCase = foldCase; this.sqlFirehoseDatabaseConnector = sqlFirehoseDatabaseConnector; this.objectMapper = objectMapper; }</code><technical_language>Do need null checks json provided fields? is handled some annotation seeing? is default boolean if foldCase is specified</technical_language>

Target:
public SqlInputSource( @JsonProperty("sqls") List<String> sqls, @JsonProperty("foldCase") boolean foldCase, @JsonProperty("database") SQLFirehoseDatabaseConnector sqlFirehoseDatabaseConnector, @JacksonInject @Smile ObjectMapper objectMapper ) { Preconditions.checkArgument(sqls.size() > 0, "No SQL queries provided"); this.sqls = sqls; this.foldCase = foldCase; this.sqlFirehoseDatabaseConnector = Preconditions.checkNotNull( sqlFirehoseDatabaseConnector, "SQL Metadata Connector not configured!" ); this.objectMapper = objectMapper; }
Source:
<code>public void process(EquivalenceAssertionMessage message) throws RecoverableException { LOG.debug( "Processing message on id {}, asserted adjacents: {}, message: {}", message.getSubject().getId(), <START> message.getAssertedAdjacents().stream() <END> .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); try { if (messageTimer != null) { Timer.Context timer = messageTimer.time(); graphStore.updateEquivalences(message.getSubject(), message.getAssertedAdjacents(), message.getPublishers()); equivMigrator.migrateEquivalence(message.getSubject()); timer.stop(); } else { graphStore.updateEquivalences(message.getSubject(), message.getAssertedAdjacents(), message.getPublishers()); equivMigrator.migrateEquivalence(message.getSubject()); } LOG.debug("Successfully processed message {}", message.toString()); } catch (WriteException e) { LOG.warn( "Failed to process message on id {}, asserted adjacents: {}, message: {}. " + "Retrying...", message.getSubject().getId(), message.getAssertedAdjacents().stream() .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); throw new RecoverableException("update failed for " + message.toString(), e); } catch (Exception e) { LOG.warn( "Failed to process message on id {}, asserted adjacents: {}, message: {}", message.getSubject().getId(), message.getAssertedAdjacents().stream() .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); if (meter != null) { meter.mark(); } } }</code><technical_language>This evaluated message warrant this a if (LOG.isDebugEnabled()) block</technical_language>

Target:
public void process(EquivalenceAssertionMessage message) throws RecoverableException { if (LOG.isDebugEnabled()) { LOG.debug( "Processing message on id {}, asserted adjacents: {}, message: {}", message.getSubject().getId(), message.getAssertedAdjacents().stream() .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); } try { if (messageTimer != null) { Timer.Context timer = messageTimer.time(); graphStore.updateEquivalences(message.getSubject(), message.getAssertedAdjacents(), message.getPublishers()); equivMigrator.migrateEquivalence(message.getSubject()); timer.stop(); } else { graphStore.updateEquivalences(message.getSubject(), message.getAssertedAdjacents(), message.getPublishers()); equivMigrator.migrateEquivalence(message.getSubject()); } LOG.debug("Successfully processed message {}", message.toString()); } catch (WriteException e) { LOG.warn( "Failed to process message on id {}, asserted adjacents: {}, message: {}. " + "Retrying...", message.getSubject().getId(), message.getAssertedAdjacents().stream() .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); throw new RecoverableException("update failed for " + message.toString(), e); } catch (Exception e) { LOG.warn( "Failed to process message on id {}, asserted adjacents: {}, message: {}", message.getSubject().getId(), message.getAssertedAdjacents().stream() .map(ResourceRef::getId) .collect(ImmutableCollectors.toList()), message ); if (meter != null) { meter.mark(); } } }
Source:
<code>public List<BuildTimeOutStrategyDescriptor> getStrategies() { <START> return Jenkins.getInstance().getDescriptorList(BuildTimeOutStrategy.class); <END> }</code><technical_language>apply TimeOutStrategy#isApplicableAsBuildStep here</technical_language>

Target:
public List<BuildTimeOutStrategyDescriptor> getStrategies() { List<BuildTimeOutStrategyDescriptor> descriptors = Jenkins.getInstance().getDescriptorList(BuildTimeOutStrategy.class); List<BuildTimeOutStrategyDescriptor> supportedStrategies = new ArrayList<BuildTimeOutStrategyDescriptor>(descriptors.size()); for(BuildTimeOutStrategyDescriptor descriptor : descriptors) { if (descriptor.isApplicableAsBuildStep()) { supportedStrategies.add(descriptor); } } return supportedStrategies; }
Source:
<code>public Host getCurrentHost() throws DotDataException, DotSecurityException { final HttpServletRequest request = HttpServletRequestThreadLocal.INSTANCE.getRequest(); <START> return this.getCurrentHost(request); <END> }</code><technical_language>Do handle case request is null</technical_language>

Target:
public Host getCurrentHost() throws DotDataException, DotSecurityException { final HttpServletRequest request = HttpServletRequestThreadLocal.INSTANCE.getRequest(); if (request == null) { return APILocator.getHostAPI().findDefaultHost(APILocator.systemUser(), true); } return this.getCurrentHost(request); }
Source:
<code>protected Cluster postPopulate(Cluster model) { ErrorHandling errorHandling = new ErrorHandling(); errorHandling.setOnError(MappingTestHelper.shuffle(MigrateOnError.class).value()); model.setErrorHandling(errorHandling); SchedulingPolicy policy = new SchedulingPolicy(); policy.setPolicy(NONE); FencingPolicy fencingPolicy = new FencingPolicy(); SkipIfSDActive skipIfSDActive = new SkipIfSDActive(); SkipIfConnectivityBroken skipIfConnectivityBroken = new SkipIfConnectivityBroken(); skipIfSDActive.setEnabled(false); skipIfConnectivityBroken.setEnabled(false); skipIfConnectivityBroken.setThreshold(50); fencingPolicy.setEnabled(true); fencingPolicy.setSkipIfSdActive(skipIfSDActive); <START> fencingPolicy.setSkipIfConnectivityBroken(skipIfConnectivityBroken); <END> model.setSchedulingPolicy(policy); model.getSerialNumber().setPolicy(SerialNumberPolicy.CUSTOM.value()); model.getRequiredRngSources().getRngSources().clear(); model.getRequiredRngSources().getRngSources().add(RngSource.RANDOM.name()); model.getSchedulingPolicy().setPolicy(NONE); model.getSchedulingPolicy().setName(NONE); model.setFencingPolicy(fencingPolicy); return model; }</code><technical_language>This needed. testing infrastructure populate fields randomly automatically. This kind of explicit assignment is needed enums assign, random values ok</technical_language>

Target:
protected Cluster postPopulate(Cluster model) { ErrorHandling errorHandling = new ErrorHandling(); errorHandling.setOnError(MappingTestHelper.shuffle(MigrateOnError.class).value()); model.setErrorHandling(errorHandling); SchedulingPolicy policy = new SchedulingPolicy(); policy.setPolicy(NONE); model.setSchedulingPolicy(policy); model.getSerialNumber().setPolicy(SerialNumberPolicy.CUSTOM.value()); model.getRequiredRngSources().getRngSources().clear(); model.getRequiredRngSources().getRngSources().add(RngSource.RANDOM.name()); model.getSchedulingPolicy().setPolicy(NONE); model.getSchedulingPolicy().setName(NONE); return model; }
Source:
<code>public void nextPreviewStyle() { for (Tab tab : this.entryEditorTabs) { if (tab instanceof FieldsEditorTab) { <START> ((FieldsEditorTab) tab).previewPanel.nextPreviewStyle(); <END> } } }</code><technical_language>I add next/previousPreviewStyle EntryEditorTab override properly in FieldsEditorTab . In this way, a bit more flexible in future (e.g. if other tabs previews embedded) previewPanel private (at private)</technical_language>

Target:
public void nextPreviewStyle() { this.entryEditorTabs.forEach(EntryEditorTab::nextPreviewStyle); }
Source:
<code>public Set<Type> getImportTypes() { Set<Type> imported = new HashSet<Type>( super.getImportTypes() ); if ( isDirectAssignment() ) { if ( targetType.getImplementationType() != null ) { imported.addAll( targetType.getImplementationType().getImportTypes() ); } else { imported.addAll( targetType.getImportTypes() ); } if ( isEnumSet() ) { imported.add( typeFactory.getType( EnumSet.class ) ); } } if (isDirectAssignment() || getSourcePresenceCheckerReference() == null ) { imported.addAll( getNullCheckLocalVarType().getImportTypes() ); } if ( isMapNullToDefault() ) { <START> imported.add( targetType.getImplementationType() ); <END> } return imported; }</code><technical_language>In line 52 is a check if targetType.getImplementationType() is null - case this point is null? In this case need check prevent adding null this Set</technical_language>

Target:
public Set<Type> getImportTypes() { Set<Type> imported = new HashSet<Type>( super.getImportTypes() ); if ( isDirectAssignment() ) { if ( targetType.getImplementationType() != null ) { imported.addAll( targetType.getImplementationType().getImportTypes() ); } else { imported.addAll( targetType.getImportTypes() ); } if ( isEnumSet() ) { imported.add( typeFactory.getType( EnumSet.class ) ); } } if (isDirectAssignment() || getSourcePresenceCheckerReference() == null ) { imported.addAll( getNullCheckLocalVarType().getImportTypes() ); } if ( isMapNullToDefault() && ( targetType.getImplementationType() != null ) ) { imported.add( targetType.getImplementationType() ); } return imported; }
Source:
<code>public ArrayList<Sprite> getSprites(double steps) { SpriteStore store = SpriteStore.getInstance(); String id = "fruit"; ArrayList<Sprite> result = new ArrayList<Sprite>(); <START> result.add(store.getAnimated(id).getFrame(posX())); <END> return result; }</code><technical_language>"fruit" .getAnimated(id) save line of code, is is necessary. <review</technical_language>

Target:
public ArrayList<Sprite> getSprites(double steps) { SpriteStore store = SpriteStore.getInstance(); ArrayList<Sprite> result = new ArrayList<Sprite>(); result.add(store.getAnimated("fruit").getFrame(posX())); return result; }
Source:
<code>public void patchPasswordMissingValue() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/password", null); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isBadRequest()); <START> } <END></code><technical_language>need more test verify that: - single replace operation fails for anonymous administrator users - multiple valid replace operations in requests succeed - multiple replace operations is invalid fails changes (including required valid operations)</technical_language>

Target:
public void patchPasswordMissingValue() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .withPassword("testpass79bC") .build(); String token = getAuthToken(admin.getEmail(), password); String newPassword = "newpass"; List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/password", newPassword); ops.add(replaceOperation); String patchBody = getPatchContent(ops); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()); List<Operation> ops2 = new ArrayList<Operation>(); ReplaceOperation replaceOperation2 = new ReplaceOperation("/password", null); ops2.add(replaceOperation2); patchBody = getPatchContent(ops2); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isBadRequest()); token = getAuthToken(ePerson.getEmail(), newPassword); getClient(token).perform(get("/api/")) .andExpect(status().isOk()); }
Source:
<code>public int getSourceAnchorVerticalPosition() { IdentityAnchor srcAnchor = null; Anchor sourceAnchor = edge.getSourceAnchor(); if (sourceAnchor instanceof IdentityAnchor) { srcAnchor = (IdentityAnchor) sourceAnchor; } else <START> if (sourceAnchor.eIsProxy()) { <END> SequenceDiagramPlugin.INSTANCE.log(MessageFormat.format(Messages.ProxyAnchor_Source, ((DEdge) edge.getElement()).getName())); } View source = edge.getSource(); Range sourceRange = new Range(0, 0); if (source instanceof Node) { sourceRange = new SequenceNodeQuery((Node) source).getVerticalRange(); } return getAnchorAbsolutePosition(srcAnchor, sourceRange); }</code><technical_language>this tested instanceof? I CDO *currently* support proxies enough instantiate correct EClasses, safer test for eIsProxy()</technical_language>

Target:
public int getSourceAnchorVerticalPosition() { IdentityAnchor srcAnchor = null; Anchor sourceAnchor = edge.getSourceAnchor(); if (sourceAnchor instanceof IdentityAnchor) { srcAnchor = (IdentityAnchor) sourceAnchor; } View source = edge.getSource(); Range sourceRange = new Range(0, 0); if (source instanceof Node) { sourceRange = new SequenceNodeQuery((Node) source).getVerticalRange(); } return getAnchorAbsolutePosition(srcAnchor, sourceRange); }
Source:
<code>PendingIntent createContentIntent(Context context, Account account, boolean incoming) { Intent editServerSettingsIntent = incoming ? <START> IncomingView.intentActionEditIncomingSettings(context, account) : <END> OutgoingView.intentActionEditOutgoingSettings(context, account); return PendingIntent.getActivity(context, account.getAccountNumber(), editServerSettingsIntent, PendingIntent.FLAG_UPDATE_CURRENT); }</code><technical_language>a activity presenter view structures. in experience messy faster introducing a secondary start activity</technical_language>

Target:
PendingIntent createContentIntent(Context context, Account account, boolean incoming) { Intent editServerSettingsIntent = incoming ? AccountSetupActivity.intentActionEditIncomingSettings(context, account) : AccountSetupActivity.intentActionEditOutgoingSettings(context, account); return PendingIntent.getActivity(context, account.getAccountNumber(), editServerSettingsIntent, PendingIntent.FLAG_UPDATE_CURRENT); }
Source:
<code>public void testLockingLocks() throws Exception { Lock lock = new ReentrantLock(); int threads = 10; CyclicBarrier barrier = new CyclicBarrier(threads); AtomicInteger underLock = new AtomicInteger(0); AtomicInteger maxUnderLock = new AtomicInteger(0); List<Future<?>> futures = IntStream.range(0, threads) .mapToObj(i -> executor.submit(() -> { barrier.await(); locking(lock, () -> { maxUnderLock.accumulateAndGet(underLock.incrementAndGet(), Integer::max); Thread.sleep(30); underLock.decrementAndGet(); }); return null; })) .collect(toImmutableList()); <START> futures.forEach(MoreFutures::getFutureValue); <END> }</code><technical_language>This test missing assertion</technical_language>

Target:
public void testLockingLocks() throws Exception { Lock lock = new ReentrantLock(); int threads = 10; CyclicBarrier barrier = new CyclicBarrier(threads); AtomicInteger underLock = new AtomicInteger(0); AtomicInteger maxUnderLock = new AtomicInteger(0); List<Future<?>> futures = IntStream.range(0, threads) .mapToObj(i -> executor.submit(() -> { barrier.await(); locking(lock, () -> { maxUnderLock.accumulateAndGet(underLock.incrementAndGet(), Integer::max); Thread.sleep(30); underLock.decrementAndGet(); }); return null; })) .collect(toImmutableList()); futures.forEach(MoreFutures::getFutureValue); assertEquals(maxUnderLock.get(), 1, "More than one thread acquired the lock at the same time"); }
Source:
<code>private void checkLog(Log log, long expectedSegmentCapacity, List<String> expectedSegmentNames) throws IOException { LogSegment nextSegment = log.getFirstSegment(); assertNull("Prev segment should be null", log.getPrevSegment(nextSegment)); for (String segmentName : expectedSegmentNames) { assertEquals("Next segment is not as expected", segmentName, nextSegment.getName()); LogSegment segment = log.getSegment(segmentName); assertEquals("Segment name is not as expected", segmentName, segment.getName()); assertEquals("Segment capacity not as expected", expectedSegmentCapacity, segment.getCapacityInBytes()); assertEquals("Segment returned by getSegment() is incorrect", segment, log.getSegment(segment.getName())); nextSegment = log.getNextSegment(segment); if (nextSegment != null) { assertEquals("Prev segment not as expected", segment, log.getPrevSegment(nextSegment)); } } assertNull("Next segment should be null", nextSegment); <START> assertEquals("Unexpected result for isLogSegment", log.getCapacityInBytes() != expectedSegmentCapacity, <END> log.isLogSegmented()); long expectedSegmentsNeeded = (log.getCapacityInBytes() / expectedSegmentCapacity) - expectedSegmentNames.size(); assertEquals("DiskSpaceRequirements has wrong number of unallocated segments", expectedSegmentsNeeded, log.getRemainingUnallocatedSegments()); }</code><technical_language>isLogSegmented()</technical_language>

Target:
private void checkLog(Log log, long expectedSegmentCapacity, List<String> expectedSegmentNames) throws IOException { LogSegment nextSegment = log.getFirstSegment(); assertNull("Prev segment should be null", log.getPrevSegment(nextSegment)); for (String segmentName : expectedSegmentNames) { assertEquals("Next segment is not as expected - expectedSegmentNames=" + expectedSegmentNames, segmentName, nextSegment.getName()); LogSegment segment = log.getSegment(segmentName); assertEquals("Segment name is not as expected - expectedSegmentNames=" + expectedSegmentNames, segmentName, segment.getName()); assertEquals("Segment capacity not as expected", expectedSegmentCapacity, segment.getCapacityInBytes()); assertEquals("Segment returned by getSegment() is incorrect", segment, log.getSegment(segment.getName())); nextSegment = log.getNextSegment(segment); if (nextSegment != null) { assertEquals("Prev segment not as expected - expectedSegmentNames=" + expectedSegmentNames, segment, log.getPrevSegment(nextSegment)); } } assertNull( "Next segment should be null - expectedSegmentNames=" + expectedSegmentNames + ", nextSegment=" + nextSegment, nextSegment); assertEquals("Unexpected result for isLogSegmented()", log.getCapacityInBytes() != expectedSegmentCapacity, log.isLogSegmented()); long expectedUnallocatedSegments = (log.getCapacityInBytes() / expectedSegmentCapacity) - expectedSegmentNames.size(); assertEquals("DiskSpaceRequirements has wrong number of unallocated segments", expectedUnallocatedSegments, log.getRemainingUnallocatedSegments()); }
Source:
<code>private void getMapObject(String parentName, MapObjectInspector mapObjectInspector, Object mapObject, Map<String, Object> parsedMap) { if (mapObjectInspector.getMapSize(mapObject) < 0) { return; } String prefix = parentName + "_"; Map objectMap = mapObjectInspector.getMap(mapObject); PrimitiveObjectInspector key = (PrimitiveObjectInspector) mapObjectInspector.getMapKeyObjectInspector(); PrimitiveObjectInspector value = (PrimitiveObjectInspector) mapObjectInspector.getMapValueObjectInspector(); <START> for (Iterator itr = objectMap.entrySet().iterator(); itr.hasNext(); ) { <END> Map.Entry it = (Map.Entry) itr.next(); parsedMap.put(prefix + key.getPrimitiveJavaObject(it.getKey()).toString(), value.getPrimitiveJavaObject(it.getValue())); } }</code><technical_language>a TeamCity inspection error here: extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc OrcHadoopInputRowParser.java (1) 150: getMapObject() for loop replaceable 'foreach'</technical_language>

Target:
private void getMapObject(String parentName, MapObjectInspector mapObjectInspector, Object mapObject, Map<String, Object> parsedMap) { if (mapObjectInspector.getMapSize(mapObject) < 0) { return; } String mapChildFieldNameFormat = StringUtils.format(mapParentFieldNameFormat, parentName).replace(MAP_CHILD_TAG, "%s"); Map objectMap = mapObjectInspector.getMap(mapObject); PrimitiveObjectInspector key = (PrimitiveObjectInspector) mapObjectInspector.getMapKeyObjectInspector(); PrimitiveObjectInspector value = (PrimitiveObjectInspector) mapObjectInspector.getMapValueObjectInspector(); objectMap.forEach((k, v) -> { String resolvedFieldName = StringUtils.format(mapChildFieldNameFormat, key.getPrimitiveJavaObject(k).toString()); parsedMap.put(resolvedFieldName, value.getPrimitiveJavaObject(v)); }); }
Source:
<code>private synchronized void replaceIfNecessary(Throwable thrown) { if (shouldReplace.test(thrown)) { <START> log.info("Replacing underlying proxy due to thrown exception", thrown); <END> delegate = delegateFactory.get(); } }</code><technical_language>Putting log line basically print for request fails this, shouldReplace true for of them. need put in supplier remove it. for confusing</technical_language>

Target:
private void replaceIfNecessary(Throwable thrown) { if (shouldReplace.test(thrown)) { synchronized (this) { T replacement = delegateFactory.get(); if (delegate != replacement) { log.info("Replacing underlying proxy due to thrown exception", thrown); delegate = delegateFactory.get(); } } } }
Source:
<code>protected void acquire(TransactionLocks locks) throws IOException { if (locks.containsLock(Type.NameNodeLease)) { NameNodeLeaseLock nameNodeLeaseLock = (NameNodeLeaseLock) locks.getLock(Type.NameNodeLease); if (nameNodeLeaseLock.getNameNodeLease() != null) { acquireLeasePaths(nameNodeLeaseLock.getNameNodeLease()); } } LeaseLock leaseLock = (LeaseLock) locks.getLock(Type.Lease); for (Lease lease : leaseLock.getLeases()) { acquireLeasePaths(lease); } Lease singleFileLease = leaseLock.getSingleFileLease(); if (singleFileLease != null){ <START> setLockMode(lockType); LeasePath leasePath = acquireLock(lockType, LeasePath.Finder.ByPath, leaseLock.getSingleFileLock()); if(leasePath != null){ <END> leasePaths.add(leasePath); } } if(src != null && !src.equals("")){ acquireAllLeasePathsForDir(src); } if (leasePaths.size() > expectedCount) { } }</code><technical_language>do of this in acquire function do for other cases, easier read</technical_language>

Target:
protected void acquire(TransactionLocks locks) throws IOException { if (locks.containsLock(Type.NameNodeLease)) { NameNodeLeaseLock nameNodeLeaseLock = (NameNodeLeaseLock) locks.getLock(Type.NameNodeLease); if (nameNodeLeaseLock.getNameNodeLease() != null) { acquireLeasePaths(nameNodeLeaseLock.getNameNodeLease()); } } LeaseLock leaseLock = (LeaseLock) locks.getLock(Type.Lease); LeaseHolderResolveType resolveType = leaseLock.getResolveType(); for (Lease lease : leaseLock.getLeases()) { if(resolveType == LeaseHolderResolveType.SINGLE_PATH ) { acquireLeasePath(lease, leaseLock.getSingleFileLock()); } else { assert resolveType == LeaseHolderResolveType.ALL_PATHS; acquireLeasePaths(lease); } } if(src != null && !src.equals("")){ acquireAllLeasePathsForDir(src); } if (leasePaths.size() > expectedCount) { } }
Source:
<code>public Mono<Void> updateCheckpointAsync(EventData eventData) { <START> Objects.requireNonNull(eventData, "'eventData' cannot be null"); <END> Checkpoint checkpoint = new Checkpoint() .setConsumerGroup(partitionContext.getConsumerGroup()) .setEventHubName(partitionContext.getEventHubName()) .setPartitionId(partitionContext.getPartitionId()) .setSequenceNumber(eventData.getSequenceNumber()) .setOffset(eventData.getOffset()); return this.checkpointStore.updateCheckpoint(checkpoint); }</code><technical_language>missing @throws. iirc, this monoError</technical_language>

Target:
public Mono<Void> updateCheckpointAsync(EventData eventData) { if (eventData == null) { return monoError(logger, new NullPointerException("'eventData' cannot be null")); } Checkpoint checkpoint = new Checkpoint() .setConsumerGroup(partitionContext.getConsumerGroup()) .setEventHubName(partitionContext.getEventHubName()) .setPartitionId(partitionContext.getPartitionId()) .setSequenceNumber(eventData.getSequenceNumber()) .setOffset(eventData.getOffset()); return this.checkpointStore.updateCheckpoint(checkpoint); }
Source:
<code>public void reportEvents() { if ( pins > 0 ) { pageCacheTracer.pins( pins ); } if ( unpins > 0 ) { pageCacheTracer.unpins( unpins ); } if ( hits > 0 ) { pageCacheTracer.hits( hits ); historicalHits = Math.addExact( historicalHits, hits ); } if ( faults > 0 ) { pageCacheTracer.faults( faults ); <START> historicalFaults = Math.addExact( historicalFaults, faults ); <END> } if ( bytesRead > 0 ) { pageCacheTracer.bytesRead( bytesRead ); } if ( evictions > 0 ) { pageCacheTracer.evictions( evictions ); } if ( evictionExceptions > 0 ) { pageCacheTracer.evictionExceptions( evictionExceptions ); } if ( bytesWritten > 0 ) { pageCacheTracer.bytesWritten( bytesWritten ); } if ( flushes > 0 ) { pageCacheTracer.flushes( flushes ); } reset(); }</code><technical_language>Is throw exception overflow in cases</technical_language>

Target:
public void reportEvents() { if ( pins > 0 ) { pageCacheTracer.pins( pins ); } if ( unpins > 0 ) { pageCacheTracer.unpins( unpins ); } if ( hits > 0 ) { pageCacheTracer.hits( hits ); historicalHits = historicalHits + hits; } if ( faults > 0 ) { pageCacheTracer.faults( faults ); historicalFaults = historicalFaults + faults; } if ( bytesRead > 0 ) { pageCacheTracer.bytesRead( bytesRead ); } if ( evictions > 0 ) { pageCacheTracer.evictions( evictions ); } if ( evictionExceptions > 0 ) { pageCacheTracer.evictionExceptions( evictionExceptions ); } if ( bytesWritten > 0 ) { pageCacheTracer.bytesWritten( bytesWritten ); } if ( flushes > 0 ) { pageCacheTracer.flushes( flushes ); } reset(); }
Source:
<code>private boolean isPrimaryKey(RelationInfo relationInfo) { <START> return relationInfo != null && (relationInfo.primaryKey().size() > 1 || (relationInfo.primaryKey().size() == 1 && !relationInfo.primaryKey().get(0).name().equals("_id"))); <END> }</code><technical_language>suggestion return relationInfo.primaryKey().size() > 1 || (relationInfo.primaryKey().size() == 1 && !relationInfo.primaryKey().get(0).name().equals("_id")); I null RelationInfo entries</technical_language>

Target:
private boolean isPrimaryKey(RelationInfo relationInfo) { return (relationInfo.primaryKey().size() > 1 || (relationInfo.primaryKey().size() == 1 && !relationInfo.primaryKey().get(0).name().equals("_id"))); }
Source:
<code>public MemoryInfo getMemoryInfo() { <START> taskManager.updateMemoryPoolAssignments(new MemoryPoolAssignmentsRequest("", 0, new ArrayList<>())); <END> return memoryManager.getInfo(); }</code><technical_language>this call do? I read code this do request is empty</technical_language>

Target:
public MemoryInfo getMemoryInfo() { return memoryManager.getInfo(); }
Source:
<code>public String getOvnCentralByClusterId(Guid clusterId) { List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (Provider provider : providerDao.getAllByTypes(ProviderType.EXTERNAL_NETWORK)) { for (Network network : clusterNetworks) { ProviderNetwork providerNetwork = network.getProvidedBy(); if ((providerNetwork != null) <START> && (providerNetwork.getProviderId().equals(provider.getId()))) { <END> return NetworkUtils.getIpAddress(provider.getUrl()); } } } return null; }</code><technical_language>Please remove unneeded parenthesis: if (providerNetwork != null && providerNetwork.getProviderId().equals(provider.getId())) {</technical_language>

Target:
public String getOvnCentralByClusterId(Guid clusterId) { List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (Provider provider : providerDao.getAllByTypes(ProviderType.EXTERNAL_NETWORK)) { for (Network network : clusterNetworks) { ProviderNetwork providerNetwork = network.getProvidedBy(); if (providerNetwork != null && (providerNetwork.getProviderId().equals(provider.getId()))) { return NetworkUtils.getIpAddress(provider.getUrl()); } } } return null; }
Source:
<code>public Connection getConnection() throws SQLException { if (getDataSource() == null) { return createDataSource().getConnection(); } Connection connection = null; int retryAttempt = 0; this.dataSource = null; <START> while (connection == null && retryAttempt < ServerInternals.MAX_DB_RETRY_COUNT) { <END> try { connection = createDataSource().getConnection(); if(connection != null) return connection; } catch (Exception ex) { logger.error("Failed to find DB connection", ex); this.dataSource = null; logger.info("waits 10 seconds and retry. No.Attempt = " + retryAttempt); } finally { retryAttempt ++; } } return connection; }</code><technical_language>This method works ok - a good idea try exponential/ fibonacci backoff in cases This is a good read: <LINK_0> This well: <LINK_1> simple necessarily external dependency - this is a good example of exponential backoff</technical_language>

Target:
public synchronized Connection getConnection() throws SQLException { if (getDataSource() == null) { return createDataSource().getConnection(); } Connection connection = null; int retryAttempt = 0; while (connection == null && retryAttempt < ServerInternals.MAX_DB_RETRY_COUNT) { try { connection = createDataSource().getConnection(); if(connection != null) return connection; } catch (SQLException ex) { this.dataSource = null; logger.error("Failed to find DB connection. waits 1 minutes and retry. No.Attempt = " + retryAttempt, ex); } catch (Exception ex) { logger.error("Exception other than SQLException is thrown", ex); return null; } finally { retryAttempt ++; } } return connection; }
Source:
<code>public void shouldReencrypt() throws Exception { final Encryption source = new Encryption(KeySources.fixedKey("DataPrepIsSoCool"), CipherSources.aes()); final Encryption target = new Encryption(KeySources.random(16), CipherSources.getDefault()); final EncryptionMigration migration = EncryptionMigration.build(source, target); <START> final String originalEncrypted = "JP6lC6hVeu3wRZA1Tzigyg=="; <END> final String reencrypt = migration.migrate(originalEncrypted); final String decrypted = target.decrypt(reencrypt); assertEquals("5ecr3t", decrypted); assertNotEquals(originalEncrypted, reencrypt); }</code><technical_language>start plaintext, encrypt source instead of hard-coding encrypted value</technical_language>

Target:
public void shouldReencrypt() throws Exception { final String plainText = "5ecr3t"; final Encryption source = new Encryption(KeySources.fixedKey("DataPrepIsSoCool"), CipherSources.aes()); final Encryption target = new Encryption(KeySources.random(16), CipherSources.getDefault()); final EncryptionMigration migration = EncryptionMigration.build(source, target); final String originalEncrypted = source.encrypt(plainText); final String reencrypt = migration.migrate(originalEncrypted); final String decrypted = target.decrypt(reencrypt); assertEquals(plainText, decrypted); assertNotEquals(originalEncrypted, reencrypt); }
Source:
<code>Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); <START> HostPageData pageData = new HostPageData(); pageData.version = Version.getVersion(); pageData.isNoteDbEnabled = isNoteDbEnabled; pageData.pluginsLoadTimeout = pluginsLoadTimeout; <END> StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.removeAttribute("id"); nocache.setAttribute("src", noCacheName); opt = new Content(hostDoc); nocache.setAttribute("src", "gerrit_ui/dbg_gerrit_ui.nocache.js"); debug = new Content(hostDoc); }</code><technical_language>include loadInIFrame part of HostPageData</technical_language>

Target:
Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); HostPageData pageData = new HostPageData(); pageData.version = Version.getVersion(); pageData.isNoteDbEnabled = isNoteDbEnabled; pageData.pluginsLoadTimeout = pluginsLoadTimeout; pageData.canLoadInIFrame = canLoadInIFrame; StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.removeAttribute("id"); nocache.setAttribute("src", noCacheName); opt = new Content(hostDoc); nocache.setAttribute("src", "gerrit_ui/dbg_gerrit_ui.nocache.js"); debug = new Content(hostDoc); }
Source:
<code><START> protected String getCorporateBilledCorporatePaidDocumentParameter(String parameterName){ <END> String parameterValue = parameterService.getParameterValueAsString("KFS-FP", CuFPParameterConstants.CorporateBilledCorporatePaidDocument.COMPONENT_NAME, parameterName); if (LOG.isDebugEnabled()) { LOG.debug("getCorporateBilledCorporatePaidDocumentParameter, param name: " + parameterName + " param value: " + parameterValue); } return parameterValue; }</code><technical_language>Missing space curly brace</technical_language>

Target:
public String getCorporateBilledCorporatePaidDocumentParameter(String parameterName) { String parameterValue = parameterService.getParameterValueAsString(KFSConstants.ParameterNamespaces.FINANCIAL, CuFPParameterConstants.CorporateBilledCorporatePaidDocument.CBCP_COMPONENT_NAME, parameterName); if (LOG.isDebugEnabled()) { LOG.debug("getCorporateBilledCorporatePaidDocumentParameter, param name: " + parameterName + " param value: " + parameterValue); } return parameterValue; }
Source:
<code>public boolean pollSocketsInfo() { if (!isTcpInfoSupported()) return false; FileDescriptor fd = null; try { final long time = SystemClock.elapsedRealtime(); fd = connectToKernel(); mTcpStats.clear(); for (final int family : ADDRESS_FAMILIES) { if (!sendPollingRequest(fd, family)) continue; final ByteBuffer bytes = recvMesssage(fd); log("pollSocketsInfo: recv size=" + bytes.limit()); while (enoughBytesRemainForValidNlMsg(bytes)) { <START> StructNlMsgHdr nlmsghdr <END> = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { bytes.position(bytes.position() + StructInetDiagMsg.STRUCT_SIZE - 7 * Integer.BYTES); final long cookie = ((long) bytes.getInt() << 32) | (long) bytes.getInt(); bytes.position(bytes.position() + 5 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); mSocketInfos.put(cookie, info); } if (nlmsghdr.nlmsg_type == NLMSG_DONE) break; } } cleanupSocketInfo(time); return true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return false; }</code><technical_language>final</technical_language>

Target:
public boolean pollSocketsInfo() { if (!isTcpInfoSupported()) return false; FileDescriptor fd = null; try { final long time = SystemClock.elapsedRealtime(); fd = connectToKernel(); mTcpStats.clear(); for (final int family : ADDRESS_FAMILIES) { if (!sendPollingRequest(fd, family)) continue; final ByteBuffer bytes = recvMesssage(fd); log("pollSocketsInfo: recv size=" + bytes.limit()); while (enoughBytesRemainForValidNlMsg(bytes)) { final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { bytes.position(bytes.position() + StructInetDiagMsg.STRUCT_SIZE - 7 * Integer.BYTES); final long cookie = bytes.getLong(); bytes.position(bytes.position() + 5 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); mSocketInfos.put(cookie, info); } if (nlmsghdr.nlmsg_type == NLMSG_DONE) break; } } cleanupSocketInfo(time); return true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return false; }
Source:
<code>public static void setSubscriptionsFilter(SubscriptionsFilter value) { prefs.edit() <START> .putString(PREF_FILTER_FEED, TextUtils.join(",", value.getValues())) <END> .apply(); }</code><technical_language>I a method value.serialize() better. This details of items joined encapsulated class</technical_language>

Target:
public static void setSubscriptionsFilter(SubscriptionsFilter value) { prefs.edit() .putString(PREF_FILTER_FEED, value.serialize()) .apply(); }