auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void applyChanges(Library target, Library source) throws IOException { target.setDescription(source.getDescription()); target.setIdentificationBarcode(source.getIdentificationBarcode()); target.setLocationBarcode(source.getLocationBarcode()); target.setInitialConcentration(source.getInitialConcentration()); target.setPlatformName(source.getPlatformName()); target.setAlias(source.getAlias()); target.setPaired(source.getPaired()); target.setLowQuality(source.isLowQuality()); target.setDiscarded(source.isDiscarded()); if (target.isDiscarded()) { target.setVolume(0.0); } else { target.setVolume(source.getVolume()); } target.setQcPassed(source.getQcPassed()); if (isDetailedLibrary(target)) { DetailedLibrary dSource = (DetailedLibrary) source; DetailedLibrary dTarget = (DetailedLibrary) target; dTarget.setPreMigrationId(dSource.getPreMigrationId()); dTarget.setNonStandardAlias(dSource.hasNonStandardAlias()); dTarget.setArchived(dSource.getArchived()); } }

Target:
private void applyChanges(Library target, Library source) throws IOException { target.setDescription(source.getDescription()); target.setIdentificationBarcode(source.getIdentificationBarcode()); target.setLocationBarcode(source.getLocationBarcode()); target.setInitialConcentration(source.getInitialConcentration()); target.setPlatformName(source.getPlatformName()); target.setAlias(source.getAlias()); target.setPaired(source.getPaired()); target.setLowQuality(source.isLowQuality()); target.setDiscarded(source.isDiscarded()); if (target.isDiscarded()) { target.setVolume(0.0); } else { target.setVolume(source.getVolume()); } target.getLibraryType().setId(source.getLibraryType().getId()); target.getLibrarySelectionType().setId(source.getLibrarySelectionType().getId()); target.getLibraryStrategyType().setId(source.getLibraryStrategyType().getId()); target.setQcPassed(source.getQcPassed()); if (isDetailedLibrary(target)) { DetailedLibrary dSource = (DetailedLibrary) source; DetailedLibrary dTarget = (DetailedLibrary) target; dTarget.setPreMigrationId(dSource.getPreMigrationId()); dTarget.setNonStandardAlias(dSource.hasNonStandardAlias()); dTarget.setArchived(dSource.getArchived()); dTarget.getLibraryDesignCode().setId(dSource.getLibraryDesignCode().getId()); if (dSource.getLibraryDesign() != null) { dTarget.getLibraryDesign().setId(dSource.getLibraryDesign().getId()); } else { dTarget.getLibraryDesign().setId(null); } if (dSource.getKitDescriptor() != null) { dTarget.getKitDescriptor().setId(dSource.getKitDescriptor().getId()); } else { dTarget.getKitDescriptor().setId(null); } } }
Source:
private Dimension layoutSize(Container target, boolean preferred) { synchronized (target.getTreeLock()) { synchronized (this.oppositeAlignedItems) { ParentDimensions targetDims = getTargetDimensions(target); List<Component> components = Arrays.asList(target.getComponents()); List<WrapLayoutRow> rows = getAllRows(components, preferred, targetDims.innerWidth); Integer containerHeight = rows.stream().map((r) -> r.height).reduce(0, Integer::sum); if (rows.size() > 1) { containerHeight += (rows.size() - 1) * getVgap(); } containerHeight += targetDims.insets.top + targetDims.insets.bottom; Integer containerWidth = rows.stream().map((r) -> r.width).reduce(0, Math::max); containerWidth += targetDims.insets.left + targetDims.insets.right + (getHgap() * 2); Container scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane.class, target); if (scrollPane != null && target.isValid()) { containerWidth -= (getHgap() + 1); } return new Dimension(containerWidth, containerHeight); } } }

Target:
private Dimension layoutSize(Container target, boolean preferred) { ParentDimensions targetDims = getTargetDimensions(target); List<Component> components = Arrays.asList(target.getComponents()); List<WrapLayoutRow> rows = getAllRows(components, preferred, targetDims.getInnerWidth()); Integer containerHeight = rows.stream().map((r) -> r.getHeight()).reduce(0, Integer::sum); if (rows.size() > 1) { containerHeight += (rows.size() - 1) * getVerticalGap(); } containerHeight += targetDims.getInsets().top + targetDims.getInsets().bottom; Integer containerWidth = rows.stream().map((r) -> r.getWidth()).reduce(0, Math::max); containerWidth += targetDims.getInsets().left + targetDims.getInsets().right + (getHorizontalGap() * 2); Container scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane.class, target); if (scrollPane != null && target.isValid()) { containerWidth -= (getHorizontalGap() + 1); } return new Dimension(containerWidth, containerHeight); }
Source:
public String toString() { return description != null ? description : ""; }

Target:
public String toString() { return description != null ? description : strategy.getClass().getSimpleName(); }
Source:
private static Action1<Object> startPostActivityAction(final Activity activity) { return new Action1<Object>() { @Override public void call(Object o) { activity.startActivity(new Intent(activity.getApplicationContext(), CreatePostActivity.class)); } }; }

Target:
private static Action1<Object> startPostActivityAction(final Activity activity) { return new Action1<Object>() { @Override public void call(Object o) { activity.startActivity(CreatePostActivity.newIntent(activity)); } }; }
Source:
private boolean isOkUsingLombok(ASTClassOrInterfaceDeclaration parent) { if (hasClassLombokAnnotation()) { ASTAnnotation annotation = parent.getAnnotation("lombok.NoArgsConstructor"); if (annotation != null) { List<ASTMemberValuePair> memberValuePairs = annotation.findDescendantsOfType(ASTMemberValuePair.class); for (ASTMemberValuePair memberValuePair : memberValuePairs) { if ("access".equals(memberValuePair.getImage())) { List<ASTName> names = memberValuePair.findDescendantsOfType(ASTName.class); for (ASTName name : names) { if (name.getImage().endsWith("PRIVATE")) { return true; } } } } } } return false; }

