auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateIndexes(List<LookupDto> indexes) { Iterator<Lookup> it = getLookups().iterator(); while (it.hasNext()) { Lookup lookup = it.next(); boolean inNewList = false; for (LookupDto lookupDto : indexes) { if (Objects.equals(lookup.getId(), lookupDto.getId())) { inNewList = true; break; } } if (!inNewList) { it.remove(); } } for (LookupDto lookupDto : indexes) { Lookup lookup = getLookupById(lookupDto.getId()); List<Field> lookupFields = new ArrayList<>(); List<String> lookupFieldsOrder = new ArrayList<>(); for (LookupFieldDto lookupField : lookupDto.getLookupFields()) { Field field = getField(lookupField.getId()); if (!lookupFields.contains(field)) { lookupFields.add(field); } String lookupFieldName = LookupName.buildLookupFieldName(field.getName(), lookupField.getRelatedName()); lookupFieldsOrder.add(lookupFieldName); if(lookupField.getName() != field.getName()) { lookupField.setName(lookupFieldName); } } lookupDto.setFieldsOrder(lookupFieldsOrder); if (lookup == null) { Lookup newLookup = new Lookup(lookupDto, lookupFields); addLookup(newLookup); } else { lookup.update(lookupDto, lookupFields); } } }

Target:
public void updateIndexes(List<LookupDto> indexes) { Iterator<Lookup> it = getLookups().iterator(); while (it.hasNext()) { Lookup lookup = it.next(); boolean inNewList = false; for (LookupDto lookupDto : indexes) { if (Objects.equals(lookup.getId(), lookupDto.getId())) { inNewList = true; break; } } if (!inNewList) { it.remove(); } } for (LookupDto lookupDto : indexes) { Lookup lookup = getLookupById(lookupDto.getId()); List<Field> lookupFields = new ArrayList<>(); List<String> lookupFieldsOrder = new ArrayList<>(); for (LookupFieldDto lookupField : lookupDto.getLookupFields()) { Field field = getField(lookupField.getId()); if (!lookupFields.contains(field)) { lookupFields.add(field); } String lookupFieldName = LookupName.buildLookupFieldName(field.getName(), lookupField.getRelatedName()); lookupFieldsOrder.add(lookupFieldName); lookupField.setName(lookupFieldName); } lookupDto.setFieldsOrder(lookupFieldsOrder); if (lookup == null) { Lookup newLookup = new Lookup(lookupDto, lookupFields); addLookup(newLookup); } else { lookup.update(lookupDto, lookupFields); } } }
Source:
public ValueMatcher makeValueMatcher(final BaseLongColumnValueSelector selector, final String value) { final Long matchVal = DimensionHandlerUtils.convertObjectToLong(value); if (matchVal == null) { return new ValueMatcher() { @Override public boolean matches() { return selector.isNull(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; } final long matchValLong = matchVal; return new ValueMatcher() { @Override public boolean matches() { return selector.getLong() == matchValLong; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }

Target:
public ValueMatcher makeValueMatcher(final BaseLongColumnValueSelector selector, final String value) { final Long matchVal = DimensionHandlerUtils.convertObjectToLong(value); if (matchVal == null) { return ValueMatcher.nullValueMatcher(selector); } final long matchValLong = matchVal; return new ValueMatcher() { @Override public boolean matches() { return selector.getLong() == matchValLong; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }
Source:
public <V> void execute(final Callback<V> callback) { checkNotNull("callback", callback); if (clipboardControl.hasElements()) { final CompositeCommandBuilder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommandBuilder<>(); commandBuilder.addCommands(clipboardControl.getElements().stream() .filter(element -> element instanceof Node) .map(Element::asNode) .filter(Objects::nonNull) .map(node -> (Node<View<?>, Edge>) node) .map(node -> { String newParentUUID = getNewParentUUID(node); return canvasCommandFactory.cloneNode(node, newParentUUID, calculateNewLocation(node, newParentUUID), cloneNodeCallback()); }) .collect(Collectors.toList())); if (Objects.equals(commandBuilder.size(), 0)) { return; } final CommandResult<CanvasViolation> result = sessionCommandManager.execute(getCanvasHandler(), commandBuilder.build()); if (CommandUtils.isError(result)) { LOGGER.severe("Error pasting selection " + CommandUtils.toList(result.getViolations())); callback.onError(null); return; } fireSelectedElementEvent(); callback.onSuccess(); } }

Target:
public <V> void execute(final Callback<V> callback) { checkNotNull("callback", callback); if (clipboardControl.hasElements()) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommands(clipboardControl.getElements().stream() .filter(element -> element instanceof Node) .map(Element::asNode) .filter(Objects::nonNull) .map(node -> (Node<View<?>, Edge>) node) .map(node -> { String newParentUUID = getNewParentUUID(node); return canvasCommandFactory.cloneNode(node, newParentUUID, calculateNewLocation(node, newParentUUID), cloneNodeCallback()); }) .collect(Collectors.toList())); if (Objects.equals(commandBuilder.size(), 0)) { return; } final CommandResult<CanvasViolation> result; if(wasNodesDeletedFromGraph()){ clipboardControl.getRollbackCommands().forEach(command -> command.undo(getCanvasHandler())); result = sessionCommandManager.execute(getCanvasHandler(), commandBuilder.build()); clipboardControl.getRollbackCommands().forEach(command -> command.execute(getCanvasHandler())); }else { result = sessionCommandManager.execute(getCanvasHandler(), commandBuilder.build()); } if (CommandUtils.isError(result)) { LOGGER.severe("Error on paste selection." + getCanvasViolations(result)); return; } fireSelectedElementEvent(); callback.onSuccess(); clear(); copySelectionSessionCommand.execute(); } }
Source:
public void go() throws Exception; } public static interface MIDExpectation { public boolean expectMID(Message message); }

Target:
public void go() throws Exception; } public static interface MidExpectation { public boolean expectMID(Message message); }
Source:
public String getSecIpsString() { final StringBuilder sb = new StringBuilder(); final List<String> ips = getSecIps(); if (ips == null) { sb.append("0;"); } else { for (final String ip : ips) { sb.append(ip).append(RULE_COMMAND_SEPARATOR); } } return sb.toString(); }

Target:
public String getSecIpsString() { final StringBuilder sb = new StringBuilder(); final List<String> ips = getSecIps(); if (ips == null) { sb.append("0").append(RULE_COMMAND_SEPARATOR); } else { for (final String ip : ips) { sb.append(ip).append(RULE_COMMAND_SEPARATOR); } } return sb.toString(); }
Source:
private void confirmSSLCertificateDialog() { try { log.info(this.cdk3 ? "CDK3 server adapter has extended timeout set to 720s" : "CDK 2.x server adapter has timeout set to 300s"); new WaitUntil(new ShellIsAvailable(SSL_DIALOG_NAME), this.cdk3 ? TimePeriod.getCustom(720) : TimePeriod.getCustom(300)); new DefaultShell(SSL_DIALOG_NAME); new PushButton("Yes").click(); log.info("SSL Certificate Dialog appeared during " + this.getLabel().getState().toString()); new WaitWhile(new ShellIsAvailable(SSL_DIALOG_NAME)); setCertificateAccepted(true); } catch (WaitTimeoutExpiredException ex) { String message ="WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown"; log.error(message); throw new CDKServerException(message, ex); } }

Target:
private void confirmSSLCertificateDialog() { try { log.info(this.isCDK3() ? "CDK3 server adapter has extended timeout set to 720s" : "CDK 2.x server adapter has timeout set to 300s"); new WaitUntil(new ShellIsAvailable(SSL_DIALOG_NAME), this.isCDK3() ? TimePeriod.getCustom(720) : TimePeriod.VERY_LONG); new DefaultShell(SSL_DIALOG_NAME); new PushButton("Yes").click(); log.info("SSL Certificate Dialog appeared during " + this.getLabel().getState().toString()); new WaitWhile(new ShellIsAvailable(SSL_DIALOG_NAME)); setCertificateAccepted(true); } catch (WaitTimeoutExpiredException ex) { String message ="WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown"; log.error(message); throw new CDKServerException(message, ex); } }
Source:
public void should_return_endpoints_with_actuator_default_context_path_different_port() { contextRunner.withConfiguration(UserConfigurations.of(EndpointConfig.class)) .withPropertyValues("management.endpoint.health.enabled=true", "management.endpoint.info.enabled=true", "management.endpoints.web.exposure.include=info,health", "management.servet.port=0", "server.servlet.context-path=foo") .run(context -> { SkipPatternProvider skipPatternProvider = context .getBean(SkipPatternProvider.class); Pattern pattern = skipPatternProvider.skipPattern(); then(pattern.pattern()) .contains("/actuator/(health|health/.*|info|info/.*)"); }); }

Target:
public void should_return_endpoints_with_actuator_default_context_path_different_port() { contextRunner.withConfiguration(UserConfigurations.of(ServerPropertiesConfig.class)) .withPropertyValues("management.server.port=0", "server.servlet.context-path=foo") .run(context -> { then(extractAllPatterns(context)).containsExactlyInAnyOrder( "/actuator/(health|health/.*|info|info/.*)", SleuthWebProperties.DEFAULT_SKIP_PATTERN); }); }
Source:
public IntegerCopyNumberTransitionMatrixCollection cloneWithPaddedStates() { final IntegerCopyNumberTransitionMatrixCollection newCollection = new IntegerCopyNumberTransitionMatrixCollection(); if (!sexGenotypeAndContigToTransitionMatrixMap.isEmpty()) { final int highestCopyNumber = sexGenotypeAndContigToTransitionMatrixMap.values().stream() .mapToInt(IntegerCopyNumberTransitionMatrixData::getMaxCopyNumber) .max().getAsInt(); sexGenotypeAndContigToTransitionMatrixMap.keySet().stream() .forEach(key -> { final IntegerCopyNumberTransitionMatrixData dat = sexGenotypeAndContigToTransitionMatrixMap.get(key); newCollection.add(key.getSexGenotype(), key.getContig(), new IntegerCopyNumberTransitionMatrixData(dat.getTransitionMatrix(), highestCopyNumber - dat.getMaxCopyNumber())); }); } return newCollection; }

Target:
public IntegerCopyNumberTransitionMatrixCollection cloneWithPaddedStates() { final IntegerCopyNumberTransitionMatrixCollection newCollection = new IntegerCopyNumberTransitionMatrixCollection(); if (!sexGenotypeAndContigToTransitionMatrixMap.isEmpty()) { final int highestCopyNumber = sexGenotypeAndContigToTransitionMatrixMap.values().stream() .mapToInt(IntegerCopyNumberTransitionMatrix::getMaxCopyNumber) .max().getAsInt(); sexGenotypeAndContigToTransitionMatrixMap.keySet() .forEach(key -> { final IntegerCopyNumberTransitionMatrix transitionMatrix = sexGenotypeAndContigToTransitionMatrixMap.get(key); newCollection.add(key.getSexGenotype(), key.getContig(), new IntegerCopyNumberTransitionMatrix(transitionMatrix.getTransitionMatrix(), highestCopyNumber - transitionMatrix.getMaxCopyNumber())); }); } return newCollection; }
Source:
public DiscussionThreadViewHolder(View itemView) { super(itemView); threadTitleTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_title_text_view); threadBodyTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_body_text_view); threadVisibilityTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_visibility_text_view); actionsBar = itemView.findViewById(R.id.discussion_actions_bar); authorLayoutViewHolder = new AuthorLayoutViewHolder(itemView.findViewById(R.id.discussion_user_profile_row)); numberResponsesViewHolder = new NumberResponsesViewHolder(itemView); socialLayoutViewHolder = new DiscussionSocialLayoutViewHolder(itemView); discussionReportViewHolder = new DiscussionReportViewHolder(itemView); }

Target:
public DiscussionThreadViewHolder(View itemView) { super(itemView); actionsBar = itemView.findViewById(R.id.discussion_actions_bar); threadTitleTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_title_text_view); threadBodyTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_body_text_view); threadVisibilityTextView = (TextView) itemView. findViewById(R.id.discussion_responses_thread_row_visibility_text_view); authorLayoutViewHolder = new AuthorLayoutViewHolder(itemView.findViewById(R.id.discussion_user_profile_row)); numberResponsesViewHolder = new NumberResponsesViewHolder(itemView); socialLayoutViewHolder = new DiscussionSocialLayoutViewHolder(itemView); discussionReportViewHolder = new DiscussionReportViewHolder(itemView); }
Source:
private void addOrUpdateDayTruncatedActivity(ActivityPayload payload, UserAnonymizedDTO userAnonymized, Goal matchingGoal) { Date minEndTime = new Date(payload.startTime.getTime() - yonaProperties.getAnalysisService().getConflictInterval()); DayActivity dayActivity = getCachedDayActivity(payload, userAnonymized, matchingGoal); Activity activity = dayActivity == null ? null : dayActivity.getLastActivity(); if (activity == null || activity.getEndTime().before(minEndTime)) { addActivity(payload, userAnonymized, matchingGoal, dayActivity); } else if (payload.endTime.getTime() - activity.getEndTime().getTime() >= yonaProperties.getAnalysisService() .getUpdateSkipWindow() || payload.startTime.before(activity.getStartTime())) { updateActivity(payload, userAnonymized, matchingGoal, dayActivity, activity); } }

