auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PageableResult search(RequestContext context) throws ResponseException { String query = context.getParameter("q"); String location_uuid = context.getParameter("location_uuid"); query = query.isEmpty() ? null : query; location_uuid = StringUtils.isEmpty(location_uuid) ? null : location_uuid; ICashPointService service = Context.getService(ICashPointService.class); if (location_uuid == null) { PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = service.findByName(query, context.getIncludeAll(), pagingInfo); AlreadyPagedWithLength<CashPoint> results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); return results; } else { LocationService locationService = Context.getLocationService(); Location location = locationService.getLocationByUuid(location_uuid); if (query == null) { return searchByLocation(location_uuid, context); } PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = service.findCashPoints(location, query, context.getIncludeAll(), pagingInfo); PageableResult results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); return results; } }

Target:
public PageableResult search(RequestContext context) throws ResponseException { String query = context.getParameter("q"); String location_uuid = context.getParameter("location_uuid"); query = query.isEmpty() ? null : query; location_uuid = StringUtils.isEmpty(location_uuid) ? null : location_uuid; ICashPointService service = Context.getService(ICashPointService.class); LocationService locationService = Context.getLocationService(); Location location = locationService.getLocationByUuid(location_uuid); PagingInfo pagingInfo = PagingUtil.getPagingInfoFromContext(context); List<CashPoint> cashpoints = null; PageableResult results = null; if (location_uuid == null) { cashpoints = service.findByName(query, context.getIncludeAll(), pagingInfo); } else if (query == null) { cashpoints = service.getCashPointsByLocation(location, context.getIncludeAll(), pagingInfo); } else { cashpoints = service.findCashPoints(location, query, context.getIncludeAll(), pagingInfo); } results = new AlreadyPagedWithLength<CashPoint>(context, cashpoints, pagingInfo.hasMoreResults(), pagingInfo.getTotalRecordCount()); return results; }
Source:
default boolean messageIsValid(CorfuMsg msg, ChannelHandlerContext ctx) { if (msg.getMsgType().ignoreEpoch) { return true; } if (!epochIsValid(msg, ctx)) { return false; } return getCurrentLayout() .map(layout -> clusterIdIsValid(msg, ctx, layout)) .orElseGet(() -> { sendNoBootstrapMessage(msg, ctx); return false; }); }

Target:
default boolean messageIsValid(CorfuMsg msg, ChannelHandlerContext ctx) { if (!msg.getMsgType().ignoreEpoch && !epochIsValid(msg, ctx)) { return false; } if(!msg.getMsgType().ignoreClusterId){ return getCurrentLayout() .map(layout -> clusterIdIsValid(msg, ctx, layout)) .orElseGet(() -> { sendNoBootstrapMessage(msg, ctx); return false; }); } return true; }
Source:
public ScalarUdf createInstance(String clazz, String udfName) { Config udfConfig = udfMetadata.get(udfName).get(0).getUdfConfig(); ScalarUdf scalarUdf = ReflectionUtil.createInstanceOrNull(clazz, ScalarUdf.class, getClass().getClassLoader()); if (scalarUdf == null) { String msg = String.format("Couldn't create udf %s of class %s", udfName, clazz); throw new SamzaException(msg); } scalarUdf.init(udfConfig); return scalarUdf; }

Target:
public ScalarUdf createInstance(String clazz, String udfName) { Config udfConfig = udfMetadata.get(udfName).get(0).getUdfConfig(); ScalarUdf scalarUdf = ReflectionUtil.getObj(getClass().getClassLoader(), clazz, ScalarUdf.class); scalarUdf.init(udfConfig); return scalarUdf; }
Source:
public boolean updateMessageOnIccEf(int index, int status, byte[] pdu) { if (DBG) log("updateMessageOnIccEf: index=" + index + " status=" + status + " ==> " + "("+ pdu + ")"); enforceReceiveAndSend("Updating message on RUIM"); synchronized(mLock) { mSuccess = false; Message response = mHandler.obtainMessage(EVENT_UPDATE_DONE); if (status == STATUS_ON_ICC_FREE) { mPhone.mCM.deleteSmsOnRuim(index, response); } else { byte[] record = makeSmsRecordData(status, pdu); ((RuimFileHandler)mPhone.getIccFileHandler()).updateEFLinearFixed( IccConstants.EF_SMS, index, record, null, response); } try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); } } return mSuccess; }

Target:
updateMessageOnIccEf(int index, int status, byte[] pdu) { if (DBG) log("updateMessageOnIccEf: index=" + index + " status=" + status + " ==> " + "("+ pdu + ")"); enforceReceiveAndSend("Updating message on RUIM"); synchronized(mLock) { mSuccess = false; Message response = mHandler.obtainMessage(EVENT_UPDATE_DONE); if (status == STATUS_ON_ICC_FREE) { mPhone.mCM.deleteSmsOnRuim(index, response); } else { byte[] record = makeSmsRecordData(status, pdu); ((RuimFileHandler)mPhone.getIccFileHandler()).updateEFLinearFixed( IccConstants.EF_SMS, index, record, null, response); } try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); } } return mSuccess; }
Source:
public boolean match(Block block) { boolean ret; if (block instanceof MacroBlock) { ret = ((MacroBlock) block).getId().equals("mention") && Optional.ofNullable(block.getParameter("anchor")) .map(it -> it.equals(this.anchorId)) .orElse(false); } else { ret = false; } return ret; }

Target:
public boolean match(Block block) { boolean ret; if (block instanceof MacroBlock) { ret = ((MacroBlock) block).getId().equals("mention") && Objects.equals(Objects.toString(block.getParameter("anchor"), ""), this.anchorId); } else { ret = false; } return ret; }
Source:
public void changeStateOfProgramEnrollment(String configName, String programEnrollmentUuid, DateTime programCompletedDate, String stateUuid, DateTime startDate) { ProgramEnrollment programEnrollment = new ProgramEnrollment(); programEnrollment.setUuid(programEnrollmentUuid); programEnrollment.setDateCompleted(Objects.nonNull(programCompletedDate) ? programCompletedDate.toDate() : null); if (!Strings.isNullOrEmpty(stateUuid)) { Program.State state = new Program.State(); state.setUuid(stateUuid); ProgramEnrollment.StateStatus stateStatus = new ProgramEnrollment.StateStatus(); stateStatus.setState(state); stateStatus.setStartDate(startDate.toDate()); programEnrollment.setStates(Collections.singletonList(stateStatus)); } programEnrollmentService.updateProgramEnrollment(configName, programEnrollment); }