Target:
private boolean isOkUsingLombok(ASTClassOrInterfaceDeclaration parent) { ASTAnnotation annotation = parent.getAnnotation("lombok.NoArgsConstructor"); if (annotation != null) { List<ASTMemberValuePair> memberValuePairs = annotation.findDescendantsOfType(ASTMemberValuePair.class); for (ASTMemberValuePair memberValuePair : memberValuePairs) { if ("access".equals(memberValuePair.getImage())) { List<ASTName> names = memberValuePair.findDescendantsOfType(ASTName.class); for (ASTName name : names) { if (name.getImage().endsWith("PRIVATE")) { return true; } } } } } return false; }
Source:
public boolean equals(Object o) { if (o instanceof MagnetConnection) { MagnetConnection other = (MagnetConnection) o; return ((null != location) ? (location.getX() == other.location.getX() && location.getY() == other.location.getY()) : null == other.location) && ((null != auto) ? auto.equals(other.auto) : null == other.auto); } return false; }

Target:
public boolean equals(Object o) { if (o instanceof MagnetConnection) { MagnetConnection other = (MagnetConnection) o; return ((null != location && null != other.location) ? (location.getX() == other.location.getX() && location.getY() == other.location.getY()) : null == location && null == other.location) && ((null != auto) ? auto.equals(other.auto) : null == other.auto); } return false; }
Source:
private String getNetworkName() { return getVmNetworkInterfaceDAO().get(getParameters().getNicId()).getNetworkName(); }

Target:
private String getNetworkName() { VmNetworkInterface vmNetworkInterface = getVmNetworkInterfaceDAO().get(getParameters().getNicId()); return vmNetworkInterface == null ? null : vmNetworkInterface.getNetworkName(); }
Source:
public void save(final JdbcSession session) { final byte[] sessionBytes = this.serializer.convert(session.delegate); if (session.isNew()) { this.jdbcOperations.update(getQuery(Query.CREATE_SESSION), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setString(1, session.getId()); ps.setLong(2, session.getLastAccessedTime()); ps.setString(3, session.getPrincipalName()); JdbcOperationsSessionRepository.this.lobHandler.getLobCreator() .setBlobAsBytes(ps, 4, sessionBytes); } }); session.setNew(false); publishEvent(new SessionCreatedEvent(this, session)); } else { this.jdbcOperations.update(getQuery(Query.UPDATE_SESSION), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setLong(1, session.getLastAccessedTime()); ps.setString(2, session.getPrincipalName()); JdbcOperationsSessionRepository.this.lobHandler.getLobCreator() .setBlobAsBytes(ps, 3, sessionBytes); ps.setString(4, session.getId()); } }); } }

Target:
public void save(final JdbcSession session) { if (session.isNew()) { this.jdbcOperations.update(getQuery(CREATE_SESSION_QUERY), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setString(1, session.getId()); ps.setLong(2, session.getLastAccessedTime()); ps.setString(3, session.getPrincipalName()); JdbcOperationsSessionRepository.this.lobHandler.getLobCreator() .setBlobAsBytes(ps, 4, serialize(session.delegate)); } }); } else { if (session.isAttributesChanged()) { this.jdbcOperations.update(getQuery(UPDATE_SESSION_QUERY), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setLong(1, session.getLastAccessedTime()); ps.setString(2, session.getPrincipalName()); JdbcOperationsSessionRepository.this.lobHandler.getLobCreator() .setBlobAsBytes(ps, 3, serialize(session.delegate)); ps.setString(4, session.getId()); } }); } else if (session.isLastAccessTimeChanged()) { this.jdbcOperations.update(getQuery(UPDATE_SESSION_LAST_ACCESS_TIME_QUERY), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setLong(1, session.getLastAccessedTime()); ps.setString(2, session.getId()); } }); } else { return; } } session.clearChangeFlags(); }
Source:
public String getDescription() { return "A rule detects ambiguities in words."; }

Target:
public String getDescription() { return "A rule detects ambiguities in TC words."; }
Source:
private void updateUIOnSocialLoginToEdxFailure(SocialFactory.SOCIAL_SOURCE_TYPE socialType, String accessToken) { View signupWith = findViewById(R.id.signup_with_row); signupWith.setVisibility(View.GONE); View socialPanel = findViewById(R.id.panel_social_layout); socialPanel.setVisibility(View.GONE); DividerWithTextView signupWithEmailTitle = (DividerWithTextView) findViewById(R.id.or_signup_with_email_title); signupWithEmailTitle.setText(getString(R.string.complete_registration)); showRegularMessage(socialType); populateEmailFromSocialSite(socialType, accessToken); List<IRegistrationFieldView> extraFields = new ArrayList<>(); for (IRegistrationFieldView field : this.mFieldViews) { String fieldName = field.getField().getName(); if (RegistrationFieldType.CONFIRM_EMAIL.name().equalsIgnoreCase(fieldName)) { field.getView().setVisibility(View.GONE); extraFields.add(field); } if (RegistrationFieldType.PASSWORD.name().equalsIgnoreCase(fieldName)) { field.getView().setVisibility(View.GONE); extraFields.add(field); } } this.mFieldViews.removeAll(extraFields); }

