auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Slice stMultiPoint(@SqlType("array(" + GEOMETRY_TYPE_NAME + ")") Block input) { MultiPoint multipoint = new MultiPoint(); for (int i = 0; i < input.getPositionCount(); i++) { Slice slice = GEOMETRY.getSlice(input, i); if (slice.getInput().available() == 0) { continue; } OGCGeometry geometry = deserialize(slice); if (!(geometry instanceof OGCPoint)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("ST_MultiPoint takes only an array of valid points, %s was passed", geometry.geometryType())); } OGCPoint point = (OGCPoint) geometry; if (point.isEmpty()) { continue; } multipoint.add(point.X(), point.Y()); } if (multipoint.getPointCount() < 1) { return null; } <START> OGCGeometry geometry = createFromEsriGeometry(multipoint, null); <END> return serialize(geometry); }</code><technical_language>nit: geometry variable is once; inline return serialize(createFromEsriGeometry(multipoint, null));</technical_language>

Target:
public static Slice stMultiPoint(@SqlType("array(" + GEOMETRY_TYPE_NAME + ")") Block input) { MultiPoint multipoint = new MultiPoint(); for (int i = 0; i < input.getPositionCount(); i++) { if (input.isNull(i)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "ST_MultiPoint takes only an array of valid points, NULL point was passed"); } Slice slice = GEOMETRY.getSlice(input, i); OGCGeometry geometry = deserialize(slice); if (!(geometry instanceof OGCPoint)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("ST_MultiPoint takes only an array of valid points, %s was passed", geometry.geometryType())); } OGCPoint point = (OGCPoint) geometry; if (point.isEmpty()) { continue; } multipoint.add(point.X(), point.Y()); } if (multipoint.getPointCount() < 1) { return null; } return serialize(createFromEsriGeometry(multipoint, null, true)); }
Source:
<code>public ObisCodeValues convertFrom(com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues source, Type<ObisCodeValues> destinationType) { final ObisCodeValues result = new ObisCodeValues(); result.setA(source.getA()); result.setB(source.getB()); result.setC(source.getC()); result.setD(source.getD()); result.setE(source.getE()); result.setF(source.getF()); return result; <START> } <END></code><technical_language>This is right, result a signed value, do "source.getA() & 0xFF"</technical_language>

Target:
public ObisCodeValues convertFrom(com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues source, Type<ObisCodeValues> destinationType) { final ObisCodeValues result = new ObisCodeValues(); result.setA((short)(source.getA() & 0xFF)); result.setB((short)(source.getB() & 0xFF)); result.setC((short)(source.getC() & 0xFF)); result.setD((short)(source.getD() & 0xFF)); result.setE((short)(source.getE() & 0xFF)); result.setF((short)(source.getF() & 0xFF)); return result; }
Source:
<code>public String getMessage(Bundle bundle, String value) { String result = value; if (bundle != null && result != null && result.startsWith(PERCENT)) { if (bundle != null && result != null && result.startsWith(PERCENT + PERCENT)) { return result.replaceFirst(PERCENT, EMPTY); } try { result = <START> Platform.getResourceBundle(bundle).getString(result.replaceFirst(PERCENT, EMPTY)); <END> } catch (MissingResourceException mre) { DslCommonPlugin.INSTANCE.log(mre); } } return result; }</code><technical_language>result.substring(PERCENT.length()) simpler more efficient. String#substring() avoids allocating a new char[] sharing original string (it's a good idea, in this case fine)</technical_language>

Target:
public String getMessage(Bundle bundle, String value) { String result = value; if (bundle != null && result != null && result.startsWith(PERCENT)) { if (bundle != null && result != null && result.startsWith(PERCENT + PERCENT)) { return result.replaceFirst(PERCENT, EMPTY); } try { result = Platform.getResourceBundle(bundle).getString(result.substring(PERCENT.length())); } catch (MissingResourceException mre) { DslCommonPlugin.INSTANCE.log(new Status(IStatus.WARNING, bundle.getSymbolicName(), 0, "The key " + value + "has not been found in the properties file for label localization", mre)); } } return result; }
Source:
<code>public void testProteinSubstitutionScoresModel() { String testVariantId = "rs370478"; String url = "/v1/variants/" + testVariantId + "/info?species=mmusculus_grcm38"; List<VariantWithSamplesAndAnnotation> variants = WSTestHelpers.testRestTemplateHelper(url, restTemplate); for (VariantWithSamplesAndAnnotation variant : variants) { for (ConsequenceType consequenceType : variant.getAnnotation().getConsequenceTypes()) { if (consequenceType.getProteinSubstitutionScores().size() > 0) { assertNull(consequenceType.getSift()); <START> assertNull(consequenceType.getPolyphen()); <END> } } } }</code><technical_language>I this is model deserialized: if scores present, ideally populate fields represent them. I expected test check structure of JSON response, is part is causing problems. Of this test useful</technical_language>

Target:
public void testProteinSubstitutionScoresModel() { String testVariantId = "rs370478"; String url = "/v1/variants/" + testVariantId + "/info?species=mmusculus_grcm38"; JSONObject jsonObject = WSTestHelpers.testRestTemplateHelperJsonObject(url, restTemplate); JSONArray responseArray = jsonObject.getJSONArray("response"); for (int i = 0; i < responseArray.length(); ++i) { JSONObject response = responseArray.getJSONObject(i); JSONArray resultArray = response.getJSONArray("result"); for (int j = 0; j < resultArray.length(); ++j) { JSONObject result = resultArray.getJSONObject(j); JSONArray consequenceTypes = result.getJSONObject("annotation").getJSONArray("consequenceTypes"); for (int k = 0; k < consequenceTypes.length(); ++k) { JSONObject consequenceType = consequenceTypes.getJSONObject(k); if (!consequenceType.has("ensemblTranscriptId")){ continue; } if (consequenceType.getString("ensemblTranscriptId").equals("ENST00000426146")) { assertTrue(consequenceType.has("proteinSubstitutionScores")); assertFalse(consequenceType.has("sift")); assertFalse(consequenceType.has("polyphen")); } } } } }
Source:
<code>public void schedule(Server server) { ServerCommand serverCommand = new ServerCommand(server, queryExecutorRepository, resultProcessor); long runPeriod = serverCommand.getRunPeriodSeconds(configuration.getRunPeriod()); ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleAtFixedRate(serverCommand, runPeriod, runPeriod, TimeUnit.SECONDS); <START> serverCommand.setScheduledFuture(scheduledFuture); <END> this.scheduledServerCommands.add(serverCommand); log.debug("Scheduled job for server {}", serverCommand.getName()); }</code><technical_language>Cyclic dependency bewteen serverCommand, serverScheduler scheduledFuture slightly bothers me. a big deal, feels fine a cleaner organize this</technical_language>

