auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AnnotationVisitor visitLocalVariableAnnotation(final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String descriptor, final boolean visible) { <START> int[] newIndex = new int[index.length]; <END> for (int i = 0; i < newIndex.length; i++) { newIndex[i] = map(index[i]); } return mv.visitLocalVariableAnnotation(typeRef, typePath, start, end, newIndex, descriptor, visible); }</code><technical_language>final</technical_language>

Target:
public AnnotationVisitor visitLocalVariableAnnotation(final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String descriptor, final boolean visible) { final int[] newIndex = new int[index.length]; for (int i = 0; i < newIndex.length; i++) { newIndex[i] = map(index[i]); } return mv.visitLocalVariableAnnotation(typeRef, typePath, start, end, newIndex, descriptor, visible); }
Source:
<code>private void logSSLInfo(ChannelHandlerContext ctx) { if (sslLogMessage == null) { sslLogMessage = new StringBuilder(); sslLogMessage.append("SSL ("); try { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); boolean sslUsed = sslHandler != null; sslLogMessage.append("[used=").append(sslUsed).append("]"); if (sslUsed && publicAccessLogger.isCertLoggingEnabled()) { X509Certificate certificate = (X509Certificate) sslHandler.engine().getSession().getPeerCertificates()[0]; X500Principal principal = certificate.getSubjectX500Principal(); Collection subjectAlternativeNames = certificate.getSubjectAlternativeNames(); sslLogMessage.append(", [principal=").append(principal).append("]"); <START> sslLogMessage.append(", [san=").append(subjectAlternativeNames).append("]"); <END> } } catch (Exception e) { logger.error("Unexpected error while getting SSL connection info for public access logger", e); } sslLogMessage.append(")"); } logMessage.append(sslLogMessage); }</code><technical_language>post a sample message ssl</technical_language>

Target:
private void logSSLInfo(ChannelHandlerContext ctx) { if (sslLogMessage == null) { sslLogMessage = new StringBuilder(); sslLogMessage.append("SSL ("); try { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); boolean sslUsed = sslHandler != null; sslLogMessage.append("[used=").append(sslUsed).append("]"); if (sslUsed) { X509Certificate certificate = (X509Certificate) sslHandler.engine().getSession().getPeerCertificates()[0]; X500Principal principal = certificate.getSubjectX500Principal(); Collection subjectAlternativeNames = certificate.getSubjectAlternativeNames(); sslLogMessage.append(", [principal=").append(principal).append("]"); sslLogMessage.append(", [san=").append(subjectAlternativeNames).append("]"); } } catch (Exception e) { logger.error("Unexpected error while getting SSL connection info for public access logger", e); } sslLogMessage.append(")"); } logMessage.append(sslLogMessage); }
Source:
<code>private String getSQLQuery(){ StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT max(obs.person_id) as PersonId, max(person.uuid) as PersonUuid, "); <START> stringBuilder.append("(select identifier from patient_identifier where patient_id = max(encounter.patient_id) limit 0,1) as 'OpenMRS ID', "); <END> stringBuilder.append("CONCAT(max(person_name.given_name),' ', max(person_name.middle_name), ' ', max(person_name.family_name)) as 'Patient Name', "); stringBuilder.append("IF(max(person.gender)='M', 'Male', 'Female') as Gender, "); stringBuilder.append("max(encounter.encounter_datetime) as 'Encounter Date', count(*) as 'Total Encounters' "); stringBuilder.append("FROM obs obs INNER JOIN concept_name cn ON obs.value_coded= cn.concept_id "); stringBuilder.append("INNER JOIN encounter encounter ON encounter.encounter_id = obs.encounter_id "); stringBuilder.append("INNER JOIN person person ON person.person_id = obs.person_id "); stringBuilder.append("INNER JOIN person_name person_name on person.person_id = person_name.person_id "); stringBuilder.append("WHERE cn.locale='en' "); stringBuilder.append("AND cn.locale_preferred = '1' "); stringBuilder.append("AND cn.uuid = :diagnosisUuid "); stringBuilder.append("AND obs.date_created >= :startDate "); stringBuilder.append("AND obs.date_created <= :endDate "); stringBuilder.append("group by person.uuid "); stringBuilder.append("order by count(*) DESC limit 0,30;"); return stringBuilder.toString(); }</code><technical_language>Please add preferred = true display preferred identifier</technical_language>

Target:
private String getSQLQuery(){ StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("SELECT max(obs.person_id) as PersonId, max(person.uuid) as PersonUuid, "); stringBuilder.append("(select identifier from patient_identifier where patient_id = max(encounter.patient_id) and preferred=true limit 0,1) as 'OpenMRS ID', "); stringBuilder.append("CONCAT(max(person_name.given_name),' ', max(person_name.middle_name), ' ', max(person_name.family_name)) as 'Patient Name', "); stringBuilder.append("IF(max(person.gender)='M', 'Male', 'Female') as Gender, "); stringBuilder.append("max(encounter.encounter_datetime) as 'Encounter Date', count(*) as 'Total Encounters' "); stringBuilder.append("FROM obs obs INNER JOIN concept_name cn ON obs.value_coded= cn.concept_id "); stringBuilder.append("INNER JOIN encounter encounter ON encounter.encounter_id = obs.encounter_id "); stringBuilder.append("INNER JOIN person person ON person.person_id = obs.person_id "); stringBuilder.append("INNER JOIN person_name person_name on person.person_id = person_name.person_id "); stringBuilder.append("WHERE cn.locale='en' "); stringBuilder.append("AND cn.locale_preferred = '1' "); stringBuilder.append("AND cn.uuid = :diagnosisUuid "); stringBuilder.append("AND obs.date_created >= :startDate "); stringBuilder.append("AND obs.date_created <= :endDate "); stringBuilder.append("group by person.uuid "); stringBuilder.append("order by count(*) DESC limit 0,30;"); return stringBuilder.toString(); }
Source:
<code>public ChatScriptEndpoint(String uri, String remaining, ChatScriptComponent component) throws URISyntaxException { super(uri, component); <START> URI remainingUri = new URI("tcp://" + remaining); <END> port = remainingUri.getPort() == -1 ? DEFAULT_PORT : remainingUri.getPort(); if (ObjectHelper.isEmpty(remainingUri.getPath())) { throw new IllegalArgumentException(URI_ERROR); } host = remainingUri.getHost(); if (ObjectHelper.isEmpty(host)) { throw new IllegalArgumentException(URI_ERROR); } botname = remainingUri.getPath(); if (ObjectHelper.isEmpty(botname)) { throw new IllegalArgumentException(URI_ERROR); } botname = botname.substring(1); setBot(new ChatScriptBot(getHostName(), getPort(), getBotName(), "")); }</code><technical_language>Is starting 'tcp' is correct</technical_language>

Target:
public ChatScriptEndpoint(String uri, String remaining, ChatScriptComponent component) throws URISyntaxException { super(uri, component); URI remainingUri = new URI("tcp://" + remaining); port = remainingUri.getPort() == -1 ? DEFAULT_PORT : remainingUri.getPort(); if (ObjectHelper.isEmpty(remainingUri.getPath())) { throw new IllegalArgumentException(ChatScriptConstants.URI_ERROR); } host = remainingUri.getHost(); if (ObjectHelper.isEmpty(host)) { throw new IllegalArgumentException(ChatScriptConstants.URI_ERROR); } botName = remainingUri.getPath(); if (ObjectHelper.isEmpty(botName)) { throw new IllegalArgumentException(ChatScriptConstants.URI_ERROR); } botName = botName.substring(1); setBot(new ChatScriptBot(getHost(), getPort(), getBotName(), "")); }
Source:
<code>public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Object> parameterValues, PatientCalculationContext context) { Program mchmsProgram = MetadataUtils.getProgram(Metadata.Program.MCHMS); Set<Integer> alive = alivePatients(cohort, context); Set<Integer> inMchmsProgram = CalculationUtils.patientsThatPass(Calculations.activeEnrollment(mchmsProgram, alive, context)); CalculationResultMap lastHivStatusObss = Calculations.lastObs(getConcept(Dictionary.HIV_STATUS), inMchmsProgram, context); CalculationResultMap ret = new CalculationResultMap(); <START> boolean notHivTested; <END> for (Integer ptId : cohort) { notHivTested = false; if (inMchmsProgram.contains(ptId)) { Concept lastHivStatus = EmrCalculationUtils.codedObsResultForPatient(lastHivStatusObss, ptId); if (lastHivStatus != null) { notHivTested = lastHivStatus.equals(Dictionary.getConcept(Dictionary.NOT_HIV_TESTED)); } } ret.put(ptId, new BooleanResult(notHivTested, this, context)); } return ret; }</code><technical_language>this variable declaration loop changes loop iteration. declared loop ensures "leak" iteration another. This is a variable change iteration a concept. For final keyword</technical_language>

