auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String encodeTo(Node node) { String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName(); <START> return encodeTo("/computer/"+ nodePath, node.getDisplayName()); <END> }</code><technical_language>I want reuse Computer.getUrl, escapes special characters in URL. (But needs fixed getName getDisplayName. getSearchUrl in Computer Node need fixed implementation.)</technical_language>

Target:
public static String encodeTo(Node node) { Computer c = node.toComputer(); if (c != null) { return encodeTo("/" + c.getUrl(), node.getDisplayName()); } String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName(); return encodeTo("/computer/" + nodePath, node.getDisplayName()); }
Source:
<code>ByteBuffer getBytes() { ByteBuffer value = ByteBuffer.allocate(indexValueSizeInBytes); if (version == PersistentIndex.VERSION_0) { value.putLong(size); value.putLong(offset.getOffset()); value.put(flags); value.putLong(expiresAtMs); value.putLong(originalMessageOffset); value.position(0); } else if (version == PersistentIndex.VERSION_1) { value.putLong(size); value.putLong(offset.getOffset()); value.put(flags); value.putInt( <START> expiresAtMs != Utils.Infinite_Time ? Math.toIntExact(expiresAtMs / Time.MsPerSec) : (int) expiresAtMs); <END> value.putLong(originalMessageOffset); value.putInt(operationTimeInSecs); value.putShort(serviceId); value.putShort(containerId); value.position(0); } return value; }</code><technical_language>toIntExact java 1.8. 3 places in this class report error</technical_language>

Target:
ByteBuffer getBytes() { ByteBuffer value; switch (version) { case PersistentIndex.VERSION_0: value = ByteBuffer.allocate(INDEX_VALUE_SIZE_IN_BYTES_V0); value.putLong(size); value.putLong(offset.getOffset()); value.put(flags); value.putLong(expiresAtMs); value.putLong(originalMessageOffset); value.position(0); break; case PersistentIndex.VERSION_1: value = ByteBuffer.allocate(INDEX_VALUE_SIZE_IN_BYTES_V1); value.putLong(size); value.putLong(offset.getOffset()); value.put(flags); value.putInt(expiresAtMs != Utils.Infinite_Time ? (int) (expiresAtMs / Time.MsPerSec) : (int) expiresAtMs); value.putLong(originalMessageOffset); value.putInt(operationTimeInMs != Utils.Infinite_Time ? (int) (operationTimeInMs / Time.MsPerSec) : (int) operationTimeInMs); value.putShort(serviceId); value.putShort(containerId); value.position(0); break; default: throw new IllegalArgumentException("Unsupported version " + version + " for IndexValue "); } return value; }
Source:
<code>private void index(IFeatureModel childModel, IFeatureModel parentModel) { String childId = childModel.getFeature().getId(); <START> Collection<IFeatureModel> parents = includingFeatures.get(childId); <END> if (parents == null) { parents = new HashSet<>(); includingFeatures.put(childId, parents); } parents.add(parentModel); }</code><technical_language>computeIfAbsent</technical_language>

Target:
private void index(IFeatureModel childModel, IFeatureModel parentModel) { String childId = childModel.getFeature().getId(); Collection<IFeatureModel> parents = fIncludingFeatures.computeIfAbsent(childId, key -> new HashSet<>()); parents.add(parentModel); }
Source:
<code>void load(final String type, final String value, final ConstraintType constraintType) { this.constraintValue = value; <START> if (!Objects.isNull(value) && !value.isEmpty() && constraintType == null) { <END> this.constraintType = inferComponentType(value); } else { this.constraintType = constraintType; } prepareView(type, value, constraintType); }</code><technical_language>shorten this condition: java (StringUtils.nonEmpty(value) && constraintType == null) FQN for StringUtils is org.kie.workbench.common.stunner.core.util.StringUtils</technical_language>

Target:
void load(final String type, final String value, final ConstraintType constraintType) { this.constraintValue = value; if (!StringUtils.isEmpty(value) && constraintType == null) { this.constraintType = inferComponentType(value); } else { this.constraintType = constraintType; } prepareView(type, value, constraintType); }
Source:
<code>public CharSequence getContent() throws IllegalEditorStateException { if (!isAdded()) { throw new IllegalEditorStateException(); } if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) { mContentHtml = mSourceViewContent.getText().toString(); return StringUtils.notNullStr(mContentHtml); } if (Looper.myLooper() == Looper.getMainLooper()) { AppLog.d(T.EDITOR, "getContent() called from UI thread"); } mGetContentCountDownLatch = new CountDownLatch(1); getActivity().runOnUiThread(new Runnable() { @Override public void run() { mWebView.execJavaScriptFromString("ZSSEditor.getField('zss_field_content').getHTMLForCallback();"); } }); try { mGetContentCountDownLatch.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { AppLog.e(T.EDITOR, e); Thread.currentThread().interrupt(); } mContentHtml = StringUtils.notNullStr(mContentHtml); <START> if (mContentHtml.charAt(0) == '\u200B') { <END> mContentHtml = mContentHtml.substring(1, mContentHtml.length()); } return mContentHtml; }</code><technical_language>This a StringIndexOutOfBoundsException if switch HTML mode (or exit editor, wait for autosave) adding content. Process: org.wordpress.android.beta, PID: 22501 java.lang.StringIndexOutOfBoundsException: length=0; index=0 java.lang.String.charAt(Native Method) org.wordpress.android.editor.EditorFragment.getContent(EditorFragment.java:1017) org.wordpress.android.editor.EditorFragment$6.run(EditorFragment.java:650)</technical_language>

