auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void registerMbean() { ObjectName objectName = null; MBeanServer mBeanServer = null; try { objectName = new ObjectName(Geocoding.class.getName() + ":service=geocoding"); mBeanServer = ManagementFactory.getPlatformMBeanServer(); } catch (MalformedObjectNameException e) { LOGGER.info("Unable to create Geocoding Configuration MBean.", e); } if (mBeanServer != null) { try { try { mBeanServer.registerMBean(this, objectName); LOGGER.debug( "Registered Geocoding Configuration MBean under object name: {}", objectName); } catch (InstanceAlreadyExistsException e) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); LOGGER.debug("Re-registered Geocoding Configuration MBean"); } } catch (Exception e) { <START> LOGGER.info("Could not register MBean [{}].", objectName.toString(), e); <END> } } }</code><technical_language>remove .toString()</technical_language>

Target:
private void registerMbean() { try { ObjectName objectName = new ObjectName(Geocoding.class.getName() + ":service=geocoding"); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); tryRegisterMBean(mBeanServer, objectName); } catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | InstanceNotFoundException | NotCompliantMBeanException e) { LOGGER.info("Unable to create Geocoding Configuration MBean.", e); } }
Source:
<code>public void sendEmail(String senderName, InternetAddress receiverAddress, String subjectTemplateName, String bodyTemplateName, Map<String, Object> templateParameters) { MimeMessagePreparator preparator = new MimeMessagePreparator() { <START> public void prepare(MimeMessage mimeMessage) throws Exception <END> { String subjectText = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "email/" + subjectTemplateName + ".vm", "UTF-8", templateParameters); String bodyText = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "email/" + bodyTemplateName + ".vm", "UTF-8", templateParameters); MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setFrom(new InternetAddress(senderAddress, senderName)); message.setTo(receiverAddress); message.setSubject(subjectText); message.setText(bodyText, true); } }; this.mailSender.send(preparator); }</code><technical_language>Remove throws put try/catch of BuddyService inside</technical_language>

Target:
public void sendEmail(String senderName, InternetAddress receiverAddress, String subjectTemplateName, String bodyTemplateName, Map<String, Object> templateParameters) { LOGGER.info(MessageFormat.format("Sending e-mail to '{0}'. subjectTemplateName: {0}\r\n", receiverAddress, subjectTemplateName)); if (!yonaProperties.getEmail().isEnabled()) { LOGGER.info("E-mail sending is disabled. No message has been sent."); return; } MimeMessagePreparator preparator = new MimeMessagePreparator() { public void prepare(MimeMessage mimeMessage) throws Exception { String subjectText = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "email/" + subjectTemplateName + ".vm", "UTF-8", templateParameters); String bodyText = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "email/" + bodyTemplateName + ".vm", "UTF-8", templateParameters); MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setFrom(new InternetAddress(yonaProperties.getEmail().getSenderAddress(), senderName)); message.setTo(receiverAddress); message.setSubject(subjectText); message.setText(bodyText, true); } }; mailSender.send(preparator); LOGGER.info("E-mail sent succesfully."); }
Source:
<code>private static void storeGroups(String groupFilePath, Multimap<String, String> groups) throws ManageUsersException { try { try (PrintWriter writer = new PrintWriter(new FileWriter(groupFilePath))) { <START> for (String username : groups.keySet()) { <END> for (String group : groups.get(username)) { writer.println(username + ":" + group); } } } } catch (IOException e) { exitWithErrorMessage("could not write group file : " + groupFilePath, null, e); } }</code><technical_language>loop time full entryset</technical_language>

Target:
private static void storeGroups(String groupFilePath, Multimap<String, String> groups) throws ManageUsersException { try { try (PrintWriter writer = new PrintWriter(new FileWriter(groupFilePath))) { for (Map.Entry<String, String> userEntry : groups.entries()) { writer.println(userEntry.getKey() + ":" + userEntry.getValue()); } } } catch (IOException e) { exitWithErrorMessage("could not write group file : " + groupFilePath, null, e); } }
Source:
<code>public EvaJobParameterBuilder inputStudyId(String inputStudyId) { <START> super.addParameter(JobParametersNames.INPUT_STUDY_ID, new JobParameter(inputStudyId)); <END> return this; }</code><technical_language>why</technical_language>

Target:
public EvaJobParameterBuilder inputStudyId(String inputStudyId) { addParameter(JobParametersNames.INPUT_STUDY_ID, new JobParameter(inputStudyId)); return this; }
Source:
<code>public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { try { enterFunction.run(); return AtlasFutures.getUnchecked(delegate().getAsync(tableRef, cells)); } finally { <START> exitFunction.run(); <END> } }</code><technical_language>This is possibly correct, is a bit of a non-standard pattern: if enterFunction.run() throws, do want exitFunction run? This depends semantics want. tests matter much. If adopt Felix's suggestion (which I agree with), this is a non-issue</technical_language>

Target:
public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { try (PathTypeTracker resource = tracker.enterAsyncPath()) { return AtlasFutures.getUnchecked(delegate().getAsync(tableRef, cells)); } }
Source:
<code><START> static InetAddress[] restoreAddresses(final String address) throws DecoderException, UnknownHostException { <END> final byte[] data = Hex.decodeHex(address.toCharArray()); if (data.length == 16) { for (int i = 0; i < 4; ++i) { ArrayUtils.reverse(data, i * 4, i * 4 + 4); } final InetAddress result = InetAddress.getByAddress(data); if (result instanceof Inet6Address) { if (InetAddresses.hasEmbeddedIPv4ClientAddress((Inet6Address) result)) { return new InetAddress[]{result, InetAddresses.getEmbeddedIPv4ClientAddress((Inet6Address) result)}; } } return new InetAddress[]{result}; } else { return new InetAddress[]{InetAddress.getByAddress(data)}; } }</code><technical_language>package scope</technical_language>