Target:
public void schedule(Server server) { ServerCommand serverCommand = new ServerCommand(server, queryExecutorRepository, resultProcessor); long runPeriod = serverCommand.getRunPeriodSeconds(configuration.getRunPeriod()); ScheduledFuture<?> scheduledFuture = scheduledExecutor.scheduleAtFixedRate(serverCommand, runPeriod, runPeriod, TimeUnit.SECONDS); synchronized (this.scheduledServerCommands) { this.scheduledServerCommands.add(new ScheduledServerCommand(serverCommand, scheduledFuture)); } log.debug("Scheduled job for server {}", serverCommand.getName()); }
Source:
<code>public void forTypeMirror_typeVariable() { List<? extends TypeParameterElement> typeVariables = getElement(Parameterized.class).getTypeParameters(); assert_().that(TypeNames.forTypeMirror(typeVariables.get(0).asType())) .isEqualTo(TypeVariableName.named("Simple")); assert_().that(TypeNames.forTypeMirror(typeVariables.get(1).asType())) .isEqualTo(new TypeVariableName("ExtendsClass", ImmutableList.<TypeName>of( ClassName.fromClass(Number.class)))); assert_().that(TypeNames.forTypeMirror(typeVariables.get(2).asType())) .isEqualTo(new TypeVariableName("ExtendsInterface", ImmutableList.<TypeName>of( ClassName.fromClass(Runnable.class)))); assert_().that(TypeNames.forTypeMirror(typeVariables.get(3).asType())) .isEqualTo(new TypeVariableName("ExtendsTypeVariable", ImmutableList.<TypeName>of( TypeVariableName.named("Simple")))); TypeName intersectionExpected; <START> if (Double.parseDouble(System.getProperty("java.version").substring(0, 3)) >= 1.8) { <END> intersectionExpected = new TypeVariableName("Intersection", ImmutableList.<TypeName>of( new IntersectionTypeName(ImmutableList.<TypeName>of(ClassName.fromClass(Number.class), ClassName.fromClass(Runnable.class))))); } else { intersectionExpected = new TypeVariableName("Intersection", ImmutableList.<TypeName>of( ClassName.fromClass(Number.class), ClassName.fromClass(Runnable.class))); } assert_().that(TypeNames.forTypeMirror(typeVariables.get(4).asType())) .isEqualTo(intersectionExpected); }</code><technical_language>2 separate tests Assume version instead? nice separate if read a failure report</technical_language>

Target:
public void forTypeMirror_typeVariable() { List<? extends TypeParameterElement> typeVariables = getElement(Parameterized.class).getTypeParameters(); assert_().that(TypeNames.forTypeMirror(typeVariables.get(0).asType())) .isEqualTo(TypeVariableName.named("Simple")); assert_().that(TypeNames.forTypeMirror(typeVariables.get(1).asType())) .isEqualTo(new TypeVariableName("ExtendsClass", ImmutableList.<TypeName>of( ClassName.fromClass(Number.class)))); assert_().that(TypeNames.forTypeMirror(typeVariables.get(2).asType())) .isEqualTo(new TypeVariableName("ExtendsInterface", ImmutableList.<TypeName>of( ClassName.fromClass(Runnable.class)))); assert_().that(TypeNames.forTypeMirror(typeVariables.get(3).asType())) .isEqualTo(new TypeVariableName("ExtendsTypeVariable", ImmutableList.<TypeName>of( TypeVariableName.named("Simple")))); }
Source:
<code>private void updateClientsForDevice(@Nullable IDevice device) { if (device == null) { <START> myClientsListModel.clear(); <END> return; } Object selectedObject = myClientsList.getSelectedValue(); Client[] clients = device.getClients(); try { myClientsListUpdateInProgress = ArrayUtil.contains(selectedObject, clients); myClientsListModel.clear(); myClientsListModel.addAll(clients); myClientsList.setSelectedValue(selectedObject, true); } finally { myClientsListUpdateInProgress = false; } }</code><technical_language>Do want set myClientsListUpdateInProgress this clear()</technical_language>

Target:
private void updateClientsForDevice(@Nullable IDevice device) { if (device == null) { myClientsListModel.clear(); return; } Object selectedObject = myClientsList.getSelectedValue(); Client[] clients = device.getClients(); try { myIgnoreListeners = ArrayUtil.contains(selectedObject, clients); myClientsListModel.clear(); myClientsListModel.addAll(clients); myClientsList.setSelectedValue(selectedObject, true); } finally { myIgnoreListeners = false; } }
Source:
<code>public void onSelectPage(@NonNull HistoryEntry entry) { <START> Intent intent = new Intent(MainActivity.ACTION_PAGE_FOR_TITLE) <END> .setClass(getActivity(), MainActivity.class) .putExtra(MainActivity.EXTRA_HISTORYENTRY, entry) .putExtra(MainActivity.EXTRA_PAGETITLE, entry.getTitle()); startActivity(intent); }</code><technical_language>I recommend moving this logic a static method in MainActivity.newIntent()</technical_language>

