auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addDefaultBackends() { <START> try { <END> ResourcesPlugin.getWorkspace(); backends.add(new WorkspaceBackend(this)); } catch (IllegalStateException e) { } }</code><technical_language>remark in ViewpointRegistryImpl</technical_language>

Target:
private void addDefaultBackends() { IWorkspaceRoot workspaceRoot = EcorePlugin.getWorkspaceRoot(); if (workspaceRoot != null) { backends.add(new WorkspaceBackend(this)); } }
Source:
<code>public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); String tokenString = null; if (Token.PINYIN == token.type) { tokenString = token.target; } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } tokenString = token.source; } if (tokenString != null) { keyPinyin.insert(0, tokenString); if (i == tokenCount - 1 && tokenCount > 1) { keyInitial.insert(0, tokenString); } else { keyInitial.insert(0, tokenString.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); <START> keys.add(keyInitial.toString()); <END> } return keys.iterator(); }</code><technical_language>I code in patch 2 modify this line if (i != tokenCount - 1) { keys.add(keyInitial.toString()); }</technical_language>

Target:
public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); if (Token.PINYIN == token.type) { keyPinyin.insert(0, token.target); if (i == tokenCount - 1) { keyInitial.insert(0, token.target); } else { keyInitial.insert(0, token.target.charAt(0)); } } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } keyPinyin.insert(0, token.source); if (i == tokenCount - 1) { keyInitial.insert(0, token.source); } else { keyInitial.insert(0, token.source.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); if (i != tokenCount - 1) { keys.add(keyInitial.toString()); } } return keys.iterator(); }
Source:
<code>private Diagnostic checkView(IFile file) throws IOException { final VView view = ViewModelHelper.loadView(file, <START> new LinkedHashSet<String>()); <END> final VViewModelProperties properties = ViewModelPropertiesHelper.getInhertitedPropertiesOrEmpty(view); view.setLoadingProperties(properties); return Diagnostician.INSTANCE.validate(view); }</code><technical_language>list filled models registered. unregistered longer need them</technical_language>

Target:
private Optional<Diagnostic> checkView(IFile file) throws IOException { final LinkedHashSet<String> ecores = new LinkedHashSet<String>(); final VView view = ViewModelHelper.loadView(file, ecores); try { if (view != null) { final VViewModelProperties properties = ViewModelPropertiesHelper.getInhertitedPropertiesOrEmpty(view); view.setLoadingProperties(properties); return Optional.of(Diagnostician.INSTANCE.validate(view)); } return Optional.empty(); } finally { for (final String registeredEcore : ecores) { EcoreHelper.unregisterEcore(registeredEcore); } } }
Source:
<code>public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException { Class<?> targetClass = AopUtils.getTargetClass(bean); <START> final TypeMetadata metadata = this.typeCache.computeIfAbsent(targetClass, TypeMetadataHolder::new).get(); <END> for (ListenerMethod lm : metadata.methods) { for (RabbitListener rabbitListener : lm.listenerAnnotations) { processAmqpListener(rabbitListener, lm.method, bean, beanName); } } if (metadata.multiMethods.length > 0) { processMultiMethodListeners(metadata.classLevelListeners, metadata.multiMethods, bean, beanName); } return bean; }</code><technical_language>computeIfAbsent() if port it. Or... need more backport PR</technical_language>

Target:
public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException { Class<?> targetClass = AopUtils.getTargetClass(bean); final TypeMetadata metadata = this.typeCache.computeIfAbsent(targetClass, this::buildMetadata); for (ListenerMethod lm : metadata.listenerMethods) { for (RabbitListener rabbitListener : lm.annotations) { processAmqpListener(rabbitListener, lm.method, bean, beanName); } } if (metadata.handlerMethods.length > 0) { processMultiMethodListeners(metadata.classAnnotations, metadata.handlerMethods, bean, beanName); } return bean; }
Source:
<code>private void updateRowsRuler(int firstRowIndex, int firstRowPositionY, @Nullable List<String> rowsLabels) { if (rowsRuler != null && rowsLabels != null) { int distanceFromRuler = getVerticalDistanceOnScreen(rowsRuler); <START> rowsRuler.onLabelsChanged(rowsLabels, firstRowIndex, firstRowPositionY + distanceFromRuler, rowHeightPx); <END> } }</code><technical_language>I this in interface exposed TLM in Ruler directly. OnLabelChangeListener. I call columnLabelsChangeListener rowLabelsChangeListener leaking idea of ROW BOUND in names. for setters for listeners</technical_language>

Target:
private void updateRowsRuler(int firstRowIndex, int firstRowPositionY, @Nullable List<String> rowsLabels) { if (rowsRuler != null && rowsLabels != null) { int distanceFromRuler = getVerticalDistanceOnScreenFrom(rowsRuler); rowsRuler.onLabelsChanged(rowsLabels, firstRowIndex, firstRowPositionY + distanceFromRuler, rowHeightPx); } }
Source:
<code>public LocalDate getFirstAppearance() { if (super.isEmpty()) { return null; } LocalDate firstAppearance = super.get(0).getFirstAppearance(); for (int index = 1; index < super.size(); index++) { <START> LocalDate firstAppearance = super.get(index).getFirstAppearance(); <END> if (firstAppearance.isBefore(firstAppearance)) { firstAppearance = firstAppearance; } } return firstAppearance; }</code><technical_language>This compile: firstAppearance is defined</technical_language>

