auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String toString() { return toStringHelper(this) .add("table", table.toString()) <START> .add("offset_start_ts", offsetStartTs) <END> .add("offset_end_ts", offsetEndTs).toString(); }</code><technical_language>s/offset_start_ts/startOffsetTimestamp/g generally, do put underscore in toString</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("table", table.toString()) .add("startOffsetTimestamp", startOffsetTimestamp) .add("endOffsetTimestamp", endOffsetTimestamp).toString(); }
Source:
<code>public HttpLogOptions setAllowedHeaderNames(final Set<String> allowedHeaderNames) { <START> this.allowedHeaderNames = allowedHeaderNames == null ? this.allowedHeaderNames : allowedHeaderNames; <END> return this; }</code><technical_language>If pass in null, clear out whitelist</technical_language>

Target:
public HttpLogOptions setAllowedHeaderNames(final Set<String> allowedHeaderNames) { this.allowedHeaderNames = allowedHeaderNames == null ? new HashSet<>() : allowedHeaderNames; return this; }
Source:
<code>public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException { if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED) && artifact.getAttributeCount(ContentUrl) > 0) { <START> if (presentationType.matches(WEB_PREVIEW, PresentationType.PREVIEW)) { <END> return SPECIALIZED_MATCH; } else if (presentationType.equals(DEFAULT_OPEN)) { return PRESENTATION_TYPE; } } return NO_MATCH; }</code><technical_language>instead of changing if condition, add following: } else if (presentationType.equals(PREVIEW)) { return PRESENTATION_SUBTYPE_MATCH;</technical_language>

Target:
public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException { if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED) && artifact.getAttributeCount(ContentUrl) > 0) { if (presentationType.matches(WEB_PREVIEW)) { return SPECIALIZED_MATCH; } else if (presentationType.equals(PresentationType.PREVIEW)) { return PRESENTATION_SUBTYPE_MATCH; } else if (presentationType.equals(DEFAULT_OPEN)) { return PRESENTATION_TYPE; } } return NO_MATCH; }
Source:
<code>public static String getEncryptedData(String message) { String[] lines = splitIntoLines(message, false); <START> String result = ""; <END> for (String line : lines) { result += line; } return result; }</code><technical_language>a StringBuilder :)</technical_language>

Target:
String getEncryptedData(String message) { String[] lines = splitIntoLines(message, false); StringBuilder result = new StringBuilder(); for (String line : lines) { result.append(line); } return result.toString(); }
Source:
<code>public void afterTextChanged(Editable s) { if(searchbox.getText() == s) { filterString = s.toString(); if(adapter != null) { adapter.applyFilter(filterString); <START> noSearchResults.setText(Localization.get("select.search.empty", new String[] {searchbox.getText().toString()})); <END> noSearchResults.setVisibility(adapter.getCount() == 0 ? View.VISIBLE : View.GONE); } } }</code><technical_language>possibly want another string if simply cases registered</technical_language>

Target:
public void afterTextChanged(Editable s) { if(searchbox.getText() == s) { filterString = s.toString(); if(adapter != null) { adapter.applyFilter(filterString); String query = searchbox.getText().toString(); if (!"".equals(query)) { searchResultStatus.setText(Localization.get("select.search.status", new String[] { ""+adapter.getCount(), ""+adapter.getFullCount(), query })); searchResultStatus.setVisibility(View.VISIBLE); } else { searchResultStatus.setVisibility(View.GONE); } } } }
Source:
<code>private long getArtifactTimeStamp(IToolChain toolChain) { IBuilder builder = toolChain.getBuilder(); IConfiguration configuration = toolChain.getParent(); URI buildLocationURI = ManagedBuildManager.getBuildLocationURI(configuration, builder); if (buildLocationURI != null) { if (!buildLocationURI.toString().endsWith("/")) { buildLocationURI = URI.create(buildLocationURI.toString() + "/"); } String artifactName = configuration.getArtifactName(); String artifactExt = configuration.getArtifactExtension(); String artifactPref = configuration.getOutputPrefix(artifactExt); if (artifactName.length() > 0) { if (artifactExt.length() > 0) artifactName += "." + artifactExt; if (artifactPref.length() > 0) artifactName = artifactPref + artifactName; try { artifactName = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, configuration); } catch (BuildMacroException e) { } <START> URI buildArtifactURI = URIUtil.append(buildLocationURI, artifactName); <END> try { IFileStore artifact = EFS.getStore(buildArtifactURI); org.eclipse.core.filesystem.IFileInfo info = (artifact == null) ? null : artifact.fetchInfo(); if ((info != null) && info.exists()) { return info.getLastModified(); } } catch (CoreException e) { } } } return 0; }</code><technical_language>This a place URI needs resolved EFSExtensionProvider.append(...)</technical_language>

Target:
private long getArtifactTimeStamp(IToolChain toolChain) { IBuilder builder = toolChain.getBuilder(); IConfiguration configuration = toolChain.getParent(); URI buildLocationURI = ManagedBuildManager.getBuildLocationURI(configuration, builder); if (buildLocationURI != null) { if (!buildLocationURI.toString().endsWith("/")) { buildLocationURI = URI.create(buildLocationURI.toString() + "/"); } String artifactName = configuration.getArtifactName(); String artifactExt = configuration.getArtifactExtension(); String artifactPref = configuration.getOutputPrefix(artifactExt); if (artifactName.length() > 0) { if (artifactExt.length() > 0) artifactName += "." + artifactExt; if (artifactPref.length() > 0) artifactName = artifactPref + artifactName; try { artifactName = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, configuration); } catch (BuildMacroException e) { } URI buildArtifactURI = EFSExtensionManager.getDefault().append(buildLocationURI, artifactName); try { IFileStore artifact = EFS.getStore(buildArtifactURI); org.eclipse.core.filesystem.IFileInfo info = (artifact == null) ? null : artifact.fetchInfo(); if ((info != null) && info.exists()) { return info.getLastModified(); } } catch (CoreException e) { } } } return 0; }
Source:
<code>public void addWorkMemberTest() { unit.addMember(workChildObj); ArgumentCaptor<ContentObject> captor = ArgumentCaptor.forClass(ContentObject.class); <START> verify(repository).addMember(eq(unit), captor.capture()); <END> ContentObject child = captor.getValue(); assertFalse("Should not be able to add Work to AdminUnit", child instanceof WorkObject); }</code><technical_language>is returned here? supposed throw exception for invalid member type</technical_language>

