auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Optional<PlanNode> visitTableScan(TableScanExpression tableScan, Context context) { List<Symbol> outputChannelNames = context.getOutput(); List<ColumnHandle> columnHandles = tableScan.getOutput().stream() .filter(ColumnReferenceExpression.class::isInstance) .map(ColumnReferenceExpression.class::cast) .map(ColumnReferenceExpression::getColumnHandle) .collect(toImmutableList()); checkArgument(columnHandles.size() == tableScan.getOutput().size(), "tableScan must contains all columnHandle"); <START> ImmutableMap.Builder<Symbol, ColumnHandle> columnHandleMap = new ImmutableMap.Builder(); <END> for (int i = 0; i < columnHandles.size(); i++) { columnHandleMap.put(outputChannelNames.get(i), columnHandles.get(i)); } Optional<TableLayoutHandle> tableLayoutHandle = Optional.empty(); if (tableScan.getConnectorTableLayoutHandle().isPresent()) { tableLayoutHandle = Optional.of( new TableLayoutHandle( connectorId, metadata.getTransactionHandle(session, connectorId), tableScan.getConnectorTableLayoutHandle().get())); } return Optional.of( new TableScanNode( idAllocator.getNextId(), new TableHandle(connectorId, tableScan.getTableHandle()), outputChannelNames, columnHandleMap.build(), tableLayoutHandle, TupleDomain.all(), TupleDomain.all())); }</code><technical_language>new ImmutableMap.Builder() -> ImmutableMap.buider()</technical_language>

Target:
private Optional<PlanNode> visitTableScan(TableScanExpression tableScan, Context context) { List<Symbol> outputChannelNames = context.getOutput(); List<ColumnHandle> columnHandles = tableScan.getOutput().stream() .filter(ColumnReferenceExpression.class::isInstance) .map(ColumnReferenceExpression.class::cast) .map(ColumnReferenceExpression::getColumnHandle) .collect(toImmutableList()); checkArgument(columnHandles.size() == tableScan.getOutput().size(), "tableScan must contains all columnHandle"); ImmutableMap.Builder<Symbol, ColumnHandle> columnHandleMap = new ImmutableMap.Builder(); for (int i = 0; i < columnHandles.size(); i++) { columnHandleMap.put(outputChannelNames.get(i), columnHandles.get(i)); } Optional<TableLayoutHandle> tableLayoutHandle = Optional.empty(); if (tableScan.getConnectorTableLayoutHandle().isPresent()) { tableLayoutHandle = Optional.of( new TableLayoutHandle( connectorId, metadata.getTransactionHandle(session, connectorId), tableScan.getConnectorTableLayoutHandle().get())); } return Optional.of( new TableScanNode( idAllocator.getNextId(), new TableHandle(connectorId, tableScan.getTableHandle()), outputChannelNames, columnHandleMap.build(), tableLayoutHandle, TupleDomain.all(), TupleDomain.all())); }
Source:
<code>public void canObtainValidatorFactoryAndPerformValidation() { Thread.currentThread().setContextClassLoader( getClass().getClassLoader() ); Set<ConstraintViolation<Customer>> constraintViolations = Validation.byDefaultProvider() .providerResolver( new MyValidationProviderResolver() ) .configure() .buildValidatorFactory() .getValidator() .validate( new Customer() ); assertEquals( 1, constraintViolations.size() ); <START> assertEquals( "must be greater than or equal to 2", constraintViolations.iterator().next().getMessage() ); <END> }</code><technical_language>is coming from</technical_language>

Target:
public void canObtainValidatorFactoryAndPerformValidation() { ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( getClass().getClassLoader() ); Set<ConstraintViolation<Customer>> constraintViolations = Validation.byDefaultProvider() .providerResolver( new MyValidationProviderResolver() ) .configure() .buildValidatorFactory() .getValidator() .validate( new Customer() ); assertEquals( 1, constraintViolations.size() ); assertEquals( "must be greater than or equal to 2", constraintViolations.iterator().next().getMessage() ); } finally { Thread.currentThread().setContextClassLoader( originalClassLoader ); } }
Source:
<code>private static List<Pair<String, String>> split(String flattenedPossibleRepresentations) { return ESCAPE_OUTER .getSplitPattern() .splitAsStream(flattenedPossibleRepresentations) .map(ESCAPE_OUTER::unescape) .map( joinedPossibleRepresentation -> { <START> String[] values = ESCAPE_INNER.getSplitPattern().split(joinedPossibleRepresentation); <END> if (values.length != 1 && values.length != 2) { throw new IllegalStateException( "Wrong number of split results - joined string: " + joinedPossibleRepresentation + ", split result: " + Arrays.toString(values)); } String name = values[0]; String path; if (values.length == 2) { path = values[1]; } else { path = ""; } return new ImmutablePair<>(ESCAPE_INNER.unescape(name), ESCAPE_INNER.unescape(path)); }) .collect(Collectors.toList()); }</code><technical_language>moving code method function statement is easier read</technical_language>

