auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public static URL getTrimmedUrl(@NonNull String repositoryUrl) { <END> String trimmedRepoUrl = repositoryUrl.trim(); if (StringUtils.isBlank(trimmedRepoUrl)) { throw new IllegalArgumentException("Repository URL must not be empty"); } URL url; try { url = new URL(trimmedRepoUrl); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } if (!url.getProtocol().equals("http") && !url.getProtocol().equals("https")) { throw new IllegalArgumentException("Invalid repository URL scheme (must be HTTPS or HTTP): " + url.getProtocol()); } return url; }</code><technical_language>I suggest this method private too</technical_language>

Target:
private static URL getTrimmedUrl(@NonNull String repositoryUrl) { String trimmedRepoUrl = repositoryUrl.trim(); if (StringUtils.isBlank(trimmedRepoUrl)) { throw new IllegalArgumentException("Repository URL must not be empty"); } URL url; try { url = new URL(trimmedRepoUrl); } catch (MalformedURLException e) { throw new IllegalArgumentException(e.getMessage(), e); } if (!url.getProtocol().equals("http") && !url.getProtocol().equals("https")) { throw new IllegalArgumentException("Invalid repository URL scheme (must be HTTPS or HTTP): " + url.getProtocol()); } return url; }
Source:
<code>public String buildAssertionMessage(@NonNull String assertion,@NonNull String assertionType) throws UnsupportedEncodingException { Logger.v(TAG, "Building request message for redeeming token with saml assertion."); String message = String.format("%s=%s&%s=%s&%s=%s&%s=%s&%s=%s", AuthenticationConstants.OAuth2.GRANT_TYPE, StringExtensions.urlFormEncode(assertionType), <START> AuthenticationConstants.OAuth2.ASSERTION, <END> StringExtensions.urlFormEncode(Base64.encodeToString(assertion.getBytes("UTF-8"), Base64.NO_WRAP)), AuthenticationConstants.OAuth2.CLIENT_ID, StringExtensions.urlFormEncode(mRequest.getClientId()), AuthenticationConstants.OAuth2.SCOPE, AuthenticationConstants.OAuth2Scopes.OPEN_ID_SCOPE, AuthenticationConstants.OAuth2.CLIENT_INFO, AuthenticationConstants.OAuth2.CLIENT_INFO_TRUE ); message = buildRequestMessage(message); return message; }</code><technical_language>constant is imported common, fix this moved constant ADAL</technical_language>

Target:
public String buildAssertionMessage(@NonNull String assertion, @NonNull String assertionType) throws UnsupportedEncodingException { Logger.v(TAG, "Building request message for redeeming token with saml assertion."); String message = String.format("%s=%s&%s=%s&%s=%s&%s=%s&%s=%s", AuthenticationConstants.OAuth2.GRANT_TYPE, StringExtensions.urlFormEncode(assertionType), com.microsoft.aad.adal.AuthenticationConstants.OAuth2.ASSERTION, StringExtensions.urlFormEncode(Base64.encodeToString(assertion.getBytes("UTF-8"), Base64.NO_WRAP)), AuthenticationConstants.OAuth2.CLIENT_ID, StringExtensions.urlFormEncode(mRequest.getClientId()), AuthenticationConstants.OAuth2.SCOPE, AuthenticationConstants.OAuth2Scopes.OPEN_ID_SCOPE, AuthenticationConstants.OAuth2.CLIENT_INFO, AuthenticationConstants.OAuth2.CLIENT_INFO_TRUE ); message = buildRequestMessage(message); return message; }
Source:
<code>public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { AuthConfigs authConfigs = userSpecificDockerRegistryCredentialsProvider.getCredentials(); <START> if (authConfigs.getConfigs().isEmpty()) { <END> return; } Gson gson = new Gson(); Base64.Encoder encoder = Base64.getEncoder(); String config; try (StringWriter strWriter = new StringWriter(); JsonWriter jsonWriter = gson.newJsonWriter(strWriter)) { jsonWriter.beginObject(); authConfigs .getConfigs() .forEach( (name, authConfig) -> { try { if (!name.startsWith("https://")) { name = "https://" + name; } jsonWriter.name(name); jsonWriter.beginObject(); jsonWriter.name("username"); jsonWriter.value(authConfig.getUsername()); jsonWriter.name("password"); jsonWriter.value(authConfig.getPassword()); jsonWriter.name("email"); jsonWriter.value("email@email"); String auth = new StringBuilder(authConfig.getUsername()) .append(':') .append(authConfig.getPassword()) .toString(); jsonWriter.name("auth"); jsonWriter.value(encoder.encodeToString(auth.getBytes())); jsonWriter.endObject(); } catch (IOException e) { throw new RuntimeException(e); } }); jsonWriter.endObject(); jsonWriter.flush(); config = strWriter.toString(); String encodedConfig = encoder.encodeToString(config.getBytes()); Secret secret = new SecretBuilder() .addToData(".dockercfg", encodedConfig) .withType("kubernetes.io/dockercfg") .withNewMetadata() .withName(SECRET_NAME) .endMetadata() .build(); clientFactory .create(identity.getWorkspaceId()) .secrets() .inNamespace(namespaceFactory.create(identity.getWorkspaceId()).getName()) .createOrReplace(secret); } catch (Exception e) { throw new InfrastructureException(e); } k8sEnv.getPods().values().forEach(this::provision); }</code><technical_language>get NPE here. Please, add a check</technical_language>

