auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ComponentUISpecification getCustomProcessorUISpecification (ComponentUISpecification componentUISpecification) { ComponentUISpecification result = new ComponentUISpecification(); List<ComponentUISpecification.UIField> fields = new ArrayList<>(); for (ComponentUISpecification.UIField uiField: componentUISpecification.getFields()) { if (uiField.getFieldName().startsWith(TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_PREFIX)) { ComponentUISpecification.UIField newUIField = new ComponentUISpecification.UIField(uiField); newUIField.setFieldName(uiField.getFieldName().replaceFirst(TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_PREFIX_REGEX, "")); fields.add(newUIField); } } result.setFields(fields); <START> return (result.getFields().size() == 0 ? null : result); <END> }</code><technical_language>nit: fields.isEmpty() Q: NPE caller? return Optional</technical_language>

Target:
private ComponentUISpecification getCustomProcessorUISpecification (ComponentUISpecification componentUISpecification) { ComponentUISpecification result = new ComponentUISpecification(); List<ComponentUISpecification.UIField> fields = new ArrayList<>(); for (ComponentUISpecification.UIField uiField: componentUISpecification.getFields()) { if (uiField.getFieldName().startsWith(TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_PREFIX)) { ComponentUISpecification.UIField newUIField = new ComponentUISpecification.UIField(uiField); newUIField.setFieldName(uiField.getFieldName().replaceFirst(TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_PREFIX_REGEX, "")); fields.add(newUIField); } } result.setFields(fields); return (result.getFields().isEmpty() ? null : result); }
Source:
<code>void verifyEnumBraceStyle(ParserRuleContext ctx) { for (ParseTree child : ctx.children) { if (child instanceof TerminalNodeImpl) { Token openBrace = ((TerminalNodeImpl) child).getSymbol(); Location openBraceLocation = ListenerUtil.getTokenLocation(openBrace); ParserRuleContext leftSibling = (ParserRuleContext) ParseTreeUtil.getLeftSibling(child); Location leftSiblingLocation = ListenerUtil.getContextStopLocation(leftSibling); if (openBraceLocation.line != leftSiblingLocation.line) { printer.warn(Messages.ENUM + Messages.OPEN_BRACKET_STYLE, openBraceLocation); } else if (checkLeftSpaces(leftSibling.getStop(), openBrace, 1)) { printer.error(Messages.OPEN_BRACE + Messages.SPACE_BEFORE, openBraceLocation); } break; } } ParseTree lastChild = ParseTreeUtil.getLastChild(ctx); Location closeBraceLocation = ListenerUtil.getParseTreeStartLocation(lastChild); Location closeBraceLeftSiblingLocation = ListenerUtil.getParseTreeStopLocation( <START> ParseTreeUtil.getLeftSibling(lastChild)); <END> if (closeBraceLocation.line == closeBraceLeftSiblingLocation.line) { printer.warn(Messages.ENUM + Messages.CLOSE_BRACKET_STYLE, closeBraceLocation); } }</code><technical_language>Please adjust this indent: java Location closeBraceLeftSiblingLocation = ListenerUtil.getParseTreeStopLocation(ParseTreeUtil.getLeftSibling(lastChild));</technical_language>

Target:
void verifyEnumBraceStyle(ParserRuleContext ctx) { for (ParseTree child : ctx.children) { if (child instanceof TerminalNodeImpl) { Token openBrace = ((TerminalNodeImpl) child).getSymbol(); Location openBraceLocation = ListenerUtil.getTokenLocation(openBrace); ParserRuleContext leftSibling = (ParserRuleContext) ParseTreeUtil.getLeftSibling(child); Location leftSiblingLocation = ListenerUtil.getContextStopLocation(leftSibling); if (openBraceLocation.line != leftSiblingLocation.line) { printer.warn(Messages.ENUM + Messages.OPEN_BRACKET_STYLE, openBraceLocation); } else if (checkLeftSpaces(leftSibling.getStop(), openBrace, 1)) { printer.error(Messages.OPEN_BRACE + Messages.SPACE_BEFORE, openBraceLocation); } break; } } ParseTree lastChild = ParseTreeUtil.getLastChild(ctx); verifyCloseBraceStyle(lastChild, ParseTreeUtil.getLeftSibling(lastChild), Messages.ENUM); }
Source:
<code>public Message send(Payload responsePayload) { <START> Acknowledge.AcknowledgeBuilder ackBuilder = this.messageFactory.createAckBuilder(); <END> ackBuilder.withResponderId(responderId); ackBuilder.withResponsesRemaining(-1); Message message = this.messageFactory.createResponseMessage(this.messageBuilder, ackBuilder.build(), responsePayload); sendMessage(message); return message; }</code><technical_language>Suppose AcknowledgeBuilder is code Acknowledge.AcknowledgeBuilder</technical_language>

Target:
public Message send(Payload responsePayload) { AcknowledgeBuilder ackBuilder = this.messageFactory.createAckBuilder(); ackBuilder.withResponderId(responderId); ackBuilder.withResponsesRemaining(-1); Message message = this.messageFactory.createResponseMessage(this.messageBuilder, ackBuilder.build(), responsePayload); sendMessage(message); return message; }
Source:
<code>public EditBlockDialog(Shell parentShell, EditableBlock block, EditableConfiguration config) { super(parentShell); this.config = config; this.block = block; blockLogSettingsViewModel = new BlockLogSettingsViewModel(this.block); viewModels.add(blockLogSettingsViewModel); blockRunControlViewModel = new BlockRunControlViewModel(this.block); viewModels.add(blockRunControlViewModel); blockDetailsViewModel = new BlockDetailsViewModel(this.block, this.config); viewModels.add(blockDetailsViewModel); for (ErrorMessageProvider provider : viewModels) { provider.addPropertyChangeListener("error", errorListener); } for (ErrorMessageProvider provider : viewModels) { provider.addPropertyChangeListener("warning", warningListener); <START> } <END> }</code><technical_language>This loop is it, neater add listeners in loop</technical_language>