Target:
private static List<Pair<String, String>> split(String flattenedPossibleRepresentations) { return ESCAPE_OUTER .splitAsStream(flattenedPossibleRepresentations) .map(ESCAPE_OUTER::unescape) .map(AbstractPossibleRepresentationProvider::splitInner) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
<code>public void pushDirectoryURI(URI dir) { if (dir != null) { <START> if (dir.isAbsolute()) <END> fDirectoryStack.addElement(dir); else fDirectoryStack.addElement(URIUtil.makeAbsolute(dir, getWorkingDirectoryURI())); } }</code><technical_language>Please bring braces back</technical_language>

Target:
public void pushDirectoryURI(URI dir) { if (dir != null) { if (dir.isAbsolute()) { fDirectoryStack.addElement(dir); } else { fDirectoryStack.addElement(URIUtil.makeAbsolute(dir, getWorkingDirectoryURI())); } } }
Source:
<code>public final MessageInterpolator getDefaultMessageInterpolator() { <START> return new ResourceBundleMessageInterpolator( defaultResourceBundleLocator ); <END> }</code><technical_language>I thought this approach I admit I disliked fact instantiate a new ResourceBundleMessageInterpolator time call this method (and getMessageInterpolator). I expect return object for call. Thinking I noticed Configuration is supposed thread safe, store interpolators time methods called? solve this issue</technical_language>

Target:
public final MessageInterpolator getDefaultMessageInterpolator() { if ( defaultMessageInterpolator == null ) { defaultMessageInterpolator = new ResourceBundleMessageInterpolator( defaultResourceBundleLocator ); } return defaultMessageInterpolator; }
Source:
<code>public void notifySurfaceDetached() { super.notifySurfaceDetached(); <START> if (mImageReaderToReleaseList.size() > 0) { <END> for (ImageReaderProxy imageReader : mImageReaderToReleaseList) { Surface surface = imageReader.getSurface(); if (surface != null) { surface.release(); } imageReader.close(); } mImageReaderToReleaseList.clear(); } }</code><technical_language>isEmpty() alternatively, check size, for loop run if is empty</technical_language>

Target:
public void notifySurfaceDetached() { super.notifySurfaceDetached(); if (!mImageReaderToReleaseList.isEmpty()) { for (ImageReaderProxy imageReader : mImageReaderToReleaseList) { Surface surface = imageReader.getSurface(); if (surface != null) { surface.release(); } imageReader.close(); } mImageReaderToReleaseList.clear(); } }
Source:
<code>public String searchClassifier( String uriPath, String uriQuery ) { <START> if(Utilities.stringContains(uriPath, apiPath)) <END> { if(Utilities.stringContains(uriQuery, queryAction)) { if(Utilities.stringContains(uriQuery, prefixSearchList)) { return "prefix search"; } if(Utilities.stringContains(uriQuery, searchList)) { return "cirrus search"; } if(Utilities.stringContains(uriQuery, geoSearchList)) { return "geo search"; } return ""; } if(Utilities.stringContains(uriQuery, openSearchAction)) { return "open search"; } if(Utilities.stringContains(uriQuery, languageSearchAction)) { return "language search"; } } return ""; }</code><technical_language>is a good reason for uriPath.contains this is unexpected</technical_language>

Target:
public String searchClassifier( String uriPath, String uriQuery ) { if(Utilities.stringContains(uriPath, apiPath)) { if(Utilities.stringContains(uriQuery, queryAction)) { if(Utilities.stringContains(uriQuery, prefixSearchList)) { return "prefix"; } if(Utilities.stringContains(uriQuery, searchList)) { return "cirrus"; } if(Utilities.stringContains(uriQuery, geoSearchList)) { return "geo"; } return ""; } if(Utilities.stringContains(uriQuery, openSearchAction)) { return "open"; } if(Utilities.stringContains(uriQuery, languageSearchAction)) { return "language"; } } return ""; }
Source:
<code>public Builder addDictEncoding(Encoding encoding, int numPages) { Integer pages = dictStats.get(encoding); if (pages != null) { dictStats.put(encoding, numPages + pages); } else { dictStats.put(encoding, numPages); <START> } <END> return this; }</code><technical_language>about: dictStats.put(encoding, numPages == null ? 0 : numPages);</technical_language>

Target:
public Builder addDictEncoding(Encoding encoding, int numPages) { Integer pages = dictStats.get(encoding); dictStats.put(encoding, numPages + (pages != null ? pages : 0)); return this; }
Source:
<code>public void nonExistentTablesWithMetadataDoNotAppearInGetMetadataForTables() { insertMetadataIntoNewCell(LOWER_UPPER); assertThat(kvs.getMetadataForTables()).isEmpty(); <START> assertThat(kvs.getMetadataForTable(LOWER_UPPER)).contains(AtlasDbConstants.GENERIC_TABLE_METADATA); <END> }</code><technical_language>nit: This a separate test (the name of test lead expect line 84, this one)</technical_language>

Target:
public void nonExistentTablesWithMetadataDoNotAppearInGetMetadataForTables() { insertMetadataIntoNewCell(LOWER_UPPER); assertThat(kvs.getMetadataForTables()).isEmpty(); }
Source:
<code>public SSLContext get() { Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null"); if (new File(currentCreds.identity).isFile() && new File(currentCreds.credential).isFile()) { try { SSLContext sslContext = SSLContext.getInstance("TLS"); X509Certificate certificate = getCertificate(loadFile(currentCreds.identity)); PrivateKey privateKey = getKey(loadFile(currentCreds.credential)); sslContext.init(new KeyManager[]{new InMemoryKeyManager(certificate, privateKey)}, trustManager, new SecureRandom()); return sslContext; } catch (GeneralSecurityException e) { <START> throw new AssertionError(); END> } catch (IOException e) { throw propagate(e); } } return null; }</code><technical_language>propagate a proper exception here</technical_language>

Target:
public SSLContext get() { Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null"); try { SSLContext sslContext = SSLContext.getInstance("TLS"); X509Certificate certificate = getCertificate(loadFile(currentCreds.identity)); PrivateKey privateKey = getKey(loadFile(currentCreds.credential)); sslContext.init(new KeyManager[]{new InMemoryKeyManager(certificate, privateKey)}, trustManager, new SecureRandom()); return sslContext; } catch (GeneralSecurityException e) { throw propagate(e); } catch (IOException e) { throw propagate(e); } }
Source:
<code><START> public void testConvertAdHocSubprocessNode_notautostart() throws Exception { <END> final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertFalse(CustomElement.autoStart.of(writer.getFlowElement()).get()); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testConvertAdHocSubprocessNode_notautostart() { final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertFalse(CustomElement.autoStart.of(writer.getFlowElement()).get()); }
Source:
<code>public void testWritingToFile() throws IOException { for (int threads = 1; threads <= 4; threads++) { AsyncWriterPool pool = new AsyncWriterPool(threads); int fileNum = 8; ArrayList<File> files = new ArrayList<>(); ArrayList<Writer<String>> writers = new ArrayList<>(); ArrayList<Iterator<Integer>> streams = new ArrayList<>(); for (int i = 0; i < fileNum; i++) { File file = File.createTempFile(String.format("AsyncPoolWriter_%s_%s", threads, i), ".tmp"); TestWriter writer = new TestWriter(file.toPath()); files.add(file); Writer<String> pooledWriter = pool.pool(writer, new LinkedBlockingQueue<>(), 15); writers.add(pooledWriter); streams.add(Stream.iterate(0, val -> val + 1).iterator()); } for (int i = 0; i < fileNum * 10; i++) { for (int j = 0; j < 10; j++) { writers.get(i % fileNum).write(String.format("%s\n", streams.get(i % fileNum).next())); } } pool.close(); for (int i = 0; i < fileNum; i++) { File file = files.get(i); List<Integer> lines = IOUtil.slurpLines(file).stream().map(Integer::parseInt).collect(Collectors.toList()); <START> assert AsyncWriterPoolTest.isSorted(lines); <END> assert lines.size() == 100; } } }</code><technical_language>tests Assert.assertTrue() instead of assert keyword</technical_language>

Target:
public void testWritingToFile() throws IOException { for (int threads = 1; threads <= 4; threads++) { AsyncWriterPool pool = new AsyncWriterPool(threads); int fileNum = 8; ArrayList<File> files = new ArrayList<>(); ArrayList<Writer<String>> writers = new ArrayList<>(); ArrayList<Iterator<Integer>> streams = new ArrayList<>(); for (int i = 0; i < fileNum; i++) { File file = File.createTempFile(String.format("AsyncPoolWriter_%s_%s", threads, i), ".tmp"); file.deleteOnExit(); TestWriter writer = new TestWriter(file.toPath()); files.add(file); Writer<String> pooledWriter = pool.pool(writer, new LinkedBlockingQueue<>(), 15); writers.add(pooledWriter); streams.add(Stream.iterate(0, val -> val + 1).iterator()); } for (int i = 0; i < fileNum * 10; i++) { for (int j = 0; j < 10; j++) { writers.get(i % fileNum).write(String.format("%s\n", streams.get(i % fileNum).next())); } } pool.close(); for (int i = 0; i < fileNum; i++) { File file = files.get(i); List<Integer> lines = IOUtil.slurpLines(file).stream().map(Integer::parseInt).collect(Collectors.toList()); Assert.assertTrue(AsyncWriterPoolTest.isSorted(lines)); Assert.assertEquals(lines.size(), 100); } } }
Source:
<code>private void initTable() { AbstractEntityModelTextColumn<StorageDomain> nameColumn = new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { return storage.getStorageName(); } }; storageDomainItems.setColumnWidth(nameColumn, "280px"); storageDomainItems.addColumn(nameColumn, constants.nameStorage()); AbstractEntityModelTextColumn<StorageDomain> freeSpaceColumn = new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { if (storage.getAvailableDiskSize() == null || storage.getAvailableDiskSize() < 1) { return messages.gigabytes("< 1"); } return <START> messages.gigabytes(storage.getAvailableDiskSize().toString()); <END> } }; storageDomainItems.setColumnWidth(freeSpaceColumn, "80px"); storageDomainItems.addColumn(freeSpaceColumn, constants.freeSpaceStorage()); }</code><technical_language>consider String.valueOf() circumvent NPE</technical_language>

Target:
private void initTable() { AbstractEntityModelTextColumn<StorageDomain> nameColumn = new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { return storage.getStorageName(); } }; storageDomainItems.setColumnWidth(nameColumn, "280px"); storageDomainItems.addColumn(nameColumn, constants.nameStorage()); AbstractEntityModelTextColumn<StorageDomain> freeSpaceColumn = new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { if (storage.getAvailableDiskSize() == null || storage.getAvailableDiskSize() < 1) { return messages.gigabytes("< 1"); } return messages.gigabytes(String.valueOf(storage.getAvailableDiskSize())); } }; storageDomainItems.setColumnWidth(freeSpaceColumn, "80px"); storageDomainItems.addColumn(freeSpaceColumn, constants.freeSpaceStorage()); }
Source:
<code>private OMResponse createErrorResponse( OMRequest omRequest, IOException exception) { OzoneManagerProtocolProtos.Type cmdType = omRequest.getCmdType(); switch (cmdType) { <START> case CreateVolume: <END> case SetVolumeProperty: case DeleteVolume: case CreateBucket: case SetBucketProperty: case DeleteBucket: case CreateKey: case RenameKey: case DeleteKey: case CommitKey: case AllocateBlock: case CreateS3Bucket: case DeleteS3Bucket: case InitiateMultiPartUpload: case CommitMultiPartUpload: case CompleteMultiPartUpload: case AbortMultiPartUpload: case GetS3Secret: case GetDelegationToken: case RenewDelegationToken: case CancelDelegationToken: case CreateDirectory: case CreateFile: case RemoveAcl: case SetAcl: case AddAcl: case PurgeKeys: OMResponse.Builder omResponse = OMResponse.newBuilder() .setStatus( OzoneManagerRatisUtils.exceptionToResponseStatus(exception)) .setCmdType(cmdType) .setSuccess(false); if (exception.getMessage() != null) { omResponse.setMessage(exception.getMessage()); } return omResponse.build(); default: return null; } }</code><technical_language>avoid this switch/case block</technical_language>

