auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String keyToString(Object kvValue) { Class<?> type = kvValue.getClass(); if (type.isArray()) { if (type.getComponentType() == boolean.class) { return Arrays.toString((boolean[]) kvValue); } else if (type.getComponentType() == byte.class) { <START> return Arrays.toString((byte[]) kvValue); <END> } else if (type.getComponentType() == char.class) { return Arrays.toString((char[]) kvValue); } else if (type.getComponentType() == double.class) { return Arrays.toString((double[]) kvValue); } else if (type.getComponentType() == float.class) { return Arrays.toString((float[]) kvValue); } else if (type.getComponentType() == int.class) { return Arrays.toString((int[]) kvValue); } else if (type.getComponentType() == long.class) { return Arrays.toString((long[]) kvValue); } else if (type.getComponentType() == short.class) { return Arrays.toString((short[]) kvValue); } else { return Arrays.toString((Object[]) kvValue); } } else { return String.valueOf(kvValue); } }</code><technical_language>I this BinaryNode is convert a Binary byte[] JSON. base64-encode data is binary creating array node</technical_language>

Target:
String keyToString(Object kvValue) { if (kvValue == null) { return "null"; } Class<?> type = kvValue.getClass(); if (type.isArray()) { if (type.getComponentType() == boolean.class) { return Arrays.toString((boolean[]) kvValue); } else if (type.getComponentType() == byte.class) { return new BinaryNode((byte[]) kvValue).asText(); } else if (type.getComponentType() == char.class) { return Arrays.toString((char[]) kvValue); } else if (type.getComponentType() == double.class) { return Arrays.toString((double[]) kvValue); } else if (type.getComponentType() == float.class) { return Arrays.toString((float[]) kvValue); } else if (type.getComponentType() == int.class) { return Arrays.toString((int[]) kvValue); } else if (type.getComponentType() == long.class) { return Arrays.toString((long[]) kvValue); } else if (type.getComponentType() == short.class) { return Arrays.toString((short[]) kvValue); } else { return Arrays.toString((Object[]) kvValue); } } else { return String.valueOf(kvValue); } }
Source:
<code>private static <T> T readContent(final String content, final Constructor constructor) throws DockstoreYamlException { try { final Yaml yaml = new Yaml(constructor); return yaml.load(content); } catch (Exception e) { String msg = ERROR_READING_DOCKSTORE_YML; String errorMsg = e.getMessage(); if (errorMsg.startsWith("Cannot create property=")) { <START> int startIndex = errorMsg.indexOf("=") + 1; <END> int endIndex = errorMsg.indexOf(" for JavaBean"); msg += " Unrecognized property \"" + errorMsg.substring(startIndex, endIndex) + "\"."; } else { msg += e.getMessage(); } LOG.error(msg, e); throw new DockstoreYamlException(msg); } }</code><technical_language>a test, string parse indexes feel breakable if underlying library changes</technical_language>

Target:
private static <T> T readContent(final String content, final Constructor constructor) throws DockstoreYamlException { try { final Yaml yaml = new Yaml(constructor); return yaml.load(content); } catch (Exception e) { final String exceptionMsg = e.getMessage(); String errorMsg = ERROR_READING_DOCKSTORE_YML; final Matcher matcher = WRONG_KEY_PATTERN.matcher(exceptionMsg); if (matcher.find()) { errorMsg += " Unrecognized property \"" + matcher.group(1) + "\""; } else { errorMsg += exceptionMsg; } LOG.error(errorMsg, e); throw new DockstoreYamlException(errorMsg); } }
Source:
<code>private Map<String, LabelInfo> labelsFor(ChangeData cd, boolean standard, boolean detailed) throws OrmException { if (!standard && !detailed) { return null; } ChangeControl ctl = control(cd); if (ctl == null) { <START> return null; <END> } PatchSet ps = cd.currentPatchSet(db); if (ps == null) { return null; } if (cd.getChange().getStatus().isOpen()) { return labelsForOpenChange(cd, standard, detailed); } else { return labelsForClosedChange(cd, standard, detailed); } }</code><technical_language>This part leaves nervous some callers relying ChangeInfo.labels present. Is reason part of patch simplifying ChangeControl caching</technical_language>

Target:
private Map<String, LabelInfo> labelsFor(ChangeData cd, boolean standard, boolean detailed) throws OrmException { if (!standard && !detailed) { return null; } ChangeControl ctl = control(cd); if (ctl == null) { return Collections.emptyMap(); } PatchSet ps = cd.currentPatchSet(db); if (ps == null) { return Collections.emptyMap(); } if (cd.getChange().getStatus().isOpen()) { return labelsForOpenChange(cd, standard, detailed); } else { return labelsForClosedChange(cd, standard, detailed); } }
Source:
<code>private void forceFailover(JedisSentinelPool pool) throws InterruptedException { HostAndPort oldMaster = pool.getCurrentHostMaster(); Jedis beforeFailoverJedis = pool.getResource(); assertEquals("PONG", beforeFailoverJedis.ping()); waitForFailover(pool, oldMaster); Jedis afterFailoverJedis = pool.getResource(); assertEquals("PONG", afterFailoverJedis.ping()); assertNotNull(afterFailoverJedis.configGet("requirepass").get(1)); <END> <START> assertEquals(2, afterFailoverJedis.getDB()); beforeFailoverJedis.close(); afterFailoverJedis.close(); }</code><technical_language>this unchanged. is pending PR related this</technical_language>

