auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void waitForChanges(int direction) throws InterruptedException { if (direction != DIRECTION_DOWNLOAD && direction != DIRECTION_UPLOAD) { throw new IllegalArgumentException("Unknown direction: " + direction); } if (!isClosed) { String realmPath = configuration.getPath(); WaitForSessionWrapper wrapper = new WaitForSessionWrapper(); waitingForServerChanges.set(wrapper); boolean listenerRegistered = (direction == DIRECTION_DOWNLOAD) ? nativeWaitForDownloadCompletion(realmPath) : nativeWaitForUploadCompletion(realmPath); if (!listenerRegistered) { waitingForServerChanges.set(null); String errorMsg = ""; switch (direction) { case DIRECTION_DOWNLOAD: errorMsg = "It was not possible to download all remote changes."; break; case DIRECTION_UPLOAD: errorMsg = "It was not possible upload all local changes."; break; default: throw new IllegalArgumentException("Unknown direction: " + direction); } throw new ObjectServerError(ErrorCode.UNKNOWN, errorMsg + " Has the SyncClient been started?"); } try { wrapper.waitForServerChanges(); } catch(InterruptedException e) { <START> waitingForServerChanges.set(null); END> throw e; } try { if (!isClosed) { if (!wrapper.isSuccess()) { wrapper.throwExceptionIfNeeded(); } } } finally { waitingForServerChanges.set(null); } } }</code><technical_language>This is enough. is a chance users add another listener cancellation. SyncSession session = ...; try { session.downloadAllServerChanges(); } catch (InterruptedException e) { // cancelled } ... // do some works session.uploadAllLocalChanges(); // this return early of callback caused downloadAllServerChanges()</technical_language>

Target:
private void waitForChanges(int direction) throws InterruptedException { if (direction != DIRECTION_DOWNLOAD && direction != DIRECTION_UPLOAD) { throw new IllegalArgumentException("Unknown direction: " + direction); } if (!isClosed) { String realmPath = configuration.getPath(); WaitForSessionWrapper wrapper = new WaitForSessionWrapper(); waitingForServerChanges.set(wrapper); int callbackId = waitCounter.incrementAndGet(); boolean listenerRegistered = (direction == DIRECTION_DOWNLOAD) ? nativeWaitForDownloadCompletion(callbackId, realmPath) : nativeWaitForUploadCompletion(callbackId, realmPath); if (!listenerRegistered) { waitingForServerChanges.set(null); String errorMsg = ""; switch (direction) { case DIRECTION_DOWNLOAD: errorMsg = "It was not possible to download all remote changes."; break; case DIRECTION_UPLOAD: errorMsg = "It was not possible upload all local changes."; break; default: throw new IllegalArgumentException("Unknown direction: " + direction); } throw new ObjectServerError(ErrorCode.UNKNOWN, errorMsg + " Has the SyncClient been started?"); } try { wrapper.waitForServerChanges(); } catch(InterruptedException e) { waitingForServerChanges.set(null); throw e; } try { if (!isClosed) { if (!wrapper.isSuccess()) { wrapper.throwExceptionIfNeeded(); } } } finally { waitingForServerChanges.set(null); } } }
Source:
<code>private static void setOMNodeSpecificConfigs( OzoneConfiguration ozoneConfiguration, String omServiceId, String omNodeId) { <START> String[] confKeys = new String[] { <END> OMConfigKeys.OZONE_OM_HTTP_ADDRESS_KEY, OMConfigKeys.OZONE_OM_HTTPS_ADDRESS_KEY, OMConfigKeys.OZONE_OM_HTTP_BIND_HOST_KEY, OMConfigKeys.OZONE_OM_HTTPS_BIND_HOST_KEY, OMConfigKeys.OZONE_OM_HTTP_KERBEROS_KEYTAB_FILE, OMConfigKeys.OZONE_OM_HTTP_KERBEROS_PRINCIPAL_KEY, OMConfigKeys.OZONE_OM_KERBEROS_KEYTAB_FILE_KEY, OMConfigKeys.OZONE_OM_KERBEROS_PRINCIPAL_KEY, OMConfigKeys.OZONE_OM_DB_DIRS, OMConfigKeys.OZONE_OM_ADDRESS_KEY, }; for (String confKey : confKeys) { String confValue = OmUtils.getConfSuffixedWithOMNodeId( ozoneConfiguration, confKey, omServiceId, omNodeId); if (confValue != null) { LOG.info("Setting configuration key with value of key {}: {}", confKey, OmUtils.addKeySuffixes(confKey, omNodeId), confValue); ozoneConfiguration.set(confKey, confValue); } } }</code><technical_language>move definition of this array beginning of file</technical_language>

Target:
private static void setOMNodeSpecificConfigs( OzoneConfiguration ozoneConfiguration, String omServiceId, String omNodeId) { for (String confKey : genericConfigKeys) { String confValue = OmUtils.getConfSuffixedWithOMNodeId( ozoneConfiguration, confKey, omServiceId, omNodeId); if (confValue != null) { LOG.info("Setting configuration key with value of key {}: {}", confKey, OmUtils.addKeySuffixes(confKey, omNodeId), confValue); ozoneConfiguration.set(confKey, confValue); } } }
Source:
<code>public void teardown() { WorkbenchShellHandler.getInstance().closeAllNonWorbenchShells(); <START> ProjectExplorer pe = new ProjectExplorer(); <END> pe.open(); for (Project p : pe.getProjects()) { p.delete(true); } new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); new DefaultEditor(CENTRAL_LABEL); }</code><technical_language>this: <LINK_0></technical_language>