Target:
private static InetAddress[] restoreAddresses(final String address) throws DecoderException, UnknownHostException { final byte[] data = Hex.decodeHex(address.toCharArray()); if (data.length == 16) { for (int i = 0; i < 4; ++i) { ArrayUtils.reverse(data, i * 4, i * 4 + 4); } final InetAddress result = InetAddress.getByAddress(data); if (result instanceof Inet6Address) { if (InetAddresses.hasEmbeddedIPv4ClientAddress((Inet6Address) result)) { return new InetAddress[]{result, InetAddresses.getEmbeddedIPv4ClientAddress((Inet6Address) result)}; } } return new InetAddress[]{result}; } else { ArrayUtils.reverse(data); return new InetAddress[]{InetAddress.getByAddress(data)}; } }
Source:
<code>private CompletionStage<RestResponse> getSchemasNames(RestRequest request) { AdvancedCache<Object, Object> cache = invocationHelper.getRestCacheManager() .getCache(ProtobufMetadataManager.PROTOBUF_METADATA_CACHE_NAME, request); List<ProtoSchema> protoSchemas = cache.entrySet().stream() .filter(cacheEntry -> !((String)cacheEntry.getKey()).endsWith(ProtobufMetadataManager.ERRORS_KEY_SUFFIX)) .map(cacheEntry -> { String error = (String) cache .get(cacheEntry.getKey() + ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX); ProtoSchema protoSchema = new ProtoSchema(); protoSchema.name = cacheEntry.getKey().toString(); protoSchema.validation = error == null ? "success" : error; return protoSchema; <START> }) <END> .collect(Collectors.toList()); NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); try { responseBuilder .status(OK) .contentType(APPLICATION_JSON) .entity(invocationHelper.getMapper().writeValueAsBytes(protoSchemas)); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return CompletableFuture.completedFuture(responseBuilder.build()); }</code><technical_language>This lookup done in constructor, depend request: returning in format</technical_language>

Target:
private CompletionStage<RestResponse> getSchemasNames(RestRequest request) { NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); AdvancedCache<Object, Object> cache = invocationHelper.getRestCacheManager() .getCache(ProtobufMetadataManager.PROTOBUF_METADATA_CACHE_NAME, request); return CompletableFuture.supplyAsync(() -> Flowable.fromIterable(cache.keySet()) .filter(key -> !((String)key).endsWith(ProtobufMetadataManager.ERRORS_KEY_SUFFIX)) .map(key -> { String error = (String) cache .get(key + ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX); ProtoSchema protoSchema = new ProtoSchema(); protoSchema.name = (String) key; if (error != null) { protoSchema.error = createErrorContent(protoSchema.name, error); } return protoSchema; }) .sorted(Comparator.comparing(s -> s.name)) .collect(Collectors.toList()) .map(protoSchemas -> { try { byte[] bytes = objectMapper.writeValueAsBytes(protoSchemas); responseBuilder.contentType(APPLICATION_JSON).entity(bytes); } catch (JsonProcessingException e) { throw new RestResponseException(e); } return (RestResponse) responseBuilder.build(); }) .toCompletionStage() , invocationHelper.getExecutor()) .thenCompose(Function.identity()); }
Source:
<code>public LogFilePath(String prefix, String path) { assert path.startsWith(prefix): path + ".startsWith(" + prefix + ")"; mPrefix = prefix; int prefixLength = prefix.length(); if (!prefix.endsWith("/")) { prefixLength++; } String suffix = path.substring(prefixLength); String[] pathElements = suffix.split("/"); assert pathElements.length >= 3: Arrays.toString(pathElements) + ".length >= 3"; mTopic = pathElements[0]; mPartitions = subArray(pathElements, 1, pathElements.length - 2); String basename = pathElements[pathElements.length - 1]; <START> int lastIndexOf = basename.indexOf('.'); <END> if (lastIndexOf >= 0) { mExtension = basename.substring(lastIndexOf, basename.length()); basename = basename.substring(0, lastIndexOf); } else { mExtension = ""; } String[] basenameElements = basename.split("_"); assert basenameElements.length == 3: Integer.toString(basenameElements.length) + " == 3"; mGeneration = Integer.parseInt(basenameElements[0]); mKafkaPartitions = new int[]{Integer.parseInt(basenameElements[1])}; mOffsets = new long[]{Long.parseLong(basenameElements[2])}; }</code><technical_language>if file name is a.b.c while a.b is basename c is extension name</technical_language>

Target:
public LogFilePath(String prefix, String path) { assert path.startsWith(prefix): path + ".startsWith(" + prefix + ")"; mPrefix = prefix; int prefixLength = prefix.length(); if (!prefix.endsWith("/")) { prefixLength++; } String suffix = path.substring(prefixLength); String[] pathElements = suffix.split("/"); assert pathElements.length >= 3: Arrays.toString(pathElements) + ".length >= 3"; mTopic = pathElements[0]; mPartitions = subArray(pathElements, 1, pathElements.length - 2); String basename = pathElements[pathElements.length - 1]; int indexOfSeparator = basename.indexOf('.'); if (indexOfSeparator >= 0) { mExtension = basename.substring(indexOfSeparator); basename = basename.substring(0, indexOfSeparator); } else { mExtension = ""; } String[] basenameElements = basename.split("_"); assert basenameElements.length == 3: basenameElements.length + " == 3"; mGeneration = Integer.parseInt(basenameElements[0]); mKafkaPartitions = new int[]{Integer.parseInt(basenameElements[1])}; mOffsets = new long[]{Long.parseLong(basenameElements[2])}; }
Source:
<code>public Object consumePart(int byteCount) { ChannelOutboundBuffer buf = unsafe().outboundBuffer(); if (buf != null) { Object msg = buf.current(); if (msg instanceof ByteBuf) { ByteBuf byteBuf = (ByteBuf) msg; if (byteBuf.readableBytes() > byteCount) { buf.removeBytes(byteCount); return null; <START> } else { <END> ReferenceCountUtil.retain(msg); buf.removeBytes(byteCount); return msg; } } else { return null; } } return null; }</code><technical_language>remove else return in if block</technical_language>