Target:
public void addWorkMemberTest() { unit.addMember(workChildObj); }
Source:
<code>public void should_distributeDataAmongMultipleServers_givenMultipleClients_AddingDifferentDataToSameSetConcurrently() throws InterruptedException { String key = "key"; List<String> members1 = makeMemberList(SET_SIZE, "member1-"); List<String> members2 = makeMemberList(SET_SIZE, "member2-"); Runnable addSetsWithClient1 = makeSADDRunnable(key, members1, jedis1); Runnable addSetsWithClient2 = makeSADDRunnable(key, members2, jedis2); runConcurrentThreads(addSetsWithClient1, addSetsWithClient2); Set<String> results = jedis3.smembers(key); <START> members1.addAll(members2); <END> assertThat(results.toArray()).containsExactlyInAnyOrder(members1.toArray()); }</code><technical_language>I this method clearer if top, initialize members1 members2 created a list of "allMembers" adding members1 members2 it. I this is mutating members1 adding members2 it</technical_language>

Target:
public void should_distributeDataAmongMultipleServers_givenMultipleClients_AddingDifferentDataToSameSetConcurrently() throws InterruptedException { String key = "key"; List<String> members1 = makeMemberList(SET_SIZE, "member1-"); List<String> members2 = makeMemberList(SET_SIZE, "member2-"); List<String> allMembers = new ArrayList<>(); allMembers.addAll(members1); allMembers.addAll(members2); CountDownLatch startThreads = new CountDownLatch(1); Runnable addSetsWithClient1 = makeSADDRunnable(key, members1, jedis1, startThreads); Runnable addSetsWithClient2 = makeSADDRunnable(key, members2, jedis2, startThreads); runConcurrentThreads(startThreads, addSetsWithClient1, addSetsWithClient2); Set<String> results = jedis3.smembers(key); assertThat(results.toArray()).containsExactlyInAnyOrder(allMembers.toArray()); }
Source:
<code>public boolean isBetween(Time start, Time end) { <START> return isAfter(start) && isBefore(end) || equals(start) || equals (end); <END> }</code><technical_language>add isAfterOrEqual</technical_language>

Target:
public boolean isBetween(Time start, Time end) { return isAfterOrEqual(start) && isBeforeOrEqual(end); }
Source:
<code>public void while_statement() { Lock lock = new ReentrantLock(); while (foo) { lock.tryLock(); } lock.unlock(); <START> while (Random.nextBoolean()) { <END> lock.tryLock(); lock = new ReentrantLock(); } lock.unlock(); }</code><technical_language>I get change this test case. behavior of handling fields changed changes. Moreover, class Random is imported, unknown method call, changes meaning of test</technical_language>

Target:
public void while_statement() { Lock lock = new ReentrantLock(); while (foo) { lock.tryLock(); } lock.unlock(); while (foo) { lock.tryLock(); lock = new ReentrantLock(); } lock.unlock(); }
Source:
<code>public BulkFileHandleDownloadRecordConfigurationProvider (CountingSemaphore semaphore, AmazonSQSClient awsSQSClient, AmazonSNSClient awsSNClient, BulkFileHandleDownloadRecordWorker worker, BulkFileHandleDownloadRecordTopicBucketInfo config, RunDuringNormalStateGate gate) { MessageDrivenWorkerStackConfiguration mdwsc = new MessageDrivenWorkerStackConfiguration(); mdwsc.setGate(gate); mdwsc.setQueueName(config.getQueueName()); mdwsc.setTopicNamesToSubscribe(Arrays.asList(config.getTopicName())); mdwsc.setRunner(worker); mdwsc.setSemaphoreLockAndMessageVisibilityTimeoutSec(60); mdwsc.setSemaphoreLockKey(SemaphoreKey.BULK_FILE_HANDLE_DOWNLOAD_RECORD_WORKER.name()); mdwsc.setSemaphoreMaxLockCount(1); Runnable runner = new MessageDrivenWorkerStack(semaphore, awsSQSClient, awsSNClient, mdwsc); this.config = new WorkerStackConfiguration(); this.config.setRunner(runner); this.config.setStartDelayMs(711); this.config.setPeriodMS(10*1000); <START> this.config.setWorkerName(BulkFileDownloadRecordWorker.class.getName()); <END> }</code><technical_language>BulkFuileHandleDownloadRecordWorker</technical_language>