Target:
public EditBlockDialog(Shell parentShell, EditableBlock block, EditableConfiguration config) { super(parentShell); this.config = config; this.block = block; blockLogSettingsViewModel = new BlockLogSettingsViewModel(this.block); viewModels.add(blockLogSettingsViewModel); blockRunControlViewModel = new BlockRunControlViewModel(this.block); viewModels.add(blockRunControlViewModel); blockDetailsViewModel = new BlockDetailsViewModel(this.block, this.config); viewModels.add(blockDetailsViewModel); for (ErrorMessageProvider provider : viewModels) { provider.addPropertyChangeListener("error", errorListener); provider.addPropertyChangeListener("warning", warningListener); } }
Source:
<code>protected void testDelStereotypedElementMergeRToL(Resource left, Resource right) throws IOException { final Comparison comparison = compare(left, right); final EList<Diff> differences = comparison.getDifferences(); final StereotypedElementChange stereotypedElementChange = getStereotypedElementChange(differences, DifferenceKind.DELETE, 2); assertDeletedBaseElementDiff(differences, "model.Class0", stereotypedElementChange); mergeRightToLeft(stereotypedElementChange); for (Diff diff : differences) { assertSame(DifferenceState.MERGED, diff.getState()); } <START> <END> assertEqualsB4Left(right); }</code><technical_language>For Right Left test, need test left models (those modified).Please verify other tests present problem</technical_language>

Target:
protected void testDelStereotypedElementMergeRToL(Resource left, Resource right) throws IOException { final Comparison comparison = compare(left, right); final EList<Diff> differences = comparison.getDifferences(); final StereotypedElementChange stereotypedElementChange = getStereotypedElementChange(differences, DifferenceKind.DELETE, 2); assertDeletedBaseElementDiff(differences, "model.Class0", stereotypedElementChange); mergeRightToLeft(stereotypedElementChange); for (Diff diff : differences) { assertSame(DifferenceState.MERGED, diff.getState()); } assertEqualsM1(right); assertEqualsM1(left); }
Source:
<code>private void validateJBIDE22704() { BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage(); applicationName = new LabeledText("Name: ").getText(); assertNotNull(applicationName); assertTrue(applicationName.length() > 0); String gitUrl = new LabeledText("Git Repository URL:").getText(); assertNotNull(gitUrl); if (gitUrl.length() < 1){ <START> new CancelButton().click(); <END> throw new OpenshiftTestInFailureException("JBIDE-23704 should be fixed now."); } new WaitUntil(new WidgetIsEnabled(new NextButton())); new NextButton().click(); new WaitUntil(new WidgetIsEnabled(new BackButton())); int numberofEnvironmentVariables = new DefaultTable().rowCount(); assertTrue(numberofEnvironmentVariables > 0); new NextButton().click(); new WaitUntil(new WidgetIsEnabled(new BackButton())); int numberOfServicePorts = new DefaultTable().rowCount(); assertTrue(numberOfServicePorts > 0); new CancelButton().click(); new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120)); }</code><technical_language>I suggest add wait for shell is supposed cancelled</technical_language>

Target:
private void validateJBIDE22704() { BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage(); applicationName = new LabeledText("Name: ").getText(); assertNotNull(applicationName); assertTrue(applicationName.length() > 0); String gitUrl = new LabeledText("Git Repository URL:").getText(); assertNotNull(gitUrl); if (gitUrl.length() < 1){ new CancelButton().click(); new WaitWhile(new ShellWithTextIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD)); throw new OpenshiftTestInFailureException("JBIDE-23704 should be fixed now."); } new WaitUntil(new WidgetIsEnabled(new NextButton())); new NextButton().click(); new WaitUntil(new WidgetIsEnabled(new BackButton())); int numberofEnvironmentVariables = new DefaultTable().rowCount(); assertTrue(numberofEnvironmentVariables > 0); new NextButton().click(); new WaitUntil(new WidgetIsEnabled(new BackButton())); int numberOfServicePorts = new DefaultTable().rowCount(); assertTrue(numberOfServicePorts > 0); new CancelButton().click(); new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120)); }
Source:
<code>private boolean hasProjectPermission(String userName, Permission permission, RoleBasedAuthorizationStrategy rbas) { <START> LOGGER.debug("Check the project permission of the user " + userName + " " + rbas.getGrantedRoles(RoleBasedAuthorizationStrategy.PROJECT)); <END> return hasPermission(userName, permission, rbas.getGrantedRoles(RoleBasedAuthorizationStrategy.PROJECT)); }</code><technical_language>Slow logging</technical_language>

Target:
private boolean hasProjectPermission(String userName, Permission permission, RoleBasedAuthorizationStrategy rbas) { return hasPermission(userName, permission, rbas.getGrantedRoles(RoleBasedAuthorizationStrategy.PROJECT)); }
Source:
<code><START> public void testGetOptionalExpressionWhenIsPresent() { <END> final View content = mock(View.class); final Decision decision = mock(Decision.class); when(node.getContent()).thenReturn(content); when(content.getDefinition()).thenReturn(decision); when(decision.getExpression()).thenReturn(null); final Optional<Expression> optionalExpression = helper.getOptionalExpression(node); assertFalse(optionalExpression.isPresent()); }</code><technical_language>I testGetOptionalExpressionWhenIsPresent testGetOptionalExpressionWhenIsNotPresent swapped</technical_language>

Target:
public void testGetOptionalExpressionWhenIsPresent() { final View content = mock(View.class); final Decision decision = mock(Decision.class); final Expression expectedExpression = mock(Expression.class); when(node.getContent()).thenReturn(content); when(content.getDefinition()).thenReturn(decision); when(decision.getExpression()).thenReturn(expectedExpression); final Optional<Expression> optionalExpression = helper.getOptionalExpression(node); assertTrue(optionalExpression.isPresent()); assertEquals(expectedExpression, optionalExpression.get()); }
Source:
<code>public void onActivated(OnActivatedComponent event, EntityRef entityRef, LASTeamComponent team, LocationComponent locationComponent) { <START> logger.info("activated " + entityRef + " " + team.team); <END> Set<EntityRef> teamEntities = teams.get(team.team); if (teamEntities == null) { teamEntities = Sets.newHashSet(); teams.put(team.team, teamEntities); } teamEntities.add(entityRef); entities.add(entityRef); WorkTargetComponent component = new WorkTargetComponent(); component.workUri = "LightAndShadow:attackMinion" + team.team; entityRef.addComponent(component); }</code><technical_language>Please remove log statements this PR is merge ready</technical_language>

