auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String getResponseType(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) return ""; String responseTypeName = ""; for (final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); if (rc < 200 || rc >= 300) continue; for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if (ConverterUtil.hasContent(responseType.getType()) && !responseType.getType().contentEquals("null")) { responseTypeName = responseType.getType(); } <START> if (ConverterUtil.hasContent(responseType.getComponentType()) && !responseType.getComponentType().contentEquals("null")) { <END> responseTypeName = responseType.getComponentType(); } } } if (responseTypeName.equalsIgnoreCase("java.lang.String")) { return "ds3_str"; } else if (!responseTypeName.isEmpty()) { return StructHelper.getResponseTypeName(responseTypeName); } return ""; }</code><technical_language>this else if check if response type a component type, else check type</technical_language>

Target:
public static String getResponseType(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) return ""; String responseTypeName = ""; for (final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); if (rc < 200 || rc >= 300) continue; for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if (ConverterUtil.hasContent(responseType.getType()) && !responseType.getType().contentEquals("null")) { responseTypeName = responseType.getType(); } else if (ConverterUtil.hasContent(responseType.getComponentType()) && !responseType.getComponentType().contentEquals("null")) { responseTypeName = responseType.getComponentType(); } } } if (responseTypeName.equalsIgnoreCase("java.lang.String")) { return "ds3_str"; } else if (!responseTypeName.isEmpty()) { return StructHelper.getResponseTypeName(responseTypeName); } return ""; }
Source:
<code>private void unlockAll() { if (undoLog != null && undoLog.size() > 0) { DbException.throwInternalError(); } if (!locks.isEmpty()) { Table[] array = locks.toArray(new Table[0]); for (Table t : array) { <START> t.unlock(this); <END> } locks.clear(); } database.unlockMetaDebug(this); savepoints = null; sessionStateChanged = true; }</code><technical_language>If locks is modified multiple threads concurrently, t null here, ArrayList.toArray() ArrayList.toArray(T[]) fully thread-safe. fail, return array leading trailing nulls duplicate elements</technical_language>

Target:
private void unlockAll() { if (undoLog != null && undoLog.size() > 0) { DbException.throwInternalError(); } if (!locks.isEmpty()) { Table[] array = locks.toArray(new Table[0]); for (Table t : array) { if (t != null) { t.unlock(this); } } locks.clear(); } database.unlockMetaDebug(this); savepoints = null; sessionStateChanged = true; }
Source:
<code>public Filter adapt(FilterAdapterContext context, ColumnPrefixFilter filter) throws IOException { byte[] prefix = filter.getPrefix(); ByteString.Output outputStream = ByteString.newOutput(prefix.length * 2); ReaderExpressionHelper.writeQuotedExpression(outputStream, prefix); outputStream.write(ReaderExpressionHelper.ALL_QUALIFIERS_BYTES); <START> return FILTERS.qualifier().regex(outputStream.toByteString()); <END> }</code><technical_language>Please this change in a PR</technical_language>

Target:
public Filter adapt(FilterAdapterContext context, ColumnPrefixFilter filter) throws IOException { byte[] prefix = filter.getPrefix(); ByteString.Output outputStream = ByteString.newOutput(prefix.length * 2); ReaderExpressionHelper.writeQuotedExpression(outputStream, prefix); outputStream.write(ReaderExpressionHelper.ALL_QUALIFIERS_BYTES); Filter qualifierFilter = FILTERS.qualifier().regex(outputStream.toByteString()); return FILTERS.chain().filter(qualifierFilter); }
Source:
<code>private Observable<List<MovedFile>> moveFiles(String folderName) { <START> File file = getPublicFolder(folderName); <END> List<MovedFile> movedFiles = new ArrayList<>(); if (file.exists()) { File[] files = file.listFiles(); movedFiles = copyFiles(files, folderName); if (files.length == movedFiles.size()) { file.delete(); } } return Observable.just(movedFiles); }</code><technical_language>a confusing for reader this folder is named file</technical_language>

Target:
private Observable<List<MovedFile>> moveFiles(String folderName) { File publicFolder = getPublicFolder(folderName); List<MovedFile> movedFiles = new ArrayList<>(); if (publicFolder.exists()) { File[] files = publicFolder.listFiles(); movedFiles = copyFiles(files, folderName); if (files.length == movedFiles.size()) { publicFolder.delete(); } } return Observable.just(movedFiles); }
Source:
<code>public void updateVirtioScsiController(VmBase vm, Boolean isVirtioScsiEnabled) { if (isVirtioScsiEnabled == null) { return; } if (isVirtioScsiEnabled) { <START> if (!hasVirtioScsiController(vm.getId())) { <END> addVirtioScsiController(vm); } } else { removeVirtioScsiControllers(vm.getId()); } }</code><technical_language>yes, I agree, this method is called, need remove controllers first</technical_language>

Target:
public void updateVirtioScsiController(VmBase vm, Boolean isVirtioScsiEnabled) { if (isVirtioScsiEnabled == null) { return; } removeVirtioScsiControllers(vm.getId()); if (isVirtioScsiEnabled) { addVirtioScsiController(vm); } }
Source:
<code>public static <T> T[] insert(T element, T[] array, Class<T> componentType) { boolean inserted = false; for (int i = 0; i < array.length; ++i) { if (array[i] == null) { array[i] = element; <START> inserted = true; <END> } } if (!inserted) { add(array, componentType, element); } return array; }</code><technical_language>this inserts element in null fields of array. Also, docs</technical_language>

Target:
public static <T> T[] insert(T element, T[] array, Class<T> componentType) { T[] arrayToReturn = array; boolean inserted = false; for (int i = 0; i < array.length; ++i) { if (array[i] == null) { array[i] = element; inserted = true; break; } } if (!inserted) { arrayToReturn = add(array, componentType, element); } return arrayToReturn; }
Source:
<code>public void go(AcceptsOneWidget container) { final ProjectWizardMode wizardMode = ProjectWizardMode.parse(context.get(WIZARD_MODE_KEY)); final String projectName = dataObject.getName(); if (CREATE == wizardMode && projectName != null) { if (getAttribute(ARTIFACT_ID).isEmpty()) { setAttribute(ARTIFACT_ID, projectName); } if (getAttribute(GROUP_ID).isEmpty()) { setAttribute(GROUP_ID, projectName); } updateDelegate.updateControls(); } projectService .getItem(Path.valueOf(dataObject.getPath()).parent().append("pom.xml")) .then( result -> { <START> updateView(container, false); <END> }) .catchError( arg -> { updateView(container, CREATE == wizardMode); }); }</code><technical_language>I need add some notification here, user information create action disabled</technical_language>