Target:
private void updateUIOnSocialLoginToEdxFailure(SocialFactory.SOCIAL_SOURCE_TYPE socialType, String accessToken) { View signupWith = findViewById(R.id.signup_with_row); signupWith.setVisibility(View.GONE); View socialPanel = findViewById(R.id.panel_social_layout); socialPanel.setVisibility(View.GONE); DividerWithTextView signupWithEmailTitle = (DividerWithTextView) findViewById(R.id.or_signup_with_email_title); signupWithEmailTitle.setText(getString(R.string.complete_registration)); showRegularMessage(socialType); populateEmailFromSocialSite(socialType, accessToken); List<IRegistrationFieldView> extraFields = new ArrayList<>(); for (IRegistrationFieldView field : this.mFieldViews) { String fieldName = field.getField().getName(); if (RegistrationFieldType.CONFIRM_EMAIL.name().equalsIgnoreCase(fieldName) || RegistrationFieldType.PASSWORD.name().equalsIgnoreCase(fieldName)) { field.getView().setVisibility(View.GONE); extraFields.add(field); } } this.mFieldViews.removeAll(extraFields); }
Source:
public void testJoinGroupUnknownMemberResponseWithOldGeneration() { setupCoordinator(); mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); final int generation = 1; mockClient.prepareResponse(joinGroupFollowerResponse(generation, memberId, JoinGroupRequest.UNKNOWN_MEMBER_ID, Errors.NONE)); mockClient.prepareResponse(syncGroupResponse(Errors.NONE)); coordinator.ensureActiveGroup(); final AbstractCoordinator.Generation currGen = coordinator.generation(); RequestFuture<ByteBuffer> future = coordinator.sendJoinGroupRequest(); final AbstractCoordinator.Generation newGen = new AbstractCoordinator.Generation( currGen.generationId, currGen.memberId + "-new", currGen.protocolName); coordinator.setNewGeneration(newGen); mockClient.prepareResponse(joinGroupFollowerResponse(generation + 1, memberId, JoinGroupRequest.UNKNOWN_MEMBER_ID, Errors.UNKNOWN_MEMBER_ID)); assertTrue(consumerClient.poll(future, mockTime.timer(REQUEST_TIMEOUT_MS))); assertTrue(future.exception().getClass().isInstance(Errors.UNKNOWN_MEMBER_ID.exception())); assertEquals(newGen, coordinator.generation()); }

Target:
public void testJoinGroupUnknownMemberResponseWithOldGeneration() throws InterruptedException { setupCoordinator(); joinGroup(); final AbstractCoordinator.Generation currGen = coordinator.generation(); RequestFuture<ByteBuffer> future = coordinator.sendJoinGroupRequest(); TestUtils.waitForCondition(() -> !mockClient.requests().isEmpty(), 2000, "The join-group request was not sent"); final AbstractCoordinator.Generation newGen = new AbstractCoordinator.Generation( currGen.generationId, currGen.memberId + "-new", currGen.protocolName); coordinator.setNewGeneration(newGen); mockClient.respond(joinGroupFollowerResponse(currGen.generationId + 1, memberId, JoinGroupRequest.UNKNOWN_MEMBER_ID, Errors.UNKNOWN_MEMBER_ID)); assertTrue(consumerClient.poll(future, mockTime.timer(REQUEST_TIMEOUT_MS))); assertTrue(future.exception().getClass().isInstance(Errors.UNKNOWN_MEMBER_ID.exception())); assertEquals(newGen, coordinator.generation()); }
Source:
private void notifyLeaderLoss() { if (lastLeaderAddress != null || lastLeaderSessionID != null) { LOG.debug( "No leader information could be retrieved. Any listeners will be notified."); lastLeaderAddress = null; lastLeaderSessionID = null; leaderListener.notifyLeaderAddress(null, null); } }

