auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void visit(NodeTraversal t, Node n, Node parent) { if (n.isExprResult()) { ClassMemberDeclaration declaration = ClassMemberDeclaration.newDeclarationOnThis(n); if (declaration == null || declarationHasBeenAdded(declaration)) { return; } Node fnNode = NodeUtil.getEnclosingFunction(n); <START> String fnName = getFnName(fnNode); <END> if ("constructor".equals(fnName) && declaration.jsDoc != null && declaration.jsDoc.getType() != null && declaration.rhsEqualToField()) { JSTypeExpression declarationType = declaration.jsDoc.getType(); Node params = fnNode.getSecondChild(); JSDocInfo constructorJsDoc = NodeUtil.getBestJSDocInfo(fnNode); for (Node param : params.children()) { JSTypeExpression paramType = constructorJsDoc.getParameterType(param.getString()); if (declaration.memberName.equals(param.getString()) && declarationType.equals(paramType)) { moveAccessModifier(declaration, param); markAsConst(declaration, param); n.detachFromParent(); compiler.reportCodeChange(); return; } } } moveFieldsIntoClasses(declaration); registerDeclaration(declaration); } }</code><technical_language>this a call foo.getBar(), a function name in closure-compiler's nomenclature</technical_language>

Target:
public void visit(NodeTraversal t, Node n, Node parent) { if (n.isExprResult()) { ClassMemberDeclaration declaration = ClassMemberDeclaration.newDeclarationOnThis(n); if (declaration == null || declarationHasBeenAdded(declaration)) { return; } Node fnNode = NodeUtil.getEnclosingFunction(n); String fnName = getEnclosingFunctionName(fnNode); if ("constructor".equals(fnName) && declaration.jsDoc != null && declaration.jsDoc.getType() != null && declaration.rhsEqualToField()) { JSTypeExpression declarationType = declaration.jsDoc.getType(); Node params = fnNode.getSecondChild(); JSDocInfo constructorJsDoc = NodeUtil.getBestJSDocInfo(fnNode); for (Node param : params.children()) { JSTypeExpression paramType = constructorJsDoc.getParameterType(param.getString()); if (declaration.memberName.equals(param.getString()) && declarationType.equals(paramType)) { moveAccessModifier(declaration, param); markAsConst(declaration, param); n.detachFromParent(); compiler.reportCodeChange(); return; } } } moveFieldsIntoClasses(declaration); registerDeclaration(declaration); } }
Source:
<code>private boolean isAuthorized(String method, String token, String projectId) { try { String verb = getVerb(method); String pod_namespace = System.getenv("POD_NAMESPACE"); if (pod_namespace == null) { pod_namespace = "default"; } String path = "/oapi/v1/namespaces/" + pod_namespace + "/subjectaccessreviews"; URL url = new URL(KUBERNETES_MASTER_URL + path); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Authorization", token); OutputStream outputStream = connection.getOutputStream(); for (byte b : generateSubjectAccessReview(projectId, verb).getBytes()) { outputStream.write(b); } outputStream.flush(); <START> outputStream.close(); <END> connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == 201) { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(connection.getInputStream()); if (jsonNode.get("allowed").asText().equals("true")) { return true; } } else { return false; } } catch (IOException e) { logger.error("Error trying to authenticate against the OpenShift server", e); } return false; }</code><technical_language>If IOException is thrown flush() write(), this close() is called. Refactor try-with in finally block</technical_language>

Target:
private boolean isAuthorized(String method, String token, String projectId) { try { String verb = getVerb(method); String pod_namespace = System.getenv("POD_NAMESPACE"); if (pod_namespace == null) { pod_namespace = "default"; } String path = "/oapi/v1/namespaces/" + pod_namespace + "/subjectaccessreviews"; URL url = new URL(KUBERNETES_MASTER_URL + path); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Authorization", token); try ( OutputStream outputStream = connection.getOutputStream(); ) { for (byte b : generateSubjectAccessReview(projectId, verb).getBytes()) { outputStream.write(b); } } connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == 201) { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(connection.getInputStream()); if (jsonNode.get("allowed").asText().equals("true")) { return true; } } else { return false; } } catch (IOException e) { logger.error("Error trying to authenticate against the OpenShift server", e); } return false; }
Source:
<code>void linkvisit(Long patientid, String formname, Encounter encounter, Encountercreate encountercreate) { VisitDAO visitDAO = new VisitDAO(); Long visitid = visitDAO.getVisitsIDByUUID(encounter.getVisit().getUuid()).toBlocking().first(); <START> visitDAO.getVisitByID(visitid) <END> .observeOn(AndroidSchedulers.mainThread()) .subscribe(visit -> { encounter.setEncounterType(new EncounterType(formname)); for (int i=0;i<encountercreate.getObservations().size();i++) { encounter.getObservations().get(i).setDisplayValue (encountercreate.getObservations().get(i).getValue()); } List<Encounter> encounterList=visit.getEncounters(); encounterList.add(encounter); visitDAO.updateVisit(visit,visit.getId(),patientid); ToastUtil.success(formname+" data saved successfully"); }); }</code><technical_language>chaining observables flatMap instead of calling toBlocking()...</technical_language>

Target:
private void linkvisit(Long patientid, String formname, Encounter encounter, Encountercreate encountercreate) { VisitDAO visitDAO = new VisitDAO(); visitDAO.getVisitByUuid(encounter.getVisit().getUuid()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(visit -> { encounter.setEncounterType(new EncounterType(formname)); for (int i=0;i<encountercreate.getObservations().size();i++) { encounter.getObservations().get(i).setDisplayValue (encountercreate.getObservations().get(i).getValue()); } List<Encounter> encounterList=visit.getEncounters(); encounterList.add(encounter); visitDAO.saveOrUpdate(visit, patientid) .observeOn(AndroidSchedulers.mainThread()) .subscribe(id -> ToastUtil.success(formname+" data saved successfully")); }); }
Source:
<code>private URL makeWorkerURL(Worker worker, String path) { Preconditions.checkArgument(path.startsWith("/"), "path must start with '/': %s", path); try { <START> return new URL(StringUtils.format("%s://%s/druid/worker/v1%s", worker.getScheme() == null ? "http": worker.getScheme(), worker.getHost(), path)); <END> } catch (MalformedURLException e) { throw Throwables.propagate(e); } }</code><technical_language>update Worker class instead handle null scheme in constructor covered for places worker.getScheme() used</technical_language>

Target:
private URL makeWorkerURL(Worker worker, String path) { Preconditions.checkArgument(path.startsWith("/"), "path must start with '/': %s", path); try { return new URL(StringUtils.format("%s://%s/druid/worker/v1%s", worker.getScheme(), worker.getHost(), path)); } catch (MalformedURLException e) { throw Throwables.propagate(e); } }
Source:
<code>public void testStreamWithMissedKeyInTransaction() throws Exception { AdvancedCache<Object, String> cache = advancedCache(0, CACHE_NAME); <START> TransactionManager tm = TestingUtil.extractComponent(cache, TransactionManager.class); <END> tm.begin(); try { Object localMissingKey = new MagicKey("key1", cache); Object remoteMissingKey = new MagicKey("key2", cache(1, CACHE_NAME)); assertFalse(cache.containsKey(localMissingKey)); assertFalse(cache.containsKey(remoteMissingKey)); Iterator<CacheEntry<Object, String>> iterator = cache.getAdvancedCache().cacheEntrySet().stream().iterator(); Map<Object, String> results = mapFromIterator(iterator); assertEquals(Collections.emptyMap(), results); assertEquals(0, cache.size()); } finally { tm.rollback(); } }</code><technical_language>is wrong cache.getTransactionManager()</technical_language>

Target:
public void testStreamWithMissedKeyInTransaction() throws Exception { AdvancedCache<Object, String> cache = advancedCache(0, CACHE_NAME); TransactionManager tm = tm(cache); tm.begin(); try { Object localMissingKey = new MagicKey("key1", cache); Object remoteMissingKey = new MagicKey("key2", cache(1, CACHE_NAME)); assertFalse(cache.containsKey(localMissingKey)); assertFalse(cache.containsKey(remoteMissingKey)); Iterator<CacheEntry<Object, String>> iterator = cache.getAdvancedCache().cacheEntrySet().stream().iterator(); Map<Object, String> results = mapFromIterator(iterator); assertEquals(Collections.emptyMap(), results); assertEquals(0, cache.size()); } finally { tm.rollback(); } }
Source:
<code>public void run() { if (checkAndReportInvalidState()) { return; } <START> matchingOffers = managementRealm.where(PermissionOffer.class) <END> .equalTo("token", offerToken) .findAllAsync(); matchingOffers.addChangeListener(new RealmChangeListener<RealmResults<PermissionOffer>>() { @Override public void onChange(final RealmResults<PermissionOffer> offers) { if (offers.size() == 1) { managementRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { PermissionOffer offer = realm.where(PermissionOffer.class) .equalTo("token", offerToken) .findFirst(); if (offer != null) { RealmObject.deleteFromRealm(offer); } } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { matchingOffers.removeAllChangeListeners(); notifyCallbackWithSuccess(); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { matchingOffers.removeAllChangeListeners(); notifyCallbackError(new ObjectServerError(ErrorCode.UNKNOWN, error)); } }); } } }); }</code><technical_language>spaces matchingOffers</technical_language>

Target:
public void run() { if (checkAndReportInvalidState()) { return; } matchingOffers = managementRealm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAllAsync(); matchingOffers.addChangeListener(new RealmChangeListener<RealmResults<PermissionOffer>>() { @Override public void onChange(final RealmResults<PermissionOffer> offers) { if (checkAndReportInvalidState()) { return; } if (!offers.isEmpty()) { managementRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { if (checkAndReportInvalidState()) { return; } RealmResults<PermissionOffer> offers = realm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAll(); if (!offers.isEmpty()) { offers.deleteAllFromRealm(); } } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { matchingOffers.removeAllChangeListeners(); if (checkAndReportInvalidState()) { return; } final SyncSession session = SyncManager.getSession(managementRealmConfig); session.addUploadProgressListener(ProgressMode.CURRENT_CHANGES, new ProgressListener() { @Override public void onChange(Progress progress) { if (progress.isTransferComplete()) { session.removeProgressListener(this); handler.post(new Runnable() { @Override public void run() { if (checkAndReportInvalidState()) { return; } notifyCallbackWithSuccess(); } }); } } }); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { matchingOffers.removeAllChangeListeners(); notifyCallbackError(new ObjectServerError(ErrorCode.UNKNOWN, error)); } }); } } }); }
Source:
<code>public List<String> getUsages() { return Arrays.asList(new String[] { <START> buildCommandUsage(SUBCMD_SAY + " <sink> <text>", "speaks a text through the given audio sink"), <END> buildCommandUsage(SUBCMD_INTERPRET + " <command>", "interprets a human language command"), buildCommandUsage(SUBCMD_VOICES, "lists available voices of the active TTS service") }); }</code><technical_language>This command line usage pretty awkward - I intentionally this simple. user configure defaultSink, is console commands</technical_language>

Target:
public List<String> getUsages() { return Arrays.asList(new String[] { buildCommandUsage(SUBCMD_SAY + " <voice> <sink> <text>", "speaks a text, with a given voice, through the given audio sink"), buildCommandUsage(SUBCMD_INTERPRET + " <command>", "interprets a human language command"), buildCommandUsage(SUBCMD_VOICES, "lists available voices of the active TTS service") }); }
Source:
<code>private FeatureVector estimateRelevanceModel(ScoredDocuments docs, IndexReader reader, boolean tweetsearch, boolean useRf) { FeatureVector f = new FeatureVector(); Set<String> vocab = new HashSet<>(); int numdocs; <START> if (useRf){ <END> numdocs = docs.documents.length; } else{ numdocs = docs.documents.length < fbDocs ? docs.documents.length : fbDocs; } FeatureVector[] docvectors = new FeatureVector[numdocs]; for (int i = 0; i < numdocs; i++) { try { FeatureVector docVector = createdFeatureVector( reader.getTermVector(docs.ids[i], field), reader, tweetsearch); docVector.pruneToSize(fbTerms); vocab.addAll(docVector.getFeatures()); docvectors[i] = docVector; } catch (IOException e) { e.printStackTrace(); return f; } } float[] norms = new float[docvectors.length]; for (int i = 0; i < docvectors.length; i++) { norms[i] = (float) docvectors[i].computeL1Norm(); } for (String term : vocab) { float fbWeight = 0.0f; for (int i = 0; i < docvectors.length; i++) { if (norms[i] > 0.001f) { fbWeight += (docvectors[i].getFeatureWeight(term) / norms[i]) * docs.scores[i]; } } f.addFeatureWeight(term, fbWeight); } f.pruneToSize(fbTerms); f.scaleToUnitL1Norm(); return f; }</code><technical_language>space )</technical_language>

Target:
private FeatureVector estimateRelevanceModel(ScoredDocuments docs, IndexReader reader, boolean tweetsearch, boolean useRf) { FeatureVector f = new FeatureVector(); Set<String> vocab = new HashSet<>(); int numdocs; if (useRf) { numdocs = docs.documents.length; } else { numdocs = docs.documents.length < fbDocs ? docs.documents.length : fbDocs; } List<FeatureVector> docvectors = new ArrayList<>(); List<Float> docScores = new ArrayList<>(); for (int i = 0; i < numdocs; i++) { if (useRf && docs.scores[i] <= .0) { continue; } try { FeatureVector docVector = createdFeatureVector( reader.getTermVector(docs.ids[i], field), reader, tweetsearch); docVector.pruneToSize(fbTerms); vocab.addAll(docVector.getFeatures()); docvectors.add(docVector); docScores.add(Float.valueOf(docs.scores[i])); } catch (IOException e) { e.printStackTrace(); return f; } } float[] norms = new float[docvectors.size()]; for (int i = 0; i < docvectors.size(); i++) { norms[i] = (float) docvectors.get(i).computeL1Norm(); } for (String term : vocab) { float fbWeight = 0.0f; for (int i = 0; i < docvectors.size(); i++) { if (norms[i] > 0.001f) { fbWeight += (docvectors.get(i).getFeatureWeight(term) / norms[i]) * docScores.get(i); } } f.addFeatureWeight(term, fbWeight); } f.pruneToSize(fbTerms); f.scaleToUnitL1Norm(); return f; }
Source:
<code>public static Container initializeFromSlices(final List<Slice> containerSlices, final CompressionHeader compressionHeader, <START> final long containerByteOffset) { <END> final Set<ReferenceContext> sliceRefContexts = containerSlices.stream() .map(Slice::getReferenceContext) .collect(Collectors.toSet()); if (sliceRefContexts.isEmpty()) { throw new CRAMException("Cannot construct a Container without any Slices"); } else if (sliceRefContexts.size() > 1) { throw new CRAMException("Cannot construct a Container from Slices with conflicting types or sequence IDs"); } final ReferenceContext commonRefContext = sliceRefContexts.iterator().next(); final Container container = new Container(commonRefContext); container.setSlices(containerSlices, containerByteOffset); container.compressionHeader = compressionHeader; if (commonRefContext.isMappedSingleRef()) { int start = Integer.MAX_VALUE; int endPlusOne = Integer.MIN_VALUE; for (final Slice slice : containerSlices) { start = Math.min(start, slice.alignmentStart); endPlusOne = Math.max(endPlusOne, slice.alignmentStart + slice.alignmentSpan); } container.alignmentStart = start; container.alignmentSpan = endPlusOne - start; } else { container.alignmentStart = Slice.NO_ALIGNMENT_START; container.alignmentSpan = Slice.NO_ALIGNMENT_SPAN; } container.setByteOffset(containerByteOffset); return container; }</code><technical_language>(non test) external caller setSlices exists slices, containerByteOffset, compression header, call this method directly. I setSlices initializeFromSlices consolidated a single method</technical_language>

Target:
public static Container initializeFromSlices(final List<Slice> containerSlices, final CompressionHeader compressionHeader, final long containerByteOffset) { final Set<ReferenceContext> sliceRefContexts = containerSlices.stream() .map(Slice::getReferenceContext) .collect(Collectors.toSet()); if (sliceRefContexts.isEmpty()) { throw new CRAMException("Cannot construct a Container without any Slices"); } else if (sliceRefContexts.size() > 1) { throw new CRAMException("Cannot construct a Container from Slices with conflicting types or sequence IDs"); } final ReferenceContext commonRefContext = sliceRefContexts.iterator().next(); final Container container = new Container(commonRefContext); container.setSlicesAndByteOffset(containerSlices, containerByteOffset); container.compressionHeader = compressionHeader; if (commonRefContext.isMappedSingleRef()) { int start = Integer.MAX_VALUE; int endPlusOne = Integer.MIN_VALUE; for (final Slice slice : containerSlices) { start = Math.min(start, slice.alignmentStart); endPlusOne = Math.max(endPlusOne, slice.alignmentStart + slice.alignmentSpan); } container.alignmentStart = start; container.alignmentSpan = endPlusOne - start; } else { container.alignmentStart = Slice.NO_ALIGNMENT_START; container.alignmentSpan = Slice.NO_ALIGNMENT_SPAN; } return container; }
Source:
<code>private boolean isFidesmoDevice() { if (isNfcConnected()) { try { byte[] selectResponse = mIsoCard.transceive(Apdu.select(FIDESMO_APPS_AID_PREFIX)); return Apdu.hasStatus(selectResponse, Apdu.OK_APDU); } catch (IOException e) { <START> e.printStackTrace(); <END> } } return false; }</code><technical_language>please Log.e(Constants.TAG, ..</technical_language>

Target:
private boolean isFidesmoDevice() { if (isNfcConnected()) { try { byte[] mSelectResponse = mIsoCard.transceive(Apdu.select(FIDESMO_APPS_AID_PREFIX)); return Apdu.hasStatus(mSelectResponse, Apdu.OK_APDU); } catch (IOException e) { Log.e(Constants.TAG, "Card communication failed!", e); } } return false; }
Source:
<code>private MessageSource getMessageSource(UUID id) { <START> return MessageSource.getRepository().findOne(id); <END> }</code><technical_language>is add MessageSourceRepository a dependency</technical_language>

Target:
private MessageSource getMessageSource(UUID id) { return messageSourceRepository.findOne(id); }
Source:
<code>public static File getConfigurationFile(String filename) { File file = new File(filename).getAbsoluteFile(); if (file.exists()) { <START> return file.getAbsoluteFile(); <END> } else { return newFile(getSimulatorHome(), "conf", filename).getAbsoluteFile(); } }</code><technical_language>Duplicate getAbsoluteFile()</technical_language>

Target:
public static File getConfigurationFile(String filename) { File file = new File(filename).getAbsoluteFile(); if (file.exists()) { return file; } else { return newFile(getSimulatorHome(), "conf", filename).getAbsoluteFile(); } }
Source:
<code>public Response export(Action action) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); String clonedVmName = <START> action.getVmname(); <END> if (StringUtils.isEmpty(action.getVmname())) { clonedVmName = String.format("%s-cloned", vm.getName()); } CloneVmParameters params = new CloneVmParameters(vm, clonedVmName); params.setDestStorageDomainId(getStorageDomainId(action)); ActionType actionType = ActionType.CloneVmNoCollapse; if (action.isSetDiscardSnapshots() && action.isDiscardSnapshots()) { actionType = ActionType.CloneVm; } return doAction(actionType, params, action); }</code><technical_language>V</technical_language>

Target:
public Response export(Action action) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); String clonedVmName = action.getExportedVmName(); if (StringUtils.isEmpty(action.getExportedVmName())) { clonedVmName = String.format("%s-cloned", vm.getName()); } CloneVmParameters params = new CloneVmParameters(vm, clonedVmName); params.setDestStorageDomainId(getStorageDomainId(action)); ActionType actionType = ActionType.CloneVmNoCollapse; if (action.isSetDiscardSnapshots() && action.isDiscardSnapshots()) { actionType = ActionType.CloneVm; } return doAction(actionType, params, action); }
Source:
<code>private void addAuditLogForPartialVMs() { <START> String missingEntities <END> = ""; if (getParameters().isAllowPartialImport() && !failedDisksToImportForAuditLog.isEmpty()) { missingEntities += StringUtils.join(failedDisksToImportForAuditLog.values(), ", ") + " "; } if (getParameters().isAllowPartialImport() && !missingAffinityGroups.isEmpty()) { missingEntities += StringUtils.join(missingAffinityGroups, ", ") + " "; } if (getParameters().isAllowPartialImport() && !missingAffinityLabels.isEmpty()) { missingEntities += StringUtils.join(missingAffinityLabels, ", ") + " "; } if (getParameters().isAllowPartialImport() && !missingUsers.isEmpty()) { missingEntities += StringUtils.join(missingUsers, ", ") + " "; } if (getParameters().isAllowPartialImport() && !missingRoles.isEmpty()) { missingEntities += StringUtils.join(missingRoles, ", ") + " "; } addCustomValue("MissingEntities", missingEntities); auditLogDirector.log(this, AuditLogType.IMPORTEXPORT_PARTIAL_VM_MISSING_ENTITIES); }</code><technical_language>StringBuilder concat instead of +</technical_language>

