auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) { <START> if (channel instanceof DirectChannel) { <END> afterMessageHandled(message, channel, null, ex); } Message<?> retrievedMessage = getMessage(message); MessageBuilder<?> messageBuilder = MessageBuilder.fromMessage(retrievedMessage); Span currentSpan = getTracer().isTracing() ? getTracer().getCurrentSpan() : buildSpan(new MessagingTextMap(messageBuilder)); if (log.isDebugEnabled()) { log.debug("Completed sending and current span is " + currentSpan); } getTracer().continueSpan(currentSpan); if (currentSpan != null) { if (log.isDebugEnabled()) { log.debug("Marking span with client received"); } currentSpan.logEvent(Span.CLIENT_RECV); } addErrorTag(ex); if (log.isDebugEnabled()) { log.debug("Closing messaging span " + currentSpan); } getTracer().close(currentSpan); if (log.isDebugEnabled()) { log.debug("Messaging span " + currentSpan + " successfully closed"); } }</code><technical_language>I good. channel AOP proxy, access target class. other AbstractMessageChannel tracing candidates well. In other words check for channel types *interceptable*. In feeling like: if (!(channel instanceof InterceptableChannel) && !(channel instanceof ExecutorChannelInterceptorAware) && channel instanceof ChannelInterceptorAware) No, classes check, interfaces! cases covered. InterceptableChannel ExecutorChannelInterceptorAware works is this fix though. WDYT</technical_language>

Target:
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) { if (isDirectChannel(channel)) { afterMessageHandled(message, channel, null, ex); } Message<?> retrievedMessage = getMessage(message); MessageBuilder<?> messageBuilder = MessageBuilder.fromMessage(retrievedMessage); Span currentSpan = getTracer().isTracing() ? getTracer().getCurrentSpan() : buildSpan(new MessagingTextMap(messageBuilder)); if (log.isDebugEnabled()) { log.debug("Completed sending and current span is " + currentSpan); } getTracer().continueSpan(currentSpan); if (currentSpan != null) { if (log.isDebugEnabled()) { log.debug("Marking span with client received"); } currentSpan.logEvent(Span.CLIENT_RECV); } addErrorTag(ex); if (log.isDebugEnabled()) { log.debug("Closing messaging span " + currentSpan); } getTracer().close(currentSpan); if (log.isDebugEnabled()) { log.debug("Messaging span " + currentSpan + " successfully closed"); } }
Source:
<code>public static OperationStatus fromString(String name, boolean isComplete) { <START> OperationStatus status = fromString(name, OperationStatus.class); <END> status.completed = isComplete; return status; }</code><technical_language>Null check</technical_language>

Target:
public static OperationStatus fromString(String name, boolean isComplete) { OperationStatus status = fromString(name, OperationStatus.class); if (status != null) { if (operationStatusMap != null && operationStatusMap.containsKey(name)) { OperationStatus operationStatus = operationStatusMap.get(name); if (operationStatus.isComplete() != isComplete) { throw new IllegalArgumentException(String.format("Cannot set complete status %s for operation" + "status %s", isComplete, name)); } } status.completed = isComplete; } return status; }
Source:
<code>public String getError() { <START> return "An entry’s parent is a file"; <END> }</code><technical_language>I try explain this better. get raised if is a file a file in S3</technical_language>

Target:
public String getError() { return "The entry's parent in the metastore database is a file."; }
Source:
<code>public Datum eval(Tuple tuple) { Datum resultDatum; <START> Writable params = new Writable[tuple.size()]; <END> for (int i=0; i<tuple.size(); i++) { params[i] = WritableTypeConverter.convertDatum2Writable(tuple.asDatum(i)); } try { Writable result = (Writable)evalMethod.invoke(instance, params); resultDatum = WritableTypeConverter.convertWritable2Datum(result); } catch (Exception e) { throw new TajoInternalError(e); } return resultDatum; }</code><technical_language>making this params a member variable? contents overwritten eval() call instead of creating new one</technical_language>

Target:
public Datum eval(Tuple tuple) { Datum resultDatum; for (int i=0; i<tuple.size(); i++) { params[i] = WritableTypeConverter.convertDatum2Writable(tuple.asDatum(i)); } try { Writable result = (Writable)evalMethod.invoke(instance, params); resultDatum = WritableTypeConverter.convertWritable2Datum(result); } catch (Exception e) { throw new TajoInternalError(e); } return resultDatum; }
Source:
<code>private PagedColumnIterable(final Column columnRequest) { mColumn = columnRequest.getColumnName(); mCloser = Closer.create(); mColumnRequest = columnRequest; mTableName = KijiManagedHBaseTableName <START> .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); <END> }</code><technical_language>charset</technical_language>