Target:
public CharSequence getContent() throws IllegalEditorStateException { if (!isAdded()) { throw new IllegalEditorStateException(); } if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) { mContentHtml = mSourceViewContent.getText().toString(); return StringUtils.notNullStr(mContentHtml); } if (Looper.myLooper() == Looper.getMainLooper()) { AppLog.d(T.EDITOR, "getContent() called from UI thread"); } mGetContentCountDownLatch = new CountDownLatch(1); getActivity().runOnUiThread(new Runnable() { @Override public void run() { mWebView.execJavaScriptFromString("ZSSEditor.getField('zss_field_content').getHTMLForCallback();"); } }); try { mGetContentCountDownLatch.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { AppLog.e(T.EDITOR, e); Thread.currentThread().interrupt(); } return StringUtils.notNullStr(mContentHtml); }
Source:
<code>public void update(InventoryScreen inventoryScreen, SolApplication solApplication) { Hero hero = solApplication.getGame().getHero(); SolItem selectedItem = inventoryScreen.getSelectedItem(); boolean itemPurchasable = (selectedItem != null && hero.getMoney() >= selectedItem.getPrice()); inventoryScreen.getInteractButton().setEnabled(itemPurchasable); <START> inventoryScreen.setInteractText("Change"); <END> }</code><technical_language>setting (static) button text in Update()</technical_language>

Target:
public void update(InventoryScreen inventoryScreen, SolApplication solApplication) { Hero hero = solApplication.getGame().getHero(); SolItem selectedItem = inventoryScreen.getSelectedItem(); boolean itemPurchasable = (selectedItem != null && hero.getMoney() >= selectedItem.getPrice()); inventoryScreen.getInteractButton().setEnabled(itemPurchasable); }
Source:
<code>public void add(long id) { if (id == 0) { throw new IllegalArgumentException(); } try { if (id > 0 && id <= 0x00000000FFFFFFFFL) { this.currentInts.get().add((int) id); } else { this.currentLongs.get().add(id); } } catch (IllegalArgumentException illegalArgumentException) { logger.warn( <START> "There are too many entries within the disk-store, please execute an offline compaction.", <END> illegalArgumentException); if (id > 0 && id <= 0x00000000FFFFFFFFL) { IntOpenHashSet overflownHashSet = new IntOpenHashSet((int) INVALID_ID); allInts.add(overflownHashSet); currentInts.set(overflownHashSet); currentInts.get().add((int) id); } else { LongOpenHashSet overflownHashSet = new LongOpenHashSet((int) INVALID_ID); allLongs.add(overflownHashSet); currentLongs.set(overflownHashSet); currentLongs.get().add(id); } } }</code><technical_language>"Too entries", this is referring deleted entries, right? In case changing "large number of deleted entries"</technical_language>

Target:
public void add(long id) { if (id == 0) { throw new IllegalArgumentException(); } try { if (id > 0 && id <= 0x00000000FFFFFFFFL) { this.currentInts.get().add((int) id); } else { this.currentLongs.get().add(id); } } catch (IllegalArgumentException illegalArgumentException) { logger.warn( "There is a large number of deleted entries within the disk-store, please execute an offline compaction."); if (id > 0 && id <= 0x00000000FFFFFFFFL) { IntOpenHashSet overflownHashSet = new IntOpenHashSet((int) INVALID_ID); allInts.add(overflownHashSet); currentInts.set(overflownHashSet); currentInts.get().add((int) id); } else { LongOpenHashSet overflownHashSet = new LongOpenHashSet((int) INVALID_ID); allLongs.add(overflownHashSet); currentLongs.set(overflownHashSet); currentLongs.get().add(id); } } }
Source:
<code>public boolean isReadOnly() { DynaClass clazz = getDynaClass(); if(clazz instanceof WrapDynaClass){ return ((WrapDynaClass)clazz).getPropertyDescriptor(propertyName). getWriteMethod() == null; } <START> return false; <END> }</code><technical_language>Read unsupported in custom cases</technical_language>

Target:
public boolean isReadOnly() { DynaClass clazz = getDynaClass(); if(clazz instanceof WrapDynaClass){ return ((WrapDynaClass)clazz).getPropertyDescriptor(propertyName). getWriteMethod() == null; } return readOnly; }
Source:
<code>public void shouldSaveAllergyWithCodedAllergen() throws Exception { Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Patient patient = allergy.getPatient(); String json = "{\"allergen\": {\"allergenType\":\"DRUG\", \"codedAllergen\": { \"uuid\": \"35d3346a-6769-4d52-823f-b4b234bac3e3\"} }}"; handle(newPostRequest(getURI(), json)); Allergies allergies = Context.getPatientService().getAllergies(patient); <START> Assert.assertEquals(allergies.size(), 5); <END> }</code><technical_language>indent assertion correctly</technical_language>

Target:
public void shouldSaveAllergyWithCodedAllergen() throws Exception { Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Patient patient = allergy.getPatient(); Allergies allergies = Context.getPatientService().getAllergies(patient); Assert.assertEquals(allergies.size(), 4); String json = "{" + " \"comment\" : \"allergy comment\"," + " \"severity\" : { \"uuid\" : \"35d3346a-6769-4d52-823f-b4b234bac3e3\"}," + " \"allergen\" : " + " { \"allergenType\" : \"DRUG\", " + " \"codedAllergen\" : { \"uuid\" : \"35d3346a-6769-4d52-823f-b4b234bac3e3\"} " + " } " + "}"; SimpleObject savedAllergy = deserialize(handle(newPostRequest(getURI(), json))); Assert.assertEquals("allergy comment", Util.getByPath(savedAllergy, "comment")); Assert.assertEquals("35d3346a-6769-4d52-823f-b4b234bac3e3", Util.getByPath(savedAllergy, "severity/uuid")); Assert.assertEquals("35d3346a-6769-4d52-823f-b4b234bac3e3", Util.getByPath(savedAllergy, "allergen/codedAllergen/uuid")); Assert.assertEquals("DRUG", Util.getByPath(savedAllergy, "allergen/allergenType")); allergies = Context.getPatientService().getAllergies(patient); Assert.assertEquals(allergies.size(), 5); }
Source:
<code>public List<KnowledgeMotionDataRow> translate(File file) throws IOException { Reader reader = new FileReader(file); Iterable<CSVRecord> records = CSVFormat.RFC4180.parse(reader); List<KnowledgeMotionDataRow> result = new ArrayList<>(); for (CSVRecord record : records) { String source = record.get(KnowledgeMotionSpreadsheetColumn.SOURCE.getFieldName()); String id = record.get(KnowledgeMotionSpreadsheetColumn.ID.getFieldName()); String title = record.get(KnowledgeMotionSpreadsheetColumn.TITLE.getFieldName()); String description = record.get(KnowledgeMotionSpreadsheetColumn.DESCRIPTION.getFieldName()); String date = record.get(KnowledgeMotionSpreadsheetColumn.DATE.getFieldName()); String duration = record.get(KnowledgeMotionSpreadsheetColumn.DURATION.getFieldName()); String keywordsString = record.get(KnowledgeMotionSpreadsheetColumn.KEYWORDS.getFieldName()); String altId = record.get(KnowledgeMotionSpreadsheetColumn.ALT_ID.getFieldName()); <START> List<String> keywords = new ArrayList<>(); <END> Matcher keywordMatcher = KEYWORDS.matcher(keywordsString); while (keywordMatcher.find()) { keywords.add(keywordMatcher.group(1)); } result.add(new KnowledgeMotionDataRow(source, id, title, description, date, duration, keywords, altId)); } return result; }</code><technical_language>ImmutableList.builder here</technical_language>