Target:
private Object consumePart(int byteCount) { ChannelOutboundBuffer buf = unsafe().outboundBuffer(); if (buf != null) { Object msg = buf.current(); if (msg != null) { ReferenceCountUtil.retain(msg); buf.removeBytes(byteCount); return msg; } } return null; }
Source:
<code><START> public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { <END> this.context = (ConfigurableApplicationContext) applicationContext; }</code><technical_language>minor thing, this need throws clause</technical_language>

Target:
public void setApplicationContext(ApplicationContext applicationContext) { this.context = (ConfigurableApplicationContext) applicationContext; }
Source:
<code>public JSONObject jsonObject() { ContentType type = from(); JSONObject jsonObject; try { jsonObject = new JSONObject(mapper.writeValueAsString(type)); jsonObject.remove("permissionType"); jsonObject.remove("permissionId"); jsonObject.remove("versionable"); jsonObject.remove("multilingualable"); jsonObject.put("fields", new JsonFieldTransformer(type.fields()).jsonArray()); jsonObject.put(LAYOUT_PROPERTY_NAME, this.getLayoutAsJsonArray(type)); return jsonObject; <START> } catch (JSONException | JsonProcessingException e) { <END> throw new DotStateException(e); } }</code><technical_language>Log error useful information here</technical_language>

Target:
public JSONObject jsonObject() { ContentType type = from(); JSONObject jsonObject; try { jsonObject = new JSONObject(mapper.writeValueAsString(type)); jsonObject.remove("permissionType"); jsonObject.remove("permissionId"); jsonObject.remove("versionable"); jsonObject.remove("multilingualable"); jsonObject.put("fields", new JsonFieldTransformer(type.fields()).jsonArray()); jsonObject.put(LAYOUT_PROPERTY_NAME, this.getLayoutAsJsonArray(type)); return jsonObject; } catch (JSONException | JsonProcessingException e) { Logger.error(JsonContentTypeTransformer.class, String.format("Error with the content type %s: %s", type.name(), e.getMessage())); throw new DotStateException(e); } }
Source:
<code>public void clear() { long count = 0; boolean destroyDatabase = false; try { semaphore.acquire(); } catch (InterruptedException e) { throw new PersistenceException("Cannot acquire semaphore", e); } try { if (stopped) { throw new PersistenceException("RocksDB is stopped"); } Optional<RocksIterator> optionalIterator = getDBIterator(this.db); if (optionalIterator.isPresent() && configuration.clearThreshold() <= 0) { RocksIterator it = optionalIterator.get(); <START> try { <END> for(it.seekToFirst(); it.isValid(); it.next()) { db.remove(it.key()); count++; if (count > configuration.clearThreshold()) { destroyDatabase = true; break; } } } catch (RocksDBException e) { destroyDatabase = true; } finally { it.close(); } } else { destroyDatabase = true; } } finally { semaphore.release(); } if (destroyDatabase) { try { reinitAllDatabases(); } catch (Exception e) { throw new PersistenceException(e); } } }</code><technical_language>a try-with-resources statement</technical_language>