Target:
public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Object> parameterValues, PatientCalculationContext context) { Program mchmsProgram = MetadataUtils.getProgram(Metadata.Program.MCHMS); Set<Integer> alive = alivePatients(cohort, context); Set<Integer> inMchmsProgram = CalculationUtils.patientsThatPass(Calculations.activeEnrollment(mchmsProgram, alive, context)); CalculationResultMap lastHivStatusObss = Calculations.lastObs(getConcept(Dictionary.HIV_STATUS), inMchmsProgram, context); CalculationResultMap ret = new CalculationResultMap(); for (Integer ptId : cohort) { boolean notHivTested = false; if (inMchmsProgram.contains(ptId)) { Concept lastHivStatus = EmrCalculationUtils.codedObsResultForPatient(lastHivStatusObss, ptId); if (lastHivStatus != null) { notHivTested = lastHivStatus.equals(Dictionary.getConcept(Dictionary.NOT_HIV_TESTED)); } } ret.put(ptId, new BooleanResult(notHivTested, this, context)); } return ret; }
Source:
<code>protected boolean updateBrickServerName(GlusterBrickEntity brick, boolean addCanDoActionMessage) { VdsStatic server = getVdsStaticDao().get(brick.getServerId()); <START> if ((server == null || !server.getvds_group_id().equals(getVdsGroupId())) && addCanDoActionMessage) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID); return false; } brick.setServerName(server.gethost_name()); return true; }</code><technical_language>return false if addCanDoActionMessage=false? name of parameter sounds message is needed give correct return</technical_language>

Target:
protected boolean updateBrickServerName(GlusterBrickEntity brick, boolean addCanDoActionMessage) { VdsStatic server = getVdsStaticDao().get(brick.getServerId()); if ((server == null || !server.getvds_group_id().equals(getVdsGroupId()))) { if (addCanDoActionMessage) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID); } return false; } brick.setServerName(server.gethost_name()); return true; }
Source:
<code>public DatastreamPositionResponse getPositionResponse() { DatastreamPositionResponse response = new DatastreamPositionResponse(); PhysicalSources positions = _kafkaPositionTrackerTask.getPositions(); <START> Map<String, PhysicalSources> datastreamsToPhysicalSources = _datastreamTask.getDatastreams() <END> .stream() .map(Datastream::getName) .collect(Collectors.toMap(name -> name, name -> positions)); response.setDatastreamToPhysicalSources(datastreamsToPhysicalSources); return response; }</code><technical_language>_datastreamTask.getDatastreams() is return a list of 1 Datastream. is instance variables _datastream _datastreamName created in this class's constructor. simply do this: Map<String, PhysicalSources> datastreamsToPhysicalSources = new HashMap<>(); datastreamsToPhysicalSources.put(_datastreamName, positions);</technical_language>

Target:
public DatastreamPositionResponse getPositionResponse() { return new DatastreamPositionResponse(ImmutableMap.of(_datastreamName, _kafkaPositionTracker.getPositions())); }
Source:
<code>public <E extends Enum<E>> StructArrayEncoder enm(String name, E value) { EnmField<E> field = (EnmField<E>) fieldSearcher.findField(name, EnmField.class, null); <START> currentData.add(new EnmDataHolder<E>(value, field.index(), field.getEnm())); <END> return this; }</code><technical_language>If data holder construction encoded field type duplicated code in methods removed (and of other methods in other encoders)</technical_language>