Target:
public LocalDate getFirstAppearance() { if (super.isEmpty()) { return null; } LocalDate firstAppearance = super.get(0).getFirstAppearance(); for (int index = 1; index < super.size(); index++) { LocalDate otherFirstAppearance = super.get(index).getFirstAppearance(); if (otherFirstAppearance.isBefore(firstAppearance)) { firstAppearance = otherFirstAppearance; } } return firstAppearance; }
Source:
<code>@Override public void close() { for (Map.Entry<String, JedisPool> entry : jedisPoolCache.asMap().entrySet()) { try { entry.getValue().destroy(); } catch (Exception e) { LOGGER.warn("While destroying JedisPool " + entry.getKey()); } <START> } <END> jedisPoolCache.invalidateAll(); }</code><technical_language>Do need L106~L112</technical_language>

Target:
@Override public void close() { jedisPoolCache.invalidateAll(); }
Source:
<code>private static Object convertAndResolveUnionToPrimitive(Schema schema, String key, String value) throws ParseException { Schema unionSchema = schema.getField(key).schema(); List<Schema> types = unionSchema.getTypes(); Object convertedValue = null; for (int i = 0; i < types.size(); i++) { try { if (types.get(i).getType() == Type.NULL) { if (value == null || value.equals("null")) { convertedValue = null; break; } else { continue; } } convertedValue = convertValueToAvroPrimitive(types.get(i).getType(), key, value); } catch (RuntimeException e) { <START> continue; <END> } break; } return convertedValue; }</code><technical_language>log exception</technical_language>

Target:
private static Object convertAndResolveUnionToPrimitive(Schema schema, String key, String value) throws ParseException { Schema unionSchema = schema.getField(key).schema(); List<Schema> types = unionSchema.getTypes(); Object convertedValue = null; for (int i = 0; i < types.size(); i++) { try { if (types.get(i).getType() == Type.NULL) { if (value == null || value.equals("null")) { convertedValue = null; break; } else { continue; } } convertedValue = convertValueToAvroPrimitive(types.get(i).getType(), key, value); } catch (RuntimeException e) { LOG.error("Could not handle schema resolution", e); continue; } break; } return convertedValue; }
Source:
<code>StagingArea(DefaultRevisionIndex index, String branchPath, ObjectMapper mapper) { this.index = index; this.branchPath = branchPath; this.mapper = mapper; <START> this.exclusions = Sets.newHashSet(); <END> reset(); }</code><technical_language>Collections.emptySet() for initialization</technical_language>

Target:
StagingArea(DefaultRevisionIndex index, String branchPath, ObjectMapper mapper) { this.index = index; this.branchPath = branchPath; this.mapper = mapper; this.exclusions = Collections.emptySet(); reset(); }
Source:
<code><START> private void encodeLocalizedTitles(Described entity, DBObject dbObject) { <END> Iterable<DBObject> localizedTitles = Iterables.transform(entity.getLocalizedTitles(), new Function<LocalizedTitle, DBObject>() { @Override public DBObject apply(LocalizedTitle input) { return localizedTitleTranslator.toDBObject(new BasicDBObject(), input); } }); dbObject.put(LOCALIZED_TITLES_KEY, localizedTitles); }</code><technical_language>Need ensure ordering, conversation re. hashcodes :)</technical_language>

Target:
private void encodeLocalizedTitles(Described entity, DBObject dbObject) { List<LocalizedTitle> sortedTitles = LOCALIZED_TITLE_ORDERING.sortedCopy(entity.getLocalizedTitles()); BasicDBList dbTitles = new BasicDBList(); for (LocalizedTitle localizedTitle: sortedTitles) { dbTitles.add(localizedTitleTranslator.toDBObject(new BasicDBObject(), localizedTitle)); } dbObject.put(LOCALIZED_TITLES_KEY, dbTitles); }
Source:
<code>public void scanFile(MavenFileScannerContext context) { MavenDependencyMatcher matcher; try { <START> matcher = MavenDependencyMatcher.withName(dependencyName).withVersion(version); <END> } catch (IllegalArgumentException e) { throw new IllegalArgumentException("[" + KEY + "] Unable to build matchers from provided dependency name: " + dependencyName, e); } for (Dependency dependency : new MavenDependencyCollector(context.getMavenProject()).allDependencies()) { if (matcher.matches(dependency)) { context.reportIssue(this, dependency, "Remove this forbidden dependency."); } } }</code><technical_language>odd reconstruct this object for single file... if matcher is stateless for matching (which should) built once</technical_language>

Target:
public void scanFile(MavenFileScannerContext context) { for (Dependency dependency : new MavenDependencyCollector(context.getMavenProject()).allDependencies()) { if (getMatcher().matches(dependency)) { context.reportIssue(this, dependency, "Remove this forbidden dependency."); } } }
Source:
<code><START> public PagedFlux<PeekedMessageItem> peekMessage() { <END> try { return peekMessages(null); } catch (RuntimeException ex) { return pagedFluxError(logger, ex); } }</code><technical_language>here. this a Mono instead of a PagedFlux returning a single message</technical_language>