Target:
public void go(AcceptsOneWidget container) { final ProjectWizardMode wizardMode = ProjectWizardMode.parse(context.get(WIZARD_MODE_KEY)); final String projectName = dataObject.getName(); if (CREATE == wizardMode && projectName != null) { if (getAttribute(ARTIFACT_ID).isEmpty()) { setAttribute(ARTIFACT_ID, projectName); } if (getAttribute(GROUP_ID).isEmpty()) { setAttribute(GROUP_ID, projectName); } updateDelegate.updateControls(); } if (CREATE == wizardMode) { projectService .getItem(Path.valueOf(dataObject.getPath()).parent().append("pom.xml")) .then( result -> { notificationManager.notify( localization.mavenPageArchetypeDisabledTitle(), localization.mavenPageArchetypeDisabledMessage(), WARNING, EMERGE_MODE); updateView(container, false); }) .catchError( error -> { updateView(container, true); }); } else { updateView(container, false); } }
Source:
<code>private void handleTransferring(final StateContext context) { if (context.iterationTimestamp >= getParameters().getSessionExpiration() - getHostTicketRefreshAllowance()) { log.info("Renewing transfer ticket for {}", getTransferDescription()); boolean extendSucceeded = extendImageTransferSession(context.entity); if (!extendSucceeded) { log.warn("Failed to renew transfer ticket for {}", getTransferDescription()); <START> if (!getParameters().isRetryExtendTicket()) { <END> updateEntityPhase(ImageTransferPhase.PAUSED_SYSTEM); getParameters().setRetryExtendTicket(true); } else { getParameters().setRetryExtendTicket(false); } } } else { log.debug("Not yet renewing transfer ticket for {}", getTransferDescription()); } resetPeriodicPauseLogTime(0); }</code><technical_language>Suggestion: prevent negative condition switch content</technical_language>

Target:
private void handleTransferring(final StateContext context) { if (context.iterationTimestamp >= getParameters().getSessionExpiration() - getHostTicketRefreshAllowance()) { log.info("Renewing transfer ticket for {}", getTransferDescription()); boolean extendSucceeded = extendImageTransferSession(context.entity); if (!extendSucceeded) { log.warn("Failed to renew transfer ticket for {}", getTransferDescription()); if (getParameters().isRetryExtendTicket()) { getParameters().setRetryExtendTicket(false); } else { updateEntityPhase(ImageTransferPhase.PAUSED_SYSTEM); getParameters().setRetryExtendTicket(true); } } } else { log.debug("Not yet renewing transfer ticket for {}", getTransferDescription()); } resetPeriodicPauseLogTime(0); if (getParameters().getTransferType() == TransferType.Download) { pollDownloadStatus(context); } }
Source:
<code>public List<VDS> filter(SchedulingContext context, List<VDS> hosts, VM vm, PerHostMessages messages) { <START> if (vm.getVmType() <END> == VmType.HighPerformance) { VDS vmVds = vdsDao.get(vm.getRunOnVds()); if (vmVds == null || vmVds.getTscFrequency() == null) { return hosts; } return hosts.stream() .filter(vds -> vdsMatchesTscFrequency(messages, vmVds, vds)) .collect(Collectors.toList()); } return hosts; }</code><technical_language>Please add a check if VM is running (vm.getRunOnVds() != null) accessing DB</technical_language>

Target:
public List<VDS> filter(SchedulingContext context, List<VDS> hosts, VM vm, PerHostMessages messages) { if (vm.getRunOnVds() != null && vm.getVmType() == VmType.HighPerformance) { VDS vmVds = vdsDao.get(vm.getRunOnVds()); if (vmVds == null || vmVds.getTscFrequency() == null) { return hosts; } return hosts.stream() .filter(vds -> vdsMatchesTscFrequency(messages, vmVds, vds)) .collect(Collectors.toList()); } return hosts; }
Source:
<code>public ResultSet getResultSet() throws SQLException { ResultSet resultSet = super.getResultSet(); <START> return (resultSet == null) ? null : new LoggingPhoenixResultSet(super.getResultSet(), <END> phoenixMetricsLog, sql); }</code><technical_language>This is a bug. super.getResultSet() call is idempotent. replace this resultSet local variable</technical_language>

Target:
public ResultSet getResultSet() throws SQLException { ResultSet resultSet = super.getResultSet(); return (resultSet == null) ? null : new LoggingPhoenixResultSet(resultSet, phoenixMetricsLog, sql); }
Source:
<code>public BackendClusterNetworkResource(String id, BackendClusterNetworksResource parent) { super(id, parent, ActionType.DetachNetworkToCluster); clusterId = <START> ((BackendClusterNetworksResource)parent).clusterId; <END> }</code><technical_language>is this cast needed? I casting type</technical_language>

Target:
public BackendClusterNetworkResource(String id, BackendClusterNetworksResource parent) { super(id, parent, ActionType.DetachNetworkToCluster); clusterId = (parent).clusterId; }
Source:
<code>public DbMetricsImpl(int maxTotalConnections, int minIdleConnections, long maxWaitMillis, long keepAliveMillis) { <START> startTime = System.currentTimeMillis(); <END> this.maxTotalConnections = maxTotalConnections; this.minIdleConnections = minIdleConnections; this.maxWaitMillis = maxWaitMillis; this.keepAliveMillis = keepAliveMillis; }</code><technical_language>other parameters referred this., style for startTime</technical_language>