Target:
public void teardown() { WorkbenchShellHandler.getInstance().closeAllNonWorbenchShells(); new ProjectExplorer().deleteAllProjects(); new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); new DefaultEditor(CENTRAL_LABEL); }
Source:
<code>public ChargeEntity markDelayedCaptureChargeAsCaptureApproved(String externalId) { return chargeDao.findByExternalId(externalId).map(charge -> { ChargeStatus currentStatus = fromString(charge.getStatus()); if (chargeCanBeSkipped(charge)) { logger.info("Skipping charge [charge_external_id={}] with status from marking as CAPTURE APPROVED", currentStatus, externalId); return charge; } if (currentStatus == AWAITING_CAPTURE_REQUEST) { try { transitionChargeState(charge, CAPTURE_APPROVED); } catch (InvalidStateTransitionException e) { throw new ConflictRuntimeException(charge.getExternalId(), <START> format("attempt to perform delayed capture on invalid charge state")); <END> } } else { throw new ConflictRuntimeException(charge.getExternalId(), format("attempt to perform delayed capture on charge not in %s state.", AWAITING_CAPTURE_REQUEST)); } return charge; }).orElseThrow(() -> new ChargeNotFoundRuntimeException(externalId)); }</code><technical_language>I need change this message: fine before. Right format( ) anything</technical_language>

Target:
public ChargeEntity markDelayedCaptureChargeAsCaptureApproved(String externalId) { return chargeDao.findByExternalId(externalId).map(charge -> { switch (fromString(charge.getStatus())) { case AWAITING_CAPTURE_REQUEST: try { transitionChargeState(charge, CAPTURE_APPROVED); } catch (InvalidStateTransitionException e) { throw new ConflictRuntimeException(charge.getExternalId(), "attempt to perform delayed capture on invalid charge state " + e.getMessage()); } return charge; case CAPTURE_APPROVED: case CAPTURE_APPROVED_RETRY: case CAPTURE_READY: case CAPTURE_SUBMITTED: case CAPTURED: return charge; default: throw new ConflictRuntimeException(charge.getExternalId(), format("attempt to perform delayed capture on charge not in %s state.", AWAITING_CAPTURE_REQUEST) ); } }).orElseThrow(() -> new ChargeNotFoundRuntimeException(externalId)); }
Source:
<code>private int getSegment(Object key) { if (cacheMode.needsStateTransfer()) { return keyPartitioner.getSegment(key); } <START> return 0; <END> }</code><technical_language>change KeyPartitionerFactory return a -> 0 partitioner in local invalidation caches instead</technical_language>

Target:
private int getSegment(Object key) { return keyPartitioner.getSegment(key); }
Source:
<code>public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(EmptyLineSeparatorCheck.class); final String[] expected = { "21: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), <START> "28: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, " END> "36: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), "39: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "VARIABLE_DEF"), "40: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "STATIC_INIT"), "44: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INSTANCE_INIT"), "58: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CTOR_DEF"), "63: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "METHOD_DEF"), "80: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "METHOD_DEF"), "111: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INTERFACE_DEF"), }; verify(checkConfig, getPath("InputEmptyLineSeparator.java"), expected); }</code><technical_language>please explain this violation appear</technical_language>

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(EmptyLineSeparatorCheck.class); final String[] expected = { "21: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), "38: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), "41: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "VARIABLE_DEF"), "42: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "STATIC_INIT"), "46: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INSTANCE_INIT"), "60: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CTOR_DEF"), "65: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "METHOD_DEF"), "82: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "METHOD_DEF"), "113: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INTERFACE_DEF"), }; verify(checkConfig, getPath("InputEmptyLineSeparator.java"), expected); }
Source:
<code>public void testHasItem() { VirtualFile myFile = myFixture.copyFileToProject("themeEditor/styles_1.xml", "res/values/styles.xml"); myFixture.copyFileToProject("themeEditor/attrs.xml", "res/values/attrs.xml"); Configuration configuration = myFacet.getConfigurationManager().getConfiguration(myFile); ThemeResolver themeResolver = new ThemeResolver(configuration); ThemeEditorStyle theme = themeResolver.getTheme("@style/AppTheme"); assertNotNull(theme); ThemeEditorStyle parent = theme.getParent(); assertNotNull(parent); ItemResourceValue hasItem = new ItemResourceValue("myColor", false, "?android:attr/colorBackground", false); ItemResourceValue hasNotItem = new ItemResourceValue("myHasNot", false, "?android:attr/colorBackground", false); ItemResourceValue hasInParent = new ItemResourceValue("editTextStyle", true, "?android:attr/colorBackground", true); assertEquals(true, theme.hasItem(new EditedStyleItem(hasItem, theme))); assertEquals(false, theme.hasItem(new EditedStyleItem(hasNotItem, theme))); <START> assertEquals(true, theme.getParent().hasItem(new <END> EditedStyleItem(hasInParent, parent))); assertEquals(false, theme.hasItem(new EditedStyleItem(hasInParent, parent))); }</code><technical_language>please replace assertTrue assertFalse? either</technical_language>