Target:
private void addAuditLogForPartialVMs() { StringBuilder missingEntities = new StringBuilder(); if (getParameters().isAllowPartialImport() && !failedDisksToImportForAuditLog.isEmpty()) { missingEntities.append("Disks: "); missingEntities.append(StringUtils.join(failedDisksToImportForAuditLog.values(), ", ") + " "); } if (getParameters().isAllowPartialImport() && !missingAffinityGroups.isEmpty()) { missingEntities.append("Affinity groups: "); missingEntities.append(StringUtils.join(missingAffinityGroups, ", ") + " "); } if (getParameters().isAllowPartialImport() && !missingAffinityLabels.isEmpty()) { missingEntities.append("Affinity labels: "); missingEntities.append(StringUtils.join(missingAffinityLabels, ", ") + " "); } if (getParameters().isAllowPartialImport() && !missingUsers.isEmpty()) { missingEntities.append("Users: "); missingEntities.append(StringUtils.join(missingUsers, ", ") + " "); } if (getParameters().isAllowPartialImport() && !missingRoles.isEmpty()) { missingEntities.append("Roles: "); missingEntities.append(StringUtils.join(missingRoles, ", ") + " "); } addCustomValue("MissingEntities", missingEntities.toString()); auditLogDirector.log(this, AuditLogType.IMPORTEXPORT_PARTIAL_VM_MISSING_ENTITIES); }
Source:
<code>public Method getOnBinaryMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); if (methods == null) { return null; } <START> for (Method method : methods) { <END> if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(byte[].class) || paraList.contains(ByteBuffer.class)) { return method; } } } return null; }</code><technical_language>Consider java 8 streams</technical_language>

