auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void trackAction(ActionDescription actionDescription) { if (SESSION_START != actionDescription.getCategory() && SESSION_STOP != actionDescription.getCategory()) { return; } StringBuilder jsonBuilder = new StringBuilder("{") .append("\"action\":\"").append(actionDescription.getCategory()).append("\",") .append("\"productVersion\":\"").append(getSoapUIVersion()).append("\",") .append("\"installId\":\"").append(getInstallId()).append("\",") .append("\n") .append("\"environment\": {") .append("\"osName\":\"").append(getOsName()).append("\",") .append("\"osVersion\":\"").append(getOsVersion()).append("\",") .append("\"userCountry\":\"").append(getUserCountry()).append("\",") .append("\"javaVersion\":\"").append(getJavaVersion()).append("\",") .append("\"screenSize\":\"").append(getStrScreenSize()).append("\",") .append("\"language\":\"").append(getUserLanguage()).append("\"") .append("},"); switch (actionDescription.getCategory()) { case SESSION_START: sessionStartTime = new Date(); sessionId = UUID.randomUUID().toString(); break; case SESSION_STOP: jsonBuilder.append("\"endTime\": ").append(new Date()); break; } jsonBuilder.append("\"sessionId\":\"").append(sessionId).append("\",") .append("\"startTime\":\"").append(sessionStartTime).append("\"") .append("}"); String jsonString = jsonBuilder.toString(); <START> System.out.println(jsonString); <END> sendRecord(SESSION_URL, jsonString); }</code><technical_language>SLF4J instead? remove</technical_language>

Target:
public void trackAction(ActionDescription actionDescription) { if (SESSION_START != actionDescription.getCategory() && SESSION_STOP != actionDescription.getCategory()) { return; } StringBuilder jsonBuilder = new StringBuilder("{") .append("\"action\":\"").append(actionDescription.getCategory()).append("\",") .append("\"productVersion\":\"").append(getSoapUIVersion()).append("\",") .append("\"installId\":\"").append(getInstallId()).append("\",") .append("\n") .append("\"environment\": {") .append("\"osName\":\"").append(getOsName()).append("\",") .append("\"osVersion\":\"").append(getOsVersion()).append("\",") .append("\"userCountry\":\"").append(getUserCountry()).append("\",") .append("\"javaVersion\":\"").append(getJavaVersion()).append("\",") .append("\"screenSize\":\"").append(getStrScreenSize()).append("\",") .append("\"language\":\"").append(getUserLanguage()).append("\"") .append("},"); switch (actionDescription.getCategory()) { case SESSION_START: sessionStartTime = new Date(); sessionId = UUID.randomUUID().toString(); break; case SESSION_STOP: jsonBuilder.append("\"endTime\": ").append(new Date()); break; } jsonBuilder.append("\"sessionId\":\"").append(sessionId).append("\",") .append("\"startTime\":\"").append(sessionStartTime).append("\"") .append("}"); String jsonString = jsonBuilder.toString(); sendRecord(SESSION_URL, jsonString); }
Source:
<code>private void deleteBranches(final Set<Branch.NameKey> branchIds) { Util.PROJECT_SVC.deleteBranch(getProjectKey(), branchIds, new GerritCallback<Set<Branch.NameKey>>() { public void onSuccess(final Set<Branch.NameKey> deleted) { if (!deleted.isEmpty()) { for (int row = 1; row < table.getRowCount();) { final Branch k = getRowItem(row); if (k != null && deleted.contains(k.getNameKey())) { table.removeRow(row); } else { row++; } } } branchIds.removeAll(deleted); if (!branchIds.isEmpty()) { final SafeHtmlBuilder b = new SafeHtmlBuilder(); b.append(Util.C.branchDeletionOpenChanges()); b.br(); appendBranchOpenChangesLinks(b, branchIds); new ErrorDialog(b.toSafeHtml()).center(); } } private void appendBranchOpenChangesLinks(final SafeHtmlBuilder b, final Set<Branch.NameKey> branches) { b.openElement("p"); for (final Branch.NameKey branch : branches) { b.openAnchor(); final BranchLink link = new BranchLink(branch.getParentKey(), Change.Status.NEW, branch.get(), null); b.setAttribute("href", "/#" + link.getTargetHistoryToken()); b.setAttribute("target", "_blank"); b.append(branch.get()); b.closeAnchor(); b.br(); } <START> b.closeElement("p"); <END> } }); }</code><technical_language>"b"s h avoid confusion branch. a safehtmlbuilder is hard put widgets in errordialog</technical_language>

Target:
private void deleteBranches(final Set<Branch.NameKey> branchIds) { Util.PROJECT_SVC.deleteBranch(getProjectKey(), branchIds, new GerritCallback<Set<Branch.NameKey>>() { public void onSuccess(final Set<Branch.NameKey> deleted) { if (!deleted.isEmpty()) { for (int row = 1; row < table.getRowCount();) { final Branch k = getRowItem(row); if (k != null && deleted.contains(k.getNameKey())) { table.removeRow(row); } else { row++; } } } branchIds.removeAll(deleted); if (!branchIds.isEmpty()) { final VerticalPanel p = new VerticalPanel(); final ErrorDialog errorDialog = new ErrorDialog(p); final Label l = new Label(Util.C.branchDeletionOpenChanges()); l.setStyleName(Gerrit.RESOURCES.css().errorDialogText()); p.add(l); for (final Branch.NameKey branch : branchIds) { final BranchLink link = new BranchLink(branch.getParentKey(), Change.Status.NEW, branch.get(), null) { @Override public void go() { errorDialog.hide(); super.go(); }; }; p.add(link); } errorDialog.center(); } } }); }
Source:
<code>private void impl$reAssignValuesFromIncomingInfo(final WorldInfo info, final CallbackInfo ci) { final WorldProperties properties = (WorldProperties) info; if (((WorldInfoBridge) info).bridge$isValid()) { <START> this.dimensionType = (SpongeDimensionType) properties.getDimensionType(); <END> this.dimensionType = (SpongeDimensionType) properties.getDimensionType(); this.difficulty = properties.getDifficulty(); this.serializationBehavior = properties.getSerializationBehavior(); this.isEnabled = properties.isEnabled(); this.loadOnStartup = properties.doesLoadOnStartup(); this.keepSpawnLoaded = properties.doesKeepSpawnLoaded(); this.generateSpawnOnLoad = properties.doesGenerateSpawnOnLoad(); this.pvpEnabled = properties.isPVPEnabled(); this.bonusChestEnabled = properties.doesGenerateBonusChest(); this.generatorSettings = properties.getGeneratorSettings(); } }</code><technical_language>Try twice, work time</technical_language>