Target:
private PagedColumnIterable(final Column columnRequest) { mColumn = columnRequest.getColumnName(); mColumnRequest = columnRequest; mTableName = KijiManagedHBaseTableName .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); }
Source:
<code>private void run(String[] args) throws IOException { <START> Nd4j.ENFORCE_NUMERICAL_STABILITY = true; <END> Nd4j.getMemoryManager().setAutoGcWindow(GC_WINDOW); createDictionary(); File networkFile = new File(toTempPath(MODEL_FILENAME)); int offset = 0; if (networkFile.exists()) { System.out.println("Loading the existing network..."); net = ModelSerializer.restoreComputationGraph(networkFile); System.out.print("Enter d to start dialog or a number to continue training from that minibatch: "); String input; try (Scanner scanner = new Scanner(System.in)) { input = scanner.nextLine(); } if (input.toLowerCase().equals("d")) { startDialog(); } else { offset = Integer.valueOf(input); test(); } } else { System.out.println("Creating a new network..."); createComputationGraph(); } System.out.println("Number of parameters: " + net.numParams()); net.setListeners(new ScoreIterationListener(1)); train(networkFile, offset); }</code><technical_language>need this? I intended deprecating this some point. If need this for some reason consider tuning neural net a bit</technical_language>

Target:
private void run(String[] args) throws IOException { Nd4j.getMemoryManager().setAutoGcWindow(GC_WINDOW); createDictionary(); File networkFile = new File(toTempPath(MODEL_FILENAME)); int offset = 0; if (networkFile.exists()) { System.out.println("Loading the existing network..."); net = ModelSerializer.restoreComputationGraph(networkFile); System.out.print("Enter d to start dialog or a number to continue training from that minibatch: "); String input; try (Scanner scanner = new Scanner(System.in)) { input = scanner.nextLine(); } if (input.toLowerCase().equals("d")) { startDialog(); } else { offset = Integer.valueOf(input); test(); } } else { System.out.println("Creating a new network..."); createComputationGraph(); } System.out.println("Number of parameters: " + net.numParams()); net.setListeners(new ScoreIterationListener(1)); train(networkFile, offset); }
Source:
<code>public void create() { this.optionsGroup = UIAssets.getOptionsGroup(); super.root = new Group(); root.setVisible(false); MyClickListener mClickListener = new MyClickListener(); newProject = new TextButton("Nuevo Proyecto", skin, "default-thin"); newProject.addListener(mClickListener); projectGallery = new TextButton("Galería de Proyectos", skin); projectGallery.addListener(mClickListener); cg = new CircularGroup(halfstageh, 135, 180, true, newProject, projectGallery); cg.setX(halfstagew); cg.setY(halfstageh); Table projectsTable = new Table(); projectsTable.defaults().space(10); ScrollPane sp = new ScrollPane(projectsTable); sp.setBounds(stagew * .1f, 10, stagew * .8f, stageh * .2f); sp.setScrollingDisabled(false, true); Texture t = new Texture(Gdx.files.internal("mockup/temp/proyecto.png")); t.setFilter(TextureFilter.Linear, TextureFilter.Linear); final int PROJECTS = 8; mProjects = new Array<Actor>(false, PROJECTS); for (int i = 0; i < PROJECTS; ++i) { Image im = new Image(t); im.addListener(mClickListener); projectsTable.add(im); mProjects.add(im); } root.addActor(sp); root.addActor(cg); stage.addActor(root); <START> exitDialog = new Dialog("¿Salir?", skin, "exit-dialog") { <END> protected void result (Object object) { if((Boolean) object){ Gdx.app.exit(); } } } .text("¿Estás seguro?") .button("Salir", true) .button("¡Todavía no!", false) .key(Keys.BACK, false) .key(Keys.ENTER, true); exitDialog.setMovable(false); }</code><technical_language>I18N here</technical_language>

Target:
public void create() { this.optionsGroup = UIAssets.getOptionsGroup(); super.root = new Group(); root.setVisible(false); MyClickListener mClickListener = new MyClickListener(); newProject = new TextButton("Nuevo Proyecto", skin, "default-thin"); newProject.addListener(mClickListener); projectGallery = new TextButton("Galería de Proyectos", skin); projectGallery.addListener(mClickListener); cg = new CircularGroup(halfstageh, 135, 180, true, newProject, projectGallery); cg.setX(halfstagew); cg.setY(halfstageh); Table projectsTable = new Table(); projectsTable.defaults().space(10); ScrollPane sp = new ScrollPane(projectsTable); sp.setBounds(stagew * .1f, 10, stagew * .8f, stageh * .2f); sp.setScrollingDisabled(false, true); Texture t = new Texture(Gdx.files.internal("mockup/temp/proyecto.png")); t.setFilter(TextureFilter.Linear, TextureFilter.Linear); final int PROJECTS = 8; mProjects = new Array<Actor>(false, PROJECTS); for (int i = 0; i < PROJECTS; ++i) { Image im = new Image(t); im.addListener(mClickListener); projectsTable.add(im); mProjects.add(im); } Image bg = new Image(skin.getRegion("bg")); bg.setTouchable(Touchable.disabled); bg.setBounds(0, 0, stagew, stageh); root.addActor(bg); root.addActor(sp); root.addActor(cg); stage.addActor(root); exitDialog = new Dialog("¿Salir?", skin, "exit-dialog") { protected void result(Object object) { if ((Boolean) object) { Gdx.app.exit(); } } }.text("¿Estás seguro?").button("Salir", true).button("¡Todavía no!", false).key(Keys.BACK, false).key(Keys.ENTER, true); exitDialog.setMovable(false); }
Source:
<code>public byte[] getCacheKey() { byte[] valueBytes = StringUtils.toUtf8(value); <START> return ByteBuffer.allocate(2 + valueBytes.length) <END> .put(caseSensitive ? (byte)1 : 0) .put(CACHE_TYPE_ID) .put(valueBytes) .array(); }</code><technical_language>put CACHE_TYPE_ID first</technical_language>