Target:
public BulkFileHandleDownloadRecordConfigurationProvider (CountingSemaphore semaphore, AmazonSQSClient awsSQSClient, AmazonSNSClient awsSNClient, BulkFileHandleDownloadRecordWorker worker, BulkFileHandleDownloadRecordTopicBucketInfo config, RunDuringNormalStateGate gate) { MessageDrivenWorkerStackConfiguration mdwsc = new MessageDrivenWorkerStackConfiguration(); mdwsc.setGate(gate); mdwsc.setQueueName(config.getQueueName()); mdwsc.setTopicNamesToSubscribe(Arrays.asList(config.getTopicName())); mdwsc.setRunner(worker); mdwsc.setSemaphoreLockAndMessageVisibilityTimeoutSec(60); mdwsc.setSemaphoreLockKey(SemaphoreKey.BULK_FILE_HANDLE_DOWNLOAD_RECORD_WORKER.name()); mdwsc.setSemaphoreMaxLockCount(1); Runnable runner = new MessageDrivenWorkerStack(semaphore, awsSQSClient, awsSNClient, mdwsc); this.config = new WorkerStackConfiguration(); this.config.setRunner(runner); this.config.setStartDelayMs(711); this.config.setPeriodMS(10*1000); this.config.setWorkerName(BulkFileHandleDownloadRecordWorker.class.getName()); }
Source:
<code>public void authenticate(SignInMode requestedMode, final String token) { OpenIdUtil.SVC.discover(ssoUrl, requestedMode, false, token, new GerritCallback<DiscoveryResult>() { public void onSuccess(final DiscoveryResult result) { onDiscovery(result); } @Override public void onFailure(final Throwable caught) { <START> super.onFailure(caught); <END> } }); }</code><technical_language>This method necessary if is super implementation</technical_language>

Target:
public void authenticate(SignInMode requestedMode, final String token) { OpenIdUtil.SVC.discover(ssoUrl, requestedMode, false, token, new GerritCallback<DiscoveryResult>() { public void onSuccess(final DiscoveryResult result) { onDiscovery(result); } }); }
Source:
<code><START> public PageTitle(final String namespace, final String text, final Site site) { <END> this.namespace = namespace; this.text = text; this.fragment = null; this.site = site; }</code><technical_language>collapse this new constructor function "this(namespace, text, null, site);" here</technical_language>

Target:
public PageTitle(final String namespace, final String text, final Site site) { this(namespace, text, null, site); }
Source:
<code>public static void main(String[] args) { int exitStatus = 1; try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); if(argMap.containsKey("version")) { throw new ExitException( String.format("%1$s %2$s", Config.EXT_TESTTOOL_PACKAGE_DISPLAY_NAME, Config.EXT_TESTTOOL_PACKAGE_VERSION), 0 ); } List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); throw new ExitException("Modules: " + StringUtils.join(modules, ", "), 0); } if (others.isEmpty()) { throw new ExitException("Please provide module.", 0); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others); if (moduleService.doHelp()) { throw new ExitException(module + " help", 0); } loadExtensions(moduleService, argMap); moduleService.run(); } catch(ExitException e) { System.out.println(e.getMessage()); exitStatus = e.getExitCode(); } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); <START> t.printStackTrace(); <END> } System.exit(exitStatus); }</code><technical_language>this is done automatically in debug, no</technical_language>

Target:
public static void main(String[] args) { int exitStatus = 1; try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); if(argMap.containsKey("version")) { throw new ExitException( String.format("%1$s %2$s", Config.EXT_TESTTOOL_PACKAGE_DISPLAY_NAME, Config.EXT_TESTTOOL_PACKAGE_VERSION), 0 ); } List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); throw new ExitException("Modules: " + StringUtils.join(modules, ", "), 0); } if (others.size() < 2) { throw new ExitException("Please provide module and action.", 0); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others.remove(0), others); loadExtensions(moduleService, argMap); moduleService.run(); } catch(ExitException e) { System.out.println(e.getMessage()); exitStatus = e.getExitCode(); } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); } System.exit(exitStatus); }
Source:
<code>String[] getFontNames() { FontData[] fontNames = display.getFontList(null, true); String[] names = new String[fontNames.length]; int count = 0; mainfor: for (FontData <START> fontName2 : <END> fontNames) { String fontName = fontName2.getName(); if (fontName.startsWith("@")) continue; for (int j = 0; j < count; j++) { if (names[j].equals(fontName)) continue mainfor; } names[count++] = fontName; } if (count < names.length) { String[] newNames = new String[count]; System.arraycopy(names, 0, newNames, 0, count); names = newNames; } return names; }</code><technical_language>rename fontData</technical_language>

Target:
String[] getFontNames() { FontData[] fontNames = display.getFontList(null, true); String[] names = new String[fontNames.length]; int count = 0; mainfor: for (FontData fontdata : fontNames) { String fontName = fontdata.getName(); if (fontName.startsWith("@")) continue; for (int j = 0; j < count; j++) { if (names[j].equals(fontName)) continue mainfor; } names[count++] = fontName; } if (count < names.length) { String[] newNames = new String[count]; System.arraycopy(names, 0, newNames, 0, count); names = newNames; } return names; }
Source:
<code>public void addAlternativeSequenceName(final String name) { <START> validateAltRegExp(name); <END> final Set<String> altSequences = new HashSet<>(getAlternativeSequenceNames()); if (!mSequenceName.equals(name)) { altSequences.add(name); } encodeAltSequences(altSequences); }</code><technical_language>remove this validation done encodeAltSequences</technical_language>

Target:
public void addAlternativeSequenceName(final String name) { final Set<String> altSequences = new HashSet<>(getAlternativeSequenceNames()); if (!mSequenceName.equals(name)) { altSequences.add(name); } encodeAltSequences(altSequences); }
Source:
<code><START> protected @Nullable IAnalysisModule findSegmentProviderAnalysis(@NonNull ITmfTrace trace) { <END> return fPatternAnalysisId != null ? TmfTraceUtils.getAnalysisModuleOfClass(trace, XmlPatternAnalysis.class, fPatternAnalysisId) : null; }</code><technical_language>return ISegmentStoreProvider</technical_language>

