auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest httpReq = (HttpServletRequest) req; String requestURI = httpReq.getRequestURI(); if (!Context.isAuthenticated()) { if ("GET".equalsIgnoreCase(httpReq.getMethod()) && !requestURI.contains("login.")) { if (req.getAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR) == null) { String queryParams = httpReq.getQueryString(); String redirectUrl = requestURI + (StringUtils.isNotBlank(queryParams) ? "?" + queryParams : ""); httpReq.getSession().setAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); if (log.isDebugEnabled()) { log.debug("Set " + OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR + " = " + redirectUrl); } } } } } catch (Exception e) { } chain.doFilter(req, res); }

Target:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest httpReq = (HttpServletRequest) req; String requestURI = httpReq.getRequestURI(); if (!Context.isAuthenticated()) { if ("GET".equalsIgnoreCase(httpReq.getMethod()) && !requestURI.contains("login.")) { HttpSession session = httpReq.getSession(false); if (session != null && session.getAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR) == null) { String queryParams = httpReq.getQueryString(); String redirectUrl = requestURI + (StringUtils.isNotBlank(queryParams) ? "?" + queryParams : ""); httpReq.getSession().setAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); if (log.isDebugEnabled()) { log.debug("Set = {}", OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); } } } } } catch (Exception e) { log.warn("An error occurred while setting session attribute " + OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, e); } chain.doFilter(req, res); }
Source:
private void doCancelTest(String sql) { Response response = null; Boolean isQueryCancelled; int statusCode; ExecutorService executor = Executors.newFixedThreadPool(2); Future<Boolean> executeQueryThread = executor.submit(new executeQuery(sql)); Future<Response> cancelQueryThread = executor.submit(new cancelQuery(sql)); try { isQueryCancelled = executeQueryThread.get(1, TimeUnit.MINUTES); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); throw new RuntimeException("error in query execution thread"); } catch (TimeoutException e) { e.printStackTrace(); executeQueryThread.cancel(true); throw new RuntimeException("query execution timelimit exceeded"); } if (!isQueryCancelled) { throw new RuntimeException("failed to cancel the query"); } try { response = cancelQueryThread.get(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("error in cancel query thread"); } if (response == null) { throw new RuntimeException("error in cancel query thread"); } statusCode = response.getStatusCode(); if (statusCode != HttpStatus.OK.code() && statusCode != HttpStatus.ACCEPTED.code() && statusCode != HttpStatus.NO_CONTENT.code()) { throw new RuntimeException("unexpected error code " + statusCode + "; reason=" + response.getStatusMessage()); } }

Target:
private void doCancelTest(String sql) throws Exception { Future<Void> executeQueryThread = executor.submit(new SqlExecuteCallable(sql)); Future<Response> cancelQueryThread = executor.submit(new SqlCancelCallable(sql)); try { executeQueryThread.get(2, TimeUnit.MINUTES); } catch (TimeoutException e) { executeQueryThread.cancel(true); throw new RuntimeException("Query execution time limit exceeded", e); } Response response = cancelQueryThread.get(); assertNotNull(response, "Error in cancel query thread"); if (response.getStatusCode() != HttpStatus.OK.code() && response.getStatusCode() != HttpStatus.ACCEPTED.code() && response.getStatusCode() != HttpStatus.NO_CONTENT.code()) { fail("Unexpected error code " + response.getStatusCode() + "; reason=" + response.getStatusMessage()); } }
Source:
public Boolean call() throws IOException, InterruptedException { boolean moved = false; int count = 0; int retries = admin.getConfiguration() .getInt(RegionMover.MOVE_RETRIES_MAX_KEY, RegionMover.DEFAULT_MOVE_RETRIES_MAX); int maxWaitInSeconds = admin.getConfiguration() .getInt(RegionMover.MOVE_WAIT_MAX_KEY, RegionMover.DEFAULT_MOVE_WAIT_MAX); long startTime = EnvironmentEdgeManager.currentTime(); boolean sameServer = true; isSuccessfulScan(region); LOG .info("Moving region: from to {}", region.getEncodedName(), sourceServer, targetServer); while (count < retries && sameServer) { if (count > 0) { LOG.info("Retry " + count + " of maximum " + retries); } count = count + 1; admin.move(region.getEncodedNameAsBytes(), targetServer); long maxWait = startTime + (maxWaitInSeconds * 1000); while (EnvironmentEdgeManager.currentTime() < maxWait) { sameServer = isSameServer(region, sourceServer); if (!sameServer) { break; } Thread.sleep(100); } } if (sameServer) { LOG.error("Region: stuck on ,newServer={}", region.getRegionNameAsString(), this.sourceServer, this.targetServer); } else { isSuccessfulScan(region); LOG.info("Moved Region " + region.getRegionNameAsString() + " cost:" + String .format("%.3f", (float) (EnvironmentEdgeManager.currentTime() - startTime) / 1000)); moved = true; movedRegions.add(region); } return moved; }