Target:
public void onSelectPage(@NonNull HistoryEntry entry) { startActivity(MainActivity.newIntent(getContext(), entry, entry.getTitle())); }
Source:
<code>public void getNotModifiedBlobAndVerify(String blobId) throws Exception { JSONObject headers = new JSONObject(); <START> SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.US); <END> Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, blobId, headers, null); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); doOperation(restRequest, restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.NotModified, restResponseChannel.getResponseStatus()); assertTrue("No Date header", restResponseChannel.getHeader(RestUtils.Headers.DATE) != null); assertNull("No Last-Modified header expected", restResponseChannel.getHeader("Last-Modified")); assertNull(RestUtils.Headers.BLOB_SIZE + " should have been null ", restResponseChannel.getHeader(RestUtils.Headers.BLOB_SIZE)); assertNull("Content-Type should have been null", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); assertEquals("No content expected as blob is not modified", 0, restResponseChannel.getResponseBody().length); }</code><technical_language>Locale.English timezone GMT</technical_language>

Target:
public void getNotModifiedBlobAndVerify(String blobId) throws Exception { JSONObject headers = new JSONObject(); SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, blobId, headers, null); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); doOperation(restRequest, restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.NotModified, restResponseChannel.getResponseStatus()); assertTrue("No Date header", restResponseChannel.getHeader(RestUtils.Headers.DATE) != null); assertNull("No Last-Modified header expected", restResponseChannel.getHeader("Last-Modified")); assertNull(RestUtils.Headers.BLOB_SIZE + " should have been null ", restResponseChannel.getHeader(RestUtils.Headers.BLOB_SIZE)); assertNull("Content-Type should have been null", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); assertEquals("No content expected as blob is not modified", 0, restResponseChannel.getResponseBody().length); }
Source:
<code>public void start() { try { LOGGER.info("Starting Redis Channel: " + getName()); redisOperator = RedisInit.getInstance(redisConf, jedisPoolConfig); counter.start(); super.start(); <START> } catch (Exception e) { <END> LOGGER.error("Could not start Redis Chnnel"); throw new FlumeException("Unable to create Redis Connections. " + "Check whether Redis Server are up and that the " + "Flume agent can connect to it.", e); } }</code><technical_language>I noticed a occurrences of catch (Exception e). <LINK_0> catch specific type can. catch more specific exceptions here</technical_language>

Target:
public void start() { try { LOGGER.info("Starting Redis Channel: " + getName()); redisOperator = RedisInit.getInstance(redisConf, jedisPoolConfig); counter.start(); super.start(); } catch (CannotGetRedisInstanceException e) { LOGGER.error("Could not start Redis Chnnel"); throw new FlumeException("Unable to create Redis Connections. " + "Check whether Redis Server are up and that the " + "Flume agent can connect to it.", e); } catch (UnsupportRedisTypeException e) { LOGGER.error("Could not start Redis Chnnel"); throw new FlumeException("Unable to create Redis Connections. " + "Check whether Redis Type is correct.", e); } }
Source:
<code>public void dispatchOutput(String output, boolean detectLocalEcho) { if (detectLocalEcho && !localEcho_.isEmpty()) { String lastOutput = ""; <START> while (!localEcho_.isEmpty() && lastOutput.length() < output.length()) <END> { lastOutput += localEcho_.poll(); } if (lastOutput.equals(output)) { return; } lastOutput += " \r"; if (lastOutput.equals(output)) { return; } localEcho_.clear(); } xterm_.write(output); }</code><technical_language>This handles case output received server includes some of local output. Is output received server includes of local output *and some additional text*? is handled elsewhere? (e.g. set -o vi for a pathological case)? If so, this a mode emits characters output consumed localEcho_</technical_language>

Target:
public void dispatchOutput(String output, boolean detectLocalEcho) { if (detectLocalEcho && !localEcho_.isEmpty()) { String lastOutput = ""; while (!localEcho_.isEmpty() && lastOutput.length() < output.length()) { lastOutput += localEcho_.poll(); } if (lastOutput.equals(output)) { return; } if (output.startsWith(lastOutput)) { xterm_.write(output.substring(lastOutput.length())); return; } localEcho_.clear(); } xterm_.write(output); }
Source:
<code>public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<>(); addNonEmptyError(validator.getInvalidityInfoForGoogleId(googleId), errors); if (!StringHelper.isEmpty(shortName)) { addNonEmptyError(validator.getInvalidityInfoForPersonName(shortName), errors); } if (!StringHelper.isEmpty(email)) { addNonEmptyError(validator.getInvalidityInfoForEmail(email), errors); } if (!StringHelper.isEmpty(institute)) { addNonEmptyError(validator.getInvalidityInfoForInstituteName(institute), errors); } if (!StringHelper.isEmpty(nationality)) { addNonEmptyError(validator.getInvalidityInfoForNationality(nationality), errors); } <START> Assumption.assertNotNull(this.pictureKey); <END> return errors; }</code><technical_language>null for gender</technical_language>

Target:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<>(); addNonEmptyError(validator.getInvalidityInfoForGoogleId(googleId), errors); if (!StringHelper.isEmpty(shortName)) { addNonEmptyError(validator.getInvalidityInfoForPersonName(shortName), errors); } if (!StringHelper.isEmpty(email)) { addNonEmptyError(validator.getInvalidityInfoForEmail(email), errors); } if (!StringHelper.isEmpty(institute)) { addNonEmptyError(validator.getInvalidityInfoForInstituteName(institute), errors); } if (!StringHelper.isEmpty(nationality)) { addNonEmptyError(validator.getInvalidityInfoForNationality(nationality), errors); } Assumption.assertNotNull(gender); Assumption.assertNotNull(this.pictureKey); return errors; }
Source:
<code>private SocketAddress nextServer(Set<SocketAddress> failedServers) { SocketAddress server; <START> if (balancer instanceof FailoverRequestBalancingStrategy) { <END> server = ((FailoverRequestBalancingStrategy) balancer).nextServer(failedServers); } else { server = balancer.nextServer(); } return server; }</code><technical_language>instead of checking this time, wrap in start() RequestBalancingStrategy in FailoverRequestBalancingStrategy delegate new method</technical_language>