Target:
private OMResponse createErrorResponse( OMRequest omRequest, IOException exception) { OzoneManagerProtocolProtos.Type cmdType = omRequest.getCmdType(); OMResponse.Builder omResponse = OMResponse.newBuilder() .setStatus( OzoneManagerRatisUtils.exceptionToResponseStatus(exception)) .setCmdType(cmdType) .setSuccess(false); if (exception.getMessage() != null) { omResponse.setMessage(exception.getMessage()); } return omResponse.build(); }
Source:
<code>public void createIndex( Iterator rows, InputRowParser parser, final AggregatorFactory[] metrics, File outDir, long minTimestamp, QueryGranularity gran, boolean deserializeComplexMetrics, int maxRowCount ) throws Exception { IncrementalIndex index = null; List<File> toMerge = new ArrayList<>(); try { index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount); while (rows.hasNext()) { Object row = rows.next(); try { if (row instanceof String && parser instanceof StringInputRowParser) { index.add(((StringInputRowParser) parser).parse((String) row)); } else { index.add(parser.parse(row)); } } catch (IndexSizeExceededException ex) { <START> File tmp = Files.createTempDir(); <END> toMerge.add(tmp); IndexMerger.persist(index, tmp, null, new IndexSpec()); index.close(); index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount); } } if (toMerge.size() > 0) { File tmp = Files.createTempDir(); toMerge.add(tmp); IndexMerger.persist(index, tmp, null, new IndexSpec()); List<QueryableIndex> indexes = new ArrayList<>(toMerge.size()); for (File file : toMerge) { indexes.add(IndexIO.loadIndex(file)); } IndexMerger.mergeQueryableIndex(indexes, metrics, outDir, new IndexSpec()); for (QueryableIndex qi : indexes) { qi.close(); } } else { IndexMerger.persist(index, outDir, null, new IndexSpec()); } } finally { if (index != null) { index.close(); } for (File file : toMerge) { FileUtils.deleteDirectory(file); } } }</code><technical_language>indexing tests notoriously dirty leaving files behind. this reorchestrated a controlled TemporaryFolder @Rule, caller</technical_language>