Target:
private void forceFailover(JedisSentinelPool pool) throws InterruptedException { HostAndPort oldMaster = pool.getCurrentHostMaster(); Jedis beforeFailoverJedis = pool.getResource(); assertEquals("PONG", beforeFailoverJedis.ping()); waitForFailover(pool, oldMaster); Jedis afterFailoverJedis = pool.getResource(); assertEquals("PONG", afterFailoverJedis.ping()); assertEquals(2, afterFailoverJedis.getDB()); assertEquals("twice-failover-client", afterFailoverJedis.clientGetname()); beforeFailoverJedis.close(); afterFailoverJedis.close(); }
Source:
<code>private void findRequireBundleReferences(ArrayList<TextFileChange> changes, IProgressMonitor monitor) throws CoreException { String oldId = fDesc.getSymbolicName(); BundleDescription[] dependents = fDesc.getDependents(); <START> SubMonitor subMonitor = SubMonitor.convert(monitor, "", dependents.length); END> for (int i = 0; i < dependents.length; i++) { BundleSpecification[] requires = dependents[i].getRequiredBundles(); boolean found = false; for (int j = 0; j < requires.length; j++) { if (requires[j].getName().equals(oldId)) { CreateHeaderChangeOperation op = new CreateHeaderChangeOperation(PluginRegistry.findModel(dependents[i]), Constants.REQUIRE_BUNDLE, oldId, fNewId); op.run(subMonitor.newChild(1)); TextFileChange change = op.getChange(); if (change != null) changes.add(change); found = true; break; } } if (!found) subMonitor.worked(1); } }</code><technical_language>two-argument constructor</technical_language>

Target:
private void findRequireBundleReferences(ArrayList<TextFileChange> changes, IProgressMonitor monitor) throws CoreException { String oldId = fDesc.getSymbolicName(); BundleDescription[] dependents = fDesc.getDependents(); SubMonitor subMonitor = SubMonitor.convert(monitor, dependents.length); for (int i = 0; i < dependents.length; i++) { BundleSpecification[] requires = dependents[i].getRequiredBundles(); SubMonitor iterationMonitor = subMonitor.newChild(1); for (int j = 0; j < requires.length; j++) { if (requires[j].getName().equals(oldId)) { CreateHeaderChangeOperation op = new CreateHeaderChangeOperation(PluginRegistry.findModel(dependents[i]), Constants.REQUIRE_BUNDLE, oldId, fNewId); op.run(iterationMonitor); TextFileChange change = op.getChange(); if (change != null) { changes.add(change); } break; } } } }
Source:
<code>public static Set<Integer> getOptedInHistoryTypes() { <START> return optedInHistoryTypes; <END> }</code><technical_language>Collections.unmodifiableSet(optedInHistoryTypes)</technical_language>

Target:
public static Set<Integer> getOptedInHistoryTypes() { return Collections.unmodifiableSet(optedInHistoryTypes); }
Source:
<code>public abstract T retriableCall() throws Exception; public T call() throws Exception { int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (retry == retrys) { throw e; } <START> logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); <END> if(++logCounter == 1) logger.error("Exception --> "+ExceptionUtils.getFullStackTrace(e)); Thread.sleep(waitTime); } finally { forEachExecution(); } } }</code><technical_language>IIRC, I reason for printing out exception message full stack trace reduce noise in logs. I full stack printed if number of failures reaches some threshold. reconsider</technical_language>

Target:
public abstract T retriableCall() throws Exception; public T call() throws Exception { int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (retry == retrys) { throw e; } logger.error(String.format("Retry #%d for: %s",retry, e.getMessage())); if(++logCounter == 1) logger.error("Exception --> "+ExceptionUtils.getFullStackTrace(e)); Thread.sleep(waitTime); } finally { forEachExecution(); } } }
Source:
<code>protected boolean canConvert(String input) { try { URI uri = new URI(input); <START> return uri.getScheme() != null && "file".equalsIgnoreCase(uri.getScheme()); <END> } catch (URISyntaxException e) { return false; } }</code><technical_language>is a behavioral change, previous code lookup files resource loader if string representation scheme, this not. change fixes specific build failure. suggestion return uri.getScheme() == null || "file".equalsIgnoreCase(uri.getScheme()); verified this change for a successful build (with extensions included, -Prelease): [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 06:12 min (Wall Clock) [INFO] Finished at: 2020-05-06T15:36:28+02:00 [INFO] ------------------------------------------------------------------------</technical_language>

Target:
protected boolean canConvert(String input) { try { URI uri = new URI(input); return uri.getScheme() == null || "file".equalsIgnoreCase(uri.getScheme()); } catch (URISyntaxException e) { return false; } }
Source:
<code>public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); <START> parser.startFileFromBeginning(); <END> if (encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = DEFAULT_CHARSET; } }</code><technical_language>StringInputRowParser is parser options file-oriented (you streams etc) this a good place put this. imo, this replace reset() called in places reset() is currently called (like FileIteratingFirehose). addition: needs called file too</technical_language>

Target:
public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); if (encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = DEFAULT_CHARSET; } }
Source:
<code>public void setListValue(List<T> value) { selectedList.clear(); selectedList.addAll(value); ListBox listBox = asListBox(); if (listBox.getSelectedIndex() > -1) { listBox.setItemSelected(listBox.getSelectedIndex(), false); } for (T item: selectedList) { if <START> (typedItemList.indexOf(item) > -1 && typedItemList.indexOf(item) < listBox.getItemCount()) { listBox.setItemSelected(typedItemList.indexOf(item), true); <END> } } }</code><technical_language>Please consider evaluate 'typedItemList.indexOf(item)' once</technical_language>

Target:
public void setListValue(List<T> value) { selectedList.clear(); selectedList.addAll(value); ListBox listBox = asListBox(); if (listBox.getSelectedIndex() > -1) { listBox.setItemSelected(listBox.getSelectedIndex(), false); } for (T item: selectedList) { int itemIndex = typedItemList.indexOf(item); if (itemIndex > -1 && itemIndex < listBox.getItemCount()) { listBox.setItemSelected(itemIndex, true); } } }
Source:
<code><START> VLANs(Iterable<VLANInfo> objects, PaginationOptions paginationOptions) { <END> super(objects, paginationOptions); }</code><technical_language>is this constructor package protected</technical_language>