Target:
public Boolean call() throws IOException, InterruptedException { boolean moved = false; int count = 0; int retries = admin.getConfiguration() .getInt(RegionMover.MOVE_RETRIES_MAX_KEY, RegionMover.DEFAULT_MOVE_RETRIES_MAX); int maxWaitInSeconds = admin.getConfiguration() .getInt(RegionMover.MOVE_WAIT_MAX_KEY, RegionMover.DEFAULT_MOVE_WAIT_MAX); long startTime = EnvironmentEdgeManager.currentTime(); boolean sameServer = true; isSuccessfulScan(region); LOG.info("Moving region: from to {}", region.getRegionNameAsString(), sourceServer, targetServer); while (count < retries && sameServer) { if (count > 0) { LOG.debug("Retry of maximum for region: {}", count, retries, region.getRegionNameAsString()); } count = count + 1; admin.move(region.getEncodedNameAsBytes(), targetServer); long maxWait = startTime + (maxWaitInSeconds * 1000); while (EnvironmentEdgeManager.currentTime() < maxWait) { sameServer = isSameServer(region, sourceServer); if (!sameServer) { break; } Thread.sleep(1000); } } if (sameServer) { LOG.error("Region: stuck on for sec , newServer={}", region.getRegionNameAsString(), this.sourceServer, getTimeDiffInSec(startTime), this.targetServer); } else { isSuccessfulScan(region); LOG.info("Moved Region , cost (sec): {}", region.getRegionNameAsString(), getTimeDiffInSec(startTime)); moved = true; movedRegions.add(region); } return moved; }
Source:
public AMQPMessage setAddress(String address) { internalSetAddress(address); setProtonAddress(address); return this; }

Target:
public AMQPMessage setAddress(String address) { setAddress(cachedAddressSimpleString(address)); return this; }
Source:
public boolean store() throws OseeCoreException { if (artifacts.size() > 0) { for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); if (persist) { artifact.persist(getClass().getSimpleName()); } } if (persist) { SkynetTransaction transaction = TransactionManager.createTransaction(artifacts.iterator().next().getBranch(), "Prompt change boolean"); transaction.execute(); } } return true; }

Target:
public boolean store() throws OseeCoreException { if (persist) { SkynetTransaction transaction = TransactionManager.createTransaction(artifacts.iterator().next().getBranch(), "Prompt change boolean"); for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); artifact.persist(transaction); } transaction.execute(); } else { for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); } } return true; }
Source:
protected void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID, DiskImage diskImage) { Guid hostIdToExecuteQemuImageInfo = null; List<Pair<VM, VmDevice>> attachedVmsInfo = vmDao.getVmsWithPlugInfo(diskImage.getId()); Optional<Pair<VM, VmDevice>> pair = attachedVmsInfo.stream().findFirst(); if (pair.isPresent()) { VM vm = pair.get().getFirst(); if (Boolean.TRUE.equals(pair.get().getSecond().isPlugged())) { if (!vm.isDown()) { hostIdToExecuteQemuImageInfo = vm.getRunOnVds(); } } } setQcowCompat(diskImage.getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo); }

Target:
protected void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID, DiskImage diskImage) { Guid hostIdToExecuteQemuImageInfo = vmDao.getVmsWithPlugInfo(diskImage.getId()) .stream() .filter(p -> !p.getFirst().isDown()) .filter(p -> p.getSecond().isPlugged()) .map(p -> p.getFirst().getRunOnVds()) .findFirst() .orElse(null); setQcowCompat(diskImage.getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo); }
Source:
public boolean isIdProperty() { if (isAnnotationPresent(Id.class) || super.isIdProperty()){ return true; } if(getField() != null && this.getFieldName().toLowerCase(Locale.ROOT).equals("id")){ return true; } return false; }

Target:
public boolean isIdProperty() { if (super.isIdProperty()){ return true; } if(getName().equals("id")){ return true; } return false; }
Source:
public ContainerSpecData getContainersByContainerSpec(final String serverTemplateId, final String containerSpecId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId); List<Container> containers = getKieServerInstanceManager().getContainers(serverTemplate, containerSpec); return new ContainerSpecData(containerSpec, containers); }

Target:
public ContainerSpecData getContainersByContainerSpec(final String serverTemplateId, final String containerSpecId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId); final List<Container> containers = getKieServerInstanceManager().getContainers(serverTemplate, containerSpec); return new ContainerSpecData(containerSpec, containers); }
Source:
public void cherryPickToSameBranchWithRebase() throws Exception { createChange(); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "another_file.txt", "another content"); PushOneCommit.Result r = push.to(git, "refs/for/master"); CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = "it generates a new patch set\n\nChange-Id: " + r.getChangeId(); ChangeApi orig = gApi.changes() .id("p~master~" + r.getChangeId()); ChangeApi cherry = orig.revision(r.getCommit().name()) .cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(2); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 1."); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 2."); }