Target:
public Mono<PeekedMessageItem> peekMessage() { try { return peekMessages(null).single(); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public Plan optimize(final Collection<EvaluatorParameters> activeEvaluators, final int availableEvaluators) { if (callsSkipped < callsToSkip) { callsSkipped++; return PlanImpl.newBuilder().build(); } if (callsMade == maxCallsToMake) { return PlanImpl.newBuilder().build(); } final String evaluatorToAdd = "new-" + callsMade; callsMade++; EvaluatorParameters srcEvaluator = null; for (final EvaluatorParameters evaluator : activeEvaluators) { if (!evaluator.getDataInfos().isEmpty()) { srcEvaluator = evaluator; break; } } if (srcEvaluator == null) { <START> return PlanImpl.newBuilder().build(); <END> } final DataInfo srcDataInfo = srcEvaluator.getDataInfos().iterator().next(); final int numUnitsToMove = srcDataInfo.getNumUnits() / 2; final TransferStep transferStep = new TransferStepImpl( srcEvaluator.getId(), evaluatorToAdd, new DataInfoImpl(srcDataInfo.getDataType(), numUnitsToMove)); return PlanImpl.newBuilder() .addEvaluatorToAdd(evaluatorToAdd) .addTransferStep(transferStep) .build(); }</code><technical_language>add more evaluator if evaluator data? generating a plan evaluator add, transfer step</technical_language>

Target:
public Plan optimize(final Collection<EvaluatorParameters> activeEvaluators, final int availableEvaluators) { if (callsSkipped < callsToSkip) { callsSkipped++; return PlanImpl.newBuilder().build(); } if (callsMade == maxCallsToMake) { return PlanImpl.newBuilder().build(); } final String evaluatorToAdd = "new-" + callsMade; callsMade++; EvaluatorParameters srcEvaluator = null; for (final EvaluatorParameters evaluator : activeEvaluators) { if (!evaluator.getDataInfos().isEmpty()) { srcEvaluator = evaluator; break; } } if (srcEvaluator == null) { return PlanImpl.newBuilder() .addEvaluatorToAdd(evaluatorToAdd) .build(); } final DataInfo srcDataInfo = srcEvaluator.getDataInfos().iterator().next(); final int numUnitsToMove = srcDataInfo.getNumUnits() / 2; final TransferStep transferStep = new TransferStepImpl( srcEvaluator.getId(), evaluatorToAdd, new DataInfoImpl(srcDataInfo.getDataType(), numUnitsToMove)); return PlanImpl.newBuilder() .addEvaluatorToAdd(evaluatorToAdd) .addTransferStep(transferStep) .build(); }
Source:
<code>public InterpreterClient launch(InterpreterLaunchContext context) throws IOException { LOGGER.info("Launching Interpreter: " + context.getInterpreterSettingGroup()); this.context = context; this.properties = context.getProperties(); int connectTimeout = getConnectTimeout(); <START> if (connectTimeout < 200000) { <END> LOGGER.info("DockerInterpreterLauncher needs to pull the image and create the container, " + "it takes a long time, so the force is set to 200 seconds."); connectTimeout = 200000; } StandardInterpreterLauncher interpreterLauncher = null; if (isSpark()) { interpreterLauncher = new SparkInterpreterLauncher(zConf, recoveryStorage); } else { interpreterLauncher = new StandardInterpreterLauncher(zConf, recoveryStorage); } interpreterLauncher.setProperties(context.getProperties()); Map<String, String> env = interpreterLauncher.buildEnvFromProperties(context); return new DockerInterpreterProcess( zConf, zConf.getDockerContainerImage(), context.getInterpreterGroupId(), context.getInterpreterSettingGroup(), context.getInterpreterSettingName(), properties, env, context.getZeppelinServerHost(), Integer.toString(context.getZeppelinServerRPCPort()), connectTimeout); }</code><technical_language>provide option for this configuration. Sometimes, 200 seconds is enough</technical_language>

Target:
public InterpreterClient launch(InterpreterLaunchContext context) throws IOException { LOGGER.info("Launching Interpreter: " + context.getInterpreterSettingGroup()); this.context = context; this.properties = context.getProperties(); int connectTimeout = getConnectTimeout(); if (connectTimeout < 200000) { LOGGER.warn("DockerInterpreterLauncher needs to pull the image and create the container, " + "it takes a long time, If the creation of the interpreter on docker fails, " + "please increase the value of `zeppelin.interpreter.connect.timeout` " + "in `zeppelin-site.xml`, recommend 200 seconds."); } StandardInterpreterLauncher interpreterLauncher = null; if (isSpark()) { interpreterLauncher = new SparkInterpreterLauncher(zConf, recoveryStorage); } else { interpreterLauncher = new StandardInterpreterLauncher(zConf, recoveryStorage); } interpreterLauncher.setProperties(context.getProperties()); Map<String, String> env = interpreterLauncher.buildEnvFromProperties(context); return new DockerInterpreterProcess( zConf, zConf.getDockerContainerImage(), context.getInterpreterGroupId(), context.getInterpreterSettingGroup(), context.getInterpreterSettingName(), properties, env, context.getZeppelinServerHost(), Integer.toString(context.getZeppelinServerRPCPort()), connectTimeout); }
Source:
<code><START> static private String requireNonNull(String required, String message) throws ConfigurationRuntimeException { <END> if (required == null) throw new ConfigurationRuntimeException(message); return required; }</code><technical_language>Aaron said. This is needed</technical_language>

Target:
private static String requireNonNull(String required, String message) throws ConfigurationRuntimeException { if (required == null) throw new ConfigurationRuntimeException(message); return required; }
Source:
<code>public static MultipartUploadResponse create(String accountId, String bucketId, String contentType, String fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp) { <START> return new AutoValue_MultipartUploadResponse(accountId, bucketId, contentType, fileId, fileInfo, fileName, new Date(uploadTimestamp)); <END> }</code><technical_language>fileInfo map immutable</technical_language>

Target:
public static MultipartUploadResponse create(String accountId, String bucketId, String contentType, String fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp) { return new AutoValue_MultipartUploadResponse(accountId, bucketId, contentType, fileId, ImmutableMap.copyOf(fileInfo), fileName, new Date(uploadTimestamp)); }
Source:
<code>public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, apiAuthenticationHelper::checkAdminUserAnd403); before("/*", mimeType, apiAuthenticationHelper::checkAdminUserAnd403); get("", mimeType, this::index); get(Routes.Environments.NAME, mimeType, this::show); post("", mimeType, this::create); put(Routes.Environments.NAME, mimeType, this::update); patch(Routes.Environments.NAME, mimeType, this::partialUpdate); delete(Routes.Environments.NAME, mimeType, this::remove); <START> exception(InvalidGoCipherTextRuntimeException.class, (InvalidGoCipherTextRuntimeException exception, Request request, Response response) -> { <END> response.status(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.body(MessageJson.create(HaltApiMessages.errorWhileEncryptingMessage())); }); exception(HttpException.class, this::httpException); }); }</code><technical_language>Move this of <LINK_1> mentioned in <LINK_0></technical_language>

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, apiAuthenticationHelper::checkAdminUserAnd403); before("/*", mimeType, apiAuthenticationHelper::checkAdminUserAnd403); get("", mimeType, this::index); get(Routes.Environments.NAME, mimeType, this::show); post("", mimeType, this::create); put(Routes.Environments.NAME, mimeType, this::update); patch(Routes.Environments.NAME, mimeType, this::partialUpdate); delete(Routes.Environments.NAME, mimeType, this::remove); exception(HttpException.class, this::httpException); }); }
Source:
<code>public int compare(FileEntry o1, FileEntry o2) { <START> return (o1.offset - o2.offset) > 0 ? -1 : 1; <END> }</code><technical_language>Also, zero comparison covered</technical_language>