Target:
public byte[] getCacheKey() { if (value == null) { return ByteBuffer.allocate(2) .put(CACHE_TYPE_ID) .put(caseSensitive ? (byte) 1 : 0).array(); } byte[] valueBytes = StringUtils.toUtf8(value); return ByteBuffer.allocate(2 + valueBytes.length) .put(CACHE_TYPE_ID) .put(caseSensitive ? (byte) 1 : 0) .put(valueBytes) .array(); }
Source:
<code>public AuthorizationRest findOne(Context context, String id) { AuthorizationRest authorizationRest = null; String featureName; try { featureName = authorizationRestUtil.getFeatureName(id); } catch (IllegalArgumentException e) { <START> log.warn(e.getMessage(), e); <END> return null; } try { BaseObjectRest object = null; try { object = authorizationRestUtil.getObject(context, id); } catch (IllegalArgumentException e) { log.warn("Object informations not found in the specified id " + id, e); return null; } AuthorizationFeature authorizationFeature = null; if (featureName != null) { authorizationFeature = authorizationFeatureService.find(featureName); } if (authorizationFeature == null) { return null; } EPerson user; try { user = authorizationRestUtil.getEperson(context, id); } catch (IllegalArgumentException e) { log.warn("Invalid eperson informations in the specified id " + id, e); return null; } EPerson currUser = context.getCurrentUser(); context.setCurrentUser(user); if (authorizationFeatureService.isAuthorized(context, authorizationFeature, object)) { Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(authorizationFeature); authz.setObject(object); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } context.setCurrentUser(currUser); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return authorizationRest; }</code><technical_language>add a small message for log</technical_language>

Target:
public AuthorizationRest findOne(Context context, String id) { AuthorizationRest authorizationRest = null; String featureName; try { featureName = authorizationRestUtil.getFeatureName(id); } catch (IllegalArgumentException e) { log.warn(e.getMessage(), e); return null; } try { BaseObjectRest object = null; try { object = authorizationRestUtil.getObject(context, id); } catch (IllegalArgumentException e) { log.warn("Object informations not found in the specified id " + id, e); return null; } AuthorizationFeature authorizationFeature = null; if (featureName != null) { authorizationFeature = authorizationFeatureService.find(featureName); } if (authorizationFeature == null) { return null; } EPerson user; try { user = authorizationRestUtil.getEperson(context, id); } catch (IllegalArgumentException e) { log.warn("Invalid eperson informations in the specified id " + id, e); return null; } EPerson currUser = context.getCurrentUser(); if (currUser != user) { context.switchContextUser(user); } if (authorizationFeatureService.isAuthorized(context, authorizationFeature, object)) { Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(authorizationFeature); authz.setObject(object); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } if (currUser != user) { context.restoreContextUser(); } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return authorizationRest; }
Source:
<code>public Map<String, Statistic<?, ?>> collectStatistics(Context context, Collection<String> statisticNames, long since) { Map<String, Statistic<?, ?>> statistics = new HashMap<String, Statistic<?, ?>>(statisticNames.size()); StandardEhcacheStatistics ehcacheStatistics = (StandardEhcacheStatistics) findExposedObject(context); if (ehcacheStatistics != null) { for (String statisticName : statisticNames) { <START> statistics.put(statisticName, ehcacheStatistics.queryStatistic(statisticName, since)); <END> } } return statistics; }</code><technical_language>is anymore concept of "groups" of statistics ? Before, some group name, asked for i.e. AllCacheGet, return statistics (AllCacheGetCount, AllCacheGetRate, AllCacheGetLatencyMinimum, ...). .putAll() ;-)</technical_language>

Target:
public Map<String, Statistic<?, ?>> collectStatistics(Context context, Collection<String> statisticNames, long since) { Map<String, Statistic<?, ?>> statistics = new HashMap<String, Statistic<?, ?>>(statisticNames.size()); StandardEhcacheStatistics ehcacheStatistics = (StandardEhcacheStatistics) findExposedObject(context); if (ehcacheStatistics != null) { for (String statisticName : statisticNames) { try { statistics.put(statisticName, ehcacheStatistics.queryStatistic(statisticName, since)); } catch (IllegalArgumentException ignored) { } } } return statistics; }
Source:
<code>public void removeClassName() { HasStyleComponent component = new HasStyleComponent(); component.setClassName("foo Bar baz"); component.removeClassName("foo"); assertClasses(component, "Bar", "baz"); component.removeClassName("bar"); assertClasses(component, "Bar", "baz"); component.removeClassName("Bar"); assertClasses(component, "baz"); component.removeClassName("baz"); assertClasses(component); component.setClassName("removeMe"); <START> component.setClassName(null); <END> component.setClassName("foo"); component.getClassNames().remove("foo"); assertClasses(component); }</code><technical_language>Missing assert assertClasses ? Technically I expected test setClassName() method</technical_language>

Target:
public void removeClassName() { HasStyleComponent component = new HasStyleComponent(); component.setClassName("foo Bar baz"); component.removeClassName("foo"); assertClasses(component, "Bar", "baz"); component.removeClassName("bar"); assertClasses(component, "Bar", "baz"); component.removeClassName("Bar"); assertClasses(component, "baz"); component.removeClassName("baz"); assertClasses(component); component.setClassName("foo"); component.getClassNames().remove("foo"); assertClasses(component); }
Source:
<code>protected void syncSearch() { <START> if (getEntity() == null) { <END> return; } if (getEntity() != null) { GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) getEntity(); if (getItems() == glusterVolumeEntity.getBricks()) { getItemsChangedEvent().raise(this, EventArgs.Empty); } else { setItems(glusterVolumeEntity.getBricks()); } } else { setItems(null); } }</code><technical_language>this check is redundant</technical_language>