Target:
private void impl$reAssignValuesFromIncomingInfo(final WorldInfo info, final CallbackInfo ci) { final WorldProperties properties = (WorldProperties) info; if (!((WorldInfoBridge) info).bridge$isValid()) { return; } this.impl$logicType = (SpongeDimensionType) properties.getDimensionType(); this.impl$difficulty = properties.getDifficulty(); this.impl$serializationBehavior = properties.getSerializationBehavior(); this.impl$isEnabled = properties.isEnabled(); this.impl$loadOnStartup = properties.doesLoadOnStartup(); this.impl$keepSpawnLoaded = properties.doesKeepSpawnLoaded(); this.impl$generateSpawnOnLoad = properties.doesGenerateSpawnOnLoad(); this.impl$pvpEnabled = properties.isPVPEnabled(); this.bonusChestEnabled = properties.doesGenerateBonusChest(); this.impl$generatorSettings = properties.getGeneratorSettings(); }
Source:
<code>protected void configure() { bind(ProjectsCollection.class); bind(DashboardsCollection.class); DynamicMap.mapOf(binder(), PROJECT_KIND); DynamicMap.mapOf(binder(), DASHBOARD_KIND); put(PROJECT_KIND).to(PutProject.class); get(PROJECT_KIND).to(GetProject.class); get(PROJECT_KIND, "description").to(GetDescription.class); put(PROJECT_KIND, "description").to(PutDescription.class); delete(PROJECT_KIND, "description").to(PutDescription.class); get(PROJECT_KIND, "parent").to(GetParent.class); put(PROJECT_KIND, "parent").to(SetParent.class); <START> get(PROJECT_KIND, "head").to(GetHead.class); <END> put(PROJECT_KIND, "head").to(SetHead.class); child(PROJECT_KIND, "dashboards").to(DashboardsCollection.class); get(DASHBOARD_KIND).to(GetDashboard.class); put(DASHBOARD_KIND).to(SetDashboard.class); delete(DASHBOARD_KIND).to(DeleteDashboard.class); install(new FactoryModuleBuilder().build(CreateProject.Factory.class)); }</code><technical_language>I this HEAD is Git filesystem network protocol and... :-)</technical_language>

Target:
protected void configure() { bind(ProjectsCollection.class); bind(DashboardsCollection.class); DynamicMap.mapOf(binder(), PROJECT_KIND); DynamicMap.mapOf(binder(), DASHBOARD_KIND); put(PROJECT_KIND).to(PutProject.class); get(PROJECT_KIND).to(GetProject.class); get(PROJECT_KIND, "description").to(GetDescription.class); put(PROJECT_KIND, "description").to(PutDescription.class); delete(PROJECT_KIND, "description").to(PutDescription.class); get(PROJECT_KIND, "parent").to(GetParent.class); put(PROJECT_KIND, "parent").to(SetParent.class); get(PROJECT_KIND, "HEAD").to(GetHead.class); put(PROJECT_KIND, "HEAD").to(SetHead.class); child(PROJECT_KIND, "dashboards").to(DashboardsCollection.class); get(DASHBOARD_KIND).to(GetDashboard.class); put(DASHBOARD_KIND).to(SetDashboard.class); delete(DASHBOARD_KIND).to(DeleteDashboard.class); install(new FactoryModuleBuilder().build(CreateProject.Factory.class)); }
Source:
<code>public void selectAll(){ int numberOfFiles = mAdapter.getCount(); for(int i = 0; i < numberOfFiles; i++){ File file = (File) mAdapter.getItem(i); if (file != null) { <START> if (file.isDirectory()) { <END> } else { getListView().setItemChecked(i, true); mContainerActivity.onFileClick(file); } } } }</code><technical_language>If file is a directory, this check is necessary</technical_language>

Target:
public void selectAll(){ int numberOfFiles = mAdapter.getCount(); for(int i = 0; i < numberOfFiles; i++){ File file = (File) mAdapter.getItem(i); if (file != null) { if (!file.isDirectory()) { getListView().setItemChecked(i, true); mContainerActivity.onFileClick(file); } } } }
Source:
<code>protected List<AttributeStatement> createHomeCommunityIdAttributeStatements(final CallbackProperties properties) { LOG.debug("SamlCallbackHandler.addAssertStatements() -- Begin"); List<AttributeStatement> statements = Collections.emptyList(); final String communityId = properties.getHomeCommunity(); <START> if (communityId != null) { <END> statements = OpenSAML2ComponentBuilder.getInstance().createHomeCommunitAttributeStatement( appendPrefixHomeCommunityID(communityId)); } else { LOG.debug("Home Community ID is missing"); } return statements; }</code><technical_language>null empty check</technical_language>