Target:
public VLANs(Iterable<VLANInfo> objects, PaginationOptions paginationOptions) { super(objects, paginationOptions); }
Source:
<code>public String toString() { return MoreObjects.toStringHelper(this) .add("iLine", iLine) .add("lastK", lastK) <START> .add("peningSpaces", spacesPending.toString().replace("\t", "\\t")) <END> .add("newlinesPending", newlinesPending) .add("blankLines", blankLines) .add("super", super.toString()) .toString(); }</code><technical_language>parameter changed, right? is, "spacesPending"</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("iLine", iLine) .add("lastK", lastK) .add("spacesPending", spacesPending.toString().replace("\t", "\\t")) .add("newlinesPending", newlinesPending) .add("blankLines", blankLines) .add("super", super.toString()) .toString(); }
Source:
<code>private void backup() { if (Build.VERSION.SDK_INT >= 19) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("application/x-sqlite3") <START> .putExtra(Intent.EXTRA_TITLE, "AntennaPodBackup.db"); <END> startActivityForResult(intent, REQUEST_CODE_BACKUP_DOCUMENT); } else { try { File sd = Environment.getExternalStorageDirectory(); File backupDB = new File(sd, "AntennaPodBackup.db"); writeBackupTo(new FileOutputStream(backupDB)); } catch (Exception e) { e.printStackTrace(); Snackbar.make(findViewById(R.id.import_export_layout), e.getMessage(), Snackbar.LENGTH_SHORT).show(); } } }</code><technical_language>AntennaPodBackup.db a static final field</technical_language>

Target:
private void backup() { if (Build.VERSION.SDK_INT >= 19) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("application/x-sqlite3") .putExtra(Intent.EXTRA_TITLE, EXPORT_FILENAME); startActivityForResult(intent, REQUEST_CODE_BACKUP_DOCUMENT); } else { try { File sd = Environment.getExternalStorageDirectory(); File backupDB = new File(sd, EXPORT_FILENAME); writeBackupTo(new FileOutputStream(backupDB)); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); Snackbar.make(findViewById(R.id.import_export_layout), e.getLocalizedMessage(), Snackbar.LENGTH_SHORT).show(); } } }
Source:
<code>public void test_Constructor_URL() throws Exception { final String mockFileURL = "<LINK_0>"; MockHTTPClient mockHttpClient = new MockHTTPClient(); byte[] responseBytes = IOUtils.toByteArray(getClass().getResourceAsStream("stations-schema.json")); MockHttpResponse mockResponse = new MockHttpResponse(responseBytes, "text/json"); mockHttpClient.expectGet(mockFileURL, mockResponse); MongoSchemaStore mss = <START> new MongoSchemaFileStore("mockshema", new URL(mockFileURL), mockHttpClient); <END> assertEquals(1, mss.typeNames().size()); SimpleFeatureType type = mss.retrieveSchema(new NameImpl("stations")); assertNotNull(type); mss.deleteSchema(new NameImpl("stations")); }</code><technical_language>This constructor is runtime, try test code in production runtime</technical_language>

Target:
public void test_Constructor_URL() throws Exception { final String mockFileURL = "<LINK_0>"; MockHTTPClient mockHttpClient = new MockHTTPClient(); byte[] responseBytes = IOUtils.toByteArray(getClass().getResourceAsStream("stations-schema.json")); MockHttpResponse mockResponse = new MockHttpResponse(responseBytes, "text/json"); mockHttpClient.expectGet(mockFileURL, mockResponse); SchemaStoreDirectory directory = SchemaStoreDirectoryProvider.getLowestPriority(); File downloadedFile = MongoUtil.downloadSchemaFile( "mockshema", new URL(mockFileURL), mockHttpClient, directory); MongoSchemaStore mss = new MongoSchemaFileStore(downloadedFile.getParentFile().toURI()); assertEquals(1, mss.typeNames().size()); SimpleFeatureType type = mss.retrieveSchema(new NameImpl("stations")); assertNotNull(type); mss.deleteSchema(new NameImpl("stations")); Files.walk(new File(directory.getDirectory(), "mockshema").toPath()) .sorted(Comparator.reverseOrder()) .map(Path::toFile) .forEach(File::delete); }
Source:
<code>public void adjust(Mechanism mechanism) { if (mechanism.matches("is_open") && mechanism.requireBoolean("Doors can only be open or closed.")) { if (door.isOpen() == mechanism.getValue().asBoolean() || BigDoorsBridge.commander.isDoorBusy(door.getDoorUID())) { return; } if (!BigDoorsBridge.bigDoors.areChunksLoadedForDoor(door)) { Debug.echoError("Door chunks are not loaded. cannot open door."); return; } BigDoorsBridge.bigDoors.toggleDoor(door.getDoorUID()); return; } <START> if (mechanism.matches("is_locked") && mechanism.requireBoolean("Doors can only be locked or unlocked.")) { <END> BigDoorsBridge.commander.setLock(door.getDoorUID(), mechanism.getValue().asBoolean()); return; } if (mechanism.matches("auto_close") && mechanism.requireObject(DurationTag.class)) { BigDoorsBridge.commander.updateDoorAutoClose(door.getDoorUID(), mechanism.valueAsType(DurationTag.class).getSecondsAsInt()); } if (!mechanism.fulfilled()) { mechanism.reportInvalid(); } }</code><technical_language>remove custom message</technical_language>