Target:
public void clear() { long count = 0; boolean destroyDatabase = false; try { semaphore.acquire(); } catch (InterruptedException e) { throw new PersistenceException("Cannot acquire semaphore", e); } try { if (stopped) { throw new PersistenceException("RocksDB is stopped"); } Optional<RocksIterator> optionalIterator = wrapIterator(this.db); if (optionalIterator.isPresent() && configuration.clearThreshold() <= 0) { try (RocksIterator it = optionalIterator.get()) { for(it.seekToFirst(); it.isValid(); it.next()) { db.remove(it.key()); count++; if (count > configuration.clearThreshold()) { destroyDatabase = true; break; } } } catch (RocksDBException e) { destroyDatabase = true; } } else { destroyDatabase = true; } } finally { semaphore.release(); } if (destroyDatabase) { try { reinitAllDatabases(); } catch (Exception e) { throw new PersistenceException(e); } } }
Source:
<code>public void testPublicAccess() throws InterruptedException, MalformedURLException, IOException { final String containerName = getScratchContainerName(); try { view.getBlobStore().createContainerInLocation(null, containerName, publicRead()); assertConsistencyAwareContainerExists(containerName); defaultLocation = Iterables.find(view.getBlobStore().list(), new Predicate<StorageMetadata>() { @Override public boolean apply(@Nullable StorageMetadata input) { return input.getName().equals(containerName); } }).getLocation(); view.getBlobStore().putBlob(containerName, view.getBlobStore().blobBuilder("hello").payload(TEST_STRING).build()); assertConsistencyAwareContainerSize(containerName, 1); BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello"); assert metadata.getPublicUri() != null : metadata; SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); Predicate<HostAndPort> socketTester = retry(socketOpen, 1200, 10, SECONDS); <START> assert socketTester.apply(HostAndPort.fromHost(metadata.getPublicUri().getHost()).withDefaultPort(80)) : metadata.getPublicUri(); <END> assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING); } finally { recycleContainerAndAddToPool(containerName); } }</code><technical_language>assertTrue? I asserts in codebase, in general I TestNG assertions in tests now. Thanks</technical_language>

Target:
public void testPublicAccess() throws InterruptedException, MalformedURLException, IOException { final String containerName = getScratchContainerName(); try { view.getBlobStore().createContainerInLocation(null, containerName, publicRead()); assertConsistencyAwareContainerExists(containerName); defaultLocation = Iterables.find(view.getBlobStore().list(), new Predicate<StorageMetadata>() { @Override public boolean apply(@Nullable StorageMetadata input) { return input.getName().equals(containerName); } }).getLocation(); view.getBlobStore().putBlob(containerName, view.getBlobStore().blobBuilder("hello").payload(TEST_STRING).build()); assertConsistencyAwareContainerSize(containerName, 1); BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello"); assertTrue(metadata.getPublicUri() != null, metadata.toString()); SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class); Predicate<HostAndPort> socketTester = retry(socketOpen, 1200, 10, SECONDS); assertTrue(socketTester.apply(HostAndPort.fromHost(metadata.getPublicUri().getHost()).withDefaultPort(80)), metadata.getPublicUri().toString()); assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING); } finally { recycleContainerAndAddToPool(containerName); } }
Source:
<code>public synchronized void cancelPendingRequests(String registrationId) { ArrayList<Request> requests = pendingRequests.get(registrationId); if (requests != null) { for (Request coapRequest : requests) { coapRequest.cancel(); <START> removePendingRequest(registrationId, coapRequest); <END> } } }</code><technical_language>check, if OK remove a collection while "iterating" it</technical_language>

Target:
public void cancelPendingRequests(String registrationId) { SortedMap<String, Request> requests = pendingRequests.subMap(getFloorKey(registrationId), getCeilingKey(registrationId)); for (Request coapRequest : requests.values()) { coapRequest.cancel(); } requests.clear(); }
Source:
<code>public void setUp() { <START> executor = newScheduledThreadPool(10, daemonThreadsNamed("test-merge-operator-%s")); <END> serdeFactory = new TestingPagesSerdeFactory(); taskBuffers = CacheBuilder.newBuilder().build(CacheLoader.from(TestingTaskBuffer::new)); httpClient = new TestingHttpClient(new TestingExchangeHttpClientHandler(taskBuffers), executor); exchangeClientFactory = new ExchangeClientFactory(new ExchangeClientConfig(), httpClient, executor); }</code><technical_language>nit: do need 10 threads in pool (given memory issues in travis)</technical_language>

Target:
public void setUp() { executor = newSingleThreadScheduledExecutor(daemonThreadsNamed("test-merge-operator-%s")); serdeFactory = new TestingPagesSerdeFactory(); taskBuffers = CacheBuilder.newBuilder().build(CacheLoader.from(TestingTaskBuffer::new)); httpClient = new TestingHttpClient(new TestingExchangeHttpClientHandler(taskBuffers), executor); exchangeClientFactory = new ExchangeClientFactory(new ExchangeClientConfig(), httpClient, executor); orderingCompiler = new OrderingCompiler(); }
Source:
<code>public ProgrammaticTomcat() { <START> this.randomPort = new Random() <END> .ints(6000, 9000) .findFirst() .orElse(8080); }</code><technical_language>guarantees chosen port free. sense validate that. trick a ServerSocket for that: public static boolean isFree(int port) { try { new ServerSocket(port).close(); return true; } catch (IOException e) { return false; } } then: ... .ints(6000, 9000) .filter(port -> isFree(port)) .findFirst() .orElse(8080);</technical_language>

Target:
public ProgrammaticTomcat() { this.randomPort = new Random() .ints(6000, 9000) .filter(ProgrammaticTomcat::isFree) .findFirst() .orElse(8080); }
Source:
<code>public void validate_shouldFailValidationIfDateActivatedAfterDateStopped() throws Exception { RadiologyOrder radiologyOrder = new RadiologyOrder(); radiologyOrder.setConcept(Context.getConceptService() .getConcept(88)); radiologyOrder.setPatient(Context.getPatientService() .getPatient(2)); <START> radiologyOrder.setOrderer(Context.getProviderService() <END> .getProvider(1)); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); radiologyOrder.setDateActivated(new Date()); OrderUtilTest.setDateStopped(radiologyOrder, cal.getTime()); Errors errors = new BindException(radiologyOrder, "radiologyOrder"); new RadiologyOrderValidator().validate(radiologyOrder, errors); assertTrue(errors.hasFieldErrors("dateActivated")); assertTrue(errors.hasFieldErrors("dateStopped")); }</code><technical_language>context, this hits db. need create simple POJOs</technical_language>

Target:
public void validate_shouldFailValidationIfDateActivatedAfterDateStopped() throws Exception { RadiologyOrder radiologyOrder = getValidRadiologyOrder(); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); radiologyOrder.setDateActivated(new Date()); OrderUtilTest.setDateStopped(radiologyOrder, cal.getTime()); Errors errors = new BindException(radiologyOrder, "radiologyOrder"); new RadiologyOrderValidator().validate(radiologyOrder, errors); assertTrue(errors.hasFieldErrors("dateActivated")); assertTrue(errors.hasFieldErrors("dateStopped")); }
Source:
<code><START> private boolean isGlobalFailure(ITestResult result) { <END> ITestNGMethod m = result.getMethod(); return m.isBeforeTestConfiguration() || m.isBeforeSuiteConfiguration(); }</code><technical_language>static</technical_language>

Target:
private static boolean isGlobalFailure(ITestResult result) { ITestNGMethod m = result.getMethod(); return m.isBeforeTestConfiguration() || m.isBeforeSuiteConfiguration(); }
Source:
<code>public ArrayList<String> toggleLabel(String name) { removePossibleLabel(); ArrayList<String> removedLabels = processAndUpdateTopLabels(name); <START> restoreBottomLabels(); END> populatePanes(); return removedLabels; }</code><technical_language>if rename top bottom more meaningful names based represent located</technical_language>

Target:
public ArrayList<String> toggleLabel(String name) { removePossibleLabel(); ArrayList<String> removedLabels = resolveConflictsAndUpdateLabels(name); resetMatchingLabels(); populatePanes(); return removedLabels; }
Source:
<code>private InboundTransferTask addTransfer(Address source, Set<Integer> segmentsFromSource) { synchronized (transferMapsLock) { log.tracef("Adding transfer from %s for segments %s", source, segmentsFromSource); segmentsFromSource.removeAll(transfersBySegment.keySet()); if (segmentsFromSource.isEmpty()) { <START> log.tracef("All segments are already in progress, skipping"); <END> return null; } else { final InboundTransferTask inboundTransfer = new InboundTransferTask(segmentsFromSource, source, cacheTopology.getTopologyId(), this, rpcManager, commandsFactory, timeout, cacheName); for (int segmentId : segmentsFromSource) { transfersBySegment.put(segmentId, inboundTransfer); } List<InboundTransferTask> inboundTransfers = transfersBySource.get(inboundTransfer.getSource()); if (inboundTransfers == null) { inboundTransfers = new ArrayList<InboundTransferTask>(); transfersBySource.put(inboundTransfer.getSource(), inboundTransfers); } inboundTransfers.add(inboundTransfer); stateRequestCompletionService.submit(new Callable<Void>() { @Override public Void call() throws Exception { inboundTransfer.requestSegments(); log.debugf("Waiting for inbound transfer to finish: %s", inboundTransfer); stateRequestCompletionService.continueTaskInBackground(); return null; } }); return inboundTransfer; } } }</code><technical_language>if (trace)</technical_language>

Target:
private InboundTransferTask addTransfer(Address source, Set<Integer> segmentsFromSource) { synchronized (transferMapsLock) { if (trace) log.tracef("Adding transfer from %s for segments %s", source, segmentsFromSource); segmentsFromSource.removeAll(transfersBySegment.keySet()); if (segmentsFromSource.isEmpty()) { if (trace) log.tracef("All segments are already in progress, skipping"); return null; } else { final InboundTransferTask inboundTransfer = new InboundTransferTask(segmentsFromSource, source, cacheTopology.getTopologyId(), this, rpcManager, commandsFactory, timeout, cacheName); for (int segmentId : segmentsFromSource) { transfersBySegment.put(segmentId, inboundTransfer); } List<InboundTransferTask> inboundTransfers = transfersBySource.get(inboundTransfer.getSource()); if (inboundTransfers == null) { inboundTransfers = new ArrayList<InboundTransferTask>(); transfersBySource.put(inboundTransfer.getSource(), inboundTransfers); } inboundTransfers.add(inboundTransfer); stateRequestCompletionService.submit(new Callable<Void>() { @Override public Void call() throws Exception { inboundTransfer.requestSegments(); if (trace) log.tracef("Waiting for inbound transfer to finish: %s", inboundTransfer); stateRequestCompletionService.continueTaskInBackground(); return null; } }); return inboundTransfer; } } }
Source:
<code>private String getShareSubject() { if (getArguments().getBoolean(ARG_FEED_FEATURED_IMAGE)) { return ShareUtil.getFeaturedImageShareSubject(getContext(), new UtcDate(age).baseCalendar()); } <START> else <END> if (pageTitle != null) { return pageTitle.getDisplayText(); } return null; }</code><technical_language>Unnecessary else :]</technical_language>

Target:
private String getShareSubject() { return getArguments().getBoolean(ARG_FEED_FEATURED_IMAGE) ? ShareUtil.getFeaturedImageShareSubject(getContext(), age) : null; }
Source:
<code>private static void writeSequenceToArchive(Resource mediationResource, String individualSequenceExportPath, Registry registry, String mediationName, APIIdentifier apiIdentifier) throws RegistryException, APIManagementException { if (mediationResource != null) { String resourcePath = mediationResource.getPath(); if (registry.resourceExists(resourcePath)) { Resource mediationFile = registry.get(resourcePath); try (OutputStream outputStream = new FileOutputStream( individualSequenceExportPath + File.separator + mediationName + APIConstants.DOT + APIConstants.XML_DOC_EXTENSION); InputStream fileInputStream = mediationFile.getContentStream()) { IOUtils.copy(fileInputStream, outputStream); } catch (IOException e) { <START> throw new APIManagementException("Error while writing the mediation sequence"+ mediationName+ "to file"); <END> } } else { log.error("Sequence resource for API/API Product: " + apiIdentifier.getName() + " not found in " + resourcePath); } } }</code><technical_language>IOException Swallowed</technical_language>

Target:
private static void writeSequenceToArchive(Resource mediationResource, String individualSequenceExportPath, Registry registry, String mediationName, APIIdentifier apiIdentifier) throws RegistryException, APIManagementException { if (mediationResource != null) { String resourcePath = mediationResource.getPath(); if (registry.resourceExists(resourcePath)) { Resource mediationFile = registry.get(resourcePath); try (OutputStream outputStream = new FileOutputStream( individualSequenceExportPath + File.separator + mediationName + APIConstants.DOT + APIConstants.XML_DOC_EXTENSION); InputStream fileInputStream = mediationFile.getContentStream()) { IOUtils.copy(fileInputStream, outputStream); } catch (IOException e) { throw new APIManagementException("Error while writing the mediation sequence"+ mediationName+ "to file", e); } } else { throw new APIManagementException( "Resource specified by " + resourcePath + " cannot be found in the registry", ExceptionCodes.RESOURCE_NOT_FOUND); } } }
Source:
<code>public void testForExisting() { String url = "/v2/identifiers/rs199692280?species=mmusculus&assembly=grcm38"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<Variant> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantList']", new TypeRef<List<Variant>>() { <START> }); <END> assertTrue(variantList.size() > 0); Variant variant = variantList.get(0); assertEquals("20", variant.getChromosome()); assertEquals("T", variant.getAlternate()); assertEquals("A", variant.getReference()); assertEquals(60100L, variant.getStart()); assertEquals(60100L, variant.getEnd()); }</code><technical_language>is easy check sources annotation links there? starting .read("$['_embedded']['variantList']['_links']"</technical_language>

Target:
public void testForExisting() { String url = "/v2/identifiers/rs199692280/variants?species=mmusculus&assembly=grcm38"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<Variant> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantList']", new TypeRef<List<Variant>>() { }); assertFalse(JsonPath.using(configuration).parse(response.getBody()).read ("$['_embedded']['variantList'][0]['_links']['sources']['href']", new TypeRef<String>() { }).isEmpty()); assertFalse(JsonPath.using(configuration).parse(response.getBody()).read ("$['_embedded']['variantList'][0]['_links']['annotation']['href']", new TypeRef<String>() { }).isEmpty()); assertTrue(variantList.size() > 0); Variant variant = variantList.get(0); assertEquals("20", variant.getChromosome()); assertEquals("T", variant.getAlternate()); assertEquals("A", variant.getReference()); assertEquals(60100L, variant.getStart()); assertEquals(60100L, variant.getEnd()); }
Source:
<code>public NetworkVmListModel() { setTitle(ConstantsManager.getInstance().getConstants().virtualMachinesTitle()); setHelpTag(HelpTag.virtual_machines); setHashName("virtual_machines"); <START> setIsAvailable(ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)); <END> setComparator(new Comparator<PairQueryable<VmNetworkInterface, VM>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VM> paramT1, PairQueryable<VmNetworkInterface, VM> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }</code><technical_language>setAvailableInModes(ApplicationMode.VirtOnly)</technical_language>

Target:
public NetworkVmListModel() { setTitle(ConstantsManager.getInstance().getConstants().virtualMachinesTitle()); setHelpTag(HelpTag.virtual_machines); setHashName("virtual_machines"); setAvailableInModes(ApplicationMode.VirtOnly); setComparator(new Comparator<PairQueryable<VmNetworkInterface, VM>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VM> paramT1, PairQueryable<VmNetworkInterface, VM> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }
Source:
<code>public TestGerritClient(TaskRepository repository, AbstractWebLocation location) { super(repository, GerritFixture.current().getGerritVersion()); <START> System.out.println("Testing against Gerrit " + GerritFixture.current().getGerritVersion()); <END> initialize(location, null, null, null, null); }</code><technical_language>replace this file "previous version" commit - remove this review</technical_language>

Target:
public TestGerritClient(TaskRepository repository, AbstractWebLocation location) { super(repository, GerritFixture.current().getGerritVersion()); initialize(location, null, null, null, null); }
Source:
<code>public static Protocol fromValue(String value) { try { return valueOf(value); } catch (IllegalArgumentException e) { return UNRECOGNIZED; <START> } <END> }</code><technical_language>Enums.getIfPresent in previous enum change one, code consistent pattern addressing thing</technical_language>

Target:
public static Protocol fromValue(String value) { return Enums .getIfPresent(FirewallRule.Protocol.class, value) .or(UNRECOGNIZED); }
Source:
<code>public NBTTagCompound serializeNBT() { NBTTagList nbtTagList = new NBTTagList(); for (int i = 0; i < stacks.length; i++) { if (stacks[i] != null) { NBTTagCompound itemTag = new NBTTagCompound(); if (size < 256) itemTag.setByte("Slot", (byte) i); else itemTag.setInteger("Slot", i); <START> stacks[i].writeToNBT(itemTag); <END> nbtTagList.appendTag(itemTag); } } NBTTagCompound nbt = new NBTTagCompound(); nbt.setTag("Items", nbtTagList); nbt.setInteger("Size", size); return nbt; }</code><technical_language>Personally.. I ints... real reason to</technical_language>

Target:
public NBTTagCompound serializeNBT() { NBTTagList nbtTagList = new NBTTagList(); for (int i = 0; i < stacks.length; i++) { if (stacks[i] != null) { NBTTagCompound itemTag = new NBTTagCompound(); itemTag.setInteger("Slot", i); stacks[i].writeToNBT(itemTag); nbtTagList.appendTag(itemTag); } } NBTTagCompound nbt = new NBTTagCompound(); nbt.setTag("Items", nbtTagList); nbt.setInteger("Size", stacks.length); return nbt; }
Source:
<code>public BinaryValue getQueryInfo() { <START> StringBuilder sb = new StringBuilder("SELECT * FROM "); <END> sb.append(this.builder.tableName); sb.append(" WHERE PRIMARY KEY = { "); int numKeys = this.builder.keyValues.size(); for (int i = 0; i < numKeys; i++) { if (this.builder.keyValues.get(i) == null) { sb.append("NULL"); } else { sb.append(this.builder.keyValues.get(i).toString()); } if (i < numKeys-1) { sb.append(", "); } } sb.append(" }"); return BinaryValue.create(sb.toString()); }</code><technical_language>a time memory consuming operation. cache result re-used in case of re-calling</technical_language>

Target:
public BinaryValue getQueryInfo() { if (this.queryInfoMessage == null) { this.queryInfoMessage = createQueryInfoMessage(); } return this.queryInfoMessage; }
Source:
<code>private IStatus getFormPresenterStatus() { IStatus saveStatus = Status.OK_STATUS; if (formPresenterSupport != null && formPresenterSupport.getCurrentStatus() != null) { saveStatus = formPresenterSupport.getCurrentStatus(); } <START> return saveStatus; <END> }</code><technical_language>i formPresenterSupport null. If i miss something, null checks added dispose method</technical_language>

Target:
private IStatus getFormPresenterStatus() { IStatus status = Status.OK_STATUS; if (formPresenterSupport.getCurrentStatus() != null) { status = formPresenterSupport.getCurrentStatus(); } return status; }
Source:
<code>public String getProperty(String key) { if (properties != null && !properties.isEmpty()) { if (properties.containsKey(key)) { return properties.get(key); } else { String key_prefixed = TargetConstants.PREFIX_CUSTOM_PROPERTY + key; if (properties.containsKey(key_prefixed)) { return properties.get(key_prefixed); } } } <START> return ""; <END> }</code><technical_language>return empty string instead of null</technical_language>

Target:
public String getProperty(String key) { if (properties != null && !properties.isEmpty()) { if (properties.containsKey(key)) { return properties.get(key); } else { String key_prefixed = TargetConstants.PREFIX_CUSTOM_PROPERTY + key; if (properties.containsKey(key_prefixed)) { return properties.get(key_prefixed); } } } return null; }
Source:
<code>public void parseAsList() { assertEquals(Lists.newArrayList("a"), ConfigurationUtils.parseAsList("a", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList("a,b,c", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList(" a , b , c ", ",")); assertEquals(Lists.newArrayList("a,b,c"), ConfigurationUtils.parseAsList("a,b,c", ";")); <START> } <END></code><technical_language>add a case for a,,b empty strings omitted</technical_language>

Target:
public void parseAsList() { assertEquals(Lists.newArrayList("a"), ConfigurationUtils.parseAsList("a", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList("a,b,c", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList(" a , b , c ", ",")); assertEquals(Lists.newArrayList("a,b,c"), ConfigurationUtils.parseAsList("a,b,c", ";")); assertEquals(Lists.newArrayList("a", "c"), ConfigurationUtils.parseAsList(",,a,,c,,", ",")); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { try { IStructuredSelection selection = (IStructuredSelection)HandlerUtil .getCurrentSelectionChecked(event); IProject project = (IProject)selection.getFirstElement(); IPreferenceStore store = PreferenceStoreManager.getPreferenceStore(project); QuestionDialog dialog = new QuestionDialog( Display.getCurrent().getActiveShell(), Messages.getString("AddC2UMLSyncNature.dialogTitle"), Messages.getString("AddC2UMLSyncNature.dialogBody"), store); int result = dialog.open(); if (result > -1) { <START> SynchronizersManager.getSynchronizer().setInitialValues(project); <END> if (result == 0) { syncFromSources(project); } else if (result == 1) { syncFromModel(project); } } } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } return null; }</code><technical_language>return null if IModelSynchronizer is registered, a NPE is raised</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { try { IStructuredSelection selection = (IStructuredSelection)HandlerUtil .getCurrentSelectionChecked(event); IProject project = (IProject)selection.getFirstElement(); IPreferenceStore store = PreferenceStoreManager.getPreferenceStore(project); QuestionDialog dialog = new QuestionDialog( Display.getCurrent().getActiveShell(), Messages.getString("AddC2UMLSyncNature.dialogTitle"), Messages.getString("AddC2UMLSyncNature.dialogBody"), store); int result = dialog.open(); if (result > -1) { IModelSynchronizer synchronizer = SynchronizersManager.getSynchronizer(); if (synchronizer != null) { synchronizer.setInitialValues(project); } if (result == 0) { syncFromSources(project); } else if (result == 1) { syncFromModel(project); } } } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } return null; }
Source:
<code>public void run() { <START> while (true) { <END> try { synchronized (gcLock) { long start = System.nanoTime(); while (openTransactions() > 0) { if ((System.nanoTime() - start) / 1000 > MAX_WAIT_FOR_TRANSACTION_MILLIS) openTransactions.clear(); Thread.sleep(MAX_WAIT_FOR_TRANSACTION_MILLIS / 20); } long ready = System.nanoTime(); target.gc().join(); long done = System.nanoTime(); Logging.LOG().info(String.format("GC took: %d ms waiting to start, %d ms in actual GC", (ready - start)/1000000, (done - ready)/1000000)); } Thread.sleep(gcPeriodMillis); } catch (Throwable t) { Logging.LOG().log(Level.WARNING, t.getMessage(), t); } } }</code><technical_language>add a signal this runnable finish</technical_language>

Target:
public void run() { while (true) { try { synchronized (gcLock) { long start = System.nanoTime(); while (openTransactions() > 0) { if ((System.nanoTime() - start) / 1_000_000 > MAX_WAIT_FOR_TRANSACTION_MILLIS) openTransactions.clear(); System.out.println("GC sleeping waiting for " + openTransactions() + " open transactions.."); Thread.sleep(100); } long ready = System.nanoTime(); target.gc().join(); long done = System.nanoTime(); Logging.LOG().info(String.format("GC took: %d ms waiting to start, %d ms in actual GC", (ready - start)/1_000_000, (done - ready)/1_000_000)); } Thread.sleep(gcPeriodMillis); } catch (Throwable t) { Logging.LOG().log(Level.WARNING, t.getMessage(), t); } } }
Source:
<code>void removeWordAtIndex(final int index) { final int oldTopic = assignments[index]; topicCounts.compute(oldTopic, (key, oldValue) -> { if (oldValue == null) { <START> return 0; <END> } else { return oldValue - 1; } }); }</code><technical_language>1? element in topicCounts map means this topic's count is zero, right</technical_language>

Target:
void removeWordAtIndex(final int index) { final int oldTopic = assignments[index]; topicCounts.compute(oldTopic, (key, oldValue) -> { if (oldValue == null || oldValue == 0) { throw new RuntimeException(String.format("The TopicCounts for %d-th word is %d", index, oldValue)); } else { return oldValue - 1; } }); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { <START> isSystemUpdatingWebView = false; <END> return inflater.inflate(R.layout.fragment_authenticated_webview, container, false); } catch (InflateException e) { logger.error(e, true); isSystemUpdatingWebView = true; return inflater.inflate(R.layout.layout_content_error, container, false); } }</code><technical_language>Good mention story reference</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { isSystemUpdatingWebView = false; return inflater.inflate(R.layout.fragment_authenticated_webview, container, false); } catch (InflateException e) { logger.error(e, true); isSystemUpdatingWebView = true; return inflater.inflate(R.layout.content_error, container, false); } }
Source:
<code>static KeyStore createTrustStoreFromCertificates(Path path) { try { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); <START> File[] files = getFilesForPath(path); <END> for (File currFile : files) { keyStore.setCertificateEntry(currFile.getName(), readX509Certificate(currFile.toPath())); } return keyStore; } catch (GeneralSecurityException | IOException e) { throw Throwables.propagate(e); } }</code><technical_language>inline</technical_language>

Target:
static KeyStore createTrustStoreFromCertificates(Path path) { try { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); for (File currFile : getFilesForPath(path)) { keyStore.setCertificateEntry(currFile.getName(), readX509Certificate(currFile.toPath())); } return keyStore; } catch (GeneralSecurityException | IOException e) { throw Throwables.propagate(e); } }
Source:
<code>public Slave(SlaveLooper slaveLooper, final Communicator<Message> streamInCommunicator, final Communicator<Message> streamOutCommunicator, final Communicator<InstanceControlMsg> inControlQueue, final Communicator<Metrics.MetricPublisherPublishMessage> metricsOutCommunicator) { this.slaveLooper = slaveLooper; this.streamInCommunicator = streamInCommunicator; this.streamOutCommunicator = streamOutCommunicator; this.inControlQueue = inControlQueue; this.metricsOutCommunicator = metricsOutCommunicator; this.serializer = SerializeDeSerializeHelper.getSerializer(helper.getTopologyContext().getTopologyConfig()); <START> instanceState = new HashMapState<>(); <END> isStatefulProcessingStarted = false; this.systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG); this.metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); handleControlMessage(); }</code><technical_language>Slave create empty state? this injected? previous state loaded</technical_language>

Target:
public Slave(SlaveLooper slaveLooper, final Communicator<Message> streamInCommunicator, final Communicator<Message> streamOutCommunicator, final Communicator<InstanceControlMsg> inControlQueue, final Communicator<Metrics.MetricPublisherPublishMessage> metricsOutCommunicator) { this.slaveLooper = slaveLooper; this.streamInCommunicator = streamInCommunicator; this.streamOutCommunicator = streamOutCommunicator; this.inControlQueue = inControlQueue; this.metricsOutCommunicator = metricsOutCommunicator; instanceState = null; isStatefulProcessingStarted = false; this.systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG); this.metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); handleControlMessage(); }
Source:
<code>public void release(T element) { recycle(element); elements.add(element); <START> semaphore.release(); <END> }</code><technical_language>is a good idea add releases in a finally block, lose permits</technical_language>