Target:
public Optional<Method> getOnBinaryMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); Method returnMethod = null; for (Method method : methods) { if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(byte[].class) || paraList.contains(ByteBuffer.class)) { returnMethod = method; } } } return Optional.ofNullable(returnMethod); }
Source:
<code>public void testTriggerTaskInCanceledCase() throws Exception { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertNotNull(caseId); assertTrue(caseId.startsWith(CASE_HR_ID_PREFIX)); List<TaskSummary> caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_YODA, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); caseClient.cancelCaseInstance(CONTAINER_ID, caseId); try { caseClient.triggerAdHocFragment(CONTAINER_ID, caseId, HELLO_2_TASK, Collections.EMPTY_MAP); fail("AdHoc Task was trigged from canceled case."); } catch (KieServicesHttpException ex) { assertTrue(ex.getMessage().startsWith("Unexpected HTTP response code")); assertEquals(Integer.valueOf(404), ex.getHttpCode()); } catch (KieServicesException e) { <START> assertEquals("Case with id " + caseId + " was not found", e.getMessage()); <END> } caseClient.destroyCaseInstance(CONTAINER_ID, caseId); }</code><technical_language>is obvious exception thrown multiple catch statements. is expected behavior</technical_language>

Target:
public void testTriggerTaskInCanceledCase() throws Exception { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertNotNull(caseId); assertTrue(caseId.startsWith(CASE_HR_ID_PREFIX)); List<TaskSummary> caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_YODA, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); caseClient.cancelCaseInstance(CONTAINER_ID, caseId); assertClientException( () -> caseClient.triggerAdHocFragment(CONTAINER_ID, caseId, HELLO_2_TASK, Collections.EMPTY_MAP), 404, "Could not find case instance \"" + caseId + "\"", "Case with id " + caseId + " was not found"); caseClient.destroyCaseInstance(CONTAINER_ID, caseId); }
Source:
<code>public POSSample produce(JCas aJCas) { Sentence sentence = sentences.next(); if (!sentences.hasNext()) { documentComplete(); } List<String> words = new ArrayList<>(); List<String> tags = new ArrayList<>(); for (Token t : selectCovered(Token.class, sentence)) { words.add(t.getCoveredText()); POS pos = t.getPos(); if (pos == null) { throw new IllegalStateException("Token +t.getCoveredText()+ has no POS"); } if (pos.getPosValue() != null) { tags.add(pos.getPosValue()); } else { <START> tags.add(pos.getType().getShortName().substring(4)); <END> } } return new POSSample(words, tags); }</code><technical_language>Actually, PosValue null. do hit this case</technical_language>