Target:
public void testHasItem() { VirtualFile myFile = myFixture.copyFileToProject("themeEditor/styles_1.xml", "res/values/styles.xml"); myFixture.copyFileToProject("themeEditor/attrs.xml", "res/values/attrs.xml"); Configuration configuration = myFacet.getConfigurationManager().getConfiguration(myFile); ThemeResolver themeResolver = new ThemeResolver(configuration); ThemeEditorStyle theme = themeResolver.getTheme("@style/AppTheme"); assertNotNull(theme); ThemeEditorStyle parent = theme.getParent(); assertNotNull(parent); ItemResourceValue hasItem = new ItemResourceValue("myColor", false, "?android:attr/colorBackground", false); ItemResourceValue hasNotItem = new ItemResourceValue("myHasNot", false, "?android:attr/colorBackground", false); ItemResourceValue hasInParent = new ItemResourceValue("editTextStyle", true, "?android:attr/colorBackground", true); assertTrue(theme.hasItem(new EditedStyleItem(hasItem, theme))); assertFalse(theme.hasItem(new EditedStyleItem(hasNotItem, theme))); assertTrue(theme.getParent().hasItem(new EditedStyleItem(hasInParent, parent))); assertFalse(theme.hasItem(new EditedStyleItem(hasInParent, parent))); }
Source:
<code>public void testReviewsWithSameChangeId() throws Exception { <START> if (reviewHarness.getClient().isVersion29OrLater(new NullProgressMonitor())) { <END> String branchName = "test_side_branch"; createBranchIfNonExistent(branchName); ReviewHarness reviewHarness2 = reviewHarness.duplicate(); reviewHarness2.init("HEAD:refs/for/" + branchName, PrivilegeLevel.USER, "otherTestFile.txt", true); reviewHarness.retrieve(); reviewHarness2.retrieve(); assertEquals(reviewHarness.getReview().getKey(), reviewHarness2.getReview().getKey()); assertThat(reviewHarness.getReview().getId(), is(not(reviewHarness2.getReview().getId()))); assertThat(reviewHarness.getReview().getSets().size(), is(1)); assertThat(reviewHarness.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail = retrievePatchSetDetail(reviewHarness, "1"); assertThat(detail.getPatches().size(), is(2)); assertThat(detail.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail.getPatches().get(1).getFileName(), is("testFile1.txt")); assertThat(reviewHarness2.getReview().getSets().size(), is(1)); assertThat(reviewHarness2.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail2 = retrievePatchSetDetail(reviewHarness2, "1"); assertThat(detail2.getPatches().size(), is(2)); assertThat(detail2.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail2.getPatches().get(1).getFileName(), is("otherTestFile.txt")); } }</code><technical_language>write this if(!29) { return; }</technical_language>

Target:
public void testReviewsWithSameChangeId() throws Exception { if (!supportsBranchCreation()) { return; } String branchName = "test_side_branch"; createBranchIfNonExistent(branchName); ReviewHarness reviewHarness2 = reviewHarness.duplicate(); reviewHarness2.init("HEAD:refs/for/" + branchName, PrivilegeLevel.USER, "otherTestFile.txt", true); reviewHarness.retrieve(); reviewHarness2.retrieve(); assertEquals(reviewHarness.getReview().getKey(), reviewHarness2.getReview().getKey()); assertThat(reviewHarness.getReview().getId(), is(not(reviewHarness2.getReview().getId()))); assertThat(reviewHarness.getReview().getSets().size(), is(1)); assertThat(reviewHarness.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail = retrievePatchSetDetail(reviewHarness, "1"); assertThat(detail.getPatches().size(), is(2)); assertThat(detail.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail.getPatches().get(1).getFileName(), is("testFile1.txt")); assertThat(reviewHarness2.getReview().getSets().size(), is(1)); assertThat(reviewHarness2.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail2 = retrievePatchSetDetail(reviewHarness2, "1"); assertThat(detail2.getPatches().size(), is(2)); assertThat(detail2.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail2.getPatches().get(1).getFileName(), is("otherTestFile.txt")); }
Source:
<code>private static Data getData(@NotNull PsiElement element) { if (!element.isValid() || !element.isWritable()) return null; GoAssignmentStatement assignment = getValidAssignmentParent(element); GoReferenceExpression selectedFieldReference = assignment != null ? getFieldReferenceExpression(element, assignment) : null; if (selectedFieldReference == null) return null; GoVarDefinition structDefinition = getDefinition(selectedFieldReference); GoStatement previousStatement = PsiTreeUtil.getPrevSiblingOfType(assignment, GoStatement.class); boolean needReplaceDeclarationWithShortVar = isUnassigned(getSingleVarSpecByDefinition(previousStatement, structDefinition)); GoCompositeLit compositeLit = needReplaceDeclarationWithShortVar <START> ? createStructLiteral(structDefinition, previousStatement.getProject()) <END> : getStructLiteralByReference(selectedFieldReference, assignment); if (compositeLit == null || structDefinition == null) return null; List<GoReferenceExpression> references = getUninitializedSingleFieldReferences(assignment, structDefinition, compositeLit); return !references.isEmpty() ? new Data(assignment, compositeLit, references, previousStatement, structDefinition.getText(), needReplaceDeclarationWithShortVar) : null; }</code><technical_language>create struct literal this place. method name is getData called in isAviable</technical_language>

Target:
private static Data getData(@NotNull PsiElement element) { if (!element.isValid() || !element.isWritable()) return null; GoAssignmentStatement assignment = getValidAssignmentParent(element); GoStatement previousStatement = assignment != null ? PsiTreeUtil.getPrevSiblingOfType(assignment, GoStatement.class) : null; GoReferenceExpression selectedFieldReferenceExpression = previousStatement != null ? getFieldReferenceExpression(element, assignment, previousStatement) : null; if (selectedFieldReferenceExpression == null) return null; GoVarDefinition structDefinition = getDefinition(selectedFieldReferenceExpression); boolean needReplaceDeclarationWithShortVar = isUnassigned(getSingleVarSpecByDefinition(previousStatement, structDefinition)); GoCompositeLit compositeLit = structDefinition != null ? getStructLiteralByDefinition(structDefinition, previousStatement) : null; GoNamedElement field = ObjectUtils.tryCast(selectedFieldReferenceExpression.resolve(), GoNamedElement.class); if (compositeLit == null && !needReplaceDeclarationWithShortVar || !hasStructTypeWithField(structDefinition, field)) return null; List<GoReferenceExpression> references = getUninitializedSingleFieldReferences(assignment, previousStatement, structDefinition, compositeLit); return !references.isEmpty() ? new Data(assignment, compositeLit, references, previousStatement, structDefinition) : null; }
Source:
<code>public Object lookup(ArquillianResource resource, Annotation... qualifiers) { <START> URL url = (URL) super.doLookup(resource, qualifiers); <END> if (url == null) { URL customURL; String grapheneCustomURL = grapheneConfiguration.get().getUrl(); if (grapheneCustomURL != null) { try { customURL = new URL(grapheneCustomURL); url = customURL; } catch (MalformedURLException ex) { throw new IllegalStateException("Configured custom URL from GrapheneConfiguration should be already a valid URL."); } } } return url; }</code><technical_language>I enable custom URL provider in case is deployment for class</technical_language>

Target:
public Object lookup(ArquillianResource resource, Annotation... qualifiers) { URL url = null; if (hasDeployment(testClass.get())) { url = (URL) super.lookup(resource, qualifiers); } else { url = (URL) super.doLookup(resource, qualifiers); } if (url == null) { String grapheneCustomURL = grapheneConfiguration.get().getUrl(); if (grapheneCustomURL != null) { try { url = new URL(grapheneCustomURL); } catch (MalformedURLException ex) { throw new IllegalStateException("Configured custom URL from GrapheneConfiguration should be already a valid URL."); } } } return url; }
Source:
<code>ZipFormatter( <START> Formatters formatters, <END> FormatterUtil formatterUtil, HtmlBuilder html) { this.formatters = formatters; this.util = formatterUtil; this.html = html; }</code><technical_language>needed</technical_language>

Target:
ZipFormatter( Formatters formatters, FormatterUtil formatterUtil, HtmlBuilder html) { this.util = formatterUtil; this.html = html; }
Source:
<code>private StudentProfileAttributes getProfileAttributesFrom( String[] submissionParams) { StudentProfileAttributes spa = new StudentProfileAttributes(); <START> if(submissionParams[1] != null){ <END> spa.shortName = submissionParams[1].trim();; } if(submissionParams[3] != null){ spa.email = submissionParams[3].trim();; } if(submissionParams[5] != null){ spa.institute = submissionParams[5].trim();; } if(submissionParams[7] != null){ spa.nationality = submissionParams[7].trim();; } if(submissionParams[9] != null){ spa.gender = submissionParams[9].trim();; } if(submissionParams[11] != null){ spa.moreInfo = submissionParams[11].trim();; } spa.modifiedDate = null; return spa; }</code><technical_language>double semi-colons</technical_language>

Target:
private StudentProfileAttributes getProfileAttributesFrom( String[] submissionParams) { StudentProfileAttributes spa = new StudentProfileAttributes(); spa.shortName = StringHelper.trimIfNotNull(submissionParams[1]); spa.email = StringHelper.trimIfNotNull(submissionParams[3]); spa.institute = StringHelper.trimIfNotNull(submissionParams[5]); spa.nationality = StringHelper.trimIfNotNull(submissionParams[7]); spa.gender = StringHelper.trimIfNotNull(submissionParams[9]); spa.moreInfo = StringHelper.trimIfNotNull(submissionParams[11]); spa.modifiedDate = null; return spa; }
Source:
<code>public XmlTextAnnotation next() { String data; try { data = LineIO.slurp(currentfile); } catch (FileNotFoundException e1) { <START> System.err.println("The named entity file, \""+this.currentfile+"\", did not exist"); <END> return null; } catch (Throwable e1) { e1.printStackTrace(); return null; } try { XmlTextAnnotation ta = nextAnnotation(data, currentfile); return ta; } catch (AnnotatorException e) { e.printStackTrace(); throw new IllegalStateException(e); } }</code><technical_language>add report. logger</technical_language>

Target:
public XmlTextAnnotation next() { String data; try { data = LineIO.slurp(currentfile); } catch (FileNotFoundException e1) { this.badFiles.add(this.currentfile); return null; } catch (Throwable e1) { e1.printStackTrace(); return null; } try { XmlTextAnnotation ta = nextAnnotation(data, currentfile); return ta; } catch (AnnotatorException e) { e.printStackTrace(); throw new IllegalStateException(e); } }
Source:
<code>private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { PreparedStatement preparedStatement; try { preparedStatement = preparedStatementCache.get( statement.getQueryString() ); session.prepare( statement ); } catch (ExecutionException e) { <START> log.failToPrepareCQL( statement.getQueryString(), e.getCause() ); <END> throw new RuntimeException( e.getCause() ); } try { BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { boundStatement.setObject( i, columnValues[i] ); } return session.execute( boundStatement ); } catch (DriverException e) { log.failToExecuteCQL( statement.getQueryString(), e ); throw e; } }</code><technical_language>prefer log _or_ re-throw. IMO throw a HibernateException, wrapping original query, thrown common Log class pattern (so a unique code, too)</technical_language>

Target:
private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { PreparedStatement preparedStatement; try { preparedStatement = preparedStatementCache.get( statement.getQueryString() ); session.prepare( statement ); } catch (ExecutionException e) { throw log.failToPrepareCQL( statement.getQueryString(), e.getCause() ); } try { BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { boundStatement.setObject( i, columnValues[i] ); } return session.execute( boundStatement ); } catch (DriverException e) { throw log.failToExecuteCQL( statement.getQueryString(), e ); } }
Source:
<code>public long commit() { <START> if (currentStoreThread.compareAndSet(null, Thread.currentThread())) { <END> synchronized (this) { try { currentStoreVersion = currentVersion; if (!closed && hasUnsavedChangesInternal()) { if (fileStore == null) { lastStoredVersion = currentVersion; ++currentVersion; setWriteVersion(currentVersion); metaChanged = false; } else { if (fileStore.isReadOnly()) { throw DataUtils.newIllegalStateException( DataUtils.ERROR_WRITING_FAILED, "This store is read-only"); } try { storeNow(); } catch (IllegalStateException e) { panic(e); } catch (Throwable e) { panic(DataUtils.newIllegalStateException(DataUtils.ERROR_INTERNAL, e.toString(), e)); } } } } finally { currentStoreVersion = -1; currentStoreThread.set(null); } } } return currentVersion; }</code><technical_language>this tricky? if threads call commit() simultaneously, of is return immediately, potentially data hit disk</technical_language>

Target:
public synchronized long commit() { currentStoreThread.set(Thread.currentThread()); store(); return currentVersion; }
Source:
<code>public void testBehaviorWhenReportedSizesSmall() throws Exception { File baseDir = Files.createTempDir(); try { FileSmoosher smoosher = new FileSmoosher(baseDir, 21); final SmooshedWriter writer = smoosher.addWithSmooshedWriter("1", 2); boolean exceptionThrown = false; try { writer.write(ByteBuffer.wrap(Ints.toByteArray(1))); } catch (ISE e) { Assert.assertTrue(e.getMessage().contains("Liar!!!")); exceptionThrown = true; } Assert.assertTrue(exceptionThrown); File[] files = baseDir.listFiles(); Assert.assertEquals(1, files.length); <START> Assert.assertEquals(4, files[0].length()); <END> } finally { for (File file : baseDir.listFiles()) { file.delete(); } } }</code><technical_language>@navis reason this is changing</technical_language>

Target:
public void testBehaviorWhenReportedSizesSmall() throws Exception { File baseDir = folder.newFolder("base"); try (FileSmoosher smoosher = new FileSmoosher(baseDir, 21)) { boolean exceptionThrown = false; try (final SmooshedWriter writer = smoosher.addWithSmooshedWriter("1", 2)) { writer.write(ByteBuffer.wrap(Ints.toByteArray(1))); } catch (ISE e) { Assert.assertTrue(e.getMessage().contains("Liar!!!")); exceptionThrown = true; } Assert.assertTrue(exceptionThrown); File[] files = baseDir.listFiles(); Assert.assertNotNull(files); Assert.assertEquals(1, files.length); } }
Source:
<code>private synchronized boolean createTable(DynamoDBMapper mapper, Class<?> dtoClass) { if (db == null) { return false; } String tableName; try { ProvisionedThroughput provisionedThroughput = new ProvisionedThroughput(dbConfig.getReadCapacityUnits(), dbConfig.getWriteCapacityUnits()); CreateTableRequest request = mapper.generateCreateTableRequest(dtoClass); request.setProvisionedThroughput(provisionedThroughput); if (request.getGlobalSecondaryIndexes() != null) { for (GlobalSecondaryIndex index : request.getGlobalSecondaryIndexes()) { index.setProvisionedThroughput(provisionedThroughput); } } tableName = request.getTableName(); try { db.getDynamoClient().describeTable(tableName); } catch (ResourceNotFoundException e) { db.getDynamoClient().createTable(request); } catch (AmazonClientException e) { <START> logger.error("Exception when creation table (descibe): {}", e.getMessage()); <END> return false; } return waitForTableToBecomeActive(tableName); } catch (AmazonClientException e) { logger.error("Exception when creation table: {}", e.getMessage()); return false; } }</code><technical_language>typos. "creating" "describe". suggest eliminating parenthetical rewording error message. "Table creation failed due error in describeTable operation"</technical_language>

Target:
private synchronized boolean createTable(DynamoDBMapper mapper, Class<?> dtoClass) { if (db == null) { return false; } String tableName; try { ProvisionedThroughput provisionedThroughput = new ProvisionedThroughput(dbConfig.getReadCapacityUnits(), dbConfig.getWriteCapacityUnits()); CreateTableRequest request = mapper.generateCreateTableRequest(dtoClass); request.setProvisionedThroughput(provisionedThroughput); if (request.getGlobalSecondaryIndexes() != null) { for (GlobalSecondaryIndex index : request.getGlobalSecondaryIndexes()) { index.setProvisionedThroughput(provisionedThroughput); } } tableName = request.getTableName(); try { db.getDynamoClient().describeTable(tableName); } catch (ResourceNotFoundException e) { db.getDynamoClient().createTable(request); } catch (AmazonClientException e) { logger.error("Table creation failed due to error in describeTable operation", e); return false; } return waitForTableToBecomeActive(tableName); } catch (AmazonClientException e) { logger.error("Exception when creating table", e); return false; } }
Source:
<code>public FileDeferredDownloadBehavior(final IModel<File> fileModel, final IModel<String> fileNameModel, boolean addAntiCache) { this( new AbstractReadOnlyModel<LabelValue<String, File>>() { private static final long serialVersionUID = 1L; @Override public LabelValue<String, File> getObject() { return LabelValue.with(fileNameModel.getObject(), fileModel.getObject()); <START> } <END> }, addAntiCache ); Objects.requireNonNull(fileModel); Objects.requireNonNull(fileNameModel); }</code><technical_language>This lacks a properly defined detach() method</technical_language>

Target:
public FileDeferredDownloadBehavior(final IModel<File> fileModel, final IModel<String> fileNameModel, boolean addAntiCache) { this( new AbstractReadOnlyModel<LabelValue<String, File>>() { private static final long serialVersionUID = 1L; @Override public LabelValue<String, File> getObject() { return LabelValue.with(fileNameModel.getObject(), fileModel.getObject()); } @Override public void detach() { super.detach(); Detachables.detach(fileModel, fileNameModel); } }, addAntiCache ); Objects.requireNonNull(fileModel); Objects.requireNonNull(fileNameModel); }
Source:
<code>private void setConfigs(ASTNode node) throws SemanticException { Map<String, String> replConfigs = DDLSemanticAnalyzer.getProps(node); if (null != replConfigs) { for (Map.Entry<String, String> config : replConfigs.entrySet()) { String key = config.getKey(); if (key.equalsIgnoreCase(HIVEQUERYID.varname)) { String queryTag = config.getValue(); if (!StringUtils.isEmpty(queryTag)) { String jobTag = conf.get(MRJobConfig.JOB_TAGS); <START> if (jobTag == null) { <END> jobTag = queryTag; } else { jobTag = jobTag.concat("," + queryTag); } conf.set(MRJobConfig.JOB_TAGS, jobTag); } queryState.setQueryTag(queryTag); } else { conf.set(key, config.getValue()); } } try { db = Hive.get(conf); } catch (HiveException e) { throw new SemanticException(e); } } }</code><technical_language>This logic append is repeated. move a static method</technical_language>

Target:
private void setConfigs(ASTNode node) throws SemanticException { Map<String, String> replConfigs = DDLSemanticAnalyzer.getProps(node); if (null != replConfigs) { for (Map.Entry<String, String> config : replConfigs.entrySet()) { String key = config.getKey(); if (key.equalsIgnoreCase(HIVEQUERYID.varname)) { String queryTag = config.getValue(); if (!StringUtils.isEmpty(queryTag)) { QueryState.setMapReduceJobTag(conf, queryTag); } queryState.setQueryTag(queryTag); } else { conf.set(key, config.getValue()); } } try { db = Hive.get(conf); } catch (HiveException e) { throw new SemanticException(e); } } }
Source:
<code>private StorageConnections mapCollection(List<StorageServerConnections> entities) { StorageConnections collection = new StorageConnections(); for (org.ovirt.engine.core.common.businessentities.StorageServerConnections entity : entities) { Storage connection = map(entity); if (connection != null) { <START> collection.getStorageConnections().add(addLinks(connection)); <END> } } return collection; }</code><technical_language>please add call populate: addLinks(populate(connection))</technical_language>

Target:
private StorageConnections mapCollection(List<StorageServerConnections> entities) { StorageConnections collection = new StorageConnections(); for (org.ovirt.engine.core.common.businessentities.StorageServerConnections entity : entities) { Storage connection = map(entity); if (connection != null) { collection.getStorageConnections().add(addLinks(populate(connection,entity))); } } return collection; }
Source:
<code>public void setUp() { postgresDdlTable = new PostgresDdlTable(TEST_TABLE, connectionSupplier, <START> ImmutablePostgresDdlConfig.builder().compactIntervalMillis(10).build()); <END> }</code><technical_language>recreating table-object test, postgresDdlTable is static - is this intended</technical_language>

Target:
public void setUp() { postgresDdlTable = new PostgresDdlTable(TEST_TABLE, connectionSupplier, ImmutablePostgresDdlConfig.builder() .compactInterval(HumanReadableDuration.milliseconds(COMPACT_INTERVAL_MILLIS)) .build()); }
Source:
<code>protected JComboBox getPointUomCombo(){ CanvasSE prev = getPreview(); uoms= Uom.values(); String[] values = new String[uoms.length]; for (int i = 0; i < values.length; i++) { <START> values[i] = I18N.tr(uoms[i].toString()); <END> } final JComboBox jcc = new JComboBox(values); ActionListener acl = EventHandler.create(ActionListener.class, prev, "repaint"); ActionListener acl2 = EventHandler.create(ActionListener.class, this, "updateSUComboBox", "source.selectedIndex"); jcc.addActionListener(acl2); jcc.addActionListener(acl); jcc.setSelectedItem(((ConstantFormPoint)getLegend()).getSymbolUom().toString().toUpperCase()); return jcc; }</code><technical_language>I18n.marktr() in WellKnownName class do declaration of string translated</technical_language>

Target:
protected JComboBox getPointUomCombo(){ CanvasSE prev = getPreview(); uoms= getUomProperties(); String[] values = new String[uoms.length]; for (int i = 0; i < values.length; i++) { values[i] = I18N.tr(uoms[i].toString()); } final JComboBox jcc = new JComboBox(values); ActionListener acl = EventHandler.create(ActionListener.class, prev, "repaint"); ActionListener acl2 = EventHandler.create(ActionListener.class, this, "updateSUComboBox", "source.selectedIndex"); jcc.addActionListener(acl2); jcc.addActionListener(acl); jcc.setSelectedItem(((ConstantFormPoint)getLegend()).getSymbolUom().toString().toUpperCase()); return jcc; }
Source:
<code>private void setup(Predicate<String> validation) { setPrefColumnCount(30); validationSupport.registerValidator(this, (c, newValue) -> { boolean isError = !validation.test(getText()); if (isError) { setStyleForInvalidFilter(); } else { setStyleForValidFilter(); } return ValidationResult.fromErrorIf(this, "Parse error", isError); }); setOnKeyTyped(e -> { boolean isModifierKeyPress = e.isAltDown() || e.isMetaDown() || e.isControlDown(); String key = e.getCharacter(); if (key == null || key.isEmpty() || isModifierKeyPress) { return; } char typed = key.charAt(0); if (typed == '\t' && suggestion.isShowing()) { suggestion.hide(); suggestion.getSelectedContent().ifPresent(this::completeWord); } else { suggestion.loadSuggestions(getMatchingKeywords(getCurrentWord())); <START> suggestion.show(this, Side.BOTTOM, 0, 0); <END> } }); setOnKeyPressed(e -> { if (e.getCode() == KeyCode.TAB) { e.consume(); } }); setOnKeyReleased(e -> { e.consume(); if (e.getCode() == KeyCode.ENTER) handleOnEnter(); if (e.getCode() == KeyCode.ESCAPE) handleOnEscape(); isNavigating = e.getCode() == KeyCode.UP || e.getCode() == KeyCode.DOWN; if (suggestion.isShowing() && !isNavigating) { suggestion.loadSuggestions(getMatchingKeywords(getCurrentWord())); } }); addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (SHOW_DOCS.match(event)) { onShowDocs.run(); } }); }</code><technical_language>abstract some of parameters overload</technical_language>

Target:
private void setup(Predicate<String> validation) { setPrefColumnCount(30); validationSupport.registerValidator(this, (c, newValue) -> { boolean isError = !validation.test(getText()); if (isError) { setStyleForInvalidFilter(); } else { setStyleForValidFilter(); } return ValidationResult.fromErrorIf(this, "Parse error", isError); }); setOnKeyTyped(e -> { boolean isModifierKeyPress = e.isAltDown() || e.isMetaDown() || e.isControlDown(); String key = e.getCharacter(); if (key == null || key.isEmpty() || isModifierKeyPress) { return; } char typed = key.charAt(0); if (typed == '\t' && suggestions.isShowing()) { suggestions.hide(); suggestions.getSelectedContent().ifPresent(this::completeWord); } else { suggestions.loadSuggestions(getMatchingKeywords(getCurrentWord())); if (!suggestions.isShowing()) suggestions.show(this, Side.BOTTOM, 0, 0); } }); setOnKeyPressed(e -> { if (e.getCode() == KeyCode.TAB) { e.consume(); } }); setOnKeyReleased(e -> { e.consume(); if (e.getCode() == KeyCode.ENTER) { handleOnEnter(); } else if (e.getCode() == KeyCode.ESCAPE) { handleOnEscape(); } isNavigating = e.getCode() == KeyCode.UP || e.getCode() == KeyCode.DOWN; if (suggestions.isShowing() && !isNavigating) { suggestions.loadSuggestions(getMatchingKeywords(getCurrentWord())); } }); addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (SHOW_DOCS.match(event)) { onShowDocs.run(); } }); }
Source:
<code>public void testWhenProjectWithParamsThenRebuildProjectExecutesRebuildOfLastBuild() throws Exception { FreeStyleProject project = createFreeStyleProject(); project.scheduleBuild2(0, new Cause.UserIdCause(), new ParametersAction( new StringParameterValue("name", "test"))).get(); HtmlPage rebuildConfigPage = createWebClient().getPage(project, "1/rebuild"); submit(rebuildConfigPage.getFormByName("config")); HtmlPage projectPage = createWebClient().getPage(project); HtmlAnchor rebuildHref = projectPage.getAnchorByText("Rebuild Last"); <START> WebAssert.assertLinkPresentWithText(projectPage, "Rebuild Last"); <END> assertEquals("Rebuild Last should point to the second build", rebuildHref.getHrefAttribute(), "/" + project.getUrl() + "2/rebuild"); }</code><technical_language>this assert executed anchor is retrieved serves purpose; getAnchorByText throw exception if is link</technical_language>