Target:
public void cherryPickToSameBranchWithRebase() throws Exception { PushOneCommit.Result baseChange = createChange(); RevisionApi baseRevision = gApi.changes().id("p~master~" + baseChange.getChangeId()).current(); baseRevision.review(ReviewInput.approve()); baseRevision.submit(); PushOneCommit.Result r1 = createChange(); String subject = "Test change\n\n" + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef"; PushOneCommit push = pushFactory.create(db, admin.getIdent(), subject, "another_file.txt", "another content"); PushOneCommit.Result r2 = push.to(git, "refs/for/master"); assertThat(r2.getCommit().getParents()[0].name()) .isEqualTo(r1.getCommit().name()); ChangeApi orig = gApi.changes().id("p~master~" + r2.getChangeId()); CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = subject; ChangeApi cherry = orig.revision(r2.getCommit().name()).cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(2); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 1."); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 2."); String newParent = cherryInfo.revisions.get(cherryInfo.currentRevision) .commit.parents.get(0).commit; assertThat(newParent).isEqualTo(baseChange.getCommit().name()); }
Source:
default ColumnValueSelector makeColumnValueSelector(ReadableOffset offset) { return new ObjectColumnSelector() { @Nullable @Override public Object getObject() { return getRowValue(offset.getOffset()); } @Override public Class classOfObject() { return getClazz(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("column", ComplexColumn.this); } }; }

Target:
default ColumnValueSelector<?> makeColumnValueSelector(ReadableOffset offset) { return new ObjectColumnSelector() { @Nullable @Override public Object getObject() { return getRowValue(offset.getOffset()); } @Override public Class classOfObject() { return getClazz(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("column", ComplexColumn.this); } }; }
Source:
private void startRecording() { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(FileUtils.getPath(this, mOutputUri)); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); try { mRecorder.prepare(); } catch (IOException e) { } mRecorder.start(); mVolumeChecker.run(); }

Target:
private void startRecording() { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(FileUtils.getPath(this, mOutputUri)); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); try { mRecorder.prepare(); } catch (IOException e) { Utils.d("Error writing file: "+e.toString()); Toast.makeText(getApplicationContext(), "An error occured at recorder preparations.", Toast.LENGTH_LONG) .show(); } mRecorder.start(); mVolumeChecker.run(); }
Source:
public void setName(Context context, String name) throws SQLException { if (!permanent) getGroupService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, name); }

Target:
void setName(Context context, String name) throws SQLException { getGroupService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, name); }
Source:
public BigDecimal getExchangeRateForBuy(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); setTicker(cryptoCurrency, fiatCurrency); return rateInfo.getHighestBid(); } catch (Exception e) { log.error("", e); } return null; }

Target:
public BigDecimal getExchangeRateForBuy(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); setTicker(cryptoCurrency, fiatCurrency); return bitKubRateInfo.getHighestBid(); } catch (Exception e) { log.error("", e); } return null; }
Source:
private void updateToolbarTitle() { if (toolbar != null) { TextView tvTitle = toolbar.findViewById(R.id.toolbar_title); if (screenType == REORDER_SCREEN_TYPE) { tvTitle.setText(getString(R.string.configure_screen_quick_action)); } else { int selectedCount = actionsToDelete != null ? actionsToDelete.size() : 0; String title = String.format( getString(R.string.ltr_or_rtl_combine_via_colon), getString(R.string.shared_string_selected), String.valueOf(selectedCount)); tvTitle.setText(title); } } }

Target:
private void updateToolbarTitle() { if (toolbar != null) { TextView tvTitle = toolbar.findViewById(R.id.toolbar_title); if (screenType == SCREEN_TYPE_REORDER) { tvTitle.setText(getString(R.string.configure_screen_quick_action)); } else if (screenType == SCREEN_TYPE_DELETE) { int selectedCount = actionsToDelete != null ? actionsToDelete.size() : 0; String title = String.format( getString(R.string.ltr_or_rtl_combine_via_colon), getString(R.string.shared_string_selected), String.valueOf(selectedCount)); tvTitle.setText(title); } } }
Source:
public synchronized void doSubmitSummary( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { setDescription(req.getParameter("summary")); rsp.sendRedirect("."); }

Target:
public synchronized void doSubmitSummary( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { setSummary(req.getParameter("summary")); rsp.sendRedirect("."); }
Source:
private void loadCampaignsStateFromCache() throws JSONException { String campaignsStateFromCache = cachedLocalStorage.getCacheEntryForUser(userId, CAMPAIGNS_STATE_CATEGORY); if (!SwrveHelper.isNullOrEmpty(campaignsStateFromCache)) { JSONObject campaignsStateJson = new JSONObject(campaignsStateFromCache); Iterator<String> campaignIdIterator = campaignsStateJson.keys(); while(campaignIdIterator.hasNext()) { String campaignIdStr = campaignIdIterator.next(); try { int campaignId = Integer.parseInt(campaignIdStr); SwrveCampaignState campaignState = new SwrveCampaignState(campaignsStateJson.getJSONObject(campaignIdStr)); campaignsState.put(campaignId, campaignState); } catch(Exception exp) { SwrveLogger.e(LOG_TAG, "Could not load state for campaign " + campaignIdStr, exp); } } } }

Target:
private void loadCampaignsStateFromCache() { try { String campaignsStateFromCache = cachedLocalStorage.getCacheEntryForUser(userId, CAMPAIGNS_STATE_CATEGORY); if (!SwrveHelper.isNullOrEmpty(campaignsStateFromCache)) { JSONObject campaignsStateJson = new JSONObject(campaignsStateFromCache); Iterator<String> campaignIdIterator = campaignsStateJson.keys(); while (campaignIdIterator.hasNext()) { String campaignIdStr = campaignIdIterator.next(); try { int campaignId = Integer.parseInt(campaignIdStr); SwrveCampaignState campaignState = new SwrveCampaignState(campaignsStateJson.getJSONObject(campaignIdStr)); campaignsState.put(campaignId, campaignState); } catch (Exception exp) { SwrveLogger.e(LOG_TAG, "Could not load state for campaign " + campaignIdStr, exp); } } } } catch(JSONException e) { SwrveLogger.e(LOG_TAG, "Could not load state of campaigns, bad JSON", e); } }
Source:
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } sortSwaggerPropertiesByPosition(model); for (String key : model.getProperties().keySet()) { org.restlet.ext.apispark.internal.model.Property property = new org.restlet.ext.apispark.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); property.setExample(swaggerProperty.getExample()); property.setMinOccurs(swaggerProperty.getRequired() ? 1 : 0); property.setMaxOccurs(swaggerProperty instanceof ArrayProperty ? -1 : 1); property.setName(key); property.setUniqueItems(false); if (swaggerProperty instanceof AbstractNumericProperty) { AbstractNumericProperty numericProperty = (AbstractNumericProperty) swaggerProperty; formatPropertyMinMax(numericProperty, property); } else if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }

Target:
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.apispark.internal.model.Property property = new org.restlet.ext.apispark.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }
Source:
public void onEventMainThread(final NotificationEvents.NoteLikeStatusChanged event) { NotificationsActions.downloadNoteAndUpdateDB(event.noteId, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteLikeStatusChanged.class); Note note = NotificationsTable.getNoteById(event.noteId); mNotesAdapter.replaceNote(note); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteLikeStatusChanged.class); } } ); }

Target:
public void onEventMainThread(final NotificationEvents.NoteLikeStatusChanged event) { NotificationsActions.downloadNoteAndUpdateDB(event.noteId, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteLikeStatusChanged.class); Note note = NotificationsTable.getNoteById(event.noteId); if (note != null) { mNotesAdapter.replaceNote(note); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteLikeStatusChanged.class); } } ); }
Source:
private void addItemOnTarget( T item, T target, String targetItemNotFoundErrorMessage, SerializableFunction<Integer, Integer> insertItemsIndexProvider) { final ListDataProvider<T> dataProvider = getDataProvider(); final Collection<T> backendItems = dataProvider.getItems(); if (!(backendItems instanceof List)) { throw new IllegalArgumentException( String.format(COLLECTION_TYPE_ERROR_MESSAGE_PATTERN, backendItems.getClass().getSimpleName())); } if (equals(item, target, dataProvider)) { return; } final int targetItemIndex = getItemIndex(target, dataProvider::getId); if (targetItemIndex == -1) { throw new IllegalArgumentException(targetItemNotFoundErrorMessage); } final List<T> itemList = (List<T>) backendItems; removeItemIfPresent(item, dataProvider); itemList.add(insertItemsIndexProvider .apply(getItemIndex(target, dataProvider::getId)), item); dataProvider.refreshAll(); }

Target:
private void addItemOnTarget( T item, T target, String targetItemNotFoundErrorMessage, SerializableFunction<Integer, Integer> insertItemsIndexProvider) { final ListDataProvider<T> dataProvider = getDataProvider(); final Collection<T> backendItems = dataProvider.getItems(); if (!(backendItems instanceof List)) { throw new IllegalArgumentException( String.format(COLLECTION_TYPE_ERROR_MESSAGE_PATTERN, backendItems.getClass().getSimpleName())); } if (equals(item, target, dataProvider)) { return; } if (!contains(target, dataProvider)) { throw new IllegalArgumentException(targetItemNotFoundErrorMessage); } final List<T> itemList = (List<T>) backendItems; removeItemIfPresent(item, dataProvider); itemList.add(insertItemsIndexProvider .apply(getItemIndex(target, dataProvider::getId)), item); dataProvider.refreshAll(); }
Source:
public void testRepresentedCountry() { assertNotNull("city.getRepresentedCountry() returns null", this.insights.getRepresentedCountry()); assertEquals( "city.getRepresentedCountry().getType() does not return C<military>", "C<military>", this.insights.getRepresentedCountry().getType()); assertEquals( "city.getRepresentedCountry().isInEuropeanUnion() does not return true", true, this.insights.getRepresentedCountry().isInEuropeanUnion()); }

Target:
public void testRepresentedCountry() { assertNotNull("city.getRepresentedCountry() returns null", this.insights.getRepresentedCountry()); assertEquals( "city.getRepresentedCountry().getType() does not return C<military>", "C<military>", this.insights.getRepresentedCountry().getType()); assertTrue( "city.getRepresentedCountry().isInEuropeanUnion() does not return true", this.insights.getRepresentedCountry().isInEuropeanUnion()); }
Source:
public void canCreateRelease() throws Exception { final Releases releases = RtReleasesITCase.releases(); final String tag = "0.1"; int number = 0; try { final Release created = releases.create(tag); number = created.number(); final Release obtained = releases.get(number); MatcherAssert.assertThat( created, Matchers.is(obtained) ); MatcherAssert.assertThat( new Release.Smart(created).tag(), Matchers.equalTo(new Release.Smart(obtained).tag()) ); } finally { releases.remove(number); } }

Target:
public void canCreateRelease() throws Exception { final Releases releases = RtReleasesITCase.releases(); final String tag = "0.1"; final Release created = releases.create(tag); final int number = created.number(); try { final Release obtained = releases.get(number); MatcherAssert.assertThat( created, Matchers.is(obtained) ); MatcherAssert.assertThat( new Release.Smart(created).tag(), Matchers.equalTo(new Release.Smart(obtained).tag()) ); } finally { releases.remove(number); } }
Source:
protected String getValueFromSwitchOrProp(String what, String switchName, String propName) { if (switchName != null && ! switchName.startsWith("-")) { LOG.warn("Specifying switch names (e.g. '{}') without a leading dash is no longer supported. You must update your notification command definitions. See <LINK_0>", switchName); } LOG.debug("Trying to get from notification switch {}", what, switchName); String val = getSwitchValue(switchName); if (val != null) { LOG.info("Using value from notification switch {}", what, val, switchName); return val; } LOG.debug("Trying to get from system property {}", what, propName); val = System.getProperty(propName); if (val != null) { LOG.info("Using value from system property {}", what, val, propName); return val; } LOG.warn("Could not determine value for from notification command switch or system property {}", what, switchName, propName); return null; }