Target:
private void addOrUpdateDayTruncatedActivity(ActivityPayload payload, UserAnonymizedDTO userAnonymized, Goal matchingGoal) { DayActivityCacheResult dayActivity = getRegisteredDayActivity(payload, userAnonymized, matchingGoal); Activity lastRegisteredActivity = dayActivity.content == null ? null : dayActivity.content.getLastActivity(); if (canCombineWithLastRegisteredActivity(payload, lastRegisteredActivity)) { if (isBeyondSkipWindowAfterLastRegisteredActivity(payload, lastRegisteredActivity)) { updateActivityEndTime(payload, userAnonymized, matchingGoal, dayActivity, lastRegisteredActivity); } } else { addActivity(payload, userAnonymized, matchingGoal, dayActivity); } }
Source:
public @Nullable LatencyAnalysis getAnalysisModule() { return fAnalysisModule; }

Target:
public @Nullable TmfAbstractLatencyAnalysis getAnalysisModule() { return fAnalysisModule; }
Source:
public AccountService getAccountService() { try { long startTimeMs = System.currentTimeMillis(); logger.info("Starting a HelixAccountService"); HelixPropertyStore<ZNRecord> helixStore = ClusterMapUtils.createHelixPropertyStore(accountServiceConfig.zkClientConnectString, storeConfig, null); logger.info("HelixPropertyStore started with zkClientConnectString={}, zkClientSessionTimeoutMs={}, " + "zkClientConnectionTimeoutMs={}, rootPath={}", accountServiceConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, storeConfig.rootPath); ScheduledExecutorService scheduler = accountServiceConfig.updaterPollingIntervalMs > 0 ? Utils.newScheduler(1, HELIX_ACCOUNT_UPDATER_PREFIX, false) : null; HelixAccountService helixAccountService = new HelixAccountService(helixStore, accountServiceMetrics, notifier, scheduler, accountServiceConfig); long spentTimeMs = System.currentTimeMillis() - startTimeMs; logger.info("HelixAccountService started, took ms", spentTimeMs); accountServiceMetrics.startupTimeInMs.update(spentTimeMs); return helixAccountService; } catch (Exception e) { throw new IllegalStateException("Could not instantiate HelixAccountService", e); } }