Target:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { AuthConfigs credentials = credentialsProvider.getCredentials(); if (credentials == null) { return; } Map<String, AuthConfig> authConfigs = credentials.getConfigs(); if (authConfigs == null || authConfigs.isEmpty()) { return; } try { String encodedConfig = Base64.getEncoder().encodeToString(generateDockerCfg(authConfigs).getBytes()); Secret secret = new SecretBuilder() .addToData(".dockercfg", encodedConfig) .withType("kubernetes.io/dockercfg") .withNewMetadata() .withName(SECRET_NAME) .endMetadata() .build(); clientFactory .create(identity.getWorkspaceId()) .secrets() .inNamespace(namespaceFactory.create(identity.getWorkspaceId()).getName()) .createOrReplace(secret); } catch (KubernetesClientException e) { throw new InfrastructureException( "Unexpected exception occured while adding the 'ImagePullSecret' built from private docker registry user preferences", e); } k8sEnv.getPods().values().forEach(this::provision); }
Source:
<code>public DOI(String doi) { Objects.requireNonNull(doi); String trimmedDoi = doi.trim(); if (doi.matches(HTTP_EXP) || doi.matches(SHORT_DOI_HTTP_EXP)) { try { URI url = new URI(trimmedDoi); trimmedDoi = url.getScheme() + "://" + url.getHost() + url.getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(doi + " is not a valid HTTP DOI/Short DOI."); } } Matcher matcher = EXACT_DOI_PATT.matcher(trimmedDoi); if (matcher.find()) { this.doi = matcher.group(1).replaceAll("[^\\w,/,:,-,.,-]|[_]", ""); } else { Matcher shortDoiMatcher = EXACT_SHORT_DOI_PATT.matcher(trimmedDoi); if (shortDoiMatcher.find()) { <START> this.doi = shortDoiMatcher.group(1).replaceAll("[^\\w,/,:,-,.,-]|[_]", ""); <END> isShortDoi = true; } else { throw new IllegalArgumentException(trimmedDoi + " is not a valid DOI/Short DOI."); } } }</code><technical_language>This is pattern --> please a constant</technical_language>

Target:
public DOI(String doi) { Objects.requireNonNull(doi); String trimmedDoi = doi.trim(); if (doi.matches(HTTP_EXP) || doi.matches(SHORT_DOI_HTTP_EXP)) { try { URI url = new URI(trimmedDoi); trimmedDoi = url.getScheme() + "://" + url.getHost() + url.getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(doi + " is not a valid HTTP DOI/Short DOI."); } } Matcher matcher = EXACT_DOI_PATT.matcher(trimmedDoi); if (matcher.find()) { this.doi = matcher.group(1); } else { Matcher shortDoiMatcher = EXACT_SHORT_DOI_PATT.matcher(trimmedDoi); if (shortDoiMatcher.find()) { this.doi = shortDoiMatcher.group(1); isShortDoi = true; } else { Matcher shortcutDoiMatcher = EXACT_SHORT_DOI_SHORTCUT.matcher(trimmedDoi); if (shortcutDoiMatcher.find()) { this.doi = "10/" + shortcutDoiMatcher.group(1); isShortDoi = true; } else { throw new IllegalArgumentException(trimmedDoi + " is not a valid DOI/Short DOI."); } } } }
Source:
<code>public void finalizeRun() { if (getEngine().getPlatform() != Platform.CLIENT && !this.isOnlineLive()) { remove(); } super.finalizeRun(); if (isRemoved()) { if (getEngine().getPlatform() == Platform.SERVER) { ((ServerNetworkSynchronizer) getNetworkSynchronizer()).onRemoved(); ((SpoutServer) getEngine()).removePlayer(this); } <START> getNetwork().setSessionLive(null); <END> } else if (this.isOnline()) { this.getNetworkSynchronizer().finalizeTick(); } }</code><technical_language>Remove setSessionLive</technical_language>

Target:
public void finalizeRun() { if (getEngine().getPlatform() != Platform.CLIENT && !this.isOnlineLive()) { remove(); } super.finalizeRun(); if (isRemoved()) { if (getEngine().getPlatform() == Platform.SERVER) { ((ServerNetworkSynchronizer) getNetworkSynchronizer()).onRemoved(); ((SpoutServer) getEngine()).removePlayer(this); } } else if (this.isOnline()) { this.getNetworkSynchronizer().finalizeTick(); } }
Source:
<code>private List<ShareButtonAdapter.ShareButtonItem> getShareButtons(Activity activity, Intent intent) { List<ShareButtonAdapter.ShareButtonItem> shareButtons = new ArrayList<>(); final List<ResolveInfo> matches = activity.getPackageManager().queryIntentActivities(intent, 0); for (ResolveInfo match : matches) { <START> IconResizer iconResizer = new IconResizer(getContext()); <END> final Drawable icon = iconResizer.createIconThumbnail(match.loadIcon(activity.getPackageManager())); final CharSequence label = match.loadLabel(activity.getPackageManager()); shareButtons.add(new ShareButtonAdapter.ShareButtonItem(icon, label, match.activityInfo.packageName, match.activityInfo.name)); } return shareButtons; }</code><technical_language>creating a new IconResizer instance for match in loop, move IconResizer iconResizer = new IconResizer(getContext()); statement for loop branch</technical_language>

Target:
private List<ShareButtonAdapter.ShareButtonItem> getShareButtons(Activity activity, Intent intent) { List<ShareButtonAdapter.ShareButtonItem> shareButtons = new ArrayList<>(); final List<ResolveInfo> matches = activity.getPackageManager().queryIntentActivities(intent, 0); IconResizer iconResizer = new IconResizer(getContext()); for (ResolveInfo match : matches) { final Drawable icon = iconResizer.createIconThumbnail(match.loadIcon(activity.getPackageManager())); final CharSequence label = match.loadLabel(activity.getPackageManager()); shareButtons.add(new ShareButtonAdapter.ShareButtonItem(icon, label, match.activityInfo.packageName, match.activityInfo.name)); } return shareButtons; }
Source:
<code>private void removeAt(int index) { if (head < tail) { if (tail - index < index - head) { for (int i = index + 1; i < tail; ++i) { array[i - 1] = array[i]; } tail -= 1; <START> array[tail] = null; <END> } else { for (int i = index - 1; i >= head; --i) { array[i + 1] = array[i]; } array[head] = null; head++; } } else { if (index >= head) { for (int i = index - 1; i >= head; --i) { array[i + 1] = array[i]; } array[head] = null; head++; } else { for (int i = index + 1; i < tail; ++i) { array[i - 1] = array[i]; } tail -= 1; array[tail] = null; } } }</code><technical_language>array[--tail] = null</technical_language>

Target:
private void removeAt(int index) { if (head < tail) { if (tail - index < index - head) { for (int i = index + 1; i < tail; ++i) { array[i - 1] = array[i]; } array[--tail] = null; } else { for (int i = index - 1; i >= head; --i) { array[i + 1] = array[i]; } array[head++] = null; } } else { if (index >= head) { for (int i = index - 1; i >= head; --i) { array[i + 1] = array[i]; } array[head++] = null; } else { for (int i = index + 1; i < tail; ++i) { array[i - 1] = array[i]; } array[--tail] = null; } } }
Source:
<code>public String toString() { return MessageFormat.format( <START> "activity from {0} to {1} (timezone {2}) of activity category with id {3} and app ''{4}'' and device anonymized with id {5} (activity id {6})", <END> startTime, endTime, timeZone, activityCategory.getId(), app, deviceAnonymized.getId(), getId()); }</code><technical_language>MessageFormat accept null for insertion</technical_language>