Target:
public List<KnowledgeMotionDataRow> translate(File file) throws IOException { Reader reader = new FileReader(file); Iterator<CSVRecord> records = CSVFormat.RFC4180.withHeader(HEADER).parse(reader).iterator(); records.next(); ImmutableList.Builder<KnowledgeMotionDataRow> resultBuilder = ImmutableList.builder(); while (records.hasNext()) { CSVRecord record = records.next(); String source = record.get(KnowledgeMotionSpreadsheetColumn.SOURCE.getFieldName()); String id = record.get(KnowledgeMotionSpreadsheetColumn.ID.getFieldName()); String title = record.get(KnowledgeMotionSpreadsheetColumn.TITLE.getFieldName()); String description = record.get(KnowledgeMotionSpreadsheetColumn.DESCRIPTION.getFieldName()); String date = record.get(KnowledgeMotionSpreadsheetColumn.DATE.getFieldName()); String duration = record.get(KnowledgeMotionSpreadsheetColumn.DURATION.getFieldName()); String keywordsString = record.get(KnowledgeMotionSpreadsheetColumn.KEYWORDS.getFieldName()); String altId = record.get(KnowledgeMotionSpreadsheetColumn.ALT_ID.getFieldName()); List<String> keywords = new ArrayList<>(); Matcher keywordMatcher = KEYWORDS.matcher(keywordsString); while (keywordMatcher.find()) { keywords.add(keywordMatcher.group(1)); } resultBuilder.add(new KnowledgeMotionDataRow(source, id, title, description, date, duration, keywords, altId)); } return resultBuilder.build(); }
Source:
<code>private void validateExpiredRowsAreNotReturnedUsingData(long phoenixTTL, com.google.common.collect.Table<String, String, Object> upsertedData, DataReader dataReader, SchemaBuilder schemaBuilder) throws SQLException { String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions().getTenantId(); long scnTimestamp = EnvironmentEdgeManager.currentTimeMillis(); Properties props = new Properties(); props.setProperty("CurrentSCN", Long.toString(scnTimestamp)); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); <START> assertTrue("Upserted data should not be null", upsertedData != null); <END> assertTrue("Fetched data should not be null", fetchedData != null); verifyRowsBeforeTTLExpiration(upsertedData, fetchedData); } props.setProperty("CurrentSCN", Long.toString(scnTimestamp + (2 * phoenixTTL * 1000))); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertTrue("Fetched data should not be null", fetchedData != null); assertTrue("Expired rows should not be fetched", fetchedData.rowKeySet().size() == 0); } }</code><technical_language>nit: assertNotNull()</technical_language>

Target:
private void validateExpiredRowsAreNotReturnedUsingData(long phoenixTTL, com.google.common.collect.Table<String, String, Object> upsertedData, DataReader dataReader, SchemaBuilder schemaBuilder) throws SQLException { String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions().getTenantId(); Properties props = new Properties(); long scnTimestamp = EnvironmentEdgeManager.currentTimeMillis(); props.setProperty("CurrentSCN", Long.toString(scnTimestamp)); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertNotNull("Upserted data should not be null", upsertedData); assertNotNull("Fetched data should not be null", fetchedData); verifyRowsBeforeTTLExpiration(upsertedData, fetchedData); } props.setProperty("CurrentSCN", Long.toString(scnTimestamp + (2 * phoenixTTL * 1000))); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertNotNull("Fetched data should not be null", fetchedData); assertEquals("Expired rows should not be fetched", 0, fetchedData.rowKeySet().size()); } }
Source:
<code>public void checkBodyType() { AmqpAnnotatedMessage amqpAnnotatedMessage = null; AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); AmqpMessageBody messageBody = null; switch (bodyType) { case DATA: <START> messageBody = AmqpMessageBody.fromData(amqpAnnotatedMessage.getBody().getFirstData()); <END> break; case SEQUENCE: case VALUE: throw new RuntimeException("Body type not supported yet."); default: throw new RuntimeException("Body type not valid."); } END: com.azure.core.amqp.models.AmqpBodyType.checkBodyType }</code><technical_language>curious, repercussions of a user this: messageBody = amqpAnnotatedMessage.getBody();</technical_language>

Target:
public void checkBodyType() { AmqpAnnotatedMessage amqpAnnotatedMessage = null; byte[] payload = null; AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); switch (bodyType) { case DATA: payload = amqpAnnotatedMessage.getBody().getFirstData(); break; case SEQUENCE: case VALUE: throw new RuntimeException("Body type not supported yet."); default: throw new RuntimeException("Body type not valid."); } System.out.println(new String(payload)); END: com.azure.core.amqp.models.AmqpBodyType.checkBodyType }
Source:
<code>public static void setupTestWorkflow(DropwizardTestSupport<DockstoreWebserviceConfiguration> support) throws Exception { LOG.info("Migrating testworkflow migrations"); Application<DockstoreWebserviceConfiguration> application = support.getApplication(); application.run("db", "drop-all", "--confirm-delete-everything", CONFIDENTIAL_CONFIG_PATH); application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "1.3.0.generated"); application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "1.3.1.consistency"); <START> application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "test"); <END> application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "1.4.0"); application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "testworkflow"); application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "1.5.0"); application.run("db", "migrate", CONFIDENTIAL_CONFIG_PATH, "--include", "test_1.5.0"); }</code><technical_language>runMigration() for this</technical_language>