Target:
public <E> StructArrayEncoder enm(String name, E value) { EnumField<E> field = (EnumField<E>) fieldSearcher.findField(name, EnumField.class, null); currentData.add(new EnumDataHolder<E>(value, field.index(), field.getEnumMapping())); return this; }
Source:
<code>public Response createNewGatewayAccount(JsonNode node, @Context UriInfo uriInfo) { logger.error("Testing logging"); if (!node.has(ACCOUNT_NAME)) { return ResponseUtil.badResponse("Missing fields: name"); } <START> String name = node.get("name").textValue(); <END> logger.info("Creating new gateway account called {}", name); Long accountId = gatewayDao.insertNameAndReturnNewId(name); URI newLocation = uriInfo. getBaseUriBuilder(). path("/api/gateway/{accountId}").build(accountId); Map<String, Object> account = Maps.newHashMap(); account.put("account_id", "" + accountId); addSelfLink(newLocation, account); return Response.created(newLocation).entity(account).build(); }</code><technical_language>Please AACOUNT_NAME here</technical_language>

Target:
public Response createNewGatewayAccount(JsonNode node, @Context UriInfo uriInfo) { logger.error("Testing logging"); if (!node.has(ACCOUNT_NAME)) { return ResponseUtil.badResponse("Missing fields: name"); } String name = node.get(ACCOUNT_NAME).textValue(); logger.info("Creating new gateway account called {}", name); Long accountId = gatewayDao.insertNameAndReturnNewId(name); URI newLocation = uriInfo. getBaseUriBuilder(). path("/api/gateway/{accountId}").build(accountId); Map<String, Object> account = Maps.newHashMap(); account.put("account_id", "" + accountId); addSelfLink(newLocation, account); return Response.created(newLocation).entity(account).build(); }
Source:
<code>public void enter() { logD("Enter Disconnected"); if (mMostRecentState != BluetoothProfile.STATE_DISCONNECTED) { <START> sendMessage(CLEANUP); <END> } onConnectionStateChanged(BluetoothProfile.STATE_DISCONNECTED); }</code><technical_language>If I understand this right, state machine cleans disconnects</technical_language>

Target:
public void enter() { logD("Enter Disconnected"); if (mMostRecentState != BluetoothProfile.STATE_DISCONNECTED) { sendMessage(CLEANUP); } broadcastConnectionStateChanged(BluetoothProfile.STATE_DISCONNECTED); }
Source:
<code>synchronized void addNavigableObjects(Map<Integer, RegistryObject> associatedObjects) { Map<Integer, RegistryObject> result = new HashMap<>(); for (RegistryObject object : associatedObjects.values()) { if (object instanceof Extension) { ExtensionPoint extPoint = getExtensionPointObject(((Extension) object).getExtensionPointIdentifier()); if (extPoint == null) continue; Integer extPointIndex = Integer.valueOf(extPoint.getKeyHashCode()); if (!associatedObjects.containsKey(extPointIndex)) result.put(Integer.valueOf(extPoint.getKeyHashCode()), extPoint); for (int <START> extension2 : <END> extPoint.getRawChildren()) { Extension tmp = (Extension) basicGetObject(extension2, RegistryObjectManager.EXTENSION); if (tmp == null) continue; Integer extensionIndex = Integer.valueOf(extension2); if (!associatedObjects.containsKey(extensionIndex)) { result.put(extensionIndex, tmp); collectChildren(tmp, 0, result); } } } else if (object instanceof ExtensionPoint) { Map<String, int[]> orphans = getOrphans(); String name = ((ExtensionPoint) object).getUniqueIdentifier(); int[] extensions = orphans.get(name); if (extensions != null) { for (int extension2 : extensions) { Extension tmp = (Extension) basicGetObject(extension2, RegistryObjectManager.EXTENSION); if (tmp == null) continue; Integer extensionIndex = Integer.valueOf(extension2); if (!associatedObjects.containsKey(extensionIndex)) { result.put(extensionIndex, tmp); collectChildren(tmp, 0, result); } } } } } associatedObjects.putAll(result); }</code><technical_language>rename childId</technical_language>

Target:
synchronized void addNavigableObjects(Map<Integer, RegistryObject> associatedObjects) { Map<Integer, RegistryObject> result = new HashMap<>(); for (RegistryObject object : associatedObjects.values()) { if (object instanceof Extension) { ExtensionPoint extPoint = getExtensionPointObject(((Extension) object).getExtensionPointIdentifier()); if (extPoint == null) continue; Integer extPointIndex = Integer.valueOf(extPoint.getKeyHashCode()); if (!associatedObjects.containsKey(extPointIndex)) result.put(Integer.valueOf(extPoint.getKeyHashCode()), extPoint); for (int childId : extPoint.getRawChildren()) { Extension tmp = (Extension) basicGetObject(childId, RegistryObjectManager.EXTENSION); if (tmp == null) continue; Integer extensionIndex = Integer.valueOf(childId); if (!associatedObjects.containsKey(extensionIndex)) { result.put(extensionIndex, tmp); collectChildren(tmp, 0, result); } } } else if (object instanceof ExtensionPoint) { Map<String, int[]> orphans = getOrphans(); String name = ((ExtensionPoint) object).getUniqueIdentifier(); int[] extensions = orphans.get(name); if (extensions != null) { for (int orphanId : extensions) { Extension tmp = (Extension) basicGetObject(orphanId, RegistryObjectManager.EXTENSION); if (tmp == null) continue; Integer extensionIndex = Integer.valueOf(orphanId); if (!associatedObjects.containsKey(extensionIndex)) { result.put(extensionIndex, tmp); collectChildren(tmp, 0, result); } } } } } associatedObjects.putAll(result); }
Source:
<code>public void setAttribute(Object entity, Attribute attribute, RequestScope scope) { <START> DataStoreTransaction transaction = getTransaction(getType(entity.getClass())); <END> transaction.setAttribute(entity, attribute, scope); }</code><technical_language>call entity.getClass - need EntityDictionary.getTYpe instead</technical_language>