Target:
private SocketAddress nextServer(Set<SocketAddress> failedServers) { return balancer.nextServer(failedServers); }
Source:
<code><START> public synchronized Connection add(Connection connection) { <END> if (!maps.containsKey(connection.channel().id())) { maps.put(connection.channel().id(), connection); connections.add(connection); } return connection; }</code><technical_language>a ConcurrentHashMap instead of making functions synchronized</technical_language>

Target:
public Connection add(Connection connection) { Connection conn = connections.putIfAbsent(connection.channel().id(), connection); if (conn != null) { return conn; } return connection; }
Source:
<code>private JCheckBox createCheckBox(String label, boolean selected) { <START> JCheckBox checkBox = new JCheckBox(label, selected); <END> checkBox.setOpaque(false); checkBox.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST); return checkBox; }</code><technical_language>final</technical_language>

Target:
private JCheckBox createCheckBox(String label, boolean selected) { final JCheckBox checkBox = new JCheckBox(label, selected); checkBox.setOpaque(false); checkBox.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST); checkBox.addItemListener(item -> onSettingsUpdated(false)); return checkBox; }
Source:
<code><START> public RemotingConnectorService(String resolvedDomain, String expressionsDomain) { <END> this.resolvedDomain = resolvedDomain; this.expressionsDomain = expressionsDomain; }</code><technical_language>a big deal, this private</technical_language>

Target:
private RemotingConnectorService(String resolvedDomain, String expressionsDomain) { this.resolvedDomain = resolvedDomain; this.expressionsDomain = expressionsDomain; }
Source:
<code>public static void uploadFileIfPossible(ServerSideEncryptingAmazonS3 service, boolean disableAcl, String bucket, String key, File file) { <START> final PutObjectRequest logFilePutRequest = new PutObjectRequest(bucket, key, file); <END> if (!disableAcl) { logFilePutRequest.setAccessControlList(S3Utils.grantFullControlToBucketOwner(service, bucket)); } log.info("Pushing [%s] to bucket[%s] and key[%s].", file, bucket, key); service.putObject(logFilePutRequest); }</code><technical_language>This strictly for log files anymore, naming this more generic - putObjectRequest</technical_language>

Target:
public static void uploadFileIfPossible(ServerSideEncryptingAmazonS3 service, boolean disableAcl, String bucket, String key, File file) { final PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, key, file); if (!disableAcl) { putObjectRequest.setAccessControlList(S3Utils.grantFullControlToBucketOwner(service, bucket)); } log.info("Pushing [%s] to bucket[%s] and key[%s].", file, bucket, key); service.putObject(putObjectRequest); }
Source:
<code>public InjectedCommandGroup(CommandGroupBase previous) { <START> super(); this.previous = previous; <END> }</code><technical_language>this rely other constructor</technical_language>

Target:
public InjectedCommandGroup(CommandGroupBase previous) { this("InjectedCommandGroup", previous); }
Source:
<code>private void sortByHilbertIndex(T[] items) { if (items.length < degree) { return; } <START> Rectangle bounds = items[0].getExtent(); <END> for (int i = 1; i < items.length; i++) { bounds = bounds.merge(items[i].getExtent()); } HilbertIndex hilbert = new HilbertIndex(bounds); Arrays.parallelSort(items, Comparator.comparing((HasExtent item) -> hilbert.index( (item.getExtent().getXMin() + item.getExtent().getXMax()) / 2, (item.getExtent().getYMin() + item.getExtent().getYMax()) / 2))); }</code><technical_language>bounds -> extent overallExtent avoid introducing a new term for</technical_language>

Target:
private void sortByHilbertIndex(T[] items) { if (items == null || items.length < 2) { return; } Rectangle totalExtent = items[0].getExtent(); for (int i = 1; i < items.length; i++) { totalExtent = totalExtent.merge(items[i].getExtent()); } HilbertIndex hilbert = new HilbertIndex(totalExtent); Arrays.parallelSort(items, Comparator.comparing(item -> hilbert.indexOf( (item.getExtent().getXMin() + item.getExtent().getXMax()) / 2, (item.getExtent().getYMin() + item.getExtent().getYMax()) / 2))); }
Source:
<code>protected void modifyTable(HTableDescriptor descriptor) throws IOException { <START> try(Admin admin = getConnection().getAdmin()) { <END> admin.modifyTable(descriptor); } }</code><technical_language>This test exercise HBase 2 interface TableDescriptor HTableDescriptor</technical_language>

Target:
protected void modifyTable(HTableDescriptor descriptor) throws IOException { try(Admin admin = getConnection().getAdmin()) { admin.modifyTable((TableDescriptor)descriptor); } }
Source:
<code>public void setCurrentFieldForTest(Method method) { try { setFieldsForTest(method.getName()); <START> } catch (Exception e) { <END> LOG.error(e.getLocalizedMessage(), e); } }</code><technical_language>strange - hiding exception here. Is correct behavior</technical_language>

Target:
public void setCurrentFieldForTest(Method method) throws IOException, URISyntaxException { setFieldsForTest(method.getName()); }
Source:
<code>private void invokeClassLoadTestingHookIfNeeded() throws InterruptedException { if (TESTING_CLASS_LOAD != null) { TESTING_CLASS_LOAD.run(); <START> if (Thread.currentThread().isInterrupted()) { throw new InterruptedException("loading was interrupted."); } <END> } }</code><technical_language>nit: a runnable hook, throw exception need for test, instead of "hardcoding" exception here? imagine test cases involve setting interrupted flag here, expecting this InterruptedException (for instance try get a RemotingException proxy.fetch call in loadRemoteClass)</technical_language>

Target:
private void invokeClassLoadTestingHookIfNeeded() throws InterruptedException { if (TESTING_CLASS_LOAD != null) { TESTING_CLASS_LOAD.run(); } }
Source:
<code>LocalDate selectBaseDate(SchedulePeriod period) { <START> switch (this) { <END> case PERIOD_END: return period.getEndDate(); case PERIOD_START: default: return period.getStartDate(); } }</code><technical_language>switch adds noise return this == PERIOD_END ? period.getEndDate() : period.getStartDate(); is simpler 2 values</technical_language>