Target:
protected void syncSearch() { if (getEntity() != null) { GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) getEntity(); if (getItems() == glusterVolumeEntity.getBricks()) { getItemsChangedEvent().raise(this, EventArgs.Empty); } else { setItems(glusterVolumeEntity.getBricks()); } } else { setItems(null); } }
Source:
<code>public void onDismissClick() { <START> setResult(RESULT_DISMISS); <END> finish(); }</code><technical_language>considered Activity.RESULT_OK instead</technical_language>

Target:
public void onDismissClick() { setResult(RESULT_OK); finish(); }
Source:
<code><START> private String trimPropertyName(String propName) { <END> if ((propName.length()) > (NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1)) { return propName.substring(NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1).trim(); } else { return null; } }</code><technical_language>![MINOR](<LINK_1> "trimPropertyName" a "static" method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private static String trimPropertyName(String propName) { if ((propName.length()) > (NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1)) { return propName.substring(NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1).trim(); } else { return null; } }
Source:
<code>public boolean equals(final Object o) { if (o == this) { return true; } else if (o == null || !o.getClass().equals(getClass())) { return false; } final DumpArchiveEntry rhs = (DumpArchiveEntry) o; if (rhs.header == null) { return false; } if (ino != rhs.ino) { return false; } return (summary != null || rhs.summary == null) && (summary == null || summary.equals(rhs.summary)); <START> } <END></code><technical_language>I find this version a lot harder read original expression. totally fine rid of if, please original logic</technical_language>

Target:
public boolean equals(final Object o) { if (o == this) { return true; } else if (o == null || !o.getClass().equals(getClass())) { return false; } final DumpArchiveEntry rhs = (DumpArchiveEntry) o; if (rhs.header == null) { return false; } if (ino != rhs.ino) { return false; } if ((summary == null && rhs.summary != null) || (summary != null && !summary.equals(rhs.summary))) { return false; } return true; }
Source:
<code>public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { if (item instanceof IdentifierObjQualifier) { <START> final IdentifierObjQualifier identifierObjQualifier = (IdentifierObjQualifier) item; <END> Validate.notNull(objQualifierConverter, "'objQualifierConverter' must not be null!"); return objQualifierConverter.convertToUriQualifier(identifierObjQualifier) .map(uriObjQualifier -> new SimpleMeasureDefinition(uriObjQualifier, aggregation, computeRatio, filters)) .orElseThrow(() -> new IllegalArgumentException(format("The converter does not know how to convert identifier '%s'!", item))); } return this; }</code><technical_language>piece of code - introduce some utility function</technical_language>

Target:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { return ObjIdentifierUtilities.copyIfNecessary( this, item, uriObjQualifier -> new SimpleMeasureDefinition(uriObjQualifier, aggregation, computeRatio, filters), objQualifierConverter ); }
Source:
<code>private PlanWithProperties planAndEnforce( PlanNode node, HashComputationSet requiredHashes, boolean pruneExtraHashSymbols, HashComputationSet preferredHashes) { PlanWithProperties result = plan(node, preferredHashes); boolean preferenceSatisfied; if (pruneExtraHashSymbols) { Set<HashComputation> resultHashes = result.getHashSymbols().keySet(); <START> preferenceSatisfied = resultHashes.containsAll(requiredHashes.getHashes()) <END> && ImmutableSet.builder() .addAll(requiredHashes.getHashes()) .addAll(preferredHashes.getHashes()) .build() .containsAll(resultHashes); } else { preferenceSatisfied = result.getHashSymbols().keySet().containsAll(requiredHashes.getHashes()); } if (preferenceSatisfied) { return result; } return enforce(result, requiredHashes); }</code><technical_language>issue here</technical_language>

Target:
private PlanWithProperties planAndEnforce( PlanNode node, HashComputationSet requiredHashes, boolean pruneExtraHashSymbols, HashComputationSet preferredHashes) { PlanWithProperties result = plan(node, preferredHashes); boolean preferenceSatisfied; if (pruneExtraHashSymbols) { Set<HashComputation> resultHashes = result.getHashSymbols().keySet(); Set<HashComputation> requiredAndPreferredHashes = ImmutableSet.<HashComputation>builder() .addAll(requiredHashes.getHashes()) .addAll(preferredHashes.getHashes()) .build(); preferenceSatisfied = resultHashes.containsAll(requiredHashes.getHashes()) && requiredAndPreferredHashes.containsAll(resultHashes); } else { preferenceSatisfied = result.getHashSymbols().keySet().containsAll(requiredHashes.getHashes()); } if (preferenceSatisfied) { return result; } return enforce(result, requiredHashes); }
Source:
<code>public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTDeclarationStatement declStatement = (IASTDeclarationStatement) declaration.getParent(); <START> IASTNode node = declStatement.getParent(); <END> if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }</code><technical_language>getParent() is defined IASTNode, is need cast IASTDeclarationStatement line above: declaration.getParent().getParent() here</technical_language>