Target:
public static void setupTestWorkflow(DropwizardTestSupport<DockstoreWebserviceConfiguration> support) throws Exception { LOG.info("Migrating testworkflow migrations"); Application<DockstoreWebserviceConfiguration> application = support.getApplication(); application.run("db", "drop-all", "--confirm-delete-everything", CONFIDENTIAL_CONFIG_PATH); List<String> migrationList = Arrays.asList("1.3.0.generated", "1.3.1.consistency", "test", "1.4.0", "testworkflow", "1.5.0", "test_1.5.0"); runMigration(migrationList, application, CONFIDENTIAL_CONFIG_PATH); }
Source:
<code>public void cancel(Account account, OCFile file){ SynchronizeFolderOperation syncOperation = null; String targetKey = buildRemoteName(account, file.getRemotePath()); ArrayList<String> keyItems = new ArrayList<String>(); synchronized (mPendingOperations) { if (file.isFolder()) { Log_OC.d(TAG, "Canceling pending sync operations"); Iterator<String> it = mPendingOperations.keySet().iterator(); boolean found = false; while (it.hasNext()) { String keySyncOperation = it.next(); <START> found = keySyncOperation.contains(targetKey); <END> if (found) { keyItems.add(keySyncOperation); } } } else { Log_OC.d(TAG, "Canceling sync operation"); keyItems.add(buildRemoteName(account, file.getRemotePath())); } } for (String item: keyItems) { syncOperation = mPendingOperations.remove(item); Log_OC.d(TAG, "Key sync operations removed: " + item); if (syncOperation != null) { syncOperation.cancel(); } } Intent intent = new Intent(mService, FileDownloader.class); intent.setAction(FileDownloader.ACTION_CANCEL_FILE_DOWNLOAD); intent.putExtra(FileDownloader.EXTRA_ACCOUNT, account); intent.putExtra(FileDownloader.EXTRA_FILE, file); mService.startService(intent); }</code><technical_language>Please, replace contains startsWith</technical_language>

Target:
public void cancel(Account account, OCFile file){ SynchronizeFolderOperation syncOperation = null; String targetKey = buildRemoteName(account, file.getRemotePath()); ArrayList<String> keyItems = new ArrayList<String>(); synchronized (mPendingOperations) { if (file.isFolder()) { Log_OC.d(TAG, "Canceling pending sync operations"); Iterator<String> it = mPendingOperations.keySet().iterator(); boolean found = false; while (it.hasNext()) { String keySyncOperation = it.next(); found = keySyncOperation.startsWith(targetKey); if (found) { keyItems.add(keySyncOperation); } } } else { Log_OC.d(TAG, "Canceling sync operation"); keyItems.add(buildRemoteName(account, file.getRemotePath())); } } for (String item: keyItems) { syncOperation = mPendingOperations.remove(item); Log_OC.d(TAG, "Key sync operations removed: " + item); if (syncOperation != null) { syncOperation.cancel(); } } Intent intent = new Intent(mService, FileDownloader.class); intent.setAction(FileDownloader.ACTION_CANCEL_FILE_DOWNLOAD); intent.putExtra(FileDownloader.EXTRA_ACCOUNT, account); intent.putExtra(FileDownloader.EXTRA_FILE, file); mService.startService(intent); }
Source:
<code>public void testHardResetWithConflicts_DoOverWriteUntrackedFile() throws JGitInternalException, AmbiguousObjectException, IOException, GitAPIException { setupRepository(); git.rm().setCached(true).addFilepattern("a.txt").call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD) .call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); <START> } <END></code><technical_language>assert content of a.txt "reset --hard" is "content" content "contentnew content" of untracked file a.txt overwritten</technical_language>

Target:
public void testHardResetWithConflicts_DoOverWriteUntrackedFile() throws JGitInternalException, AmbiguousObjectException, IOException, GitAPIException { setupRepository(); git.rm().setCached(true).addFilepattern("a.txt").call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD) .call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); assertEquals("content", read(new File(db.getWorkTree(), "a.txt"))); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { LOGGER.debug("Performing doFilter() on CsrfFilter"); HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String targetContextPath = httpRequest.getRequestURI(); if (protectedContexts.stream().anyMatch(targetContextPath::startsWith)) { String sourceOrigin = httpRequest.getHeader(ORIGIN_HEADER); String sourceReferer = httpRequest.getHeader(REFERER_HEADER); String csrfHeader = httpRequest.getHeader(CSRF_HEADER); if (sourceOrigin == null && sourceReferer == null) { respondForbidden( httpResponse, "Cross-site check failure: Incoming request did not have an Origin or Referer header."); return; } if (!isTrustedAuthority(sourceOrigin) && !isTrustedAuthority(sourceReferer)) { respondForbidden( httpResponse, <START> "Cross-site check failure: Neither the Origin or Referer header matched a system internal or external name."); <END> return; } if (!targetContextPath.startsWith(WEBSOCKET_CONTEXT) && csrfHeader == null) { respondForbidden( httpResponse, "Cross-site check failure: Request did not have required X-Requested-With header."); return; } } chain.doFilter(request, response); }</code><technical_language>"Origin Referer"</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { LOGGER.debug("Performing doFilter() on CsrfFilter"); HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String targetContextPath = httpRequest.getRequestURI(); if (protectedContexts.stream().anyMatch(targetContextPath::startsWith)) { String sourceOrigin = httpRequest.getHeader(ORIGIN_HEADER); String sourceReferer = httpRequest.getHeader(REFERER_HEADER); String csrfHeader = httpRequest.getHeader(CSRF_HEADER); if (sourceOrigin == null && sourceReferer == null) { respondForbidden( httpResponse, "Cross-site check failure: Incoming request did not have an Origin or Referer header."); return; } if (!isTrustedAuthority(sourceOrigin) && !isTrustedAuthority(sourceReferer)) { respondForbidden( httpResponse, "Cross-site check failure: Neither the Origin nor Referer header matched a system internal or external name."); return; } if (!targetContextPath.startsWith(WEBSOCKET_CONTEXT) && csrfHeader == null) { respondForbidden( httpResponse, "Cross-site check failure: Request did not have required X-Requested-With header."); return; } } chain.doFilter(request, response); }
Source:
<code>public String getCustomDefaultContributorRoleAlias(){ if (dvObject instanceof Dataverse && isCustomDefaultConributorRole()){ <START> return defaultContributorRoleAlias.equals("none") ? "none" : roleService.findCustomRoleByAliasAndOwner(defaultContributorRoleAlias,dvObject.getId()).getAlias(); <END> } else { return ""; } }</code><technical_language>this English word "none" moved bundle translated</technical_language>