Target:
protected String getValueFromSwitchOrProp(String what, String switchName, String propName) { if (Strings.isNullOrEmpty(switchName)) { LOG.error("Switch name must not be null or empty"); return null; } if (!switchName.startsWith("-")) { LOG.warn("Specifying switch names (e.g. '{}') without a leading dash is deprecated. Please update your notification command definition to use '-{}' instead. See <LINK_0>", switchName, switchName); } LOG.debug("Trying to get from notification switch '{}'", what, switchName); if (hasSwitchName(switchName) && hasSwitchValue(switchName)) { final String val = getSwitchValue(switchName); LOG.info("Using value from notification switch {}", what, val, switchName); return val; } final String alternateSwitchName = switchName.startsWith("-") ? switchName.substring(1) : "-" + switchName; LOG.debug("Trying to get from notification switch '{}'", what, alternateSwitchName); if (hasSwitchValue(alternateSwitchName) && hasSwitchValue(alternateSwitchName)) { final String val = getSwitchValue(alternateSwitchName); LOG.info("Using value from notification switch '{}'", what, val, switchName); return val; } if (propName != null) { LOG.debug("Trying to get from system property '{}'", what, propName); final String val = System.getProperty(propName); if (val != null) { LOG.info("Using value from system property '{}'", what, val, propName); return val; } } LOG.warn("Could not determine value for from notification command switch '{}' or system property '{}'", what, switchName, propName); return null; }
Source:
protected void requireOriginalContext(TreeReference forReference) throws AnalysisInvalidException{ if (getOriginalContextRef() == null) { throw AnalysisInvalidException.INSTANCE; } }

Target:
protected void requireOriginalContext(TreeReference forReference) throws AnalysisInvalidException{ if (getOriginalContextRef() == null) { throw AnalysisInvalidException.INSTANCE_NO_ORIGINAL_CONTEXT_REF; } }
Source:
public void start() throws IOException, UnavailableException, InterruptedException, KeeperException, BKException { this.bookie.start(); if (!this.bookie.isRunning()) { exitCode = bookie.getExitCode(); return; } this.nettyServer.start(); running = true; deathWatcher = new DeathWatcher(conf); deathWatcher.start(); }

Target:
public void start() throws IOException, UnavailableException, InterruptedException, BKException { this.bookie.start(); if (!this.bookie.isRunning()) { exitCode = bookie.getExitCode(); return; } this.nettyServer.start(); running = true; deathWatcher = new DeathWatcher(conf); deathWatcher.start(); }
Source:
private void updateFirewallTypeUponVersionChange(Version version) { ListModel<FirewallType> firewallType = getFirewallType(); firewallType.setIsChangeable(version.greaterOrEquals(Version.v4_0)); if (version.greater(Version.v4_2)) { firewallType.setSelectedItem(FirewallType.FIREWALLD); } else if (version.less(Version.v4_2)) { firewallType.setSelectedItem(FirewallType.IPTABLES); } }

Target:
private void updateFirewallTypeUponVersionChange(Version version) { ListModel<FirewallType> firewallType = getFirewallType(); if (version.less(AsyncDataProvider.getInstance().multiFirewallSupportSince())) { firewallType.setIsChangeable(false); firewallType.setSelectedItem(FirewallType.IPTABLES); } else { firewallType.setIsChangeable(true); } }
Source:
public void onMessage(CommandStatusReportFromDatanode report, EventPublisher publisher) { Preconditions.checkNotNull(report); List<CommandStatus> cmdStatusList = report.getReport().getCmdStatusList(); Preconditions.checkNotNull(cmdStatusList); LOGGER.trace("Processing command status report for dn: {}", report .getDatanodeDetails()); cmdStatusList.forEach(cmdStatus -> { LOGGER.trace("Emitting command status for id:{} type: {}", cmdStatus .getCmdId(), cmdStatus.getType()); switch (cmdStatus.getType()) { case deleteBlocksCommand: if (cmdStatus.getStatus() == CommandStatus.Status.EXECUTED) { publisher.fireEvent(SCMEvents.DELETE_BLOCK_STATUS, new DeleteBlockStatus(cmdStatus)); } break; case createPipelineCommand: if (cmdStatus.getStatus() != CommandStatus.Status.PENDING) { publisher.fireEvent(SCMEvents.CREATE_PIPELINE_STATUS, new CreatePipelineStatus(cmdStatus)); } break; default: LOGGER.warn("CommandStatus of type:{} not handled in " + "CommandStatusReportHandler.", cmdStatus.getType()); } }); }