Target:
public void onActivated(OnActivatedComponent event, EntityRef entityRef, LASTeamComponent team, LocationComponent locationComponent) { Set<EntityRef> teamEntities = teams.get(team.team); if (teamEntities == null) { teamEntities = Sets.newHashSet(); teams.put(team.team, teamEntities); } teamEntities.add(entityRef); entities.add(entityRef); WorkTargetComponent component = new WorkTargetComponent(); component.workUri = "LightAndShadow:attackMinion" + team.team; entityRef.addComponent(component); }
Source:
<code>public CompletableFuture<List<TableDescriptor>> listTableDescriptors(boolean arg0) { <START> throw new UnsupportedOperationException("updateConfiguration"); END> }</code><technical_language>this method implementable</technical_language>

Target:
public CompletableFuture<List<TableDescriptor>> listTableDescriptors(boolean arg0) { throw new UnsupportedOperationException("listTableDescriptors"); }
Source:
<code>public ValidationResult validate(ConfigKey key, String value) { boolean returnValue = true; StringTokenizer tokenizer = new StringTokenizer(value, ","); while (tokenizer.hasMoreElements()) { String token = (String) tokenizer.nextElement(); String[] pair = token.split(":", -1); String password = pair[1]; <START> if (!pwdValueHelper.validate(null, password).isOk()) { <END> returnValue = false; break; } } return new ValidationResult(returnValue); }</code><technical_language>result details, return it, instead of constructing a new below</technical_language>

Target:
public ValidationResult validate(ConfigKey key, String value) { StringTokenizer tokenizer = new StringTokenizer(value, ","); while (tokenizer.hasMoreElements()) { String token = (String) tokenizer.nextElement(); String[] pair = token.split(":", -1); String password = pair[1]; ValidationResult validationResult = pwdValueHelper.validate(null, password); if (!validationResult.isOk()) { return validationResult; } } return new ValidationResult(true); }
Source:
<code><START> private boolean shouldAdd(String dimName) <END> { final boolean belowThreshold = pQueue.size() < this.threshold; final boolean belowMax = belowThreshold || this.comparator.compare(pQueue.peek().getTopNMetricVal(), dimName) < 0; return belowMax && comparator.compare(dimName, previousStop) > 0; }</code><technical_language>Is avoid copy pasting code reuse code other topnresultbuilders</technical_language>

Target:
private boolean shouldAdd(String dimName) { final boolean belowThreshold = pQueue.size() < threshold; final boolean belowMax = belowThreshold || comparator.compare(pQueue.peek().getTopNMetricVal(), dimName) < 0; return belowMax && (previousStop == null || comparator.compare(dimName, previousStop) > 0); }
Source:
<code>public R save(@RequestParam("name") String name, @RequestParam("definition") String definition, @RequestParam(value = "deploy", defaultValue = "true") boolean deploy) { final D moduleDefinition = createDefinition(name, definition); final D savedModuleDefinition = deployer.save(moduleDefinition); if (deploy) { <START> Map<String, String> emptyMap = Collections.emptyMap(); <END> deployer.deploy(name, emptyMap); } final R result = resourceAssemblerSupport.toResource(savedModuleDefinition); return result; }</code><technical_language>collapsing this line IMO</technical_language>

Target:
public R save(@RequestParam("name") String name, @RequestParam("definition") String definition, @RequestParam(value = "deploy", defaultValue = "true") boolean deploy) { final D moduleDefinition = createDefinition(name, definition); final D savedModuleDefinition = deployer.save(moduleDefinition); if (deploy) { deployer.deploy(name, Collections.<String, String> emptyMap()); } final R result = resourceAssemblerSupport.toResource(savedModuleDefinition); return result; }
Source:
<code>private void completeRequest(boolean closeNetworkChannel, boolean shouldDelay) { if ((closeNetworkChannel || forceClose) && ctx.channel().isOpen()) { <START> if (!shouldDelay || (request != null && !request.getRestMethod().equals(RestMethod.POST)) || (this.nettyConfig.nettyServerCloseDelayTimeoutMs == 0)) { <END> writeFuture.addListener(ChannelFutureListener.CLOSE); } else { writeFuture.addListener(DELAYED_CLOSE); nettyMetrics.delayedCloseScheduledCount.inc(); } logger.trace("Requested closing of channel {}", ctx.channel()); } closeRequest(); }</code><technical_language>Need format this class for line wrapping. In LI Intellij, do Code/Reformat Code key shortcut Cmd-Alt-L</technical_language>

Target:
private void completeRequest(boolean closeNetworkChannel, boolean shouldDelay) { if ((closeNetworkChannel || forceClose) && ctx.channel().isOpen()) { if (shouldDelay && (request != null && request.getRestMethod().equals(RestMethod.POST)) && this.nettyConfig.nettyServerCloseDelayTimeoutMs > 0) { nettyMetrics.delayedCloseScheduledCount.inc(); writeFuture.addListener(DELAYED_CLOSE); } else { writeFuture.addListener(ChannelFutureListener.CLOSE); } logger.trace("Requested closing of channel {}", ctx.channel()); } closeRequest(); }
Source:
<code>public ActionResult execute() { <START> String blobKey = getNonNullRequestParamValue(Const.ParamsNames.BLOB_KEY); <END> logic.deletePicture(new BlobKey(blobKey)); logic.deletePictureKey(userInfo.id); return new JsonResult("Your profile picture has been deleted successfully", HttpStatus.SC_OK); }</code><technical_language>This is dangerous. Meaning blob key, delete else's profile picture</technical_language>

Target:
public ActionResult execute() { String googleId = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_ID); StudentProfileAttributes studentProfileAttributes = logic.getStudentProfile(googleId); if (studentProfileAttributes == null) { return new JsonResult("Invalid student profile", HttpStatus.SC_NOT_FOUND); } logic.deletePicture(new BlobKey(studentProfileAttributes.pictureKey)); logic.deletePictureKey(userInfo.id); return new JsonResult("Your profile picture has been deleted successfully", HttpStatus.SC_OK); }
Source:
<code>public void deprecatesDefaultImage() throws IOException { final Profile profile = this.profile( new XMLDocument( StringUtils.join( "<p>", "<entry key='docker'>", "<entry key='image'>yegor256/rultor</entry>", "</entry>", "</p>" ) ) ); final Talk talk = this.talk(profile); final String dir = talk.read().xpath("/talk/daemon/dir/text()").get(0); MatcherAssert.assertThat( dir, <START> Matchers.notNullValue() <END> ); }</code><technical_language>@essobedo join this line</technical_language>