Target:
public String getCustomDefaultContributorRoleAlias(){ if (dvObject instanceof Dataverse && isCustomDefaultContributorRole()){ return defaultContributorRoleAlias.equals(DataverseRole.NONE) ? DataverseRole.NONE : roleService.findCustomRoleByAliasAndOwner(defaultContributorRoleAlias,dvObject.getId()).getAlias(); } else { return ""; } }
Source:
<code>public synchronized void load() { try { Map.Entry<ManagerSpec, Map<ResourceGroupIdTemplate, ResourceGroupSpec>> specsFromDb = buildSpecsFromDb(); ManagerSpec managerSpec = specsFromDb.getKey(); Map<ResourceGroupIdTemplate, ResourceGroupSpec> resourceGroupSpecs = specsFromDb.getValue(); Set<ResourceGroupIdTemplate> changedSpecs = new HashSet<>(); Set<ResourceGroupIdTemplate> deletedSpecs = Sets.difference(this.resourceGroupSpecs.keySet(), resourceGroupSpecs.keySet()); for (Map.Entry<ResourceGroupIdTemplate, ResourceGroupSpec> entry : resourceGroupSpecs.entrySet()) { if (!entry.getValue().sameConfig(this.resourceGroupSpecs.get(entry.getKey()))) { changedSpecs.add(entry.getKey()); } } this.resourceGroupSpecs = resourceGroupSpecs; this.cpuQuotaPeriod.set(managerSpec.getCpuQuotaPeriod()); this.rootGroups.set(managerSpec.getRootGroups()); this.selectors.set(buildSelectors(managerSpec)); configureChangedGroups(changedSpecs); disableDeletedGroups(deletedSpecs); } catch (Exception e) { <START> log.error("Error loading configuration from db: %s", e); <END> } }</code><technical_language>want pass exception exception parameter logged full stack trace. This print name message</technical_language>

Target:
public synchronized void load() { try { Map.Entry<ManagerSpec, Map<ResourceGroupIdTemplate, ResourceGroupSpec>> specsFromDb = buildSpecsFromDb(); ManagerSpec managerSpec = specsFromDb.getKey(); Map<ResourceGroupIdTemplate, ResourceGroupSpec> resourceGroupSpecs = specsFromDb.getValue(); Set<ResourceGroupIdTemplate> changedSpecs = new HashSet<>(); Set<ResourceGroupIdTemplate> deletedSpecs = Sets.difference(this.resourceGroupSpecs.keySet(), resourceGroupSpecs.keySet()); for (Map.Entry<ResourceGroupIdTemplate, ResourceGroupSpec> entry : resourceGroupSpecs.entrySet()) { if (!entry.getValue().sameConfig(this.resourceGroupSpecs.get(entry.getKey()))) { changedSpecs.add(entry.getKey()); } } this.resourceGroupSpecs = resourceGroupSpecs; this.cpuQuotaPeriod.set(managerSpec.getCpuQuotaPeriod()); this.rootGroups.set(managerSpec.getRootGroups()); this.selectors.set(buildSelectors(managerSpec)); configureChangedGroups(changedSpecs); disableDeletedGroups(deletedSpecs); } catch (Throwable e) { log.error(e, "Error loading configuration from db"); } }
Source:
<code>public void prepareSandboxTask(Path exercisePath, Path submissionPath, Path outputPath, Path tmcRunPath, Path tmcLangsPath) throws NoLanguagePluginFoundException, IOException { Path tempdir = Files.createTempDirectory("sandbox-task"); FileUtils.copyDirectoryStructure(exercisePath.toFile(), tempdir.toFile()); getLanguagePlugin(exercisePath).prepareSubmission(submissionPath, tempdir); TarCreator tarCreator = new TarCreator(); log.info("Copying files to directory " + submissionPath.toString() + " and creating tar ball"); try { tarCreator.createTarFromProject(tempdir, tmcLangsPath, tmcRunPath, outputPath); } catch (ArchiveException ex) { <START> java.util.logging.Logger.getLogger(TaskExecutorImpl.class.getName()).log(Level.SEVERE, null, ex); <END> } FileUtils.forceDelete(tempdir.toFile()); }</code><technical_language>Add a log message project failed. "Failed create tar project {}" is a project name, path that</technical_language>

Target:
public void prepareSandboxTask(Path exercisePath, Path submissionPath, Path outputPath, Path tmcRunPath, Path tmcLangsPath) throws NoLanguagePluginFoundException, IOException { Path tempdir = Files.createTempDirectory("sandbox-task"); FileUtils.copyDirectoryStructure(exercisePath.toFile(), tempdir.toFile()); getLanguagePlugin(exercisePath).prepareSubmission(submissionPath, tempdir); TarCreator tarCreator = new TarCreator(); log.info("Copying files to directory " + submissionPath.toString() + " and creating tar ball"); try { tarCreator.createTarFromProject(tempdir, tmcLangsPath, tmcRunPath, outputPath); } catch (ArchiveException ex) { java.util.logging.Logger.getLogger(TaskExecutorImpl.class.getName()).log(Level.SEVERE, "Failed to create tar from project " + submissionPath, ex); } FileUtils.forceDelete(tempdir.toFile()); }
Source:
<code>public static Iterable<Object[]> data() { return Arrays.asList(new Object[][]{ <START> {FastMoney.of(29.95, "EUR"), FastMoney.of(100.00, "EUR"), FastMoney.of(0.0001, "EUR")}, <END> {Money.of(29.95, "EUR"), Money.of(100.00, "EUR"), Money.of(0.0001, "EUR")}, {RoundedMoney.of(29.95, "EUR", getDefaultRounding()), RoundedMoney.of(100.00, "EUR", getDefaultRounding()), RoundedMoney.of(0.0001, "EUR", getDefaultRounding())}, }); }</code><technical_language>test case for expanding default number of digits missing this inputs. 100 instead of 100.00</technical_language>