Target:
protected List<AttributeStatement> createHomeCommunityIdAttributeStatements(final CallbackProperties properties) { LOG.debug("SamlCallbackHandler.addAssertStatements() -- Begin"); List<AttributeStatement> statements = Collections.emptyList(); final String communityId = properties.getHomeCommunity(); if (StringUtils.isNotBlank(communityId)) { statements = OpenSAML2ComponentBuilder.getInstance().createHomeCommunitAttributeStatement( appendPrefixHomeCommunityID(communityId)); } else { LOG.debug("Home Community ID is missing"); } return statements; }
Source:
<code>public ApiKey generateApiKey() { <START> URI uri = new URIBase(getBaseUri()).path("_api/v2/api_keys").build(); <END> InputStream response = couchDbClient.post(uri, null); return getResponse(response, ApiKey.class, getGson()); }</code><technical_language>path("_api").path("v2").path("api_keys")</technical_language>

Target:
public ApiKey generateApiKey() { URI uri = new URIBase(getBaseUri()).path("_api").path("v2").path("api_keys").build(); InputStream response = couchDbClient.post(uri, null); return getResponse(response, ApiKey.class, getGson()); }
Source:
<code>public Response updateTokenDescription(JsonNode payload) { return withTokenLinkAndDescription(payload, (token_link, description) -> { boolean updated = authDao.updateTokenDescription(token_link, description); if (updated) { return Response.ok(ImmutableMap.of("token_link", token_link, "description", description)).build(); } <START> return Response.status(NOT_FOUND).entity(ImmutableMap.of("message", "Could not update token description")).build(); <END> }); }</code><technical_language>move a ResponseUtil method</technical_language>

Target:
public Response updateTokenDescription(JsonNode payload) { return withTokenLinkAndDescription(payload, (token_link, description) -> { boolean updated = authDao.updateTokenDescription(token_link, description); if (updated) { return ok(ImmutableMap.of("token_link", token_link, "description", description)).build(); } return notFoundResponse(logger, "Could not update token description"); }); }
Source:
<code>public void afterPropertiesSet() throws Exception { Properties properties = new Properties(); properties.put("locators", "localhost[7777]"); properties.put("log-level", "warning"); properties.put("mcast-port", "0"); this.cache = new CacheFactory(properties).create(); RegionFactory<String, Set<String>> regionFactory = this.cache.createRegionFactory(RegionShortcut.REPLICATE); <START> this.consumerGroupsRegion = regionFactory.create(CONSUMER_GROUPS_REGION); <END> }</code><technical_language>This region name needs configurable too</technical_language>

Target:
public void afterPropertiesSet() throws Exception { RegionFactory<String, ConsumerGroupTracker> regionFactory = this.cache.createRegionFactory(RegionShortcut.REPLICATE); this.consumerGroupsRegion = regionFactory.setScope(Scope.GLOBAL).create(CONSUMER_GROUPS_REGION); }
Source:
<code>public static void init(ObjectMapper mapper) { <START> log.info("finding expression functions.."); <END> for (NamedType subType : resolveSubtypes(mapper, Function.Library.class)) { Parser.register(subType.getType()); } }</code><technical_language>minor nit, this a string builder starts "Found math expression functions:" add functions finds outputting</technical_language>

Target:
public static void init(ObjectMapper mapper) { List<Class<?>> libraries = Lists.transform( resolveSubtypes(Function.Library.class, mapper), new com.google.common.base.Function<NamedType, Class<?>>() { @Override public Class<?> apply(NamedType input) { return input.getType(); } } ); log.info("finding expression functions in libraries [%s]..", libraries); for (Class<?> library : libraries) { Parser.register(library); } }
Source:
<code>private void newPostSetup() { mIsNewPost = true; if (mSite == null) { showErrorAndFinish(R.string.blog_not_found); return; } if (!mSite.isVisible()) { showErrorAndFinish(R.string.error_blog_hidden); return; } PostModel post = mPostStore.instantiatePostModel(mSite, mIsPage, null, null); <START> post.setStatus(PostStatus.DRAFT.toString()); <END> mEditPostRepository.setPost(post); EventBus.getDefault().postSticky( new PostEvents.PostOpenedInEditor(mEditPostRepository.getLocalSiteId(), mEditPostRepository.getId())); mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST); }</code><technical_language>Out of curiosity, is reason set status PostModel set post EditPostRepository? is call "updateInTransaction" updating a single field</technical_language>

Target:
private void newPostSetup() { mIsNewPost = true; if (mSite == null) { showErrorAndFinish(R.string.blog_not_found); return; } if (!mSite.isVisible()) { showErrorAndFinish(R.string.error_blog_hidden); return; } mEditPostRepository.setInTransaction(() -> { PostModel post = mPostStore.instantiatePostModel(mSite, mIsPage, null, null); post.setStatus(PostStatus.DRAFT.toString()); return post; }); EventBus.getDefault().postSticky( new PostEvents.PostOpenedInEditor(mEditPostRepository.getLocalSiteId(), mEditPostRepository.getId())); mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST); }
Source:
<code><START> public List<FileAndCommitsForTimePeriod> getFrequentlyChangedFiles( <END> long projectId, String commitHash, Date startDate, int frequency, List<FilePattern> filePatterns) { Pair<List<String>, List<String>> includesAndExcludes = mapPatternsToRegex(filePatterns); return mapFileAndCommitsForTimePeriodResult( fileRepository.getFrequentlyChangedFiles( projectId, commitHash, startDate.getTime(), frequency, includesAndExcludes.getFirst(), includesAndExcludes.getSecond())); }</code><technical_language>if start date is commit time</technical_language>