Target:
private void notifyLeaderLoss() { notifyIfNewLeaderAddress(null, null); }
Source:
protected boolean syncClock() throws KuraException { boolean ret = false; try { int ntpTimeout = this.ntpTimeout / 1000; Command command = new Command("ntpdate -t " + ntpTimeout + " " + this.ntpHost); command.setTimeout(60); CommandStatus status = this.executorService.execute(command); if ((Integer) status.getExitStatus().getExitValue() == 0) { logger.info("System Clock Synchronized with {}", this.ntpHost); this.lastSync = new Date(); this.listener.onClockUpdate(0); ret = true; } else { logger.warn( "Error while synchronizing System Clock with NTP host {}. Please verify network connectivity ...", this.ntpHost); } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return ret; }

Target:
protected boolean syncClock() throws KuraException { boolean ret = false; try { int ntpTimeout = this.ntpTimeout / 1000; Command command = new Command(new String[] { "ntpdate", "-t", Integer.toString(ntpTimeout), this.ntpHost }); command.setTimeout(60); CommandStatus status = this.executorService.execute(command); if ((Integer) status.getExitStatus().getExitValue() == 0) { logger.info("System Clock Synchronized with {}", this.ntpHost); this.lastSync = new Date(); this.listener.onClockUpdate(0); ret = true; } else { logger.warn( "Error while synchronizing System Clock with NTP host {}. Please verify network connectivity ...", this.ntpHost); } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return ret; }
Source:
public String toString() { StringBuilder str = new StringBuilder(); Iterator<RemoteConnectionEndpointLookupFailure> iterator = lookupFailures.iterator(); while (iterator.hasNext()) { str.append("\n" + iterator.next().toString()); } return str.toString(); }

Target:
public String toString() { StringBuilder str = new StringBuilder(); StringUtils.appendTo(lookupFailures, str); return str.toString(); }
Source:
public void testValidSingleQuotedQuerySpecificChars() { String query = "repository: 'releases#1'"; AqlQueryParser aqlParser = new AqlQueryParser(query); Map<Pair<Integer, Integer>, String> errorMap = null; aqlParser.parseQuery(); logger.info(String.format("Query [%s] parse tree:\n[%s]", query, aqlParser)); assertFalse(aqlParser.hasErrors()); }

Target:
public void testValidSingleQuotedQuerySpecificChars() { String query = "repository: 'releases#1'"; AqlQueryParser aqlParser = new AqlQueryParser(query); aqlParser.parseQuery(); logger.info(String.format("Query [%s] parse tree:\n[%s]", query, aqlParser)); assertFalse(aqlParser.hasErrors()); }
Source:
public Iterator<Path> iterator() { HashSet<Path> sourceFiles = new HashSet<>(); for (Path srcFile : rawSrcFiles) { if (filterSteps.get(srcFile.getParent()).getSourceFiles().contains(srcFile)) { sourceFiles.add(srcFile); } } sourceFiles.addAll(extraSrcFiles); return sourceFiles.iterator(); }

Target:
public Iterator<Path> iterator() { HashSet<Path> sourceFiles = new HashSet<>(); for (Path srcFile : rawSrcFiles) { GoListStep step = filterSteps.get(srcFile.getParent()); Preconditions.checkNotNull(step, "No GoListStep is found for " + srcFile.toString()); if (step.getSourceFiles().contains(srcFile)) { sourceFiles.add(srcFile); } } sourceFiles.addAll(extraSrcFiles); return sourceFiles.iterator(); }
Source:
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = convertView; if (rowView == null) { rowView = inflater.inflate(mResourceId, parent, false); ViewHolder viewHolder = new ViewHolder(rowView); rowView.setTag(viewHolder); } ViewHolder viewHolder = (ViewHolder) rowView.getTag(); CategoryNode node = getItem(position); if (node != null) { viewHolder.mCategoryRowText.setText(StringEscapeUtils.unescapeHtml4(node.getName())); ViewCompat.setPaddingRelative(viewHolder.mCategoryRowText, DisplayUtils.dpToPx(getContext(), 16) * node.getLevel(), 0, DisplayUtils.dpToPx(getContext(), 16), 0); } return rowView; }

Target:
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = convertView; if (rowView == null) { rowView = inflater.inflate(mResourceId, parent, false); ViewHolder viewHolder = new ViewHolder(rowView); rowView.setTag(viewHolder); } ViewHolder viewHolder = (ViewHolder) rowView.getTag(); CategoryNode node = getItem(position); if (node != null) { viewHolder.mCategoryRowText.setText(StringEscapeUtils.unescapeHtml4(node.getName())); if (node.getLevel() > 1) { ViewCompat.setPaddingRelative(viewHolder.mCategoryRowLayout, getContext().getResources().getDimensionPixelSize(R.dimen.margin_medium) * node.getLevel(), 0, 0, 0); } } return rowView; }
Source:
private Runnable createPoller() throws Exception { List<Advice> receiveOnlyAdviceChain = new ArrayList<>(); if (!CollectionUtils.isEmpty(this.adviceChain)) { receiveOnlyAdviceChain.addAll(this.adviceChain.stream() .filter(this::isReceiveOnlyAdvice) .collect(Collectors.toList())); } Callable<Boolean> pollingTask = this::doPoll; List<Advice> adviceChain = this.adviceChain; if (!CollectionUtils.isEmpty(adviceChain)) { ProxyFactory proxyFactory = new ProxyFactory(pollingTask); if (!CollectionUtils.isEmpty(adviceChain)) { adviceChain.stream() .filter(advice -> !isReceiveOnlyAdvice(advice)) .forEach(proxyFactory::addAdvice); } pollingTask = (Callable<Boolean>) proxyFactory.getProxy(this.beanClassLoader); } if (receiveOnlyAdviceChain.size() > 0) { applyReceiveOnlyAdviceChain(receiveOnlyAdviceChain); } return new Poller(pollingTask); }

Target:
private Runnable createPoller() throws Exception { List<Advice> receiveOnlyAdviceChain = null; if (!CollectionUtils.isEmpty(this.adviceChain)) { receiveOnlyAdviceChain = this.adviceChain.stream() .filter(this::isReceiveOnlyAdvice) .collect(Collectors.toList()); } Callable<Boolean> pollingTask = this::doPoll; List<Advice> adviceChain = this.adviceChain; if (!CollectionUtils.isEmpty(adviceChain)) { ProxyFactory proxyFactory = new ProxyFactory(pollingTask); if (!CollectionUtils.isEmpty(adviceChain)) { adviceChain.stream() .filter(advice -> !isReceiveOnlyAdvice(advice)) .forEach(proxyFactory::addAdvice); } pollingTask = (Callable<Boolean>) proxyFactory.getProxy(this.beanClassLoader); } if (receiveOnlyAdviceChain != null) { applyReceiveOnlyAdviceChain(receiveOnlyAdviceChain); } return new Poller(pollingTask); }
Source:
public AggregationPolicy<TrapInformationWrapper, TrapLogDTO, TrapLogDTO> getAggregationPolicy() { return new AggregationPolicy<TrapInformationWrapper, TrapLogDTO, TrapLogDTO>() { @Override public int getCompletionSize() { return config.getBatchSize(); } @Override public int getCompletionIntervalMs() { return config.getBatchIntervalMs(); } @Override public Object key(TrapInformationWrapper message) { if (message.getTrapInformation() != null) { return message.getTrapInformation().getTrapAddress(); } else { return message.getTrapDTO().getTrapAddress(); } } @Override public TrapLogDTO aggregate(TrapLogDTO accumulator, TrapInformationWrapper newMessage) { final TrapInformation trapInfo = newMessage.getTrapInformation(); TrapDTO trapDTO; if(trapInfo != null) { trapDTO = transformTrapInfo(trapInfo); } else { trapDTO = newMessage.getTrapDTO(); } if (accumulator == null) { accumulator = new TrapLogDTO(distPoller.getId(), distPoller.getLocation(), trapDTO.getTrapAddress()); } accumulator.addMessage(trapDTO); return accumulator; } @Override public TrapLogDTO build(TrapLogDTO accumulator) { return accumulator; } }; }