Target:
public void setAttribute(Object entity, Attribute attribute, RequestScope scope) { DataStoreTransaction transaction = getTransaction(EntityDictionary.getType(entity)); transaction.setAttribute(entity, attribute, scope); }
Source:
<code>public ModelProvider[] getEnabledModelProviders() { boolean addGitProvider = true; List<ModelProvider> providers = new ArrayList<ModelProvider>(); boolean includeResourceModel = includeResourceModelProvider(); ModelProvider[] enabledProviders = super.getEnabledModelProviders(); for (ModelProvider provider : enabledProviders) { String providerId = provider.getId(); <START> if (!providerId.equals(WORKSPACE_MODEL_PROVIDER) <END> || includeResourceModel) providers.add(provider); if (addGitProvider && providerId.equals(GitChangeSetModelProvider.ID)) addGitProvider = false; } if (addGitProvider) providers.add(GitChangeSetModelProvider.getProvider()); return providers.toArray(new ModelProvider[providers.size()]); }</code><technical_language>I exclude Java workspace model: org.eclipse.jdt.ui.modelProvider. operates local workspace. do returning GitChangeSetModelProvider if !gsd.shouldIncludeLocal() filtering out a predefined list</technical_language>

Target:
public ModelProvider[] getEnabledModelProviders() { List<ModelProvider> providers = new ArrayList<ModelProvider>(); if (!includeResourceModelProvider()) providers.add(GitChangeSetModelProvider.getProvider()); else { boolean addGitProvider = true; ModelProvider[] enabledProviders = super.getEnabledModelProviders(); for (ModelProvider provider : enabledProviders) { String providerId = provider.getId(); providers.add(provider); if (addGitProvider && providerId.equals(GitChangeSetModelProvider.ID)) addGitProvider = false; } if (addGitProvider) providers.add(GitChangeSetModelProvider.getProvider()); } return providers.toArray(new ModelProvider[providers.size()]); }
Source:
<code>private void read(final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload) { this.findAssets(); JsonArray request; try { <START> request = getRequestJsonArray(reqPayload); <END> } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } ChannelOperationResponse response; if (request == null || request.size() == 0) { response = readAllAssets(respPayload); } else { List<ReadRequest> readRequests; try { readRequests = ReadRequest.parseAll(request); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } response = new ChannelOperationResponse(); for (ReadRequest readRequest : readRequests) { readAsset(readRequest.getAssetName(), readRequest.getChannelNames(), response); } } respPayload.setBody(response.getSerialized().toString().getBytes(StandardCharsets.UTF_8)); respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_OK); }</code><technical_language>call parseRequest</technical_language>

Target:
private void read(final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload) { this.findAssets(); JsonArray request; try { request = parseRequest(reqPayload); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } ChannelOperationResponse response; if (request == null || request.isEmpty()) { response = readAllAssets(respPayload); } else { List<ReadRequest> readRequests; try { readRequests = ReadRequest.parseAll(request); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } response = new ChannelOperationResponse(); for (ReadRequest readRequest : readRequests) { readAsset(readRequest.getAssetName(), readRequest.getChannelNames(), response); } } respPayload.setBody(response.serialize()); respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_OK); }
Source:
<code>public int getHeightInt() { try { <START> return Integer.parseInt(mHeight); <END> } catch (NumberFormatException ex) { return 0; } }</code><technical_language>Tip: StringUtils.stringToInt() in getWidthInt()</technical_language>

Target:
public int getHeightInt() { return StringUtils.stringToInt(mHeight); }
Source:
<code>public void publish(Object event, Configuration conf) { for(int i=0; i<this.publishers.length; i++) { try{ this.publishers[i].publish(event, conf); }catch(Exception e){ <START> LOG.warn("Could not post event to " + <END> this.publishers[i].getClass().getName()); } } }</code><technical_language>Patameterized logging please</technical_language>

Target:
public void publish(Object event, Configuration conf) { for(int i=0; i<this.publishers.length; i++) { try{ this.publishers[i].publish(event, conf); }catch(Exception e){ LOG.warn("Could not post event to {}", this.publishers[i].getClass().getName()); } } }
Source:
<code>public void populate(ContentValues contentValues, Column column, T value) { if (value != null) { ColumnDataType dataType = column.getSpec().getDataType(); <START> String stringValue = String.valueOf(value.getMappedValue()); <END> if (dataType == ColumnDataType.TEXT) { contentValues.put(column.getName(), stringValue); } else if (dataType == ColumnDataType.INTEGER) { contentValues.put(column.getName(), Integer.valueOf(stringValue)); } } else { contentValues.putNull(column.getName()); } }</code><technical_language>a string Integer</technical_language>

Target:
public void populate(ContentValues contentValues, Column column, T value) { if (value != null) { ColumnDataType dataType = column.getSpec().getDataType(); String stringValue = String.valueOf(value.getMappedValue()); if (dataType == ColumnDataType.TEXT) { contentValues.put(column.getName(), stringValue); } else if (dataType == ColumnDataType.INTEGER) { contentValues.put(column.getName(), Integer.valueOf(stringValue)); } else { throw new IllegalStateException("Mapped Enum are only supported for INTEGER or TEXT columns. Cannot" + " populate Enum value " + value + " into column of type " + dataType); } } else { contentValues.putNull(column.getName()); } }
Source:
<code><START> AdapterUnifiedNativeAdMapper(final Context context, @NonNull final NativeAd nativeAd) { <END> this.context = context; verizonAd = nativeAd; JSONObject titleJSON = nativeAd.getJSON("title"); if (titleJSON != null) { setHeadline(titleJSON.optString("data")); } JSONObject bodyJSON = nativeAd.getJSON("body"); if (bodyJSON != null) { setBody(bodyJSON.optString("data")); } JSONObject callToActionJSON = nativeAd.getJSON("callToAction"); if (callToActionJSON != null) { setCallToAction(callToActionJSON.optString("data")); } JSONObject disclaimerJSON = nativeAd.getJSON("disclaimer"); if (disclaimerJSON != null) { setAdvertiser(disclaimerJSON.optString("data")); } JSONObject ratingJSON = nativeAd.getJSON("rating"); if (ratingJSON != null) { String ratingString = ratingJSON.optString("data"); if (ratingString != null) { String[] ratingArray = ratingString.trim().split("\\s+"); if (ratingArray.length >= 1) { try { Double rating = Double.parseDouble(ratingArray[0]); setStarRating(rating); } catch (NumberFormatException e) { } } } } JSONObject iconImageJSON = nativeAd.getJSON("iconImage"); if (iconImageJSON != null) { setIcon(mappedImageFromJSON(iconImageJSON)); } JSONObject mainImageJSON = nativeAd.getJSON("mainImage"); if (mainImageJSON != null) { List<com.google.android.gms.ads.formats.NativeAd.Image> imagesList = new ArrayList<>(); imagesList.add(mappedImageFromJSON(mainImageJSON)); setImages(imagesList); } }</code><technical_language>testing, rendered main image asset icon asset in native ad small, is a server side issue</technical_language>