Target:
public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTNode node = declaration.getParent(); if (node == null) return PROCESS_CONTINUE; node = node.getParent(); if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }
Source:
<code>public void bind(SQLStatement<?> q, Parameter param, Bind b, Object arg) { String value = b != null ? b.value() : Bind.USE_PARAM_NAME; if (value.equals(Bind.USE_PARAM_NAME)) { if (param.isNamePresent()) { value = param.getName(); } else if (b == null && paramIndex >= 0) { value = Integer.toString(paramIndex); } else { throw new UnsupportedOperationException("A parameter was annotated with @Bind " + "but no name was specified, and parameter name data is not present " + "in the class file. " + param.getDeclaringExecutable() + " :: " + param); } } <START> q.bind(paramIndex, arg); <END> q.bind(value, arg); }</code><technical_language>this called if this DefaultObjectBinder is created no-arg constructor</technical_language>

Target:
public void bind(SQLStatement<?> q, Parameter param, Bind b, Object arg) { final String bindName; if (b == null || b.value().equals(Bind.USE_PARAM_NAME)) { if (param.isNamePresent()) { bindName = param.getName(); } else { throw new UnsupportedOperationException("A parameter was not given a name, " + "and parameter name data is not present in the class file, for: " + param.getDeclaringExecutable() + " :: " + param); } } else { bindName = b.value(); } q.bind(paramIndex, arg); q.bind(bindName, arg); }
Source:
<code>private void setUpSizeFilter(FileSearchData.FileType fileType) { int count = 0; DefaultListModel<FileSize> sizeListModel = (DefaultListModel<FileSize>) sizeList.getModel(); sizeListModel.removeAllElements(); if (null == fileType) { for (FileSize size : FileSize.values()) { sizeListModel.add(count, size); } } else { List<FileSearchData.FileSize> sizes; switch (fileType) { case VIDEO: sizes = FileSize.getOptionsForVideos(); break; case IMAGE: sizes = FileSize.getOptionsForImages(); break; case DOCUMENTS: <START> sizes = FileSize.getOptionsForImages(); <END> break; default: sizes = new ArrayList<>(); break; } for (FileSize size : sizes) { sizeListModel.add(count, size); } } }</code><technical_language>rename image sizes more "default size options" (in places) weird for images videos</technical_language>

Target:
private void setUpSizeFilter(FileSearchData.FileType fileType) { int count = 0; DefaultListModel<FileSize> sizeListModel = (DefaultListModel<FileSize>) sizeList.getModel(); sizeListModel.removeAllElements(); if (null == fileType) { for (FileSize size : FileSize.values()) { sizeListModel.add(count, size); } } else { List<FileSearchData.FileSize> sizes; switch (fileType) { case VIDEO: sizes = FileSize.getOptionsForVideos(); break; case IMAGE: sizes = FileSize.getDefaultSizeOptions(); break; case DOCUMENTS: sizes = FileSize.getDefaultSizeOptions(); break; default: sizes = new ArrayList<>(); break; } for (FileSize size : sizes) { sizeListModel.add(count, size); } } }
Source:
<code>protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { builder.addConstructorArgValue(element.getAttribute("queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer", true); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "task-executor"); <START> IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "expect-message"); <END> IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "phase"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); }</code><technical_language>This is fault. I meant **change** this property extract-payload..</technical_language>

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { builder.addConstructorArgValue(element.getAttribute("queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer", true); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "task-executor"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "phase"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); }
Source:
<code>private void printTransformers(Class transformerClass, String type) throws Exception { Collection<ServiceReference> sref = bundleContext.getServiceReferences(transformerClass, "(id=*)"); List<TransformerProperties> transformersProperties = sref.stream().map(TransformerProperties::new).collect(Collectors.toList()); int activeTransformers = transformersProperties.size(); if (activeTransformers == 0) { console.printf(getNoActiveString(type)); return; } <START> console.printf(getActiveNumString(type, activeTransformers)); <END> Iterator<TransformerProperties> tpIterator = transformersProperties.iterator(); TransformerProperties tp; while (tpIterator.hasNext()) { tp = tpIterator.next(); if (allOption) console.printf("%s", tp.printAllProperties()); else console.printf("%s", tp.printDefaultProperties()); if (tpIterator.hasNext()) { console.printf("%n%s%n", StringUtils.repeat(LINE, 3)); } console.printf("%n"); } }</code><technical_language>changed NO_ACTIVE_TRANSFORMERS "There active %s transformers" called String.format(NO_ACTIVE_TRANSFORMERS, type) instead of getNoActiveString(type)</technical_language>