Target:
public void createIndex( Iterator rows, InputRowParser parser, final AggregatorFactory[] metrics, File outDir, long minTimestamp, QueryGranularity gran, boolean deserializeComplexMetrics, int maxRowCount ) throws Exception { IncrementalIndex index = null; List<File> toMerge = new ArrayList<>(); try { index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount); while (rows.hasNext()) { Object row = rows.next(); try { if (row instanceof String && parser instanceof StringInputRowParser) { index.add(((StringInputRowParser) parser).parse((String) row)); } else { index.add(parser.parse(row)); } } catch (IndexSizeExceededException ex) { File tmp = tempFolder.newFolder(); toMerge.add(tmp); IndexMerger.persist(index, tmp, null, new IndexSpec()); index.close(); index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount); } } if (toMerge.size() > 0) { File tmp = tempFolder.newFolder(); toMerge.add(tmp); IndexMerger.persist(index, tmp, null, new IndexSpec()); List<QueryableIndex> indexes = new ArrayList<>(toMerge.size()); for (File file : toMerge) { indexes.add(IndexIO.loadIndex(file)); } IndexMerger.mergeQueryableIndex(indexes, metrics, outDir, new IndexSpec()); for (QueryableIndex qi : indexes) { qi.close(); } } else { IndexMerger.persist(index, outDir, null, new IndexSpec()); } } finally { if (index != null) { index.close(); } } }
Source:
<code>public MwPageCombo pageCombo(String title, boolean noImages) throws IOException { Response<MwPageCombo> rsp = webService.pageCombo(title, noImages).execute(); if (rsp.isSuccessful() && !rsp.body().hasError()) { return rsp.body(); } <START> throw new IOException(rsp.message()); <END> }</code><technical_language>this obscure error returned server (body().getError()). Do throw IOException(body().getError()) in case body().hasError()? (ditto for RbPageService)</technical_language>

Target:
public MwPageCombo pageCombo(String title, boolean noImages) throws IOException { Response<MwPageCombo> rsp = webService.pageCombo(title, noImages).execute(); if (rsp.isSuccessful() && !rsp.body().hasError()) { return rsp.body(); } ServiceError err = rsp.body() == null || rsp.body().getError() == null ? null : rsp.body().getError(); throw new IOException(err == null ? rsp.message() : err.getDetails()); }
Source:
<code>private void openWelcomeEditors(IWorkbenchWindow window) { if (IDEWorkbenchPlugin.getDefault().getPreferenceStore().getBoolean( IDEInternalPreferences.WELCOME_DIALOG)) { IProduct product = Platform.getProduct(); if (product == null) { return; } AboutInfo productInfo = new AboutInfo(product); URL url = productInfo.getWelcomePageURL(); if (url == null) { return; } IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue( IDEInternalPreferences.WELCOME_DIALOG, false); openWelcomeEditor(window, new WelcomeEditorInput(productInfo), null); } else { List<AboutInfo> welcomeFeatures = new ArrayList<>(); for (Object element : <START> wbAdvisor.getNewlyAddedBundleGroups().entrySet()) { <END> Map.Entry entry = (Map.Entry) element; AboutInfo info = (AboutInfo) entry.getValue(); if (info != null && info.getWelcomePageURL() != null) { welcomeFeatures.add(info); String pi = info.getBrandingBundleId(); if (pi != null) { Bundle bundle = Platform.getBundle(pi); if (bundle != null) { try { bundle.start(Bundle.START_TRANSIENT); } catch (BundleException exception) { StatusManager .getManager() .handle( new Status( IStatus.ERROR, IDEApplication.PLUGIN_ID, "Failed to load feature", exception)); } } } } } int wCount = getWorkbench().getWorkbenchWindowCount(); for (int i = 0; i < welcomeFeatures.size(); i++) { AboutInfo newInfo = welcomeFeatures.get(i); String id = newInfo.getWelcomePerspectiveId(); if (id == null || i >= wCount) { openWelcomeEditor(window, new WelcomeEditorInput(newInfo), id); } } } }</code><technical_language>call values()</technical_language>