Target:
public AggregationPolicy<TrapInformationWrapper, TrapLogDTO, TrapLogDTO> getAggregationPolicy() { return new AggregationPolicy<TrapInformationWrapper, TrapLogDTO, TrapLogDTO>() { @Override public int getCompletionSize() { return config.getBatchSize(); } @Override public int getCompletionIntervalMs() { return config.getBatchIntervalMs(); } @Override public Object key(TrapInformationWrapper message) { return message.getTrapAddress(); } @Override public TrapLogDTO aggregate(TrapLogDTO accumulator, TrapInformationWrapper newMessage) { final TrapInformation trapInfo = newMessage.getTrapInformation(); TrapDTO trapDTO; InetAddress trapAddress; if(trapInfo != null) { trapDTO = transformTrapInfo(trapInfo); trapAddress = TrapUtils.getEffectiveTrapAddress(trapInfo, config.shouldUseAddressFromVarbind()); } else { trapDTO = newMessage.getTrapDTO(); trapAddress = newMessage.getTrapAddress(); } if (accumulator == null) { accumulator = new TrapLogDTO(distPoller.getId(), distPoller.getLocation(), trapAddress); } accumulator.addMessage(trapDTO); return accumulator; } @Override public TrapLogDTO build(TrapLogDTO accumulator) { return accumulator; } }; }
Source:
public void testPatch() throws IOException, InterruptedException { thrown.expectCause(isA(ProtocolException.class)); TestInterface api = Feign.builder().target(TestInterface.class, "http://localhost:" + server.getPort()); api.patch("foo"); }

Target:
public void testPatch() throws Exception { thrown.expect(RetryableException.class); thrown.expectCause(isA(ProtocolException.class)); super.testPatch(); }
Source:
public void loadRemoteStartPage() { assert !bootconfig.isLocal(); String startPage = bootconfig.getStartPage(); Log.i("SalesforceDroidGapActivity.loadRemoteStartPage", "loading: " + startPage); refresh(startPage); webAppLoaded = true; }

Target:
public void loadRemoteStartPage() { assert !bootconfig.isLocal(); String startPage = bootconfig.getStartPage(); Log.i("SalesforceDroidGapActivity.loadRemoteStartPage", "loading: " + startPage); String url = getFrontDoorUrl(startPage); loadUrl(url); webAppLoaded = true; }
Source:
public Alert(PrincipalUser creator, PrincipalUser owner, String name, String expression, String cronEntry) { super(creator); setOwner(owner); setName(name); setExpression(expression); setCronEntry(cronEntry); setEnabled(false); setMissingDataNotificationEnabled(false); }

Target:
public Alert(PrincipalUser creator, PrincipalUser owner, String name, String expression, String cronEntry) { super(creator); setOwner(owner); setName(name); setExpression(expression); setCronEntry(cronEntry); setEnabled(false); setMissingDataNotificationEnabled(false); setShared(false); }
Source:
public void testGetThemeStyleSheet() { assertEquals("User portal style sheet: 'user_portal.css'", "user_portal.css", testTheme.getThemeStylesheets("userportal").get(0)); assertEquals("User portal style sheet: 'user_portal.css'", "abc.css", testTheme.getThemeStylesheets("userportal").get(1)); assertEquals("Wedadmin style sheet: 'web_admin.css'", "web_admin.css", testTheme.getThemeStylesheets("webadmin").get(0)); assertEquals("Wedadmin style sheet: 'web_admin.css'", "123.css", testTheme.getThemeStylesheets("webadmin").get(1)); }

Target:
public void testGetThemeStyleSheet() { assertEquals("User portal style sheet: 'user_portal.css'", "user_portal.css", testTheme.getThemeStylesheets("userportal").get(0)); assertEquals("User portal style sheet: 'abc.css'", "abc.css", testTheme.getThemeStylesheets("userportal").get(1)); assertEquals("Wedadmin style sheet: 'web_admin.css'", "web_admin.css", testTheme.getThemeStylesheets("webadmin").get(0)); assertEquals("Wedadmin style sheet: '123.css'", "123.css", testTheme.getThemeStylesheets("webadmin").get(1)); }
Source:
public String getWelcomePageUrl() throws GetWelcomePageURLException { String welcomePageUrl = null; Connection connection = OpenShiftServerUtils.getConnection(server); if(connection == null || !connection.connect()) { throw new GetWelcomePageURLException("Connection is not established."); } IService service = OpenShiftServerUtils.getService(server, connection); if(service == null) { throw new GetWelcomePageURLException("Service is missing."); } IProject project = service.getProject(); if (project != null) { List<IRoute> routes = project.getResources(ResourceKind.ROUTE); IRoute route = getRoute(routes); if (route != null) { welcomePageUrl = route.getURL(); } } else { throw new GetWelcomePageURLException("Project is missing."); } return welcomePageUrl; }

Target:
public String getWelcomePageUrl() throws GetWelcomePageURLException { String welcomePageUrl = null; try { Connection connection = OpenShiftServerUtils.getConnection(server); if(connection == null || !connection.connect()) { throw new GetWelcomePageURLException("Connection is not established."); } IService service = OpenShiftServerUtils.getService(server, connection); if(service == null) { throw new GetWelcomePageURLException("Service is missing."); } IProject project = service.getProject(); if (project != null) { List<IRoute> routes = project.getResources(ResourceKind.ROUTE); IRoute route = getRoute(OpenShiftServerUtils.getRouteURL(server), routes); if (route == null) { route = getRoute(routes); } if (route != null) { welcomePageUrl = route.getURL(); } } } catch (OpenShiftException e) { throw new GetWelcomePageURLException(e.getMessage(), e); } return welcomePageUrl; }
Source:
public void setUp() throws URISyntaxException { testObj = new Transactions(); mockTransaction.setShortLived(false); when(mockTxManager.create()).thenReturn(mockTransaction); when(mockTxManager.get(VALID_TX_ID)).thenReturn(mockTransaction); when(mockTxManager.get(AdditionalMatchers.not(ArgumentMatchers.eq(VALID_TX_ID)))) .thenThrow(new TransactionNotFoundException("No Transaction found with transactionId")); when(mockTransaction.getId()).thenReturn("123"); when(mockTransaction.getExpires()).thenReturn(now().plusSeconds(100)); when(mockUriInfo.getBaseUri()).thenReturn(new URI("http://localhost/rest")); setField(testObj, "txManager", mockTxManager); setField(testObj, "uriInfo", mockUriInfo); }