Target:
public void deprecatesDefaultImage() throws IOException { final Talk talk = this.talk(); final XML xml = talk.read(); for (final String path : xml.xpath("/p/entry[@key='merge']/entry[@key='script']") ) { if ("yegor256/rultor".equals(path)) { final String dir = talk.read() .xpath("/talk/daemon/dir/text()").get(0); MatcherAssert.assertThat( dir, StringStartsWith.startsWith("#### Deprecation Notice ####") ); } } }
Source:
<code><START> private RowDataPoint dataPointFor(final Row row) { <END> final ColumnDefinitions columnDefinitions = row.getColumnDefinitions(); if (columnDefinitions.contains("long_value")) { return new RowLongDataPoint(); } else { throw new AssertionError("row does not contain any known type"); } }</code><technical_language>need define types of datapoints (rows) for float_value double_value</technical_language>

Target:
private RowDataPoint dataPointFor(final Row row) { final ColumnDefinitions columnDefinitions = row.getColumnDefinitions(); if (columnDefinitions.contains("long_value")) { return new RowDataPoint.RowLongDataPoint(); } else if (columnDefinitions.contains("float_value")) { return new RowDataPoint.RowFloatDataPoint(); } else if (columnDefinitions.contains("double_value")) { return new RowDataPoint.RowDoubleDataPoint(); } else { throw new AssertionError("row does not contain any known type"); } }
Source:
<code>public void save() { try (BufferedWriter writer = Files.newBufferedWriter(getConfigFile(), TerasologyConstants.CHARSET)) { createGson().toJson(config, writer); } catch (IOException e) { logger.error("Failed to save config", e); } <START> CoreRegistry.get(FlexibleConfigManager.class).save(); <END> }</code><technical_language>instance of this config class is created in ConfigurationSubsystem. Please, pass Context it, construction, CoreRegistry</technical_language>

Target:
public void save() { try (BufferedWriter writer = Files.newBufferedWriter(getConfigFile(), TerasologyConstants.CHARSET)) { createGson().toJson(config, writer); } catch (IOException e) { logger.error("Failed to save config", e); } context.get(FlexibleConfigManager.class).saveAllConfigs(); }
Source:
<code>public void podTemplateWithMultipleLabels() throws Exception { PodTemplate pt = new PodTemplate(); pt.setName("podTemplate"); pt.setLabel("label1 label2"); ContainerTemplate jnlp = new ContainerTemplate("jnlp", "jenkins/jnlp-slave:3.35-5-alpine"); pt.setContainers(Collections.singletonList(jnlp)); cloud.addTemplate(pt); SemaphoreStep.waitForStart("pod/1", b); <START> Map<String, String> labels = getLabels(cloud, this, name); <END> labels.put("jenkins/label","label1_label2"); PodList pods = cloud.connect().pods().withLabels(labels).list(); assertThat( "Expected one pod with labels " + labels + " but got: " + pods.getItems().stream().map(pod -> pod.getMetadata()).collect(Collectors.toList()), pods.getItems(), hasSize(1)); SemaphoreStep.success("pod/1", null); r.assertBuildStatusSuccess(r.waitForCompletion(b)); }</code><technical_language>Do expect Computer original labels label1 & label2? I guess <LINK_0> tests this implicitly for benefit of readers good assert this explicitly</technical_language>

Target:
public void podTemplateWithMultipleLabels() throws Exception { PodTemplate pt = new PodTemplate(); pt.setName("podTemplate"); pt.setLabel("label1 label2"); ContainerTemplate jnlp = new ContainerTemplate("jnlp", "jenkins/jnlp-slave:3.35-5-alpine"); pt.setContainers(Collections.singletonList(jnlp)); cloud.addTemplate(pt); SemaphoreStep.waitForStart("pod/1", b); Map<String, String> labels = getLabels(cloud, this, name); labels.put("jenkins/label","label1_label2"); KubernetesSlave node = r.jenkins.getNodes().stream() .filter(KubernetesSlave.class::isInstance) .map(KubernetesSlave.class::cast) .findAny().get(); assertTrue(node.getAssignedLabels().containsAll(Label.parse("label1 label2"))); PodList pods = cloud.connect().pods().withLabels(labels).list(); assertThat( "Expected one pod with labels " + labels + " but got: " + pods.getItems().stream().map(pod -> pod.getMetadata()).collect(Collectors.toList()), pods.getItems(), hasSize(1)); SemaphoreStep.success("pod/1", null); r.assertBuildStatusSuccess(r.waitForCompletion(b)); }
Source:
<code>private IStatus getModuleStatus(String moduleName) { StatusInfo status= new StatusInfo(); <START> if (moduleName.length() > 0) { <END> IStatus val= validateModuleName(moduleName); if (val.getSeverity() == IStatus.ERROR) { status.setError(Messages.format(NewWizardMessages.NewModuleInfoWizardPage_error_InvalidModuleName, val.getMessage())); } else if (val.getSeverity() == IStatus.WARNING) { status.setWarning(Messages.format(NewWizardMessages.NewModuleInfoWizardPage_warning_DiscouragedModuleName, val.getMessage())); } } else { status.setError(NewWizardMessages.NewModuleInfoWizardPage_error_EnterName); } return status; }</code><technical_language>Add a null check</technical_language>