Target:
public AccountService getAccountService() { try { long startTimeMs = System.currentTimeMillis(); logger.info("Starting a HelixAccountService"); HelixPropertyStore<ZNRecord> helixStore = CommonUtils.createHelixPropertyStore(accountServiceConfig.zkClientConnectString, storeConfig, null); logger.info("HelixPropertyStore started with zkClientConnectString={}, zkClientSessionTimeoutMs={}, " + "zkClientConnectionTimeoutMs={}, rootPath={}", accountServiceConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, storeConfig.rootPath); ScheduledExecutorService scheduler = accountServiceConfig.updaterPollingIntervalMs > 0 ? Utils.newScheduler(1, HELIX_ACCOUNT_UPDATER_PREFIX, false) : null; HelixAccountService helixAccountService = new HelixAccountService(helixStore, accountServiceMetrics, notifier, scheduler, accountServiceConfig); long spentTimeMs = System.currentTimeMillis() - startTimeMs; logger.info("HelixAccountService started, took ms", spentTimeMs); accountServiceMetrics.startupTimeInMs.update(spentTimeMs); return helixAccountService; } catch (Exception e) { throw new IllegalStateException("Could not instantiate HelixAccountService", e); } }
Source:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); try { boolean visible = waypoint != null && waypoint.getCoords() != null; menu.findItem(MENU_ID_NAVIGATION).setVisible(visible); menu.findItem(MENU_ID_DEFAULT_NAVIGATION).setVisible(visible); menu.findItem(MENU_ID_CACHES_AROUND).setVisible(visible); boolean openGeocache = StringUtils.isEmpty(geocode) && !StringUtils.isEmpty(waypoint.getGeocode()); menu.findItem(MENU_ID_OPEN_GEOCACHE).setVisible(openGeocache); } catch (Exception e) { } return true; }