Target:
public void changeStateOfProgramEnrollment(String configName, String programEnrollmentUuid, DateTime programCompletedDate, String stateUuid, DateTime startDate) { ProgramEnrollment programEnrollment = new ProgramEnrollment(); programEnrollment.setUuid(programEnrollmentUuid); programEnrollment.setDateCompleted(Objects.nonNull(programCompletedDate) ? programCompletedDate.toDate() : null); if (StringUtils.isNotBlank(stateUuid)) { Program.State state = new Program.State(); state.setUuid(stateUuid); ProgramEnrollment.StateStatus stateStatus = new ProgramEnrollment.StateStatus(); stateStatus.setState(state); stateStatus.setStartDate(startDate.toDate()); programEnrollment.setStates(Collections.singletonList(stateStatus)); } programEnrollmentService.updateProgramEnrollment(configName, programEnrollment); }
Source:
public Iterable<Image> listImages() { final ImmutableList.Builder<Image> images = ImmutableList.builder(); final List<String> availableLocationNames = newArrayList( transform(listLocations(), new Function<Region, String>() { @Override public String apply(Region location) { return location.id(); } })); for (String regionId : availableLocationNames) { images.addAll(api.imageApi().list(regionId).concat()); } return images.build(); }

Target:
public Iterable<ImageInRegion> listImages() { final ImmutableList.Builder<ImageInRegion> imagesInRegion = ImmutableList.builder(); for (final String regionId : getAvailableLocationNames()) { imagesInRegion.addAll(api.imageApi().list(regionId).concat() .transform(new Function<Image, ImageInRegion>() { @Override public ImageInRegion apply(Image image) { return ImageInRegion.create(regionId, image); } }) ); } return imagesInRegion.build(); }
Source:
public void checkRegularExecution() { System.setProperty("kie.maven.offline.force", "false"); final M2ServletContextListener listener = spy(new M2ServletContextListener()); final ServletContextEvent contextEvent = mock(ServletContextEvent.class); final ServletContext servletContext = mock(ServletContext.class); when(servletContext.getRealPath(any())).thenReturn("."); when(contextEvent.getServletContext()).thenReturn(servletContext); listener.contextInitialized(contextEvent); System.clearProperty("kie.maven.offline.force"); verify(listener, times(0)).deployJarsFromWar(any()); }

Target:
public void checkRegularExecution() { System.setProperty("kie.maven.offline.force", "false"); final M2ServletContextListener listener = spy(new M2ServletContextListener()); final ServletContextEvent contextEvent = mock(ServletContextEvent.class); final ServletContext servletContext = mock(ServletContext.class); when(servletContext.getRealPath(any())).thenReturn("."); when(contextEvent.getServletContext()).thenReturn(servletContext); listener.contextInitialized(contextEvent); verify(listener, times(0)).deployJarsFromWar(any()); }
Source:
public List<Comment> getComments(CoreSession session, String documentId) { DocumentModel commentedDoc = session.getDocument(new IdRef(documentId)); return getComments(commentedDoc).stream().map(commentModel -> { Comment comment = new CommentImpl(); comment.setAuthor((String) commentModel.getPropertyValue(COMMENT_AUTHOR)); comment.setText((String) commentModel.getPropertyValue(COMMENT_TEXT)); comment.setDocumentId(documentId); comment.setCreationDate((Instant) commentModel.getPropertyValue(COMMENT_CREATION_DATE)); return comment; }).collect(Collectors.toList()); }

Target:
public List<Comment> getComments(CoreSession session, String documentId) throws IllegalArgumentException { DocumentRef docRef = new IdRef(documentId); if (!session.exists(docRef)) { throw new IllegalArgumentException("The document " + documentId + " does not exist."); } DocumentModel commentedDoc = session.getDocument(new IdRef(documentId)); return getComments(commentedDoc).stream().map(commentModel -> { Comment comment = new CommentImpl(); comment.setAuthor((String) commentModel.getPropertyValue(COMMENT_AUTHOR)); comment.setText((String) commentModel.getPropertyValue(COMMENT_TEXT)); comment.setDocumentId(documentId); comment.setCreationDate((Instant) commentModel.getPropertyValue(COMMENT_CREATION_DATE)); return comment; }).collect(Collectors.toList()); }
Source:
public ServiceBusManagementClientBuilder endpoint(String endpoint) { try { new URL(endpoint); } catch (MalformedURLException ex) { throw logger.logExceptionAsWarning(new IllegalArgumentException("'endpoint' must be a valid URL")); } this.endpoint = endpoint; return this; }

Target:
public ServiceBusManagementClientBuilder endpoint(String endpoint) { final URL url; try { url = new URL(Objects.requireNonNull(endpoint, "'endpoint' cannot be null.")); } catch (MalformedURLException ex) { throw logger.logExceptionAsWarning(new IllegalArgumentException("'endpoint' must be a valid URL")); } this.endpoint = url.getHost(); return this; }
Source:
public EventType mapRow(ResultSet rs, int rowNum) throws SQLException { try { return jsonMapper.readValue(rs.getString(2), EventType.class); } catch (IOException e) { return null; } }

Target:
public EventType mapRow(ResultSet rs, int rowNum) throws SQLException { try { return jsonMapper.readValue(rs.getString("et_event_type_object"), EventType.class); } catch (IOException e) { throw new SQLException(e); } }
Source:
public void clientConfiguredForDomain() throws IOException { System.out.println("==================================="); ManagementClient.online(OnlineOptions.domain().build() .localDefault() .protocol(ManagementProtocol.HTTPS) .ssl(sslOptions) .auth(USERNAME, PASSWORD) .connectionTimeout(5000) .build() ); }