Target:
public POSSample produce(JCas aJCas) { Sentence sentence = sentences.next(); if (!sentences.hasNext()) { documentComplete(); } List<String> words = new ArrayList<>(); List<String> tags = new ArrayList<>(); for (Token t : selectCovered(Token.class, sentence)) { words.add(t.getCoveredText()); if (t.getPos() == null) { throw new IllegalStateException("Token +t.getCoveredText()+ has no POS"); } tags.add(t.getPos().getPosValue()); } return new POSSample(words, tags); }
Source:
<code>private ElementTag createButton(String content, String buttonClass, String id, String href, String title, String dataToggle, String onClick, boolean isDisabled){ ElementTag button = new ElementTag(content); if ((buttonClass != null) && (!buttonClass.equals(""))) { button.setAttribute("class", buttonClass); } if ((id != null) && (!id.equals(""))) { button.setAttribute("id", id); } <START> if ((href != null) && (!href.equals(""))) { <END> button.setAttribute("href", href); } if (title != null) { button.setAttribute("title", title); button.setAttribute("data-placement", "top"); } if (dataToggle != null) { button.setAttribute("data-toggle", dataToggle); } if ((onClick != null) && (!onClick.equals(""))) { button.setAttribute("onclick", onClick); } if (isDisabled) { button.setAttribute("disabled", "disabled"); } return button; }</code><technical_language>string.isEmpty() easier read string.equals("") here</technical_language>