Target:
public void setUp() { testObj = new Transactions(); mockTransaction.setShortLived(false); when(mockTxManager.create()).thenReturn(mockTransaction); when(mockTxManager.get(VALID_TX_ID)).thenReturn(mockTransaction); when(mockTxManager.get(AdditionalMatchers.not(ArgumentMatchers.eq(VALID_TX_ID)))) .thenThrow(new TransactionNotFoundException("No Transaction found with transactionId")); when(mockTransaction.getId()).thenReturn("123"); when(mockTransaction.getExpires()).thenReturn(now().plusSeconds(100)); when(mockUriInfo.getBaseUri()).thenReturn(URI.create("http://localhost/rest")); setField(testObj, "txManager", mockTxManager); setField(testObj, "uriInfo", mockUriInfo); }
Source:
public String maskSensitiveElements( final Message message, final String originalLogString) { if (replacementsXML.isEmpty() && replacementsJSON.isEmpty() || originalLogString == null) { return originalLogString; } final Optional<String> contentType = Optional.ofNullable(message) .map(m -> (String) m.get(Message.CONTENT_TYPE)); if (!contentType.isPresent()) { return originalLogString; } final String lowerCaseContentType = contentType.get().toLowerCase(); if (lowerCaseContentType.contains(XML_CONTENT) || lowerCaseContentType.contains(HTML_CONTENT)) { return applyMasks(originalLogString, replacementsXML); } else if (lowerCaseContentType.contains(JSON_CONTENT)) { return applyMasks(originalLogString, replacementsJSON); } return originalLogString; }

Target:
public String maskSensitiveElements( final Message message, final String originalLogString) { if (replacementsXML.isEmpty() && replacementsJSON.isEmpty() || originalLogString == null || message == null) { return originalLogString; } final String contentType = (String) message.get(Message.CONTENT_TYPE); if (contentType == null) { return originalLogString; } final String lowerCaseContentType = contentType.toLowerCase(); if (lowerCaseContentType.contains(XML_CONTENT) || lowerCaseContentType.contains(HTML_CONTENT)) { return applyMasks(originalLogString, replacementsXML); } else if (lowerCaseContentType.contains(JSON_CONTENT)) { return applyMasks(originalLogString, replacementsJSON); } return originalLogString; }
Source:
public void executeVmCommand() { addAuditLogForPartialVMs(); super.executeVmCommand(); if (getSucceeded()) { if (isImagesAlreadyOnTarget()) { for (DiskImage diskImage : getImages()) { initQcowVersionForDisks(diskImage.getId()); } unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); auditLogDirector.log(this, AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY); } else if (!vmDisksToAttach.isEmpty()) { auditLogDirector.log(this, attemptToAttachDisksToImportedVm(vmDisksToAttach)); } } setActionReturnValue(getVm().getId()); }

Target:
public void executeVmCommand() { addAuditLogForPartialVMs(); super.executeVmCommand(); if (getSucceeded()) { if (isImagesAlreadyOnTarget()) { getImages().stream().forEach(diskImage -> { initQcowVersionForDisks(diskImage.getId()); }); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); auditLogDirector.log(this, AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY); } else if (!vmDisksToAttach.isEmpty()) { auditLogDirector.log(this, attemptToAttachDisksToImportedVm(vmDisksToAttach)); } } setActionReturnValue(getVm().getId()); }
Source:
public void testNoEntryInL1PutReplacedNullValueConcurrently() throws InterruptedException, ExecutionException, TimeoutException { final Cache<Object, String> nonOwnerCache = getFirstNonOwner(key); final Cache<Object, String> ownerCache = getFirstOwner(key); RpcManager rm = TestingUtil.extractComponent(nonOwnerCache, RpcManager.class); ControlledRpcManager crm = new ControlledRpcManager(rm); crm.blockAfter(PutKeyValueCommand.class); TestingUtil.replaceComponent(nonOwnerCache, RpcManager.class, crm, true); try { Future<String> future = nonOwnerCache.putIfAbsentAsync(key, firstValue); crm.waitForCommandToBlock(1, TimeUnit.SECONDS); assertEquals(firstValue, ownerCache.remove(key)); asyncWait(key, RemoveCommand.class, ownerCache); crm.stopBlocking(); assertNull(future.get(1, TimeUnit.SECONDS)); removeAllBlockingInterceptorsFromCache(nonOwnerCache); assertIsNotInL1(nonOwnerCache, key); assertNull(nonOwnerCache.get(key)); assertIsNotInL1(nonOwnerCache, key); } finally { TestingUtil.replaceComponent(nonOwnerCache, RpcManager.class, rm, true); } }

Target:
public void testNoEntryInL1PutReplacedNullValueConcurrently() throws InterruptedException, ExecutionException, TimeoutException { final Cache<Object, String> nonOwnerCache = getFirstNonOwner(key); final Cache<Object, String> ownerCache = getFirstOwner(key); RpcManager rm = TestingUtil.extractComponent(nonOwnerCache, RpcManager.class); ControlledRpcManager crm = new ControlledRpcManager(rm); crm.blockAfter(PutKeyValueCommand.class); TestingUtil.replaceComponent(nonOwnerCache, RpcManager.class, crm, true); try { Future<String> future = nonOwnerCache.putIfAbsentAsync(key, firstValue); crm.waitForCommandToBlock(5, TimeUnit.SECONDS); assertEquals(firstValue, ownerCache.remove(key)); crm.stopBlocking(); assertNull(future.get(5, TimeUnit.SECONDS)); removeAllBlockingInterceptorsFromCache(nonOwnerCache); assertIsNotInL1(nonOwnerCache, key); assertNull(nonOwnerCache.get(key)); assertIsNotInL1(nonOwnerCache, key); } finally { TestingUtil.replaceComponent(nonOwnerCache, RpcManager.class, rm, true); } }
Source:
public static boolean getBooleanForKey(Map<String, String> map, String key) { String value = map.get(key); return ("true".equals(value) || "yes".equals(value) || "1".equals(value)); }