Target:
public void onMessage(CommandStatusReportFromDatanode report, EventPublisher publisher) { Preconditions.checkNotNull(report); List<CommandStatus> cmdStatusList = report.getReport().getCmdStatusList(); Preconditions.checkNotNull(cmdStatusList); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Processing command status report for dn: {}", report .getDatanodeDetails()); } cmdStatusList.forEach(cmdStatus -> { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Emitting command status for id:{} type: {}", cmdStatus .getCmdId(), cmdStatus.getType()); } if (cmdStatus.getType() == SCMCommandProto.Type.deleteBlocksCommand) { if (cmdStatus.getStatus() == CommandStatus.Status.EXECUTED) { publisher.fireEvent(SCMEvents.DELETE_BLOCK_STATUS, new DeleteBlockStatus(cmdStatus)); } } else { LOGGER.debug("CommandStatus of type:{} not handled in " + "CommandStatusReportHandler.", cmdStatus.getType()); } }); }
Source:
private PlanNodeCostEstimate calculateCumulativeCost(PlanNode node) { PlanNodeCostEstimate localCost = costCalculator.calculateCost(node, statsProvider, lookup, session, types); PlanNodeCostEstimate sourcesCost = sourceProvider.getSources(node).stream() .map(this::getCumulativeCost) .reduce(ZERO_COST, PlanNodeCostEstimate::add); PlanNodeCostEstimate cumulativeCost = node.accept(new CostCombiner(), new CostCombiner.Context(localCost, sourcesCost)); verify(cumulativeCost != null); return cumulativeCost; }

Target:
private PlanCostEstimate calculateCumulativeCost(PlanNode node) { PlanNodeCostEstimate localCost = costCalculator.calculateCost(node, statsProvider, session, types); List<PlanCostEstimate> sourcesCosts = node.getSources().stream() .map(this::getPlanCost) .collect(toImmutableList()); MemoryEstimate memoryEstimate = node.accept(new PeakMemoryEstimator(), new EstimationContext(localCost.getMemoryCost(), sourcesCosts)); verify(memoryEstimate != null); PlanCostEstimate sourcesCost = sourcesCosts.stream() .reduce(PlanCostEstimate.zero(), CachingCostProvider::addSiblingsCost); return new PlanCostEstimate( localCost.getCpuCost() + sourcesCost.getCpuCost(), Math.max(sourcesCost.getMaxMemory(), Math.max(memoryEstimate.maxMemoryBeforeOutputting, memoryEstimate.maxMemoryWhenOutputting)), memoryEstimate.maxMemoryWhenOutputting, localCost.getNetworkCost() + sourcesCost.getNetworkCost()); }
Source:
public void visitNode(Tree tree) { for (Tree member : ((ClassTree) tree).members()) { if (member.is(Kind.VARIABLE)) { VariableTreeImpl variableTree = (VariableTreeImpl) member; if (variableTree.modifiers().modifiers().contains(Modifier.STATIC)) { Tree variableType = variableTree.type(); VariableSymbol symbol = variableTree.getSymbol(); if (variableType.is(Kind.ARRAY_TYPE) || (variableType.is(Kind.PARAMETERIZED_TYPE) && symbol.getType().isSubtypeOf(COLLECTION_QUALIFIED_NAME)) || (variableType.is(Kind.IDENTIFIER) && (symbol.getType().is(DATE_QUALIFIER_NAME) || symbol.getType().isSubtypeOf(COLLECTION_QUALIFIED_NAME)))) { addIssue(variableTree, MESSAGE.replace("xxx", variableTree.simpleName().name())); } } } } }

Target:
public void visitNode(Tree tree) { for (Tree member : ((ClassTree) tree).members()) { if (member.is(Kind.VARIABLE)) { VariableTreeImpl variableTree = (VariableTreeImpl) member; if (isStaticMember(variableTree) && isMutableMember(variableTree)) { addIssue(variableTree, MessageFormat.format("Move \"{0}\" to a class and lower its visibility", variableTree.simpleName().name())); } } } }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (tuple == null || tuple.size() == 0) return false; long ts = tuple.getValue(0).getTimestamp(); Cell emptyColumnKV = tuple.getValue(emptyCF, emptyCQ); if ((emptyColumnKV != null) && CellUtil.matchingColumn(emptyColumnKV, emptyCF, emptyCQ)) { ts = emptyColumnKV.getTimestamp(); } Date rowTimestamp = new Date(ts); ptr.set(PDate.INSTANCE.toBytes(rowTimestamp)); return true; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (tuple == null || tuple.size() == 0) { return false; } byte[] emptyCF = ((KeyValueColumnExpression)children.get(0)).getColumnFamily(); byte[] emptyCQ = ((KeyValueColumnExpression)children.get(0)).getColumnQualifier(); long ts = tuple.getValue(0).getTimestamp(); Cell emptyColumnKV = tuple.getValue(emptyCF, emptyCQ); if ((emptyColumnKV != null) && CellUtil.matchingColumn(emptyColumnKV, emptyCF, emptyCQ)) { ts = emptyColumnKV.getTimestamp(); } Date rowTimestamp = new Date(ts); ptr.set(PDate.INSTANCE.toBytes(rowTimestamp)); return true; }
Source:
protected static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap conParams = new DefaultValueMap(); conParams.put("id", connection.getid(), Guid.Empty.toString()); conParams.put("connection", connection.getconnection(), ""); switch (connection.getstorage_type()) { case ISCSI: conParams.put("portal", connection.getportal(), ""); conParams.put("port", connection.getport(), ""); conParams.put("iqn", connection.getiqn(), ""); conParams.put("user", connection.getuser_name(), ""); conParams.put("password", connection.getpassword(), ""); break; case NFS: if (storagePool == null || Config.<Boolean> GetValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { conParams.putIfNotEmpty("mnt_options", connection.getMountOptions()); conParams.putIfNotEmpty("vfs_type", connection.getVfsType()); if (connection.getNfsVersion() != null) { conParams.put("protocol_version", connection.getNfsVersion().getValue()); } conParams.putIfNotEmpty("timeout", connection.getNfsTimeo()); conParams.putIfNotEmpty("retrans", connection.getNfsRetrans()); } break; } return conParams; }