Target:
public List<FileAndCommitsForTimePeriod> getFrequentlyChangedFiles( long projectId, String commitHash, Date startDate, int frequency, List<FilePattern> filePatterns) { Pair<List<String>, List<String>> includesAndExcludes = PatternUtil.mapPatternsToRegex(filePatterns); return mapFileAndCommitsForTimePeriodResult( fileRepository.getFrequentlyChangedFiles( projectId, commitHash, startDate.getTime(), frequency, includesAndExcludes.getFirst(), includesAndExcludes.getSecond())); }
Source:
<code><START> public void parseMapFileEntry(String repoSpecificentry, Properties overrideTags, Map entryInfos) throws CoreException { <END> String[] arguments = Utils.getArrayFromStringWithBlank(repoSpecificentry, SEPARATOR); Map<String,String> table = new HashMap<String,String>(); for (int i = 0; i < arguments.length; i++) { String arg = arguments[i]; int index = arg.indexOf('='); if (index == -1) { String message = NLS.bind(Messages.error_incorrectDirectoryEntryKeyValue, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } String key = arg.substring(0, index); String value = arg.substring(index + 1); table.put(key, value); } if (!table.containsKey(KEY_REPO)) { String message = NLS.bind(Messages.error_directoryEntryRequiresRepo, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } String overrideTag = overrideTags != null ? overrideTags.getProperty(OVERRIDE_TAG) : null; entryInfos.put(IFetchFactory.KEY_ELEMENT_TAG, (overrideTag != null && overrideTag.trim().length() != 0 ? overrideTag : table.get(IFetchFactory.KEY_ELEMENT_TAG))); entryInfos.put(KEY_REPO, table.get(KEY_REPO)); if (table.get(KEY_PATH) != null) entryInfos.put(KEY_PATH, new Path((String) table.get(KEY_PATH)).makeRelative().removeTrailingSeparator().toString()); entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); addProjectReference(entryInfos); }</code><technical_language>style nit: inconsistent camel case : repoSpecificEntry</technical_language>

Target:
public void parseMapFileEntry(String repoSpecificentry, Properties overrideTags, Map entryInfos) throws CoreException { final String[] arguments = Utils.getArrayFromStringWithBlank( repoSpecificentry, SEPARATOR); final Map<String, String> table = new HashMap<String, String>(); for (int i = 0; i < arguments.length; i++) { final String arg = arguments[i]; final int index = arg.indexOf('='); if (index == -1) { final String message = NLS.bind( Messages.error_incorrectDirectoryEntryKeyValue, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } final String key = arg.substring(0, index); final String value = arg.substring(index + 1); table.put(key, value); } if (!table.containsKey(KEY_REPO)) { final String message = NLS.bind( Messages.error_directoryEntryRequiresRepo, entryInfos.get(KEY_ELEMENT_NAME)); throw new CoreException(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, 1, message, null)); } final String overrideTag = overrideTags != null ? overrideTags .getProperty(OVERRIDE_TAG) : null; entryInfos .put(IFetchFactory.KEY_ELEMENT_TAG, (overrideTag != null && overrideTag.trim().length() != 0 ? overrideTag : table.get(IFetchFactory.KEY_ELEMENT_TAG))); entryInfos.put(KEY_REPO, table.get(KEY_REPO)); if (table.get(KEY_PATH) != null) entryInfos.put(KEY_PATH, new Path(table.get(KEY_PATH)) .makeRelative().removeTrailingSeparator().toString()); entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); addProjectReference(entryInfos); }
Source:
<code>protected Scope visitUnnest(Unnest node, Optional<Scope> scope) { ImmutableList.Builder<Field> outputFields = ImmutableList.builder(); for (Expression expression : node.getExpressions()) { ExpressionAnalysis expressionAnalysis = analyzeExpression(expression, createScope(scope)); Type expressionType = expressionAnalysis.getType(expression); if (expressionType instanceof ArrayType) { Type elementType = ((ArrayType) expressionType).getElementType(); if (elementType instanceof RowType) { <START> outputFields.addAll( <END> elementType.getTypeParameters().stream() .map(type -> Field.newUnqualified(Optional.empty(), type)) .collect(toImmutableList())); } else { outputFields.add(Field.newUnqualified(Optional.empty(), elementType)); } } else if (expressionType instanceof MapType) { outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getKeyType())); outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getValueType())); } else { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Cannot unnest type: " + expressionType); } } if (node.isWithOrdinality()) { outputFields.add(Field.newUnqualified(Optional.empty(), BIGINT)); } return createAndAssignScope(node, scope, outputFields.build()); }</code><technical_language>Extracting a variable this more readable: ImmutableList<Field> fields = elementType.getTypeParameters().stream() .map(type -> Field.newUnqualified(Optional.empty(), type)) .collect(toImmutableList()); outputFields.addAll(fields);</technical_language>

Target:
protected Scope visitUnnest(Unnest node, Optional<Scope> scope) { ImmutableList.Builder<Field> outputFields = ImmutableList.builder(); for (Expression expression : node.getExpressions()) { ExpressionAnalysis expressionAnalysis = analyzeExpression(expression, createScope(scope)); Type expressionType = expressionAnalysis.getType(expression); if (expressionType instanceof ArrayType) { Type elementType = ((ArrayType) expressionType).getElementType(); if (!SystemSessionProperties.isLegacyUnnest(session) && elementType instanceof RowType) { elementType.getTypeParameters().stream() .map(type -> Field.newUnqualified(Optional.empty(), type)) .forEach(outputFields::add); } else { outputFields.add(Field.newUnqualified(Optional.empty(), elementType)); } } else if (expressionType instanceof MapType) { outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getKeyType())); outputFields.add(Field.newUnqualified(Optional.empty(), ((MapType) expressionType).getValueType())); } else { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Cannot unnest type: " + expressionType); } } if (node.isWithOrdinality()) { outputFields.add(Field.newUnqualified(Optional.empty(), BIGINT)); } return createAndAssignScope(node, scope, outputFields.build()); }
Source:
<code>public String toEnrollmentString() { StringBuilder enrollmentString = new StringBuilder(); String enrollmentStringSeparator = "|"; enrollmentString.append(this.section).append(enrollmentStringSeparator) .append(this.team).append(enrollmentStringSeparator) .append(this.name).append(enrollmentStringSeparator) .append(this.email).append(enrollmentStringSeparator) .append(this.comments); <START> return enrollmentString.toString(); <END> }</code><technical_language>This a simple return ... + ... + ... well</technical_language>

Target:
public String toEnrollmentString() { String enrollmentStringSeparator = "|"; return this.section + enrollmentStringSeparator + this.team + enrollmentStringSeparator + this.name + enrollmentStringSeparator + this.email + enrollmentStringSeparator + this.comments; }
Source:
<code>public int maxDepth( Envelope referenceEnvelope, Envelope range, int nbrDim, int maxLevel ) { double searchRatio = range.getArea() / referenceEnvelope.getArea(); <START> final int i = (int) (Math.log( searchRatio ) / Math.log( Math.pow( 2, nbrDim ) )) + extraLevels; <END> return i; }</code><technical_language>sure, do need natural logarithmic logarithmic behaviour in general? In case, more efficient log2, I suppose. write this (int) (Math.log2(searchRatio) / nbrDim) + extraLevels</technical_language>

Target:
public int maxDepth( Envelope referenceEnvelope, Envelope range, int nbrDim, int maxLevel ) { double searchRatio = range.getArea() / referenceEnvelope.getArea(); return (int) (Math.log( searchRatio ) / Math.log( Math.pow( 2, nbrDim ) )) + extraLevels; }
Source:
<code>public void loadConfiguration(@Observes ManagerStarted event) { final InputStream input = FileUtils.loadArquillianXml(ARQUILLIAN_XML_PROPERTY, ARQUILLIAN_XML_DEFAULT); final ArquillianDescriptor descriptor = resolveDescriptor(input); final PropertiesParser propertiesParser = new PropertiesParser(); propertiesParser.addProperties( descriptor, FileUtils.loadArquillianProperties(ARQUILLIAN_PROP_PROPERTY, ARQUILLIAN_PROP_DEFAULT)); Properties envProperties = new Properties(); envProperties.putAll(systemEnvironmentVars); propertiesParser.addProperties(descriptor, envProperties); ArquillianDescriptor resolvedDesc = descriptor; final List<ConfigurationPlaceholderResolver> configurationPlaceholderResolvers = new ArrayList<ConfigurationPlaceholderResolver>(serviceLoaderInstance.get().all(ConfigurationPlaceholderResolver.class)); Collections.sort(configurationPlaceholderResolvers, new Comparator<ConfigurationPlaceholderResolver>() { public int compare(ConfigurationPlaceholderResolver o1, ConfigurationPlaceholderResolver o2) { Integer a = o1.precedence(); <START> Integer b = o2.precedence(); <END> return b.compareTo(a); } }); for (ConfigurationPlaceholderResolver configurationPlaceholderResolver : configurationPlaceholderResolvers) { resolvedDesc = configurationPlaceholderResolver.resolve(resolvedDesc); } descriptorInst.set(resolvedDesc); }</code><technical_language>I firstResolver secondResolver instead of o1 o2</technical_language>

Target:
public void loadConfiguration(@Observes ManagerStarted event) { final InputStream input = FileUtils.loadArquillianXml(ARQUILLIAN_XML_PROPERTY, ARQUILLIAN_XML_DEFAULT); final ArquillianDescriptor descriptor = resolveDescriptor(input); final PropertiesParser propertiesParser = new PropertiesParser(); propertiesParser.addProperties( descriptor, FileUtils.loadArquillianProperties(ARQUILLIAN_PROP_PROPERTY, ARQUILLIAN_PROP_DEFAULT)); Properties envProperties = new Properties(); envProperties.putAll(systemEnvironmentVars); propertiesParser.addProperties(descriptor, envProperties); ArquillianDescriptor resolvedDesc = descriptor; final List<ConfigurationPlaceholderResolver> configurationPlaceholderResolvers = loadAndOrderPlaceholderResolvers(); for (ConfigurationPlaceholderResolver configurationPlaceholderResolver : configurationPlaceholderResolvers) { resolvedDesc = configurationPlaceholderResolver.resolve(resolvedDesc); } descriptorInst.set(resolvedDesc); }
Source:
<code>private void enqueueExceptionHandlers(Type exceptionType, ProgramState ps) { programPosition.block.successors().stream() .map(b -> (BytecodeCFG.Block) b) .filter(BytecodeCFG.Block::isCatchBlock) .filter(b -> b.isUncaughtException() || exceptionType == null <START> || exceptionType.isSubtypeOf(b.getExceptionType(semanticModel)) <END> || b.getExceptionType(semanticModel).isSubtypeOf(exceptionType)) .forEach(b -> enqueue(new ProgramPoint(b), ps)); }</code><technical_language>I try spare consecutive calls b.getExceptionType(semanticModel). Dedicated small method</technical_language>

Target:
private void enqueueExceptionHandlers(Type exceptionType, ProgramState ps) { programPosition.block.successors().stream() .map(b -> (BytecodeCFG.Block) b) .filter(BytecodeCFG.Block::isCatchBlock) .filter(b -> isExceptionHandledByBlock(exceptionType, b)) .forEach(b -> enqueue(new ProgramPoint(b), ps)); }
Source:
<code>public void testTrackFiles() throws Exception { final ArrayList<IFile> files = new ArrayList<IFile>(); assertEquals("Index should be empty", 0, repository1.getRepository() .getIndex().getMembers().length); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) files.add((IFile) resource); return true; } }); IFile[] fileArr = files.toArray(new IFile[files.size()]); TrackOperation trop = new TrackOperation(fileArr); trop.execute(new NullProgressMonitor()); assertEquals("Index should have two entries", 2, repository1 <START> .getRepository().getIndex().getMembers().length); <END> UntrackOperation utop = new UntrackOperation(Arrays.asList(fileArr)); utop.execute(new NullProgressMonitor()); assertEquals("Index should be empty", 0, repository1.getRepository() .getIndex().getMembers().length); }</code><technical_language>DirCache.getEntryCount() instead deprecated GitIndex</technical_language>