Target:
public static boolean getBooleanForKey(Map<String, String> map, String key) { String value = map.get(key); return ("true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value) || "1".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value)); }
Source:
private List<Map<String, List<String>>> executeVarQuery(Map<String, Object> vars, String varName) throws LDAPException { List<Map<String, List<String>>> ret = new ArrayList<>(); List<String> queryVars = new ArrayList<>(); for (String var : vars.keySet()) { if (var.startsWith(varName)) { queryVars.add(var); } } if (queryVars.size() > 0) { try { ExecutorService executor = Executors.newFixedThreadPool(queryVars.size()); List<Future<List<Map<String, List<String>>>>> list = new ArrayList<>(); for (String var : queryVars) { log.debug("Resolving query var '{}'", var); Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { Callable<List<Map<String, List<String>>>> searchExecute = framework.new SearchExecute(instance, 0); Future<List<Map<String, List<String>>>> submit = executor.submit(searchExecute); list.add(submit); } } for (Future<List<Map<String, List<String>>>> future : list) { try { ret.addAll(future.get()); } catch (InterruptedException | ExecutionException e) { log.error("Failed to execute search: {}", e.getMessage()); log.debug("Exception", e); throw new RuntimeException(e); } } executor.shutdown(); } finally { for (String var : queryVars) { Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { vars.remove(var); try { framework.searchClose(instance); } catch (Exception e) { log.error("Cannot close search of var '{}'", var); log.debug("Cannot close search of var '{}', search: {}", var, instance); log.debug("Exception", e); } } } } } return ret; }

Target:
private List<Map<String, List<String>>> executeVarQuery(Map<String, Object> vars, String varName) throws LDAPException { List<Map<String, List<String>>> ret = new ArrayList<>(); List<String> queryVars = new ArrayList<>(); for (String var : vars.keySet()) { if (var.startsWith(varName)) { queryVars.add(var); } } if (queryVars.size() > 0) { try { ExecutorService executor = Executors.newFixedThreadPool(queryVars.size()); List<Future<List<Map<String, List<String>>>>> list = new ArrayList<>(); for (String var : queryVars) { log.debug("Resolving query var '{}'", var); Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { Callable<List<Map<String, List<String>>>> searchExecute = framework.new SearchExecute(instance, 0); Future<List<Map<String, List<String>>>> submit = executor.submit(searchExecute); list.add(submit); } } for (Future<List<Map<String, List<String>>>> future : list) { try { ret.addAll(future.get()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } executor.shutdown(); } finally { for (String var : queryVars) { Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { vars.remove(var); try { framework.searchClose(instance); } catch (Exception e) { log.error("Cannot close search of var '{}': {}", var, e.getMessage()); log.debug("Search: {}", instance); log.debug("Exception", e); } } } } } return ret; }
Source:
public List<URI> getDependencies(URI uri) { Set<URI> dependencies = new LinkedHashSet<URI>(); for (String fileExtension : fileExtensions) { URI dependencyURI = uri.trimFileExtension().appendFileExtension(fileExtension); if (URIConverter.INSTANCE.exists(dependencyURI, null)) { dependencies.add(dependencyURI); } } return new ArrayList<URI>(dependencies); }

Target:
public Set<URI> getDependencies(URI uri) { final Set<URI> dependencies = new LinkedHashSet<URI>(); for (String fileExtension : fileExtensions) { URI dependencyURI = uri.trimFileExtension().appendFileExtension(fileExtension); if (URIConverter.INSTANCE.exists(dependencyURI, null)) { dependencies.add(dependencyURI); } } return dependencies; }
Source:
public void appendStepEnd() { CommandAction[] aA = new CommandAction[commandInProgress.size()]; aA = commandInProgress.toArray( aA ); SolutionCommand newCmd = new SolutionCommand( aA ); int prevCmdIndex = solutionInProgress.size() - 1; SolutionCommand prevCmd = prevCmdIndex >= 0 ? solutionInProgress.get( prevCmdIndex ) : null ; SolutionCommand combCmd = SolutionCommand.tryToSimplify( prevCmd, newCmd ); if( null == combCmd) { solutionInProgress.add( newCmd ); } else { solutionInProgress.set( prevCmdIndex, combCmd ); } commandInProgress = new ArrayList<CommandAction>(); }

Target:
public void appendStepEnd() { CommandAction[] aA = new CommandAction[commandInProgress.size()]; aA = commandInProgress.toArray( aA ); append( new SolutionCommand( aA ) ); commandInProgress = new ArrayList<CommandAction>(); }
Source:
VolcanoRuleMatch popMatch(VolcanoPlannerPhase phase) { dumpPlannerState(); PhaseMatchList phaseMatchList = matchListMap.get(phase); if (phaseMatchList == null) { throw new AssertionError("Used match list for phase " + phase + " after phase complete"); } VolcanoRuleMatch match; for (;;) { if (phaseMatchList.size() == 0) { return null; } dumpRuleQueue(phaseMatchList); match = phaseMatchList.poll(); if (skipMatch(match)) { LOGGER.trace("Skip match: {}", match); } else { break; } } phaseMatchList.matchMap.remove( planner.getSubset(match.rels[0]), match); LOGGER.trace("Pop match: {}", match); return match; }

Target:
VolcanoRuleMatch popMatch(VolcanoPlannerPhase phase) { dumpPlannerState(); PhaseMatchList phaseMatchList = matchListMap.get(phase); if (phaseMatchList == null) { throw new AssertionError("Used match list for phase " + phase + " after phase complete"); } VolcanoRuleMatch match; for (;;) { if (phaseMatchList.size() == 0) { return null; } dumpRuleQueue(phaseMatchList); match = phaseMatchList.poll(); if (skipMatch(match)) { LOGGER.debug("Skip match: {}", match); } else { break; } } phaseMatchList.matchMap.remove( planner.getSubset(match.rels[0]), match); LOGGER.debug("Pop match: {}", match); return match; }
Source:
public void shouldConstructANewEntity() { ChargeEntity chargeEntity = aValidChargeEntity().build(); Long amount = 100L; RefundEntity refundEntity = new RefundEntity(chargeEntity, amount, userExternalId); refundEntity.setStatus(CREATED); assertNotNull(refundEntity.getExternalId()); assertThat(refundEntity.getChargeEntity(), is(chargeEntity)); assertThat(refundEntity.getReference(), is(nullValue())); assertThat(refundEntity.getAmount(), is(amount)); assertThat(refundEntity.getStatus(), is(CREATED)); assertThat(refundEntity.getUserExternalId(), is(userExternalId)); assertNotNull(refundEntity.getCreatedDate()); }

Target:
public void shouldConstructANewEntity() { ChargeEntity chargeEntity = aValidChargeEntity().build(); Long amount = 100L; RefundEntity refundEntity = new RefundEntity(chargeEntity, amount, userExternalId); assertNotNull(refundEntity.getExternalId()); assertThat(refundEntity.getChargeEntity(), is(chargeEntity)); assertThat(refundEntity.getReference(), is(nullValue())); assertThat(refundEntity.getAmount(), is(amount)); assertThat(refundEntity.getUserExternalId(), is(userExternalId)); assertNotNull(refundEntity.getCreatedDate()); }
Source:
private void initializePermission(Workflow workflow, User user) { ResourcesApi resourcesApi = getResourcesApi(user); String encodedPath = encodedWorkflowResource(workflow, resourcesApi.getApiClient()); try { resourcesApi.createResourceWithDefaults(SamConstants.RESOURCE_TYPE, encodedPath); addPolicy(resourcesApi, encodedPath, SamConstants.WRITE_POLICY); addPolicy(resourcesApi, encodedPath, SamConstants.READ_POLICY); } catch (ApiException e) { if (e.getCode() == HttpStatus.SC_CONFLICT) { handleConflict(encodedPath); } else { throw new CustomWebApplicationException("Error initializing permissions", e.getCode()); } } }

Target:
private void initializePermission(Workflow workflow, User user) { ResourcesApi resourcesApi = getResourcesApi(user); String encodedPath = encodedWorkflowResource(workflow, resourcesApi.getApiClient()); try { resourcesApi.createResourceWithDefaults(SamConstants.RESOURCE_TYPE, encodedPath); addPolicy(resourcesApi, encodedPath, SamConstants.WRITE_POLICY); addPolicy(resourcesApi, encodedPath, SamConstants.READ_POLICY); } catch (ApiException e) { if (e.getCode() == HttpStatus.SC_CONFLICT) { final String message = MessageFormat.format( "An unexpected error occurred. Please send a private message to \"admins\" at <LINK_0> and mention \"SAM {0}\"", encodedPath); throw new CustomWebApplicationException(message, HttpStatus.SC_CONFLICT); } else { throw new CustomWebApplicationException("Error initializing permissions", e.getCode()); } } }
Source:
private void sendToSocket(byte[] chunk) { DatagramPacket packet = new DatagramPacket(chunk, chunk.length, address, port); try { log.debug("Sending to UDP port {}", chunk, port); socket.send(packet); } catch (IOException e) { socket.close(); openSocket(); } }

Target:
private void sendToSocket(byte[] chunk) { DatagramPacket packet = new DatagramPacket(chunk, chunk.length, address, port); try { log.trace("Sending to UDP port {}", chunk, port); socket.send(packet); } catch (IOException e) { log.error("Error sending packet!", e); socket.close(); openSocket(); } }
Source:
public void randomField() { for (int i = 0; i < width; i++) for (int j = 0; j < height; j++) { currentGeneration[i][j] = (int) (Math.random() * 2) == 0 ? (byte) 1 : (byte) 0; } }

Target:
public void randomField() { for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { currentGeneration[i][j] = (int) (Math.random() * 2) == 0 ? (byte) 1 : (byte) 0; } } }
Source:
public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitattributes = new File(localDb.getWorkTree(), ".gitattributes"); assertTrue("The .gitattributes file should exist", gitattributes.exists()); BufferedReader reader = new BufferedReader( new FileReader(gitattributes)); String content = reader.readLine(); reader.close(); assertEquals(".gitattributes content should be as expected", "/test a1 a2", content); } } }