Target:
protected static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap conParams = new DefaultValueMap(); conParams.put("id", connection.getid(), Guid.Empty.toString()); conParams.put("connection", connection.getconnection(), ""); switch (connection.getstorage_type()) { case ISCSI: conParams.put("portal", connection.getportal(), ""); conParams.put("port", connection.getport(), ""); conParams.put("iqn", connection.getiqn(), ""); conParams.put("user", connection.getuser_name(), ""); conParams.put("password", connection.getpassword(), ""); break; case POSIXFS: conParams.putIfNotEmpty("mnt_options", connection.getMountOptions()); conParams.putIfNotEmpty("vfs_type", connection.getVfsType()); break; case NFS: if (storagePool == null || Config.<Boolean> getValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { if (connection.getNfsVersion() != null) { conParams.put("protocol_version", connection.getNfsVersion().getValue()); } conParams.putIfNotEmpty("timeout", connection.getNfsTimeo()); conParams.putIfNotEmpty("retrans", connection.getNfsRetrans()); } break; } return conParams; }
Source:
public void removePath(String path) { paths.remove(PathUtils.validatePath(path)); }

Target:
public boolean removePath(String path) { return paths.remove(PathUtils.validatePath(path)); }
Source:
private void setClasspaths(IProgressMonitor monitor) throws JavaModelException { SubMonitor subMonitor = SubMonitor.convert(monitor, "", fProjectClasspaths.size()); Enumeration<IProject> keys = fProjectClasspaths.keys(); while (keys.hasMoreElements()) { IProject project = keys.nextElement(); IClasspathEntry[] classpath = fProjectClasspaths.get(project); subMonitor.subTask(project.getName()); JavaCore.create(project).setRawClasspath(classpath, subMonitor.newChild(1)); } }

Target:
private void setClasspaths(IProgressMonitor monitor) throws JavaModelException { SubMonitor subMonitor = SubMonitor.convert(monitor, fProjectClasspaths.size()); Enumeration<IProject> keys = fProjectClasspaths.keys(); while (keys.hasMoreElements()) { IProject project = keys.nextElement(); IClasspathEntry[] classpath = fProjectClasspaths.get(project); subMonitor.subTask(project.getName()); JavaCore.create(project).setRawClasspath(classpath, subMonitor.newChild(1)); } }
Source:
private KernelServices buildKernelServices(ModelTestControllerVersion controllerVersion, ModelVersion version, String... mavenResourceURLs) throws Exception { String xmlName = String.format("eap-%s-transformer.xml", controllerVersion.getRealVersionName()); String xml = readResource(xmlName); return this.buildKernelServices(xml, controllerVersion, version, mavenResourceURLs); }

Target:
private KernelServices buildKernelServices(ModelTestControllerVersion controllerVersion, ModelVersion version, String... mavenResourceURLs) throws Exception { return this.buildKernelServices(this.getSubsystemXml(), controllerVersion, version, mavenResourceURLs); }
Source:
public Comparator<Entry<?, ?>> resolve(KeyValueQuery<?> query) { if (query == null || query.getSort() == Sort.unsorted()) { return null; } Comparator hazelcastPropertyComparator = null; for (Order order : query.getSort()) { if (order.getProperty().indexOf('.') > -1) { throw new UnsupportedOperationException("Embedded fields not implemented: " + order); } if (order.isIgnoreCase()) { throw new UnsupportedOperationException("Ignore case not implemented: " + order); } if (NullHandling.NATIVE != order.getNullHandling()) { throw new UnsupportedOperationException("Null handling not implemented: " + order); } if (hazelcastPropertyComparator == null) { hazelcastPropertyComparator = new HazelcastPropertyComparator(order.getProperty(), order.isAscending()); } else { hazelcastPropertyComparator.thenComparing(new HazelcastPropertyComparator(order.getProperty(), order.isAscending())); } } return hazelcastPropertyComparator; }

Target:
public Comparator<Entry<?, ?>> resolve(KeyValueQuery<?> query) { if (query == null || query.getSort() == Sort.unsorted()) { return null; } Comparator hazelcastPropertyComparator = null; for (Order order : query.getSort()) { if (order.getProperty().indexOf('.') > -1) { throw new UnsupportedOperationException("Embedded fields not implemented: " + order); } if (order.isIgnoreCase()) { throw new UnsupportedOperationException("Ignore case not implemented: " + order); } if (NullHandling.NATIVE != order.getNullHandling()) { throw new UnsupportedOperationException("Null handling not implemented: " + order); } if (hazelcastPropertyComparator == null) { hazelcastPropertyComparator = new HazelcastPropertyComparator(order.getProperty(), order.isAscending()); } else { hazelcastPropertyComparator = hazelcastPropertyComparator.thenComparing( new HazelcastPropertyComparator(order.getProperty(), order.isAscending())); } } return hazelcastPropertyComparator; }
Source:
private List<File> createFoundModules(final File pomFile) { try { List<File> result = new ArrayList<>(); if (log.isLoggable(Level.FINE)) { log.fine("Processing " + pomFile.getAbsolutePath() + " for classpath module resolution"); } Xpp3Dom dom = null; try (FileReader reader = new FileReader(pomFile)) { dom = Xpp3DomBuilder.build(reader); } Xpp3Dom modules = dom.getChild("modules"); if (modules != null) { for (Xpp3Dom module : modules.getChildren()) { result.add(new File(pomFile.getParent(), module.getValue())); } } if (result.isEmpty()) { Xpp3Dom parent = dom.getChild("parent"); if (parent != null) { Xpp3Dom relativePathNode = parent.getChild("relativePath"); if ( relativePathNode != null && !(relativePathNode.getValue() == null) ) { String relativePath = (relativePathNode == null) ? "../pom.xml" : relativePathNode.getValue(); File parentPom = pomFile.getParentFile().toPath().resolve(relativePath).toFile(); if (parentPom.isFile()) result = createFoundModules(parentPom); } } } return result; } catch (final Exception e) { throw new RuntimeException("Could not parse pom.xml: " + pomFile, e); } }