Target:
public static Iterable<Object[]> data() { return Arrays.asList(new Object[][]{ {FastMoney.of(29.95, "EUR"), FastMoney.of(100, "EUR"), FastMoney.of(0.0001, "EUR")}, {Money.of(29.95, "EUR"), Money.of(100, "EUR"), Money.of(0.0001, "EUR")}, {RoundedMoney.of(29.95, "EUR", getDefaultRounding()), RoundedMoney.of(100, "EUR", getDefaultRounding()), RoundedMoney.of(0.0001, "EUR", getDefaultRounding())}, }); }
Source:
<code>private Optional<Ref> getBestMatch(List<Ref> tags) { if (tags == null || tags.size() == 0) { return Optional.empty(); } else if (matchers.size() == 0) { if (tags.size() > 1) { Collections.sort(tags, tagTieBreaker); } return Optional.of(tags.get(0)); } else { <START> Comparator<Ref> tieBreaker = tagTieBreaker; <END> for (IMatcher matcher : matchers) { Optional<Ref> match = tags.stream() .filter(tag -> matcher.matches(tag.getName(), false, false)) .sorted(tieBreaker) .findFirst(); if (match.isPresent()) { return match; } } return Optional.empty(); } }</code><technical_language>This is necessary; pass tagTieBreaker line 240</technical_language>

Target:
private Optional<Ref> getBestMatch(List<Ref> tags) { if (tags == null || tags.size() == 0) { return Optional.empty(); } else if (matchers.size() == 0) { if (tags.size() > 1) { Collections.sort(tags, tagTieBreaker); } return Optional.of(tags.get(0)); } else { for (IMatcher matcher : matchers) { Optional<Ref> match = tags.stream() .filter(tag -> matcher.matches(tag.getName(), false, false)) .sorted(tagTieBreaker) .findFirst(); if (match.isPresent()) { return match; } } return Optional.empty(); } }
Source:
<code>public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { final long nanos = TimeUnit.NANOSECONDS.convert(timeout, unit); final long millis = TimeUnit.MILLISECONDS.convert(timeout, unit); final int sleepNanos = (int) (nanos - millis * 1_000_000L); <START> Thread.sleep(millis, sleepNanos); <END> return false; }</code><technical_language>I sleeping sense here, return immediately throw UnsupportedOperationException</technical_language>

Target:
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { try { shutdownPhaser.awaitAdvanceInterruptibly(initialPhase, timeout, unit); return true; } catch (TimeoutException e) { return false; } }
Source:
<code>public TreeElement getTreeElement() { WebElement element = getDriver() .findElement(By.className(CONTAINER_TREE_CLASS)) .findElement(By.className(TREE_CLASS)); <START> getDriver().waitUntilElementIsVisible(By.className(TREE_CLASS)); <END> return new TreeElement(element); }</code><technical_language>I put this line previous instruction #xtree found. WDYT</technical_language>