Target:
private IStatus getModuleStatus(String moduleName) { StatusInfo status= new StatusInfo(); if (moduleName != null && moduleName.length() > 0) { IStatus val= validateModuleName(moduleName); if (val.getSeverity() == IStatus.ERROR) { status.setError(Messages.format(NewWizardMessages.NewModuleInfoWizardPage_error_InvalidModuleName, val.getMessage())); } else if (val.getSeverity() == IStatus.WARNING) { status.setWarning(Messages.format(NewWizardMessages.NewModuleInfoWizardPage_warning_DiscouragedModuleName, val.getMessage())); } } else { status.setError(NewWizardMessages.NewModuleInfoWizardPage_error_EnterName); } return status; }
Source:
<code>public void testWithInvalidForcedQualifier() throws Exception { MavenProject project = getProject("projects/buildqualifier", "p001/pom.xml"); BuildQualifierMojo mojo = createMojoWithProject(project); setVariableValueToObject(mojo, "forceContextQualifier", "invalid:Qualifier"); try { mojo.execute(); fail(); } catch (MojoFailureException e) { <START> assertEquals( "Invalid build qualifier, it does not match the OSGi qualifier constraint ([0..9]|[a..zA..Z]|'_'|'-')", e.getMessage()); <END> } }</code><technical_language>assertThat(e.getMessage(), containsString("Invalid build qualifier")</technical_language>

Target:
public void testWithInvalidForcedQualifier() throws Exception { MavenProject project = getProject("projects/buildqualifier", "p001/pom.xml"); BuildQualifierMojo mojo = createMojoWithProject(project); setVariableValueToObject(mojo, "forceContextQualifier", "invalid:Qualifier"); try { mojo.execute(); fail(); } catch (MojoFailureException e) { assertThat(e.getMessage(), containsString("Invalid build qualifier")); } }
Source:
<code>protected void doAppend(ByteBuffer bb) { <START> throw new IllegalStateException("Can not add to this buffer!"); <END> }</code><technical_language>UnsupportedOperationException a fit me</technical_language>

Target:
protected void doAppend(ByteBuffer bb) { throw new UnsupportedOperationException("Can not add to this buffer!"); }
Source:
<code>public int compare(String o1, String o2) { LocalDate dateA; LocalDate dateB; try { dateA = LocalDate.parse(o1, DateTimeFormatter.ofPattern( campaign.getCampaignOptions().getDisplayDateFormat())); } catch (Exception ignored) { <START> if ("-".equals(o2) && "-".equals(o1)) { <END> return 0; } else if ("-".equals(o1)) { return 1; } else { return -1; } } try { dateB = LocalDate.parse(o2, DateTimeFormatter.ofPattern( campaign.getCampaignOptions().getDisplayDateFormat())); } catch (Exception ignored) { return -1; } return dateA.compareTo(dateB); }</code><technical_language>try first</technical_language>

Target:
public int compare(String o1, String o2) { if (Objects.equals(o1, o2)) { return 0; } else if ("-".equals(o1)) { return -1; } else if ("-".equals(o2)) { return 1; } LocalDate dateA; LocalDate dateB; try { dateA = LocalDate.parse(o1, DateTimeFormatter.ofPattern( campaign.getCampaignOptions().getDisplayDateFormat())); } catch (Exception ignored) { return -1; } try { dateB = LocalDate.parse(o2, DateTimeFormatter.ofPattern( campaign.getCampaignOptions().getDisplayDateFormat())); } catch (Exception ignored) { return 1; } return dateA.compareTo(dateB); }
Source:
<code>public static int getNextFreeDimId() { <START> int next = 0; <END> while (true) { while (usedIds.contains(next)) next++; if (checkAvailable(next)) return next; } }</code><technical_language>need start zero time, a static var holding returned value. A from-scratch search need done launch avoids issues uninstalled mods</technical_language>

Target:
public static int getNextFreeDimId() { int next = lastUsedId; while (usedIds.contains(next) || !checkAvailable(next)) { next++; } return lastUsedId = next; }
Source:
<code>private ApiDefinition getApiDefinitionForPaginatedList(boolean requiresFullDetails, Class<?> clazz) { ApiDefinition apiDefinition; <START> if (requiresFullDetails == true) { <END> apiDefinition = new ApiDefinition(ApiType.GET_LIST_WITH_DETAILS, clazz); } else { apiDefinition = new ApiDefinition(ApiType.GET_LIST, clazz); } return apiDefinition; }</code><technical_language>"== true"</technical_language>

Target:
private ApiDefinition getApiDefinitionForPaginatedList(boolean requiresFullDetails, Class<?> clazz) { ApiDefinition apiDefinition; if (requiresFullDetails) { apiDefinition = new ApiDefinition(ApiType.GET_LIST_WITH_DETAILS, clazz); } else { apiDefinition = new ApiDefinition(ApiType.GET_LIST, clazz); } return apiDefinition; }
Source:
<code>public static MediaLayout buildComprehensiveLayout(Context context, TextView text, String audioURI, String imageURI, final String videoURI, final String bigImageURI, final String qrCodeContent, String inlineVideoURI, final String ttsText, int questionIndex) { MediaLayout mediaLayout = new MediaLayout(context); mediaLayout.setAVT(text, audioURI, imageURI, videoURI, bigImageURI, qrCodeContent, inlineVideoURI, false, questionIndex); <START> if (ttsText != null && audioURI == null && imageURI == null && videoURI == null <END> && qrCodeContent == null && inlineVideoURI == null) { mediaLayout.showTtsButton(ttsText); } return mediaLayout; }</code><technical_language>I tts shown irrespective of other media content audioURI i.e. audioURI is present want TTS settings effect in other cases if TTS is enabled, show TTS button</technical_language>

Target:
public static MediaLayout buildComprehensiveLayout(Context context, TextView text, String audioURI, String imageURI, final String videoURI, final String bigImageURI, final String qrCodeContent, String inlineVideoURI, final String ttsText, int questionIndex) { MediaLayout mediaLayout = new MediaLayout(context); mediaLayout.setAVT(text, audioURI, imageURI, videoURI, bigImageURI, qrCodeContent, inlineVideoURI, false, questionIndex); if (ttsText != null && audioURI == null) { mediaLayout.showTtsButton(ttsText); } return mediaLayout; }
Source:
<code>private void showException(PageBook pageBook, FormText exceptionText, Throwable e) { JBossCentralActivator.log(e); StringBuffer message = new StringBuffer("An error occurred"); if(e.getMessage()!=null) { message.append(": " + StringEscapeUtils.escapeXml(e.getMessage())); <START> } else if (e.getClass().getCanonicalName()!=null) { <END> message.append(": " + e.getClass().getCanonicalName()); } message.append(". See error log for details"); String text = JBossCentralActivator.FORM_START_TAG + "<img href=\"image\"/> " + message.toString() + JBossCentralActivator.FORM_END_TAG; exceptionText.setText(text, true, false); Image image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); exceptionText.setImage("image", image); pageBook.showPage(exceptionText); }</code><technical_language>e.getClass().getCanonicalName() null</technical_language>