Target:
LocalDate selectBaseDate(SchedulePeriod period) { return (this == PERIOD_END ? period.getEndDate() : period.getStartDate()); }
Source:
<code><START> public void addMoodListener(MoodListener listener) { <END> moodListeners.add(listener); }</code><technical_language>methods add remove a listener thread-safe in Smack. This is case here</technical_language>

Target:
public synchronized void addMoodListener(MoodListener listener) { moodListeners.add(listener); }
Source:
<code>public boolean isSameHour(Date d1, Date d2) { Calendar c1 = Calendar.getInstance(tz); c1.setTime(d1); Calendar c2 = Calendar.getInstance(tz); c2.setTime(d2); <START> return isSameDay(d1, d2) <END> && c1.get(Calendar.HOUR_OF_DAY) == c2.get(Calendar.HOUR_OF_DAY); }</code><technical_language>need create versions of accept Calendar reuse calendar instance recreate for call within. remove boilerplate</technical_language>

Target:
public boolean isSameHour(Date d1, Date d2) { Calendar c1 = Calendar.getInstance(tz); c1.setTime(d1); Calendar c2 = Calendar.getInstance(tz); c2.setTime(d2); return isSameHour(c1, c2); }
Source:
<code>public Optional<String> getContainerIdIfContainerized() throws IOException, InterruptedException { ByteArrayOutputStream cgroup = new ByteArrayOutputStream(); <START> launcher.launch().cmds("cat", "/proc/self/cgroup").quiet(true).stdout(cgroup).join(); <END> final Pattern pattern = Pattern.compile("(?m)^\\d+:\\w+:/docker/(?<containerId>\\p{XDigit}{12,})$"); final String charsetName = Charset.defaultCharset().name(); Matcher matcher = pattern.matcher(cgroup.toString(charsetName)); return matcher.find() ? Optional.of(matcher.group("containerId")) : Optional.<String>absent(); }</code><technical_language>if running a slave, this get /proc/self/cgroup slave, master. is I want. tested it? BTW Launcher cat, easier java String cgroup = node.createPath("/proc/self/cgroup").readToString();</technical_language>

Target:
public Optional<String> getContainerIdIfContainerized() throws IOException, InterruptedException { final Pattern pattern = Pattern.compile("(?m)^\\d+:\\w+:/docker/(?<containerId>\\p{XDigit}{12,})$"); String cgroup = node.createPath("/proc/self/cgroup").readToString(); Matcher matcher = pattern.matcher(cgroup); return matcher.find() ? Optional.of(matcher.group(1)) : Optional.<String>absent(); }
Source:
<code>public void createElement() { when(service.getDateTime()).thenReturn(TIMESTAMP); AppConfigElement element = TestUtils.getAppConfigElement(); element.setRevision(null); element.setDeleted(true); when(dao.saveElementRevision(element)).thenReturn(VERSION_HOLDER); VersionHolder returned = service.createElement(TEST_STUDY, element); assertEquals(VERSION_HOLDER, returned); verify(dao).saveElementRevision(elementCaptor.capture()); assertEquals(new Long(1), elementCaptor.getValue().getRevision()); AppConfigElement captured = elementCaptor.getValue(); assertNull(captured.getVersion()); assertFalse(captured.isDeleted()); assertEquals("api", captured.getStudyId()); assertEquals("api:id", captured.getKey()); assertEquals(TIMESTAMP.getMillis(), captured.getCreatedOn()); <START> assertEquals(TIMESTAMP.getMillis(), captured.getModifiedOn()); <END> }</code><technical_language>TIMESTAMP is DateTime.now() TestUtils creates timestamps DateTime.now(). consider values ensure test works. (Similarly in updateElementRevision(), publishElementRevision(), deleteElementRevision(), deleteElementAllRevisions().)</technical_language>

Target:
public void createElement() { AppConfigElement element = TestUtils.getAppConfigElement(); element.setRevision(null); element.setDeleted(true); when(dao.saveElementRevision(element)).thenReturn(VERSION_HOLDER); VersionHolder returned = service.createElement(TEST_STUDY, element); assertEquals(VERSION_HOLDER, returned); verify(dao).saveElementRevision(elementCaptor.capture()); assertEquals(new Long(1), elementCaptor.getValue().getRevision()); AppConfigElement captured = elementCaptor.getValue(); assertNull(captured.getVersion()); assertFalse(captured.isDeleted()); assertEquals("api", captured.getStudyId()); assertEquals("api:id", captured.getKey()); assertEquals(TIMESTAMP.getMillis(), captured.getCreatedOn()); assertEquals(TIMESTAMP.getMillis(), captured.getModifiedOn()); }
Source:
<code>public static void validatePrimaryKey(TableSchema schema) { schema.getPrimaryKey().ifPresent( key -> { List<LogicalTypeRoot> illegalTypes = key.getColumns() .stream() .map(fieldName -> { LogicalType logicalType = schema.getFieldDataType(fieldName).get().getLogicalType(); if (hasRoot(logicalType, LogicalTypeRoot.DISTINCT_TYPE)) { return ((DistinctType) logicalType).getSourceType().getTypeRoot(); } else { return logicalType.getTypeRoot(); } }) .filter(ILLEGAL_PRIMARY_KEY_TYPES::contains) .collect(Collectors.toList()); if (!illegalTypes.isEmpty()) { throw new ValidationException( String.format( "The table has a primary key on columns of illegal types: %s.\n" + " Elasticsearch sink does not support primary keys on columns of types: %s.", <START> ILLEGAL_PRIMARY_KEY_TYPES, illegalTypes)); <END> } } ); }</code><technical_language>Switch parameter</technical_language>