Target:
public void release(T element) { try { if (recycle(element)) { elements.add(element); } } finally { semaphore.release(); } }
Source:
<code><START> public MongoProviderImpl(String connectionUrl, String maxConnectionIdleTime) { <END> MongoClientOptions.Builder clientOptionsBuilder = new MongoClientOptions.Builder(); if(StringUtils.isNotEmpty(maxConnectionIdleTime) && Integer.parseInt(maxConnectionIdleTime) > 0) { clientOptionsBuilder.maxConnectionIdleTime(Integer.parseInt(maxConnectionIdleTime)); } MongoClientURI uri = new MongoClientURI(connectionUrl, clientOptionsBuilder); definedDatabase = uri.getDatabase(); LOG.info("[MongoProvider] [constructor] creating new MongoClient for {}, {}", uri.getHosts(), (StringUtils.isEmpty(definedDatabase) ? "default database" : "database: " + definedDatabase)); mongo = new MongoClient(uri); }</code><technical_language>check if Metis is constructor? changed signature of this class, this result in Metis able upgrade a new version of Corelib provide a maxConnectionIdleTime parameter. If case need research means proper values are. A more user-friendly implementation MongoProviderImpl add a constructor maxConnectionIdleTime</technical_language>

Target:
public MongoProviderImpl(String connectionUrl, String maxConnectionIdleTime) { MongoClientOptions.Builder clientOptionsBuilder = new MongoClientOptions.Builder(); if(StringUtils.isNotEmpty(maxConnectionIdleTime) && Integer.parseInt(maxConnectionIdleTime) > 0) { clientOptionsBuilder.maxConnectionIdleTime(Integer.parseInt(maxConnectionIdleTime)); } MongoClientURI uri = new MongoClientURI(connectionUrl, clientOptionsBuilder); definedDatabase = uri.getDatabase(); LOG.info("[MongoProvider] [constructor] creating new MongoClient for {}, {}, maxConnectionIdleTime ms ", uri.getHosts(), (StringUtils.isEmpty(definedDatabase) ? "default database" : "database: " + definedDatabase), uri.getOptions().getMaxConnectionIdleTime()); mongo = new MongoClient(uri); }