Target:
protected @Nullable ISegmentStoreProvider findSegmentProviderAnalysis(@NonNull ITmfTrace trace) { return fPatternAnalysisId != null ? TmfTraceUtils.getAnalysisModuleOfClass(trace, XmlPatternAnalysis.class, fPatternAnalysisId) : null; }
Source:
<code>public String getCardName(@NonNull Resources resources) { <START> return "Kartu Multi Trip"; <END> }</code><technical_language>string resource</technical_language>

Target:
public String getCardName(@NonNull Resources resources) { return resources.getString(R.string.kmt_longname); }
Source:
<code>public synchronized byte[] getEventKeyBytesGAE(EventKey eventKey) { long timestamp = 0; if (eventKey.getKey() .getFieldDescriptor().getFieldList() .contains(DimensionsDescriptor.DIMENSION_TIME)) { timestamp = eventKey.getKey().getFieldLong(DimensionsDescriptor.DIMENSION_TIME); } try { byte[] timeBytes = Longs.toByteArray(timestamp); byte[] schemaIDBytes = Ints.toByteArray(eventKey.getSchemaID()); byte[] dimensionDescriptorIDBytes = Ints.toByteArray(eventKey.getDimensionDescriptorID()); byte[] aggregatorIDBytes = Ints.toByteArray(eventKey.getAggregatorID()); byte[] gpoBytes = GPOUtils.serialize(eventKey.getKey(), tempBal); bal.add(timeBytes); bal.add(schemaIDBytes); bal.add(dimensionDescriptorIDBytes); bal.add(aggregatorIDBytes); bal.add(gpoBytes); byte[] serializedBytes = bal.toByteArray(); bal.clear(); return serializedBytes; } <START> catch(Exception e) <END> { e.printStackTrace(); return null; } }</code><technical_language>needed, removed</technical_language>

Target:
public synchronized byte[] getEventKeyBytesGAE(EventKey eventKey) { long timestamp = 0; if (eventKey.getKey() .getFieldDescriptor().getFieldList() .contains(DimensionsDescriptor.DIMENSION_TIME)) { timestamp = eventKey.getKey().getFieldLong(DimensionsDescriptor.DIMENSION_TIME); } byte[] timeBytes = Longs.toByteArray(timestamp); byte[] schemaIDBytes = Ints.toByteArray(eventKey.getSchemaID()); byte[] dimensionDescriptorIDBytes = Ints.toByteArray(eventKey.getDimensionDescriptorID()); byte[] aggregatorIDBytes = Ints.toByteArray(eventKey.getAggregatorID()); byte[] gpoBytes = GPOUtils.serialize(eventKey.getKey(), tempBal); bal.add(timeBytes); bal.add(schemaIDBytes); bal.add(dimensionDescriptorIDBytes); bal.add(aggregatorIDBytes); bal.add(gpoBytes); byte[] serializedBytes = bal.toByteArray(); bal.clear(); return serializedBytes; }
Source:
<code>private void emitAndPersistEvent(PaymentDetailsEntered event) { try { eventQueue.emitEvent(event); persistEventEmitRecord(event); } catch (QueueException e) { <START> logger.error("Failed to emit event due to {}", event, e); <END> } }</code><technical_language>log chargeId/ChargeEventId</technical_language>

Target:
private void emitAndPersistEvent(PaymentDetailsEntered event) { try { eventQueue.emitEvent(event); persistEventEmittedRecord(event); } catch (QueueException e) { logger.error("Failed to emit event due to [chargeId={}]", event, e.getMessage(), event.getResourceExternalId()); } }
Source:
<code>protected boolean isDescriptionSheetExists(final Workbook wb) throws WorkbookParserException { final Sheet sheet1 = wb.getSheetAt(WorkbookParser.DESCRIPTION_SHEET); <START> if (sheet1 == null || sheet1.getSheetName() == null || !"Description".equals(sheet1.getSheetName())) { <END> return false; } return true; }</code><technical_language>Extract "Description" constant</technical_language>

Target:
protected boolean isDescriptionSheetExists(final Workbook wb) throws WorkbookParserException { final Sheet sheet1 = wb.getSheetAt(WorkbookParser.DESCRIPTION_SHEET); if (sheet1 == null || sheet1.getSheetName() == null || !WorkbookParser.DESCRIPTION_SHEET_NAME.equals(sheet1.getSheetName())) { return false; } return true; }
Source:
<code>public void keyPressed(KeyEvent e) { <START> System.out.println("KEY: " + e.getKeyChar() + ", " + selectedItem); <END> if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) { selectedItem--; if (selectedItem < 0) { selectedItem = buttons.size() - 1; } } else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) { selectedItem++; if (selectedItem > buttons.size() - 1) { selectedItem = 0; } } else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value - 0.1f; if (value < 0) { value = 0; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value + 0.1f; if (value > 1) { value = 1; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) { e.consume(); ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; if (slider.value == 1) { slider.setValue(0); } else { slider.setValue(1); } } button.postClick(); } else if (e.getKeyCode() == KeyEvent.VK_F11) { MojamComponent.toggleFullscreen(); } }</code><technical_language>Pls remove debug output</technical_language>

Target:
public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) { selectedItem--; if (selectedItem < 0) { selectedItem = buttons.size() - 1; } } else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) { selectedItem++; if (selectedItem > buttons.size() - 1) { selectedItem = 0; } } else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value - 0.1f; if (value < 0) { value = 0; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value + 0.1f; if (value > 1) { value = 1; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) { e.consume(); ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; if (slider.value == 1) { slider.setValue(0); } else { slider.setValue(1); } } button.postClick(); } else if (e.getKeyCode() == KeyEvent.VK_F11) { MojamComponent.toggleFullscreen(); } }
Source:
<code>private static HashMap<String, String> getPluginConfiguration() { <START> final short kEntries = 2; <END> HashMap<String, String> conf = new HashMap<>((int) Math.ceil(kEntries / 0.75)); conf.put("configDir", ConfigCore.getKitodoConfigDirectory()); conf.put("tempDir", ConfigCore.getParameter(Parameters.PLUGIN_TEMP_DIR)); return conf; }</code><technical_language>mentioned above: do introduce unreadable variable names</technical_language>