Target:
public void clientConfiguredForDomain() throws IOException { ManagementClient.online(OnlineOptions.domain().build() .localDefault() .protocol(ManagementProtocol.HTTPS) .ssl(sslOptions) .auth(USERNAME, PASSWORD) .connectionTimeout(5000) .build() ); }
Source:
public ResourceAlreadyExistsException(String resourceName, String resourceId) { super(format("%s resource with id \'%s\' already exists.", resourceName, resourceId)); }

Target:
public ResourceAlreadyExistsException(String resourceName, String resourceId) { super(format("%s resource with id '%s' already exists.", resourceName, resourceId)); }
Source:
private String setupMountPoint(String parent) { String mountPoint = null; for (int i = 0; i < 10; i++) { String mntPt = parent + File.separator + String.valueOf(ManagementServerNode.getManagementServerId()) + "." + Integer.toHexString(rand.nextInt(Integer.MAX_VALUE)); File file = new File(mntPt); if (!file.exists()) { if (storage.mkdir(mntPt)) { mountPoint = mntPt; break; } } s_logger.error("Unable to create mount: " + mntPt); } return mountPoint; }

Target:
private String setupMountPoint(String parent) { String mountPoint = null; String mntPt = parent + File.separator + String.valueOf(ManagementServerNode.getManagementServerId()) + "." + Integer.toHexString(rand.nextInt(Integer.MAX_VALUE)); for (int i = 0; i < 10; i++) { File file = new File(mntPt); if (!file.exists()) { if (storage.mkdir(mntPt)) { mountPoint = mntPt; break; } } } if (mountPoint == null){ s_logger.error("Unable to create mount: " + mntPt); } return mountPoint; }
Source:
public static LocalDate deserializeLocalDate(String dateTimeString) throws IOException { return deserializeLocalDateTime(dateTimeString).toLocalDate(); }

Target:
public static LocalDate deserializeLocalDate(String dateTimeString) throws IOException { return DATE_FORMATTER.parse(dateTimeString, LocalDate::from); }
Source:
public String getLongAccessLabel() { String label = ""; if(isSiteOnly()) { checkParent(); if(this.parent == null) { label = trb.getString("access.site.noparent"); logger.warn("ListItem.getLongAccessLabel(): Unable to display label because isSiteOnly == true and parent == null and constructor == " + this.constructor); } else { label = trb.getFormattedMessage("access.site.nochoice", new String[]{parent.getName()}); } } else if(isGroupInherited()) { label = getMultiGroupLabel(); } else if(inheritsRoles()) { checkParent(); if(parent == null) { Iterator<String> roleIterator = this.inheritedRoleIds.iterator(); label = trb.getString(String.format(String.format("access.role%s.noparent", roleIterator.next()))); while(roleIterator.hasNext()) { label += "<br/>" + trb.getString(String.format(String.format("access.role%s.noparent", roleIterator.next()))); } logger.warn("ListItem.getLongAccessLabel(): Unable to display label because isPubviewInherited == true and parent == null and constructor == " + this.constructor); } else { Iterator<String> roleIterator = this.inheritedRoleIds.iterator(); label = trb.getFormattedMessage(String.format("access.role%s.nochoice", roleIterator.next()), new String[]{parent.getName()}); while(roleIterator.hasNext()) { label += "<br/>" + trb.getFormattedMessage(String.format("access.role%s.nochoice", roleIterator.next()), new String[]{parent.getName()}); } } } else if(isCollection()) { label = trb.getString("edit.who.fldr"); } else { label = trb.getString("edit.who"); } return label; }

Target:
public String getLongAccessLabel() { String label = ""; if(isSiteOnly()) { checkParent(); if(this.parent == null) { label = trb.getString("access.site.noparent"); logger.warn("ListItem.getLongAccessLabel(): Unable to display label because isSiteOnly == true and parent == null and constructor == " + this.constructor); } else { label = trb.getFormattedMessage("access.site.nochoice", new String[]{parent.getName()}); } } else if(isGroupInherited()) { label = getMultiGroupLabel(); } else if(inheritsRoles()) { checkParent(); if(parent == null) { Iterator<String> roleIterator = this.inheritedRoleIds.iterator(); label = trb.getString(String.format("access.role%s.noparent", roleIterator.next())); while(roleIterator.hasNext()) { label += "<br/>" + trb.getString(String.format("access.role%s.noparent", roleIterator.next())); } logger.warn("ListItem.getLongAccessLabel(): Unable to display label because isPubviewInherited == true and parent == null and constructor == " + this.constructor); } else { Iterator<String> roleIterator = this.inheritedRoleIds.iterator(); label = trb.getFormattedMessage(String.format("access.role%s.nochoice", roleIterator.next()), new String[]{parent.getName()}); while(roleIterator.hasNext()) { label += "<br/>" + trb.getFormattedMessage(String.format("access.role%s.nochoice", roleIterator.next()), new String[]{parent.getName()}); } } } else if(isCollection()) { label = trb.getString("edit.who.fldr"); } else { label = trb.getString("edit.who"); } return label; }
Source:
public void conditionalReplaceAll(String originator, TaskId taskid, String channel, String predicate, String thenRemappingFunction, String elseRemappingFunction) throws InvalidChannelException, CompilationException, IOException { String currentKey = null; try { Channel chosenChannel = getChannel(channel); for (Map.Entry<String, Serializable> entry : chosenChannel.entrySet()) { currentKey = entry.getKey(); Serializable value = chosenChannel.get(currentKey); if (evaluateClosure(predicate, BiPredicate.class).test(currentKey, value)) { Serializable answer = chosenChannel.compute(currentKey, (BiFunction<? super String, ? super Serializable, ? extends Serializable>) evaluateClosure(thenRemappingFunction, BiFunction.class)); logWithContext(taskid, channel, "Run conditionalReplaceAll(Then)" + ON_KEY + QUOTE + currentKey + QUOTE + RESULT_IS + answer, Level.DEBUG); } else { Serializable answer = chosenChannel.compute(currentKey, (BiFunction<? super String, ? super Serializable, ? extends Serializable>) evaluateClosure(elseRemappingFunction, BiFunction.class)); logWithContext(taskid, channel, "Run conditionalReplaceAll(Else)" + ON_KEY + QUOTE + currentKey + QUOTE + RESULT_IS + answer, Level.DEBUG); } } commitIfNeeded(channel); } catch (InvalidChannelException | CompilationException | IOException e) { throw e; } catch (Exception e) { throw new ClosureEvaluationException(EXCEPTION_WHEN_EVALUATING_CLOSURE + StackTraceUtil.getStackTrace(e)); } }