Target:
private void openWelcomeEditors(IWorkbenchWindow window) { if (IDEWorkbenchPlugin.getDefault().getPreferenceStore().getBoolean( IDEInternalPreferences.WELCOME_DIALOG)) { IProduct product = Platform.getProduct(); if (product == null) { return; } AboutInfo productInfo = new AboutInfo(product); URL url = productInfo.getWelcomePageURL(); if (url == null) { return; } IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue( IDEInternalPreferences.WELCOME_DIALOG, false); openWelcomeEditor(window, new WelcomeEditorInput(productInfo), null); } else { List<AboutInfo> welcomeFeatures = new ArrayList<>(); for (AboutInfo info : wbAdvisor.getNewlyAddedBundleGroups().values()) { if (info != null && info.getWelcomePageURL() != null) { welcomeFeatures.add(info); String pi = info.getBrandingBundleId(); if (pi != null) { Bundle bundle = Platform.getBundle(pi); if (bundle != null) { try { bundle.start(Bundle.START_TRANSIENT); } catch (BundleException exception) { StatusManager.getManager().handle(new Status(IStatus.ERROR, IDEApplication.PLUGIN_ID, "Failed to load feature", exception)); } } } } } int wCount = getWorkbench().getWorkbenchWindowCount(); for (int i = 0; i < welcomeFeatures.size(); i++) { AboutInfo newInfo = welcomeFeatures.get(i); String id = newInfo.getWelcomePerspectiveId(); if (id == null || i >= wCount) { openWelcomeEditor(window, new WelcomeEditorInput(newInfo), id); } } } }
Source:
<code>protected List<CaseDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) { <START> List<CaseDefinitionEntity> defList=transformer.createTransform().deployment(deployment).resource(resource).transform(); <END> if(!properties.contains(TIMER_DECLR_KEY)){ properties.set(TIMER_DECLR_KEY,new HashMap()); } for(CaseDefinitionEntity caseDefinitionEntity: defList){ if(caseDefinitionEntity.getTimerJobDeclarationMap()!=null){ properties.get(TIMER_DECLR_KEY).putAll(caseDefinitionEntity.getTimerJobDeclarationMap()); } } return defList; }</code><technical_language>I suggest implement follows: @Override protected List<CaseDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) { CmmnTransform cmmnTransform = transformer.createTransform(); List<CaseDefinitionEntity> definitions = cmmnTransform .deployment(deployment) .resource(resource) .transform(); if (!properties.contains(JOB_DECLARATIONS_PROPERTY)) { properties.set(JOB_DECLARATIONS_PROPERTY, new HashMap<String, List<JobDeclaration<?, ?>>>()); } properties.get(JOB_DECLARATIONS_PROPERTY).putAll(cmmnTransform.getJobDeclarations()); return definitions; }</technical_language>

Target:
protected List<CaseDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) { CmmnTransform cmmnTransform = transformer.createTransform(); List<CaseDefinitionEntity> defList=cmmnTransform.deployment(deployment).resource(resource).transform(); if(!properties.contains(JOB_DECLARATIONS_PROPERTY)){ properties.set(JOB_DECLARATIONS_PROPERTY, new HashMap<String, List<JobDeclaration<?, ?>>>()); } properties.get(JOB_DECLARATIONS_PROPERTY).putAll(cmmnTransform.getJobDeclarations()); return defList; }
Source:
<code>public boolean handlesEvent(CellPreviewEvent<EntityModel> event) <START> { <END> NativeEvent nativeEvent = event.getNativeEvent(); if (!BrowserEvents.CLICK.equals(nativeEvent.getType())) { return false; } return true; }</code><technical_language>this simply "return BrowserEvents.CLICK.equals( event.getNativeEvent().getType())"</technical_language>

Target:
public boolean handlesEvent(CellPreviewEvent<EntityModel> event) { return BrowserEvents.CLICK.equals(event.getNativeEvent().getType()); }
Source:
<code>public HadoopWritableInputRow getCurrentValue() throws IOException, InterruptedException { Map<String, Object> event = currRow.getEvent(); for(Metric m : complexMetrics) { if(event.containsKey(m.getName())) { <START> ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(m.getComplexTypeName()); <END> if (serde == null) { throw new ISE("Unknown type[%s]", m.getComplexTypeName()); } event.put(m.getName(), serde.getObjectStrategy().toBytes(event.get(m.getName()))); } } return new MapBasedHadoopWritableInputRow(new MapBasedInputRow(currRow.getTimestamp(), spec.getDimensions(), event)); }</code><technical_language>This feels weird here. If one, a general utility for converting a Map<Stirng, Object> event a proper MapBasedInputRow</technical_language>

Target:
public InputRow getCurrentValue() throws IOException, InterruptedException { return new SegmentInputRow( new MapBasedInputRow( currRow.getTimestamp(), spec.getDimensions(), currRow.getEvent() ) ); }
Source:
<code>public synchronized boolean addMetadataStoreRealm(String realm) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return createZkRealm(realm); } <START> String leaderHostName = _leaderElection.getCurrentLeaderInfo().getId(); String url = leaderHostName + "/admin/v2/namespaces/" + _namespace + "/metadata-store-realms/" + realm; <END> HttpPut putRequest = new HttpPut(url); try { HttpResponse response = _forwardHttpClient.execute(putRequest); if (response.getStatusLine().getStatusCode() != 201) { HttpEntity respEntity = response.getEntity(); LOG.error("the forwarded request to leader has failed for addMetadataStoreRealm: {}", respEntity != null ? EntityUtils.toString(respEntity) : ""); return false; } } catch (IOException e) { LOG.error("the forwarded request to leader raised an exception for addMetadataStoreRealm", e); return false; } return true; }</code><technical_language>refactor this out a private method getCurrentLeaderEndpoint()? code more readable reduce duplication</technical_language>

Target:
public synchronized boolean addMetadataStoreRealm(String realm) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return createZkRealm(realm); } String urlSuffix = constructUrlSuffix(MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, realm); return forwardRequestToLeader(urlSuffix, HttpConstants.RestVerbs.PUT, Response.Status.CREATED.getStatusCode()); }
Source:
<code>public void testHere() { <START> Geocoder geocoder = new HereGeocoder("<LINK_0>", "", "", null, 0, new AddressFormat()); <END> String address = geocoder.getAddress(48.8575, 2.2944, null); assertEquals("6 Avenue Gustave Eiffel, Paris, Île-de-France, FRA", address); }</code><technical_language>URL removed</technical_language>