Target:
public void testWhenProjectWithParamsThenRebuildProjectExecutesRebuildOfLastBuild() throws Exception { FreeStyleProject project = createFreeStyleProject(); project.scheduleBuild2(0, new Cause.UserIdCause(), new ParametersAction( new StringParameterValue("name", "test"))).get(); HtmlPage rebuildConfigPage = createWebClient().getPage(project, "1/rebuild"); submit(rebuildConfigPage.getFormByName("config")); HtmlPage projectPage = createWebClient().getPage(project); WebAssert.assertLinkPresentWithText(projectPage, "Rebuild Last"); HtmlAnchor rebuildHref = projectPage.getAnchorByText("Rebuild Last"); assertEquals("Rebuild Last should point to the second build", rebuildHref.getHrefAttribute(), "/" + project.getUrl() + "2/rebuild"); }
Source:
<code>public T get(int index) { if ((index < 0) || (index >= length())) { throw new IndexOutOfBoundsException("get(" + index + ")"); } else { final T[] leaf = trie.getLeaf(index); final int leafIndex = lastDigit(trie.offset() + index); <START> return leaf[leafIndex]; <END> } }</code><technical_language>I 3 lines moved BMT, logic</technical_language>

Target:
public T get(int index) { if ((index < 0) || (index >= length())) { throw new IndexOutOfBoundsException("get(" + index + ")"); } else { return trie.get(index); } }
Source:
<code>public Date getBarcodeDate() { <START> return getReceivedDate(); <END> }</code><technical_language>creation date if received date is null</technical_language>