Target:
private void printTransformers(Class transformerClass, String type) throws InvalidSyntaxException { Collection<ServiceReference> sref = bundleContext.getServiceReferences(transformerClass, FILTER); List<TransformerProperties> transformersProperties = sref.stream().map(TransformerProperties::new).collect(Collectors.toList()); int activeTransformers = transformersProperties.size(); if (activeTransformers == 0) { console.printf("There are no active %s transformers%n%n", type); return; } console.printf("%n%n%n%nActive %s Transformers: %d%n%s%n%n", type, activeTransformers, LINE); Iterator<TransformerProperties> tpIterator = transformersProperties.iterator(); TransformerProperties tp; while (tpIterator.hasNext()) { tp = tpIterator.next(); if (allOption) { console.printf("%s", tp.printAllProperties()); } else { console.printf("%s", tp.printDefaultProperties()); } if (tpIterator.hasNext()) { console.printf("%n%s%n", StringUtils.repeat(LINE, 3)); } console.printf("%n"); } }
Source:
<code>public ActualProperties visitAssignUniqueId(AssignUniqueId node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.getNodePartitioning().isPresent()) { return properties; } return ActualProperties.builderFrom(properties) <START> .global(partitionedOn(FIXED_HASH_DISTRIBUTION, node.getOutputSymbols(), Optional.empty())) <END> .build(); }</code><technical_language>FIXED_HASH_DISTRIBUTION? addition of unique property ensures data is partitioned columns, guarantees is partitioned. Also, I partitioned_on(<all-columns>) is weaker partitioned_on(unique). partitioned_on(unique) implies partitioning unique+<any combination of columns>, e.g. partitioned_in(unique, col1) partitioned_in(unique, col1, col2), enables one-step aggregation for grouping sets, e.g. GROUP unique, col1 GROUP unique col1, col2</technical_language>

Target:
public ActualProperties visitAssignUniqueId(AssignUniqueId node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.getNodePartitioning().isPresent()) { return properties; } return ActualProperties.builderFrom(properties) .global(partitionedOn(ARBITRARY_DISTRIBUTION, ImmutableList.of(node.getIdColumn()), Optional.empty())) .build(); }
Source:
<code>public void runTask() throws Exception { Set<ContractSituation> retirementSituations = Bennu.getInstance().getContractSituationsSet().stream() <START> .filter(this::isRetiredSituation).filter(Objects::nonNull).collect(Collectors.toSet()); <END> LocalDate today = new LocalDate(); Set<User> retiredTeachersUsers = Bennu.getInstance().getGiafProfessionalDataSet().stream() .filter(giafData -> isUsersWithRetirementTeacherSituations(giafData, retirementSituations, today)) .map(giafData -> giafData.getPersonProfessionalData().getPerson().getUser()).filter(Objects::nonNull) .collect(Collectors.toSet()); Group actualRetiredTeachersGroup = UserGroup.of(retiredTeachersUsers); DynamicGroup.get("retiredTeachers").mutator().changeGroup(actualRetiredTeachersGroup); }</code><technical_language>Objects:nonNull is useless</technical_language>

Target:
public void runTask() throws Exception { Set<ContractSituation> retirementSituations = Bennu.getInstance().getContractSituationsSet().stream() .filter(this::isRetiredSituation).collect(Collectors.toSet()); LocalDate today = new LocalDate(); Set<User> retiredTeachersUsers = Bennu.getInstance().getGiafProfessionalDataSet().stream() .filter(giafData -> giafData.getPersonProfessionalData().getPerson() != null && isUsersWithRetirementTeacherSituations(giafData, retirementSituations, today)) .map(giafData -> giafData.getPersonProfessionalData().getPerson().getUser()).filter(Objects::nonNull) .collect(Collectors.toSet()); Group actualRetiredTeachersGroup = UserGroup.of(retiredTeachersUsers); DynamicGroup.get("retiredTeachers").mutator().changeGroup(actualRetiredTeachersGroup); }
Source:
<code>private String getTokenToUse(String authTokenCredentialId, String token) { if (!StringUtils.isEmpty(authTokenCredentialId)) { <START> StringCredentials credentials = CredentialsObtainer.lookupCredentials(authTokenCredentialId, null); <END> if (credentials != null) { logger.fine("Using Integration Token Credential ID."); return credentials.getSecret().getPlainText(); } } logger.fine("Using Integration Token."); return token; }</code><technical_language>this overloaded method please pass null around? suggestion StringCredentials credentials = CredentialsObtainer.lookupCredentials(authTokenCredentialId);</technical_language>

Target:
private String getTokenToUse(String authTokenCredentialId, String token) { if (!StringUtils.isEmpty(authTokenCredentialId)) { StringCredentials credentials = CredentialsObtainer.lookupCredentials(authTokenCredentialId); if (credentials != null) { logger.fine("Using Integration Token Credential ID."); return credentials.getSecret().getPlainText(); } } logger.fine("Using Integration Token."); return token; }
Source:
<code>public List<PaymentWorksVendorUpdatesDTO> getPendingAddressVendorUpdatesFromPaymentWorks() { <START> PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; <END> List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); boolean moreRecords = true; Client client = buildClient(); ClientResponse response = client.handle(buildClientRequest(buildPendingAddressVendorUpdatesFromPaymentWorksURL())); while (moreRecords) { updateVendorsRoot = response.getEntity(PaymentWorksVendorUpdatesRootDTO.class); LOG.debug("getPendingAddressVendorUpdatesFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == 200) { if (ObjectUtils.isNotNull(updateVendorsRoot)) { LOG.info("getPendingAddressVendorUpdatesFromPaymentWorks, Vendor Updates retrieved: " + updateVendorsRoot.getCount()); } if (updateVendorsRoot.getCount() > 0) { vendorUpdates.addAll(updateVendorsRoot.getVendorUpdates().getNewVendorList()); } if (StringUtils.isNotEmpty(updateVendorsRoot.getNext())) { response = client.handle(buildClientRequest(updateVendorsRoot.getNext())); } else { moreRecords = false; } } else { LOG.error("getPendingAddressVendorUpdatesFromPaymentWorks, Failed to retrieve Pending Vendor Updates: " + response.getEntity(String.class)); moreRecords = false; } } return vendorUpdates; }</code><technical_language>more logic similar</technical_language>

Target:
public List<PaymentWorksVendorUpdatesDTO> getPendingAddressVendorUpdatesFromPaymentWorks() { PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); processVendorUpdates(vendorUpdates, buildPendingAddressVendorUpdatesFromPaymentWorksURL()); return vendorUpdates; }
Source:
<code>static boolean isPinningAndMigrationValid(List<String> reasons, VmStatic vmStaticData, String cpuPinning) { <START> final boolean cpuPingMigrationEnabled = Boolean.TRUE.equals(Config.<Boolean> GetValue(ConfigValues.CpuPinMigrationEnabled)); <END> if (!cpuPingMigrationEnabled && vmStaticData.getMigrationSupport() == MigrationSupport.MIGRATABLE && StringUtils.isNotEmpty(cpuPinning)) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString()); return false; } return true; }</code><technical_language>s/ cpuPingMigrationEnabled/ cpuPinMigrationEnabled</technical_language>