Target:
public void conditionalReplaceAll(String originator, TaskId taskid, String channel, String predicate, String thenRemappingFunction, String elseRemappingFunction) throws InvalidChannelException, CompilationException, IOException { String currentKey; try { Channel chosenChannel = getChannel(channel); for (Map.Entry<String, Serializable> entry : chosenChannel.entrySet()) { currentKey = entry.getKey(); if (evaluateClosure(predicate, BiPredicate.class).test(currentKey, entry.getValue())) { chosenChannel.compute(currentKey, (BiFunction<? super String, ? super Serializable, ? extends Serializable>) evaluateClosure(thenRemappingFunction, BiFunction.class)); } else { chosenChannel.compute(currentKey, (BiFunction<? super String, ? super Serializable, ? extends Serializable>) evaluateClosure(elseRemappingFunction, BiFunction.class)); } } logWithContextAndPersist(taskid, channel, "Run conditionalReplaceAll, new content is: " + chosenChannel, Level.DEBUG); } catch (InvalidChannelException | CompilationException | IOException e) { throw e; } catch (Exception e) { throw new ClosureEvaluationException(EXCEPTION_WHEN_EVALUATING_CLOSURE + StackTraceUtil.getStackTrace(e)); } }
Source:
public void setup() throws Exception { DynamicSequentialTask<Object> t = new DynamicSequentialTask<Object>(); DynamicTasks.setTaskQueueingContext(t); app = ApplicationBuilder.newManagedApp(TestApplication.class); mgmt = app.getManagementContext(); LocalhostMachineProvisioningLocation localhost = mgmt.getLocationManager().createLocation( LocationSpec.create(LocalhostMachineProvisioningLocation.class)); host = localhost.obtain(); app.start(Arrays.asList(host)); }

Target:
public void setup() throws Exception { app = ApplicationBuilder.newManagedApp(TestApplication.class); mgmt = app.getManagementContext(); LocalhostMachineProvisioningLocation localhost = mgmt.getLocationManager().createLocation( LocationSpec.create(LocalhostMachineProvisioningLocation.class)); host = localhost.obtain(); app.start(Arrays.asList(host)); }
Source:
public MetacardApplication( CatalogFramework catalogFramework, FilterBuilder filterBuilder, EndpointUtil endpointUtil, Validator validator, WorkspaceTransformer transformer, ExperimentalEnumerationExtractor enumExtractor, SubscriptionsPersistentStore subscriptions, List<MetacardType> types, Associated associated, QueryResponseTransformer csvQueryResponseTransformer, AttributeRegistry attributeRegistry, ConfigurationApplication configuration, NoteUtil noteUtil, SubjectIdentity subjectIdentity, AccessControlSecurityConfiguration accessControlSecurityConfiguration) { this.catalogFramework = catalogFramework; this.filterBuilder = filterBuilder; this.util = endpointUtil; this.validator = validator; this.transformer = transformer; this.enumExtractor = enumExtractor; this.subscriptions = subscriptions; this.types = types; this.associated = associated; this.csvQueryResponseTransformer = csvQueryResponseTransformer; this.attributeRegistry = attributeRegistry; this.configuration = configuration; this.noteUtil = noteUtil; this.subjectIdentity = subjectIdentity; this.systemUserList.addAll( Arrays.asList(accessControlSecurityConfiguration.getSystemUserAttributeValue().split(","))); }

Target:
public MetacardApplication( CatalogFramework catalogFramework, FilterBuilder filterBuilder, EndpointUtil endpointUtil, Validator validator, WorkspaceTransformer transformer, ExperimentalEnumerationExtractor enumExtractor, SubscriptionsPersistentStore subscriptions, List<MetacardType> types, Associated associated, QueryResponseTransformer csvQueryResponseTransformer, AttributeRegistry attributeRegistry, ConfigurationApplication configuration, NoteUtil noteUtil, SubjectIdentity subjectIdentity, AccessControlSecurityConfiguration accessControlSecurityConfiguration) { this.catalogFramework = catalogFramework; this.filterBuilder = filterBuilder; this.util = endpointUtil; this.validator = validator; this.transformer = transformer; this.enumExtractor = enumExtractor; this.subscriptions = subscriptions; this.types = types; this.associated = associated; this.csvQueryResponseTransformer = csvQueryResponseTransformer; this.attributeRegistry = attributeRegistry; this.configuration = configuration; this.noteUtil = noteUtil; this.subjectIdentity = subjectIdentity; this.accessControlSecurityConfiguration = accessControlSecurityConfiguration; }
Source:
private int firstIndexOf(int fromIndex, int toIndex, byte value) { fromIndex = Math.max(fromIndex, 0); if (fromIndex >= toIndex || capacity() == 0) { return -1; } for (int i = fromIndex; i < toIndex; i ++) { if (_getByte(i) == value) { return i; } } return -1; }

Target:
private int firstIndexOf(int fromIndex, int toIndex, byte value) { fromIndex = Math.max(fromIndex, 0); if (fromIndex >= toIndex || capacity() == 0) { return -1; } checkIndex(fromIndex, toIndex - fromIndex); for (int i = fromIndex; i < toIndex; i ++) { if (_getByte(i) == value) { return i; } } return -1; }
Source:
public void close() { fBitBuffer = BitBuffer.EMPTY_BITBUFFER; }

Target:
public void close() { fBitBuffer = null; }
Source:
public boolean shouldRun() { final boolean shouldRun = pendingPartitions.size() > 0; return shouldRun; }

Target:
public boolean shouldRun() { synchronized (pendingPartitions) { final boolean shouldRun = pendingPartitions.size() > 0; return shouldRun; } }
Source:
public void initiate() { for (int i = 0; i < currentEnsemble.size(); i++) { lh.bk.getBookieClient().readLac(currentEnsemble.get(i), lh.ledgerId, this, i); } }