Target:
private List<File> createFoundModules(final File pomFile) { try { List<File> result = new ArrayList<>(); if (log.isLoggable(Level.FINE)) { log.fine("Processing " + pomFile.getAbsolutePath() + " for classpath module resolution"); } Xpp3Dom dom = null; try (FileReader reader = new FileReader(pomFile)) { dom = Xpp3DomBuilder.build(reader); } Xpp3Dom modules = dom.getChild("modules"); if (modules != null) { for (Xpp3Dom module : modules.getChildren()) { result.add(new File(pomFile.getParent(), module.getValue())); } } if (result.isEmpty()) { Xpp3Dom parent = dom.getChild("parent"); if (parent != null) { Xpp3Dom relativePathNode = parent.getChild("relativePath"); String relativePath = (relativePathNode == null) ? "../pom.xml" : relativePathNode.getValue(); if (relativePath != null) { File parentPom = pomFile.getParentFile().toPath().resolve(relativePath).toFile(); if (parentPom.isFile()) result = createFoundModules(parentPom); } } } return result; } catch (final Exception e) { throw new RuntimeException("Could not parse pom.xml: " + pomFile, e); } }
Source:
protected void build(UnitVmModel model, VmBase vm) { vm.setMigrationSupport(model.getMigrationMode().getSelectedItem()); vm.setMigrationDowntime(model.getSelectedMigrationDowntime()); if (model.getOverrideMigrationPolicy().getEntity()) { vm.setMigrationPolicyId(model.getMigrationPolicies().getSelectedItem().getId()); } else { vm.setMigrationPolicyId(null); } }

Target:
protected void build(UnitVmModel model, VmBase vm) { vm.setMigrationSupport(model.getMigrationMode().getSelectedItem()); vm.setMigrationDowntime(model.getSelectedMigrationDowntime()); vm.setMigrationPolicyId(model.getSelectedMigrationPolicy()); }
Source:
public void sendMailBySendCloud(String toAddress, String title, String content, SendCloudType type) throws UnsupportedEncodingException { try { if(SEND_MAIL_COUNT <= 0){ return; } SEND_MAIL_COUNT --; Session mailSession = getMailSession(); SMTPTransport transport = null; transport = (SMTPTransport) mailSession.getTransport("smtp"); MimeMessage message = new MimeMessage(mailSession); message.setFrom(new InternetAddress(sendCloudFrom, "拓天速贷", "UTF-8")); message.addRecipient(Message.RecipientType.TO, new InternetAddress(toAddress)); message.setSubject(title, "UTF-8"); Multipart multipart = new MimeMultipart("alternative"); BodyPart contentPart = new MimeBodyPart(); contentPart.setHeader("Content-Type", "text/html;charset=UTF-8"); contentPart.setHeader("Content-Transfer-Encoding", "base64"); if (SendCloudType.TEXT.equals(type)) { contentPart.setText(content); } else { contentPart.setContent(content, "text/html;charset=UTF-8"); } multipart.addBodyPart(contentPart); message.setContent(multipart); transport.connect(); transport.sendMessage(message, message.getRecipients(Message.RecipientType.TO)); transport.close(); }catch (MessagingException e){ logger.error(e.getLocalizedMessage(),e); this.sendMailBySendCloud(toAddress,title,content,type); } }

Target:
public void sendMailBySendCloud(String toAddress, String title, String content, SendCloudType type) throws UnsupportedEncodingException { for (int i = 0; i < 3; i++) { try { Session mailSession = getMailSession(); SMTPTransport transport = null; transport = (SMTPTransport) mailSession.getTransport("smtp"); MimeMessage message = new MimeMessage(mailSession); message.setFrom(new InternetAddress(sendCloudFrom, "拓天速贷", "UTF-8")); message.addRecipient(Message.RecipientType.TO, new InternetAddress(toAddress)); message.setSubject(title, "UTF-8"); Multipart multipart = new MimeMultipart("alternative"); BodyPart contentPart = new MimeBodyPart(); contentPart.setHeader("Content-Type", "text/html;charset=UTF-8"); contentPart.setHeader("Content-Transfer-Encoding", "base64"); if (SendCloudType.TEXT.equals(type)) { contentPart.setText(content); } else { contentPart.setContent(content, "text/html;charset=UTF-8"); } multipart.addBodyPart(contentPart); message.setContent(multipart); transport.connect(); transport.sendMessage(message, message.getRecipients(Message.RecipientType.TO)); transport.close(); break; } catch (MessagingException e) { logger.debug("send cloud is fail by" + e.getMessage()); } } }