Target:
private ElementTag createButton(String content, String buttonClass, String id, String href, String title, String dataToggle, String onClick, boolean isDisabled){ ElementTag button = new ElementTag(content); if (buttonClass != null) { button.setAttribute("class", buttonClass); } if (id != null) { button.setAttribute("id", id); } if (href != null) { button.setAttribute("href", href); } if (title != null) { button.setAttribute("title", title); button.setAttribute("data-placement", "top"); } if (dataToggle != null) { button.setAttribute("data-toggle", dataToggle); } if (onClick != null) { button.setAttribute("onclick", onClick); } if (isDisabled) { button.setAttribute("disabled", "disabled"); } return button; }
Source:
<code>@Override final String doReadUtf8(int length) { <START> String result = new String(buf, pos, length, UTF_8); <END> pos += length; return result; }</code><technical_language>require(length)</technical_language>

Target:
@Override final String doReadUtf8(int length) { String result = new String(buf, offset, length, UTF_8); offset += length; return result; }
Source:
<code>public Practitioner createFHIRPractitioner(Practitioner practitioner) { Provider provider=null; <START> if (practitioner.getGender().equalsIgnoreCase(String.valueOf(AdministrativeGenderEnum.UNKNOWN))&&practitioner.getBirthDate()==null){ <END> provider=new Provider(); HumanNameDt humanNameDt= practitioner.getName(); if (humanNameDt.getUse() != null) { String getUse = humanNameDt.getUse(); if (String.valueOf(NameUseEnum.USUAL).equalsIgnoreCase(getUse)) { List<StringDt> givenNames = humanNameDt.getGiven(); StringDt givenName = givenNames.get(0); provider.setName(valueOf(givenName)); } } List<IdentifierDt> identifiers=practitioner.getIdentifier(); IdentifierDt idnt=identifiers.get(0); provider.setIdentifier(idnt.getValue()); Provider omrsProvider = Context.getProviderService().saveProvider(provider); return FHIRPractitionerUtil.generatePractitioner(omrsProvider); }else{ Person person=FHIRPractitionerUtil.generateOpenMRSPerson(practitioner); provider = new Provider(); List<IdentifierDt> identifiers=practitioner.getIdentifier(); if (identifiers != null) { IdentifierDt idnt=identifiers.get(0); provider.setIdentifier(idnt.getValue()); } return FHIRPractitionerUtil.generatePractitioner(provider); } }</code><technical_language>contant equals variable. patttern avoid null pointers</technical_language>