Target:
public String toString() { UUID deviceAnonymizedId = deviceAnonymized != null ? deviceAnonymized.getId() : null; return MessageFormat.format( "activity from {0} to {1} (timezone {2}) of activity category with id {3} and app ''{4}'' and device anonymized with id {5} (activity id {6})", startTime, endTime, timeZone, activityCategory.getId(), app, deviceAnonymizedId, getId()); }
Source:
<code>private void collectExpandedBreakpoints(TreeItem item, List<IBreakpoint> list) { Object data = item.getData(); if (data instanceof IBreakpoint) { list.add((IBreakpoint) data); return; } if (item.getExpanded()) { for (TreeItem <START> item2 : <END> item.getItems()) { collectExpandedBreakpoints(item2, list); } } }</code><technical_language>rename child childItem</technical_language>

Target:
private void collectExpandedBreakpoints(TreeItem item, List<IBreakpoint> list) { Object data = item.getData(); if (data instanceof IBreakpoint) { list.add((IBreakpoint) data); return; } if (item.getExpanded()) { for (TreeItem childItem : item.getItems()) { collectExpandedBreakpoints(childItem, list); } } }
Source:
<code>protected void executeCommand() { lunsToUpdateInDb = getLunsToUpdateInDb(); <START> if (acquireLockInternal()) { <END> lunDao.updateAllInBatch(getLunsToUpdateInDb()); freeLock(); setSucceeded(true); } }</code><technical_language>do need manually acquire a lock here</technical_language>

Target:
protected void executeCommand() { lunsToUpdateInDb = getLunsToUpdateInDb(); if (acquireLockInternal()) { TransactionSupport.executeInNewTransaction(() -> { Collection<LUNs> oldLuns = lunIdToDiskIdOfDirectLunsAttachedToVmsInPool.keySet() .stream() .map(lunDao::get) .collect(Collectors.toList()); CompensationContext context = getCompensationContext(); context.snapshotEntities(oldLuns); lunDao.updateAllInBatch(lunsToUpdateInDb); context.stateChanged(); log.info("LUNs with IDs: [" + lunsToUpdateInDb.stream().map(LUNs::getLUNId).collect(Collectors.joining(", ")) + "] were updated in the DB."); setSucceeded(true); return null; }); freeLock(); } else { addCustomValue("DisksIds", lunsToUpdateInDb.stream() .map(LUNs::getDiskId).map(Guid::toString).collect(Collectors.joining(", "))); auditLogDirector.log(this, AuditLogType.DIRECT_LUNS_COULD_NOT_BE_SYNCED); } }
Source:
<code>private boolean isSignificant(String candidateClassName) { return !excludedClasses.contains(candidateClassName) && !candidateClassName.startsWith("java.lang.") && (excludeClassesRegexp == null || excludeClassesRegexp.isEmpty() <START> || !candidateClassName.matches(excludeClassesRegexp)); <END> }</code><technical_language>This compile regexp time execution process enters method. In order avoid this need compile regexp in setter. A good example is <LINK_0></technical_language>

Target:
private boolean isSignificant(String candidateClassName) { boolean result = !excludedClasses.contains(candidateClassName) && !candidateClassName.startsWith("java.lang."); if (result) { for (Pattern pattern : excludeClassesRegexps) { if (pattern.matcher(candidateClassName).matches()) { result = false; break; } } } return result; }
Source:
<code>private static void setToken(Application a){ if (a.getPreferenceManager().getToken() != null) CountlyPush.onTokenRefresh(a.getPreferenceManager().getToken()); <START> System.out.println("CountlyPush " + a.getPreferenceManager().getToken()); <END> }</code><technical_language>Log.d for that</technical_language>

Target:
private static void setToken(Application a){ if (a.getPreferenceManager().getToken() != null) CountlyPush.onTokenRefresh(a.getPreferenceManager().getToken()); }
Source:
<code>private void checkTagPresentInDeleteMarker(String tableName, String startRowKey, boolean tagPresent, String tagValue) throws IOException { List<Cell> values = new ArrayList<>(); TableName table = TableName.valueOf(tableName); for (HRegion region : getUtility().getHBaseCluster().getRegions(table)) { values.clear(); Scan scan = new Scan(); scan.setRaw(true); scan.withStartRow(Bytes.toBytes(startRowKey)); RegionScanner scanner = region.getScanner(scan); scanner.next(values); if (!values.isEmpty()) { break; } } assertTrue("Values shouldn't be empty", !values.isEmpty()); Cell first = values.get(0); assertTrue("First cell should be delete marker ", PrivateCellUtil.isDelete(first.getType().getCode())); List<Tag> tags = PrivateCellUtil.getTags(first); if (tagPresent) { assertEquals(1, tags.size()); Optional<Tag> optional = <START> PrivateCellUtil.getTag(first, PhoenixTagType.SOURCE_OPERATION_TAG_TYPE); <END> assertTrue(optional.isPresent()); Tag sourceOfOperationTag = optional.get(); assertEquals(tagValue, Tag.getValueAsString(sourceOfOperationTag)); } else { assertEquals(0, tags.size()); } }</code><technical_language>PrivateCellUtil is IA.Private -- need of IA.LimitedPrivate classes RawCell</technical_language>

Target:
private void checkTagPresentInDeleteMarker(String tableName, String startRowKey, boolean tagPresent, String tagValue) throws IOException { List<Cell> values = new ArrayList<>(); TableName table = TableName.valueOf(tableName); for (HRegion region : getUtility().getHBaseCluster().getRegions(table)) { Scan scan = new Scan(); scan.setRaw(true); scan.withStartRow(Bytes.toBytes(startRowKey)); RegionScanner scanner = region.getScanner(scan); scanner.next(values); if (!values.isEmpty()) { break; } } assertFalse("Values shouldn't be empty", values.isEmpty()); Cell first = values.get(0); assertTrue("First cell should be delete marker ", CellUtil.isDelete(first)); List<Tag> tags = PrivateCellUtil.getTags(first); if (tagPresent) { assertEquals(1, tags.size()); RawCell rawCell = (RawCell)first; Optional<Tag> optional = rawCell.getTag(PhoenixTagType.SOURCE_OPERATION_TAG_TYPE); assertTrue(optional.isPresent()); Tag sourceOfOperationTag = optional.get(); assertEquals(tagValue, Tag.getValueAsString(sourceOfOperationTag)); } else { assertEquals(0, tags.size()); } }
Source:
<code>protected void handleEvent(VariableEvent event) { AbstractVariableScope sourceScope = event.getSourceScope(); if (sourceScope instanceof ExecutionEntity) { addEventToScopeExecution((ExecutionEntity) sourceScope, event); <START> } else { <END> if(sourceScope.getParentVariableScope() instanceof ExecutionEntity) { ExecutionEntity execution = (ExecutionEntity)sourceScope.getParentVariableScope(); if (execution != null) { addEventToScopeExecution(execution, event); } } else { throw new ProcessEngineException("BPMN execution scope expected"); } } }</code><technical_language>This check is necessary, support SubTasks, failing test case: SubTaskDataTest.testSubTaskData:71 ProcessEngine BPMN execution scope expect..</technical_language>