Target:
public void testTrackFiles() throws Exception { final ArrayList<IFile> files = new ArrayList<IFile>(); DirCache cache = DirCache.read(repository1.getRepository()); assertEquals("Wrong cache entry count", 0, cache.getEntryCount()); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) files.add((IFile) resource); return true; } }); IFile[] fileArr = files.toArray(new IFile[files.size()]); TrackOperation trop = new TrackOperation(fileArr); trop.execute(new NullProgressMonitor()); cache.read(); assertEquals("Wrong cache entry count", 2, cache.getEntryCount()); UntrackOperation utop = new UntrackOperation(Arrays.asList(fileArr)); utop.execute(new NullProgressMonitor()); cache.read(); assertEquals("Wrong cache entry count", 0, cache.getEntryCount()); }
Source:
<code>public boolean provides(IDiagramElementEditPart editPart) { boolean provides = false; if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { View view = (View) editPart.getModel(); if (view != null) { EObject model = view.getElement(); <START> provides = model instanceof DNode || model instanceof DDiagramElementContainer; <END> if (!(view instanceof Edge) && !view.isSetElement()) { provides = false; } EditDomain ed = editPart.getViewer().getEditDomain(); if (!(ed instanceof DiagramEditDomain)) { provides = false; } } } return provides; }</code><technical_language>is a SubDiagramDecorator edge??</technical_language>