Target:
public Practitioner createFHIRPractitioner(Practitioner practitioner) { Provider provider = new Provider(); Person prsnProvider = FHIRPractitionerUtil.generateOpenMRSPerson(practitioner); List<IdentifierDt> identifiers = practitioner.getIdentifier(); if (!identifiers.isEmpty()) { IdentifierDt idnt = identifiers.get(0); provider.setIdentifier(idnt.getValue()); } provider.setPerson(prsnProvider); Provider omrsProvider = Context.getProviderService().saveProvider(provider); return FHIRPractitionerUtil.generatePractitioner(omrsProvider); }
Source:
<code><START> public static double lgmultivariategamma(int p, double x) { <END> double ret = Math.log(Math.PI) * p * (p - 1) * 0.25; for (int i = 1; i <= p; i++) { ret += Gamma.lgamma(x + (1 - i) * 0.5); } return ret; }</code><technical_language>I this private for now, if other code it</technical_language>

Target:
private static double lgmultivariategamma(int p, double x) { double ret = Math.log(Math.PI) * p * (p - 1) * 0.25; for (int i = 1; i <= p; i++) { ret += Gamma.lgamma(x + (1 - i) * 0.5); } return ret; }
Source:
<code><START> public void testRandomMethodSorter() { <END> List<String> original = Arrays.asList(ALPHA, BETA, DELTA, EPSILON, GAMMA_VOID, GAMMA_BOOLEAN); List<String> result1 = getDeclaredMethodNames(DummySortRandom.class); assertNotEquals(original, result1); List<String> result2 = getDeclaredMethodNames(DummySortRandom.class); assertNotEquals(result1, result2); }</code><technical_language>This test occasionally fail</technical_language>

Target:
public void testRandomMethodSorter() { List<String> original = Arrays.asList(ALPHA, BETA, DELTA, EPSILON, GAMMA_VOID, GAMMA_BOOLEAN); List<String> result1; do{ result1 = getDeclaredMethodNames(DummySortRandom.class); } while(original.equals(result1)); List<String> result2; do { result2 = getDeclaredMethodNames(DummySortRandom.class); } while(result1.equals(result2)); }
Source:
<code>protected void onResume() { super.onResume(); if (getIntent().getBooleanExtra("FROM_LOG_OUT_BUTTON", false)) { <START> Log.d("LandingActivity", "onResume: FROM_LOG_OUT_BUTTON == false"); <END> } else if (getIntent().getAction().equals(Intent.ACTION_VIEW)) { Log.d("LandingActivity", "onResume: getIntent().getAction().equals(Intent.ACTION_VIEW"); Uri uri = getIntent().getData(); String error = uri.getQueryParameter("error"); if (error != null) { showErrorDialog(); Log.d("LandingActivity", "onResume: error = " + error); AnalyticsTracker.getInstance(getApplicationContext()).trackEvent( "Error in LandingActivity onResume()", loggedIn); } else { String authCode = uri.getQueryParameter("code"); Intent intent = new Intent(this, AccountRetrievalService.class); intent.putExtra("AUTHCODE", authCode); intent.putExtra("REDIRECT_URI", REDIRECT_URI); intent.putExtra("CLIENT_ID", CLIENT_ID); startService(intent); Intent loadingActivityIntent = new Intent(this, LoadingActivity.class); startActivity(loadingActivityIntent); } } }</code><technical_language>intend leave this Log call</technical_language>

Target:
protected void onResume() { super.onResume(); if (getIntent().getBooleanExtra("FROM_LOG_OUT_BUTTON", false)) { Toast.makeText(getApplicationContext(), R.string.log_out_toast_confirm, Toast.LENGTH_LONG).show(); } else if (getIntent().getAction().equals(Intent.ACTION_VIEW)) { Uri uri = getIntent().getData(); String error = uri.getQueryParameter("error"); if (error != null) { showErrorDialog(); } else { String authCode = uri.getQueryParameter("code"); Intent intent = new Intent(this, AccountRetrievalService.class); intent.putExtra(AUTHCODE_KEY, authCode); intent.putExtra(REDIRECT_URI_KEY, REDIRECT_URI); intent.putExtra(CLIENT_ID_KEY, CLIENT_ID); startService(intent); Intent loadingActivityIntent = new Intent(this, LoadingActivity.class); startActivity(loadingActivityIntent); } } }
Source:
<code>public Map<String, Object> getConstants() { final Map<String, Object> constants = new HashMap<>(); <START> constants.put(ANY.jsName(), ANY.name()); <END> constants.put(SECURE_SOFTWARE.jsName(), SECURE_SOFTWARE.name()); constants.put(SECURE_HARDWARE.jsName(), SECURE_HARDWARE.name()); return constants; }</code><technical_language>follow code style in this library: suggestion constants.put(SecurityLevel.ANY.jsName(), SecurityLevel.ANY.name());</technical_language>