Target:
protected void handleEvent(VariableEvent event) { AbstractVariableScope sourceScope = event.getSourceScope(); if (sourceScope instanceof ExecutionEntity) { addEventToScopeExecution((ExecutionEntity) sourceScope, event); } else if (sourceScope instanceof TaskEntity) { TaskEntity task = (TaskEntity) sourceScope; ExecutionEntity execution = task.getExecution(); if (execution != null) { addEventToScopeExecution(execution, event); } } else if(sourceScope.getParentVariableScope() instanceof ExecutionEntity) { addEventToScopeExecution((ExecutionEntity)sourceScope.getParentVariableScope(), event); } else { throw new ProcessEngineException("BPMN execution scope expected"); } }
Source:
<code>public Object visitSizeCommand(InvocationContext ctx, SizeCommand command) throws Throwable { Object size = super.visitSizeCommand(ctx, command); <START> if (enabled && passivationEnabled && size instanceof Integer) { <END> int loaderSize = loader.loadAllKeys(Collections.emptySet()).size(); return loaderSize + ((Integer) size).intValue(); } else { return size; } }</code><technical_language>SizeCommand returns Integer, I check is a bit redundant. IOW, if size is Integer, is wrong simply returning waiting for CCE happen else</technical_language>

Target:
public Object visitSizeCommand(InvocationContext ctx, SizeCommand command) throws Throwable { int totalSize = 0; if (enabled && !shouldSkipCacheLoader(command)) { totalSize = loader.loadAllKeys(Collections.emptySet()).size(); } if (cacheConfiguration.loaders().passivation() || totalSize == 0) { totalSize += (Integer)super.visitSizeCommand(ctx, command); } return totalSize; }
Source:
<code><START> public void prepareRun(StageSubmitterContext context) throws Exception { <END> super.prepareRun(context); FailureCollector collector = context.getFailureCollector(); collector.getOrThrowException(); context.record( TransformLineageRecorderUtils.oneInToAllOut(config.inputField, TransformLineageRecorderUtils.getFields(outSchema), "XMLParse", "Parsed XML data into a full row.")); }</code><technical_language>This is similar XMLMultiParser</technical_language>

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); FailureCollector collector = context.getFailureCollector(); collector.getOrThrowException(); context.record( TransformLineageRecorderUtils.generateOneToMany(config.inputField, TransformLineageRecorderUtils.getFields(context.getOutputSchema()), "XMLParse", "Parsed XML data into a full row.")); }
Source:
<code>public int compareTo(final TimeValue other) { if (other != null) { final TimeUnit targetTimeUnit = min(other.getTimeUnit()); return Long.compare(convert(targetTimeUnit), other.convert(targetTimeUnit)); } else { <START> return -Integer.MAX_VALUE; <END> } }</code><technical_language>This violates: natural ordering for a class C is consistent equals if if e1.compareTo(e2) == 0 boolean e1.equals(e2) for e1 e2 of class C. Note null is instance of class, e.compareTo(null) throw a NullPointerException e.equals(null) returns false</technical_language>

Target:
public int compareTo(final TimeValue other) { final TimeUnit targetTimeUnit = min(other.getTimeUnit()); return Long.compare(convert(targetTimeUnit), other.convert(targetTimeUnit)); }
Source:
<code><START> void add(Closeable hook) { <END> if (closeHooks == null) { closeHooks = new ConcurrentHashSet<>(); } closeHooks.add(hook); }</code><technical_language>synchronization issue here. instantiate set times</technical_language>

Target:
synchronized void add(Closeable hook) { if (closeHooks == null) { closeHooks = new HashSet<>(); } closeHooks.add(hook); }
Source:
<code>public void startGitRepoRemoteHttpAuthTest() throws Exception { <START> container.startGitBackedConfiguration("http://agitter@localhost:" + httpServer.getUri().getPort() + "/sbasic/.git", <END> Constants.MASTER, AUTH_FILE); Assert.assertTrue("Directory not found " + getDotGitDir(), Files.exists(getDotGitDir())); Assert.assertTrue("File not found " + getDotGitIgnore(), Files.exists(getDotGitIgnore())); List<String> commits = listCommits(remoteRepository); Assert.assertEquals(1, commits.size()); addSystemProperty(); publish(null); commits = listCommits(remoteRepository); Assert.assertEquals(3, commits.size()); try (Git git = new Git(remoteRepository)) { git.checkout().setName("my_branch").setCreateBranch(true).call(); } removeSystemProperty(); publish(null); container.stop(); closeRepository(); container.startGitBackedConfiguration("http://agitter@localhost:" + httpServer.getUri().getPort() + "/sbasic/.git", "my_branch", AUTH_FILE); Assert.assertTrue("Directory not found " + getDotGitDir(), Files.exists(getDotGitDir())); Assert.assertTrue("File not found " + getDotGitIgnore(), Files.exists(getDotGitIgnore())); try { addSystemProperty(); Assert.fail("Operation should have failed"); } catch (UnsuccessfulOperationException uoe) { Assert.assertTrue(uoe.getMessage().contains("WFLYCTL0212")); } }</code><technical_language>good include a test for https case</technical_language>