Target:
public void adjust(Mechanism mechanism) { if (mechanism.matches("is_open") && mechanism.requireBoolean()) { if (door.isOpen() == mechanism.getValue().asBoolean() || BigDoorsBridge.commander.isDoorBusy(door.getDoorUID())) { return; } if (!BigDoorsBridge.bigDoors.areChunksLoadedForDoor(door)) { Debug.echoError("Door chunks are not loaded. cannot open door."); return; } BigDoorsBridge.bigDoors.toggleDoor(door.getDoorUID()); return; } if (mechanism.matches("is_locked") && mechanism.requireBoolean()) { BigDoorsBridge.commander.setLock(door.getDoorUID(), mechanism.getValue().asBoolean()); return; } if (mechanism.matches("auto_close") && mechanism.requireObject(DurationTag.class)) { BigDoorsBridge.commander.updateDoorAutoClose(door.getDoorUID(), mechanism.valueAsType(DurationTag.class).getSecondsAsInt()); } if (!mechanism.fulfilled()) { mechanism.reportInvalid(); } }
Source:
<code>private void setTabViews() { for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); <START> getMenu().add(1, i, <END> i, navTab.text()).setIcon(navTab.icon()); } }</code><technical_language>Menu.NONE clearer</technical_language>

Target:
private void setTabViews() { for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); getMenu().add(Menu.NONE, Menu.NONE, i, navTab.text()).setIcon(navTab.icon()); } }
Source:
<code>public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { <START> return new Gateway3DSAuthorisationResponse(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION, null); <END> }</code><technical_language>Calling constructor null replaced wither constructor chaining a factory method suggested in this class</technical_language>

Target:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { return Gateway3DSAuthorisationResponse.ofException(); }
Source:
<code>private ObjectMap getVariantOptions() { VariantSource source = getVariantSource(); ObjectMap variantOptions = new ObjectMap(); <START> variantOptions.put(VariantStorageManager.VARIANT_SOURCE, source); <END> variantOptions.put(VariantStorageManager.OVERWRITE_STATS, outputParameters.getStatisticsOverwrite()); return variantOptions; }</code><technical_language>Direct call getVariantSource() maybe</technical_language>

Target:
private ObjectMap getVariantOptions() { ObjectMap variantOptions = new ObjectMap(); variantOptions.put(VariantStorageManager.VARIANT_SOURCE, getVariantSource()); variantOptions.put(VariantStorageManager.OVERWRITE_STATS, outputParameters.getStatisticsOverwrite()); return variantOptions; }
Source:
<code>public void testDefaultSetup() throws Exception { setupGitAndDoHardReset(null, null, null, null, "* text=auto"); collectRepositoryState(); assertEquals("text=auto", entry1.attrs); <START> assertEquals(CONTENT_LF, entry1.file); assertEquals(CONTENT_LF, entry1.index); <END> assertEquals(CONTENT_LF, entry2.file); assertEquals(CONTENT_LF, entry2.index); assertEquals(CONTENT_LF, entry3.file); assertEquals(CONTENT_LF, entry3.index); }</code><technical_language>upload a version a helper method decreases size of this class</technical_language>

Target:
public void testDefaultSetup() throws Exception { setupGitAndDoHardReset(null, null, null, null, "* text=auto"); collectRepositoryState(); assertEquals("text=auto", entryCRLF.attrs); checkEntryContent(entryCRLF, CONTENT_LF, CONTENT_LF); checkEntryContent(entryLF, CONTENT_LF, CONTENT_LF); checkEntryContent(entryMixed, CONTENT_LF, CONTENT_LF); }
Source:
<code><START> public static GameObject getEntity(GameObjectDTO dto, EntityType type) <END> { Point2D position = new Point2D(dto.getBody().get_point().getX(), dto.getBody().get_point().getY()); switch (type) { case WALL: GameObject wall = new Wall(dto.getId(), position, dto.getBody().get_width(), dto.getBody().get_height(), defaultImages.get(EntityType.WALL)); return wall; case ENEMY_CHARACTER: GameObject enemy = new BoDCharacter(dto.getId(), position, dto.getBody().get_width(), dto.getBody().get_height(), 0, defaultImages.get(EntityType.ENEMY_CHARACTER)); return enemy; } return null; }</code><technical_language>createEntity is EntityType a parameter? in case part of GameObjectDTO. in case i dont this is a solid handle creation of objects. possiblity give client collections of objects in joinGame methods for object creation. I do single collection gameobjects is approach, gameobjects fundamental differences (could character) need collection</technical_language>

Target:
public static GameObject getEntity(GameObjectDTO dto, EntityType type) { BodyDTO body = dto.getBody(); Point2D position = new Point2D(body.get_point().getX(), body.get_point().getY()); switch (type) { case WALL: GameObject wall = new Wall(dto.getId(), position, body.get_width(), body.get_height(), defaultImages.get(EntityType.WALL)); return wall; case ENEMY_CHARACTER: GameObject enemy = new BoDCharacter(dto.getId(), position, body.get_width(), body.get_height(), 0, defaultImages.get(EntityType.ENEMY_CHARACTER)); return enemy; } return null; }
Source:
<code><START> private void applyExpandedStateContext(ViewContext viewContext) { <END> if (viewContext != null) { fTimeGraphViewer.setExpandedState(viewContext.getExpandedEntries(), true); } else { Object input = fTimeGraphViewer.getInput(); if (input instanceof List) { for (Object traceEntry : (List<Object>) input) { if (traceEntry instanceof ITimeGraphEntry) { setDefaultExpandState((ITimeGraphEntry) traceEntry, 0); } } } else if (input instanceof ITimeGraphEntry) { setDefaultExpandState((ITimeGraphEntry) input, 0); } else { throw new IllegalStateException("Invalid input type"); } } }</code><technical_language>I this method called switching a trace, opening for time refreshing time graph manage expanded state</technical_language>

Target:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.setExpandedState(viewContext.getExpandedEntries(), true); } else { ITimeGraphEntry[] elements = fTimeGraphContentProvider.getElements(fTimeGraphViewer.getInput()); for (ITimeGraphEntry entry : elements) { fTimeGraphViewer.setDefaultExpandState(entry, 0); } } fTimeGraphViewer.refresh(); }
Source:
<code>public Ds3ResponseType toDs3ResponseType() { <START> Ds3ResponseType ds3ResponseType = new Ds3ResponseType(type); <END> return ds3ResponseType; }</code><technical_language>Missing final</technical_language>