Target:
public DbMetricsImpl(int maxTotalConnections, int minIdleConnections, long maxWaitMillis, long keepAliveMillis) { this.startTime = System.currentTimeMillis(); this.maxTotalConnections = maxTotalConnections; this.minIdleConnections = minIdleConnections; this.maxWaitMillis = maxWaitMillis; this.keepAliveMillis = keepAliveMillis; }
Source:
<code>public VcfLineMapper(VariantSource source) { this.source = source; <START> factory = new VariantVcfFactory(); <END> }</code><technical_language>I good split, if class internally is same. Passing aggregation mode "NONE" is a implementation-specific detail, sense for a higher level layer</technical_language>

Target:
public VcfLineMapper(VariantSource source) { this.source = source; this.factory = new VariantVcfFactory(); }
Source:
<code>private ResultSet findSchemaID(BinlogPosition targetPosition) throws SQLException { PreparedStatement s = connection <START> .prepareStatement("SELECT * from `maxwell`.`schemas` where binlog_file <= ? and binlog_position <= ? " <END> + "ORDER BY id desc limit 1"); s.setString(1, targetPosition.getFile()); s.setInt(2, targetPosition.getOffset()); ResultSet rs = s.executeQuery(); if (rs.next()) { return rs; } else return null; }</code><technical_language>If file changes, offset remain increasing? If not, this wrong... (I hope not)</technical_language>