Target:
private static HashMap<String, String> getPluginConfiguration() { final short entries = 2; HashMap<String, String> conf = new HashMap<>((int) Math.ceil(entries / 0.75)); conf.put("configDir", ConfigCore.getKitodoConfigDirectory()); conf.put("tempDir", ConfigCore.getParameter(Parameters.PLUGIN_TEMP_DIR)); return conf; }
Source:
<code>public static Set<SkinPart> fromFlags(int flags) { Set<SkinPart> parts = Sponge.getRegistry().getAllOf(SkinPart.class).stream() .filter(part -> part instanceof SpongeSkinPart) <START> .filter(part -> (flags & (1 << ((SpongeSkinPart) part).ordinal())) != 0) <END> .collect(Collectors.toSet()); return ImmutableSet.copyOf(parts); }</code><technical_language>filter(part -> (part instanceof SpongeSkinPart) && (flags [...])</technical_language>

Target:
public static Set<SkinPart> fromFlags(int flags) { return Sponge.getRegistry().getAllOf(SkinPart.class).stream() .map(part -> (SpongeSkinPart) part) .filter(part -> part.test(flags)) .collect(GuavaCollectors.toImmutableSet()); }
Source:
<code>WorkerThread(ForkJoinPool pool, ClassLoader contextClassLoader) { super(pool); <START> super.setContextClassLoader(contextClassLoader); <END> }</code><technical_language>nit: super is unnecessary here, it</technical_language>

Target:
WorkerThread(ForkJoinPool pool, ClassLoader contextClassLoader) { super(pool); setContextClassLoader(contextClassLoader); }
Source:
<code>private static boolean nullSafeDateEquals(final Date obj1, final Date obj2) { if (obj1 == null || obj2 == null) { return true; } else { Calendar cal1 = Calendar.getInstance(); cal1.setTime(obj1); Calendar cal2 = Calendar.getInstance(); cal2.setTime(obj2); <START> if (cal1.get(Calendar.MONTH) == cal1.get(Calendar.MONTH) <END> && cal1.get(Calendar.YEAR) == cal1.get(Calendar.YEAR) && cal1.get(Calendar.DATE) == cal1.get(Calendar.DATE)) { return true; } else { return false; } } }</code><technical_language>Do compare cal1 cal2 here</technical_language>

Target:
private static boolean nullSafeDateEquals(final Date obj1, final Date obj2) { if (obj1 == null || obj2 == null) { return true; } else { Calendar cal1 = Calendar.getInstance(); cal1.setTime(obj1); Calendar cal2 = Calendar.getInstance(); cal2.setTime(obj2); if (cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.DATE) == cal2.get(Calendar.DATE)) { return true; } else { return false; } } }
Source:
<code>public static TreeWalk forPath(final ObjectReader reader, final String path, final AnyObjectId... trees) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(reader); PathFilter f = PathFilter.create(path); tw.setFilter(f); tw.reset(trees); tw.setRecursive(false); <START> for (;;) { <END> if (!tw.next()) { return null; } else if (f.isDone(tw)) { return tw; } else if (tw.isSubtree()) { tw.enterSubtree(); } else { return null; } } }</code><technical_language>a while loop a condition? while (tw.next()) { if (f.isDone(tw)) return tw; if (tw.isSubtree()) tw.enterSubtree(); } return null;</technical_language>

Target:
public static TreeWalk forPath(final ObjectReader reader, final String path, final AnyObjectId... trees) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(reader); PathFilter f = PathFilter.create(path); tw.setFilter(f); tw.reset(trees); tw.setRecursive(false); while (tw.next()) { if (f.isDone(tw)) { return tw; } else if (tw.isSubtree()) { tw.enterSubtree(); } } return null; }
Source:
<code>public void testMessageCountNeverSubscribed() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); Optional<Long> result = adapter.messageCount(); verify(mockChannel, never()).messageCount(anyString()); <START> assertEquals(result, Optional.empty()); <END> }</code><technical_language>wrong order</technical_language>

Target:
public void testMessageCountNeverSubscribed() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); Optional<Long> result = adapter.messageCount(); verify(mockChannel, never()).messageCount(anyString()); assertEquals(Optional.empty(), result); }
Source:
<code>public boolean validate() { if (oldGenerator != null && getJsonTextArea().getText().equals(oldGenerator.getPayloadGenerator().getJson()) && numberOfPayloadsSpinner.getValue() == oldGenerator.getPayloadGenerator().getNumberOfPayloads()) { return true; } if (getJsonTextArea().getText().isEmpty()) return false; <START> if (numberOfPayloadsSpinner.getValue() <= 0) return false; <END> oldGenerator = null; return true; }</code><technical_language>This is unnecessary, spinner allow zero negative values</technical_language>

Target:
public boolean validate() { if (oldGenerator != null && getJsonTextArea().getText().equals(oldGenerator.getPayloadGenerator().getJson()) && numberOfPayloadsSpinner.getValue() == oldGenerator.getPayloadGenerator().getNumberOfPayloads()) { return true; } if (getJsonTextArea().getDocument().getLength() == 0) { return false; } if (isInvalidJson(getJsonTextArea().getText())) { return false; } oldGenerator = null; return true; }
Source:
<code>private String getLocaleFromCookie() { Cookie[] cookies = request.getCookies(); return cookies == null ? null : FluentIterable.of(cookies) <START> .firstMatch(cookie -> LOCALE_COOKIE_NAME.equals(cookie.getName()) <END> && SUPPORTED_LOCALES.contains(cookie.getValue())) .transform(cookie -> cookie.getValue().toLowerCase()) .orNull(); }</code><technical_language>This fail deploy. appengine support java 8</technical_language>