Target:
public Ds3ResponseType toDs3ResponseType() { final Ds3ResponseType ds3ResponseType = new Ds3ResponseType(type); return ds3ResponseType; }
Source:
<code>public int hashCode() { <START> int result = blockName != null ? blockName.hashCode() : 0; <END> result = 31 * result + (int) (contentLength ^ (contentLength >>> 32)); result = 31 * result + (committed ? 1 : 0); return result; }</code><technical_language>Prefer return Objects.hashCode(blobName, contentLenght, committed);</technical_language>

Target:
public int hashCode() { return Objects.hashCode(blockName, contentLength, committed); }
Source:
<code>public boolean waitForPath(int waitTime, String path) { long timeout = System.currentTimeMillis() + waitTime; File file = new File(path); boolean exists = file.exists(); while (!exists && System.currentTimeMillis() < timeout) { try { Thread.sleep(1000); } <START> catch (InterruptedException e) { <END> throw new IllegalStateException(e.getMessage(), e); } exists = file.exists(); } return exists; }</code><technical_language>Please call Thread.currentThread().interrupt() handling InterruptedException directly</technical_language>

Target:
public boolean waitForPath(int waitTime, String path) { long timeout = System.currentTimeMillis() + waitTime; File file = new File(path); boolean exists = file.exists(); while (!exists && System.currentTimeMillis() < timeout) { try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException(e.getMessage(), e); } exists = file.exists(); } return exists; }
Source:
<code>public EnumConstantDeclaration addEnumConstant(String name) { <START> EnumConstantDeclaration enumConstant = new EnumConstantDeclaration(name); <END> getEntries().add(enumConstant); enumConstant.setParentNode(this); return enumConstant; }</code><technical_language>Hmmm, a method precondition: parameter name null. is required, stack trace clearer: points this location instead of constructor of SimpleName. user figure out constructor is called all, deduce nullpointer passed in a null String. I leave in, more asserts merrier :)</technical_language>

Target:
public EnumConstantDeclaration addEnumConstant(String name) { assertNonEmpty(name); EnumConstantDeclaration enumConstant = new EnumConstantDeclaration(name); getEntries().add(enumConstant); enumConstant.setParentNode(this); return enumConstant; }
Source:
<code>public void testSelectMeasurementsWithJson() { Delete.table(Measurement.class); addMeasurement(EXISTING_REPORT_ID, true); addMeasurement(EXISTING_REPORT_ID_2, true); addMeasurement(NONEXISTING_REPORT_ID, true); addMeasurement(NONEXISTING_REPORT_ID, true); <START> List<Measurement> measurements = Measurement.selectMeasurementsWithJson(a); <END> if (measurements.size() == 2 && containsMeasurement(measurements, EXISTING_REPORT_ID) && containsMeasurement(measurements, EXISTING_REPORT_ID_2)) Assert.assertTrue(true); Assert.fail(); }</code><technical_language>I confused this a. application, it</technical_language>

Target:
public void testSelectMeasurementsWithJson() throws IOException { Delete.table(Measurement.class); addMeasurement(EXISTING_REPORT_ID, false); addMeasurement(EXISTING_REPORT_ID_2, true); addMeasurement(NONEXISTING_REPORT_ID, true); List<Measurement> measurements = Measurement.selectMeasurementsWithJson(a); Assert.assertTrue(measurements.size() == 2 && containsMeasurement(measurements, NONEXISTING_REPORT_ID) && containsMeasurement(measurements, EXISTING_REPORT_ID_2)); }
Source:
<code>public void testSetUpActions_Exception(){ Context context = getInstrumentation().getTargetContext(); View layout = mock(View.class); View view1 = new View(context); view1.setId(13); actionList = Lists.of(action1); setupActionGetViewId(); setupTriggerType(); when(layout.findViewById(1)).thenReturn(view1); ComponentActionManager actionManager = new ComponentActionManager(actionList); try{ actionManager.setupActions(layout); } <START> catch(IllegalArgumentException e){ <END> } }</code><technical_language>throwing exception is of a test. need restructure this class verify things, especially is called. do introduce a ActionPerformerFactory returns ActionPerformer, a mock in this case setupListener is called it. Similarly need t introduce a method access ActionList validate it</technical_language>

Target:
public void testSetUpActions_Exception() { Context context = getInstrumentation().getTargetContext(); View layout = mock(View.class); View view1 = new View(context); view1.setId(13); actionList = Lists.of(view1Action1); when(layout.findViewById(1)).thenReturn(view1); ComponentActionManager actionManager = new ComponentActionManager(actionList); try { actionManager.setupActions(layout); } catch (IllegalArgumentException e) { } }
Source:
<code>public Map<ArchitectureType, Integer> getDefaultOSes() { <START> HashMap<ArchitectureType, Integer> defaultOSes = new HashMap<ArchitectureType, Integer>(); <END> defaultOSes.put(ArchitectureType.x86_64, DEFAULT_X86_OS); defaultOSes.put(ArchitectureType.ppc64, DEFAULT_PPC_OS); return defaultOSes; }</code><technical_language>please cache this map (as is hard coded) create intial compact new HashMap<>(2)</technical_language>

Target:
public Map<ArchitectureType, Integer> getDefaultOSes() { return defaultOsMap; }
Source:
<code>public long writeTo(int index, WritableByteChannel channel, long relativeOffset, long maxSize) throws IOException { if (index >= readOptions.size()) { throw new IndexOutOfBoundsException("index " + index + " out of the messageset size " + readOptions.size()); } BlobReadOptions options = readOptions.get(index); long startOffset = options.getOffset() + relativeOffset; long sizeToRead = Math.min(maxSize, options.getMessageInfo().getSize() - relativeOffset); logger.trace("Blob Message Read Set position count {}", startOffset, sizeToRead); long written = 0; if (options.getPreFetchedDataRelativeOffset() != -1) { ByteBuffer buf = options.getPreFetchedData(); <START> buf.flip(); <END> long bufStartOffset = relativeOffset - options.getPreFetchedDataRelativeOffset(); buf.limit((int)(bufStartOffset + sizeToRead)); buf.position((int)(bufStartOffset)); while (buf.hasRemaining()) { written += channel.write(buf); } } else { written = options.getChannel().transferTo(startOffset, sizeToRead, channel); } logger.trace("Written bytes to the write channel from the file channel : {}", written, options.getFile()); return written; }</code><technical_language>this done time is prefetched - read</technical_language>