Target:
public void initiate() { for (int i = 0; i < currentEnsemble.size(); i++) { bookieClient.readLac(currentEnsemble.get(i), lh.ledgerId, this, i); } }
Source:
public CreateWsResponse create(CreateRequest request) { return call( new PostRequest(path("create")) .setParam("email", request.getEmail()) .setParam("local", request.getLocal()) .setParam("login", request.getLogin()) .setParam("name", request.getName()) .setParam("password", request.getPassword()) .setParam("scmAccount", request.getScmAccount() == null ? null : request.getScmAccount()) .setParam("scmAccounts", request.getScmAccounts() == null ? null : request.getScmAccounts().stream().collect(Collectors.joining(","))), CreateWsResponse.parser()); }

Target:
public CreateWsResponse create(CreateRequest request) { return call( new PostRequest(path("create")) .setParam("email", request.getEmail()) .setParam("local", request.getLocal()) .setParam("login", request.getLogin()) .setParam("name", request.getName()) .setParam("password", request.getPassword()) .setParam("scmAccount", request.getScmAccount()) .setParam("scmAccounts", request.getScmAccounts() == null ? null : request.getScmAccounts().stream().collect(Collectors.joining(","))), CreateWsResponse.parser()); }
Source:
public void testVersion0_98IsValid() throws Exception{ rootDir = Paths.get(getClass().getClassLoader().getResource("bags/v0_98/bag").toURI()); if (System.getProperty("os.name").contains("Windows")){ Path bagitDir = rootDir.resolve(".bagit"); Files.setAttribute(bagitDir, "dos:hidden", Boolean.TRUE); } Bag bag = reader.read(rootDir); sut.isValid(bag, true); }

Target:
public void testVersion0_98IsValid() throws Exception{ rootDir = Paths.get(getClass().getClassLoader().getResource("bags/v0_98/bag").toURI()); Bag bag = reader.read(rootDir); sut.isValid(bag, true); }
Source:
protected void checkFile(@NotNull final GoFile file, @NotNull ProblemsHolder problemsHolder) { if (!GoTestFinder.isTestFile(file)) return; GoImportSpec testingImportSpec = file.getImportedPackagesMap().get(GoConstants.TESTING_PATH); String testingAlias = getTestingAlias(testingImportSpec); for (GoFunctionDeclaration function : file.getFunctions()) { GoTestFunctionType type = GoTestFunctionType.fromName(function.getName()); if (type == null) continue; GoSignature signature = function.getSignature(); if (signature == null) continue; List<GoParameterDeclaration> params = signature.getParameters().getParameterDeclarationList(); if (type == GoTestFunctionType.EXAMPLE) { if (params.size() != 0) { problemsHolder.registerProblem(function.getIdentifier(), "Wrong example signature", new GoTestSignaturesQuickFix(type)); } } else { GoParameterDeclaration param = ContainerUtil.getFirstItem(params); if (params.size() != 1 || param == null || testingImportSpec == null || !param.getType().textMatches(getProperParamType(testingAlias, type))) { problemsHolder.registerProblem(function.getIdentifier(), "Wrong test signature", new GoTestSignaturesQuickFix(type)); } } } }

Target:
protected void checkFile(@NotNull final GoFile file, @NotNull ProblemsHolder problemsHolder) { if (!GoTestFinder.isTestFile(file)) return; GoImportSpec testingImportSpec = file.getImportedPackagesMap().get(GoConstants.TESTING_PATH); String testingAlias = getTestingAlias(testingImportSpec); for (GoFunctionDeclaration function : file.getFunctions()) { GoTestFunctionType type = GoTestFunctionType.fromName(function.getName()); if (type == null) continue; GoSignature signature = function.getSignature(); if (signature == null) continue; List<GoParameterDeclaration> params = signature.getParameters().getParameterDeclarationList(); if (type == GoTestFunctionType.EXAMPLE) { if (!params.isEmpty()) { problemsHolder.registerProblem(function.getIdentifier(), "Wrong example signature", new GoTestSignaturesQuickFix(type)); } } else { GoParameterDeclaration param = ContainerUtil.getFirstItem(params); if (params.size() != 1 || param == null || testingImportSpec == null || !param.getType().textMatches(getProperParamType(testingAlias, type))) { problemsHolder.registerProblem(function.getIdentifier(), "Wrong test signature", new GoTestSignaturesQuickFix(type)); } } } }
Source:
public void run() { long threadId = Thread.currentThread().getId(); if (webDriver != null) { log.info("Close webdriver: -> {}", threadId, webDriver); if (selenideProxyServer != null) { log.info("Close proxy server: -> {}", threadId, selenideProxyServer); } long start = System.currentTimeMillis(); Thread t = new Thread(new CloseBrowser(webDriver, selenideProxyServer)); t.setDaemon(true); t.start(); try { t.join(); } catch (InterruptedException e) { long duration = System.currentTimeMillis() - start; log.debug("Failed to close webdriver " + threadId + " in " + duration + " ms", e); Thread.currentThread().interrupt(); } long duration = System.currentTimeMillis() - start; log.info("Closed webdriver in ms", threadId, duration); } else if (selenideProxyServer != null) { log.info("Close proxy server: -> {}", threadId, selenideProxyServer); selenideProxyServer.shutdown(); } }

Target:
public void run() { long threadId = Thread.currentThread().getId(); if (webDriver != null) { log.info("Close webdriver: -> {}", threadId, webDriver); if (selenideProxyServer != null) { log.info("Close proxy server: -> {}", threadId, selenideProxyServer); } long start = System.currentTimeMillis(); Thread t = new Thread(new CloseBrowser(webDriver, selenideProxyServer)); t.setDaemon(true); t.start(); try { t.join(); } catch (InterruptedException e) { long duration = System.currentTimeMillis() - start; log.debug("Failed to close webdriver in ms", threadId, duration, e); Thread.currentThread().interrupt(); } long duration = System.currentTimeMillis() - start; log.info("Closed webdriver in ms", threadId, duration); } else if (selenideProxyServer != null) { log.info("Close proxy server: -> {}", threadId, selenideProxyServer); selenideProxyServer.shutdown(); } }
Source:
public static Collection<DiskInterface> getDiskHotpluggableInterfaces(Integer osId, Version version) { Pair<Integer, Version> pair = new Pair<Integer, Version>(osId, version); if (getDiskHotpluggableInterfacesMap().containsKey(pair)) { List<String> diskHotpluggableInterfaces = getDiskHotpluggableInterfacesMap().get(pair); Collection<DiskInterface> diskInterfaces = new HashSet<DiskInterface>(); for (String diskHotpluggableInterface : diskHotpluggableInterfaces) { diskInterfaces.add(DiskInterface.valueOf(diskHotpluggableInterface)); } return diskInterfaces; } return Collections.emptyList(); }