Target:
public int compare(FileEntry o1, FileEntry o2) { long diff = o1.offset - o2.offset; return (diff == 0) ? 0 : ((diff > 0) ? -1 : 1); }
Source:
<code>protected StreamComponentDefinition determineUpstreamStreamComponentDefinition(final EvaluatorContext context) throws NotFoundException { final StreamComponentDefinition assumedDownstreamToMatch = context.getStreamComponentDefinition(); if(!assumedDownstreamToMatch.isFound() || !assumedDownstreamToMatch.getStreamDefinition().isFound() || assumedDownstreamToMatch.getStreamDefinition().getStream().getUpstream() == null) return null; final StreamDefinition upstreamStreamDef = new StreamDefinition(assumedDownstreamToMatch.getStreamDefinition().getStream().getUpstream().getName(), assumedDownstreamToMatch.getName()); final ArrayList<StreamDefinition> tmp = new ArrayList<>(); tmp.add(upstreamStreamDef); <START> StreamDefinitionUtil.matchStreams(context.getAphrodite(), tmp); <END> return upstreamStreamDef.getStreamComponents().get(0); }</code><technical_language>do StreamDefinitionUtil.matchStreams(context.getAphrodite(), Arrays.asList(upstreamStreamDef)); remove tmp list</technical_language>

Target:
protected StreamComponentDefinition determineUpstreamStreamComponentDefinition(final EvaluatorContext context) throws NotFoundException { final StreamComponentDefinition assumedDownstreamToMatch = context.getStreamComponentDefinition(); if(!assumedDownstreamToMatch.isFound() || !assumedDownstreamToMatch.getStreamDefinition().isFound() || assumedDownstreamToMatch.getStreamDefinition().getStream().getUpstream() == null) return null; final StreamDefinition upstreamStreamDef = new StreamDefinition(assumedDownstreamToMatch.getStreamDefinition().getStream().getUpstream().getName(), assumedDownstreamToMatch.getName()); StreamDefinitionUtil.matchStreams(context.getAphrodite(), Arrays.asList(upstreamStreamDef)); return upstreamStreamDef.getStreamComponents().get(0); }
Source:
<code>public void updateInPerspective(ActionEvent event) { Optional<DebugConfiguration> configurationOptional = configurationsManager.getCurrentDebugConfiguration(); if (configurationOptional.isPresent() && configuration.equals(configurationOptional.get())) { <START> event.getPresentation().setVisible(false); <END> } else { event.getPresentation().setVisible(true); } }</code><technical_language>event.getPresentation().setVisible(<expression>) instead of if (<expression>) { event.getPresentation().setVisible(false) } else { event.getPresentation().setVisible(true) }</technical_language>

Target:
public void updateInPerspective(ActionEvent event) { Optional<DebugConfiguration> configurationOptional = configurationsManager.getCurrentDebugConfiguration(); boolean isCurrentConfig = configurationOptional.isPresent() && configuration.equals(configurationOptional.get()); event.getPresentation().setEnabledAndVisible(!isCurrentConfig); }
Source:
<code>public static Branch getWorkingBranch(TeamWorkFlowArtifact teamArt, boolean force) throws OseeCoreException { long now = new Date().getTime(); boolean notSet = hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) == null; if (notSet || force || (now - hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) > 1000)) { hridToWorkingBranchCache.put(teamArt.getHumanReadableId(), <START> getWorkingBranchExcludeStates(teamArt, BranchState.REBASELINED, BranchState.DELETED, BranchState.PURGED)); <END> hridToWorkingBranchCacheUpdated.put(teamArt.getHumanReadableId(), now); } return hridToWorkingBranchCache.get(teamArt.getHumanReadableId()); }</code><technical_language>include branches in of "IN_PROGRESS" states</technical_language>