Target:
AdapterUnifiedNativeAdMapper(final Context context, @NonNull final NativeAd nativeAd) { this.context = context; verizonAd = nativeAd; setHeadline(parseTextComponent("title", nativeAd)); setBody(parseTextComponent("body", nativeAd)); setCallToAction(parseTextComponent("callToAction", nativeAd)); setAdvertiser(parseTextComponent("disclaimer", nativeAd)); String ratingString = parseTextComponent("rating", nativeAd); if (!TextUtils.isEmpty(ratingString)) { String[] ratingArray = ratingString.trim().split("\\s+"); if (ratingArray.length >= 1) { try { Double rating = Double.parseDouble(ratingArray[0]); setStarRating(rating); } catch (NumberFormatException e) { } } } }
Source:
<code>public void checkForRecursiveHTTPImports(String content, Set<String> currentFileImports) throws IOException { String[] lines = StringUtils.split(content, '\n'); for (String line : lines) { Matcher m = IMPORT_PATTERN.matcher(line); while (m.find()) { String match = m.group(1); if (match.startsWith("http://") || match.startsWith("https://")) { <START> System.out.println("Found match: " + match); <END> if (currentFileImports.contains(match)) { throw new CustomWebApplicationException("Error parsing workflow. You may have a recursive import.", HttpStatus.SC_BAD_REQUEST); } else { System.out.println("New match: " + match); currentFileImports.add(match); URL url = new URL(match); String s = IOUtils.toString(url, StandardCharsets.UTF_8); checkForRecursiveHTTPImports(s, currentFileImports); } currentFileImports.add(match.replaceFirst("file://", "")); } } } }</code><technical_language>Change this line 297 logger remove</technical_language>

Target:
public void checkForRecursiveHTTPImports(String content, Set<String> currentFileImports) throws IOException { String[] lines = StringUtils.split(content, '\n'); for (String line : lines) { Matcher m = IMPORT_PATTERN.matcher(line); while (m.find()) { String match = m.group(1); if (match.startsWith("http://") || match.startsWith("https://")) { if (currentFileImports.contains(match)) { throw new CustomWebApplicationException("Error parsing workflow. You may have a recursive import.", HttpStatus.SC_BAD_REQUEST); } else { currentFileImports.add(match); URL url = new URL(match); try (InputStream is = url.openStream()) { BoundedInputStream boundedInputStream = new BoundedInputStream(is, FileUtils.ONE_MB); String fileContents = IOUtils.toString(boundedInputStream, StandardCharsets.UTF_8); checkForRecursiveHTTPImports(fileContents, currentFileImports); } } currentFileImports.add(match); } } } }
Source:
<code>public Map<String, Map<String, String>> readContainerLocality() { Map<String, Map<String, String>> allMappings = new HashMap<>(); metadataStore.all().forEach((keyBytes, valueBytes) -> { if (valueBytes != null) { String locationId = valueSerde.fromBytes(valueBytes); allMappings.put(keySerde.fromBytes(keyBytes), ImmutableMap.of(SetContainerHostMapping.HOST_KEY, locationId, <START> SetContainerHostMapping.JMX_TUNNELING_URL_KEY, "", <END> SetContainerHostMapping.JMX_URL_KEY, "")); } }); containerToHostMapping = allMappings; if (LOG.isDebugEnabled()) { for (Map.Entry<String, Map<String, String>> entry : containerToHostMapping.entrySet()) { LOG.debug(String.format("Locality for container %s: %s", entry.getKey(), entry.getValue())); } } return Collections.unmodifiableMap(allMappings); }</code><technical_language>longer setting JMX_TUNNELING_URL_KEY JMX_URL_KEY</technical_language>

Target:
public Map<String, Map<String, String>> readContainerLocality() { Map<String, Map<String, String>> allMappings = new HashMap<>(); metadataStore.all().forEach((keyBytes, valueBytes) -> { if (valueBytes != null) { String locationId = valueSerde.fromBytes(valueBytes); allMappings.put(keySerde.fromBytes(keyBytes), ImmutableMap.of(SetContainerHostMapping.HOST_KEY, locationId)); } }); if (LOG.isDebugEnabled()) { for (Map.Entry<String, Map<String, String>> entry : allMappings.entrySet()) { LOG.debug(String.format("Locality for container %s: %s", entry.getKey(), entry.getValue())); } } return Collections.unmodifiableMap(allMappings); }
Source:
<code><START> public Matrix rotate() { <END> double[][] rotatedMatrix = new double[this.columns()][this.rows()]; for (int i = 0; i < this.rows(); i++) { for (int j = 0; j < this.columns(); j++) { rotatedMatrix[j][this.rows()-1-i] = this.get(i, j); } } return factory.createMatrix(rotatedMatrix); }</code><technical_language>need call method in matrix. other methods for example</technical_language>

Target:
public Matrix rotate() { return self.rotate(factory); }
Source:
<code><START> public List<DeprecatedRuleKeyDto> selectAllDeprecatedRuleKeys(DbSession session) { <END> return mapper(session).selectAllDeprecatedRuleKeys(); }</code><technical_language>returning a Set emphasis is specific order in returned collection</technical_language>

Target:
public Set<DeprecatedRuleKeyDto> selectAllDeprecatedRuleKeys(DbSession session) { return mapper(session).selectAllDeprecatedRuleKeys(); }
Source:
<code>public void flush() { BufferedReader in = new BufferedReader(new StringReader(getBuffer().toString())); while (true) { try { String line = in.readLine(); if (line == null) { break; } if (logger.isInfoEnabled()) { <START> logger.info(line); <END> } } catch (IOException e) { throw new Error(e); } } getBuffer().setLength(0); }</code><technical_language>I need "if" check. log info. logger is check enabled anyway.... "is enabled" is useful log line work</technical_language>