Target:
private void showException(PageBook pageBook, FormText exceptionText, Throwable e) { JBossCentralActivator.log(e); StringBuffer message = new StringBuffer("An error occurred"); if(e.getMessage()!=null) { message.append(": " + StringEscapeUtils.escapeXml(e.getMessage())); } else if (e.getClass().getCanonicalName()!=null) { message.append(": " + e.getClass().getCanonicalName()); } message.append(". Open the Error view for more details"); String text = JBossCentralActivator.FORM_START_TAG + "<img href=\"image\"/> " + message.toString() + JBossCentralActivator.FORM_END_TAG; exceptionText.setText(text, true, false); Image image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); exceptionText.setImage("image", image); pageBook.showPage(exceptionText); }
Source:
<code>private OzoneManagerRatisServer(Configuration conf, OzoneManagerServerProtocol om, String raftGroupIdStr, RaftPeerId localRaftPeerId, InetSocketAddress addr, List<RaftPeer> raftPeers) throws IOException { this.ozoneManager = om; this.omRatisAddress = addr; this.port = addr.getPort(); RaftProperties serverProperties = newRaftProperties(conf); this.raftPeerId = localRaftPeerId; this.raftGroupId = RaftGroupId.valueOf( getRaftGroupIdFromOmServiceId(raftGroupIdStr)); this.raftGroup = RaftGroup.valueOf(raftGroupId, raftPeers); StringBuilder raftPeersStr = new StringBuilder(); for (RaftPeer peer : raftPeers) { raftPeersStr.append(", ").append(peer.getAddress()); } LOG.info("Instantiating OM Ratis server with GroupID: and " + "Raft Peers: {}", raftGroupIdStr, raftPeersStr.toString().substring(2)); <START> this.omStateMachine = getStateMachine(this.raftGroupId); <END> this.server = RaftServer.newBuilder() .setServerId(this.raftPeerId) .setGroup(this.raftGroup) .setProperties(serverProperties) .setStateMachine(omStateMachine) .build(); this.scheduledRoleChecker = Executors.newSingleThreadScheduledExecutor(); this.scheduledRoleChecker.scheduleWithFixedDelay(new Runnable() { @Override public void run() { if (cachedPeerRole.isPresent() && cachedPeerRole.get() == RaftPeerRole.LEADER) { updateServerRole(); } } }, roleCheckInitialDelayMs, roleCheckIntervalMs, TimeUnit.MILLISECONDS); }</code><technical_language>Here, passing raftGroupId getStateMachine, param in method</technical_language>

Target:
private OzoneManagerRatisServer(Configuration conf, OzoneManagerServerProtocol om, String raftGroupIdStr, RaftPeerId localRaftPeerId, InetSocketAddress addr, List<RaftPeer> raftPeers) throws IOException { this.ozoneManager = om; this.omRatisAddress = addr; this.port = addr.getPort(); RaftProperties serverProperties = newRaftProperties(conf); this.raftPeerId = localRaftPeerId; this.raftGroupId = RaftGroupId.valueOf( getRaftGroupIdFromOmServiceId(raftGroupIdStr)); this.raftGroup = RaftGroup.valueOf(raftGroupId, raftPeers); StringBuilder raftPeersStr = new StringBuilder(); for (RaftPeer peer : raftPeers) { raftPeersStr.append(", ").append(peer.getAddress()); } LOG.info("Instantiating OM Ratis server with GroupID: and " + "Raft Peers: {}", raftGroupIdStr, raftPeersStr.toString().substring(2)); this.omStateMachine = getStateMachine(); this.server = RaftServer.newBuilder() .setServerId(this.raftPeerId) .setGroup(this.raftGroup) .setProperties(serverProperties) .setStateMachine(omStateMachine) .build(); this.scheduledRoleChecker = Executors.newSingleThreadScheduledExecutor(); this.scheduledRoleChecker.scheduleWithFixedDelay(new Runnable() { @Override public void run() { if (cachedPeerRole.isPresent() && cachedPeerRole.get() == RaftPeerRole.LEADER) { updateServerRole(); } } }, roleCheckInitialDelayMs, roleCheckIntervalMs, TimeUnit.MILLISECONDS); }
Source:
<code>public void link(Attributes attributes, String hrefOrHashName, String text) { <START> if (hrefOrHashName != null) { <END> assertOpenBlock(); try { currentBlock.write('"'); writeAttributes(attributes); currentBlock.write(text); currentBlock.write('"'); currentBlock.write(':'); currentBlock.write(hrefOrHashName); } catch (IOException e) { throw new RuntimeException(e); } } }</code><technical_language>This "lossy" in attributes text of link lost if is link target. prefer this emit possible, simply omit href if needed, e.g. if (hrefOrHashName == null) { hrefOrHashName = ""; } other builders</technical_language>