Target:
public static Collection<DiskInterface> getDiskHotpluggableInterfaces(Integer osId, Version version) { List<String> diskHotpluggableInterfaces = getDiskHotpluggableInterfacesMap() .get(new Pair<Integer, Version>(osId, version)); if (diskHotpluggableInterfaces == null) { return Collections.emptyList(); } Collection<DiskInterface> diskInterfaces = new HashSet<DiskInterface>(); for (String diskHotpluggableInterface : diskHotpluggableInterfaces) { diskInterfaces.add(DiskInterface.valueOf(diskHotpluggableInterface)); } return diskInterfaces; }
Source:
private void sendDeleteEvent (final Contentlet contentlet) throws DotHibernateException { HibernateUtil.addAsyncCommitListener( () -> { this.isInodeIndexed(contentlet.getInode()); this.contentletSystemEventUtil.pushDeleteEvent(contentlet); }, 1000); }

Target:
private void sendDeleteEvent (final Contentlet contentlet) throws DotHibernateException { HibernateUtil.addAsyncCommitListener( () -> { this.contentletSystemEventUtil.pushDeleteEvent(contentlet); }, 1000); }
Source:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem item = menu.add(Menu.NONE, MENU_SORT_ID, Menu.FIRST, "Clear completed"); item.setIcon(android.R.drawable.ic_input_delete); return true; }