Target:
public Map<String, Object> getConstants() { final Map<String, Object> constants = new HashMap<>(); constants.put(SecurityLevel.ANY.jsName(), SecurityLevel.ANY.name()); constants.put(SecurityLevel.SECURE_SOFTWARE.jsName(), SecurityLevel.SECURE_SOFTWARE.name()); constants.put(SecurityLevel.SECURE_HARDWARE.jsName(), SecurityLevel.SECURE_HARDWARE.name()); return constants; }
Source:
<code>private double sum(final int[] values) { final int length = values.length; double total = 0; <START> for (int i = 0; i < length; ++i) { <END> total += values[i]; } return total; }</code><technical_language>i++ is generally convention explicitly need preincrement</technical_language>

Target:
private double sum(final int[] values) { final int length = values.length; double total = 0; for (int i = 0; i < length; i++) { total += values[i]; } return total; }
Source:
<code>public void testOnlyInternalScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingGlobal(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(etd.getInternal()).thenReturn(ist); Mockito.when(ist.getPreScript()).thenReturn(s2); Mockito.when(ist.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); <START> assertEquals(true, result); <END> }</code><technical_language>assertEquals is relevant</technical_language>

Target:
public void testOnlyInternalScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingGlobal(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(etd.getInternal()).thenReturn(ist); Mockito.when(ist.getPreScript()).thenReturn(s2); Mockito.when(ist.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
<code>public void adsLeaderboardOnPageWithInfobox(String wikiName, <START> String article, <END> String adUnit) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage); ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC); Point leaderboardLocation = driver.findElement(By.id(MOBILE_TOP_LEADERBOARD)).getLocation(); Point infoboxLocation = driver.findElement(By.className("portable-infobox")).getLocation(); Assertion.assertTrue(leaderboardLocation.getY() > infoboxLocation.getY()); }</code><technical_language>alighment</technical_language>

Target:
public void adsLeaderboardOnPageWithInfobox(String wikiName, String article, String adUnit) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage); PortableInfobox infobox = new PortableInfobox(); ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC); Assertion.assertTrue( ads.getElementTopPositionByCssSelector(AdsContent.getSlotSelector(AdsContent.MOBILETOP_LB)) >= infobox.getElementBottomPositionByCssSelector(PORTABLE_INFOBOX) ); }
Source:
<code>public void addContents(@NonNull Container container) { Jenkins jenkins = Jenkins.getInstance(); if(jenkins != null) { File configFile = new File(jenkins.getRootDir(), "config.xml"); if (configFile.exists()) { try { File patchedXmlFile = SecretHandler.findSecrets(configFile); container.add(new FileContent("jenkins-root-configuration-files/" + configFile.getName(), patchedXmlFile)); } catch (Exception e) { <START> logger.log(Level.WARNING, "could not add the {0} configuration file to the support bundle because of: {1}", new Object[]{configFile.getName(), e}); <END> } } } }</code><technical_language>a WARNING? If user requested/checked some file, work, ERROR IMO</technical_language>

Target:
public void addContents(@NonNull Container container) { Jenkins jenkins = Helper.getActiveInstance(); File configFile = new File(jenkins.getRootDir(), "config.xml"); if (configFile.exists()) { File patchedXmlFile = null; try { patchedXmlFile = SecretHandler.findSecrets(configFile); container.add(new FileContent("jenkins-root-configuration-files/" + configFile.getName(), patchedXmlFile)); } catch (IOException | ParserConfigurationException | XMLStreamException | SAXException | TransformerException e) { LOGGER.log(Level.WARNING, "could not add the {0} configuration file to the support bundle because of: {1}", new Object[]{configFile.getName(), e}); } finally { if (patchedXmlFile != null) { if(!patchedXmlFile.delete()) { LOGGER.log(Level.WARNING, "Failed to delete tmp file {0}", new Object[]{ patchedXmlFile.getPath() }); } } } } else { LOGGER.log(Level.WARNING, "Jenkins global config file does not exist."); } }
Source:
<code>void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor) throws JavaModelException { WorkspaceJob touchJob = new WorkspaceJob(Messages.synchronizing_projects_job) { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, projectsToTouch.length); for (IProject iProject : projectsToTouch) { if (JavaBuilder.DEBUG) { System.out.println("Touching project " + iProject.getName()); } if <START> (iProject.isOpen()) <END> { iProject.touch(subMonitor.split(1)); } } return Status.OK_STATUS; } public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family; } }; touchJob.schedule(); }</code><technical_language>isAccessible() here, covers deleted projects</technical_language>

Target:
void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor) throws JavaModelException { WorkspaceJob touchJob = new WorkspaceJob(Messages.synchronizing_projects_job) { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, projectsToTouch.length); for (IProject iProject : projectsToTouch) { if (JavaBuilder.DEBUG) { System.out.println("Touching project " + iProject.getName()); } if (iProject.isAccessible()) { iProject.touch(subMonitor.split(1)); } } return Status.OK_STATUS; } public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family; } }; touchJob.schedule(); }
Source:
<code>private Client buildMockClient() { Client client = Mockito.mock(Client.class); <START> Mockito.when(client.target(Mockito.any(URI.class))).thenReturn(buildMockWebTarget()); <END> return client; }</code><technical_language>code building a new WebTarget invocation. new code do that, then() instead of thenReturn(), a lambda expression method reference accordingly</technical_language>