Target:
public long writeTo(int index, WritableByteChannel channel, long relativeOffset, long maxSize) throws IOException { if (index >= readOptions.size()) { throw new IndexOutOfBoundsException("index " + index + " out of the messageset size " + readOptions.size()); } BlobReadOptions options = readOptions.get(index); long sizeToRead = Math.min(maxSize, options.getMessageInfo().getSize() - relativeOffset); long written = 0; if (options.getPrefetchedDataRelativeOffset() == -1) { long startOffset = options.getOffset() + relativeOffset; logger.trace("Blob Message Read Set position count {}", startOffset, sizeToRead); written = options.getChannel().transferTo(startOffset, sizeToRead, channel); } else { ByteBuffer buf = options.getPrefetchedData(); long bufStartOffset = relativeOffset - options.getPrefetchedDataRelativeOffset(); buf.limit((int) (bufStartOffset + sizeToRead)); buf.position((int) (bufStartOffset)); written = channel.write(buf); } logger.trace("Written bytes to the write channel from the file channel : {}", written, options.getFile()); return written; }
Source:
<code><START> private static IOSDriver<?> createAppiumIOSInstance(URL url, DesiredCapabilities capability) { <END> try { List<EventListener> listeners = DriverFactoryHelper.getSeLionEventListeners(); if (listeners.size() > 0) { return new SeLionAppiumIOSDriver( new EventFiringCommandExecutor(new HttpCommandExecutor(url), listeners), capability, url); } else { return new SeLionAppiumIOSDriver(url, capability); } } catch (Exception e) { throw new WebDriverException(e); } }</code><technical_language>wildcard return type for android here. Technically a practice more narrowly bound this type if can. For example AndroidDriver<? extends WebElement></technical_language>

Target:
private static IOSDriver<? extends WebElement> createAppiumIOSInstance(URL url, DesiredCapabilities capability) { try { List<EventListener> listeners = DriverFactoryHelper.getSeLionEventListeners(); if (listeners.size() > 0) { return new SeLionAppiumIOSDriver( new EventFiringCommandExecutor(new HttpCommandExecutor(url), listeners), capability, url); } else { return new SeLionAppiumIOSDriver(url, capability); } } catch (Exception e) { throw new WebDriverException(e); } }
Source:
<code>public void testStreamProcessor() { final String testSystem = "test-system"; final String inputTopic = "numbers"; final String outputTopic = "output"; final int messageCount = 20; final Config configs = new MapConfig(createConfigs("1", testSystem, inputTopic, outputTopic, messageCount)); createTopics(inputTopic, outputTopic); final StreamProcessor processor = new StreamProcessor( "1", new MapConfig(configs), new HashMap<>(), IdentityStreamTask::new, <START> new StreamProcessorLifeCycleAware() { <END> @Override public void onStart() { } @Override public void onShutdown() { } @Override public void onFailure(Throwable t) { } }); produceMessages(inputTopic, messageCount); run(processor, endLatch); verifyNumMessages(outputTopic, messageCount); }</code><technical_language>PR 117: Prefer mocks for instead of anonymous classes</technical_language>

Target:
public void testStreamProcessor() { final String testSystem = "test-system"; final String inputTopic = "numbers"; final String outputTopic = "output"; final int messageCount = 20; final Config configs = new MapConfig(createConfigs("1", testSystem, inputTopic, outputTopic, messageCount)); createTopics(inputTopic, outputTopic); final StreamProcessor processor = new StreamProcessor( "1", new MapConfig(configs), new HashMap<>(), IdentityStreamTask::new, new StreamProcessorLifecycleListener() { @Override public void onStart() { } @Override public void onShutdown() { } @Override public void onFailure(Throwable t) { } }); produceMessages(inputTopic, messageCount); run(processor, endLatch); verifyNumMessages(outputTopic, messageCount); }
Source:
<code>public String getString(String dataType, BigInteger address, MemoryByte[] data) { StringBuilder strBuffer = new StringBuilder(); int endianess = getEndianness(data); String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); if (endianess == RenderingsUtil.LITTLE_ENDIAN) { MemoryByte[] swapped = new MemoryByte[data.length]; for (int i = 0; i < data.length; i++){ swapped[data.length-i-1] = data[i]; } data = swapped; } for (MemoryByte <START> d : <END> data) { if (d.isReadable()) { strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(d.getValue()))); } else { strBuffer.append(paddedStr); } } return strBuffer.toString().toUpperCase(); }</code><technical_language>rename memByte</technical_language>

Target:
public String getString(String dataType, BigInteger address, MemoryByte[] data) { StringBuilder strBuffer = new StringBuilder(); int endianess = getEndianness(data); String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); if (endianess == RenderingsUtil.LITTLE_ENDIAN) { MemoryByte[] swapped = new MemoryByte[data.length]; for (int i = 0; i < data.length; i++){ swapped[data.length-i-1] = data[i]; } data = swapped; } for (MemoryByte memByte : data) { if (memByte.isReadable()) { strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(memByte.getValue()))); } else { strBuffer.append(paddedStr); } } return strBuffer.toString().toUpperCase(); }
Source:
<code>public BoltConnectionQueueMonitorAggregate( BoltConnectionQueueMonitor... monitors ) { <START> this.monitors = new ArrayList<>( Arrays.asList( monitors ) ); <END> }</code><technical_language>this this.monitors = Arrays.asList( monitors );</technical_language>