Target:
public void testHere() { Geocoder geocoder = new HereGeocoder(null, "", "", null, 0, new AddressFormat()); String address = geocoder.getAddress(48.8575, 2.2944, null); assertEquals("6 Avenue Gustave Eiffel, Paris, Île-de-France, FRA", address); }
Source:
<code>public static ProcessMonitor getInstance() { if(instance == null) { synchronized (lock) { if(instance == null) { if (UIUtil.isLinux) { <START> instance = new LinuxProcessMonitor(); <END> } else if (UIUtil.isWindows) { instance = new WindowsProcessMonitor(); } else { instance = new ProcessMonitor(); } } } } return instance; }</code><technical_language>macOs implementation is pending</technical_language>

Target:
public static ProcessMonitor getInstance() { if(instance == null) { synchronized (lock) { if(instance == null) { if (UIUtil.isLinux) { instance = new LinuxProcessMonitor(); } else if (UIUtil.isWindows) { instance = new WindowsProcessMonitor(); } else if(UIUtil.isMac) { instance = new MacProcessMonitor(); } else { instance = new ProcessMonitor(); } } } } return instance; }
Source:
<code>public static double[] findCoordinates(String name) { double[] pair = new double[2]; if (name.equals("")) { pair = findCoordinatesByIp(); } else { <START> String query = "<LINK_0>"; <END> String key = "&key=AIzaSyB-_tiO6Z9cJusdLmgQoJ_GOAS7lYy3UHU"; String finalQuery = query + name + key; try { URL url = new URL(finalQuery); URLConnection conn = url.openConnection(); ByteArrayOutputStream output = new ByteArrayOutputStream(MAX_BYTE_STREAM); org.apache.commons.io.IOUtils.copy(conn.getInputStream(), output); output.close(); String result = output.toString(); twitter4j.JSONObject geoData = new twitter4j.JSONObject(result); if (geoData.getString("status").equals("OK")) { twitter4j.JSONArray places = geoData.getJSONArray("results"); twitter4j.JSONObject place = places.getJSONObject(0); twitter4j.JSONObject geometry = place.getJSONObject("geometry"); twitter4j.JSONObject location = geometry.getJSONObject("location"); double lat = Double.parseDouble(location.getString("lat")); double lon = Double.parseDouble(location.getString("lng")); pair[0] = lat; pair[1] = lon; return pair; } else { System.err.println("can't find coordinates"); } } catch (Exception ex) { System.err.println(ex.getMessage()); } } return pair; }</code><technical_language>String.format</technical_language>

Target:
public static double[] findCoordinates(String name) throws LocationException, PropertiesException { double lat, lon; String key; if (name.equals("")) { return findCoordinatesByIp(); } else { PropertiesLoader prop = new PropertiesLoader(); try { key = "&key=" + prop.loadKey().split("\"")[1]; } catch (PropertiesException e) { throw new PropertiesException(e.getMessage()); } String query = "<LINK_0>"; String finalQuery = query + name + key; try { URL url = new URL(finalQuery); URLConnection conn = url.openConnection(); try (ByteArrayOutputStream output = new ByteArrayOutputStream(MAX_BYTE_STREAM)) { org.apache.commons.io.IOUtils.copy(conn.getInputStream(), output); output.close(); String result = output.toString(); twitter4j.JSONObject geoData = new twitter4j.JSONObject(result); if (geoData.getString("status").equals("OK")) { twitter4j.JSONArray places = geoData.getJSONArray("results"); twitter4j.JSONObject place = places.getJSONObject(0); twitter4j.JSONObject geometry = place.getJSONObject("geometry"); twitter4j.JSONObject location = geometry.getJSONObject("location"); lat = Double.parseDouble(location.getString("lat")); lon = Double.parseDouble(location.getString("lng")); } else { throw new LocationException("can't find coordinates"); } } catch (Exception ex) { throw new LocationException(ex.getMessage()); } } catch (Exception ex) { throw new LocationException(ex.getMessage()); } } return new double[]{lat, lon}; }
Source:
<code>private long getTotalBytesRead(StoreFindToken newToken, List<MessageInfo> messageEntries, long logEndOffsetBeforeFind) { if (newToken.getOffset() == -1) { return newToken.getIndexStartOffset(); } else { <START> <END> if (messageEntries.size() > 0) { MessageInfo lastMsgInfo = messageEntries.get(messageEntries.size() - 1); return newToken.getOffset() + lastMsgInfo.getSize(); } else { return logEndOffsetBeforeFind; } } }</code><technical_language>whitespace</technical_language>

Target:
private long getTotalBytesRead(StoreFindToken newToken, List<MessageInfo> messageEntries, long logEndOffsetBeforeFind) { if (newToken.getOffset() == StoreFindToken.Uninitialized_Offset) { if (newToken.getIndexStartOffset() == StoreFindToken.Uninitialized_Offset) { return 0; } else { return newToken.getIndexStartOffset(); } } else { if (messageEntries.size() > 0) { MessageInfo lastMsgInfo = messageEntries.get(messageEntries.size() - 1); return newToken.getOffset() + lastMsgInfo.getSize(); } else { return logEndOffsetBeforeFind; } } }
Source:
<code><START> public boolean equals(final Object obj) { <END> if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (this.getClass() != obj.getClass()) { return false; } final SsldConverter other = (SsldConverter) obj; if (this.helper == null) { if (other.helper != null) { return false; } } else if (!this.helper.equals(other.helper)) { return false; } if (this.ssldRepository == null) { if (other.ssldRepository != null) { return false; } } else if (!this.ssldRepository.equals(other.ssldRepository)) { return false; } return true; }</code><technical_language>java.util.Objects</technical_language>