Target:
public Date getBarcodeDate() { return getReceivedDate() == null ? getCreationTime() : getReceivedDate(); }
Source:
<code>public BroadcastEndpoint createBroadcastEndpoint() throws Exception { JGroupsBroadcastEndpoint endpoint = new JGroupsBroadcastEndpoint(JChannelManager.getInstance(), channelName) { @Override public JChannel createChannel() throws Exception { synchronized (JGroupsBroadcastEndpointFactory.class) { JChannel channel = (JChannel) channelFactory.createChannel(channelName); channels.put(channelName, channel); return channel; } } @Override protected synchronized void internalCloseChannel(JChannelWrapper channel) { <START> synchronized (JGroupsBroadcastEndpointFactory.class) { <END> channels.remove(channelName); super.internalCloseChannel(channel); } } }; return endpoint.initChannel(); }</code><technical_language>funky synchronization instance parent class</technical_language>

Target:
public BroadcastEndpoint createBroadcastEndpoint() throws Exception { JGroupsBroadcastEndpoint endpoint = new JGroupsBroadcastEndpoint(JChannelManager.getInstance(), channelName) { @Override public JChannel createChannel() throws Exception { JChannel channel = (JChannel) channelFactory.createChannel(channelName); if (channels != null) { channels.put(channelName, channel); } return channel; } @Override protected void internalCloseChannel(JChannelWrapper channel) { if (channels != null) { channels.remove(channelName); } super.internalCloseChannel(channel); } }; return endpoint.initChannel(); }
Source:
<code>public static RadioStation fromJson(String json) throws JSONException { JSONObject jsonStation = new JSONObject(json); RadioStation station = new RadioStation(); station.id = jsonStation.getLong(JSON_ID); station.name = jsonStation.getString(JSON_NAME); station.countryCode = jsonStation.getString(JSON_COUNTRY); station.stream = jsonStation.getString(JSON_STREAM); String bitRateString = jsonStation.getString(JSON_BITRATE); if (bitRateString != null && !bitRateString.isEmpty()) { try { station.bitrate = jsonStation.getLong(JSON_BITRATE); <START> } catch (Throwable t) { <END> } } return station; }</code><technical_language>catch JSONException</technical_language>