Target:
public void startGitRepoRemoteHttpAuthTest() throws Exception { container.startGitBackedConfiguration("<LINK_0>" + httpServer.getUri().getPort() + "/sbasic/.git", Constants.MASTER, AUTH_FILE); Assert.assertTrue("Directory not found " + getDotGitDir(), Files.exists(getDotGitDir())); Assert.assertTrue("File not found " + getDotGitIgnore(), Files.exists(getDotGitIgnore())); List<String> commits = listCommits(remoteRepository); Assert.assertEquals(1, commits.size()); addSystemProperty(); publish(null); commits = listCommits(remoteRepository); Assert.assertEquals(3, commits.size()); try (Git git = new Git(remoteRepository)) { git.checkout().setName("my_branch").setCreateBranch(true).call(); } removeSystemProperty(); publish(null); container.stop(); closeRepository(); container.startGitBackedConfiguration("<LINK_0>" + httpServer.getUri().getPort() + "/sbasic/.git", "my_branch", AUTH_FILE); Assert.assertTrue("Directory not found " + getDotGitDir(), Files.exists(getDotGitDir())); Assert.assertTrue("File not found " + getDotGitIgnore(), Files.exists(getDotGitIgnore())); try { addSystemProperty(); Assert.fail("Operation should have failed"); } catch (UnsuccessfulOperationException uoe) { Assert.assertTrue(uoe.getMessage().contains("WFLYCTL0212")); } }
Source:
<code>@Override public RelRoot rel(SqlNode sql) throws RelConversionException { if (m_state == State.STATE_1_READY) { try { validate(sql); } catch (ValidationException e) { throw new RelConversionException(e); } } ensure(State.STATE_2_VALIDATED); <START> assert(m_validatedSqlNode != null); <END> m_relRoot = m_sqlToRelConverter.convertQuery( m_validatedSqlNode, false , true ); m_relRoot = m_relRoot.withRel(RelDecorrelator.decorrelateQuery(m_relRoot.rel, m_relBuilder)); m_state = State.STATE_3_CONVERTED; return m_relRoot; }</code><technical_language>suggestion Precondition.checkNotNull("Validated SQL node null", m_validatedSqlNode);</technical_language>

Target:
@Override public RelRoot rel(SqlNode sql) throws RelConversionException { if (m_state == State.STATE_1_READY) { try { validate(sql); } catch (ValidationException e) { throw new RelConversionException(e); } } ensure(State.STATE_2_VALIDATED); Preconditions.checkNotNull(m_validatedSqlNode, "Validated SQL node cannot be null."); m_relRoot = m_sqlToRelConverter.convertQuery( m_validatedSqlNode, false , true ); m_relRoot = m_relRoot.withRel(RelDecorrelator.decorrelateQuery(m_relRoot.rel, m_relBuilder)); m_state = State.STATE_3_CONVERTED; return m_relRoot; }
Source:
<code>public static boolean isStreamStoreValueTable(TableReference tableReference) { <START> return tableReference.getQualifiedName().contains(StreamTableType.VALUE.tableSuffix); <END> }</code><technical_language>endsWith</technical_language>