Target:
public static void validatePrimaryKey(TableSchema schema) { schema.getPrimaryKey().ifPresent( key -> { List<LogicalTypeRoot> illegalTypes = key.getColumns() .stream() .map(fieldName -> { LogicalType logicalType = schema.getFieldDataType(fieldName).get().getLogicalType(); if (hasRoot(logicalType, LogicalTypeRoot.DISTINCT_TYPE)) { return ((DistinctType) logicalType).getSourceType().getTypeRoot(); } else { return logicalType.getTypeRoot(); } }) .filter(ILLEGAL_PRIMARY_KEY_TYPES::contains) .collect(Collectors.toList()); if (!illegalTypes.isEmpty()) { throw new ValidationException( String.format( "The table has a primary key on columns of illegal types: %s.\n" + " Elasticsearch sink does not support primary keys on columns of types: %s.", illegalTypes, ILLEGAL_PRIMARY_KEY_TYPES)); } } ); }
Source:
<code>private void setStaffOnly(Resource resc, Model model) { Map<String, String> depositStatus = getDepositStatus(); String staffOnly = depositStatus.get(DepositField.staffOnly.name()); <START> if (Boolean.parseBoolean(staffOnly)) { <END> model.add(resc, CdrAcl.none, PUBLIC_PRINC); model.add(resc, CdrAcl.none, AUTHENTICATED_PRINC); } }</code><technical_language>need determination deposit is staff once, suggest checking this line 54 Model model = getWritableModel(); early return if staff only. Alternatively, remove check check is (trying to) happen in DepositSupervisor</technical_language>

Target:
private void setStaffOnly(Resource resc, Model model) { model.add(resc, CdrAcl.none, PUBLIC_PRINC); model.add(resc, CdrAcl.none, AUTHENTICATED_PRINC); }
Source:
<code>public void stop(BundleContext bundleContext) throws Exception { EMFCompareRCPPlugin.plugin = null; final IExtensionRegistry registry = Platform.getExtensionRegistry(); registry.removeListener(loadOnDemandRegistryListener); loadOnDemandRegistryListener = null; loadOnDemandRegistry = null; registry.removeListener(postProcessorFactoryRegistryListener); postProcessorFactoryRegistryListener = null; postProcessorDescriptorsRegistry = null; registry.removeListener(mergerRegistryListener); mergerRegistryListener = null; mergerRegistry = null; registry.removeListener(matchEngineRegistryListener); matchEngineRegistryListener = null; matchEngineFactoryRegistry = null; registry.removeListener(adapterFactoryRegistryListener); adapterFactoryRegistryListener = null; adapterFactoryRegistry = null; <START> <END> registry.removeListener(diffEngineListener); diffEngineListener = null; diffEngineRegistry = null; registry.removeListener(equiEngineListener); equiEngineListener = null; equiEngineRegistry = null; registry.removeListener(conflictDetectorListener); conflictDetectorListener = null; conflictDetectorRegistry = null; registry.removeListener(reqEngineListener); reqEngineListener = null; reqEngineRegistry = null; super.stop(bundleContext); }</code><technical_language>careful stop. unstack done in start, i.e. if A, B C done in start(), stop() undo in order C, B A</technical_language>

Target:
public void stop(BundleContext bundleContext) throws Exception { EMFCompareRCPPlugin.plugin = null; final IExtensionRegistry registry = Platform.getExtensionRegistry(); discardConflictDetectorRegistry(registry); discardReqEngineRegistry(registry); discardEquiEngineRegistry(registry); discardDiffEngineRegistry(registry); discardLoadOnDemandeRegistry(registry); discardPostProcessorfactoryRegistry(registry); discardMergerRegistry(registry); discardMatchEngineRegistry(registry); discardAdapterFactoryRegistry(registry); super.stop(bundleContext); }
Source:
<code>public void setRef(String ref) { mRef = ref; getArguments().putString("ref", ref); <START> mSubscriptions[0] = mLoadReadme.compose(RxTools.applySchedulers()).subscribe(); <END> if (mContentView != null) { mContentView.findViewById(R.id.readme).setVisibility(View.GONE); mContentView.findViewById(R.id.pb_readme).setVisibility(View.VISIBLE); } }</code><technical_language>I is error. I mLoadReadme set anywhere</technical_language>

Target:
public void setRef(String ref) { mRef = ref; getArguments().putString("ref", ref); loadReadme(false); if (mContentView != null) { mContentView.findViewById(R.id.readme).setVisibility(View.GONE); mContentView.findViewById(R.id.pb_readme).setVisibility(View.VISIBLE); } }
Source:
<code>private void reload() throws IOException { <START> final Reader r = new FileReader(ConfigFileConstants.getFile(ConfigFileConstants.EVENTD_CONFIG_FILE_NAME)); <END> m_config = JaxbUtils.unmarshal(EventdConfiguration.class, r); }</code><technical_language>close FileReader unmarshal? pass File JaxbUtils</technical_language>

Target:
private void reload() throws IOException { try (final Reader r = new FileReader(ConfigFileConstants.getFile(ConfigFileConstants.EVENTD_CONFIG_FILE_NAME))) { m_config = JaxbUtils.unmarshal(EventdConfiguration.class, r); } }
Source:
<code>public void onResponse(Response coapResponse) { LOG.debug("Received coap response: for {}", coapResponse, coapRequest); coapRequest.removeMessageObserver(this); if (evenRaised.compareAndSet(false, true)) { cleaningTask.cancel(false); responseCallback.onResponse(coapResponse); } else { <START> LOG.warn("OnResponse callback ignored because an event was already raised for this request {}", <END> coapRequest); } }</code><technical_language>warn</technical_language>

Target:
public void onResponse(Response coapResponse) { LOG.debug("Received coap response: for {}", coapResponse, coapRequest); coapRequest.removeMessageObserver(this); if (eventRaised.compareAndSet(false, true)) { cleaningTask.cancel(false); try { responseCallback.onResponse(coapResponse); } catch (RuntimeException e) { LOG.warn("Uncaught exception during onResponse callback"); } } else { LOG.debug("OnResponse callback ignored because an event was already raised for this request {}", coapRequest); } }
Source:
<code>public void handlePageSelected() { assertThat(activity.pageSelectedViewPager).isNull(); assertThat(activity.pageSelectedPosition).isEqualTo(0); <START> ViewPager.OnPageChangeListener listener = field("mOnPageChangeListener").ofType(ViewPager.OnPageChangeListener.class).in(viewPager).get(); <END> int position = 100; listener.onPageSelected(position); assertThat(activity.pageSelectedViewPager).isEqualTo(viewPager); assertThat(activity.pageSelectedPosition).isEqualTo(position); }</code><technical_language>Move this common line setUp</technical_language>