Target:
public boolean provides(IDiagramElementEditPart editPart) { boolean provides = false; if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { View view = (View) editPart.getModel(); if (view != null) { if (view instanceof Edge || view.isSetElement()) { EditDomain ed = editPart.getViewer().getEditDomain(); if (ed instanceof DiagramEditDomain) { EObject model = view.getElement(); provides = model instanceof DNode || model instanceof DDiagramElementContainer; } } } } return provides; }
Source:
<code>@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); <START> cfg.setDataStorageConfiguration( <END> new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)) .setCheckpointFrequency(500L)); cfg.setCacheConfiguration( new CacheConfiguration<>() .setName(DEFAULT_CACHE_NAME) .setIndexedTypes(Integer.class, Integer.class)); return cfg; }</code><technical_language>Do need persistence here</technical_language>

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))); cfg.setCacheConfiguration( new CacheConfiguration<>() .setName(DEFAULT_CACHE_NAME) .setIndexedTypes(Integer.class, Integer.class)); failureHnd = new TestStopNodeFailureHandler(); cfg.setFailureHandler(failureHnd); return cfg; }
Source:
<code>public TypeSet types() { final Optional<Symbol> symbol = symbol(); if (symbol.isPresent()) { <START> return symbol.get().types(); <END> } else { return types.immutableCopy(); } }</code><technical_language>Consider a one-liner here, short pretty clear for : return symbol().map(Symbol::types).orElse(types.immutableCopy());</technical_language>

Target:
public TypeSet types() { return symbol().map(Symbol::types).orElse(types.immutableCopy()); }
Source:
<code>public void recognise() throws Exception { TensorflowRESTVideoRecogniser recogniser = new TensorflowRESTVideoRecogniser(); recogniser.initialize(new HashMap<String, Param>()); try (InputStream stream = getClass().getClassLoader().getResourceAsStream("test-documents/testVideoMp4.mp4")) { List<RecognisedObject> objects = recogniser.recognise(stream, new DefaultHandler(), new Metadata(), new ParseContext()); Assert.assertTrue(objects.size() > 0); Set<String> objectLabels = new HashSet<>(); for (RecognisedObject object : objects) { objectLabels.add(object.getLabel()); <START> System.out.println(object.getLabel()); <END> } Assert.assertTrue(objectLabels.size() > 0); } }</code><technical_language>Please Logs instead of std out prints. this print is necessary, instead more asserts expected</technical_language>

Target:
public void recognise() throws Exception { TensorflowRESTVideoRecogniser recogniser = new TensorflowRESTVideoRecogniser(); recogniser.initialize(new HashMap<String, Param>()); try (InputStream stream = getClass().getClassLoader().getResourceAsStream("test-documents/testVideoMp4.mp4")) { List<RecognisedObject> objects = recogniser.recognise(stream, new DefaultHandler(), new Metadata(), new ParseContext()); Assert.assertTrue(objects.size() > 0); Set<String> objectLabels = new HashSet<>(); for (RecognisedObject object : objects) { objectLabels.add(object.getLabel()); } Assert.assertTrue(objectLabels.size() > 0); } }
Source:
<code>public boolean isValid(Object path, ConstraintValidatorContext context) { if (path == null) { return true; } <START> <END> if (path instanceof String) { return Files.exists(Paths.get((String) path)); } if (path instanceof Path) { return ((Path) path).toFile().exists(); } if (path instanceof File) { return ((File) path).exists(); } context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(format("could not validate value of type %s", path.getClass().getSimpleName())) .addConstraintViolation(); return false; }</code><technical_language>suggestion // @NotNull's responsibility return true;</technical_language>

Target:
public boolean isValid(Object path, ConstraintValidatorContext context) { if (path == null) { return true; } boolean fileExists = exists(path); if (!fileExists) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate("file does not exist: " + path) .addConstraintViolation(); } return fileExists; }
Source:
<code>public void delete() throws CentralRepoException { String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id; <START> CentralRepository.getInstance().executeUpdateSQL(deleteSQL); <END> }</code><technical_language>Add null check for CentralRepository.getInstance()</technical_language>