Target:
public static Branch getWorkingBranch(TeamWorkFlowArtifact teamArt, boolean force) throws OseeCoreException { long now = new Date().getTime(); boolean notSet = hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) == null; if (notSet || force || (now - hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) > 1000)) { hridToWorkingBranchCache.put( teamArt.getHumanReadableId(), getWorkingBranchExcludeStates(teamArt, BranchState.REBASELINED, BranchState.DELETED, BranchState.PURGED, BranchState.COMMIT_IN_PROGRESS, BranchState.CREATION_IN_PROGRESS, BranchState.DELETE_IN_PROGRESS, BranchState.PURGE_IN_PROGRESS)); hridToWorkingBranchCacheUpdated.put(teamArt.getHumanReadableId(), now); } return hridToWorkingBranchCache.get(teamArt.getHumanReadableId()); }
Source:
<code>public void testInvalidMessageFormatInSqlFile() throws Exception { final DefaultConfiguration filterCfg = createModuleConfig(SuppressWithPlainTextCommentFilter.class); filterCfg.addAttribute("onCommentFormat", "CSON (\\w+)"); filterCfg.addAttribute("messageFormat", "e[l"); final DefaultConfiguration checkCfg = createModuleConfig(RegexpSinglelineCheck.class); checkCfg.addAttribute("format", "^.*COUNT\\(\\*\\).*$"); checkCfg.addAttribute("message", "Don''t use COUNT(*), use COUNT(1) instead."); final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; final String[] violationMessages = { <START> "2: Don't use COUNT(*), use COUNT(1) instead.", <END> }; try { verifySuppressed( "InputSuppressWithPlainTextCommentFilterWithCustomOnComment.sql", removeSuppressed(violationMessages, suppressed), filterCfg, checkCfg ); fail("CheckstyleException is expected"); } catch (CheckstyleException ex) { final IllegalArgumentException cause = (IllegalArgumentException) ex.getCause(); assertEquals("Invalid exception message", "unable to parse expanded comment e[l", cause.getMessage()); } }</code><technical_language>Please move message variable reuse in places</technical_language>

Target:
public void testInvalidMessageFormatInSqlFile() throws Exception { final DefaultConfiguration filterCfg = createModuleConfig(SuppressWithPlainTextCommentFilter.class); filterCfg.addAttribute("onCommentFormat", "CSON (\\w+)"); filterCfg.addAttribute("messageFormat", "e[l"); final DefaultConfiguration checkCfg = createModuleConfig(RegexpSinglelineCheck.class); checkCfg.addAttribute("format", "^.*COUNT\\(\\*\\).*$"); final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; final String[] violationMessages = { "2: " + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, "^.*COUNT\\(\\*\\).*$"), }; try { verifySuppressed( "InputSuppressWithPlainTextCommentFilterWithCustomOnComment.sql", removeSuppressed(violationMessages, suppressed), filterCfg, checkCfg ); fail("CheckstyleException is expected"); } catch (CheckstyleException ex) { final IllegalArgumentException cause = (IllegalArgumentException) ex.getCause(); assertEquals("Invalid exception message", "unable to parse expanded comment e[l", cause.getMessage()); } }
Source:
<code>public void refresh() { String labelExpression = this.description.getLabelExpression(); EAttribute eAttribute = EefPackage.Literals.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION; this.newEval().call(eAttribute, labelExpression, String.class, new ISuccessfulResultConsumer<String>() { @Override public void apply(String value) { EEFGroupController.this.newLabelConsumer.apply(value); } }); <START> List<IValidationRuleResult> validationRuleResults = new ArrayList<IValidationRuleResult>(); EAttribute auditEAttribute = EefPackage.Literals.EEF_RULE_AUDIT_DESCRIPTION__AUDIT_EXPRESSION; EAttribute messageEAttribute = EefPackage.Literals.EEF_VALIDATION_RULE_DESCRIPTION__MESSAGE_EXPRESSION; for (EEFSemanticValidationRuleDescription semanticValidationRule : this.description.getSemanticValidationRules()) { boolean isValid = true; for (EEFRuleAuditDescription audit : semanticValidationRule.getAudits()) { String auditExpression = audit.getAuditExpression(); Boolean result = this.newEval().get(auditEAttribute, auditExpression, Boolean.class); isValid = isValid && (result != null && result.booleanValue()); if (!isValid) { break; } } if (isValid) { validationRuleResults.add(new ValidationRuleResult(semanticValidationRule)); } else { String messageExpression = semanticValidationRule.getMessageExpression(); String message = this.newEval().get(messageEAttribute, messageExpression, String.class); validationRuleResults.add(new InvalidValidationRuleResult(semanticValidationRule, message, null, semanticValidationRule.getSeverity() .getValue())); } } this.validationConsumer.apply(validationRuleResults); <END> }</code><technical_language>code exists in abstract widget controller, merge</technical_language>

Target:
public void refresh() { super.refresh(); String labelExpression = this.description.getLabelExpression(); EAttribute eAttribute = EefPackage.Literals.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION; this.newEval().call(eAttribute, labelExpression, String.class, new ISuccessfulResultConsumer<String>() { @Override public void apply(String value) { EEFGroupController.this.newLabelConsumer.apply(value); } }); }
Source:
<code>private Boolean savedAccountQuestion(final Long accountId, final Question question, final DateTime created) { final List<AccountQuestion> questions = questionResponseReadDAO.getAskedQuestionByQuestionIdCreatedDate(accountId, question.id, created); if (questions.isEmpty()) { <START> return Boolean.FALSE; <END> } else { LOGGER.info("event=multiple_question_impression account_id={} question_id={} usr_local_utc_date={}", accountId, question.id, created); return Boolean.TRUE; } }</code><technical_language>if inverse condition get rid of if/else</technical_language>

Target:
private Boolean savedAccountQuestion(final Long accountId, final Question question, final DateTime created) { final List<AccountQuestion> questions = questionResponseReadDAO.getAskedQuestionByQuestionIdCreatedDate(accountId, question.id, created); return !questions.isEmpty(); }
Source:
<code>protected void applyCenterCrop(@NonNull TextureView view, @NonNull Matrix transformMatrix) { float xScale = (float)view.getWidth() / intrinsicVideoSize.x; float yScale = (float)view.getHeight() / intrinsicVideoSize.y; float scale = Math.max(xScale, yScale); <START> xScale = scale / xScale; <END> yScale = scale / yScale; applyScale(view, transformMatrix, xScale, yScale); }</code><technical_language>dividing calculate maxScale? This inconsistent scaling (stretching)</technical_language>