Target:
public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitattributes = new File(localDb.getWorkTree(), ".gitattributes"); assertTrue("The .gitattributes file should exist", gitattributes.exists()); try (BufferedReader reader = new BufferedReader( new FileReader(gitattributes));) { String content = reader.readLine(); assertEquals(".gitattributes content should be as expected", "/test a1 a2", content); } } } }
Source:
private void restart() { quit_.prepareForQuit( "Restarting RStudio", new QuitContext() { @Override public void onReadyToQuit(boolean saveChanges) { String project = session_.getSessionInfo().getActiveProjectFile(); if (project == null) project = Projects.NONE; events_.fireEvent(new OpenProjectNewWindowEvent(project, null)); quit_.performQuit(null, saveChanges); } }); }

Target:
private void restart() { quit_.prepareForQuit( "Restarting RStudio", new QuitContext() { @Override public void onReadyToQuit(boolean saveChanges) { String project = session_.getSessionInfo().getActiveProjectFile(); if (project == null) project = Projects.NONE; final String finalProject = project; quit_.performQuit(null, saveChanges, () -> { events_.fireEvent(new OpenProjectNewWindowEvent(finalProject, null)); }); } }); }
Source:
public void testTableTables() { createTablesWithRetry(dbi); long tableId = dao.insertTable("schema1", "table1", true, false, null, 0, false); assertNotNull(tableId); }

Target:
public void testTableTables() { createTablesWithRetry(dbi); long tableId = dao.insertTable("schema1", "table1", true, false, null, 0, false); assertGreaterThan(tableId, 0L); }