Target:
public boolean equals(final Object obj) { return super.equals(obj) && Objects.equals(this.helper, ((SsldConverter) obj).helper) && Objects.equals(this.ssldRepository, ((SsldConverter) obj).ssldRepository); }
Source:
<code>private void loadData(@NonNull CourseComponent courseComponent) { courseComponentId = courseComponent.getId(); if (courseData == null || getActivity() == null) return; if (!EventBus.getDefault().isRegistered(this)) { EventBus.getDefault().registerSticky(this); } if (!isOnCourseOutline) { getActivity().setTitle(courseComponent.getDisplayName()); } adapter.setData(courseComponent); if (adapter.hasCourseData()) { setUpBulkDownloadHeader(courseComponent); errorNotification.hideError(); } else { <START> if (isAdded()) { <END> UiUtil.removeFragmentByTag(getChildFragmentManager(), "bulk_download"); } errorNotification.showError(isVideoMode ? R.string.no_videos_text : R.string.no_chapter_text, null, -1, null); } if (!isOnCourseOutline) { environment.getAnalyticsRegistry().trackScreenView( Analytics.Screens.SECTION_OUTLINE, courseData.getCourse().getId(), courseComponent.getInternalName()); lastAccessManager.setLastAccessed(courseComponent.getCourseId(), courseComponent.getId()); } fetchLastAccessed(); }</code><technical_language>move isAdded() function utility function java public static void removeFragmentByTag(@NonNull Fragment parentFragment, @NonNull String tag) { if (parentFragment.isAdded()) { final FragmentManager fragmentManager = parentFragment.getChildFragmentManager(); final Fragment fragment = fragmentManager.findFragmentByTag(tag); if (fragment != null) { fragmentManager.beginTransaction().remove(fragment) .commit(); } } }</technical_language>

Target:
private void loadData(@NonNull CourseComponent courseComponent) { courseComponentId = courseComponent.getId(); if (courseData == null || getActivity() == null) return; if (!EventBus.getDefault().isRegistered(this)) { EventBus.getDefault().registerSticky(this); } if (!isOnCourseOutline) { getActivity().setTitle(courseComponent.getDisplayName()); } adapter.setData(courseComponent); if (adapter.hasCourseData()) { setUpBulkDownloadHeader(courseComponent); errorNotification.hideError(); } else { UiUtil.removeFragmentByTag(CourseOutlineFragment.this, "bulk_download"); errorNotification.showError(isVideoMode ? R.string.no_videos_text : R.string.no_chapter_text, null, -1, null); } if (!isOnCourseOutline) { environment.getAnalyticsRegistry().trackScreenView( Analytics.Screens.SECTION_OUTLINE, courseData.getCourse().getId(), courseComponent.getInternalName()); lastAccessManager.setLastAccessed(courseComponent.getCourseId(), courseComponent.getId()); } fetchLastAccessed(); }
Source:
<code>private void setPreservePathOnForward(Boolean preservePathOnForward) throws Exception { String opName = preservePathOnForward == null ? UNDEFINE_ATTRIBUTE_OPERATION : WRITE_ATTRIBUTE_OPERATION; <START> ModelNode setPreservePathOp = createOpNode("subsystem=undertow/servlet-container=default", WRITE_ATTRIBUTE_OPERATION); <END> setPreservePathOp.get("name").set("preserve-path-on-forward"); if (preservePathOnForward != null) { setPreservePathOp.get("value").set(preservePathOnForward); } CoreUtils.applyUpdate(setPreservePathOp, managementClient.getControllerClient()); ServerReload.executeReloadAndWaitForCompletion(managementClient.getControllerClient()); }</code><technical_language>Instead of WRITE_ATTRIBUTE_OPERATION, opName here</technical_language>

Target:
private void setPreservePathOnForward(Boolean preservePathOnForward) throws Exception { String opName = preservePathOnForward == null ? UNDEFINE_ATTRIBUTE_OPERATION : WRITE_ATTRIBUTE_OPERATION; ModelNode setPreservePathOp = createOpNode("subsystem=undertow/servlet-container=default", opName); setPreservePathOp.get("name").set("preserve-path-on-forward"); if (preservePathOnForward != null) { setPreservePathOp.get("value").set(preservePathOnForward); } CoreUtils.applyUpdate(setPreservePathOp, managementClient.getControllerClient()); ServerReload.executeReloadAndWaitForCompletion(managementClient.getControllerClient()); }
Source:
<code>public void shouldUnRetireAPersonAttributeType() throws Exception { final String nonRetiredAttribute = "a0f5521c-dbbd-4c10-81b2-1b7ab18330df"; <START> PersonAttributeType obj = service.getPersonAttributeTypeByUuid(nonRetiredAttribute); <END> obj.setRetired(true); obj.setRetireReason("random reason"); obj = service.savePersonAttributeType(obj); Assert.assertTrue(obj.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + nonRetiredAttribute, json))); obj = service.getPersonAttributeTypeByUuid(nonRetiredAttribute); Assert.assertFalse(obj.isRetired()); Assert.assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }</code><technical_language>do some googling good variable names</technical_language>

Target:
public void shouldUnRetireAPersonAttributeType() throws Exception { final String nonRetiredAttribute = "a0f5521c-dbbd-4c10-81b2-1b7ab18330df"; PersonAttributeType personAttrType = service.getPersonAttributeTypeByUuid(nonRetiredAttribute); personAttrType.setRetired(true); personAttrType.setRetireReason("random reason"); service.savePersonAttributeType(personAttrType); personAttrType = service.getPersonAttributeTypeByUuid(nonRetiredAttribute); Assert.assertTrue(personAttrType.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + nonRetiredAttribute, json))); personAttrType = service.getPersonAttributeTypeByUuid(nonRetiredAttribute); Assert.assertFalse(personAttrType.isRetired()); Assert.assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }
Source:
<code>public void replyToChange(Shell shell, RevisionInfo revisionInfo, GerritClient client) { EMap<String, EList<String>> permittedLabels = revisionInfo.getChangeInfo().getPermitted_labels(); EMap<String, LabelInfo> labels = revisionInfo.getChangeInfo().getLabels(); final ReplyDialog replyDialog = new ReplyDialog(shell, permittedLabels, labels); Display.getDefault().syncExec(new Runnable() { public void run() { <START> int ret = replyDialog.open(); <END> if (ret == IDialogConstants.OK_ID) { ReviewInput reviewInput = new ReviewInput(); reviewInput.setMessage(replyDialog.getMessage()); reviewInput.setLabels(replyDialog.getRadiosSelection()); reviewInput.setDrafts(ReviewInput.DRAFT_PUBLISH); SetReviewCommand reviewToEmit = client.setReview(revisionInfo.getChangeInfo().getId(), revisionInfo.getChangeInfo().getCurrent_revision()); reviewToEmit.setCommandInput(reviewInput); try { reviewToEmit.call(); } catch (EGerritException e1) { EGerritCorePlugin.logError(client.getRepository().formatGerritVersion() + e1.getMessage()); } } } }); }</code><technical_language>This code is duplicated in UIHelpers.java, is UIHelpers is in GeritMultipleInput</technical_language>