Target:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem item = menu.add(Menu.NONE, MENU_CLEAR_COMPLETED_ID, Menu.FIRST, this.getString(R.string.gtasks_GTA_clear_completed)); item.setIcon(android.R.drawable.ic_input_delete); return true; }
Source:
public void testProject() { TableScanNode tableScan = tableScan("ts", "orderkey"); PlanNode project = project("project", tableScan, "string", new Cast(new SymbolReference("orderkey"), "STRING")); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of("ts", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of( "project", statsEstimate(project, 4000), "ts", statsEstimate(tableScan, 1000)); Map<String, Type> types = ImmutableMap.of( "orderkey", BIGINT, "string", VARCHAR); assertCost(project, costs, stats, types) .cpu(1000 + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostEstimatedExchanges(project, costs, stats, types) .cpu(1000 + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostFragmentedPlan(project, costs, stats, types) .cpu(1000 * IS_NULL_OVERHEAD + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostHasUnknownComponentsForUnknownStats(project, types); }

Target:
public void testProject() { TableScanNode tableScan = tableScan("ts", "orderkey"); PlanNode project = project("project", tableScan, "string", new Cast(new SymbolReference("orderkey"), "STRING")); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of("ts", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of( "project", statsEstimate(project, 4000), "ts", statsEstimate(tableScan, 1000)); Map<String, Type> types = ImmutableMap.of( "orderkey", BIGINT, "string", VARCHAR); assertCost(project, costs, stats, types) .cpu(1000 + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostEstimatedExchanges(project, costs, stats, types) .cpu(1000 + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostFragmentedPlan(project, costs, stats, types) .cpu(1000 + 4000 * OFFSET_AND_IS_NULL_OVERHEAD) .memory(0) .network(0); assertCostHasUnknownComponentsForUnknownStats(project, types); }
Source:
public void testNoZipFileDumpedWhenTransformFails() throws Exception { MetacardTransformer transformer = mock(MetacardTransformer.class); when(transformer.transform(any(), any())).thenThrow(CatalogTransformerException.class); QueryResponseTransformer zipCompressionMock = mock(QueryResponseTransformer.class); when(zipCompressionMock.transform(any(), any())).thenThrow(CatalogTransformerException.class); List<MetacardTransformer> transformers = new ArrayList<>(); transformers.add(transformer); List<Result> resultList = getResultList("id1", "id2"); MetacardImpl metacard1 = new MetacardImpl(resultList.get(0).getMetacard()); MetacardImpl metacard2 = new MetacardImpl(resultList.get(1).getMetacard()); metacard1.setResourceURI(new URI("content:" + metacard1.getId())); metacard2.setResourceURI(new URI("content:" + metacard2.getId() + "#preview")); TestDumpCommand dumpCommand = new TestDumpCommand(transformers, zipCompressionMock); dumpCommand.catalogFramework = givenCatalogFramework(resultList); dumpCommand.filterBuilder = new GeotoolsFilterBuilder(); File outputDirectory = testFolder.newFolder("somedirectory"); String outputDirectoryPath = outputDirectory.getAbsolutePath(); dumpCommand.dirPath = outputDirectoryPath; dumpCommand.transformerId = "someOtherTransformer"; Path zipfilePath = Paths.get(outputDirectoryPath.toString(), "foo.zip"); dumpCommand.zipFileName = zipfilePath.toString(); dumpCommand.executeWithSubject(); assertThat(consoleOutput.getOutput(), containsString(" 0 file(s) dumped in ")); assertThat(zipfilePath.toFile().exists(), is(false)); }

Target:
public void testNoZipFileDumpedWhenTransformFails() throws Exception { MetacardTransformer transformer = mock(MetacardTransformer.class); when(transformer.transform(any(), any())).thenThrow(CatalogTransformerException.class); QueryResponseTransformer zipCompressionMock = mock(QueryResponseTransformer.class); when(zipCompressionMock.transform(any(), any())).thenThrow(CatalogTransformerException.class); List<MetacardTransformer> transformers = new ArrayList<>(); transformers.add(transformer); List<Result> resultList = getResultList("id1", "id2"); MetacardImpl metacard1 = new MetacardImpl(resultList.get(0).getMetacard()); MetacardImpl metacard2 = new MetacardImpl(resultList.get(1).getMetacard()); metacard1.setResourceURI(new URI("content:" + metacard1.getId())); metacard2.setResourceURI(new URI("content:" + metacard2.getId() + "#preview")); TestDumpCommand dumpCommand = new TestDumpCommand(transformers, zipCompressionMock); dumpCommand.catalogFramework = givenCatalogFramework(resultList); dumpCommand.filterBuilder = new GeotoolsFilterBuilder(); File outputDirectory = testFolder.newFolder("somedirectory"); String outputDirectoryPath = outputDirectory.getAbsolutePath(); dumpCommand.dirPath = outputDirectoryPath; dumpCommand.transformerId = "someOtherTransformer"; Path zipfilePath = Paths.get(outputDirectoryPath, "foo.zip"); dumpCommand.zipFileName = zipfilePath.toString(); dumpCommand.executeWithSubject(); assertThat(consoleOutput.getOutput(), containsString(" 0 file(s) dumped in ")); assertThat(zipfilePath.toFile().exists(), is(false)); }
Source:
public AllocateTableWriteIdsResponse allocate_table_write_ids( AllocateTableWriteIdsRequest rqst) throws TException { AllocateTableWriteIdsResponse response = getTxnHandler().allocateTableWriteIds(rqst); if (listeners != null && !listeners.isEmpty()) { MetaStoreListenerNotifier.notifyTxnEvent(listeners, EventType.ALLOC_WRITE_ID, new AllocWriteIdEvent(rqst.getTxnIds(), rqst.getTableName(), this), null, null); } return response; }

Target:
public AllocateTableWriteIdsResponse allocate_table_write_ids( AllocateTableWriteIdsRequest rqst) throws TException { AllocateTableWriteIdsResponse response = getTxnHandler().allocateTableWriteIds(rqst); if (listeners != null && !listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALLOC_WRITE_ID, new AllocWriteIdEvent(response.getTxnToWriteIds(), rqst.getDbName(), rqst.getTableName(), this)); } return response; }
Source:
private List<Event> getDownloadedEvents() { List<Event> downloadedEvents = new ArrayList<>(); List<Event> downloadedEventsWithoutValues = eventStore.querySingleEvents(); TrackedEntityDataValueStore trackedEntityDataValueStore = TrackedEntityDataValueStoreImpl.create(databaseAdapter()); for (Long i = 0L; i < downloadedEventsWithoutValues.size(); ++i) { Event event = downloadedEventsWithoutValues.get(i.intValue()); List<TrackedEntityDataValue> trackedEntityDataValues = trackedEntityDataValueStore.queryTrackedEntityDataValuesByEventUid(event.uid()); List<TrackedEntityDataValue> trackedEntityDataValuesWithNullIdsAndEvents = new ArrayList<>(); for (TrackedEntityDataValue trackedEntityDataValue : trackedEntityDataValues) { trackedEntityDataValuesWithNullIdsAndEvents.add( trackedEntityDataValue.toBuilder().id(null).event(null).build()); } downloadedEvents.add(event.toBuilder() .id(null) .deleted(false) .trackedEntityDataValues(trackedEntityDataValuesWithNullIdsAndEvents).build()); } return downloadedEvents; }

Target:
private List<Event> getDownloadedEvents() { List<Event> downloadedEvents = new ArrayList<>(); List<Event> downloadedEventsWithoutValues = eventStore.querySingleEvents(); TrackedEntityDataValueStore trackedEntityDataValueStore = TrackedEntityDataValueStoreImpl.create(databaseAdapter()); for (int i = 0; i < downloadedEventsWithoutValues.size(); ++i) { Event event = downloadedEventsWithoutValues.get(i); List<TrackedEntityDataValue> trackedEntityDataValues = trackedEntityDataValueStore.queryTrackedEntityDataValuesByEventUid(event.uid()); List<TrackedEntityDataValue> trackedEntityDataValuesWithNullIdsAndEvents = new ArrayList<>(); for (TrackedEntityDataValue trackedEntityDataValue : trackedEntityDataValues) { trackedEntityDataValuesWithNullIdsAndEvents.add( trackedEntityDataValue.toBuilder().id(null).event(null).build()); } downloadedEvents.add(event.toBuilder() .id(null) .deleted(false) .trackedEntityDataValues(trackedEntityDataValuesWithNullIdsAndEvents).build()); } return downloadedEvents; }
Source:
public Map<String, SystemAdmin> getSystemAdmins(String adminLabel) { return getSystemFactories().entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue() .getAdmin(systemNameToFactoryEntry.getKey(), this, adminLabel))); }

Target:
public Map<String, SystemAdmin> getSystemAdmins(String adminLabel) { if (systemAdminMap.isEmpty()) { systemAdminMap = getSystemFactories().entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue() .getAdmin(systemNameToFactoryEntry.getKey(), this, adminLabel))); } return systemAdminMap; }
Source:
public static boolean vmDeviceChanged(Guid vmId, VmDeviceGeneralType deviceType, boolean deviceEnabled) { List<VmDevice> vmDevices = dao.getVmDeviceByVmIdAndType(vmId, deviceType); return deviceEnabled == vmDevices.isEmpty(); }

Target:
public static boolean vmDeviceChanged(Guid vmId, VmDeviceGeneralType deviceType, boolean deviceEnabled) { return vmDeviceChanged(vmId, null, deviceEnabled); }
Source:
private SpanContext startSpanOptions(SpanContext parentContext, String name, Timestamp timestamp, SpanKind spanKind, Boolean enableTrace, Boolean enableStackTrace) { if (timestamp == null) { timestamp = timestampFactory.now(); } if (spanKind == null) { spanKind = SpanKind.UNSPECIFIED; } if (enableTrace != null || enableStackTrace != null) { TraceOptions options = parentContext.getTraceOptions(); if (enableTrace) { options = options.overrideTraceEnabled(enableTrace); } if (enableStackTrace) { options = options.overrideStackTraceEnabled(enableStackTrace); } parentContext = parentContext.overrideOptions(options); } SpanContext context = spanContextFactory.childContext(parentContext); for (TraceSink sink : sinks) { sink.startSpan(context, parentContext, spanKind, name, timestamp); } return context; }

Target:
private SpanContext startSpanOptions(SpanContext parentContext, String name, Timestamp timestamp, SpanKind spanKind, Boolean enableTrace, Boolean enableStackTrace) { if (timestamp == null) { timestamp = timestampFactory.now(); } if (spanKind == null) { spanKind = SpanKind.UNSPECIFIED; } if (enableTrace != null || enableStackTrace != null) { TraceOptions options = parentContext.getTraceOptions(); if (enableTrace != null) { options = options.overrideTraceEnabled(enableTrace); } if (enableStackTrace != null) { options = options.overrideStackTraceEnabled(enableStackTrace); } parentContext = parentContext.overrideOptions(options); } SpanContext context = spanContextFactory.childContext(parentContext); for (TraceSink sink : sinks) { sink.startSpan(context, parentContext, spanKind, name, timestamp); } return context; }
Source:
private void initZoomToolBar() { ZoomToolbar toolbar = new ZoomToolbar(MAXZOOM); wrapper.setRight(toolbar.getToolBar()); toolbar.getZoomlevel().addListener((observeVal, oldVal, newVal) -> { int diffLevel = oldVal.intValue() - newVal.intValue(); zoomLevel = Math.abs(newVal.intValue()); if (diffLevel < 0) { zoom(Math.pow(ZOOMOUTFACTOR, diffLevel * -1)); } else if (diffLevel > 0) { zoom(Math.pow(ZOOMINFACTOR, diffLevel)); } }); }

Target:
private void initZoomToolBar() { Zoombar toolbar = new Zoombar(MAXZOOM); wrapper.setRight(toolbar.getToolBar()); toolbar.getZoomlevel().addListener((observeVal, oldVal, newVal) -> { int diffLevel = oldVal.intValue() - newVal.intValue(); zoomLevel = Math.abs(newVal.intValue()); if (diffLevel < 0) { zoomGraph(Math.pow(ZOOM_OUT_FACTOR, diffLevel * -1)); } else if (diffLevel > 0) { zoomGraph(Math.pow(ZOOM_IN_FACTOR, diffLevel)); } }); }
Source:
public void listPagedIterableCollectionQueuesFail() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(new MockResponse().setBody(accessRackspace)); server.enqueue(new MockResponse().setResponseCode(404).setBody("")); try { MarconiApi api = api(server.getUrl("/").toString(), "openstack-marconi"); QueueApi queueApi = api.getQueueApiForZoneAndClient("DFW", CLIENT_ID); Queues queues = queueApi.list(ListQueuesOptions.NONE); assertEquals(queues.size(), 0); } finally { server.shutdown(); } }

Target:
public void listPagedIterableCollectionQueuesFail() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(new MockResponse().setBody(accessRackspace)); server.enqueue(new MockResponse().setResponseCode(404)); try { MarconiApi api = api(server.getUrl("/").toString(), "openstack-marconi"); QueueApi queueApi = api.getQueueApiForZoneAndClient("DFW", CLIENT_ID); Queues queues = queueApi.list(ListQueuesOptions.NONE); assertTrue(queues.isEmpty(), "Expecting empty queues but was " + queues.toString()); } finally { server.shutdown(); } }
Source:
public void should_remove_invalid_contact_point() { InetSocketAddress wrongContactPoint = unusedAddress(); Iterator<InetSocketAddress> contactPoints = simulacron.getContactPoints().iterator(); InetSocketAddress address1 = contactPoints.next(); InetSocketAddress address2 = contactPoints.next(); NodeStateListener localNodeStateListener = Mockito.mock(NodeStateListener.class); try (Cluster localCluster = Cluster.builder() .addContactPoint(address1) .addContactPoint(wrongContactPoint) .addNodeStateListeners(localNodeStateListener) .withConfigLoader( new TestConfigLoader( "connection.reconnection-policy.base-delay = 1 hour", "connection.reconnection-policy.max-delay = 1 hour")) .build()) { Map<InetSocketAddress, Node> nodes = localCluster.getMetadata().getNodes(); assertThat(nodes).doesNotContainKey(wrongContactPoint); Node localMetadataNode1 = nodes.get(address1); Node localMetadataNode2 = nodes.get(address2); Mockito.verify(localNodeStateListener, timeout(100)) .onRemove(new DefaultNode(wrongContactPoint)); Mockito.verify(localNodeStateListener, timeout(100)).onUp(localMetadataNode1); Mockito.verify(localNodeStateListener, timeout(100)).onAdd(localMetadataNode2); } }