Target:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); try { boolean visible = waypoint != null && waypoint.getCoords() != null; menu.findItem(MENU_ID_NAVIGATION).setVisible(visible); menu.findItem(MENU_ID_DEFAULT_NAVIGATION).setVisible(visible); menu.findItem(MENU_ID_CACHES_AROUND).setVisible(visible); boolean openGeocache = StringUtils.isEmpty(geocode) && StringUtils.isNotEmpty(waypoint.getGeocode()); menu.findItem(MENU_ID_OPEN_GEOCACHE).setVisible(openGeocache); } catch (Exception e) { } return true; }
Source:
private void createHelloWorldIfEligible(Module module) { ModuleRootManager rootManager = ModuleRootManager.getInstance(module); VirtualFile[] srcDirs = rootManager.getSourceRoots(); VirtualFile[] rootDirs = rootManager.getContentRoots(); if(rootDirs.length != 1 || srcDirs.length != 1) { return; } VirtualFile root = rootDirs[0]; VirtualFile src = srcDirs[0]; if(src.getChildren().length != 0) { return; } for(VirtualFile item:root.getChildren()) { if(item.getExtension() == "hxml") { return; } } ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { try { VirtualFile mainHx = src.createChildData(this, "Main.hx"); String mainHxSource = "class Main {\n" + " static public function main() {\n" + " trace(\"Hello, world!\");\n" + " }\n" + "}\n"; mainHx.setBinaryContent(mainHxSource.getBytes(StandardCharsets.UTF_8)); VirtualFile buildHxml = root.createChildData(this, "build.hxml"); String buildHxmlSource = "-cp src\n" + "-D analyzer-optimize\n" + "-main Main\n" + "--interp"; buildHxml.setBinaryContent(buildHxmlSource.getBytes(StandardCharsets.UTF_8)); createDefaultRunConfiguration(module, buildHxml.getPath()); FileEditorManager editorManager = FileEditorManager.getInstance(module.getProject()); editorManager.openFile(mainHx, true); } catch (IOException e) { } } }); LOG.debug("Hey"); }

Target:
private void createHelloWorldIfEligible(Module module) { ModuleRootManager rootManager = ModuleRootManager.getInstance(module); VirtualFile[] srcDirs = rootManager.getSourceRoots(); VirtualFile[] rootDirs = rootManager.getContentRoots(); if(rootDirs.length != 1 || srcDirs.length != 1) { return; } VirtualFile root = rootDirs[0]; VirtualFile src = srcDirs[0]; if(src.getChildren().length != 0) { return; } for(VirtualFile item:root.getChildren()) { if(item.getExtension() == "hxml") { return; } } ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { try { VirtualFile mainHx = src.createChildData(this, "Main.hx"); String mainHxSource = "class Main {\n" + " static public function main() {\n" + " trace(\"Hello, world!\");\n" + " }\n" + "}\n"; mainHx.setBinaryContent(mainHxSource.getBytes(StandardCharsets.UTF_8)); VirtualFile buildHxml = root.createChildData(this, "build.hxml"); String buildHxmlSource = "-cp src\n" + "-D analyzer-optimize\n" + "-main Main\n" + "--interp"; buildHxml.setBinaryContent(buildHxmlSource.getBytes(StandardCharsets.UTF_8)); createDefaultRunConfiguration(module, buildHxml.getPath()); FileEditorManager editorManager = FileEditorManager.getInstance(module.getProject()); editorManager.openFile(mainHx, true); } catch (IOException e) { } } }); }
Source:
public static boolean isAppleJDK() { return JAVA_VM_VENDOR.toUpperCase().contains("apple"); }

Target:
public static boolean isAppleJDK() { return JAVA_VM_VENDOR.toLowerCase().contains("apple"); }
Source:
public static TransformersSubRegistration register(TransformationDescription description, SubsystemTransformerRegistration registration, ModelVersionRange range) { final TransformersSubRegistration subRegistration = registration.registerModelTransformers(range, description.getResourceTransformer(), description.getOperationTransformer(), description.isPlaceHolder()); for (final Map.Entry<String, OperationTransformer> entry : description.getOperationTransformers().entrySet()) { subRegistration.registerOperationTransformer(entry.getKey(), entry.getValue()); } for (final TransformationDescription child : description.getChildren()) { register(child, subRegistration); } subRegistration.discardOperations(description.getDiscardedOperations().toArray(new String[description.getDiscardedOperations().size()])); return subRegistration; }

Target:
public static TransformersSubRegistration register(TransformationDescription description, SubsystemTransformerRegistration registration, ModelVersionRange range) { final TransformersSubRegistration subRegistration = registration.registerModelTransformers(range, description.getResourceTransformer(), description.getOperationTransformer(), description.isPlaceHolder()); return getTransformersSubRegistration(description, subRegistration); }
Source:
private Iterable<List<Episode>> getAsEpisodes(Iterable<List<Programme>> programmes) { Iterable<List<Programme>> filteredProgrammes = Iterables.transform( programmes, IS_EPISODES_LIST ); return Iterables.transform( filteredProgrammes, TO_EPISODES_LIST ); }

Target:
private Iterable<List<Episode>> getAsEpisodes(Iterable<List<Programme>> programmes) { Iterable<List<Programme>> episodes = Iterables.transform( programmes, isEpisodesList() ); return Iterables.transform( episodes, toEpisodesList() ); }
Source:
public URL publicUrlForFilePath(final FilePath filePath) throws NonExistentItemException { return amazonS3Client.generatePresignedUrl(bucketNameForFilePath(filePath), filePath.filename(), new DateTime() .plusHours(1).toDate(), HttpMethod.GET); }

Target:
public URL publicUrlForFilePath(final FilePath filePath) throws NonExistentItemException { return amazonS3Client.generatePresignedUrl(bucketNameForFilePath(filePath), filePath.filename(), DateTime.now() .plusHours(1).toDate(), HttpMethod.GET); }
Source:
public Clusters list() { ApplicationMode appMode = getCurrent().get(ApplicationMode.class); if (isFiltered()) { if (appMode == ApplicationMode.VirtOnly) { return mapVirtOnlyCollection(getBackendCollection(VdcQueryType.GetAllVdsGroups, new VdcQueryParametersBase())); } else { return mapCollection(getBackendCollection(VdcQueryType.GetAllVdsGroups, new VdcQueryParametersBase())); } } else { if (appMode == ApplicationMode.VirtOnly) { return mapVirtOnlyCollection(getBackendCollection(SearchType.Cluster)); } else { return mapCollection(getBackendCollection(SearchType.Cluster)); } } }