Target:
private ResultSet findSchemaID(BinlogPosition targetPosition) throws SQLException { PreparedStatement s = connection.prepareStatement( "SELECT * from `maxwell`.`schemas` " + "WHERE (binlog_file < ?) OR (binlog_file = ? and binlog_position <= ?) " + "ORDER BY id desc limit 1"); s.setString(1, targetPosition.getFile()); s.setString(2, targetPosition.getFile()); s.setInt(3, targetPosition.getOffset()); ResultSet rs = s.executeQuery(); if (rs.next()) { return rs; } else return null; }
Source:
<code>public void onCreate() { super.onCreate(); mApp = this; mPrefs = PreferenceManager.getDefaultSharedPreferences(this); initOba(); initObaRegion(); <START> NodeService.schedule(this); END> }</code><technical_language>@pohh I this right - understanding of general Wear lifecycle: - User start oba-android app start NodeService service. this, NodeService continue run indefinitely in background, oba-android app is running. - user interacts oba-wear app (running Wearable), oba-wear passes messages NodeService in oba-android fetch starred stops trigger API calls, passes resulting data oba-wear. Is generally correct? If so, I guess NodeService need setup run device boot well, [BootstrapService](<LINK_0></technical_language>

Target:
public void onCreate() { super.onCreate(); mApp = this; mPrefs = PreferenceManager.getDefaultSharedPreferences(this); initOba(); initObaRegion(); ObaAnalytics.initAnalytics(this); reportAnalytics(); }
Source:
<code>public Object postProcessAfterInitialization(Object bean, String beanName) { if (bean instanceof JobParserJobFactoryBean) { ((JobParserJobFactoryBean) bean).setJobExecutionListeners(this.jobExecutionListeners.toArray(new JobExecutionListener[this.jobExecutionListeners.size()])); } <START> if (bean instanceof StepParserStepFactoryBean<?, ?>) { <END> ((StepParserStepFactoryBean) bean).setListeners(this.stepListeners.toArray()); } if (bean instanceof FlowJob) { FlowJob job = (FlowJob) bean; job.setName(this.groupName); if (!jobRegistry.getJobNames().contains(groupName)) { jobLocator.addJob(groupName, (job.getJobParametersIncrementer() != null) ? true : false); jobLocator.addStepNames(groupName, job.getStepNames()); super.postProcessAfterInitialization(bean, beanName); } else { throw new BatchJobAlreadyExistsException(groupName); } } return bean; }</code><technical_language>do if/else/else.. I guess</technical_language>

Target:
public Object postProcessAfterInitialization(Object bean, String beanName) { if (bean instanceof JobParserJobFactoryBean) { addJobExecutionListener(); if (!this.jobExecutionListeners.isEmpty()) { ((JobParserJobFactoryBean) bean).setJobExecutionListeners(this.jobExecutionListeners.toArray(new JobExecutionListener[this.jobExecutionListeners.size()])); } } else if (bean instanceof StepParserStepFactoryBean<?, ?>) { addStepListeners(); if (!stepListeners.isEmpty()) { ((StepParserStepFactoryBean) bean).setListeners(this.stepListeners.toArray(new StepListener[this.stepListeners.size()])); } } else if (bean instanceof FlowJob) { FlowJob job = (FlowJob) bean; job.setName(this.groupName); if (!jobRegistry.getJobNames().contains(groupName)) { jobLocator.addJob(groupName, (job.getJobParametersIncrementer() != null) ? true : false); jobLocator.addStepNames(groupName, job.getStepNames()); super.postProcessAfterInitialization(bean, beanName); } else { throw new BatchJobAlreadyExistsException(groupName); } } return bean; }
Source:
<code>public List<String> getStatusLineMessages() { return UIThreadRunnable.syncExec(new ListResult<String>() { @Override <START> public List<String> run() { <END> Control statusLine = null; IStatusLineManager s = null; int messageCount = 0; final List<String> l = new ArrayList<String>(); IWorkbenchPartSite site = bot.activeEditor().getReference().getPart(false).getSite(); if (site instanceof IViewSite) { s = ((IViewSite) site).getActionBars().getStatusLineManager(); } else if (site instanceof IEditorSite) { s = ((IEditorSite) site).getActionBars().getStatusLineManager(); } if (s instanceof SubStatusLineManager) { s = (IStatusLineManager) ((SubStatusLineManager) s).getParent(); } if (s instanceof StatusLineManager) { statusLine = ((StatusLineManager) s).getControl(); } if (statusLine == null) return l; SWTBot statusbot = new SWTBot(statusLine); try { @SuppressWarnings("unchecked") List<? extends Widget> separators = bot.widgets( allOf(widgetOfType(Label.class), withStyle(SWT.SEPARATOR, "Separator")), statusLine); messageCount = separators.size() + 1; } catch (Exception e) { messageCount = 1; } for (int i = 0; i < messageCount; i++) { try { l.add(statusbot.clabel(i).getText()); } catch (Exception e) { log.warn("Failed to get Status line message at index " + Integer.toString(i), e); } } return l; } }); }</code><technical_language>status line shows status of active part. If call getStatusLineMessage() a workbench part, I ensure this part focus attempting extract info status line</technical_language>

Target:
public List<String> getStatusLineMessages() { return UIThreadRunnable.syncExec(new ListResult<String>() { @Override public List<String> run() { Control statusLine = null; IStatusLineManager s = null; int messageCount = 0; final List<String> l = new ArrayList<String>(); IWorkbenchPartSite site = partReference.getPart(false).getSite(); if (site instanceof IViewSite) { s = ((IViewSite) site).getActionBars().getStatusLineManager(); } else if (site instanceof IEditorSite) { s = ((IEditorSite) site).getActionBars().getStatusLineManager(); } while (s instanceof SubStatusLineManager) { s = (IStatusLineManager) ((SubStatusLineManager) s).getParent(); } if (s instanceof StatusLineManager) { statusLine = ((StatusLineManager) s).getControl(); } if (statusLine == null) return l; SWTBot statusbot = new SWTBot(statusLine); try { @SuppressWarnings("unchecked") List<? extends Widget> clabels = bot.widgets(allOf(widgetOfType(CLabel.class)), statusLine); messageCount = clabels.size(); } catch (Exception e) { log.warn("Failed to get CLable controls on Status line", e); } for (int i = 0; i < messageCount; i++) { try { l.add(statusbot.clabel(i).getText()); } catch (Exception e) { log.warn("Failed to get Status line message at index " + Integer.toString(i), e); } } return l; } }); }
Source:
<code>public PGPSecretKey findSecretKey() throws IOException, PGPException { if (exists(USER_KEYBOX_PATH)) { PGPPublicKey publicKey = findPublicKeyInKeyBox(USER_KEYBOX_PATH); if (publicKey == null) { throw new PGPException( <START> "no public-key with key or user id: " + signingKey); END> } PGPSecretKey secretKey = findSecretKeyForKeyBoxPublicKey(publicKey); if (secretKey != null) { return secretKey; } throw new PGPException( "unable to find associated secret key for public key: " + Long.toHexString(publicKey.getKeyID())); } else if (exists(USER_PGP_LEGACY_SECRING_FILE)) { PGPSecretKey secretKey = findSecretKeyInLegacySecring(signingKey, USER_PGP_LEGACY_SECRING_FILE); if (secretKey != null) { return secretKey; } throw new PGPException( "no matching secret key found in legacy secring.gpg for key or user id: " + signingKey); } throw new PGPException( "neither pubring.kbx nor secring.gpg files found"); }</code><technical_language>externalize error messages,</technical_language>

Target:
public PGPSecretKey findSecretKey() throws IOException, PGPException { if (exists(USER_KEYBOX_PATH)) { PGPPublicKey publicKey = findPublicKeyInKeyBox(USER_KEYBOX_PATH); if (publicKey == null) { throw new PGPException(MessageFormat.format( JGitText.get().gpgNoPublicKeyFound, signingKey)); } PGPSecretKey secretKey = findSecretKeyForKeyBoxPublicKey(publicKey); if (secretKey != null) { return secretKey; } throw new PGPException(MessageFormat.format( JGitText.get().gpgNoSecretKeyForPublicKey, Long.toHexString(publicKey.getKeyID()))); } else if (exists(USER_PGP_LEGACY_SECRING_FILE)) { PGPSecretKey secretKey = findSecretKeyInLegacySecring(signingKey, USER_PGP_LEGACY_SECRING_FILE); if (secretKey != null) { return secretKey; } throw new PGPException(MessageFormat.format( JGitText.get().gpgNoKeyInLegacySecring, signingKey)); } throw new PGPException(JGitText.get().gpgNoKeyring); }
Source:
<code>public void handleAction(ActionParameters params) throws ActionException { <START> final int layerId = ConversionHelper.getInt(params.getRequiredParam(PARAM_LAYER_ID), -1); <END> final OskariLayer layer = getLayer(layerId); final JSONObject response = getLayerFields(layer); ResponseHelper.writeResponse(params, response); }</code><technical_language>suggestion final int layerId = params.getRequiredParamInt(PARAM_LAYER_ID)</technical_language>

Target:
public void handleAction(ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(PARAM_LAYER_ID); final User user = params.getUser(); final OskariLayer layer = getLayer(layerId, user); final JSONObject response = getLayerFields(layer); ResponseHelper.writeResponse(params, response); }
Source:
<code>public void testInitializeWithConfiguration() throws IOException { final String tableName = getTestTableName("testInitializeWithConfiguration"); final Configuration conf = getTableCreationConfig(); conf.unset(S3GUARD_DDB_TABLE_NAME_KEY); String savedRegion = conf.get(S3GUARD_DDB_REGION_KEY, getFileSystem().getBucketLocation()); conf.unset(S3GUARD_DDB_REGION_KEY); try (DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore()) { ddbms.initialize(conf, new S3Guard.TtlTimeProvider(conf)); fail("Should have failed because the table name is not set!"); } catch (IllegalArgumentException ignored) { } conf.set(S3GUARD_DDB_TABLE_NAME_KEY, tableName); try (DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore()) { ddbms.initialize(conf, new S3Guard.TtlTimeProvider(conf)); fail("Should have failed because as the region is not set!"); } catch (IllegalArgumentException ignored) { } conf.set(S3GUARD_DDB_REGION_KEY, savedRegion); DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore(); try { ddbms.initialize(conf, new S3Guard.TtlTimeProvider(conf)); Table table = verifyTableInitialized(tableName, ddbms.getDynamoDB()); <START> verifyTableSse(conf, table.getDescription()); <END> assertNotNull(ddbms.getTable()); assertEquals(tableName, ddbms.getTable().getTableName()); assertEquals("Unexpected key schema found!", keySchema(), ddbms.getTable().describe().getKeySchema()); } finally { destroy(ddbms); } }</code><technical_language>Please create a new test for this feature instead of extending one</technical_language>

Target:
public void testInitializeWithConfiguration() throws IOException { final String tableName = getTestTableName("testInitializeWithConfiguration"); final Configuration conf = getTableCreationConfig(); conf.unset(S3GUARD_DDB_TABLE_NAME_KEY); String savedRegion = conf.get(S3GUARD_DDB_REGION_KEY, getFileSystem().getBucketLocation()); conf.unset(S3GUARD_DDB_REGION_KEY); try (DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore()) { ddbms.initialize(conf, new S3Guard.TtlTimeProvider(conf)); fail("Should have failed because the table name is not set!"); } catch (IllegalArgumentException ignored) { } conf.set(S3GUARD_DDB_TABLE_NAME_KEY, tableName); try (DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore()) { ddbms.initialize(conf, new S3Guard.TtlTimeProvider(conf)); fail("Should have failed because as the region is not set!"); } catch (IllegalArgumentException ignored) { } conf.set(S3GUARD_DDB_REGION_KEY, savedRegion); doTestInitializeWithConfiguration(conf, tableName); conf.setBoolean(S3GUARD_DDB_TABLE_SSE_ENABLED, true); doTestInitializeWithConfiguration(conf, tableName); }
Source:
<code>protected ClientConfiguration getClientConfiguration() { <START> boolean proxyDisabled = Boolean.parseBoolean(Framework.getProperty(DISABLE_PROXY_PROPERTY)); <END> String proxyHost = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_HOST); String proxyPort = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_PORT); String proxyLogin = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_LOGIN); String proxyPassword = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_PASSWORD); int maxConnections = getIntProperty(CONNECTION_MAX_PROPERTY); int maxErrorRetry = getIntProperty(CONNECTION_RETRY_PROPERTY); int connectionTimeout = getIntProperty(CONNECTION_TIMEOUT_PROPERTY); int socketTimeout = getIntProperty(SOCKET_TIMEOUT_PROPERTY); ClientConfiguration clientConfiguration = new ClientConfiguration(); if (!proxyDisabled) { if (isNotBlank(proxyHost)) { clientConfiguration.setProxyHost(proxyHost); } if (isNotBlank(proxyPort)) { clientConfiguration.setProxyPort(Integer.parseInt(proxyPort)); } if (isNotBlank(proxyLogin)) { clientConfiguration.setProxyUsername(proxyLogin); } if (proxyPassword != null) { clientConfiguration.setProxyPassword(proxyPassword); } } if (maxConnections > 0) { clientConfiguration.setMaxConnections(maxConnections); } if (maxErrorRetry >= 0) { clientConfiguration.setMaxErrorRetry(maxErrorRetry); } if (connectionTimeout >= 0) { clientConfiguration.setConnectionTimeout(connectionTimeout); } if (socketTimeout >= 0) { clientConfiguration.setSocketTimeout(socketTimeout); } return clientConfiguration; }</code><technical_language>In case remains a Framework property, _Framework#isBooleanPropertyTrue_ do work</technical_language>