Target:
private String getLocaleFromCookie() { Cookie[] cookies = request.getCookies(); return cookies == null ? null : FluentIterable.of(cookies) .firstMatch(new Predicate<Cookie>() { @Override public boolean apply(Cookie cookie) { return LOCALE_COOKIE_NAME.equals(cookie.getName()) && SUPPORTED_LOCALES.contains(cookie.getValue()); } }).transform(new Function<Cookie, String>() { @Override public String apply(Cookie cookie) { return cookie.getValue().toLowerCase(); } }).orNull(); }
Source:
<code>public void typeTextToSearchFactoryField(String expectedText) { seleniumWebDriverHelper.setValue(searchWorkspaceField, expectedText); <START> WaitUtils.sleepQuietly(1); <END> }</code><technical_language>avoid sleeping here</technical_language>

Target:
public void typeTextToSearchFactoryField(String expectedText) { seleniumWebDriverHelper.setValue(searchWorkspaceField, expectedText); }
Source:
<code>public FileSystemJarCache(@Nonnull File rootDir, boolean touch) { this.rootDir = rootDir; this.touch = touch; if (rootDir==null) throw new IllegalArgumentException("Root directory is null"); try { Util.mkdirs(rootDir); } catch (IOException ex) { <START> throw new IllegalArgumentException("Root directory not writable: " + rootDir); <END> } }</code><technical_language>append admins a chance identify fix</technical_language>

Target:
public FileSystemJarCache(@Nonnull File rootDir, boolean touch) { this.rootDir = rootDir; this.touch = touch; if (rootDir==null) throw new IllegalArgumentException("Root directory is null"); try { Util.mkdirs(rootDir); } catch (IOException ex) { throw new IllegalArgumentException("Root directory not writable: " + rootDir, ex); } }
Source:
<code>public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { if (response != null && request != null) { boolean isConnAborted = false; if (response.isError()) { Throwable ex = (Throwable)request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); if (ex instanceof ClientAbortException) { isConnAborted = true; buf.append('X'); } } if (!isConnAborted) { if (org.apache.coyote.http11.Constants.KEEPALIVE.equals( <START> request.getHeader(org.apache.coyote.http11.Constants.CONNECTION))) { <END> buf.append('+'); } else { buf.append('-'); } } } else { buf.append('?'); } }</code><technical_language>log message is intended show if connection remains in keep-alive current request finishes. want Connection header (for close) response mimic behaviour for httpd</technical_language>

Target:
public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { if (response != null && request != null) { boolean statusFound = false; AtomicBoolean isIoAllowed = new AtomicBoolean(false); request.getCoyoteRequest().action(ActionCode.IS_IO_ALLOWED, isIoAllowed); if (!isIoAllowed.get()) { buf.append('X'); statusFound = true; } else { if (response.isError()) { Throwable ex = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); if (ex instanceof ClientAbortException) { buf.append('X'); statusFound = true; } } } if (!statusFound) { String connStatus = response.getHeader(org.apache.coyote.http11.Constants.CONNECTION); if (org.apache.coyote.http11.Constants.CLOSE.equals(connStatus)) { buf.append('-'); } else { buf.append('+'); } } } else { buf.append('?'); } }
Source:
<code>public void onResponse(final ImageLoader.ImageContainer response, boolean isImmediate) { if (!mUrl.equals(mRequestedURL)) { <START> return; <END> } if (isImmediate && mIsInLayoutPass) { post(new Runnable() { @Override public void run() { onResponse(response, false); } }); return; } handleResponse(response, isImmediate, mImageLoadListener); }</code><technical_language>add a log entry here, perhaps: AppLog.w(AppLog.T.UTILS, "WPNetworkImageView > request longer valid");</technical_language>

Target:
public void onResponse(final ImageLoader.ImageContainer response, boolean isImmediate) { if (mUrl == null || !mUrl.equals(mRequestedURL)) { AppLog.w(AppLog.T.UTILS, "WPNetworkImageView > request no longer valid: " + mRequestedURL); return; } if (isImmediate && mIsInLayoutPass) { post(new Runnable() { @Override public void run() { onResponse(response, false); } }); return; } handleResponse(response, isImmediate, mImageLoadListener); }
Source:
<code>Family smartResolutor(long studyUid, String entry, String user) throws CatalogException { Query query = new Query() .append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), studyUid); if (UUIDUtils.isOpenCGAUUID(entry)) { query.put(FamilyDBAdaptor.QueryParams.UUID.key(), entry); } else { try { long entryLong = Long.parseLong(entry); <START> query.put(FamilyDBAdaptor.QueryParams.UID.key(), entryLong); <END> } catch (NumberFormatException e) { query.put(FamilyDBAdaptor.QueryParams.ID.key(), entry); } } QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList( FamilyDBAdaptor.QueryParams.UUID.key(), FamilyDBAdaptor.QueryParams.UID.key(), FamilyDBAdaptor.QueryParams.STUDY_UID.key(), FamilyDBAdaptor.QueryParams.ID.key(), FamilyDBAdaptor.QueryParams.RELEASE.key(), FamilyDBAdaptor.QueryParams.VERSION.key(), FamilyDBAdaptor.QueryParams.STATUS.key())); QueryResult<Family> familyQueryResult = familyDBAdaptor.get(query, options, user); if (familyQueryResult.getNumResults() == 0) { familyQueryResult = familyDBAdaptor.get(query, options); if (familyQueryResult.getNumResults() == 0) { throw new CatalogException("Family " + entry + " not found"); } else { throw new CatalogAuthorizationException("Permission denied. " + user + " is not allowed to see the family " + entry); } } else if (familyQueryResult.getNumResults() > 1) { throw new CatalogException("More than one family found based on " + entry); } else { return familyQueryResult.first(); } }</code><technical_language>UID is a valid parameter search 1.4.0</technical_language>