Target:
public Clusters list() { ApplicationMode appMode = getCurrent().get(ApplicationMode.class); if (appMode == ApplicationMode.VirtOnly) { return listVirtOnly(); } else { return listAll(); } }
Source:
public void testInitialSizeZeroIsAllowed() throws Exception { try { DataSourceFactory ds = getDataSourceFactory("yaml/empty_initial_pool.yml"); assertThat(ds.getInitialSize()).isEqualTo(0); } catch (ConfigurationValidationException e) { e.printStackTrace(); fail(e.getMessage()); } }

Target:
public void testInitialSizeZeroIsAllowed() throws Exception { DataSourceFactory ds = getDataSourceFactory("yaml/empty_initial_pool.yml"); assertThat(ds.getInitialSize()).isEqualTo(0); }
Source:
private TreeViewer createTree(Composite composite) { Tree tree = toolkit.createTree(composite, SWT.FULL_SELECTION | SWT.MULTI); TreeViewer treeViewer = new TreeViewer(tree); TreeViewerColumn columnName = new TreeViewerColumn(treeViewer, SWT.LEFT); columnName.getColumn().setText("File"); TreeViewerColumn columnModified = new TreeViewerColumn(treeViewer, SWT.LEFT); columnModified.getColumn().setText("Modified"); tree.setHeaderVisible(true); tree.getColumn(0).setWidth(250); tree.getColumn(1).setWidth(100); return treeViewer; }

Target:
private TreeViewer createTree(Composite composite) { Tree tree = toolkit.createTree(composite, SWT.FULL_SELECTION | SWT.MULTI); TreeViewer treeViewer = new TreeViewer(tree); TreeViewerColumn columnName = new TreeViewerColumn(treeViewer, SWT.LEFT); columnName.getColumn().setText(UIText.StagingView_Column_File); TreeViewerColumn columnModified = new TreeViewerColumn(treeViewer, SWT.LEFT); columnModified.getColumn().setText(UIText.StagingView_Column_Modified); tree.setHeaderVisible(true); tree.getColumn(0).setWidth(250); tree.getColumn(1).setWidth(100); return treeViewer; }
Source:
public void destroy(String name) throws CachePersistenceException { while (true) { if (entity == null) { try { entity = entityFactory.retrieve(entityIdentifier, serviceConfiguration.getServerConfiguration()); } catch (EntityNotFoundException e) { } catch (TimeoutException e) { throw new CachePersistenceException("Could not connect to the cluster tier manager '" + entityIdentifier + "'; retrieve operation timed out", e); } catch (DestroyInProgressException e) { silentDestroy(); return; } catch (ConnectionClosedException | ConnectionShutdownException e) { reconnect(); continue; } } try { if (entity != null) { entityFactory.destroyClusteredStoreEntity(entityIdentifier, name); } break; } catch (EntityNotFoundException e) { LOGGER.debug("Destruction of cluster tier failed as it does not exist", name); } catch (ConnectionClosedException | ConnectionShutdownException e) { handleConnectionClosedException(); } } }