Target:
public static boolean isStreamStoreValueTable(TableReference tableReference) { return tableReference.getQualifiedName().endsWith(StreamTableType.VALUE.tableSuffix); }
Source:
<code>private void handleTimeZone() { if (!isVmTimeZoneValid(getVm())) { <START> log.warnFormat("ResourceManager::{0}::Attempting to run VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", <END> getClass().getName(), getVmId().toString(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); if (!getVm().isRunOnce()) { getVmStaticDAO().update(getVm().getStaticData()); } } }</code><technical_language>"ResourceManage" is relevant, class name logged log4j vm name is vm id (or both) please this log message: log.warnFormat("Attempting run VM {0} - {1} incorrect timezone '{2}'. Resetting timezone engine default.", getVmId(), getVm().getName(), getVm().getTimeZone());</technical_language>

Target:
private void handleTimeZone() { if (!VmHandler.isTimeZoneLegal(getVm().getStaticData())) { log.warnFormat("Attempting to run VM {0} - {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", getVmId(), getVm().getName(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); if (!getVm().isRunOnce()) { getVmStaticDAO().update(getVm().getStaticData()); } } }
Source:
<code>private void testFindAvailableFunctions(String clazz, String[] expectedFunctions) { List<FunctionDef> functionDefs = service.findAvailableFunctions(path, clazz); assertEquals(functionDefs.size(), expectedFunctions.length); for (String expectedFunction : expectedFunctions) { <START> assertTrue(functionDefs.stream() <END> .filter(functionDef -> expectedFunction.equals(functionDef.getName())) .findFirst() .isPresent()); } }</code><technical_language>This just: java assertTrue(functionDefs.stream() .anyMatch(functionDef -> expectedFunction.equals(functionDef.getName())));</technical_language>

Target:
private void testFindAvailableFunctions(String clazz, String[] expectedFunctions) { List<FunctionDef> functionDefs = service.findAvailableFunctions(path, clazz); assertEquals(functionDefs.size(), expectedFunctions.length); for (String expectedFunction : expectedFunctions) { assertTrue(functionDefs.stream() .anyMatch(functionDef -> expectedFunction.equals(functionDef.getName()))); } }
Source:
<code>public void teardownTest() throws InterruptedException { sharedStorageApi().delete(currentSharedStorage.id()); <START> assertNodeAvailable(currentServer); <END> deleteServer(currentServer.id()); }</code><technical_language>sense try delete server if shared storage delete operation failed? try avoid leaking resources</technical_language>

Target:
public void teardownTest() { sharedStorageApi().delete(currentSharedStorage.id()); assertNodeAvailable(currentServer); deleteServer(currentServer.id()); }
Source:
<code><START> public ManagerMethod getMethod(String methodName) { <END> return TasksManagerMethod.valueOf(methodName); }</code><technical_language>tasksManager propagationStatsReader. API resolving request URL. remove propagationStatsReader generalServiceManager in future releases</technical_language>

Target:
public ManagerMethod getMethod(String methodName) { return VosManagerMethod.valueOf(methodName); }
Source:
<code>public Completable sendMessage(int threadId, String body) { body = "<p>" + body + "</p>"; <START> body = body.replaceAll("\n", "<br>"); <END> String finalBody = body; return Completable.create(emitter -> { MessageThread thread = getRaw(threadId); if (thread == null) { throw new Error("The thread needs to already be in the cache."); } int id = getNextPendingMessageId(thread); int authorId = mLoggedInUserHelper.getId(); if (authorId == -1) { throw new Error("No currently logged in user."); } Message message = new Message(id, threadId, authorId, new Date(), finalBody, false, false); List<Message> messages = new ArrayList<>(thread.messages); messages.add(message); thread = new MessageThread( thread.id, thread.subject, thread.started, thread.isRead, thread.participantIds, messages, new Date()); save(threadId, thread); emitter.onComplete(); sendMessagesToServer(thread); }).subscribeOn(Schedulers.io()); }</code><technical_language>replaceAll() replace() in Message.java? need a regular expression CharSequence work in case</technical_language>

Target:
public Completable sendMessage(int threadId, String body) { body = "<p>" + body + "</p>"; body = body.replace("\n", "<br>"); String finalBody = body; return Completable.create(emitter -> { MessageThread thread = getRaw(threadId); if (thread == null) { throw new Error("The thread needs to already be in the cache."); } int id = getNextPendingMessageId(thread); int authorId = mLoggedInUserHelper.getId(); if (authorId == -1) { throw new Error("No currently logged in user."); } Message message = new Message(id, threadId, authorId, new Date(), finalBody, false, false); List<Message> messages = new ArrayList<>(thread.messages); messages.add(message); thread = new MessageThread( thread.id, thread.subject, thread.started, thread.isRead, thread.participantIds, messages, new Date()); save(threadId, thread); emitter.onComplete(); sendMessagesToServer(thread); }).subscribeOn(Schedulers.io()); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((owningNodeUuid == null) ? 0 : owningNodeUuid.hashCode()); result = prime * result + ((workspaceName == null) ? 0 : workspaceName.hashCode()); <START> return result; <END> }</code><technical_language>sufficient owningNodeUuid.hashCode()? If not, org.modeshape.common.util.HashCode.compute(owningNodeUuid,workspaceName)</technical_language>

Target:
public int hashCode() { return owningNodeUuid.hashCode(); }
Source:
<code>public NetworkMetadata claim(String dataCenterId) { NetworkMetadata metadata = experimentalClient("/networks/{accountAlias}/{dataCenterId}/claim") .resolveTemplate("dataCenterId", dataCenterId) .request() <START> .post(entity(new HashMap(), APPLICATION_JSON_TYPE)) <END> .readEntity(NetworkMetadata.class); setDatacenter(metadata, dataCenterId); return metadata; }</code><technical_language>I HashMap parameterized (using diamond operator)</technical_language>

Target:
public NetworkMetadata claim(String dataCenterId) { NetworkMetadata metadata = experimentalClient("/networks/{accountAlias}/{dataCenterId}/claim") .resolveTemplate("dataCenterId", dataCenterId) .request() .post(entity(new HashMap<>(), APPLICATION_JSON_TYPE)) .readEntity(NetworkMetadata.class); setDatacenter(metadata, dataCenterId); return metadata; }
Source:
<code>public final void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = (ConfigurableApplicationContext) applicationContext; Map<String, StreamListenerParameterAdapter> parameterAdapterMap = BeanFactoryUtils .beansOfTypeIncludingAncestors(this.applicationContext, StreamListenerParameterAdapter.class); for (StreamListenerParameterAdapter parameterAdapter : parameterAdapterMap.values()) { this.streamListenerParameterAdapters.add(parameterAdapter); } Map<String, StreamListenerResultAdapter> resultAdapterMap = BeanFactoryUtils .beansOfTypeIncludingAncestors(this.applicationContext, StreamListenerResultAdapter.class); this.streamListenerResultAdapters.add(new MessageChannelStreamListenerResultAdapter()); for (StreamListenerResultAdapter resultAdapter : resultAdapterMap.values()) { this.streamListenerResultAdapters.add(resultAdapter); } <START> this.evaluationContext = new StandardEvaluationContext(); <END> }</code><technical_language>IntegrationContextUtils.getEvaluationContext(BeanFactory) instead</technical_language>

Target:
public final void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = (ConfigurableApplicationContext) applicationContext; }
Source:
<code>private boolean removeDirectedEdge(DirectedGraphNode source, DirectedGraphNode target) { boolean sourceExisted = source.outgoings.remove(target); boolean targetExisted = target.ingoings.remove(source); <START> assert sourceExisted == targetExisted; <END> return targetExisted; }</code><technical_language>assert is useful a check exception. enabled in a strange inconsistent way, find users symptoms for bug hidden symptoms</technical_language>

Target:
private boolean removeDirectedEdge(DirectedGraphNode source, DirectedGraphNode target) { boolean sourceExisted = source.outgoings.remove(target); boolean targetExisted = target.ingoings.remove(source); if (sourceExisted != targetExisted) { String message = MessageFormat .format("Inconsistent edge encountered from [source: {0}] to [target: {1}]:", source, target); throw new IllegalStateException(message); } return targetExisted; }
Source:
<code>public RedisMetadataStore(RedisConnectionFactory connectionFactory) { Assert.notNull(connectionFactory, "'connectionFactory' must not be null."); this.redisTemplate = new StringRedisTemplate(connectionFactory); <START> this.redisTemplate.afterPropertiesSet(); <END> }</code><technical_language>StringRedisTemplate constructor takes care of it</technical_language>

Target:
public RedisMetadataStore(RedisConnectionFactory connectionFactory) { Assert.notNull(connectionFactory, "'connectionFactory' must not be null."); this.redisTemplate = new StringRedisTemplate(connectionFactory); }
Source:
<code>public List<NameValuePair> build() { String expectedFrontend3dsIncomingUrl = "<LINK_0>"; EpdqParameterBuilder epdqParameterBuilder = newParameterBuilder() .add(ACCEPTURL_KEY, expectedFrontend3dsIncomingUrl) .add(AMOUNT_KEY, AMOUNT) .add(CARD_NO_KEY, CARD_NO) .add(CARDHOLDER_NAME_KEY, CARDHOLDER_NAME) .add(CURRENCY_KEY, CURRENCY) .add(CVC_KEY, CVC) .add(DECLINEURL_KEY, expectedFrontend3dsIncomingUrl + "?status=declined") .add(EXPIRY_DATE_KEY, END_DATE) .add(EXCEPTIONURL_KEY, expectedFrontend3dsIncomingUrl + "?status=error") .add(FLAG3D_KEY, "Y") .add(HTTPACCEPT_URL, ACCEPT_HEADER) .add(LANGUAGE_URL, "en_GB") .add(OPERATION_KEY, OPERATION_TYPE) <START> .add(ORDER_ID_KEY, ORDER_ID) <END> .add(PSPID_KEY, PSP_ID) .add(PSWD_KEY, PASSWORD) .add(USERID_KEY, USER_ID) .add(WIN3DS_URL, "MAINW") .add(BROWSER_COLOR_DEPTH, browserColorDepth) .add(BROWSER_LANGUAGE, browserLanguage) .add(BROWSER_SCREEN_HEIGHT, browserScreenHeight) .add(BROWSER_SCREEN_WIDTH, browserScreenWidth) .add(BROWSER_TIMEZONE_OFFSET_MINS, browserTimezoneOffsetMins) .add(BROWSER_USER_AGENT, browserUserAgent); return epdqParameterBuilder.build(); }</code><technical_language>I this wants stay. do normalisation for this (the defaulting Mozilla/5.0 if get a User-Agent header) do for new parameter. rename HTTPUSER_AGENT_URL HTTP_USER_AGENT something? need for URL in confuses me</technical_language>