Target:
protected void applyCenterCrop(@NonNull TextureView view, @NonNull Matrix transformMatrix) { float xScale = (float)view.getWidth() / intrinsicVideoSize.x; float yScale = (float)view.getHeight() / intrinsicVideoSize.y; float scale = Math.max(xScale, yScale); applyScale(view, transformMatrix, scale, scale); }
Source:
<code>void testNonJapanAttack() { advanceToStep(bridge, "japaneseEndTurn"); advanceToStep(bridge, "japaneseBattle"); final List<Unit> infantryUs = infantry.create(1, americans); final Collection<TerritoryEffect> territoryEffects = TerritoryEffectHelper.getEffects(queensland); whenGetRandom(bridge) .thenAnswer(withValues(1)) .thenAnswer(withValues(1)) .thenAnswer(withValues(1)); DiceRoll roll = DiceRoll.rollDice( infantryUs, true, americans, bridge, mock(IBattle.class), "", territoryEffects, null, <START> infantryUs); <END> assertEquals(1, roll.getHits()); final List<Unit> marineUs = marine.create(1, americans); roll = DiceRoll.rollDice( marineUs, true, americans, bridge, mock(IBattle.class), "", territoryEffects, null, infantryUs); assertEquals(1, roll.getHits()); final List<Unit> infantryChina = infantry.create(1, chinese); roll = DiceRoll.rollDice( infantryChina, true, chinese, bridge, mock(IBattle.class), "", territoryEffects, null, infantryUs); assertEquals(1, roll.getHits()); }</code><technical_language>striking parameter passed in a method. IMHO is a pretty significant API code smell. extract parameter object refactor fix that? IMO existing API significant technical debt, I is fair reason add more potential debt for else attempt fix. notable a number of other parameters useless, this API is stretched</technical_language>

Target:
void testNonJapanAttack() { advanceToStep(bridge, "japaneseEndTurn"); advanceToStep(bridge, "japaneseBattle"); final List<Unit> infantryUs = infantry.create(1, americans); final Collection<TerritoryEffect> territoryEffects = TerritoryEffectHelper.getEffects(queensland); whenGetRandom(bridge) .thenAnswer(withValues(1)) .thenAnswer(withValues(1)) .thenAnswer(withValues(1)); DiceRoll roll = DiceRoll.rollDice( infantryUs, true, americans, bridge, mock(IBattle.class), territoryEffects); assertEquals(1, roll.getHits()); final List<Unit> marineUs = marine.create(1, americans); roll = DiceRoll.rollDice(marineUs, true, americans, bridge, mock(IBattle.class), territoryEffects); assertEquals(1, roll.getHits()); final List<Unit> infantryChina = infantry.create(1, chinese); roll = DiceRoll.rollDice( infantryChina, true, chinese, bridge, mock(IBattle.class), territoryEffects); assertEquals(1, roll.getHits()); }
Source:
<code>private static void runMemoryTest(ITmfTrace[] testTraces, String testName, int loop_count) { Performance perf = Performance.getDefault(); PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + MEMORY + '#' + testName); perf.tagAsSummary(pm, TEST_SUMMARY + MEMORY + ':' + testName, Dimension.CPU_TIME); for (int i = 0; i < loop_count; i++) { TmfExperiment experiment = new TmfExperiment(CtfTmfEvent.class, "Test experiment", testTraces, BLOCK_SIZE); <START> <END> pm.start(); try { experiment.synchronizeTraces(true); } catch (TmfTraceException e) { fail("Failed at iteration " + i + " with message: " + e.getMessage()); } pm.stop(); } pm.commit(); }</code><technical_language>System.gc() before/after</technical_language>

Target:
private static void runMemoryTest(ITmfTrace[] testTraces, String testName, int loop_count) { Performance perf = Performance.getDefault(); PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + MEMORY + '#' + testName); perf.tagAsSummary(pm, TEST_SUMMARY + MEMORY + ':' + testName, Dimension.USED_JAVA_HEAP); for (int i = 0; i < loop_count; i++) { TmfExperiment experiment = new TmfExperiment(CtfTmfEvent.class, "Test experiment", testTraces, BLOCK_SIZE); System.gc(); pm.start(); try { experiment.synchronizeTraces(true); } catch (TmfTraceException e) { fail("Failed at iteration " + i + " with message: " + e.getMessage()); } System.gc(); pm.stop(); } pm.commit(); }
Source:
<code>public Collection<VocabularyTerm> getAssociatedTerms(Double standardDeviation) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsAssociatedTerms"); List<VocabularyTerm> terms = new ArrayList<>(); if (null == standardDeviation || standardDeviation <= -3) { addResolvedTermsToList(configuration, this.getName(), "extremeBelowNormal", terms); } <START> if (null == standardDeviation || standardDeviation <= -2) { <END> addResolvedTermsToList(configuration, this.getName(), "belowNormal", terms); } if (null == standardDeviation || standardDeviation >= 2) { addResolvedTermsToList(configuration, this.getName(), "aboveNormal", terms); } if (null == standardDeviation || standardDeviation >= 3) { addResolvedTermsToList(configuration, this.getName(), "extremeAboveNormal", terms); } return terms; }</code><technical_language>need repeating null checks. caught one. If want, initially do java if (standardDeviation == null) { standardDeviation = Double.NEGATIVE_INFINITY }</technical_language>