Target:
public void destroy(String name) throws CachePersistenceException { while (true) { if (entity == null) { try { entity = entityFactory.retrieve(entityIdentifier, serviceConfiguration.getServerConfiguration()); } catch (EntityNotFoundException e) { } catch (TimeoutException e) { throw new CachePersistenceException("Could not connect to the cluster tier manager '" + entityIdentifier + "'; retrieve operation timed out", e); } catch (DestroyInProgressException e) { silentDestroy(); return; } catch (ConnectionClosedException | ConnectionShutdownException e) { reconnect(); } } try { if (entity != null) { entityFactory.destroyClusteredStoreEntity(entityIdentifier, name); break; } } catch (EntityNotFoundException e) { LOGGER.debug("Destruction of cluster tier failed as it does not exist", name); } catch (ConnectionClosedException | ConnectionShutdownException e) { handleConnectionClosedException(); } } }
Source:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } ToRemove toRemove; final World world = user.getWorld(); int radius = 0; if (args.length >= 2) { try { radius = Integer.parseInt(args[1]); } catch (NumberFormatException e) { throw new Exception(_("numberRequired"), e); } } if (args.length >= 3) { world = ess.getworld(args[3]); } try { toRemove = ToRemove.valueOf(args[0].toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { throw new NotEnoughArgumentsException(e); } removeEntities(user, world, toRemove, radius); }

Target:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } ToRemove toRemove; World world = user.getWorld(); int radius = 0; if (args.length >= 2) { try { radius = Integer.parseInt(args[1]); } catch (NumberFormatException e) { throw new Exception(_("numberRequired"), e); } } if (args.length >= 3) { world = ess.getWorld(args[2]); } try { toRemove = ToRemove.valueOf(args[0].toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { throw new NotEnoughArgumentsException(e); } removeEntities(user, world, toRemove, radius); }
Source:
public void shouldGetDiagnosisById() { int diagnosisId = 1; Diagnosis diagnosis = diagnosisDAO.getDiagnosisById(diagnosisId); assertEquals("4e663d66-6b78-11e0-93c3-18a905e044dc", diagnosis.getUuid()); }

Target:
public void shouldGetDiagnosisById() { Diagnosis diagnosis = diagnosisDAO.getDiagnosisById(1); assertEquals("4e663d66-6b78-11e0-93c3-18a905e044dc", diagnosis.getUuid()); }
Source:
public static <I, O, M extends IgniteModel<I, O>, L> DatasetTrainer<IgniteModel<I, O>, L> unsafeCoerce( DatasetTrainer<? extends M, L> trainer) { return new DatasetTrainer<IgniteModel<I, O>, L>() { @Override public <K, V> IgniteModel<I, O> fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return trainer.fit(datasetBuilder, featureExtractor, lbExtractor); } @Override public <K, V> IgniteModel<I, O> update(IgniteModel<I, O> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { DatasetTrainer<IgniteModel<I, O>, L> trainer1 = (DatasetTrainer<IgniteModel<I, O>, L>)trainer; return trainer1.update(mdl, datasetBuilder, featureExtractor, lbExtractor); } @Override protected boolean checkState(IgniteModel<I, O> mdl) { return true; } @Override protected <K, V> IgniteModel<I, O> updateModel(IgniteModel<I, O> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return null; } }; }

Target:
public static <I, O, M extends IgniteModel<I, O>, L> DatasetTrainer<IgniteModel<I, O>, L> unsafeCoerce( DatasetTrainer<? extends M, L> trainer) { return new DatasetTrainer<IgniteModel<I, O>, L>() { @Override public <K, V> IgniteModel<I, O> fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return trainer.fit(datasetBuilder, featureExtractor, lbExtractor); } @Override public <K, V> IgniteModel<I, O> update(IgniteModel<I, O> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { DatasetTrainer<IgniteModel<I, O>, L> trainer1 = (DatasetTrainer<IgniteModel<I, O>, L>)trainer; return trainer1.update(mdl, datasetBuilder, featureExtractor, lbExtractor); } @Override public boolean isUpdateable(IgniteModel<I, O> mdl) { throw new IllegalStateException(); } @Override protected <K, V> IgniteModel<I, O> updateModel(IgniteModel<I, O> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { throw new IllegalStateException(); } }; }
Source:
public PlogClient(String host, int port, int chunkSize) { openSocket(); try { address = InetAddress.getByName(host); } catch (UnknownHostException e) { log.error("Unknown address {}", host, e); throw Throwables.propagate(e); } this.port = port; this.chunkSize = chunkSize; this.lastMessageId = new AtomicInteger(1); }

Target:
public PlogClient(String host, int port, int chunkSize) { Preconditions.checkNotNull(host, "host cannot be null!"); Preconditions.checkArgument(port > 1024 && port < 65536, "Must provide a valid port number!"); Preconditions.checkArgument(chunkSize < 65483, "Maximum Plog UDP data length is 65483 bytes!"); openSocket(); try { address = InetAddress.getByName(host); } catch (UnknownHostException e) { log.error("Unknown address {}", host, e); throw Throwables.propagate(e); } this.port = port; this.chunkSize = chunkSize; this.lastMessageId = new AtomicInteger(1); }
Source:
void onImportDatasetFromCSV() { final String action = "Preparing data import"; dependencyManager_.withDataImport( action, new Command() { @Override public void execute() { view_.bringToFront(); DataImportDialog dataImportDialog = new DataImportDialog( "Data Import", new OperationWithInput<DataImportOptions>() { @Override public void execute(final DataImportOptions options) { final DataImportScript dataImportScript = new DataImportScript(); String code = dataImportScript.getImportScript(options); eventBus_.fireEvent(new SendToConsoleEvent(code, true)); } }); dataImportDialog.showModal(); } }); }

Target:
void onImportDatasetFromCSV() { final String action = "Preparing data import"; dependencyManager_.withDataImportCSV( action, new Command() { @Override public void execute() { view_.bringToFront(); DataImportDialog dataImportDialog = new DataImportDialog( "Data Import", new OperationWithInput<DataImportOptions>() { @Override public void execute(final DataImportOptions options) { final DataImportScript dataImportScript = new DataImportScript(); String code = dataImportScript.getImportScript(options); eventBus_.fireEvent(new SendToConsoleEvent(code, true, true)); } }); dataImportDialog.showModal(); } }); }
Source:
public void registerUpdateLifecycleTest() throws Exception { applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UP); Thread.sleep(1000); applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UNKNOWN); Thread.sleep(1000); applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.DOWN); Thread.sleep(10 * 1000); Assert.assertEquals(Arrays.asList("UP", "UNKNOWN", "DOWN"), mockLocalEurekaServer.registrationStatuses); Assert.assertEquals(3, mockLocalEurekaServer.registerCount.get()); }

Target:
public void registerUpdateLifecycleTest() throws Exception { applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UP); Thread.sleep(400); applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UNKNOWN); Thread.sleep(400); applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.DOWN); Thread.sleep(2400); Assert.assertEquals(Arrays.asList("UP", "UNKNOWN", "DOWN"), mockLocalEurekaServer.registrationStatuses); Assert.assertEquals(3, mockLocalEurekaServer.registerCount.get()); }
Source:
public AlgorithmParameterSpec getEncryptionParameterSpec(final byte[] iv, final long position) { Validate.notNull(iv, "Initialization vector must not be null"); Validate.isTrue(iv.length == getIVLengthInBytes(), "Initialization vector has the wrong byte count [%d] " + "expected [%d] bytes", iv.length, getIVLengthInBytes()); final int blockSize = getBlockSizeInBytes(); final long startingBlock = position / blockSize; final byte[] counter = ByteBuffer.allocate(16).putLong(startingBlock).array(); final BigInteger ivBigInt = new BigInteger(iv); byte[] updatedIV = Arrays.copyOf(ivBigInt.add(BigInteger.valueOf(startingBlock)).toByteArray(), 16); return new IvParameterSpec(updatedIV); }