Target:
public BoltConnectionQueueMonitorAggregate( BoltConnectionQueueMonitor... monitors ) { this.monitors = Arrays.asList( monitors ); }
Source:
<code><START> public void testSamePortConfiguredForClientAndElection() throws IOException, ConfigException { <END> QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); try { Properties zkProp = getDefaultZKProperties(); zkProp.setProperty("server.1", "localhost:2888:2888"); quorumPeerConfig.parseProperties(zkProp); fail("ConfigException is expected"); } catch (ConfigException ce) { String expectedMessage = "Client and election port must be different! Please update the configuration file on server.1"; assertEquals(expectedMessage, ce.getMessage()); } }</code><technical_language>ConfigException is unused</technical_language>

Target:
public void testSamePortConfiguredForClientAndElection() throws IOException, ConfigException { QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); Properties zkProp = getDefaultZKProperties(); zkProp.setProperty("server.1", "localhost:2888:2888"); quorumPeerConfig.parseProperties(zkProp); }
Source:
<code>public static ClusterContext validateContext(JsonCluster definition, ClusterContext context, ClusterContext commonContext) throws KaramelException { if (context == null) { context = new ClusterContext(); } context.mergeContext(commonContext); for (JsonGroup group : definition.getGroups()) { Provider provider = UserClusterDataExtractor.getGroupProvider(definition, group.getName()); if (provider instanceof Ec2 && context.getEc2Context() == null) { throw new KaramelException("No valid Ec2 credentials registered :-|"); } if (provider instanceof Ec2 && context.getEc2Context() == null) { throw new KaramelException("No valid Ec2 credentials registered :-|"); } else if (provider instanceof Gce && context.getGceContext() == null) { throw new KaramelException("No valid Gce credentials registered :-|"); <START> } else if (provider instanceof Occi && context.getOcciContext() == null){ <END> throw new KaramelException("No valid Occi credentials registered :-|"); } } if (context.getSshKeyPair() == null) { throw new KaramelException("No ssh keypair chosen :-|"); } return context; }</code><technical_language>whitespace</technical_language>

Target:
public static ClusterContext validateContext(JsonCluster definition, ClusterContext context, ClusterContext commonContext) throws KaramelException { if (context == null) { context = new ClusterContext(); } context.mergeContext(commonContext); for (JsonGroup group : definition.getGroups()) { Provider provider = UserClusterDataExtractor.getGroupProvider(definition, group.getName()); if (provider instanceof Ec2 && context.getEc2Context() == null) { throw new KaramelException("No valid Ec2 credentials registered :-|"); } else if (provider instanceof Gce && context.getGceContext() == null) { throw new KaramelException("No valid Gce credentials registered :-|"); } else if (provider instanceof Nova && context.getNovaContext() == null) { throw new KaramelException("No valid Nova credentials registered :-|"); } else if (provider instanceof Occi && context.getOcciContext() == null) { throw new KaramelException("No valid Occi credentials registered :-|"); } } if (context.getSshKeyPair() == null) { throw new KaramelException("No ssh keypair chosen :-|"); } return context; }
Source:
<code>public void create(Event e){ <START> B86_ZK_4016FileDealer.writeMsg(this.getClass() + e.getName()); <END> }</code><technical_language>Clients.log</technical_language>

Target:
public void create(Event e){ Clients.log(this.getClass() + e.getName()); }
Source:
<code>private int onSpinMisses(int spins) { <START> if (UPDATE_STATISTICS) spinMisses.increment(); <END> if (spins == YIELD_SPINS) { spins = 0; Thread.yield(); } else { spins++; JDKSpecific.onSpinWait(); } return spins; }</code><technical_language>concerned this inlined</technical_language>

Target:
private int onSpinMisses(int spins) { if (UPDATE_STATISTICS) spinMisses.increment(); if (spins == YIELD_SPINS) { Thread.yield(); return 0; } JDKSpecific.onSpinWait(); return spins + 1; }
Source:
<code>private void processServerError(ServerErrorCode errorCode) { switch (errorCode) { case Blob_Authorization_Failure: logger.trace("Requested blob authorization failed"); setOperationException( new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobAuthorizationFailure)); break; case Blob_Deleted: logger.trace("Requested blob was deleted"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDeleted)); break; case Blob_Expired: logger.trace("Requested blob has expired"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobExpired)); break; case Blob_Not_Found: logger.trace("Requested blob was not found on this server"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDoesNotExist)); break; case Disk_Unavailable: <START> logger.trace("Requested blob is not accessible"); <END> setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.AmbryUnavailable)); default: setOperationException( new RouterException("Server returned: " + errorCode, RouterErrorCode.UnexpectedInternalError)); break; } }</code><technical_language>optional: log more accurate "The disk requested blob resides is accessible", I need add another case Replica_Unavailable PR #988 is merged</technical_language>

Target:
private void processServerError(ServerErrorCode errorCode) { switch (errorCode) { case Blob_Authorization_Failure: logger.trace("Requested blob authorization failed"); setOperationException( new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobAuthorizationFailure)); break; case Blob_Deleted: logger.trace("Requested blob was deleted"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDeleted)); break; case Blob_Expired: logger.trace("Requested blob has expired"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobExpired)); break; case Blob_Not_Found: logger.trace("Requested blob was not found on this server"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDoesNotExist)); break; case Disk_Unavailable: logger.trace("Disk on which the requested blob resides is not accessible"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.AmbryUnavailable)); default: setOperationException( new RouterException("Server returned: " + errorCode, RouterErrorCode.UnexpectedInternalError)); break; } }
Source:
<code><START> public void testEqualsCondition() { doTest(GoStringIndexIsByteQuickFix.NAME); } <END></code><technical_language>Please create methoddoTest() { doTest(GoStringIndexIsByteQuickFix.NAME); } method doTestNoFix()</technical_language>