Target:
private Client buildMockClient() { Client client = Mockito.mock(Client.class); Mockito.when(client.target(Mockito.any(URI.class))).then(this::buildMockWebTarget); return client; }
Source:
<code>public Map<String, String> build() { Map<String, String> map = new HashMap<>(); if (_guid != null) map.put(GUID, _guid); if (_zoneId != null) map.put(ZONE_ID, _zoneId); if (_hostName != null) map.put(HOST_NAME, _hostName); if (_cmsUser != null) map.put(CMS_USER, _cmsUser); if (_cmsUserPassword != null) map.put(CMS_USER_PASSWORD, _cmsUserPassword); if (_port != null) map.put(PORT, _port); if (_apiVersion != null) map.put(API_VERSION, _apiVersion); if (_apiRelativePath != null) map.put(API_RELATIVE_PATH, _apiRelativePath); if (_retryCount != null) map.put(RETRY_COUNT, _retryCount); if (_retryInterval != null) map.put(RETRY_INTERVAL, _retryInterval); <START> if (_nuageVspCmsId != null) map.put(NUAGE_VSP_CMS_ID, _nuageVspCmsId); <END> return map; }</code><technical_language>Please consider creating a utility method DRY out this code: public static <K, V> void putWhenNotNull(final Map<K, V> map, key, V value) { Preconditions.checkArgument(map != null); Preconditions.checkArgument(key != null); if (value != null) { map.put(key, value); } }</technical_language>

Target:
public Map<String, String> build() { Map<String, String> map = new HashMap<>(); putIfPresent(map, GUID, _guid); putIfPresent(map, ZONE_ID, _zoneId); putIfPresent(map, HOST_NAME, _hostName); putIfPresent(map, CMS_USER, _cmsUser); putIfPresent(map, CMS_USER_PASSWORD, _cmsUserPassword); putIfPresent(map, PORT, _port); putIfPresent(map, API_VERSION, _apiVersion); putIfPresent(map, API_RELATIVE_PATH, _apiRelativePath); putIfPresent(map, RETRY_COUNT, _retryCount); putIfPresent(map, RETRY_INTERVAL, _retryInterval); putIfPresent(map, NUAGE_VSP_CMS_ID, _nuageVspCmsId); return map; }
Source:
<code>void setMaf(double maf) { if ((maf < 0.0 || maf > 1.0) && maf != -1.0) { <START> throw new IllegalArgumentException("minimum allele frequency (maf=" + maf + ") should be in range [0.0, 1.0] or -1.0 if undefined"); <END> } this.maf = maf; }</code><technical_language>letter in exception messages capitalized</technical_language>

Target:
void setMaf(double maf) { if ((maf < 0.0 || maf > 1.0) && maf != -1.0) { throw new IllegalArgumentException("Minimum allele frequency (maf=" + maf + ") should be in range [0.0, 1.0] or -1.0 if undefined"); } this.maf = maf; }
Source:
<code>public void testRecord001() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String contents = "package pkg;\n" + <START> "public record Point() {\n" + <END> " public Point {\n" + " System.out.println(\"no error\");\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true ); IJavaProject javaProject = this.workingCopy.getJavaProject(); String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true); try { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE); ASTNode node = buildAST( contents, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit compilationUnit = (CompilationUnit) node; assertProblemsSize(compilationUnit, 0); } finally { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old); } }</code><technical_language>remove public if X</technical_language>

Target:
public void testRecord001() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String contents = "public record X() {\n" + " public X {\n" + " System.out.println(\"no error\");\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true ); IJavaProject javaProject = this.workingCopy.getJavaProject(); String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true); try { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE); ASTNode node = buildAST( contents, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit compilationUnit = (CompilationUnit) node; assertProblemsSize(compilationUnit, 0); } finally { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old); } }
Source:
<code>private ArrayList<Long> getIds(Context context){ <START> String[] s_ids = PreferenceManager.getDefaultSharedPreferences(context).getString(MAIL_NOTIFS, "").split(";"); <END> ArrayList<Long> ids = new ArrayList<>(); for (String s : s_ids){ ids.add(Long.parseLong(s)); } return ids; }</code><technical_language>need a single SharedPreferences access app's references</technical_language>

Target:
private ArrayList<Long> getIds(Context context){ String[] s_ids = MyPreferencesManager.getPreferences(context).getString(MAIL_NOTIFS, "").split(";"); ArrayList<Long> ids = new ArrayList<>(); for (String s : s_ids){ ids.add(Long.parseLong(s)); } return ids; }
Source:
<code>public Tuple next() throws SQLException { while (count < offset) { if (super.next() == null) { return null; } count++; } <START> if (limit >= 0 && count++ >= limit) { return null; } <END> return super.next(); }</code><technical_language>this {{count}} {{count++}}</technical_language>

Target:
public Tuple next() throws SQLException { while (offsetCount < offset) { if (super.next() == null) { return null; } offsetCount++; } if (limit >= 0 && count++ >= limit) { return null; } return super.next(); }
Source:
<code><START> private static MethodDeclarationTree getEnclosingConstructor(Tree tree) { <END> FunctionTree function = (FunctionTree) CheckUtils.getFirstAncestor(tree, TreeKinds.functionKinds().toArray(new Tree.Kind[0])); if (function != null && isConstructor(function)) { return (MethodDeclarationTree) function; } return null; }</code><technical_language>@ivandalbosco This method annotated withjavax.annotation.CheckForNull</technical_language>

Target:
private static MethodDeclarationTree getEnclosingConstructor(Tree tree) { FunctionTree function = (FunctionTree) CheckUtils.getFirstAncestor(tree, KindSet.FUNCTION_KINDS); if (function != null && isConstructor(function)) { return (MethodDeclarationTree) function; } return null; }