Target:
static boolean isPinningAndMigrationValid(List<String> reasons, VmStatic vmStaticData, String cpuPinning) { final boolean cpuPinMigrationEnabled = Boolean.TRUE.equals(Config.<Boolean> GetValue(ConfigValues.CpuPinMigrationEnabled)); if (!cpuPinMigrationEnabled && vmStaticData.getMigrationSupport() == MigrationSupport.MIGRATABLE && StringUtils.isNotEmpty(cpuPinning)) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString()); return false; } return true; }
Source:
<code>public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (applicationContext == null) { return null; } Class<?> parameterType = parameters[parameterIndex].getType(); Map<String, ?> beansFound = applicationContext.getBeansOfType(parameterType); if (beansFound.isEmpty()) { return null; } else if (beansFound.size() > 1) { final AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); if (beanFactory instanceof ConfigurableListableBeanFactory) { final ConfigurableListableBeanFactory clBeanFactory = (ConfigurableListableBeanFactory) beanFactory; for (Map.Entry<String, ?> bean : beansFound.entrySet()) { <START> final Qualifier qualifier = parameters[parameterIndex].getAnnotation(Qualifier.class); <END> if (qualifier != null && SpringUtils.isQualifierMatch(bean.getKey(), clBeanFactory, qualifier.value())) { return new SpringBeanParameterResolver(beanFactory, bean.getKey()); } } for (Map.Entry<String, ?> bean : beansFound.entrySet()) { if (clBeanFactory.containsBeanDefinition(bean.getKey()) && clBeanFactory.getBeanDefinition(bean.getKey()).isPrimary()) { return new SpringBeanParameterResolver(beanFactory, bean.getKey()); } } } if (logger.isWarnEnabled()) { logger.warn("{} beans of type found, but none was marked as primary and parameter lacks @Qualifier. Ignoring this parameter.", beansFound.size(), parameterType.getSimpleName()); } return null; } else { return new SpringBeanParameterResolver(applicationContext.getAutowireCapableBeanFactory(), beansFound.keySet().iterator().next()); } }</code><technical_language>qualifier variable for scope, depend that. forloop qualifier is null. Lastly, please org.axonframework.common.annotation.AnnotationUtils.findAnnotationAttributes(...) retrieve annotations, takes meta-annotations account. key want for in returned Map is 'qualifier'</technical_language>

Target:
public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (applicationContext == null) { return null; } Class<?> parameterType = parameters[parameterIndex].getType(); Map<String, ?> beansFound = applicationContext.getBeansOfType(parameterType); if (beansFound.isEmpty()) { return null; } else if (beansFound.size() > 1) { final AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); if (beanFactory instanceof ConfigurableListableBeanFactory) { Optional<ParameterResolver> resolver = findQualifiedBean(beansFound, (ConfigurableListableBeanFactory) beanFactory, parameters, parameterIndex); if (resolver.isPresent()) { return resolver.get(); } } if (logger.isWarnEnabled()) { logger.warn("{} beans of type found, but none was marked as primary and parameter lacks @Qualifier. Ignoring this parameter.", beansFound.size(), parameterType.getSimpleName()); } return null; } else { return new SpringBeanParameterResolver(applicationContext.getAutowireCapableBeanFactory(), beansFound.keySet().iterator().next()); } }
Source:
<code>private CorruptionCheckViolation timestampInvariantsViolationLevel(NamespaceAndUseCase namespaceAndUseCase) { Stream<Long> expectedSortedTimestamps = KeyedStream.stream(getLearnerLogs(namespaceAndUseCase)) .map(PaxosValue::getData) <START> .filter(Predicates.notNull()) <END> .mapEntries((sequence, timestamp) -> Maps.immutableEntry(sequence, PtBytes.toLong(timestamp))) .entries() .sorted(Comparator.comparingLong(Map.Entry::getKey)) .map(Map.Entry::getValue); return StreamEx.of(expectedSortedTimestamps) .pairMap((first, second) -> first >= second) .anyMatch(x -> x) ? CorruptionCheckViolation.CLOCK_WENT_BACKWARDS : CorruptionCheckViolation.NONE; }</code><technical_language>suggestion .filter(Objects::nonNull)</technical_language>