Target:
public AlgorithmParameterSpec getEncryptionParameterSpec(final byte[] iv, final long position) { Validate.notNull(iv, "Initialization vector must not be null"); Validate.isTrue(iv.length == getIVLengthInBytes(), "Initialization vector has the wrong byte count [%d] " + "expected [%d] bytes", iv.length, getIVLengthInBytes()); final int blockSize = getBlockSizeInBytes(); final long startingBlock = position / blockSize; final BigInteger ivBigInt = new BigInteger(iv); byte[] updatedIV = Arrays.copyOf(ivBigInt.add(BigInteger.valueOf(startingBlock)).toByteArray(), 16); return new IvParameterSpec(updatedIV); }
Source:
public Response createAPIRevision(String apiId, APIRevisionDTO apIRevisionDTO, MessageContext messageContext) { try { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); APIRevision apiRevision = new APIRevision(); apiRevision.setApiUUID(apiId); apiRevision.setDescription(apIRevisionDTO.getDescription()); String revisionId = apiProvider.addAPIRevision(apiRevision); APIRevision createdApiRevision = apiProvider.getAPIRevision(revisionId); APIRevisionDTO createdApiRevisionDTO = APIMappingUtil.fromAPIRevisiontoDTO(createdApiRevision); URI createdApiUri = new URI(RestApiConstants.RESOURCE_PATH_APIS + "/" + createdApiRevisionDTO.getApiInfo().getId() + "/" + RestApiConstants.RESOURCE_PATH_REVISIONS + "/" + createdApiRevisionDTO.getId()); return Response.created(createdApiUri).entity(createdApiRevisionDTO).build(); } catch (Exception e) { String errorMessage = "Error while adding new API Revision : " + apIRevisionDTO.getApiInfo().getProvider() + "-" + apIRevisionDTO.getApiInfo().getName() + "-" + apIRevisionDTO.getApiInfo().getVersion() + " - " + e.getMessage(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }

Target:
public Response createAPIRevision(String apiId, APIRevisionDTO apIRevisionDTO, MessageContext messageContext) { try { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); APIRevision apiRevision = new APIRevision(); apiRevision.setApiUUID(apiId); apiRevision.setDescription(apIRevisionDTO.getDescription()); String revisionId = apiProvider.addAPIRevision(apiRevision); APIRevision createdApiRevision = apiProvider.getAPIRevision(revisionId); APIRevisionDTO createdApiRevisionDTO = APIMappingUtil.fromAPIRevisiontoDTO(createdApiRevision); URI createdApiUri = new URI(RestApiConstants.RESOURCE_PATH_APIS + "/" + createdApiRevisionDTO.getApiInfo().getId() + "/" + RestApiConstants.RESOURCE_PATH_REVISIONS + "/" + createdApiRevisionDTO.getId()); return Response.created(createdApiUri).entity(createdApiRevisionDTO).build(); } catch (APIManagementException e) { String errorMessage = "Error while adding new API Revision : " + apIRevisionDTO.getApiInfo().getProvider() + "-" + apIRevisionDTO.getApiInfo().getName() + "-" + apIRevisionDTO.getApiInfo().getVersion(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } catch (URISyntaxException e) { String errorMessage = "Error while retrieving created revision API location : " + apIRevisionDTO.getApiInfo().getProvider() + "-" + apIRevisionDTO.getApiInfo().getName() + "-" + apIRevisionDTO.getApiInfo().getVersion(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }
Source:
public void doesntAddInvitedByToNodeSubscriptionsListIfNotUserOrOwnerOrModerator() throws Exception { List<NodeMembership> members = new ArrayList<NodeMembership>(); members.add(new NodeMembershipImpl(node, jid, Subscriptions.invited, Affiliations.publisher, invitedBy)); Mockito.when(channelManager.getNodeMemberships(Mockito.anyString())).thenReturn(new ResultSetImpl<NodeMembership>(members)); subscriptionsGet.process(element, jid, nodeRequest, null); Assert.assertEquals(1, queue.size()); IQ response = (IQ) queue.poll(); Assert.assertEquals(IQ.Type.result, response.getType()); Assert.assertEquals(userRequest.getTo(), response.getFrom()); Assert.assertEquals(userRequest.getFrom(), response.getTo()); Assert.assertEquals(userRequest.getID(), response.getID()); Assert.assertEquals(0, response.getChildElement().element("subscriptions").elements("invited-by").size()); }

Target:
public void doesntAddInvitedByToNodeSubscriptionsListIfNotUserOrOwnerOrModerator() throws Exception { List<NodeMembership> members = new ArrayList<NodeMembership>(); members.add(new NodeMembershipImpl(node, jid, Subscriptions.subscribed, Affiliations.publisher, invitedBy)); Mockito.when(channelManager.getNodeMemberships(Mockito.anyString())).thenReturn(new ResultSetImpl<NodeMembership>(members)); subscriptionsGet.process(element, new JID("shylock@shakespeare.lit"), nodeRequest, null); Assert.assertEquals(1, queue.size()); IQ response = (IQ) queue.poll(); Assert.assertEquals(IQ.Type.result, response.getType()); Assert.assertEquals(userRequest.getTo(), response.getFrom()); Assert.assertEquals(userRequest.getFrom(), response.getTo()); Assert.assertEquals(userRequest.getID(), response.getID()); Element subscription = (Element) response.getChildElement().element("subscriptions").elements("subscription").get(0); Assert.assertNull(subscription.attributeValue("invited-by")); }
Source:
public void userAuthDevIdUserNameResult() throws Exception { DeviceAuthorizationResult deviceAuthorizationResult = deviceAccessAuthorizationService. isUserAuthorized(deviceIds, ADMIN_USER); Assert.assertEquals(deviceAuthorizationResult.getAuthorizedDevices().size(), 5, "Expected 5 authorized devices for admin user"); Assert.assertEquals(deviceAuthorizationResult.getUnauthorizedDevices().size(), 0, "Expected 0 un-authorized devices for admin user"); }

Target:
public void userAuthDevIdUserNameResult() throws DeviceAccessAuthorizationException { PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(ADMIN_USER); DeviceAuthorizationResult deviceAuthorizationResult = deviceAccessAuthorizationService. isUserAuthorized(deviceIds, ADMIN_USER); Assert.assertEquals(deviceAuthorizationResult.getAuthorizedDevices().size(), 5, "Expected 5 authorized devices for admin user"); Assert.assertEquals(deviceAuthorizationResult.getUnauthorizedDevices().size(), 0, "Expected 0 un-authorized devices for admin user"); }
Source:
public Action getShowLostEventsAction() { if (hideLostEventsAction == null) { hideLostEventsAction = new Action(Messages.HistogramView_hideLostEvents, IAction.AS_CHECK_BOX) { @Override public void run() { HistogramScaledData.hideLostEvents = hideLostEventsAction.isChecked(); long maxNbEvents = HistogramScaledData.hideLostEvents ? fFullTraceHistogram.fScaledData.fMaxValue : fFullTraceHistogram.fScaledData.fMaxCombinedValue; fFullTraceHistogram.getMaxNbEventsLabel().setText(Long.toString(maxNbEvents)); fFullTraceHistogram.getMaxNbEventsLabel().getParent().layout(); fFullTraceHistogram.fCanvas.redraw(); maxNbEvents = HistogramScaledData.hideLostEvents ? fTimeRangeHistogram.fScaledData.fMaxValue : fTimeRangeHistogram.fScaledData.fMaxCombinedValue; fTimeRangeHistogram.getMaxNbEventsLabel().setText(Long.toString(maxNbEvents)); fTimeRangeHistogram.getMaxNbEventsLabel().getParent().layout(); fTimeRangeHistogram.fCanvas.redraw(); } }; hideLostEventsAction.setText(Messages.HistogramView_hideLostEvents); hideLostEventsAction.setToolTipText(Messages.HistogramView_hideLostEvents); hideLostEventsAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SHOW_LOST_EVENTS)); } return hideLostEventsAction; }

Target:
public Action getShowLostEventsAction() { if (hideLostEventsAction == null) { hideLostEventsAction = new Action(Messages.HistogramView_hideLostEvents, IAction.AS_CHECK_BOX) { @Override public void run() { HistogramScaledData.hideLostEvents = hideLostEventsAction.isChecked(); long maxNbEvents = HistogramScaledData.hideLostEvents ? fFullTraceHistogram.fScaledData.fMaxValue : fFullTraceHistogram.fScaledData.fMaxCombinedValue; fFullTraceHistogram.setMaxNbEvents(maxNbEvents); maxNbEvents = HistogramScaledData.hideLostEvents ? fTimeRangeHistogram.fScaledData.fMaxValue : fTimeRangeHistogram.fScaledData.fMaxCombinedValue; fTimeRangeHistogram.setMaxNbEvents(maxNbEvents); } }; hideLostEventsAction.setText(Messages.HistogramView_hideLostEvents); hideLostEventsAction.setToolTipText(Messages.HistogramView_hideLostEvents); hideLostEventsAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SHOW_LOST_EVENTS)); } return hideLostEventsAction; }
Source:
public HashMap<String, Integer> getLayouts() { return layouts; }