Target:
protected ClientConfiguration getClientConfiguration() { boolean proxyDisabled = Framework.isBooleanPropertyTrue(DISABLE_PROXY_PROPERTY); String proxyHost = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_HOST); String proxyPort = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_PORT); String proxyLogin = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_LOGIN); String proxyPassword = Framework.getProperty(Environment.NUXEO_HTTP_PROXY_PASSWORD); int maxConnections = getIntProperty(CONNECTION_MAX_PROPERTY); int maxErrorRetry = getIntProperty(CONNECTION_RETRY_PROPERTY); int connectionTimeout = getIntProperty(CONNECTION_TIMEOUT_PROPERTY); int socketTimeout = getIntProperty(SOCKET_TIMEOUT_PROPERTY); ClientConfiguration clientConfiguration = new ClientConfiguration(); if (!proxyDisabled) { if (isNotBlank(proxyHost)) { clientConfiguration.setProxyHost(proxyHost); } if (isNotBlank(proxyPort)) { clientConfiguration.setProxyPort(Integer.parseInt(proxyPort)); } if (isNotBlank(proxyLogin)) { clientConfiguration.setProxyUsername(proxyLogin); } if (proxyPassword != null) { clientConfiguration.setProxyPassword(proxyPassword); } } if (maxConnections > 0) { clientConfiguration.setMaxConnections(maxConnections); } if (maxErrorRetry >= 0) { clientConfiguration.setMaxErrorRetry(maxErrorRetry); } if (connectionTimeout >= 0) { clientConfiguration.setConnectionTimeout(connectionTimeout); } if (socketTimeout >= 0) { clientConfiguration.setSocketTimeout(socketTimeout); } return clientConfiguration; }
Source:
<code>private void printDebugMessage( String message ) { System.out.println( String.format( "%s %s %s", GdbPlugin.getDebugTime(), TIMEOUT_TRACE_IDENTIFIER, message ) ); if(GdbDebugOptions.DEBUG_COMMAND_TIMEOUTS) { if(!message.endsWith("\n")) { message = message + "\n"; } <START> GdbDebugOptions.trace(message); <END> } }</code><technical_language>output before. means print sysout printing: String.format( "%s %s %s", GdbPlugin.getDebugTime(), TIMEOUT_TRACE_IDENTIFIER, message )</technical_language>

Target:
private void printDebugMessage( String message ) { if(GdbDebugOptions.DEBUG_COMMAND_TIMEOUTS) { if(!message.endsWith("\n")) { message = message + "\n"; } GdbDebugOptions.trace(String.format( "%s %s %s", GdbPlugin.getDebugTime(), TIMEOUT_TRACE_IDENTIFIER, message)); } }
Source:
<code><START> public Long getPopulation(DateTime when) { <END> Long pop = 0l; for(Planet planet : planets.values()) { if(null != planet.getPopulation(when)) { pop += planet.getPopulation(when); } } return pop; }</code><technical_language>suggestion public long getPopulation(DateTime when) {</technical_language>

Target:
public long getPopulation(DateTime when) { long pop = 0l; for(Planet planet : planets.values()) { if(null != planet.getPopulation(when)) { pop += planet.getPopulation(when); } } return pop; }
Source:
<code>public synchronized boolean addShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } <START> if (!_zkClient.exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm)) { <END> if (!createZkRealm(realm)) { LOG.error( "Failed to add sharding key because ZkRealm creation failed! Namespace: {}, Realm: {}, Sharding key: {}", _namespace, realm, shardingKey); return false; } } ZNRecord znRecord; try { znRecord = _zkClient.readData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm); } catch (Exception e) { LOG.error( "Failed to read the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } znRecord.setListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY, Collections.singletonList(shardingKey)); try { _zkClient .writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm, znRecord); } catch (Exception e) { LOG.error( "Failed to write the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } return true; } return true; }</code><technical_language>create a variable for path need repeatedly type out</technical_language>