Target:
private CorruptionCheckViolation timestampInvariantsViolationLevel(NamespaceAndUseCase namespaceAndUseCase) { Stream<Long> expectedSortedTimestamps = KeyedStream.stream(getLearnerLogs(namespaceAndUseCase)) .map(PaxosValue::getData) .filter(Objects::nonNull) .mapEntries((sequence, timestamp) -> Maps.immutableEntry(sequence, PtBytes.toLong(timestamp))) .entries() .sorted(Comparator.comparingLong(Map.Entry::getKey)) .map(Map.Entry::getValue); return StreamEx.of(expectedSortedTimestamps) .pairMap((first, second) -> first >= second) .anyMatch(x -> x) ? CorruptionCheckViolation.CLOCK_WENT_BACKWARDS : CorruptionCheckViolation.NONE; }
Source:
<code>private void decorateBackupFromLoggingRequest(Backup backup, LoggingRequest loggingRequest) { if (loggingRequest != null) { backup.setStorageLocation(loggingRequest.getStorageLocation()); if (loggingRequest.getS3() != null) { S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters(); s3Params.setInstanceProfile(loggingRequest.getS3().getInstanceProfile()); backup.setS3(s3Params); } else if (loggingRequest.getAdlsGen2() != null) { AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters(); AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = loggingRequest.getAdlsGen2(); adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey()); adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName()); adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure()); adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity()); backup.setAdlsGen2(adlsGen2Params); } else if (loggingRequest.getGcs() != null) { GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters(); GcsCloudStorageV1Parameters gcsFromRequest = loggingRequest.getGcs(); gcsParams.setServiceAccountEmail(gcsFromRequest.getServiceAccountEmail()); <START> backup.setGcs(gcsFromRequest); <END> } } }</code><technical_language>I argument gcsParams instead consistent S3 / ADLSg2 above</technical_language>

Target:
private void decorateBackupFromLoggingRequest(Backup backup, LoggingRequest loggingRequest) { if (loggingRequest != null) { backup.setStorageLocation(loggingRequest.getStorageLocation()); if (loggingRequest.getS3() != null) { S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters(); s3Params.setInstanceProfile(loggingRequest.getS3().getInstanceProfile()); backup.setS3(s3Params); } else if (loggingRequest.getAdlsGen2() != null) { AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters(); AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = loggingRequest.getAdlsGen2(); adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey()); adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName()); adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure()); adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity()); backup.setAdlsGen2(adlsGen2Params); } else if (loggingRequest.getGcs() != null) { GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters(); GcsCloudStorageV1Parameters gcsFromRequest = loggingRequest.getGcs(); gcsParams.setServiceAccountEmail(gcsFromRequest.getServiceAccountEmail()); backup.setGcs(gcsParams); } } }
Source:
<code>public void viewedScreen(String nameOfScreen) { analytics.enqueue(ScreenMessage.builder(nameOfScreen) .userId(mapboxUsername) ); <START> } <END></code><technical_language>other single line methods new lines, reason start :)</technical_language>

Target:
public void viewedScreen(String nameOfScreen) { analytics.enqueue(ScreenMessage.builder(nameOfScreen).userId(MAPBOX_USERNAME)); }
Source:
<code>private Entry getEntry(ParsedRegistryID parsedID) { Entry entry; if (parsedID.isTool()) { entry = toolDAO.findPublishedByToolPath(parsedID.getPath(), parsedID.getToolName()); } else { String workflowPath = parsedID.getPath(); <START> if (!(parsedID.getToolName() == null)) { <END> workflowPath += "/" + parsedID.getToolName(); } entry = workflowDAO.findPublishedByWorkflowPath(workflowPath, parsedID.getToolName()); } return entry; }</code><technical_language>parsedID.getToolName() != null is simpler</technical_language>

Target:
private Entry getEntry(ParsedRegistryID parsedID) { Entry entry; if (parsedID.isTool()) { entry = toolDAO.findPublishedByToolPath(parsedID.getPath(), parsedID.getToolName()); } else { String workflowPath = parsedID.getPath(); if (parsedID.getToolName() != null) { workflowPath += "/" + parsedID.getToolName(); } entry = workflowDAO.findPublishedByWorkflowPath(workflowPath, parsedID.getToolName()); } return entry; }
Source:
<code>public void userAgentHeader() throws Exception { String versionName = GeneratedBuildParameters.PROJECT_VERSION; assertThat(versionName).isNotEmpty(); <START> assertThat(versionName).doesNotContain("${"); <END> client.fetchSpace(); RecordedRequest request = server.takeRequest(); assertThat(request.getHeader("User-Agent")).startsWith("contentful.java/" + versionName); }</code><technical_language>a regular expression test version number</technical_language>

Target:
public void userAgentHeader() throws Exception { String versionName = GeneratedBuildParameters.PROJECT_VERSION; assertThat(versionName).matches("^\\d+\\.\\d+\\.\\d+(-\\w+)?$"); client.fetchSpace(); RecordedRequest request = server.takeRequest(); assertThat(request.getHeader("User-Agent")).startsWith("contentful.java/" + versionName); }