Target:
Family smartResolutor(long studyUid, String entry, String user) throws CatalogException { Query query = new Query() .append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), studyUid); if (UUIDUtils.isOpenCGAUUID(entry)) { query.put(FamilyDBAdaptor.QueryParams.UUID.key(), entry); } else { query.put(FamilyDBAdaptor.QueryParams.ID.key(), entry); } QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList( FamilyDBAdaptor.QueryParams.UUID.key(), FamilyDBAdaptor.QueryParams.UID.key(), FamilyDBAdaptor.QueryParams.STUDY_UID.key(), FamilyDBAdaptor.QueryParams.ID.key(), FamilyDBAdaptor.QueryParams.RELEASE.key(), FamilyDBAdaptor.QueryParams.VERSION.key(), FamilyDBAdaptor.QueryParams.STATUS.key())); QueryResult<Family> familyQueryResult = familyDBAdaptor.get(query, options, user); if (familyQueryResult.getNumResults() == 0) { familyQueryResult = familyDBAdaptor.get(query, options); if (familyQueryResult.getNumResults() == 0) { throw new CatalogException("Family " + entry + " not found"); } else { throw new CatalogAuthorizationException("Permission denied. " + user + " is not allowed to see the family " + entry); } } else if (familyQueryResult.getNumResults() > 1) { throw new CatalogException("More than one family found based on " + entry); } else { return familyQueryResult.first(); } }
Source:
<code>public void testTokenDefault() throws OpenTokException, UnsupportedEncodingException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { int apiKey = 123456; String apiSecret = "1234567890abcdef1234567890abcdef1234567890"; <START> OpenTok opentok = new OpenTok.Builder(apiKey, apiSecret).build(); <END> String sessionId = "1_MX4xMjM0NTZ-flNhdCBNYXIgMTUgMTQ6NDI6MjMgUERUIDIwMTR-MC40OTAxMzAyNX4"; String token = opentok.generateToken(sessionId); assertNotNull(token); assertTrue(Helpers.verifyTokenSignature(token, apiSecret)); Map<String, String> tokenData = Helpers.decodeToken(token); assertEquals(Integer.toString(apiKey), tokenData.get("partner_id")); assertNotNull(tokenData.get("create_time")); assertNotNull(tokenData.get("nonce")); }</code><technical_language>constructor mandatory parameters public, stop Builder in test cases optional properties</technical_language>

Target:
public void testTokenDefault() throws OpenTokException, UnsupportedEncodingException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { int apiKey = 123456; String apiSecret = "1234567890abcdef1234567890abcdef1234567890"; OpenTok opentok = new OpenTok(apiKey, apiSecret); String sessionId = "1_MX4xMjM0NTZ-flNhdCBNYXIgMTUgMTQ6NDI6MjMgUERUIDIwMTR-MC40OTAxMzAyNX4"; String token = opentok.generateToken(sessionId); assertNotNull(token); assertTrue(Helpers.verifyTokenSignature(token, apiSecret)); Map<String, String> tokenData = Helpers.decodeToken(token); assertEquals(Integer.toString(apiKey), tokenData.get("partner_id")); assertNotNull(tokenData.get("create_time")); assertNotNull(tokenData.get("nonce")); }
Source:
<code>public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZKDatabase zkDb) { serverStats = new ServerStats(this); this.txnLogFactory = txnLogFactory; this.txnLogFactory.setServerStats(this.serverStats); this.zkDb = zkDb; this.tickTime = tickTime; setMinSessionTimeout(minSessionTimeout); setMaxSessionTimeout(maxSessionTimeout); listener = new ZooKeeperServerListenerImpl(this); readResponseCache = new ResponseCache(); <START> connThrottle = new BlueThrottle(); <END> connThrottle.setMaxTokens( Integer.getInteger("zookeeper.connection_throttle_tokens", 0) ); connThrottle.setFillTime( Integer.getInteger("zookeeper.connection_throttle_fill_time", 1) ); connThrottle.setFillCount( Integer.getInteger("zookeeper.connection_throttle_fill_count", 1) ); connThrottle.setFreezeTime( Integer.getInteger("zookeeper.connection_throttle_freeze_time", -1) ); connThrottle.setDropIncrease( getDoubleProp("zookeeper.connection_throttle_drop_increase", 0.02) ); connThrottle.setDropDecrease( getDoubleProp("zookeeper.connection_throttle_drop_decrease", 0.002) ); connThrottle.setDecreasePoint( getDoubleProp("zookeeper.connection_throttle_decrease_ratio", 0) ); LOG.info("Created server with tickTime " + tickTime + " minSessionTimeout " + getMinSessionTimeout() + " maxSessionTimeout " + getMaxSessionTimeout() + " datadir " + txnLogFactory.getDataDir() + " snapdir " + txnLogFactory.getSnapDir()); }</code><technical_language>This configuration setting block a bit neater existing pattern in this class: create static constants for configuration option name default value. existing config setting intBufferStartingSizeBytes is set static constructor is convenient here, overload constructor of BlueThrottle override default settings. In case need setters all</technical_language>