Target:
public synchronized boolean addShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } String realmPath = MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm; if (!_zkClient.exists(realmPath)) { if (!createZkRealm(realm)) { LOG.error( "Failed to add sharding key because ZkRealm creation failed! Namespace: {}, Realm: {}, Sharding key: {}", _namespace, realm, shardingKey); return false; } } ZNRecord znRecord; try { znRecord = _zkClient.readData(realmPath); } catch (Exception e) { LOG.error( "Failed to read the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } znRecord.setListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY, Collections.singletonList(shardingKey)); try { _zkClient.writeData(realmPath, znRecord); } catch (Exception e) { LOG.error( "Failed to write the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } return true; } return true; }
Source:
<code><START> default TableStatisticsMetadata getInsertIntoTableStatisticsMetadata(ConnectorSession session, ConnectorTableHandle tableHandle) <END> { return EMPTY_STATISTICS_METADATA; }</code><technical_language>Lets name this getInsertStatisticsMetadata consistent getInsertLayout</technical_language>

Target:
default TableStatisticsMetadata getInsertIntoTableStatisticsMetadata(ConnectorSession session, ConnectorTableHandle tableHandle) { return TableStatisticsMetadata.empty(); }
Source:
<code>private TargetedSweepMetrics(long millis) { metricsManager = new MetricsManager(); metricsForStrategyMap = ImmutableMap.of( TableMetadataPersistence.SweepStrategy.CONSERVATIVE, new MetricsForStrategy(metricsManager, AtlasDbMetricNames.PREFIX_CONSERVATIVE, millis), TableMetadataPersistence.SweepStrategy.THOROUGH, new MetricsForStrategy(metricsManager, AtlasDbMetricNames.PREFIX_THOROUGH, millis)); <START> } <END></code><technical_language>work, is a reason avoided Tagged Metrics here? Snoopy happier</technical_language>

Target:
private TargetedSweepMetrics(long millis) { MetricsManager metricsManager = new MetricsManager(); metricsForStrategyMap = ImmutableMap.of( TableMetadataPersistence.SweepStrategy.CONSERVATIVE, new MetricsForStrategy(metricsManager, AtlasDbMetricNames.TAG_CONSERVATIVE, millis), TableMetadataPersistence.SweepStrategy.THOROUGH, new MetricsForStrategy(metricsManager, AtlasDbMetricNames.TAG_THOROUGH, millis)); }
Source:
<code>public void testPreferenceChangeCastedParameterPassed() { <START> Preference preference = activity.findPreference(activity.getString(R.string.checkBoxWithCastPrefKey)); <END> Boolean newValue = new Boolean(true); preference.getOnPreferenceChangeListener().onPreferenceChange(preference, newValue); assertThat(activity.preference).isSameAs(preference); assertThat(activity.newValue).isSameAs(newValue); }</code><technical_language>checking is needed here, preference. check in other test</technical_language>

Target:
public void testPreferenceChangeCastedParameterPassed() { Preference preference = activity.findPreference(activity.getString(R.string.checkBoxWithCastPrefKey)); preference.getOnPreferenceChangeListener().onPreferenceChange(preference, true); assertThat(activity.preference).isSameAs(preference); }
Source:
<code>protected void logActivityFailure(HttpServletRequest req, Throwable e) { String url = HttpRequestHelper.getRequestedURL(req); StringBuilder message = new StringBuilder(100); message.append("<span class=\"color_red\">Servlet Action failure in ").append(actionName).append("<br>") <START> .append(e.getMessage()).append("</span>"); <END> ActivityLogEntry activityLogEntry = new ActivityLogEntry(actionName, actionDescription, null, message.toString(), url); log.log(Level.INFO, activityLogEntry.generateLogMessage()); log.severe(e.getMessage()); }</code><technical_language>Similar for variable message here</technical_language>

Target:
protected void logActivityFailure(HttpServletRequest req, Throwable e) { String url = HttpRequestHelper.getRequestedURL(req); String message = "<span class=\"color_red\">Servlet Action failure in " + actionName + "<br>" + e.getMessage() + "</span>"; ActivityLogEntry activityLogEntry = new ActivityLogEntry(actionName, actionDescription, null, message, url); log.log(Level.INFO, activityLogEntry.generateLogMessage()); log.severe(e.getMessage()); }
Source:
<code><START> Offer createAndPlaceOffer(String currencyCode, <END> String directionAsString, String priceAsString, boolean useMarketBasedPrice, double marketPriceMargin, long amountAsLong, long minAmountAsLong, double buyerSecurityDeposit, String paymentAccountId, Consumer<Offer> resultHandler) { String upperCaseCurrencyCode = currencyCode.toUpperCase(); String offerId = createOfferService.getRandomOfferId(); Direction direction = Direction.valueOf(directionAsString.toUpperCase()); Price price = Price.valueOf(upperCaseCurrencyCode, priceStringToLong(priceAsString, upperCaseCurrencyCode)); Coin amount = Coin.valueOf(amountAsLong); Coin minAmount = Coin.valueOf(minAmountAsLong); PaymentAccount paymentAccount = user.getPaymentAccount(paymentAccountId); Coin useDefaultTxFee = Coin.ZERO; Offer offer = createOfferService.createAndGetOffer(offerId, direction, upperCaseCurrencyCode, amount, minAmount, price, useDefaultTxFee, useMarketBasedPrice, exactMultiply(marketPriceMargin, 0.01), buyerSecurityDeposit, paymentAccount); boolean useSavingsWallet = true; placeOffer(offer, buyerSecurityDeposit, useSavingsWallet, transaction -> resultHandler.accept(offer)); return offer; }</code><technical_language>I more clear return offer, is passed Consumer<Offer> resultHandler</technical_language>