Target:
public static RadioStation fromJson(String json) throws JSONException { JSONObject jsonStation = new JSONObject(json); RadioStation station = new RadioStation(); station.id = jsonStation.getLong(JSON_ID); station.name = jsonStation.getString(JSON_NAME); station.countryCode = jsonStation.getString(JSON_COUNTRY); station.stream = jsonStation.getString(JSON_STREAM); String bitRateString = jsonStation.getString(JSON_BITRATE); if (bitRateString != null && !bitRateString.isEmpty()) { try { station.bitrate = jsonStation.getLong(JSON_BITRATE); } catch (JSONException e) { } } return station; }
Source:
<code>public String toString() { if (isTheDefaultInstance()) { fbo = frameBuffersManager.getFBO(fboName); <START> } <END> return String.format("%21s: %s(%sx%s)", this.getClass().getSimpleName(), fboName, fbo.width(), fbo.height()); }</code><technical_language>I here, attempting avoid NPE if fbo is null. However, instance of this class need knowledge of width height of fbo generates task updates it. So, remove this IF block remove printout of fbo.width() fbo.height(). stay in task. Also, remove private fbo variable: instantiate briefly need width height, in generateTask() update()</technical_language>

Target:
public String toString() { return String.format("%21s: %s", this.getClass().getSimpleName(), fboName); }
Source:
<code>public BroadcastExchanger(List<Consumer<PageReference>> buffers, LocalExchangeMemoryManager memoryManager) { this.buffers = ImmutableList.copyOf(requireNonNull(buffers, "buffers is null")); <START> this.memoryManager = requireNonNull(memoryManager, "v is null"); <END> }</code><technical_language>s/v/memoryManager</technical_language>