Target:
public List<NameValuePair> build() { String expectedFrontend3dsIncomingUrl = "<LINK_0>"; EpdqParameterBuilder epdqParameterBuilder = newParameterBuilder() .add(ACCEPTURL_KEY, expectedFrontend3dsIncomingUrl) .add(AMOUNT_KEY, AMOUNT) .add(CARD_NO_KEY, CARD_NO) .add(CARDHOLDER_NAME_KEY, CARDHOLDER_NAME) .add(CURRENCY_KEY, CURRENCY) .add(CVC_KEY, CVC) .add(DECLINEURL_KEY, expectedFrontend3dsIncomingUrl + "?status=declined") .add(EXPIRY_DATE_KEY, END_DATE) .add(EXCEPTIONURL_KEY, expectedFrontend3dsIncomingUrl + "?status=error") .add(FLAG3D_KEY, "Y") .add(HTTPACCEPT_KEY, browserAcceptHeader) .add(HTTPUSER_AGENT_KEY, browserUserAgent) .add(LANGUAGE_URL, "en_GB") .add(OPERATION_KEY, OPERATION_TYPE) .add(ORDER_ID_KEY, ORDER_ID) .add(PSPID_KEY, PSP_ID) .add(PSWD_KEY, PASSWORD) .add(USERID_KEY, USER_ID) .add(WIN3DS_URL, "MAINW") .add(BROWSER_COLOR_DEPTH, browserColorDepth) .add(BROWSER_LANGUAGE, browserLanguage) .add(BROWSER_SCREEN_HEIGHT, browserScreenHeight) .add(BROWSER_SCREEN_WIDTH, browserScreenWidth) .add(BROWSER_TIMEZONE_OFFSET_MINS, browserTimezoneOffsetMins) .add(BROWSER_ACCEPT_HEADER, browserAcceptHeader) .add(BROWSER_USER_AGENT, browserUserAgent); return epdqParameterBuilder.build(); }
Source:
<code>public void onExit() { uncommittedOffsets = offsets.entrySet().stream() .filter(e -> !e.getValue().isCommitted()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getSentOffset())); final String appName = getContext().getParameters().getConsumingAppId(); final NakadiKpiPublisher kpiPublisher = getContext().getKpiPublisher(); final Subscription subscription = getContext().getSubscription(); subscription.getEventTypes().stream() .forEach(et -> { final long bytes = kpiDataPerEventType.get(et).getAndResetBytesSent(); final long count = kpiDataPerEventType.get(et).getAndResetNumberOfEventsSent(); publishKpi(appName, kpiPublisher, et, bytes, count); <START> }); <END> if (null != topologyChangeSubscription) { try { topologyChangeSubscription.close(); } catch (final RuntimeException ex) { getLog().warn("Failed to cancel topology subscription", ex); } finally { topologyChangeSubscription = null; new HashSet<>(offsets.keySet()).forEach(this::removeFromStreaming); } } if (null != eventConsumer) { try { eventConsumer.close(); } catch (final IOException e) { throw new NakadiRuntimeException(e); } finally { eventConsumer = null; } } if (cursorResetSubscription != null) { try { cursorResetSubscription.close(); } catch (IOException ignore) { } cursorResetSubscription = null; } }</code><technical_language>This code is similar code some lines above. is a function in 2 places? Also, check if count is zero</technical_language>

Target:
public void onExit() { uncommittedOffsets = offsets.entrySet().stream() .filter(e -> !e.getValue().isCommitted()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getSentOffset())); getContext().getSubscription().getEventTypes().stream().forEach(et -> publishKpi(et)); if (null != topologyChangeSubscription) { try { topologyChangeSubscription.close(); } catch (final RuntimeException ex) { getLog().warn("Failed to cancel topology subscription", ex); } finally { topologyChangeSubscription = null; new HashSet<>(offsets.keySet()).forEach(this::removeFromStreaming); } } if (null != eventConsumer) { try { eventConsumer.close(); } catch (final IOException e) { throw new NakadiRuntimeException(e); } finally { eventConsumer = null; } } if (cursorResetSubscription != null) { try { cursorResetSubscription.close(); } catch (IOException ignore) { } cursorResetSubscription = null; } }
Source:
<code>public List<Job> getConfiguredJobs(String serverName) { LinkedList<Job> configuredJobs = new LinkedList<Job>(); <START> for (Job<?, ?> project : Hudson.getInstance().getItems(Job.class)) { END> GerritTrigger gerritTrigger = GerritTrigger.getTrigger(project); if (gerritTrigger != null && gerritTrigger.getServerName().equals(serverName)) { configuredJobs.add(project); } } return configuredJobs; }</code><technical_language>Inherital sin: change Hudson Jenkins</technical_language>

Target:
public List<Job> getConfiguredJobs(String serverName) { LinkedList<Job> configuredJobs = new LinkedList<Job>(); for (Job<?, ?> project : Jenkins.getInstance().getItems(Job.class)) { GerritTrigger gerritTrigger = GerritTrigger.getTrigger(project); if (gerritTrigger != null && gerritTrigger.getServerName().equals(serverName)) { configuredJobs.add(project); } } return configuredJobs; }
Source:
<code>public List<Variant> mapLine(String line, int lineNumber) { assertNotNull(this.getClass().getSimpleName() + " should be used to read genotyped VCFs only " + <START> "(hint: set VariantSource.Aggregation to NONE)", factory); <END> return factory.create(fileId, studyId, line); }</code><technical_language>This assert fail. in previous version constructor throw exception, leaving factory uninitialized</technical_language>