Target:
public void delete() throws CentralRepoException { String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id; CentralRepository cr = CentralRepository.getInstance(); if (cr != null) { cr.executeDeleteSQL(deleteSQL); } }
Source:
<code>private List<ReplicaSet> getReplicaSetByLabel(String key, String value) { <START> List<ReplicaSet> replicaSets; <END> try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { replicaSets = openShiftClient.extensions() .replicaSets() .inNamespace(openShiftCheProjectName) .withLabel(key, value) .list().getItems(); return replicaSets; } }</code><technical_language>this a part of try resource block I belive</technical_language>

Target:
private List<ReplicaSet> getReplicaSetByLabel(String key, String value) { try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { List<ReplicaSet> replicaSets = openShiftClient.extensions() .replicaSets() .inNamespace(openShiftCheProjectName) .withLabel(key, value) .list().getItems(); return replicaSets; } }
Source:
<code>private ArrayList<GenericColumnSerializer> setupMetricsWriters( final IOPeon ioPeon, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); final CompressedObjectStrategy.CompressionStrategy metCompression = indexSpec.getMetricCompressionStrategy(); <START> final CompressionFactory.LongEncodingFormat metEncoding = indexSpec.getMetricLongEncodingFormat(); <END> for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = LongColumnSerializer.create(ioPeon, metric, metCompression, metEncoding); break; case FLOAT: writer = FloatColumnSerializer.create(ioPeon, metric, metCompression); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = ComplexColumnSerializer.create(ioPeon, metric, serde); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }</code><technical_language>This is more a longEncoding a metEncoding (keep in mind long dimensions soon; also, __time is a long)</technical_language>

Target:
private ArrayList<GenericColumnSerializer> setupMetricsWriters( final IOPeon ioPeon, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); final CompressedObjectStrategy.CompressionStrategy metCompression = indexSpec.getMetricCompression(); final CompressionFactory.LongEncodingStrategy longEncoding = indexSpec.getLongEncoding(); for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = LongColumnSerializer.create(ioPeon, metric, metCompression, longEncoding); break; case FLOAT: writer = FloatColumnSerializer.create(ioPeon, metric, metCompression); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = ComplexColumnSerializer.create(ioPeon, metric, serde); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }
Source:
<code>private void setNonOperational(VDS server) { Map<String, String> customValues = new HashMap<String, String>(); customValues.put(GlusterConstants.COMMAND, "gluster peer probe"); <START> customValues.put(GlusterConstants.SERVER, server.getHostName()); <END> SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, customValues); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }</code><technical_language>I message GLUSTER_COMMAND_FAILED changed vdsName instead of Server. This need add custom for server in other places - InitVdsOnUpCommand, SetNonOperationalVdsCommand etc</technical_language>

Target:
private void setNonOperational(VDS server) { Map<String, String> customValues = new HashMap<String, String>(); customValues.put(GlusterConstants.COMMAND, "gluster peer probe"); SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, customValues); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view; if (isCoursewareAccessible) { view = inflater.inflate(R.layout.fragment_course_dashboard, container, false); courseTextName = (TextView) view.findViewById(R.id.course_detail_name); courseTextDetails = (TextView) view.findViewById(R.id.course_detail_extras); headerImageView = (ImageView) view.findViewById(R.id.header_image_view); parent = (LinearLayout) view.findViewById(R.id.dashboard_detail); shareIcon = (TextView) view.findViewById(R.id.course_detail_share); <START> Typeface font = Typeface.createFromAsset(getResources().getAssets(), "fonts/fontawesome-webfont-4.3.0.ttf"); <END> shareIcon.setTypeface(font); } else { view = inflater.inflate(R.layout.fragment_course_dashboard_disabled, container, false); errorText = (TextView) view.findViewById(R.id.error_msg); } return view; }</code><technical_language>need do this if IconButton. so: xml <org.edx.mobile.third_party.iconify.IconButton android:contentDescription="@string/share_course" app:iconName="fa_share_alt" /></technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view; if (isCoursewareAccessible) { view = inflater.inflate(R.layout.fragment_course_dashboard, container, false); courseTextName = (TextView) view.findViewById(R.id.course_detail_name); courseTextDetails = (TextView) view.findViewById(R.id.course_detail_extras); headerImageView = (ImageView) view.findViewById(R.id.header_image_view); parent = (LinearLayout) view.findViewById(R.id.dashboard_detail); shareButton = (IconButton) view.findViewById(R.id.course_detail_share); } else { view = inflater.inflate(R.layout.fragment_course_dashboard_disabled, container, false); errorText = (TextView) view.findViewById(R.id.error_msg); } return view; }
Source:
<code>public CoordinatorConfig(VerifiableProperties verifiableProperties) { this.hostname = verifiableProperties.getString("coordinator.hostname"); this.datacenterName = verifiableProperties.getString("coordinator.datacenter.name"); this.requesterPoolSize = verifiableProperties.getIntInRange("coordinator.requester.pool.size", 100, 1, Integer.MAX_VALUE); this.operationTimeoutMs = verifiableProperties.getIntInRange("coordinator.operation.timeout.ms", 2000, 1, Integer.MAX_VALUE); this.connectionPoolFactory = verifiableProperties.getString("coordinator.connection.pool.factory", "com.github.ambry.network.BlockingChannelConnectionPoolFactory"); this.connectionPoolCheckoutTimeoutMs = verifiableProperties.getIntInRange("coordinator.connection.pool.checkout.timeout.ms", 1000, 1, 5000); this.crossDCProxyCallEnable = verifiableProperties.getBoolean("coordinator.cross.dc.proxy.call.enable", true); <START> this.sslEnabledColos = verifiableProperties.getString("coordinator.ssl.enbaled.colos", ""); <END> }</code><technical_language>typo</technical_language>