Target:
public Map<String, Integer> getLayouts() { return layouts; }
Source:
public BatchServerInventoryView( final ZkPathsConfig zkPaths, final CuratorFramework curator, final ObjectMapper jsonMapper, final Predicate<Pair<DruidServerMetadata, DataSegment>> defaultFilter ) { super( log, zkPaths.getAnnouncementsPath(), zkPaths.getLiveSegmentsPath(), curator, jsonMapper, new TypeReference<Set<DataSegment>>() { } ); Preconditions.checkNotNull(defaultFilter); this.defaultFilter = defaultFilter; }

Target:
public BatchServerInventoryView( final ZkPathsConfig zkPaths, final CuratorFramework curator, final ObjectMapper jsonMapper, final Predicate<Pair<DruidServerMetadata, DataSegment>> defaultFilter ) { super( log, zkPaths.getAnnouncementsPath(), zkPaths.getLiveSegmentsPath(), curator, jsonMapper, new TypeReference<Set<DataSegment>>() { } ); this.defaultFilter = Preconditions.checkNotNull(defaultFilter); }
Source:
public void updateAdapter(List<Provider> providerList) { this.providerList = providerList; mProviderManagementRecyclerView.getAdapter().notifyDataSetChanged(); ProviderManagementRecyclerViewAdapter adapter = new ProviderManagementRecyclerViewAdapter(getContext(), providerList); mProviderManagementRecyclerView.setAdapter(adapter); adapter.notifyDataSetChanged(); }

Target:
public void updateAdapter(List<Provider> providerList) { this.providerList = providerList; providersAdapter.setItems(providerList); providersAdapter.notifyDataSetChanged(); }
Source:
public void setup() { try { adminClient.realm("test").remove(); } catch (Exception ignore) { } RealmRepresentation testRealm = loadJson(getClass().getResourceAsStream("/testrealm.json"), RealmRepresentation.class); adminClient.realms().create(testRealm); UserRepresentation user = UserBuilder.create() .username("login-test") .email("login@test.com") .enabled(true) .requiredAction(UserModel.RequiredAction.UPDATE_PASSWORD.toString()) .requiredAction(UserModel.RequiredAction.UPDATE_PROFILE.toString()) .build(); userId = ApiUtil.createUserAndResetPasswordWithAdminClient(adminClient.realm("test"), user, "password"); UserResource userResource = adminClient.realm(testRealm.getRealm()).users().get(userId); UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getRequiredActions().size() < 2) { userRepresentation.setRequiredActions(user.getRequiredActions()); userResource.update(userRepresentation); } getCleanup().addUserId(userId); oauth.clientId("test-app"); }

Target:
public void setup() { try { adminClient.realm("test").remove(); } catch (Exception ignore) { } RealmRepresentation testRealm = loadJson(getClass().getResourceAsStream("/testrealm.json"), RealmRepresentation.class); adminClient.realms().create(testRealm); UserRepresentation user = UserBuilder.create() .username("login-test") .email("login@test.com") .enabled(true) .requiredAction(UserModel.RequiredAction.UPDATE_PASSWORD.toString()) .requiredAction(UserModel.RequiredAction.UPDATE_PROFILE.toString()) .password("password") .build(); userId = ApiUtil.createUserWithAdminClient(adminClient.realm("test"), user); getCleanup().addUserId(userId); oauth.clientId("test-app"); }
Source:
public SymbolTableBuilder(String fullyQualifiedModuleName) { this.fullyQualifiedModuleName = new ArrayList<>(Arrays.asList(fullyQualifiedModuleName.split("\\."))); }

Target:
public SymbolTableBuilder(String fullyQualifiedModuleName) { this.fullyQualifiedModuleName = Arrays.asList(fullyQualifiedModuleName.split("\\.")); }