Target:
public List<Variant> mapLine(String line, int lineNumber) { return factory.create(fileId, studyId, line); }
Source:
<code>public ExecutionHandler(Executor<C, E> executor, Collection<? extends E> executables, Function<E, String> nameFactory, Function<ModelNode, String> nameExtractor) { this.executor = executor; Map<String, E> map = new HashMap<>(); for (E executable : executables) { <START> if (map.put(nameFactory.apply(executable), executable) != null) { <END> throw new IllegalStateException("Duplicate key"); } } this.executables = map; this.nameExtractor = nameExtractor; }</code><technical_language>Unnecessary conditional. Uniqueness is guaranteed</technical_language>

Target:
public ExecutionHandler(Executor<C, E> executor, Collection<? extends E> executables, Function<E, String> nameFactory, Function<ModelNode, String> nameExtractor) { this.executor = executor; Map<String, E> map = new HashMap<>(); for (E executable : executables) { map.put(nameFactory.apply(executable), executable); } this.executables = map; this.nameExtractor = nameExtractor; }
Source:
<code>protected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows) { final Scan scan = new Scan(); for (Column column : columns) { if (!column.isPrimaryKey()) { final int colonIndex = column.getName().indexOf(':'); final int len = column.getName().length(); if (colonIndex != -1) { String family = column.getName().substring(0, colonIndex); <START> String colName = column.getName().substring(colonIndex + 1, len); <END> scan.addColumn(family.getBytes(),colName.getBytes()); } else { scan.addFamily(column.getName().getBytes()); } } } if (maxRows > 0) { setMaxRows(scan, maxRows); } final org.apache.hadoop.hbase.client.Table hTable = getHTable(table.getName()); try { final ResultScanner scanner = hTable.getScanner(scan); return new HBaseDataSet(columns, scanner, hTable); } catch (Exception e) { FileHelper.safeClose(hTable); throw new MetaModelException(e); } }</code><technical_language>Remember add final :-)</technical_language>

Target:
protected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows) { final Scan scan = new Scan(); for (Column column : columns) { if (!column.isPrimaryKey()) { final int colonIndex = column.getName().indexOf(':'); final int len = column.getName().length(); if (colonIndex != -1) { final String family = column.getName().substring(0, colonIndex); final String colName = column.getName().substring(colonIndex + 1, len); scan.addColumn(family.getBytes(), colName.getBytes()); } else { scan.addFamily(column.getName().getBytes()); } } } if (maxRows > 0) { setMaxRows(scan, maxRows); } final org.apache.hadoop.hbase.client.Table hTable = getHTable(table.getName()); try { final ResultScanner scanner = hTable.getScanner(scan); return new HBaseDataSet(columns, scanner, hTable); } catch (Exception e) { FileHelper.safeClose(hTable); throw new MetaModelException(e); } }
Source:
<code>private void NoInternetConnectionSnackbar() { Snackbar mSnackbar = Snackbar.make(getActivity().findViewById(android.R.id.content), <START> "No internet connection", Snackbar.LENGTH_SHORT); <END> View sbView = mSnackbar.getView(); TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text); textView.setTextColor(Color.WHITE); mSnackbar.show(); }</code><technical_language>Put text in Strings.xml prevent Internationalization Lint errors</technical_language>

Target:
private void NoInternetConnectionSnackbar() { Snackbar mSnackbar = Snackbar.make(getActivity().findViewById(android.R.id.content), R.string.snackbar_no_internet_connection, Snackbar.LENGTH_SHORT); View sbView = mSnackbar.getView(); TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text); textView.setTextColor(Color.WHITE); mSnackbar.show(); }
Source:
<code>public void run() { for (int i = 0; i < UPLOADRETRYNUM; i++) { LOG.info(i + " time to try upload"); try { LOG.info("sleep " + ((long) Math.pow(WAITTIMEMILLIS / 1000, i * UPLOADRETRYRATE) - 1) + " seconds"); Thread.sleep(((long) Math.pow(WAITTIMEMILLIS / 1000, i * UPLOADRETRYRATE) - 1) * 1000); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } uploadRoll(); if (uploadSuccess) { break; } else { if (!networkError) { break; } else { networkError = false; } } } mgr.reportUpload(ident, compression, uploadSuccess); }</code><technical_language>LOG instead of e.printStackTrace();</technical_language>

Target:
public void run() { for (int i = 0; i < UPLOAD_RETRY_NUM; i++) { uploadRoll(); if (!uploadSuccess && networkError) { if (i + 1 == UPLOAD_RETRY_NUM) break; try { Thread.sleep(WAIT_TIME_MILLIS); } catch (InterruptedException e) { LOG.error("sleep error: " + e); } LOG.warn((i + 1) + " time to retry upload " + ident); networkError = false; } else { break; } } mgr.reportUpload(ident, compression, uploadSuccess); }
Source:
<code>public void descriptionAndBlockTagsAreRetrievable() { Javadoc javadoc = JavaParser.parseJavadoc("first line\nsecond line\n\n@param node a node\n@return result the result"); <START> assertEquals(javadoc.getDescription().toText(), "first line\nsecond line"); <END> assertEquals(2, javadoc.getBlockTagCount()); }</code><technical_language>invert this</technical_language>

Target:
public void descriptionAndBlockTagsAreRetrievable() { Javadoc javadoc = JavaParser.parseJavadoc("first line\nsecond line\n\n@param node a node\n@return result the result"); assertEquals("first line\nsecond line", javadoc.getDescription().toText()); assertEquals(2, javadoc.getBlockTags().size()); }
Source:
<code><START> boolean shouldReactToChildVisibilityChanges(MUIElement <END> theElement) { return (theElement instanceof MPartSashContainer || theElement instanceof MPartStack); }</code><technical_language>method static</technical_language>

Target:
private static boolean shouldReactToChildVisibilityChanges(MUIElement theElement) { return (theElement instanceof MPartSashContainer || theElement instanceof MPartStack); }
Source:
<code>private List<String> writeStringToFile(String fileContents, String filePath) { return Arrays.asList( <START> "cat << END_OF_FILE_CONTENTS" + ">", <END> filePath + "\n" + fileContents + "\nEND_OF_FILE_CONTENTS\n"); }</code><technical_language>this cat << 'END_OF_FILE_CONTENTS' avoid shell escaping in there</technical_language>

Target:
private List<String> writeStringToFile(String fileContents, String filePath) { return Arrays.asList( "cat << 'END_OF_FILE_CONTENTS' >", filePath + "\n" + fileContents + "\nEND_OF_FILE_CONTENTS\n"); }