Target:
public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZKDatabase zkDb) { serverStats = new ServerStats(this); this.txnLogFactory = txnLogFactory; this.txnLogFactory.setServerStats(this.serverStats); this.zkDb = zkDb; this.tickTime = tickTime; setMinSessionTimeout(minSessionTimeout); setMaxSessionTimeout(maxSessionTimeout); listener = new ZooKeeperServerListenerImpl(this); readResponseCache = new ResponseCache(); connThrottle = new BlueThrottle(); LOG.info("Created server with tickTime " + tickTime + " minSessionTimeout " + getMinSessionTimeout() + " maxSessionTimeout " + getMaxSessionTimeout() + " datadir " + txnLogFactory.getDataDir() + " snapdir " + txnLogFactory.getSnapDir()); }
Source:
<code><START> public void testHasChildren() throws Exception { <END> final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); root.setFirstChild(child); getSetParentMethod().invoke(child, root); assertWithMessage("Root node should have children") .that(root.hasChildren()) .isTrue(); assertWithMessage("Child node should have no children") .that(child.hasChildren()) .isFalse(); }</code><technical_language>Do need this test ? try avoid pure UTs possible</technical_language>

Target:
public void testHasChildren() { final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); root.setFirstChild(child); assertWithMessage("Root node should have children") .that(root.hasChildren()) .isTrue(); assertWithMessage("Child node should have no children") .that(child.hasChildren()) .isFalse(); }
Source:
<code>public GetQueryListResponse getFinishedQueryList(RpcController controller, GetQueryListRequest request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); GetQueryListResponse.Builder builder = GetQueryListResponse.newBuilder(); Collection<QueryInfo> queries = context.getQueryJobManager().getFinishedQueries(); BriefQueryInfo.Builder infoBuilder = BriefQueryInfo.newBuilder(); for (QueryInfo queryInfo : queries) { infoBuilder.setQueryId(queryInfo.getQueryId().getProto()); infoBuilder.setState(queryInfo.getQueryState()); infoBuilder.setQuery(queryInfo.getSql()); infoBuilder.setStartTime(queryInfo.getStartTime()); <START> infoBuilder.setFinishTime(System.currentTimeMillis()); <END> infoBuilder.setProgress(queryInfo.getProgress()); infoBuilder.setQueryMasterPort(queryInfo.getQueryMasterPort()); infoBuilder.setQueryMasterHost(queryInfo.getQueryMasterHost()); builder.addQueryList(infoBuilder.build()); } GetQueryListResponse result = builder.build(); return result; } catch (Throwable t) { throw new ServiceException(t); } }</code><technical_language>request time.. I suggest {{isFinishState}} branch in {{QueryInProgress.hearbeart}} sets finish time</technical_language>

Target:
public GetQueryListResponse getFinishedQueryList(RpcController controller, GetQueryListRequest request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); GetQueryListResponse.Builder builder = GetQueryListResponse.newBuilder(); Collection<QueryInfo> queries = context.getQueryJobManager().getFinishedQueries(); BriefQueryInfo.Builder infoBuilder = BriefQueryInfo.newBuilder(); for (QueryInfo queryInfo : queries) { infoBuilder.setQueryId(queryInfo.getQueryId().getProto()); infoBuilder.setState(queryInfo.getQueryState()); infoBuilder.setQuery(queryInfo.getSql()); infoBuilder.setStartTime(queryInfo.getStartTime()); infoBuilder.setFinishTime(queryInfo.getFinishTime()); infoBuilder.setProgress(queryInfo.getProgress()); infoBuilder.setQueryMasterPort(queryInfo.getQueryMasterPort()); infoBuilder.setQueryMasterHost(queryInfo.getQueryMasterHost()); builder.addQueryList(infoBuilder.build()); } GetQueryListResponse result = builder.build(); return result; } catch (Throwable t) { throw new ServiceException(t); } }
Source:
<code>protected String errorMessage(Exception e) { <START> return "%s is not a valid duration."; <END> }</code><technical_language>s/duration/size/</technical_language>

Target:
protected String errorMessage(Exception e) { return "%s is not a valid size."; }
Source:
<code>public ImmutableValue<Integer> cooldown() { <START> return ImmutableSpongeValue.cachedOf(Keys.COOLDOWN, -1, this.getValue()); <END> }</code><technical_language>Please this a final field</technical_language>

Target:
public ImmutableValue<Integer> cooldown() { return this.cooldown; }
Source:
<code>public void deactivate() { View view = getView(); if (null == view) { return; } <START> getDiagramEventBroker().removeNotificationListener(view, this); <END> }</code><technical_language>unsubscribe()</technical_language>

Target:
public void deactivate() { View view = getView(); if (null == view) { return; } unsubscribe(view); }
Source:
<code>public void testIllegalLimitParameter() { String testRegion = "20:60000-80000"; String annotationVepVersion = "78"; String annotationVepCacheversion = "78"; int limit = 100000; String url = "/v1/segments/" + testRegion + "/variants?species=mmusculus_grcm38&annot-vep-version=" + annotationVepVersion + "&annot-vep-cache-version=" + annotationVepCacheversion + "&limit=" + limit; <START> ResponseEntity response = WSTestHelpers.getRestResponse(url, restTemplate); <END> assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode()); }</code><technical_language>suggestion ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);</technical_language>

Target:
public void testIllegalLimitParameter() { String testRegion = "20:60000-80000"; String annotationVepVersion = "78"; String annotationVepCacheversion = "78"; int limit = 100000; String url = UriComponentsBuilder.fromUriString("") .path("/v1/segments/") .path(testRegion) .path("/variants") .queryParam("species", "mmusculus_grcm38") .queryParam("annot-vep-version", annotationVepVersion) .queryParam("annot-vep-cache-version", annotationVepCacheversion) .queryParam("limit", limit) .build().toString(); ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode()); }