Target:
public void should_remove_invalid_contact_point() { InetSocketAddress wrongContactPoint = unusedAddress(); Iterator<InetSocketAddress> contactPoints = simulacron.getContactPoints().iterator(); InetSocketAddress address1 = contactPoints.next(); InetSocketAddress address2 = contactPoints.next(); NodeStateListener localNodeStateListener = Mockito.mock(NodeStateListener.class); try (Cluster<CqlSession> localCluster = Cluster.builder() .addContactPoint(address1) .addContactPoint(wrongContactPoint) .addNodeStateListeners(localNodeStateListener) .withConfigLoader( new TestConfigLoader( "connection.reconnection-policy.base-delay = 1 hour", "connection.reconnection-policy.max-delay = 1 hour")) .build()) { Map<InetSocketAddress, Node> nodes = localCluster.getMetadata().getNodes(); assertThat(nodes).doesNotContainKey(wrongContactPoint); Node localMetadataNode1 = nodes.get(address1); Node localMetadataNode2 = nodes.get(address2); Mockito.verify(localNodeStateListener, timeout(100)) .onRemove(new DefaultNode(wrongContactPoint)); Mockito.verify(localNodeStateListener, timeout(100)).onUp(localMetadataNode1); Mockito.verify(localNodeStateListener, timeout(100)).onAdd(localMetadataNode2); } }
Source:
protected void onDestroy() { super.onDestroy(); }

Target:
protected void onDestroy() { EMMessage message = EMChatManager.getInstance().getMessage(msgId); if(message != null){ removeMessage(); } super.onDestroy(); }