Target:
public BroadcastExchanger(List<Consumer<PageReference>> buffers, LocalExchangeMemoryManager memoryManager) { this.buffers = ImmutableList.copyOf(requireNonNull(buffers, "buffers is null")); this.memoryManager = requireNonNull(memoryManager, "memoryManager is null"); }
Source:
<code>private void showNewDialog() { final AbstractDiskModel model = new NewDiskModel() { @Override public void onSave() { if (validate()) { flush(); getDiskModel().setEntity(this); parentModel.getParentListModel().setWindow(null); parentModel.getParentListModel().setWindow(parentModel.getUnitVmModel()); attachCommand.setIsAvailable(false); fillData(); if (getDisk().getDiskStorageType() == DiskStorageType.IMAGE) { ((DiskImage) <START> getDisk()).setActive(true); <END> } } } @Override protected void updateBootableDiskAvailable() { updateBootableFrom(parentModel.getAllCurrentDisks()); } }; VM vm = new VM(); vm.setVdsGroupId(parentModel.getUnitVmModel().getSelectedCluster().getId()); vm.setStoragePoolId(parentModel.getUnitVmModel().getSelectedDataCenter().getId()); vm.setVdsGroupCompatibilityVersion(parentModel.getUnitVmModel().getSelectedCluster().getCompatibilityVersion()); model.setVm(vm); setupModelAsDialog(model, ConstantsManager.getInstance().getConstants().newVirtualDiskTitle(), HelpTag.new_virtual_disk, "new_virtual_disk"); showDialog(model); model.initialize(parentModel.getAllCurrentDisks()); if (getVm() != null) { model.setVm(getVm()); ((NewDiskModel)model).updateSuggestedDiskAliasFromServer(); } else { String currentVmName = parentModel.getUnitVmModel().getName().getEntity(); if (!StringUtils.isEmpty(currentVmName)) { model.getAlias().setEntity(suggestAliasForNewVm(currentVmName)); } } }</code><technical_language>this is set backend, is needed here</technical_language>