Target:
public TreeElement getTreeElement() { getDriver().waitUntilElementIsVisible(By.className(TREE_CLASS)); WebElement element = getDriver() .findElement(By.className(CONTAINER_TREE_CLASS)) .findElement(By.className(TREE_CLASS)); return new TreeElement(element); }
Source:
<code>public Response listStaffMemberAddresses(@PathParam("STAFFMEMBERID") Long staffMemberId) { StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } <START> if (!restSecurity.hasPermission(new String[] { UserPermissions.LIST_STAFFMEMBERADDRESES }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { <END> return Response.status(Status.FORBIDDEN).build(); } List<Address> addresses = staffMember.getContactInfo().getAddresses(); if (addresses.isEmpty()) { return Response.noContent().build(); } return Response.ok(objectFactory.createModel(addresses)).build(); }</code><technical_language>Typo: STAFFMEMBERADDRESES</technical_language>

Target:
public Response listStaffMemberAddresses(@PathParam("STAFFMEMBERID") Long staffMemberId) { StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } if (!restSecurity.hasPermission(new String[] { UserPermissions.LIST_STAFFMEMBERADDRESSES }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { return Response.status(Status.FORBIDDEN).build(); } List<Address> addresses = staffMember.getContactInfo().getAddresses(); if (addresses.isEmpty()) { return Response.noContent().build(); } return Response.ok(objectFactory.createModel(addresses)).build(); }
Source:
<code>public static void startServer() { try { if (!serverup){ <START> getSERVER_PORT(); END> Server server = new Server(SERVER_PORT); String appDir = serverRootDir; File fp = new File(appDir); if (!fp.exists()){ fp = new File("/"+appDir); if (fp.exists()) appDir = "/"+appDir; } serverWorkingDir = appDir+"/threejs/editor/"; URI webRootUri = new File(appDir).toURI(); System.out.println("Web Root URI: %s%n"+webRootUri); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.setBaseResource(Resource.newResource(webRootUri)); context.setWelcomeFiles(new String[] { pathToStartPage+"index.html" }); context.getMimeTypes().addMimeMapping("txt","text/plain;charset=utf-8"); context.addServlet(DefaultServlet.class,"/"); context.addServlet(OpenSimSocketServlet.class, "/visEndpoint"); server.setHandler(context); server.start(); serverup = true; server.join(); } } catch (MalformedURLException ex) { Logger.getLogger(JettyMain.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(JettyMain.class.getName()).log(Level.SEVERE, null, ex); } }</code><technical_language>I tell, getSERVER_PORT() edit SERVER_PORT static variable</technical_language>

Target:
public static void startServer() { try { if (!serverup){ Server server = new Server(SERVER_PORT); String appDir = serverRootDir; File fp = new File(appDir); if (!fp.exists()){ fp = new File("/"+appDir); if (fp.exists()) appDir = "/"+appDir; } serverWorkingDir = appDir+"/threejs/editor/"; URI webRootUri = new File(appDir).toURI(); System.out.println("Web Root URI: %s%n"+webRootUri); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.setBaseResource(Resource.newResource(webRootUri)); context.setWelcomeFiles(new String[] { pathToStartPage+"index.html" }); context.getMimeTypes().addMimeMapping("txt","text/plain;charset=utf-8"); context.addServlet(DefaultServlet.class,"/"); context.addServlet(OpenSimSocketServlet.class, "/visEndpoint"); server.setHandler(context); server.start(); serverup = true; server.join(); } } catch (MalformedURLException ex) { Logger.getLogger(JettyMain.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(JettyMain.class.getName()).log(Level.SEVERE, null, ex); } }
Source:
<code>public void draw(Canvas canvas) { Rect bounds = getBounds(); int saveCount = canvas.save(); switch (mType) { case CLIPPING: mPath.setFillType(Path.FillType.EVEN_ODD); canvas.clipPath(mPath); super.draw(canvas); canvas.restoreToCount(saveCount); break; case OVERLAY_COLOR: mPath.setFillType(Path.FillType.EVEN_ODD); <START> canvas.clipPath(mPath); <END> super.draw(canvas); canvas.restoreToCount(saveCount); mPaint.setColor(mOverlayColor); mPaint.setStyle(Paint.Style.FILL); mPath.setFillType(Path.FillType.INVERSE_EVEN_ODD); canvas.drawPath(mPath, mPaint); if (mIsCircle) { float paddingH = (bounds.width() - bounds.height() + mBorderWidth) / 2f; float paddingV = (bounds.height() - bounds.width() + mBorderWidth) / 2f; if (paddingH > 0) { canvas.drawRect(bounds.left, bounds.top, bounds.left + paddingH, bounds.bottom, mPaint); canvas.drawRect( bounds.right - paddingH, bounds.top, bounds.right, bounds.bottom, mPaint); } if (paddingV > 0) { canvas.drawRect(bounds.left, bounds.top, bounds.right, bounds.top + paddingV, mPaint); canvas.drawRect( bounds.left, bounds.bottom - paddingV, bounds.right, bounds.bottom, mPaint); } } break; } if (mBorderColor != Color.TRANSPARENT) { mPaint.setStyle(Paint.Style.STROKE); mPaint.setColor(mBorderColor); mPaint.setStrokeWidth(mBorderWidth); mPath.setFillType(Path.FillType.EVEN_ODD); canvas.drawPath(mBorderPath, mPaint); } }</code><technical_language>clipPath. This is implemented a crash a lot of devices. reason currently do CLIPPING mode all</technical_language>

Target:
public void draw(Canvas canvas) { Rect bounds = getBounds(); switch (mType) { case CLIPPING: int saveCount = canvas.save(); mPath.setFillType(Path.FillType.EVEN_ODD); canvas.clipPath(mPath); super.draw(canvas); canvas.restoreToCount(saveCount); break; case OVERLAY_COLOR: super.draw(canvas); mPaint.setColor(mOverlayColor); mPaint.setStyle(Paint.Style.FILL); mPath.setFillType(Path.FillType.INVERSE_EVEN_ODD); canvas.drawPath(mPath, mPaint); if (mIsCircle) { float paddingH = (bounds.width() - bounds.height() + mBorderWidth) / 2f; float paddingV = (bounds.height() - bounds.width() + mBorderWidth) / 2f; if (paddingH > 0) { canvas.drawRect(bounds.left, bounds.top, bounds.left + paddingH, bounds.bottom, mPaint); canvas.drawRect( bounds.right - paddingH, bounds.top, bounds.right, bounds.bottom, mPaint); } if (paddingV > 0) { canvas.drawRect(bounds.left, bounds.top, bounds.right, bounds.top + paddingV, mPaint); canvas.drawRect( bounds.left, bounds.bottom - paddingV, bounds.right, bounds.bottom, mPaint); } } break; } if (mBorderColor != Color.TRANSPARENT) { mPaint.setStyle(Paint.Style.STROKE); mPaint.setColor(mBorderColor); mPaint.setStrokeWidth(mBorderWidth); mPath.setFillType(Path.FillType.EVEN_ODD); canvas.drawPath(mBorderPath, mPaint); } }
Source:
<code>public boolean isNonPCMEncodedAudio() { <START> return isAC3() || isDTS() || isTrueHD() || isDTSHD(); <END> }</code><technical_language>ATMOS</technical_language>

Target:
public boolean isNonPCMEncodedAudio() { return isAC3() || isAtmos() || isDTS() || isTrueHD() || isDTSHD(); }
Source:
<code>public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { HttpChildChannel httpChildChannel = this.httpChildChannel; if (httpChildChannel != null) { this.httpChildChannel = null; switch (httpChildChannel.readState()) { case UPGRADED: if (httpChildChannel.setReadClosed()) { fireChannelDisconnected(httpChildChannel); fireChannelUnbound(httpChildChannel); fireChannelClosed(httpChildChannel); } break; case CONTENT_COMPLETE: break; default: ChannelException exception = new ChannelException("Channel closed unexpectedly"); exception.fillInStackTrace(); fireExceptionCaught(httpChildChannel, exception); break; } switch (httpChildChannel.writeState()) { case UPGRADED: case CONTENT_CLOSE: if (httpChildChannel.setWriteClosed()) { fireChannelDisconnected(httpChildChannel); fireChannelUnbound(httpChildChannel); fireChannelClosed(httpChildChannel); } break; case CONTENT_COMPLETE: break; default: <START> Channels.fireChannelAborted(httpChildChannel); <END> break; } } }</code><technical_language>is this done in write status switch statement switch read status (which throws "Channel closed unexpectedly" exception}</technical_language>

Target:
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { HttpChildChannel httpChildChannel = this.httpChildChannel; if (httpChildChannel != null) { this.httpChildChannel = null; switch (httpChildChannel.readState()) { case UPGRADED: if (httpChildChannel.setReadClosed()) { fireChannelDisconnected(httpChildChannel); fireChannelUnbound(httpChildChannel); fireChannelClosed(httpChildChannel); } break; case CONTENT_COMPLETE: break; default: Channels.fireChannelAborted(httpChildChannel); break; } switch (httpChildChannel.writeState()) { case UPGRADED: case CONTENT_CLOSE: if (httpChildChannel.setWriteClosed()) { fireChannelDisconnected(httpChildChannel); fireChannelUnbound(httpChildChannel); fireChannelClosed(httpChildChannel); } break; case CONTENT_COMPLETE: break; default: Channels.fireChannelAborted(httpChildChannel); break; } } }
Source:
<code>private void processFreeEntries() { TreeSet<FileEntry> l = new TreeSet<FileEntry>(new FileEntryByOffsetComparator()); l.addAll(freeList); <START> long startTime = System.currentTimeMillis(); <END> int reclaimedSpace = 0; int removedEntries = 0; for (Iterator<FileEntry> it = l.iterator() ; it.hasNext(); ) { FileEntry fe = it.next(); if (!fe.isLocked() && ((fe.offset + fe.size) == filePos)) { try { channel.truncate(fe.offset); filePos = fe.offset; freeList.remove(fe); it.remove(); reclaimedSpace += fe.size; removedEntries++; } catch (IOException e) { throw new PersistenceException("Error while truncating file", e); } } else { break; } } if (trace) { log.tracef("Removed entries: " + removedEntries + ", Reclaimed Space: " + reclaimedSpace); log.tracef("Time taken for truncateFile: " + (System.currentTimeMillis() - startTime) + " (ms)"); } }</code><technical_language>Start time computed if trace is enabled</technical_language>

Target:
private void processFreeEntries() { long startTime = 0; if (trace) startTime = System.currentTimeMillis(); List<FileEntry> l = new ArrayList<FileEntry>(freeList); Collections.sort(l, new FileEntryByOffsetComparator()); int reclaimedSpace = 0; int removedEntries = 0; long truncateOffset = -1; for (Iterator<FileEntry> it = l.iterator() ; it.hasNext(); ) { FileEntry fe = it.next(); if (!fe.isLocked() && ((fe.offset + fe.size) == filePos)) { truncateOffset = fe.offset; filePos = fe.offset; freeList.remove(fe); reclaimedSpace += fe.size; removedEntries++; } else { break; } } if (truncateOffset > 0) { try { channel.truncate(truncateOffset); } catch (IOException e) { throw new PersistenceException("Error while truncating file", e); } } if (trace) { log.tracef("Removed entries: " + removedEntries + ", Reclaimed Space: " + reclaimedSpace); log.tracef("Time taken for truncateFile: " + (System.currentTimeMillis() - startTime) + " (ms)"); } }
Source:
<code>protected Type declareComplex(String name) { <START> ComplexType primitive = TypesFactory.eINSTANCE.createComplexType(); <END> primitive.setName(name); declareType(primitive, name); resource.getContents().add(primitive); return primitive; }</code><technical_language>naming</technical_language>

Target:
protected Type declareComplex(String name) { ComplexType complex = TypesFactory.eINSTANCE.createComplexType(); complex.setName(name); declareType(complex, name); resource.getContents().add(complex); return complex; }
Source:
<code>public Set<MetricNameDto> getTestGroupPlotNamesNewModel(List<TaskDataDto> tests){ try { Set<Long> testIds = CommonUtils.getTestsIds(tests); Multimap<Long, Long> testGroupMap = fetchUtil.getTestsInTestGroup(testIds); List<Object[]> plotNamesNew = getMetricNames(testGroupMap.keySet()); <START> plotNamesNew = filterMonitoring(plotNamesNew); <END> if (plotNamesNew.isEmpty()) { return Collections.EMPTY_SET; } Set<MetricNameDto> result = new HashSet<MetricNameDto>(plotNamesNew.size()); for (Object[] mde : plotNamesNew){ for (TaskDataDto td : tests){ Collection<Long> allTestsInGroup = testGroupMap.get((Long)mde[2]); if (CommonUtils.containsAtLeastOne(td.getIds(), allTestsInGroup)){ result.add(new MetricNameDto(td, (String)mde[0], (String)mde[1], MetricNameDto.Origin.METRIC_GROUP)); } } } return result; } catch (PersistenceException e) { log.debug("Could not fetch test-group metric plot names from MetricPointEntity: {}", DataProcessingUtil.getMessageFromLastCause(e)); return Collections.EMPTY_SET; } }</code><technical_language>filter is applied plot names, summary? show monitoring params in summary decision maker ready</technical_language>

Target:
public Set<MetricNameDto> getTestGroupPlotNamesNewModel(List<TaskDataDto> tests){ try { Set<Long> testIds = CommonUtils.getTestsIds(tests); Multimap<Long, Long> testGroupMap = fetchUtil.getTestsInTestGroup(testIds); List<Object[]> plotNamesNew = getMetricNames(testGroupMap.keySet()); plotNamesNew = CommonUtils.filterMonitoring(plotNamesNew, monitoringPlotGroups); if (plotNamesNew.isEmpty()) { return Collections.EMPTY_SET; } Set<MetricNameDto> result = new HashSet<MetricNameDto>(plotNamesNew.size()); for (Object[] mde : plotNamesNew){ for (TaskDataDto td : tests){ Collection<Long> allTestsInGroup = testGroupMap.get((Long)mde[2]); if (CommonUtils.containsAtLeastOne(td.getIds(), allTestsInGroup)){ result.add(new MetricNameDto(td, (String)mde[0], (String)mde[1], MetricNameDto.Origin.TEST_GROUP_METRIC)); } } } return result; } catch (PersistenceException e) { log.debug("Could not fetch test-group metric plot names from MetricPointEntity: {}", DataProcessingUtil.getMessageFromLastCause(e)); return Collections.EMPTY_SET; } }
Source:
<code><START> public TransactionalBatch(PartitionKey partitionKey) { <END> checkNotNull(partitionKey, "expected non-null partitionKey"); this.operations = new ArrayList<>(); this.partitionKey = partitionKey; }</code><technical_language>this createTransactionalBatch(). do need public? If createTransactionalBatch is public method this package private</technical_language>

Target:
TransactionalBatch(PartitionKey partitionKey) { checkNotNull(partitionKey, "expected non-null partitionKey"); this.operations = new ArrayList<>(); this.partitionKey = partitionKey; }