Target:
public void link(Attributes attributes, String hrefOrHashName, String text) { assertOpenBlock(); try { currentBlock.write('"'); writeAttributes(attributes); currentBlock.write(text); currentBlock.write('"'); currentBlock.write(':'); if (hrefOrHashName != null) { currentBlock.write(hrefOrHashName); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>private static boolean checkData( Member[][] nonAllMembers, int cnt, Set<Member> measureSet, Evaluator evaluator) { if (cnt < 0) { boolean found = false; Object value = evaluator.evaluateCurrent(); if (value != null && !(value instanceof Throwable)) { found = true; } <START> if (!measureSet.isEmpty()) { <END> for (Member measure : measureSet) { evaluator.setContext(measure); value = evaluator.evaluateCurrent(); if (value != null && !(value instanceof Throwable)) { found = true; } } } return found; } else { boolean found = false; for (Member m : nonAllMembers[cnt]) { evaluator.setContext(m); if (checkData(nonAllMembers, cnt - 1, measureSet, evaluator)) { found = true; } } return found; } }</code><technical_language>Hey @Advent51 - I understand fix. explain some? actually, putting a detail change addresses problem is more useful a commit message "Fixed." :)</technical_language>

Target:
private static boolean checkData( Member[][] nonAllMembers, int cnt, Set<Member> measureSet, Evaluator evaluator) { if (cnt < 0) { if (measureSet.isEmpty()) { Object value = evaluator.evaluateCurrent(); if (value != null && !(value instanceof Throwable)) { return true; } } else { boolean found = false; for (Member measure : measureSet) { evaluator.setContext(measure); Object value = evaluator.evaluateCurrent(); if (value != null && !(value instanceof Throwable)) { found = true; } } return found; } } else { boolean found = false; for (Member m : nonAllMembers[cnt]) { evaluator.setContext(m); if (checkData(nonAllMembers, cnt - 1, measureSet, evaluator)) { found = true; } } return found; } return false; }
Source:
<code>public ShortcutManager shortcutManager() { <START> return new ShortcutManager(shortcutDirectory, <END> desktopShortcutDirectory, libraryManager(), scriptsConfiguration.scriptInterpreter(), new ObjectMapper()); }</code><technical_language>I remember a Bean for ObjectMapper</technical_language>

Target:
public ShortcutManager shortcutManager() { return new ShortcutManager(shortcutDirectory, desktopShortcutDirectory, libraryManager(), scriptsConfiguration.scriptInterpreter(), phoenicisGlobalConfiguration.objectMapper()); }
Source:
<code>public static String subtractFromCurrentTime(int days) { <START> Calendar calendar = Calendar.getInstance(); <END> calendar.add(Calendar.DAY_OF_YEAR, -days); return FormatUtil.getTimeZoneFormat().format(calendar.getTime()); }</code><technical_language>system time get calendar</technical_language>

Target:
public static String subtractFromCurrentTime(int days) { Calendar calendar = SystemTime.asCalendar(); calendar.add(Calendar.DAY_OF_YEAR, -days); return FormatUtil.getTimeZoneFormat().format(calendar.getTime()); }
Source:
<code>public void addAlias(final String indexSuffix) { final Timer.Context timeRemoveAlias = updateAliasTimer.time(); try { String indexName = indexIdentifier.getIndex(indexSuffix); final AdminClient adminClient = esProvider.getClient().admin(); String[] indexNames = getIndexesFromEs( AliasType.Write ); final IndicesAliasesRequestBuilder aliasesRequestBuilder = adminClient.indices().prepareAliases(); for ( String currentIndex : indexNames ) { aliasesRequestBuilder.removeAlias( currentIndex, alias.getWriteAlias() ); <START> logger.info("Removing existing write Alias Name from Index [{}]", alias.getReadAlias(), currentIndex); <END> } aliasesRequestBuilder.addAlias( indexName, alias.getReadAlias()); logger.info("Created new read Alias Name on Index [{}]", alias.getReadAlias(), indexName); aliasesRequestBuilder.addAlias( indexName, alias.getWriteAlias() ); logger.info("Created new write Alias Name on Index [{}]", alias.getWriteAlias(), indexName); final IndicesAliasesResponse result = aliasesRequestBuilder.execute().actionGet(); final boolean isAcknowledged = result.isAcknowledged(); if(!isAcknowledged){ throw new RuntimeException( "Unable to add aliases to the new index " + indexSuffix ); } } finally{ aliasCache.invalidate(alias); timeRemoveAlias.stop(); } }</code><technical_language>If this removes writeAlias, logging removed alias.getWriteAlias instead of alias.getReadAlias</technical_language>

Target:
public void addAlias(final String indexSuffix) { final Timer.Context timeRemoveAlias = updateAliasTimer.time(); try { String indexName = indexIdentifier.getIndex(indexSuffix); final AdminClient adminClient = esProvider.getClient().admin(); String[] indexNames = getIndexesFromEs( AliasType.Write ); final IndicesAliasesRequestBuilder aliasesRequestBuilder = adminClient.indices().prepareAliases(); for ( String currentIndex : indexNames ) { aliasesRequestBuilder.removeAlias( currentIndex, alias.getWriteAlias() ); logger.info("Removing existing write Alias Name from Index [{}]", alias.getWriteAlias(), currentIndex); } aliasesRequestBuilder.addAlias( indexName, alias.getReadAlias()); logger.info( "Created new read Alias Name on Index [{}]", alias.getReadAlias(), indexName); aliasesRequestBuilder.addAlias( indexName, alias.getWriteAlias() ); logger.info("Created new write Alias Name on Index [{}]", alias.getWriteAlias(), indexName); final IndicesAliasesResponse result = aliasesRequestBuilder.execute().actionGet(); final boolean isAcknowledged = result.isAcknowledged(); if(!isAcknowledged){ throw new RuntimeException( "Unable to add aliases to the new index " + indexSuffix ); } } finally{ aliasCache.invalidate(alias); timeRemoveAlias.stop(); } }
Source:
<code>ImmutableSet<Integer> getPartitionKeys() throws NoConnectionsException, IOException, ProcCallException { if (!m_useClientAffinity || m_partitionKeys.get() == null) { <START> refreshPartitionKeys(); <END> } return m_partitionKeys.get(); }</code><technical_language>this get called more once</technical_language>

Target:
ImmutableSet<Integer> getPartitionKeys() throws NoConnectionsException, IOException, ProcCallException { refreshPartitionKeys(false); if (m_partitionUpdateStatus.get().getStatus() != ClientResponse.SUCCESS) { throw new ProcCallException(m_partitionUpdateStatus.get(), null, null); } return m_partitionKeys.get(); }
Source:
<code>private void readNextChunk() throws IOException { assert chunkStartOffsetIndex > 0; long highOffset = chunkStartOffsetIndex == offsetsLength ? totalSize : offsets[chunkStartOffsetIndex]; int newLowOffsetIndex = chunkStartOffsetIndex; while ( newLowOffsetIndex > 0 ) { long deltaOffset = highOffset - offsets[--newLowOffsetIndex]; if ( deltaOffset > CHUNK_SIZE ) { if ( chunkStartOffsetIndex - newLowOffsetIndex > 1 ) <START> { END> newLowOffsetIndex++; } break; } } assert chunkStartOffsetIndex - newLowOffsetIndex > 0; chunkLength = chunkStartOffsetIndex - newLowOffsetIndex; chunkStartOffsetIndex = newLowOffsetIndex; chunkCursor = 0; channel.setCurrentPosition( offsets[chunkStartOffsetIndex] ); chunkTransactions.clear(); for ( int i = 0; i < chunkLength; i++ ) { boolean success = transactionCursor.next(); assert success; chunkTransactions.add( transactionCursor.get() ); } }</code><technical_language>This sentence some love</technical_language>

Target:
private void readNextChunk() throws IOException { assert chunkStartOffsetIndex > 0; long highOffset = chunkStartOffsetIndex == offsetsLength ? totalSize : offsets[chunkStartOffsetIndex]; int newLowOffsetIndex = chunkStartOffsetIndex; while ( newLowOffsetIndex > 0 ) { long deltaOffset = highOffset - offsets[--newLowOffsetIndex]; if ( deltaOffset > CHUNK_SIZE ) { break; } } assert chunkStartOffsetIndex - newLowOffsetIndex > 0; int chunkLength = chunkStartOffsetIndex - newLowOffsetIndex; chunkStartOffsetIndex = newLowOffsetIndex; channel.setCurrentPosition( offsets[chunkStartOffsetIndex] ); assert chunkTransactions.isEmpty(); for ( int i = 0; i < chunkLength; i++ ) { boolean success = transactionCursor.next(); assert success; chunkTransactions.push( transactionCursor.get() ); } }
Source:
<code>public int findWikiIndex(String wikiCode) { <START> int index = ArrayUtils.indexOf(getWikiCodes(), wikiCode); <END> if (index == ArrayUtils.INDEX_NOT_FOUND) { return findWikiIndex(FALLBACK_WIKI_LANG_CODE); } return index; }</code><technical_language>Arrays.asList(getWikiCodes).indexOf(wikiCode) instead of importing a new library</technical_language>

Target:
public int findWikiIndex(String wikiCode) { int index = getWikiCodes().indexOf(wikiCode); if (index == -1) { return findWikiIndex(FALLBACK_WIKI_LANG_CODE); } return index; }
Source:
<code>public int getCooldown() { <START> return Balance.vpa.HALFINVULNERABLE_COOLDOWN; <END> }</code><technical_language>want do this in seconds, times 20</technical_language>

Target:
public int getCooldown() { return 20 * (Balance.vpa.HALFINVULNERABLE_COOLDOWN); }
Source:
<code>public SBlock executeSBlock(final VirtualFrame frame) { <START> return new SBlock(blockMethod, frame.materialize(), blockClass); <END> }</code><technical_language>point of this class is require frame. So, this is wrong here. Instead, [requiresContext()](<LINK_0> returns true, frame is needed</technical_language>

Target:
public SBlock executeSBlock(final VirtualFrame frame) { return new SBlock(blockMethod, null, blockClass); }
Source:
<code>public void testUpdate() { VirtualMachine vm = api().get(vmName); VirtualMachineProperties oldProperties = vm.properties(); StorageProfile oldStorageProfile = oldProperties.storageProfile(); String blob = storageService.storageServiceProperties().primaryEndpoints().get("blob"); VHD vhd = VHD.create(blob + "vhds/" + vmName + "new-data-disk.vhd"); DataDisk newDataDisk = DataDisk.create(vmName + "new-data-disk", "1", 1, vhd, "Empty"); List<DataDisk> oldDataDisks = oldStorageProfile.dataDisks(); ImmutableList<DataDisk> newDataDisks = ImmutableList.<DataDisk> builder().addAll(oldDataDisks).add(newDataDisk).build(); StorageProfile newStorageProfile = oldStorageProfile.toBuilder().dataDisks(newDataDisks).build(); VirtualMachineProperties newProperties = oldProperties.toBuilder().storageProfile(newStorageProfile).build(); VirtualMachine newVm = vm.toBuilder().properties(newProperties).build(); vm = api().createOrUpdate(vmName, newVm.location(), newVm.properties(), newVm.tags(), newVm.plan()); <START> assertEquals(vm.properties().storageProfile().dataDisks().size(), 2); <END> }</code><technical_language>assert equal oldDataDisks.size() + 1 (or assert earlier oldDataDisks size is 1)</technical_language>

Target:
public void testUpdate() { VirtualMachine vm = api().get(vmName); VirtualMachineProperties oldProperties = vm.properties(); StorageProfile oldStorageProfile = oldProperties.storageProfile(); String blob = storageService.storageServiceProperties().primaryEndpoints().get("blob"); VHD vhd = VHD.create(blob + "vhds/" + vmName + "new-data-disk.vhd"); DataDisk newDataDisk = DataDisk.create(vmName + "new-data-disk", "1", 1, vhd, "Empty"); List<DataDisk> oldDataDisks = oldStorageProfile.dataDisks(); assertEquals(oldDataDisks.size(), 1); ImmutableList<DataDisk> newDataDisks = ImmutableList.<DataDisk> builder().addAll(oldDataDisks).add(newDataDisk).build(); StorageProfile newStorageProfile = oldStorageProfile.toBuilder().dataDisks(newDataDisks).build(); VirtualMachineProperties newProperties = oldProperties.toBuilder().storageProfile(newStorageProfile).build(); VirtualMachine newVm = vm.toBuilder().properties(newProperties).build(); vm = api().createOrUpdate(vmName, newVm.location(), newVm.properties(), newVm.tags(), newVm.plan()); assertEquals(vm.properties().storageProfile().dataDisks().size(), oldDataDisks.size() + 1); }
Source:
<code>public AdapterResponse<Feed> getFeed(GetFeedRequest getFeedRequest) { AdapterResponse<Feed> response; int pageSize = PAGE_SIZE; final String pageSizeString = getFeedRequest.getPageSize(); if (StringUtils.isNotBlank(pageSizeString)) { pageSize = Integer.parseInt(pageSizeString); } final String marker = getFeedRequest.getPageMarker(); <START> if (StringUtils.isNotBlank(marker) && marker.equals(MOCK_LAST_MARKER)) { <END> response = getLastPage(getFeedRequest, pageSize); } else if (StringUtils.isNotBlank(marker)) { response = getFeedPage(getFeedRequest, marker, pageSize); } else { response = getFeedHead(getFeedRequest, pageSize); } return response; }</code><technical_language>I this is a confusing, do this: if (StringUtils.isBlank(marker)) { response = getFeedHead(...) } else { if (marker.equals(MOCK_LAST_MARKER) { response = getLastPage(getFeedRequest, pageSize); } else { response = getFeedPage(getFeedRequest, marker, pageSize); } } if improves performance anything, read a me. do think</technical_language>

Target:
public AdapterResponse<Feed> getFeed(GetFeedRequest getFeedRequest) { AdapterResponse<Feed> response; int pageSize = PAGE_SIZE; final String pageSizeString = getFeedRequest.getPageSize(); if (StringUtils.isNotBlank(pageSizeString)) { pageSize = Integer.parseInt(pageSizeString); } final String marker = getFeedRequest.getPageMarker(); if ((StringUtils.isBlank(marker))) { response = getFeedHead(getFeedRequest, pageSize); } else if (marker.equals(MOCK_LAST_MARKER)) { response = getLastPage(getFeedRequest, pageSize); } else { response = getFeedPage(getFeedRequest, marker, pageSize); } return response; }
Source:
<code>public boolean deleteBaseDir() { boolean wasDeleted = baseDir.delete(); <START> if (wasDeleted) { <END> Runtime.getRuntime().removeShutdownHook(shutdownHook); } return wasDeleted; }</code><technical_language>I need necessarily check if returned true not, remove shutdown hook. check do this flag anyways</technical_language>

Target:
public boolean deleteBaseDir() { boolean wasDeleted = baseDir.delete(); if (! baseDir.exists()) { Runtime.getRuntime().removeShutdownHook(shutdownHook); } return wasDeleted; }