Target:
public void replyToChange(Shell shell, RevisionInfo revisionInfo, GerritClient client) { EMap<String, EList<String>> permittedLabels = revisionInfo.getChangeInfo().getPermitted_labels(); EMap<String, LabelInfo> labels = revisionInfo.getChangeInfo().getLabels(); final ReplyDialog replyDialog = new ReplyDialog(shell, permittedLabels, labels); Display.getDefault().syncExec(new Runnable() { public void run() { int ret = replyDialog.open(); if (ret == IDialogConstants.OK_ID) { ReviewInput reviewInput = new ReviewInput(); reviewInput.setMessage(replyDialog.getMessage()); reviewInput.setLabels(replyDialog.getRadiosSelection()); reviewInput.setDrafts(ReviewInput.DRAFT_PUBLISH); SetReviewCommand reviewToEmit = client.setReview(revisionInfo.getChangeInfo().getId(), revisionInfo.getChangeInfo().getCurrent_revision()); reviewToEmit.setCommandInput(reviewInput); try { reviewToEmit.call(); QueryHelpers.reload(client, revisionInfo.getChangeInfo()); } catch (EGerritException e1) { EGerritCorePlugin.logError(client.getRepository().formatGerritVersion() + e1.getMessage()); } } } }); }
Source:
<code>public void setListProperty(final String key, final List<String> values) { if (values == null) { setProperty(key, null); } else if (values.isEmpty()) { setProperty(key, ""); } else { <START> StringBuilder builder = new StringBuilder(); <END> for (String value : values) { builder.append(value + ", "); } builder.setLength(builder.length() - 2); setProperty(key, builder.toString()); } }</code><technical_language>final</technical_language>

Target:
public void setListProperty(final String key, final List<String> values) { if (values == null) { setProperty(key, null); } else if (values.isEmpty()) { setProperty(key, ""); } else { final StringBuilder builder = new StringBuilder(); for (String value : values) { builder.append(value + ", "); } builder.setLength(builder.length() - 2); setProperty(key, builder.toString()); } }
Source:
<code>public void emptyPartitionOverrideTest() throws Exception { assumeTrue(overrideEnabled); clusterManager.close(); metricRegistry = new MetricRegistry(); ClusterMap clusterManagerWithEmptyRecord = new HelixClusterManager(clusterMapConfig, selfInstanceName, new MockHelixManagerFactory(helixCluster, null, null), metricRegistry); Set<String> writableInClusterManager = new HashSet<>(); for (PartitionId partition : clusterManagerWithEmptyRecord.getWritablePartitionIds(null)) { <START> String partitionStr = useComposite ? partition.toPathString() : partition.toPathString(); <END> writableInClusterManager.add(partitionStr); } Set<String> writableInCluster = helixCluster.getWritablePartitions(); if (writableInCluster.isEmpty()) { writableInCluster = helixCluster.getAllWritablePartitions(); } assertEquals("Mismatch in writable partitions during initialization", writableInCluster, writableInClusterManager); }</code><technical_language>minor: simplified String partitionStr = partition.toPathString()</technical_language>

Target:
public void emptyPartitionOverrideTest() throws Exception { assumeTrue(overrideEnabled); clusterManager.close(); metricRegistry = new MetricRegistry(); ClusterMap clusterManagerWithEmptyRecord = new HelixClusterManager(clusterMapConfig, selfInstanceName, new MockHelixManagerFactory(helixCluster, null, null), metricRegistry); Set<String> writableInClusterManager = new HashSet<>(); for (PartitionId partition : clusterManagerWithEmptyRecord.getWritablePartitionIds(null)) { String partitionStr = partition.toPathString(); writableInClusterManager.add(partitionStr); } Set<String> writableInCluster = helixCluster.getWritablePartitions(); if (writableInCluster.isEmpty()) { writableInCluster = helixCluster.getAllWritablePartitions(); } assertEquals("Mismatch in writable partitions during initialization", writableInCluster, writableInClusterManager); }
Source:
<code>public boolean containsSubsequence(BootSequence subsequence) { if (subsequence == null) { return false; } boolean subsequenceLonger = subsequence.subsequences.size() > subsequences.size(); boolean subsequenceIsEmpty = subsequence.subsequences.size() == 0; if (subsequenceIsEmpty || subsequenceLonger) { return false; } int firstElementIndex = subsequences.indexOf(subsequence.subsequences.get(0)); boolean firstElementNotPresent = firstElementIndex == -1; boolean subsequenceTooLong = subsequences.size() - firstElementIndex < subsequence.subsequences.size(); if (firstElementNotPresent || subsequenceTooLong) { <START> return false; <END> } List<BootSequence> sublist = subsequences.subList(firstElementIndex, firstElementIndex + subsequence.subsequences.size()); return sublist.equals(subsequence.subsequences); }</code><technical_language>get this in EnumSet</technical_language>

Target:
public boolean containsSubsequence(BootSequence subsequence) { if (subsequence == null) { return false; } return components.containsAll(subsequence.components); }
Source:
<code>public static void cleanUpTests(){ String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File baseDirectory = new File(pathToRepo); File toDelete = baseDirectory.getParentFile(); try { FileUtil.deleteDir(toDelete.getAbsolutePath()); } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Logger remove try-catch throw IOException</technical_language>

Target:
public static void cleanUpTests(){ String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File baseDirectory = new File(pathToRepo); File toDelete = baseDirectory.getParentFile(); try { FileUtil.deleteDir(toDelete.getAbsolutePath()); } catch (IOException e) { Logger.error(ESIndexAPITest.class,e.getMessage()); } }