Target:
public Collection<VocabularyTerm> getAssociatedTerms(Double standardDeviation) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsAssociatedTerms"); List<String> configKeys; if (standardDeviation != null) { configKeys = new LinkedList<>(); if (standardDeviation <= -3) { configKeys.add(MeasurementUtils.FUZZY_VALUE_TO_CONFIG_KEY.get( MeasurementUtils.VALUE_EXTREME_BELOW_NORMAL)); } if (standardDeviation <= -2) { configKeys.add(MeasurementUtils.FUZZY_VALUE_TO_CONFIG_KEY.get( MeasurementUtils.VALUE_BELOW_NORMAL)); } if (standardDeviation >= 2) { configKeys.add(MeasurementUtils.FUZZY_VALUE_TO_CONFIG_KEY.get( MeasurementUtils.VALUE_ABOVE_NORMAL)); } if (standardDeviation >= 3) { configKeys.add(MeasurementUtils.FUZZY_VALUE_TO_CONFIG_KEY.get( MeasurementUtils.VALUE_EXTREME_ABOVE_NORMAL)); } } else { configKeys = new LinkedList<>(MeasurementUtils.FUZZY_VALUE_TO_CONFIG_KEY.values()); } List<VocabularyTerm> terms = new ArrayList<>(); for (String key : configKeys) { terms.addAll(getResolvedTermsForConfigKey(configuration, this.getName(), key)); } return terms; }
Source:
<code>public void migrateIfNecessary_1_4_to_1_5() throws Exception { <START> String toMigrate = getFileContent("scesim-1-3-rule.scesim"); <END> assertTrue(toMigrate.contains("dmoSession")); String migrated = instance.migrateIfNecessary(toMigrate); assertTrue(migrated.contains("<ScenarioSimulationModel version=\"" + currentVersion + "\">")); assertTrue(!migrated.contains("dmoSession")); }</code><technical_language>I need file version 1.4. inside</technical_language>

Target:
public void migrateIfNecessary_1_4_to_1_5() throws Exception { String toMigrate = getFileContent("scesim-1-3-rule.scesim"); assertTrue(toMigrate.contains("dmoSession")); String migrated = instance.migrateIfNecessary(toMigrate); assertFalse(migrated.contains("<ScenarioSimulationModel version=\"1.3\">")); assertFalse(migrated.contains("<ScenarioSimulationModel version=\"1.4\">")); assertTrue(migrated.contains("<ScenarioSimulationModel version=\"" + currentVersion + "\">")); assertTrue(!migrated.contains("dmoSession")); }
Source:
<code>public List<String> checkGlusterQuorum(Cluster cluster, Iterable<Guid> selectedHostIdsForMaintenance) { List<String> volumesWithoutQuorum = new ArrayList<>(); if (cluster.supportsGlusterService()) { List<GlusterBrickEntity> bricksGoingToMaintenance = new ArrayList<>(); for (Guid serverId : selectedHostIdsForMaintenance) { bricksGoingToMaintenance.addAll(getGlusterBrickDao().getGlusterVolumeBricksByServerId(serverId)); } <START> List<GlusterVolumeEntity> volumesInCluster = getGlusterVolumeDao().getByClusterId(cluster.getId()); <END> for (GlusterVolumeEntity volume : volumesInCluster) { if (volume.getStatus() == GlusterStatus.UP && volume.getVolumeType().isReplicatedType() && !isQuorumMet(volume, bricksGoingToMaintenance)) { volumesWithoutQuorum.add(volume.getName()); } } } return volumesWithoutQuorum; }</code><technical_language>please formatter - lines in this file exceeds 120 chars</technical_language>

Target:
public List<String> checkGlusterQuorum(Cluster cluster, Iterable<Guid> selectedHostIdsForMaintenance) { List<String> volumesWithoutQuorum = new ArrayList<>(); if (cluster.supportsGlusterService()) { List<GlusterBrickEntity> bricksGoingToMaintenance = new ArrayList<>(); for (Guid serverId : selectedHostIdsForMaintenance) { bricksGoingToMaintenance.addAll(brickDao.getGlusterVolumeBricksByServerId(serverId)); } List<GlusterVolumeEntity> volumesInCluster = volumeDao.getByClusterId(cluster.getId()); volumesWithoutQuorum = volumesInCluster.stream() .filter(volume -> volume.getStatus() == GlusterStatus.UP && volume.getVolumeType().isReplicatedType() && !isQuorumMet(volume, bricksGoingToMaintenance)) .map(v -> v.getName()) .collect(Collectors.toList()); } return volumesWithoutQuorum; }
Source:
<code>private AggregationInfo buildAggregationInfo(Function function) { List<Expression> operands = function.getOperands(); if (operands == null || operands.isEmpty()) { throw new Pql2CompilationException("Aggregation function expects non null argument"); } List<String> args = new ArrayList<>(operands.size()); String functionName = function.getOperator(); if (functionName.equalsIgnoreCase(AggregationFunctionType.COUNT.getName())) { args = Collections.singletonList("*"); } else { if (functionName.equalsIgnoreCase(AggregationFunctionType.DISTINCT.getName())) { <START> Set<String> expressionSet = new HashSet<>(); <END> for (Expression operand : operands) { String expression = getColumnExpression(operand); if (expressionSet.add(expression)) { args.add(expression); } } } else { for (Expression operand : operands) { args.add(getColumnExpression(operand)); } } } AggregationInfo aggregationInfo = new AggregationInfo(); aggregationInfo.setAggregationType(functionName); aggregationInfo.setAggregationFunctionArgs(args); aggregationInfo.setIsInSelectList(true); return aggregationInfo; }</code><technical_language>maintain order</technical_language>