Target:
public void testEqualsCondition() { doTest(); }
Source:
<code>private boolean verifyLocalAvailableSpace(Set<Entity> entities) { val spaceRequired = downloadService.getSpaceRequired(entities); val spaceAvailable = getLocalAvailableSpace(); log.debug("space required: ({}) space available: ({})", FileUtils.byteCountToDisplaySize(spaceRequired), spaceRequired, FileUtils.byteCountToDisplaySize(spaceAvailable), spaceAvailable); if (spaceRequired > spaceAvailable) { terminal.printf("Insufficient space to download requested files: %s. Need %s", <START> FileUtils.byteCountToDisplaySize(spaceRequired), <END> FileUtils.byteCountToDisplaySize(spaceAvailable)); terminal.println(""); terminal.println(""); return false; } return true; }</code><technical_language>Please org.icgc.dcc.storage.client.util.Formats instead</technical_language>

Target:
private boolean verifyLocalAvailableSpace(Set<Entity> entities) { val spaceRequired = downloadService.getSpaceRequired(entities); val spaceAvailable = getLocalAvailableSpace(); log.debug("space required: ({}) space available: ({})", FileUtils.byteCountToDisplaySize(spaceRequired), spaceRequired, FileUtils.byteCountToDisplaySize(spaceAvailable), spaceAvailable); if (spaceRequired > spaceAvailable) { terminal.printf("Insufficient space to download requested files: Require %s. %s Available", FileUtils.byteCountToDisplaySize(spaceRequired), FileUtils.byteCountToDisplaySize(spaceAvailable)); terminal.println(""); terminal.println(""); return false; } return true; }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); String finalLanguageList = StringUtil.listToJsonArrayString(app.language().getAppLanguageCodes()); <START> List<Boolean> finalFeedCardsEnabled = Prefs.getFeedCardsEnabled(); List<Integer> finalFeedCardsOrder = Prefs.getFeedCardsOrder(); <END> if (requestCode == ACTIVITY_REQUEST_ADD_A_LANGUAGE && (!finalLanguageList.equals(initialLanguageList))) { setResult(ACTIVITY_RESULT_LANGUAGE_CHANGED); } else if (requestCode == ACTIVITY_REQUEST_FEED_CONFIGURE && (!initialFeedCardsEnabled.equals(finalFeedCardsEnabled) || !initialFeedCardsOrder.equals(finalFeedCardsOrder))) { setResult(ACTIVITY_RESULT_FEED_CONFIGURATION_CHANGED); } }</code><technical_language>Prefs.getFeedCardsEnabled() Prefs.getFeedCardsOrder() in if statements instead of creating new variables</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); String finalLanguageList = StringUtil.listToJsonArrayString(app.language().getAppLanguageCodes()); if (requestCode == ACTIVITY_REQUEST_ADD_A_LANGUAGE && (!finalLanguageList.equals(initialLanguageList))) { setResult(ACTIVITY_RESULT_LANGUAGE_CHANGED); } else if (requestCode == ACTIVITY_REQUEST_FEED_CONFIGURE && (!Prefs.getFeedCardsEnabled().equals(initialFeedCardsEnabled) || !Prefs.getFeedCardsOrder().equals(initialFeedCardsOrder))) { setResult(ACTIVITY_RESULT_FEED_CONFIGURATION_CHANGED); } }
Source:
<code>public void setExecutorActive(final boolean isActive, final String host, final int port) throws ExecutorManagerException { final Executor executor = this.executorLoader.fetchExecutor(host, port); Preconditions.checkState(executor != null, "Unable to obtain self entry in DB"); if (executor.isActive() != isActive) { executor.setActive(isActive); this.executorLoader.updateExecutor(executor); } else { logger.info( "Set active action ignored. Executor is already " + (isActive ? "active" : "inactive")); } this.active = isActive; <START> if (!this.active) { <END> waitUntilFlowPreparationFinish(); } }</code><technical_language>active state is tracked Executor. Is for state stored in place, instead of Executor FlowRunnerManager? chance of states out of sync (if Executor is set FlowRunnerManager for example, FlowRunnerManager is set) if is state</technical_language>

Target:
public void setExecutorActive(final boolean isActive, final String host, final int port) throws ExecutorManagerException, InterruptedException { final Executor executor = this.executorLoader.fetchExecutor(host, port); Preconditions.checkState(executor != null, "Unable to obtain self entry in DB"); if (executor.isActive() != isActive) { executor.setActive(isActive); this.executorLoader.updateExecutor(executor); } else { logger.info( "Set active action ignored. Executor is already " + (isActive ? "active" : "inactive")); } this.active = isActive; if (!this.active) { waitUntilFlowPreparationFinish(); } }
Source:
<code>public Boolean call() throws Exception { long sleepBackoff = 200L; while (poolState == POOL_NORMAL && totalConnections.get() < config.getMaximumPoolSize()) { final PoolEntry poolEntry = createPoolEntry(); if (poolEntry != null) { totalConnections.incrementAndGet(); connectionBag.add(poolEntry); return Boolean.TRUE; } quietlySleep(sleepBackoff); <START> sleepBackoff = Math.min(connectionTimeout / 5, (long) (sleepBackoff * 1.3)); <END> } return Boolean.FALSE; }</code><technical_language>5? minimum connectionTimeout of 1000ms this generate a constant load of 5 connection attempts (200ms apart). / 2 a more reasonable retry value</technical_language>

Target:
public Boolean call() throws Exception { long sleepBackoff = 200L; while (poolState == POOL_NORMAL && totalConnections.get() < config.getMaximumPoolSize()) { final PoolEntry poolEntry = createPoolEntry(); if (poolEntry != null) { totalConnections.incrementAndGet(); connectionBag.add(poolEntry); return Boolean.TRUE; } quietlySleep(sleepBackoff); sleepBackoff = Math.min( TimeUnit.SECONDS.toMillis(10), Math.min(connectionTimeout, (long) (sleepBackoff * 1.3))); } return Boolean.FALSE; }