Target:
void createAndPlaceOffer(String currencyCode, String directionAsString, String priceAsString, boolean useMarketBasedPrice, double marketPriceMargin, long amountAsLong, long minAmountAsLong, double buyerSecurityDeposit, String paymentAccountId, Consumer<Offer> resultHandler) { String upperCaseCurrencyCode = currencyCode.toUpperCase(); String offerId = createOfferService.getRandomOfferId(); Direction direction = Direction.valueOf(directionAsString.toUpperCase()); Price price = Price.valueOf(upperCaseCurrencyCode, priceStringToLong(priceAsString, upperCaseCurrencyCode)); Coin amount = Coin.valueOf(amountAsLong); Coin minAmount = Coin.valueOf(minAmountAsLong); PaymentAccount paymentAccount = user.getPaymentAccount(paymentAccountId); Coin useDefaultTxFee = Coin.ZERO; Offer offer = createOfferService.createAndGetOffer(offerId, direction, upperCaseCurrencyCode, amount, minAmount, price, useDefaultTxFee, useMarketBasedPrice, exactMultiply(marketPriceMargin, 0.01), buyerSecurityDeposit, paymentAccount); boolean useSavingsWallet = true; placeOffer(offer, buyerSecurityDeposit, useSavingsWallet, transaction -> resultHandler.accept(offer)); }
Source:
<code>private void buildAssignedActiveTaskAndPartitionsList(final String consumer, final ClientState clientState, final List<TaskId> activeTasksForConsumer, final Map<TaskId, Set<TopicPartition>> partitionsForTask, final Set<TopicPartition> allOwnedPartitions, final List<TopicPartition> activePartitionsList, final List<TaskId> assignedActiveList) { final List<AssignedPartition> assignedPartitions = new ArrayList<>(); for (final TaskId taskId : activeTasksForConsumer) { for (final TopicPartition partition : partitionsForTask.get(taskId)) { final String oldOwner = clientState.ownedPartitions().get(partition); final boolean newPartitionForConsumer = oldOwner == null || !oldOwner.equals(consumer); <START> if (newPartitionForConsumer && allOwnedPartitions.contains(partition)) { <END> log.debug("Removing task from assignment until it is safely revoked", taskId); clientState.removeFromAssignment(taskId); break; } else { assignedPartitions.add(new AssignedPartition(taskId, partition)); } } } Collections.sort(assignedPartitions); for (final AssignedPartition partition : assignedPartitions) { assignedActiveList.add(partition.taskId); activePartitionsList.add(partition.partition); } }</code><technical_language>Is a task maps multiple partitions, while some of owners, encode a partial task here</technical_language>

Target:
private void buildAssignedActiveTaskAndPartitionsList(final String consumer, final ClientState clientState, final List<TaskId> activeTasksForConsumer, final Map<TaskId, Set<TopicPartition>> partitionsForTask, final Set<TopicPartition> allOwnedPartitions, final List<TopicPartition> activePartitionsList, final List<TaskId> assignedActiveList) { final List<AssignedPartition> assignedPartitions = new ArrayList<>(); for (final TaskId taskId : activeTasksForConsumer) { final List<AssignedPartition> assignedPartitionsForTask = new ArrayList<>(); for (final TopicPartition partition : partitionsForTask.get(taskId)) { final String oldOwner = clientState.ownedPartitions().get(partition); final boolean newPartitionForConsumer = oldOwner == null || !oldOwner.equals(consumer); if (newPartitionForConsumer && allOwnedPartitions.contains(partition)) { log.debug("Removing task from assignment until it is safely revoked", taskId); clientState.removeFromAssignment(taskId); assignedPartitionsForTask.clear(); break; } else { assignedPartitionsForTask.add(new AssignedPartition(taskId, partition)); } } assignedPartitions.addAll(assignedPartitionsForTask); } Collections.sort(assignedPartitions); for (final AssignedPartition partition : assignedPartitions) { assignedActiveList.add(partition.taskId); activePartitionsList.add(partition.partition); } }
Source:
<code>public String getOnboardingSectionIdentifier() { <START> if (onboardingType == OnboardingSectionType.CUSTUM) { <END> return customOnboardingType; } return super.getOnboardingSectionIdentifier(); }</code><technical_language>CUSTOM is misspelled</technical_language>

Target:
public String getOnboardingSectionIdentifier() { if (onboardingType == OnboardingSectionType.CUSTOM) { return customOnboardingType; } return super.getOnboardingSectionIdentifier(); }
Source:
<code>public void initialize() { choseSortingTypeChoiceBox.setVisible(false); Map<SortingOrder, String> sortingOrderToString = new HashMap<>(); Arrays.stream(SortingOrder.values()) <START> .forEach(sortingOrder -> sortingOrderToString.put(sortingOrder, i18n.get(sortingOrder.getDisplayNameKey()))); <END> choseSortingTypeChoiceBox.setConverter(new StringConverter<SortingOrder>() { @Override public String toString(SortingOrder sortingOrder) { return sortingOrderToString.get(sortingOrder); } @Override public SortingOrder fromString(String string) { return sortingOrderToString.entrySet().stream().filter(sortingOrderStringEntry -> sortingOrderStringEntry.getValue().equals(string)).findFirst().get().getKey(); } }); ObservableList<Game> games = gameService.getGames(); filteredItems = new FilteredList<>(games); filteredItems.setPredicate(OPEN_CUSTOM_GAMES_PREDICATE); if (tilesButton.getId().equals(preferencesService.getPreferences().getGamesViewMode())) { viewToggleGroup.selectToggle(tilesButton); tilesButton.getOnAction().handle(null); } else { viewToggleGroup.selectToggle(tableButton); tableButton.getOnAction().handle(null); } viewToggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { if (newValue == null) { if (oldValue != null) { viewToggleGroup.selectToggle(oldValue); } else { viewToggleGroup.selectToggle(viewToggleGroup.getToggles().get(0)); } return; } preferencesService.getPreferences().setGamesViewMode(((ToggleButton) newValue).getId()); preferencesService.storeInBackground(); }); setSelectedGame(null); eventBus.register(this); }</code><technical_language>Map<SortingOrder, String> sortingOrderToString = Arrays.stream(SortingOrder.values()) .collect(Collectors.toMap(Function.identity(), sortingOrder -> i18n.get(sortingOrder.getDisplayNameKey())));</technical_language>