Target:
private AggregationInfo buildAggregationInfo(Function function) { List<Expression> operands = function.getOperands(); if (operands == null || operands.isEmpty()) { throw new Pql2CompilationException("Aggregation function expects non null argument"); } List<String> args = new ArrayList<>(operands.size()); String functionName = function.getOperator(); if (functionName.equalsIgnoreCase(AggregationFunctionType.COUNT.getName())) { args = Collections.singletonList("*"); } else { if (functionName.equalsIgnoreCase(AggregationFunctionType.DISTINCT.getName())) { Set<String> expressionSet = new TreeSet<>(); for (Expression operand : operands) { String expression = getColumnExpression(operand); if (expressionSet.add(expression)) { args.add(expression); } } } else { for (Expression operand : operands) { args.add(getColumnExpression(operand)); } } } AggregationInfo aggregationInfo = new AggregationInfo(); aggregationInfo.setAggregationType(functionName); aggregationInfo.setExpressions(args); aggregationInfo.setIsInSelectList(true); return aggregationInfo; }
Source:
<code>public static Optional<HiveBucketFilter> getHiveBucketFilter(Table table, TupleDomain<ColumnHandle> effectivePredicate) { Optional<HiveBucketProperty> hiveBucketProperty = table.getStorage().getBucketProperty(); <START> if (!hiveBucketProperty.isPresent() || !hiveBucketProperty.get().getBucketFunctionType().equals(HIVE_COMPATIBLE)) { <END> return Optional.empty(); } Optional<Map<ColumnHandle, Set<NullableValue>>> bindings = TupleDomain.extractFixedValueSets(effectivePredicate); if (!bindings.isPresent()) { return Optional.empty(); } Optional<Set<Integer>> buckets = getHiveBuckets(table, bindings.get()); if (buckets.isPresent()) { return Optional.of(new HiveBucketFilter(buckets.get())); } if (!effectivePredicate.getDomains().isPresent()) { return Optional.empty(); } Optional<Domain> domain = effectivePredicate.getDomains().get().entrySet().stream() .filter(entry -> ((HiveColumnHandle) entry.getKey()).getName().equals(BUCKET_COLUMN_NAME)) .findFirst() .map(Entry::getValue); if (!domain.isPresent()) { return Optional.empty(); } ValueSet values = domain.get().getValues(); ImmutableSet.Builder<Integer> builder = ImmutableSet.builder(); int bucketCount = table.getStorage().getBucketProperty().get().getBucketCount(); for (int i = 0; i < bucketCount; i++) { if (values.containsValue((long) i)) { builder.add(i); } } return Optional.of(new HiveBucketFilter(builder.build())); }</code><technical_language>safe ignore. add assertion getBucketFunctionType().equals(HIVE_COMPATIBLE)</technical_language>

Target:
public static Optional<HiveBucketFilter> getHiveBucketFilter(Table table, TupleDomain<ColumnHandle> effectivePredicate) { Optional<HiveBucketProperty> hiveBucketProperty = table.getStorage().getBucketProperty(); if (!hiveBucketProperty.isPresent()) { return Optional.empty(); } if (!hiveBucketProperty.get().getBucketFunctionType().equals(HIVE_COMPATIBLE)) { return Optional.empty(); } Optional<Map<ColumnHandle, Set<NullableValue>>> bindings = TupleDomain.extractFixedValueSets(effectivePredicate); if (!bindings.isPresent()) { return Optional.empty(); } Optional<Set<Integer>> buckets = getHiveBuckets(table, bindings.get()); if (buckets.isPresent()) { return Optional.of(new HiveBucketFilter(buckets.get())); } if (!effectivePredicate.getDomains().isPresent()) { return Optional.empty(); } Optional<Domain> domain = effectivePredicate.getDomains().get().entrySet().stream() .filter(entry -> ((HiveColumnHandle) entry.getKey()).getName().equals(BUCKET_COLUMN_NAME)) .findFirst() .map(Entry::getValue); if (!domain.isPresent()) { return Optional.empty(); } ValueSet values = domain.get().getValues(); ImmutableSet.Builder<Integer> builder = ImmutableSet.builder(); int bucketCount = table.getStorage().getBucketProperty().get().getBucketCount(); for (int i = 0; i < bucketCount; i++) { if (values.containsValue((long) i)) { builder.add(i); } } return Optional.of(new HiveBucketFilter(builder.build())); }
Source:
<code>private void setVmLeasesAvailability() { TModel model = getModel(); Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { <START> model.getLease().setIsChangeable(vmLeasesSupported, constants.vmLeasesSupported()); <END> } else { model.getLease().setIsChangeable(model.getIsHighlyAvailable().getEntity()); } }</code><technical_language>explicitly 'false'</technical_language>

Target:
private void setVmLeasesAvailability() { TModel model = getModel(); Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { model.getLease().setIsChangeable(false, constants.vmLeasesSupported()); } else { model.getLease().setIsChangeable(model.getIsHighlyAvailable().getEntity()); } }
Source:
<code>ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Specify them using InputDescriptors instead. Ignoring configured task.inputs value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } <START> MapConfig generatedJobConfigs = JobConfigUtil.generateJobIdAndName(new MapConfig(allowedUserConfig)); <END> allowedUserConfig.putAll(generatedJobConfigs); Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }</code><technical_language>this is correct. job name id generated for jobs here. This logic work if split app multiple jobs. job name id set correctly in JobNode</technical_language>

Target:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Specify them using InputDescriptors instead. Ignoring configured task.inputs value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }
Source:
<code>public static String appendClause(String query, String clause) { <START> if (StringUtils.isEmpty(query)) { <END> return clause; } else if (StringUtils.isEmpty(clause)) { return query; } else { return query + " AND " + clause; } }</code><technical_language>I isBlank</technical_language>

Target:
public static String appendClause(String query, String clause) { if (StringUtils.isBlank(query)) { return clause; } else if (StringUtils.isBlank(clause)) { return query; } else { return query + " AND " + clause; } }