Target:
public void flush() { BufferedReader in = new BufferedReader(new StringReader(getBuffer().toString())); while (true) { try { String line = in.readLine(); if (line == null) { break; } logger.info(line); } catch (IOException e) { throw new Error(e); } } getBuffer().setLength(0); }
Source:
<code>private void initializeLegendFields() { this.removeAll(); JPanel glob = new JPanel(); GridBagLayout grid = new GridBagLayout(); glob.setLayout(grid); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; JPanel p1 = getLineBlock(uniqueArea.getPenStroke(), "Line configuration"); glob.add(p1, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(5, 0, 5, 0); ConstantSolidFill leg = uniqueArea.getFillLegend(); <START> JPanel p2 = getAreaBlock(leg, "Fill configuration"); <END> setAreaFieldsState(leg instanceof ConstantSolidFillLegend); glob.add(p2, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; glob.add(getPreview(), gbc); this.add(glob); }</code><technical_language>If "Fill configuration" is a label (shown user) a call I18N.tr done</technical_language>

Target:
private void initializeLegendFields() { this.removeAll(); JPanel glob = new JPanel(); GridBagLayout grid = new GridBagLayout(); glob.setLayout(grid); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; JPanel p1 = getLineBlock(uniqueArea.getPenStroke(), I18N.tr("Line configuration")); glob.add(p1, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(5, 0, 5, 0); ConstantSolidFill leg = uniqueArea.getFillLegend(); JPanel p2 = getAreaBlock(leg, I18N.tr("Fill configuration")); setAreaFieldsState(leg instanceof ConstantSolidFillLegend); glob.add(p2, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; glob.add(getPreview(), gbc); this.add(glob); }
Source:
<code>public void close(final long timeoutMs) throws InterruptedException, TimeoutException, ExecutionException { final Future result = Executors.newSingleThreadExecutor().submit(() -> { for (int i = 0; i < numThreads; i++) { threads[i].startClose(); } <START> retryThread.startClose(); <END> for (int i = 0; i < numThreads; i++) { threads[i].waitForClose(); } retryThread.waitForClose(); } ); result.get(timeoutMs, TimeUnit.MILLISECONDS); }</code><technical_language>insert a blank line for readability</technical_language>

Target:
public void close(final long timeoutMs) throws InterruptedException, TimeoutException, ExecutionException { final Future result = Executors.newSingleThreadExecutor().submit(() -> { for (int i = 0; i < numWorkerThreads; i++) { workerThreads[i].startClose(); } retryThread.startClose(); for (int i = 0; i < numWorkerThreads; i++) { workerThreads[i].waitForClose(); } retryThread.waitForClose(); } ); result.get(timeoutMs, TimeUnit.MILLISECONDS); }
Source:
<code>public Connector create(String connectorId, Map<String, String> requiredConfig, ConnectorContext context) { requireNonNull(requiredConfig, "requiredConfig is null"); <START> <END> try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(this.classLoader)) { Bootstrap app = new Bootstrap(new SqlServerClientModule(connectorId)); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(requiredConfig) .initialize(); return injector.getInstance(JdbcConnector.class); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>check other args null too</technical_language>

Target:
public Connector create(String connectorId, Map<String, String> requiredConfig, ConnectorContext context) { checkArgument(!isNullOrEmpty(connectorId), "name is null or empty"); requireNonNull(requiredConfig, "requiredConfig is null"); requireNonNull(context, "context is null"); try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) { Bootstrap app = new Bootstrap(new SqlServerClientModule(connectorId)); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(requiredConfig) .initialize(); return injector.getInstance(JdbcConnector.class); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public Map<String, Double> getAllSubjectCounts(String journalKey) throws IOException { String facet = "subject_facet"; List<NameValuePair> params = setCommonCategoryParams(journalKey, facet); Map<String, Double> categoryCountMap = new HashMap<>(); Map<?, ?> resultsMap = executeFacetedQuery(params, facet); for (Object o : resultsMap.keySet()) { <START> categoryCountMap.put(o.toString(), (Double) resultsMap.get(o)); <END> } return categoryCountMap; }</code><technical_language>numbers logically integers, right? I reason cast Double is is Gson handles numbers default. (Integers in JSON ambiguous definition actual integers whole-number decimal values.) good do ((Double) resultsMap.get(o)).longValue() instead, percolate changes Double Long needed other methods</technical_language>

Target:
public Collection<SubjectCount> getAllSubjectCounts(String journalKey) throws IOException { String facet = "subject_facet"; List<NameValuePair> params = setCommonCategoryParams(journalKey, facet); Map<?, ?> resultsMap = executeFacetedQuery(params, facet); return resultsMap.entrySet().stream() .map((Map.Entry<?, ?> entry) -> new SubjectCount((String) entry.getKey(), ((Double) entry.getValue()).longValue())).collect(Collectors.toList()); }
Source:
<code>public void testQueryExecutionTimeLimit() throws Exception { Session session = testSessionBuilder() .setCatalog("tpch") .setSchema("sf100000") .setSource("dashboard") .setSystemProperty(QUERY_MAX_EXECUTION_TIME, "1ms") .build(); QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); InternalResourceGroupManager manager = queryRunner.getCoordinator().getResourceGroupManager().get(); DbResourceGroupConfigurationManager dbConfigurationManager = (DbResourceGroupConfigurationManager) manager.getConfigurationManager(); QueryId query = createQuery(queryRunner, session, LONG_LASTING_QUERY); waitForQueryState(queryRunner, query, FAILED); assertEquals(queryManager.getQueryInfo(query).getErrorCode(), EXCEEDED_TIME_LIMIT.toErrorCode()); assertContains(queryManager.getQueryInfo(query).getFailureInfo().getMessage(), "Query exceeded the maximum execution time limit of 1.00ms"); dao.updateResourceGroup(5, "dashboard-${USER}", "1MB", 1, 0, null, null, null, null, null, null, null, 3L); dbConfigurationManager.load(); QueryId secondQuery = createQuery(queryRunner, session, LONG_LASTING_QUERY); waitForQueryState(queryRunner, secondQuery, QUEUED); Thread.sleep(5_000); <START> assertEquals(queryManager.getQueryInfo(secondQuery).getState(), QUEUED); <END> }</code><technical_language>Do want test query get killed later</technical_language>

Target:
public void testQueryExecutionTimeLimit() throws Exception { Session session = testSessionBuilder() .setCatalog("tpch") .setSchema("sf100000") .setSource("dashboard") .setSystemProperty(QUERY_MAX_EXECUTION_TIME, "1ms") .build(); QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); InternalResourceGroupManager manager = queryRunner.getCoordinator().getResourceGroupManager().get(); DbResourceGroupConfigurationManager dbConfigurationManager = (DbResourceGroupConfigurationManager) manager.getConfigurationManager(); QueryId firstQuery = createQuery(queryRunner, session, LONG_LASTING_QUERY); waitForQueryState(queryRunner, firstQuery, FAILED); assertEquals(queryManager.getQueryInfo(firstQuery).getErrorCode(), EXCEEDED_TIME_LIMIT.toErrorCode()); assertContains(queryManager.getQueryInfo(firstQuery).getFailureInfo().getMessage(), "Query exceeded the maximum execution time limit of 1.00ms"); dao.updateResourceGroup(5, "dashboard-${USER}", "1MB", 1, 0, null, null, null, null, null, null, null, 3L); dbConfigurationManager.load(); QueryId secondQuery = createQuery(queryRunner, session, LONG_LASTING_QUERY); waitForQueryState(queryRunner, secondQuery, QUEUED); Thread.sleep(5_000); assertEquals(queryManager.getQueryInfo(secondQuery).getState(), QUEUED); dao.updateResourceGroup(5, "dashboard-${USER}", "1MB", 1, 1, null, null, null, null, null, null, null, 3L); dbConfigurationManager.load(); queryManager.cancelQuery(firstQuery); waitForQueryState(queryRunner, secondQuery, FAILED); }
Source:
<code>public void decrementRemainFiles(FileRegion filePart, long fileStartTime) { long fileSendTime = System.currentTimeMillis() - fileStartTime; if (fileSendTime > maxTime) { maxTime = fileSendTime; } if (fileSendTime < minTime) { minTime = fileSendTime; } if (fileSendTime > 20 * 1000) { <START> LOG.warn("PullServer send too long time: filePos:" + filePart.position() <END> + ", fileLen:" + filePart.count() + ", URI:" + requestUri); SLOW_FILE_UPDATER.compareAndSet(this, numSlowFile, numSlowFile + 1); } REMAIN_FILE_UPDATER.compareAndSet(this, remainFiles, remainFiles - 1); if (REMAIN_FILE_UPDATER.get(this) <= 0) { processingStatusMap.remove(requestUri); if(LOG.isDebugEnabled()) { LOG.debug("PullServer processing status: totalTime=" + (System.currentTimeMillis() - startTime) + " ms, " + "makeFileListTime=" + makeFileListTime + " ms, minTime=" + minTime + " ms, maxTime=" + maxTime + " ms, " + "numFiles=" + numFiles + ", numSlowFile=" + numSlowFile); } } }</code><technical_language>I moved this code. But, original logging message needs corrected. update log message</technical_language>

Target:
public void decrementRemainFiles(FileRegion filePart, long fileStartTime) { long fileSendTime = System.currentTimeMillis() - fileStartTime; if (fileSendTime > maxTime) { maxTime = fileSendTime; } if (fileSendTime < minTime) { minTime = fileSendTime; } if (fileSendTime > 20 * 1000) { LOG.warn("Sending data takes too long. " + fileSendTime + "ms elapsed, " + "length:" + (filePart.count() - filePart.position()) + ", URI:" + requestUri); SLOW_FILE_UPDATER.compareAndSet(this, numSlowFile, numSlowFile + 1); } REMAIN_FILE_UPDATER.compareAndSet(this, remainFiles, remainFiles - 1); if (REMAIN_FILE_UPDATER.get(this) <= 0) { processingStatusMap.remove(requestUri); if(LOG.isDebugEnabled()) { LOG.debug("PullServer processing status: totalTime=" + (System.currentTimeMillis() - startTime) + " ms, " + "makeFileListTime=" + makeFileListTime + " ms, minTime=" + minTime + " ms, maxTime=" + maxTime + " ms, " + "numFiles=" + numFiles + ", numSlowFile=" + numSlowFile); } } }
Source:
<code>public void setErrorMessage(String text) { if (text.contains("http://")) { int urlIndex = text.indexOf(("http://")); String beforeURL = text.substring(0, urlIndex); String url = text.substring(urlIndex); StringBuilder htmlPart = new StringBuilder(); <START> htmlPart.append(beforeURL).append("<a href=\"").append(url).append("\">").append(url).append("</a>"); END> errorMessage.getElement().setInnerHTML(htmlPart.toString()); } else { errorMessage.setText(text); } errorMessage.setVisible(text != null); if (errorMessage.isVisible()) { errorMessagePanel.setVisible(true); } }</code><technical_language>add: target="_blank" "a" tag, password changing window (or other window, for matter) "override" existing ovirt GUI window, open in a new browser tab/window</technical_language>

Target:
public void setErrorMessage(String text) { setErrorMessageText(errorMessage, text); errorMessage.setVisible(text != null); if (errorMessage.isVisible()) { errorMessagePanel.setVisible(true); } }
Source:
<code>public List<GwtModemPdpEntry> findPdpContextInfo(GwtXSRFToken xsrfToken, String interfaceName) throws GwtKuraException { checkXSRFToken(xsrfToken); List<GwtModemPdpEntry> gwtModemPdpEntries = new ArrayList<>(); ModemManagerService mms = ServiceLocator.getInstance().getService(ModemManagerService.class); CellularModem modem = getModemService(interfaceName, mms); if (modem == null) { return gwtModemPdpEntries; } try { List<ModemPdpContext> pdpContextInfo = modem.getPdpContextInfo(); GwtModemPdpEntry gwtModemPdpEntry; int contextNo = 1; for (ModemPdpContext pdpContextEntry : pdpContextInfo) { gwtModemPdpEntry = new GwtModemPdpEntry(); gwtModemPdpEntry.setContextNumber(pdpContextEntry.getNumber()); gwtModemPdpEntry.setPdpType(pdpContextEntry.getType().getValue()); gwtModemPdpEntry.setApn(pdpContextEntry.getApn()); gwtModemPdpEntries.add(gwtModemPdpEntry); contextNo++; } gwtModemPdpEntry = new GwtModemPdpEntry(); gwtModemPdpEntry.setContextNumber(contextNo); gwtModemPdpEntry.setPdpType(ModemPdpContextType.IP.getValue()); gwtModemPdpEntry.setApn("Enter your Access Point Name"); gwtModemPdpEntries.add(gwtModemPdpEntry); } catch (KuraException e) { throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e); <START> } <END> return gwtModemPdpEntries; }</code><technical_language>this entry</technical_language>

Target:
public List<GwtModemPdpEntry> findPdpContextInfo(GwtXSRFToken xsrfToken, String interfaceName) throws GwtKuraException { checkXSRFToken(xsrfToken); List<GwtModemPdpEntry> gwtModemPdpEntries = new ArrayList<>(); ModemManagerService mms = ServiceLocator.getInstance().getService(ModemManagerService.class); CellularModem modem = getModemService(interfaceName, mms); if (modem == null) { return gwtModemPdpEntries; } try { List<ModemPdpContext> pdpContextInfo = modem.getPdpContextInfo(); GwtModemPdpEntry gwtModemPdpEntry; int contextInd = 1; int firstAvailableContextNum = 0; for (ModemPdpContext pdpContextEntry : pdpContextInfo) { gwtModemPdpEntry = new GwtModemPdpEntry(); gwtModemPdpEntry.setContextNumber(pdpContextEntry.getNumber()); gwtModemPdpEntry.setPdpType(pdpContextEntry.getType().getValue()); gwtModemPdpEntry.setApn(pdpContextEntry.getApn()); gwtModemPdpEntries.add(gwtModemPdpEntry); if (firstAvailableContextNum == 0 && contextInd < pdpContextEntry.getNumber()) { firstAvailableContextNum = contextInd; } contextInd++; } if (firstAvailableContextNum == 0) { firstAvailableContextNum = contextInd; } gwtModemPdpEntry = new GwtModemPdpEntry(); gwtModemPdpEntry.setContextNumber(firstAvailableContextNum); gwtModemPdpEntry.setPdpType(ModemPdpContextType.IP.getValue()); gwtModemPdpEntry.setApn("Please provide APN for this new PDP context ..."); gwtModemPdpEntries.add(gwtModemPdpEntry); } catch (KuraException e) { throw new GwtKuraException(GwtKuraErrorCode.WARNING, e); } return gwtModemPdpEntries; }
Source:
<code>public void testPutNodeReferenceString() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { <START> storage.createNode().put(Mods.NAME, "Wilhelm Busch"); <END> } }</code><technical_language>testing here</technical_language>

Target:
public void testPutNodeReferenceString() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { storage.createNode().put(MODS_NAME, "Wilhelm Busch"); } }
Source:
<code>Optional<MetricPusherCreator> create(Map<String, String> parameters) { Supplier<MetricPusherCreator> metricPusherCreatorSupplier = () -> { try { return (MetricPusherCreator) Class.forName(parameters.get(METRIC_PUSHER_CREATOR_CLASS_NAME)) .getConstructor().newInstance(); } catch (Exception e) { logger.error("MetricPusherCreator creation failed."); <START> e.printStackTrace(); <END> return null; } }; return create(metricPusherCreatorSupplier); }</code><technical_language>making e part of error logging: logger.error("MetricPusherCreator creation failed.", e) instead of printing stacktrace out of logging scope</technical_language>

Target:
Optional<MetricPusherCreator> create(Map<String, String> parameters) { Supplier<MetricPusherCreator> metricPusherCreatorSupplier = () -> { try { return (MetricPusherCreator) Class.forName(parameters.get(METRIC_PUSHER_CREATOR_CLASS_NAME)) .getConstructor().newInstance(); } catch (Exception e) { logger.error("MetricPusherCreator creation failed.", e); return null; } }; return create(metricPusherCreatorSupplier); }
Source:
<code>public static String formatPocketQueryInfo(PocketQuery pocketQuery) { if (!pocketQuery.isDownloadable()) { return StringUtils.EMPTY; } final List<String> infos = new ArrayList<>(3); final int caches = pocketQuery.getCaches(); infos.add(caches >= 0 ? CgeoApplication.getInstance().getResources().getQuantityString(R.plurals.cache_counts, caches, caches) : StringUtils.EMPTY); <START> infos.add(pocketQuery.getLastGeneration() != null ? Formatter.formatShortDateVerbally(pocketQuery.getLastGeneration().getTime()) : StringUtils.EMPTY); <END> final int daysRemaining = pocketQuery.getDaysRemaining(); if (daysRemaining == 0) { infos.add(CgeoApplication.getInstance().getString(R.string.last_day_available)); } else { infos.add(daysRemaining > 0 ? CgeoApplication.getInstance().getResources().getQuantityString(R.plurals.days_remaining, daysRemaining, daysRemaining) : StringUtils.EMPTY); } return StringUtils.join(infos, SEPARATOR); }</code><technical_language>this generate separators if date is available</technical_language>

Target:
public static String formatPocketQueryInfo(PocketQuery pocketQuery) { if (!pocketQuery.isDownloadable()) { return StringUtils.EMPTY; } final List<String> infos = new ArrayList<>(3); final int caches = pocketQuery.getCaches(); if (caches >= 0) { infos.add(CgeoApplication.getInstance().getResources().getQuantityString(R.plurals.cache_counts, caches, caches)); } if (pocketQuery.getLastGeneration() != null) { infos.add(Formatter.formatShortDateVerbally(pocketQuery.getLastGeneration().getTime())); } final int daysRemaining = pocketQuery.getDaysRemaining(); if (daysRemaining == 0) { infos.add(CgeoApplication.getInstance().getString(R.string.last_day_available)); } else { infos.add(daysRemaining > 0 ? CgeoApplication.getInstance().getResources().getQuantityString(R.plurals.days_remaining, daysRemaining, daysRemaining) : StringUtils.EMPTY); } return StringUtils.join(infos, SEPARATOR); }