Target:
private void showNewDialog() { final AbstractDiskModel model = new NewDiskModel() { @Override public void onSave() { if (validate()) { flush(); getDiskModel().setEntity(this); parentModel.getParentListModel().setWindow(null); parentModel.getParentListModel().setWindow(parentModel.getUnitVmModel()); attachCommand.setIsAvailable(false); fillData(); Disk disk = super.getDisk(); if (disk.getDiskStorageType() == DiskStorageType.IMAGE || disk.getDiskStorageType() == DiskStorageType.CINDER) { ((DiskImage) disk).setActive(true); } } } @Override protected void updateBootableDiskAvailable() { updateBootableFrom(parentModel.getAllCurrentDisks()); } }; VM vm = new VM(); vm.setVdsGroupId(parentModel.getUnitVmModel().getSelectedCluster().getId()); vm.setStoragePoolId(parentModel.getUnitVmModel().getSelectedDataCenter().getId()); vm.setVdsGroupCompatibilityVersion(parentModel.getUnitVmModel().getSelectedCluster().getCompatibilityVersion()); model.setVm(vm); setupModelAsDialog(model, ConstantsManager.getInstance().getConstants().newVirtualDiskTitle(), HelpTag.new_virtual_disk, "new_virtual_disk"); showDialog(model); model.initialize(parentModel.getAllCurrentDisks()); if (getVm() != null) { model.setVm(getVm()); ((NewDiskModel)model).updateSuggestedDiskAliasFromServer(); } else { String currentVmName = parentModel.getUnitVmModel().getName().getEntity(); if (!StringUtils.isEmpty(currentVmName)) { model.getAlias().setEntity(suggestAliasForNewVm(currentVmName)); } } }
Source:
<code>public static float[] removeAllOccurences(final float[] array, final float element) { <START> BitSet foundBits = indexesOf(array, element); <END> return (float[]) removeAll((Object) array, foundBits); }</code><technical_language>inlining of 'foundBits'</technical_language>

Target:
public static float[] removeAllOccurences(final float[] array, final float element) { return (float[]) removeAll((Object) array, indexesOf(array, element)); }
Source:
<code>private void printSchema() { SchemaPrinter printer = new SchemaPrinter(); try { <START> Files.write(Paths.get("/Users/danielsilva/Documents/schema.graphqls"), printer.print(schema).getBytes()); <END> } catch (IOException e) { Logger.error(this, "Error printing schema", e); } }</code><technical_language>Wired Path</technical_language>

Target:
private void printSchema() { if (Config.getBooleanProperty("PRINT_GRAPHQL_SCHEMA", false)) { SchemaPrinter printer = new SchemaPrinter(); try { File graphqlDirectory = new File(ConfigUtils.getGraphqlPath()); if(!graphqlDirectory.exists()) { graphqlDirectory.mkdirs(); } File schemaFile = new File(graphqlDirectory.getPath() + File.separator + "schema.graphqls"); schemaFile.createNewFile(); Files.write(schemaFile.toPath(), printer.print(schema).getBytes()); } catch (IOException e) { Logger.error(this, "Error printing schema", e); } } }
Source:
<code>private static List<String> toStringList(final Object toCast) { if (toCast instanceof List) { return (List<String>) toCast; } <START> return Collections.singletonList((String) toCast); <END> }</code><technical_language>I want result of this call is expected modified anywhere. I assignment a instance variable this.excludeTags</technical_language>

Target:
private static List<String> toStringList(final Object toCast) { if (toCast instanceof List) { return (List<String>) toCast; } return new ArrayList<String>(Arrays.asList((String) toCast)); }