Target:
public void initialize() { chooseSortingTypeChoiceBox.setVisible(false); chooseSortingTypeChoiceBox.setConverter(new StringConverter<TilesSortingOrder>() { @Override public String toString(TilesSortingOrder tilesSortingOrder) { return i18n.get(tilesSortingOrder.getDisplayNameKey()); } @Override public TilesSortingOrder fromString(String string) { throw new UnsupportedOperationException("Not supported"); } }); ObservableList<Game> games = gameService.getGames(); filteredItems = new FilteredList<>(games); filteredItems.setPredicate(OPEN_CUSTOM_GAMES_PREDICATE); if (tilesButton.getId().equals(preferencesService.getPreferences().getGamesViewMode())) { viewToggleGroup.selectToggle(tilesButton); tilesButton.getOnAction().handle(null); } else { viewToggleGroup.selectToggle(tableButton); tableButton.getOnAction().handle(null); } viewToggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { if (newValue == null) { if (oldValue != null) { viewToggleGroup.selectToggle(oldValue); } else { viewToggleGroup.selectToggle(viewToggleGroup.getToggles().get(0)); } return; } preferencesService.getPreferences().setGamesViewMode(((ToggleButton) newValue).getId()); preferencesService.storeInBackground(); }); setSelectedGame(null); eventBus.register(this); }
Source:
<code>public void getRequestUrlTest() { String path = "this is a path ${variable} ${empty}"; expect(request.getPath()).andReturn(path); Map<String, Object> pathParams = new TreeMap<>(); pathParams.put("variable", "variable"); pathParams.put("empty", null); expect(request.getPathParams()).andReturn(pathParams); replay(request); assertThat(ramlRequestAdapter.getRequestUrl(path, false), equalTo("this is a path variable ")); <START> } <END></code><technical_language>Remember verify mocks. :-)</technical_language>

Target:
public void getRequestUrlTest() { String path = "this is a path ${variable} ${empty}"; expect(request.getPath()).andReturn(path); Map<String, Object> pathParams = new TreeMap<>(); pathParams.put("variable", "variable"); pathParams.put("empty", null); expect(request.getPathParams()).andReturn(pathParams); replay(request); assertThat(ramlRequestAdapter.getRequestUrl(path, false), equalTo("this is a path variable ")); verify(request); }
Source:
<code>public synchronized void close() throws IOException { if (m_closed) { return; } m_readCursors.clear(); for (PBDSegment segment : m_segments.values()) { segment.close(); } <START> m_segments.clear(); <END> m_closed = true; }</code><technical_language>Is this correct? right forget segments segment close, closes FDs. segment files disk? leaked</technical_language>

Target:
public synchronized void close() throws IOException { if (m_closed) { return; } m_readCursors.clear(); for (PBDSegment segment : m_segments.values()) { segment.close(); } m_closed = true; }
Source:
<code>public static boolean canDrop(FilterPredicate pred, List<ColumnChunkMetaData> columns) { checkNotNull(pred, "predicate cannot be null"); <START> checkNotNull(columns, "columns cannot be null"); <END> return pred.accept(new StatisticsFilter(columns)); }</code><technical_language>parameter is name of parameter. <LINK_0> if renaming pred, rename in in method signature well</technical_language>

Target:
public static boolean canDrop(FilterPredicate pred, List<ColumnChunkMetaData> columns) { checkNotNull(pred, "pred"); checkNotNull(columns, "columns"); return pred.accept(new StatisticsFilter(columns)); }
Source:
<code><START> private String getRolloverTarget(Index index, ClusterState currentState) { <END> IndexAbstraction indexAbstraction = currentState.metadata().getIndicesLookup().get(index.getName()); final String rolloverTarget; if (indexAbstraction.getParentDataStream() != null) { rolloverTarget = indexAbstraction.getParentDataStream().getDataStream().getName(); } else { IndexMetadata indexMetadata = currentState.metadata().index(index); String rolloverAlias = RolloverAction.LIFECYCLE_ROLLOVER_ALIAS_SETTING.get(indexMetadata.getSettings()); if (Strings.isNullOrEmpty(rolloverAlias)) { throw new IllegalStateException("setting [" + RolloverAction.LIFECYCLE_ROLLOVER_ALIAS + "] is not set on index [" + indexMetadata.getIndex().getName() + "]"); } rolloverTarget = rolloverAlias; } return rolloverTarget; }</code><technical_language>I *think* this a static method</technical_language>

Target:
private static String getRolloverTarget(Index index, ClusterState currentState) { IndexAbstraction indexAbstraction = currentState.metadata().getIndicesLookup().get(index.getName()); final String rolloverTarget; if (indexAbstraction.getParentDataStream() != null) { rolloverTarget = indexAbstraction.getParentDataStream().getName(); } else { IndexMetadata indexMetadata = currentState.metadata().index(index); String rolloverAlias = RolloverAction.LIFECYCLE_ROLLOVER_ALIAS_SETTING.get(indexMetadata.getSettings()); if (Strings.isNullOrEmpty(rolloverAlias)) { throw new IllegalStateException("setting [" + RolloverAction.LIFECYCLE_ROLLOVER_ALIAS + "] is not set on index [" + indexMetadata.getIndex().getName() + "]"); } rolloverTarget = rolloverAlias; } return rolloverTarget; }
Source:
<code><START> public static Long getValueAsLong(final byte[] key, <END> final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long " + nfe.getMessage()); nfe.printStackTrace(); return 0L; } catch (IllegalArgumentException iae ) { LOG.error("Caught IAE while converting to long " + iae.getMessage()); iae.printStackTrace(); return 0L; } } else { return 0L; } }</code><technical_language>Long -> long</technical_language>

Target:
public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return 0L; } catch (IllegalArgumentException iae ) { LOG.error("Caught IAE while converting to long ", iae); return 0L; } } else { return 0L; } }