Target:
public CoordinatorConfig(VerifiableProperties verifiableProperties) { this.hostname = verifiableProperties.getString("coordinator.hostname"); this.datacenterName = verifiableProperties.getString("coordinator.datacenter.name"); this.requesterPoolSize = verifiableProperties.getIntInRange("coordinator.requester.pool.size", 100, 1, Integer.MAX_VALUE); this.operationTimeoutMs = verifiableProperties.getIntInRange("coordinator.operation.timeout.ms", 2000, 1, Integer.MAX_VALUE); this.connectionPoolFactory = verifiableProperties.getString("coordinator.connection.pool.factory", "com.github.ambry.network.BlockingChannelConnectionPoolFactory"); this.connectionPoolCheckoutTimeoutMs = verifiableProperties.getIntInRange("coordinator.connection.pool.checkout.timeout.ms", 1000, 1, 5000); this.crossDCProxyCallEnable = verifiableProperties.getBoolean("coordinator.cross.dc.proxy.call.enable", true); this.sslEnabledDatacenters = verifiableProperties.getString("coordinator.ssl.enabled.datacenters", ""); }
Source:
<code>public MVTable(CreateTableData data, MVTableEngine.Store store) { super(data); nextAnalyze = database.getSettings().analyzeAuto; <START> changesUnitilAnalyze = nextAnalyze <= 0 ? null : new AtomicInteger(nextAnalyze); <END> this.store = store; this.transactionStore = store.getTransactionStore(); this.isHidden = data.isHidden; boolean b = false; for (Column col : getColumns()) { if (DataType.isLargeObject(col.getType())) { b = true; break; } } containsLargeObject = b; traceLock = database.getTrace(Trace.LOCK); }</code><technical_language>changesUnitilAnalyze -> changesUntilAnalyze</technical_language>

Target:
public MVTable(CreateTableData data, MVTableEngine.Store store) { super(data); nextAnalyze = database.getSettings().analyzeAuto; changesUnitlAnalyze = nextAnalyze <= 0 ? null : new AtomicInteger(nextAnalyze); this.store = store; this.transactionStore = store.getTransactionStore(); this.isHidden = data.isHidden; boolean b = false; for (Column col : getColumns()) { if (DataType.isLargeObject(col.getType())) { b = true; break; } } containsLargeObject = b; traceLock = database.getTrace(Trace.LOCK); }
Source:
<code>public void blobStoreHardDeleteTestBlobV1() throws MessageFormatException, IOException { <START> blobStoreHardDeleteTestUtil(MessageFormatRecord.Blob_Version_V1); <END> }</code><technical_language>This is testing correctly. V2 hard coded actual test. I works blob type is HardDeleteMessageFormatInputStream if version is V1. testing this independently, I suggest a single test interleaved V1 V2 records surely end scenario deployment</technical_language>

Target:
public void blobStoreHardDeleteTestBlobV1() throws MessageFormatException, IOException { short[] blobVersions = new short[5]; BlobType[] blobTypes = new BlobType[5]; for (int i = 0; i < 5; i++) { blobVersions[i] = MessageFormatRecord.Blob_Version_V1; blobTypes[i] = BlobType.DataBlob; } blobStoreHardDeleteTestUtil(blobVersions, blobTypes); }
Source:
<code>public void testChatStateListeners() throws Exception { ChatStateManager manOne = ChatStateManager.getInstance(conOne); ChatStateManager manTwo = ChatStateManager.getInstance(conTwo); Chat chatOne = ChatManager.getInstanceFor(conOne).chatWith(conTwo.getUser().asEntityBareJid()); final SimpleResultSyncPoint composingSyncPoint = new SimpleResultSyncPoint(); ChatStateListener composingListener = new ChatStateListener() { @Override public void stateChanged(Chat chat, ChatState state, Message message) { if (state.equals(ChatState.composing)) { composingSyncPoint.signal(); } } }; manTwo.addChatStateListener(composingListener); manOne.setCurrentState(ChatState.composing, chatOne); composingSyncPoint.waitForResult(10 * 1000); <START> manTwo.removeChatStateListener(composingListener); <END> final SimpleResultSyncPoint activeSyncPoint = new SimpleResultSyncPoint(); ChatStateListener activeListener = new ChatStateListener() { @Override public void stateChanged(Chat chat, ChatState state, Message message) { if (state.equals(ChatState.active)) { activeSyncPoint.signal(); } } }; manTwo.addChatStateListener(activeListener); Chat chat = ChatManager.getInstanceFor(conOne).chatWith(conTwo.getUser().asEntityBareJid()); chat.send("Hi!"); activeSyncPoint.waitForResult(10 * 1000); manTwo.removeChatStateListener(activeListener); }</code><technical_language>cleanup, removing listeners, done in @After annotated method, run of integration test throws</technical_language>

Target:
public void testChatStateListeners() throws Exception { ChatStateManager manOne = ChatStateManager.getInstance(conOne); ChatStateManager manTwo = ChatStateManager.getInstance(conTwo); manTwo.addChatStateListener(composingListener); manTwo.addChatStateListener(activeListener); Chat chatOne = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); manOne.setCurrentState(ChatState.composing, chatOne); composingSyncPoint.waitForResult(timeout); Chat chat = ChatManager.getInstanceFor(conOne) .chatWith(conTwo.getUser().asEntityBareJid()); chat.send("Hi!"); activeSyncPoint.waitForResult(timeout); }
Source:
<code><START> private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return !CollectionUtils .isEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName)); <END> }</code><technical_language>please isNotEmpty</technical_language>

Target:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return CollectionUtils .isNotEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName)); }