Target:
public void handlePageSelected() { initViewPager(R.id.viewPager1); assertViewPagerIsNull(); assertPositionIsNotSet(); int position = 100; listener.onPageSelected(position); assertThat(activity.viewPager).isEqualTo(viewPager); assertThat(activity.position).isEqualTo(position); }
Source:
<code>public PhysicalOperation visitFilter(FilterNode node, LocalExecutionPlanContext context) { PlanNode sourceNode = node.getSource(); RowExpression filterExpression = node.getPredicate(); List<Symbol> outputSymbols = node.getOutputSymbols(); <START> return visitScanFilterAndProject(context, node.getId(), sourceNode, Optional.of(filterExpression), AssignmentsUtils.identity(outputSymbols), outputSymbols); <END> }</code><technical_language>change static import</technical_language>

Target:
public PhysicalOperation visitFilter(FilterNode node, LocalExecutionPlanContext context) { PlanNode sourceNode = node.getSource(); RowExpression filterExpression = node.getPredicate(); List<Symbol> outputSymbols = node.getOutputSymbols(); AssignmentsUtils.Builder identities = AssignmentsUtils.builder(); for (Symbol symbol : outputSymbols) { Type type = requireNonNull(context.getTypes().get(symbol), format("No type for symbol %s", symbol)); identities.put(symbol, new VariableReferenceExpression(symbol.getName(), type)); } return visitScanFilterAndProject(context, node.getId(), sourceNode, Optional.of(filterExpression), identities.build(), outputSymbols); }
Source:
<code>public boolean isOriginalEmptyValue() throws Exception { <START> return !Sets.newHashSet(getOriginal()).equals(emptyValue); <END> }</code><technical_language>if this method check original state is empty value, need return value? In other words, return Objects.equals(emptyValue, Sets.newHashSet(getOriginal()))</technical_language>

Target:
public boolean isOriginalEmptyValue() throws Exception { return Objects.equals(emptyValue, Sets.newHashSet(((Iterable<?>) getOriginal()).iterator())); }
Source:
<code>public static double glucoseToMgDl(double mmolL) { <START> return mmolL * 18; <END> }</code><technical_language>create a constant make's sense? I idea is 18 atm</technical_language>

Target:
public static double glucoseToMgDl(double mmolL) { return mmolL * MG_DL_TO_MMOL_CONSTANT; }
Source:
<code>public ImmutableBoundedValue<Integer> fireTicks() { return ImmutableDataCachingUtil.getValue(ImmutableSpongeBoundedValue.class, Keys.FIRE_TICKS, this.fireTicks, this.fireTicks, intComparator(), <START> 0); <END> }</code><technical_language>missing extra argument. Put this way: ImmutableDataCachingUtil.getValue() is supposed arguments match a specific constructor of provided ImmutableSpongeBoundedValue class. parameters match exactly, util construct object</technical_language>

Target:
public ImmutableBoundedValue<Integer> fireTicks() { return new ImmutableSpongeBoundedValue<Integer>(Keys.FIRE_TICKS, this.fireTicks, 0, intComparator(), 0, Integer.MAX_VALUE); }
Source:
<code>public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vm_name", "description", "domain", "os", "osType", "creation_date", "num_of_monitors", "allowConsoleReconnect", "usb_policy", "is_auto_suspend", "auto_startup", "dedicated_vm_for_vds", "default_display_type", "priority", "default_boot_sequence", "initrd_url", "kernel_url", "kernel_params", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", <START> "vmPayload", "balloonEnabled", "num_of_cpus" }); <END> mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vds_group_id", "time_zone", "is_stateless", "nice_level", "mem_size_mb", "num_of_sockets", "cpu_per_socket", "iso_path", "userDefinedProperties", "predefinedProperties", "customProperties", "images", "interfaces" })); }</code><technical_language>Is this change part of bug fix</technical_language>

Target:
public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vm_name", "description", "domain", "os", "osType", "creation_date", "num_of_monitors", "allowConsoleReconnect", "usb_policy", "is_auto_suspend", "auto_startup", "dedicated_vm_for_vds", "default_display_type", "priority", "default_boot_sequence", "initrd_url", "kernel_url", "kernel_params", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", "vmPayload", "balloonEnabled"}); mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vds_group_id", "time_zone", "is_stateless", "nice_level", "mem_size_mb", "num_of_sockets", "cpu_per_socket", "iso_path", "userDefinedProperties", "predefinedProperties", "customProperties", "images", "interfaces" })); }
Source:
<code>public boolean isCurrentLayoutSlotUnFilled() { log.trace("isCurrentLayoutSlotUnFilled. Wrong epochs: {}, active servers: {}", wrongEpochs, activeLayoutServers ); boolean result = wrongEpochs.keySet().containsAll(activeLayoutServers); if (result) { String msg = "Current layout slot is empty. Filling slot with current layout." + " wrong epochs: {}, active layout servers: {}"; <START> log.info(msg, wrongEpochs, activeLayoutServers); <END> } return result; }</code><technical_language>put log message here</technical_language>

Target:
public boolean isCurrentLayoutSlotUnFilled() { log.trace("isCurrentLayoutSlotUnFilled. Wrong epochs: {}, active servers: {}", wrongEpochs, responsiveServers ); boolean result = wrongEpochs.keySet().containsAll(responsiveServers); if (result) { log.info("Current layout slot is empty. Filling slot with current layout. " + "Wrong epochs: {}, active layout servers: {}", wrongEpochs, responsiveServers); } return result; }
Source:
<code>public BitbucketUrl parse(String url) { Matcher matcher = bitbucketUrlPattern.matcher(url); if (!matcher.matches()) { throw new IllegalArgumentException( String.format( "The given url %s is not a valid Bitbucket server URL. Check either URL or server configuration.", url)); } String host = matcher.group("host"); String project = matcher.group("project"); String repoName = matcher.group("repo"); String branch = matcher.group("branch"); return new BitbucketUrl() .withHostName(host) .withProject(project) .withRepository(repoName) .withBranch(branch) <START> .withFactoryFilename(".factory.json") <END> .withDevfileFilenames(devfileFilenamesProvider.getConfiguredDevfileFilenames()); }</code><technical_language>withFactoryFilename(".factory.json") is used</technical_language>

Target:
public BitbucketUrl parse(String url) { if (bitbucketUrlPatterns.isEmpty()) { throw new UnsupportedOperationException( "The Bitbucket integration is not configured properly and cannot be used at this moment." + "Please refer to docs to check the Bitbucket integration instructions"); } Matcher matcher = bitbucketUrlPatterns .stream() .map(pattern -> pattern.matcher(url)) .filter(Matcher::matches) .findFirst() .orElseThrow( () -> new IllegalArgumentException( format( "The given url %s is not a valid Bitbucket server URL. Check either URL or server configuration.", url))); String host = matcher.group("host"); String project = matcher.group("project"); String repoName = matcher.group("repo"); String branch = matcher.group("branch"); return new BitbucketUrl() .withHostName(host) .withProject(project) .withRepository(repoName) .withBranch(branch) .withDevfileFilenames(devfileFilenamesProvider.getConfiguredDevfileFilenames()); }
Source:
<code>public static User map(DirectoryUser entity, User template) { User model = template != null ? template : new User(); model.setName(entity.getFirstName()); model.setUserName(entity.getPrincipal() != null ? entity.getPrincipal() : entity.getName()); <START> model.setUserName(model.getUserName() + "@" + entity.getDirectoryName()); <END> model.setId(DirectoryEntryIdUtils.encode(entity.getId())); model.setLastName(entity.getLastName()); model.setEmail(entity.getEmail()); model.setDepartment(entity.getDepartment()); model.setPrincipal(entity.getPrincipal()); model.setNamespace(entity.getNamespace()); if (entity.getGroups() != null) { model.setGroups(new Groups()); for (DirectoryGroup directoryGroup : entity.getGroups()) { Group group = new Group(); group.setName(directoryGroup.getName()); model.getGroups().getGroups().add(group); } } if (!StringUtils.isEmpty(entity.getDirectoryName())) { Domain dom = new Domain(); dom.setId(new Guid(entity.getDirectoryName().getBytes(Charset.forName("UTF-8")), true).toString()); model.setDomain(dom); } return model; }</code><technical_language>this principal I remember compatibility</technical_language>

Target:
public static User map(DirectoryUser entity, User template) { User model = template != null ? template : new User(); DbUser dbUser = new DbUser(entity); User result = map(dbUser, model); result.setId(DirectoryEntryIdUtils.encode(entity.getId())); return result; }
Source:
<code>public BytecodeNode visitLambda(LambdaDefinitionExpression lambda, Context context) { checkState(preGeneratedExpressions.getCompiledLambdaMetadata().containsKey(lambda), "lambda expressions map does not contain this lambda definition"); if (MethodHandle.class.equals(context.getLambdaInterface().get())) { <START> throw new PrestoException(FUNCTION_IMPLEMENTATION_ERROR, "Lambda cannot be generated as MethodHandle"); <END> } else { BytecodeGeneratorContext generatorContext = new BytecodeGeneratorContext( RowExpressionCompiler.this, context.getScope(), callSiteBinder, cachedInstanceBinder, registry, preGeneratedExpressions); return generateLambda( generatorContext, ImmutableList.of(), lambda, preGeneratedExpressions.getCompiledLambdaMetadata().get(lambda), context.getLambdaInterface().get()); } }</code><technical_language>Remove redundant else this line</technical_language>

Target:
public BytecodeNode visitLambda(LambdaDefinitionExpression lambda, Context context) { checkState(preGeneratedExpressions.getCompiledLambdaMap().containsKey(lambda), "lambda expressions map does not contain this lambda definition"); if (!context.lambdaInterface.get().isAnnotationPresent(FunctionalInterface.class)) { throw new VerifyException("lambda should be generated as class annotated with FunctionalInterface"); } BytecodeGeneratorContext generatorContext = new BytecodeGeneratorContext( RowExpressionCompiler.this, context.getScope(), callSiteBinder, cachedInstanceBinder, registry, preGeneratedExpressions); return generateLambda( generatorContext, ImmutableList.of(), preGeneratedExpressions.getCompiledLambdaMap().get(lambda), context.getLambdaInterface().get()); }
Source:
<code>public static void ensureCompiledCallThroughEntrypoint(boolean call) { int count = 0; while (!hasJitCompiledEntrypoint(Main.class, "callThrough")) { int limit = call ? 1 << Math.min(count, 12) : 0; for (int i = 0; i < limit; ++i) { callThrough(Main.class, "doNothing"); } try { Thread.sleep(count >= <START> 12 ? <END> 200 : 100); } catch (Exception e) { } if (++count == 50) { throw new Error("TIMEOUT"); } }; }</code><technical_language>12 from? Is related 12 line 138? introduce a variable instead</technical_language>

Target:
public static void ensureCompiledCallThroughEntrypoint(boolean call) { int count = 0; while (!hasJitCompiledEntrypoint(Main.class, "callThrough")) { final int rampUpCutOff = 12; int limit = call ? 1 << Math.min(count, rampUpCutOff) : 0; for (int i = 0; i < limit; ++i) { callThrough(Main.class, "doNothing"); } try { Thread.sleep(count >= rampUpCutOff ? 200 : 100); } catch (Exception e) { } if (++count == 50) { throw new Error("TIMEOUT"); } }; }