auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addBannerMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception { if (MaterialUtil.isBanner(stack.getType()) && string != null) { final String[] split = splitPattern.split(string, 2); if (split.length < 2) { throw new Exception(tl("invalidBanner", string)); } DyeColor baseColor = null; org.bukkit.block.banner.Pattern pattern = null; if (split[0].equalsIgnoreCase("basecolor")) { baseColor = ColorUtil.getDyeColor(split[1]); } else { try { PatternType type = PatternType.valueOf(split[0].toUpperCase()); DyeColor color = ColorUtil.getDyeColor(split[1]); pattern = new org.bukkit.block.banner.Pattern(color, type); } catch (IllegalArgumentException ignored) { } } if (stack.getType().toString().equals("SHIELD")) { BlockStateMeta meta = (BlockStateMeta) stack.getItemMeta(); Banner banner = (Banner) meta.getBlockState(); if (baseColor != null) { banner.setBaseColor(baseColor); } else if (pattern != null) { if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.BukkitVersion.fromString("1.13.0-R0.1-SNAPSHOT"))) { return; } banner.addPattern(pattern); } banner.update(); meta.setBlockState(banner); stack.setItemMeta(meta); } else { if (baseColor != null) { stack.setType(Material.valueOf(baseColor.name() + "_BANNER")); } else if (pattern != null) { final BannerMeta meta = (BannerMeta) stack.getItemMeta(); meta.addPattern(pattern); stack.setItemMeta(meta); } } } }

Target:
public void addBannerMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception { if (MaterialUtil.isBanner(stack.getType()) && string != null) { final String[] split = splitPattern.split(string, 2); if (split.length < 2) { throw new Exception(tl("invalidBanner", string)); } DyeColor baseColor = null; org.bukkit.block.banner.Pattern pattern = null; if (split[0].equalsIgnoreCase("basecolor")) { baseColor = ColorUtil.getDyeColor(split[1]); } else { try { PatternType type = PatternType.valueOf(split[0].toUpperCase()); DyeColor color = ColorUtil.getDyeColor(split[1]); pattern = new org.bukkit.block.banner.Pattern(color, type); } catch (IllegalArgumentException ignored) { } } if (stack.getType().toString().equals("SHIELD")) { BlockStateMeta meta = (BlockStateMeta) stack.getItemMeta(); Banner banner = (Banner) meta.getBlockState(); if (baseColor != null) { banner.setBaseColor(baseColor); } else if (pattern != null) { if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(v1_13_0_R01)) { return; } banner.addPattern(pattern); } banner.update(); meta.setBlockState(banner); stack.setItemMeta(meta); } else { if (baseColor != null) { stack.setType(Material.valueOf(baseColor.name() + "_BANNER")); } else if (pattern != null) { final BannerMeta meta = (BannerMeta) stack.getItemMeta(); meta.addPattern(pattern); stack.setItemMeta(meta); } } } }
Source:
public String[] keys() throws BackingStoreException { checkRemoved(); HashSet allKeys = new HashSet(Arrays.asList(getOriginal().keys())); for (Object key : temporarySettings.keySet()) { if (temporarySettings.get(key) != null) { allKeys.add(key); } else { allKeys.remove(key); } } return (String[]) allKeys.toArray(new String[allKeys.size()]); }

Target:
public String[] keys() throws BackingStoreException { checkRemoved(); HashSet<String> allKeys = new HashSet<String>(Arrays.asList(getOriginal().keys())); for (Entry<String, Object> entry : temporarySettings.entrySet()) { String key = entry.getKey(); if (entry.getValue() != null) { allKeys.add(key); } else { allKeys.remove(key); } } return allKeys.toArray(new String[allKeys.size()]); }
Source:
public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder.createFactoryFromDevfile(githubUrl.devfileFileLocation()); if (factory == null) { factory = urlFactoryBuilder.createFactoryFromJson(githubUrl.factoryJsonFileLocation()); } if (factory == null) { factory = newDto(FactoryDto.class).withV(CURRENT_VERSION); } if (factory.getWorkspace() == null) { factory.setWorkspace( urlFactoryBuilder.buildDefaultWorkspaceConfig(githubUrl.getRepository())); } return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.build(githubUrl)) .withName(githubUrl.getRepository()) .withType("blank") .withPath("/".concat(githubUrl.getRepository())); }); }

Target:
public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException, ServerException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder .createFactoryFromDevfile(githubUrl.devfileFileLocation()) .orElseGet( () -> urlFactoryBuilder .createFactoryFromJson(githubUrl.factoryFileLocation()) .orElseGet(() -> newDto(FactoryDto.class).withV(CURRENT_VERSION))); if (factory.getWorkspace() == null) { factory.setWorkspace( urlFactoryBuilder.buildDefaultWorkspaceConfig(githubUrl.getRepository())); } return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.build(githubUrl)) .withName(githubUrl.getRepository()) .withPath("/".concat(githubUrl.getRepository())); }); }
Source:
protected void activate(ComponentContext context) { try { ProvisioningServiceDataHolder.getInstance().setBundleContext(context.getBundleContext()); ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(UserOperationEventListener.class.getName(), new DefaultInboundUserProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provision Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(ApplicationMgtListener.class.getName(), new ApplicationMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Application Management Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(IdentityProviderMgtLister.class.getName(), new IdentityProviderMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provider Management Event listener registered successfully"); } if (log.isDebugEnabled()) { log.debug("Identity Provisioning framework bundle is activated"); } } catch (IdentityProvisioningException e) { log.error("Error while initiating identity provisioning connector framework", e); log.error("Error while activating Identity Provision bundle", e); } }

Target:
protected void activate(ComponentContext context) { try { ProvisioningServiceDataHolder.getInstance().setBundleContext(context.getBundleContext()); ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(UserOperationEventListener.class.getName(), new DefaultInboundUserProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provision Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(ApplicationMgtListener.class.getName(), new ApplicationMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Application Management Event listener registered successfully"); } ProvisioningServiceDataHolder.getInstance().getBundleContext().registerService(IdentityProviderMgtLister.class.getName(), new IdentityProviderMgtProvisioningListener(), null); if (log.isDebugEnabled()) { log.debug("Identity Provider Management Event listener registered successfully"); } if (log.isDebugEnabled()) { log.debug("Identity Provisioning framework bundle is activated"); } } catch (Throwable e) { log.error("Error while initiating identity provisioning connector framework", e); } }
Source:
public boolean eat(GlowPlayer player, ItemStack item) { if (!super.eat(player, item)) { return false; } for (int i = 0; i < 16; i++) { Location attempt = player.getLocation(); double deltaX = Math.random() * 16 - 8; double deltaY = Math.random() * 16 - 8; double deltaZ = Math.random() * 16 - 8; attempt.setX(attempt.getX() + deltaX); attempt.setY(Math.min(Math.max(attempt.getY() + deltaY, 0), player.getWorld().getMaxHeight() - 1)); attempt.setZ(attempt.getZ() + deltaZ); attempt = getSafeLocation(attempt); if (attempt != null) { player.getWorld().playSound(player.getLocation(), Sound.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1, 1); player.teleport(attempt); break; } } return true; }

Target:
public boolean eat(GlowPlayer player, ItemStack item) { if (!super.eat(player, item)) { return false; } for (int i = 0; i < 16; i++) { Location attempt = player.getLocation(); double deltaX = ThreadLocalRandom.current().nextDouble() * 16 - 8; double deltaY = ThreadLocalRandom.current().nextDouble() * 16 - 8; double deltaZ = ThreadLocalRandom.current().nextDouble() * 16 - 8; attempt.setX(attempt.getX() + deltaX); attempt.setY(Math.min(Math.max(attempt.getY() + deltaY, 0), player.getWorld().getMaxHeight() - 1)); attempt.setZ(attempt.getZ() + deltaZ); attempt = getSafeLocation(attempt); if (attempt != null) { player.getWorld().playSound(player.getLocation(), Sound.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1, 1); player.teleport(attempt); break; } } return true; }
Source:
public boolean isAnswer(){ boolean answer = false; if(StringUtil.isNotEmpty(getAsString(ForumsXPath.flag))){ List<String> flags = Arrays.asList(getDataHandler().getAsString(ForumsXPath.flag).split(" ")); for (int i = 0; i < flags.size(); i++) { if(StringUtil.equalsIgnoreCase(flags.get(i), FlagType.ANSWER.getFlagType())){ answer = true; } } } return answer; }

Target:
public boolean isAnswer(){ boolean answer = false; if(StringUtil.isNotEmpty(getAsString(ForumsXPath.flag))){ List<String> flags = Arrays.asList(getDataHandler().getAsString(ForumsXPath.flag).split(" ")); for (int i = 0; i < flags.size(); i++) { if(StringUtil.equalsIgnoreCase(flags.get(i), FlagType.ANSWER.getFlagType())){ answer = true; break; } } } return answer; }
Source:
public EditorPartStackView() { this.tabs = new HashMap<>(); this.contents = new LinkedList<>(); initWidget(UI_BINDER.createAndBindUi(this)); plusPanel.getElement().setInnerHTML(FontAwesome.PLUS); plusPanel.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { if (addTabButtonClickListener != null) { addTabButtonClickListener.onAddTabButtonClicked( getAbsoluteLeft(plusPanel.getElement()) + 15, getAbsoluteTop(plusPanel.getElement()) + 15); } } }, ClickEvent.getType()); partViewContainer = new AcceptsOneWidget() { @Override public void setWidget(IsWidget widget) { contentPanel.add(widget); } }; addDomHandler(this, MouseDownEvent.getType()); setMaximized(false); }

Target:
public EditorPartStackView() { this.tabs = new HashMap<>(); this.contents = new LinkedList<>(); initWidget(UI_BINDER.createAndBindUi(this)); plusPanel.getElement().setInnerHTML(FontAwesome.PLUS); plusPanel.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { if (addTabButtonClickListener != null) { addTabButtonClickListener.onAddTabButtonClicked( getAbsoluteLeft(plusPanel.getElement()) + POPUP_OFFSET, getAbsoluteTop(plusPanel.getElement()) + POPUP_OFFSET); } } }, ClickEvent.getType()); partViewContainer = new AcceptsOneWidget() { @Override public void setWidget(IsWidget widget) { contentPanel.add(widget); } }; addDomHandler(this, MouseDownEvent.getType()); setMaximized(false); }
Source:
protected void assertPairedMates(final SAMRecord record1, final SAMRecord record2) { if (!(record1.getFirstOfPairFlag() && record2.getSecondOfPairFlag() || record2.getFirstOfPairFlag() && record1.getSecondOfPairFlag())) { throw new PicardException("Illegal mate state: " + record1.getReadName()); } }

Target:
protected static void assertPairedMates(final SAMRecord record1, final SAMRecord record2) { if (!(record1.getFirstOfPairFlag() && record2.getSecondOfPairFlag() || record2.getFirstOfPairFlag() && record1.getSecondOfPairFlag())) { throw new PicardException("Illegal mate state: " + record1.getReadName()); } }
Source:
public static int getArrivalFilter(Context context, Uri uri) { ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(uri, new String[]{ARRIVAL_FILTER}, null, null, null); int result = 0; if (c != null && c.moveToNext()) { result = c.getInt(0); } if (c != null) { c.close(); } return result; }

Target:
public static ArrivalFilter getArrivalFilter(Context context, Uri uri) { ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(uri, new String[]{ARRIVAL_FILTER}, null, null, null); int result = 0; if (c != null && c.moveToNext()) { result = c.getInt(0); } if (c != null) { c.close(); } return ArrivalFilter.fromInt(result); }
Source:
public void cleanEnvironment() throws Exception { ArrayList<Starter<?>> reversedStarters = new ArrayList<>(STARTERS.values()); Collections.reverse(reversedStarters); reversedStarters.stream() .filter(Objects::nonNull) .forEach(x -> { try { x.stop(); } catch (Exception e) { e.printStackTrace(); } }); zookeeper.close(); }

Target:
public void cleanEnvironment() throws Exception { try { logger.info("Cleaning environment"); ArrayList<Starter<?>> reversedStarters = new ArrayList<>(STARTERS.values()); Collections.reverse(reversedStarters); for (Starter<?> starter : reversedStarters) { starter.stop(); } zookeeper.close(); logger.info("Environment is cleaned"); } catch (Exception e) { logger.error("Exception on cleanEnvironment", e); } }
Source:
public void deployChanges() { Set<PTContainer> newContainers = Sets.newHashSet(); Set<PTContainer> releaseContainers = Sets.newHashSet(); assignContainers(newContainers, releaseContainers); updatePartitionsInfoForPersistOperator(this.dag); this.undeployOpers.removeAll(newOpers.keySet()); this.deployOpers.addAll(this.newOpers.keySet()); Set<PTOperator> ndeps = getDependents(newOpers.keySet()); ndeps.removeAll(newOpers.keySet()); ndeps.removeAll(this.undeployOpers); this.undeployOpers.addAll(ndeps); this.deployOpers.addAll(ndeps); Set<PTOperator> deployOperators = this.getDependents(this.deployOpers); ctx.deploy(releaseContainers, this.undeployOpers, newContainers, deployOperators); this.newOpers.clear(); this.deployOpers.clear(); this.undeployOpers.clear(); }

Target:
public void deployChanges() { Set<PTContainer> newContainers = Sets.newHashSet(); Set<PTContainer> releaseContainers = Sets.newHashSet(); assignContainers(newContainers, releaseContainers); updatePartitionsInfoForPersistOperator(this.dag); Set<PTOperator> ndeps = getDependents(this.newOpers.keySet()); this.undeployOpers.addAll(ndeps); this.undeployOpers.removeAll(this.newOpers.keySet()); Set<PTOperator> deployOperators = this.getDependents(this.deployOpers); this.deployOpers.addAll(this.newOpers.keySet()); deployOperators.addAll(ndeps); ctx.deploy(releaseContainers, this.undeployOpers, newContainers, deployOperators); this.newOpers.clear(); this.deployOpers.clear(); this.undeployOpers.clear(); }
Source:
default List<String> readLines(Charset charset) throws IOException { try (Reader r = getReader(charset)) { return CharStreams.readLines(r); } }

Target:
default Stream<String> readLines(Charset charset) { return getReader(charset).lines(); }
Source:
public final boolean containsValue(Object value) { assertValueNotNull(value); return values().stream().filter(value::equals).findFirst().isPresent(); }

Target:
public final boolean containsValue(Object value) { assertValueNotNull(value); return values().stream().anyMatch(StreamMarshalling.equalityPredicate(value)); }
Source:
public Result addConfiguration() { AddConfigurationViewModel viewModel = new AddConfigurationViewModel(); List<String> datasets = new ArrayList<>(); datasets.add("dataset A"); datasets.add("dataset B"); datasets.add("dataset C"); Map<String, List<String>> task_variants = new HashMap<>(); Map<String, List<String>> evaluators = new HashMap<>(); for (int i = 65; i < 65+3; i++) { List<String> task_variants_i = new ArrayList<>(); task_variants_i.add("task_variant A" + (char) i); task_variants_i.add("task_variant B" + (char) i); task_variants_i.add("task_variant C" + (char) i); task_variants.put("dataset "+(char) i, task_variants_i); List<String> evaluator_i = new ArrayList<>(); evaluator_i.add("evaluator A" + (char) i); evaluator_i.add("evaluator B" + (char) i); evaluator_i.add("evaluator C" + (char) i); for (int j = 65; j < 65+3; j++) evaluators.put("task_variant "+(char)i+(char)j, evaluator_i); } viewModel.datasets = datasets; viewModel.task_variants = task_variants; viewModel.evaluators = evaluators; return ok(addConfiguration.render(viewModel)); }

Target:
public Result addConfiguration() { AddConfigurationViewModel viewModel = new AddConfigurationViewModel(); List<String> datasets = new ArrayList<>(); datasets.add("dataset A"); datasets.add("dataset B"); datasets.add("dataset C"); Map<String, List<String>> task_variants = new HashMap<>(); Map<String, List<String>> evaluators = new HashMap<>(); for (int i = 65; i < 65+3; i++) { List<String> task_variants_i = new ArrayList<>(); task_variants_i.add("SPAN_IDENTIFICATION"); task_variants_i.add("SPAN_TAGGING"); task_variants_i.add("PREDICATE_ARGUMENT_LABELING"); task_variants_i.add("SPAN_CLUSTERING"); task_variants_i.add("DEPENDENCY_PARSING"); task_variants_i.add("CONSTITUENCY_PARSING"); task_variants.put("dataset "+(char) i, task_variants_i); List<String> evaluator_i = new ArrayList<>(); evaluator_i.add("evaluator A" + (char) i); evaluator_i.add("evaluator B" + (char) i); evaluator_i.add("evaluator C" + (char) i); for (int j = 65; j < 65+3; j++) evaluators.put("task_variant "+(char)i+(char)j, evaluator_i); } viewModel.datasets = datasets; viewModel.task_variants = task_variants; viewModel.evaluators = evaluators; return ok(addConfiguration.render(viewModel)); }
Source:
public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, UpgradeRequest request, URI requestURI, JettyWebSocketFrameHandlerFactory frameHandlerFactory, Object websocketPojo) { super(coreClient, requestURI); if (request != null) { HttpFields.Mutable fields = getHeaders(); request.getHeaders().forEach(fields::put); List<HttpCookie> cookies = request.getCookies(); if (cookies != null) { HttpFields.Mutable headers = getHeaders(); for (HttpCookie cookie : cookies) { headers.add(HttpHeader.COOKIE, cookie.toString()); } } setSubProtocols(request.getSubProtocols()); setExtensions(request.getExtensions().stream() .map(c -> new ExtensionConfig(c.getName(), c.getParameters())) .collect(Collectors.toList())); if (request.getMethod() != null) method(request.getMethod()); if (request.getHttpVersion() != null) version(HttpVersion.fromString(request.getHttpVersion())); } handshakeRequest = new DelegatedJettyClientUpgradeRequest(this); frameHandler = frameHandlerFactory.newJettyFrameHandler(websocketPojo); }

Target:
public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, UpgradeRequest request, URI requestURI, JettyWebSocketFrameHandlerFactory frameHandlerFactory, Object websocketPojo) { super(coreClient, requestURI); if (request != null) { HttpFields.Mutable fields = getHeaders(); request.getHeaders().forEach(fields::put); List<HttpCookie> cookies = request.getCookies(); if (cookies != null) { for (HttpCookie cookie : cookies) { fields.add(HttpHeader.COOKIE, cookie.toString()); } } setSubProtocols(request.getSubProtocols()); setExtensions(request.getExtensions().stream() .map(c -> new ExtensionConfig(c.getName(), c.getParameters())) .collect(Collectors.toList())); if (request.getMethod() != null) method(request.getMethod()); if (request.getHttpVersion() != null) version(HttpVersion.fromString(request.getHttpVersion())); } handshakeRequest = new DelegatedJettyClientUpgradeRequest(this); frameHandler = frameHandlerFactory.newJettyFrameHandler(websocketPojo); }
Source:
public void createFieldMethod(Class<?> prefFieldHelperClass, IJExpression keyExpression, String fieldName, String fieldHelperMethodName, IJExpression defaultValue, String docComment, String defaultValueStr) { JMethod fieldMethod = generatedClass.method(PUBLIC, prefFieldHelperClass, fieldName); if (defaultValueStr != null) { boolean isStringPrefField = "stringField".equals(fieldHelperMethodName); if (isStringPrefField) { fieldMethod.javadoc().append("<p><b>Defaults to</b>: \"" + defaultValueStr + "\"</p>\n"); } else { fieldMethod.javadoc().append("<p><b>Defaults to</b>: " + defaultValueStr + "</p>\n"); } } codeModelHelper.addTrimmedDocComment(fieldMethod, docComment); fieldMethod.body()._return(JExpr.invoke(fieldHelperMethodName).arg(keyExpression).arg(defaultValue)); }

Target:
public void createFieldMethod(Class<?> prefFieldHelperClass, IJExpression keyExpression, String fieldName, String fieldHelperMethodName, IJExpression defaultValue, String docComment, String defaultValueStr) { JMethod fieldMethod = generatedClass.method(PUBLIC, prefFieldHelperClass, fieldName); if (defaultValueStr != null) { boolean isStringPrefField = StringPrefField.class == prefFieldHelperClass; final String defaultValueJavaDoc; if (isStringPrefField) { defaultValueJavaDoc = "\"" + defaultValueStr + "\""; } else { defaultValueJavaDoc = defaultValueStr; } fieldMethod.javadoc().append("<p><b>Defaults to</b>: " + defaultValueJavaDoc + "</p>\n"); } codeModelHelper.addTrimmedDocComment(fieldMethod, docComment); fieldMethod.body()._return(JExpr.invoke(fieldHelperMethodName).arg(keyExpression).arg(defaultValue)); }
Source:
private static Configuration validateAndGetConfiguration(final Configuration configuration) { if (!ExecutionEnvironment.areExplicitEnvironmentsAllowed()) { throw new InvalidProgramException( "The LocalStreamEnvironment cannot be used when submitting a program through a client, " + "or running in a TestEnvironment context."); } final Configuration effectiveConfiguration = new Configuration(checkNotNull(configuration)); effectiveConfiguration.set(DeploymentOptions.TARGET, "local"); effectiveConfiguration.set(DeploymentOptions.ATTACHED, true); if (!configuration.getOptional(CoreOptions.DEFAULT_PARALLELISM).isPresent()) { configuration.set(CoreOptions.DEFAULT_PARALLELISM, 1); } return effectiveConfiguration; }

Target:
private static Configuration validateAndGetConfiguration(final Configuration configuration) { if (!ExecutionEnvironment.areExplicitEnvironmentsAllowed()) { throw new InvalidProgramException( "The LocalStreamEnvironment cannot be used when submitting a program through a client, " + "or running in a TestEnvironment context."); } final Configuration effectiveConfiguration = new Configuration(checkNotNull(configuration)); effectiveConfiguration.set(DeploymentOptions.TARGET, "local"); effectiveConfiguration.set(DeploymentOptions.ATTACHED, true); return effectiveConfiguration; }
Source:
private boolean isValidUrl(String url) { return url.startsWith("http://") || url.startsWith("https://"); }

Target:
private boolean isValidUrl(String url) { return URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url); }
Source:
public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { if (initialVersion == NonExistingVersion.INSTANCE) { return generateNew(); } else if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw log.unexpectedInitialVersion(initialVersion.getClass().getName()); }

Target:
public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw log.unexpectedInitialVersion(initialVersion.getClass().getName()); }
Source:
public void keyVaultWithVirtualMachineMSI() { final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add("apt-get install maven -y"); commands.add("apt-get install git"); commands.add("mkdir azure-sdk-for-java"); commands.add("cd azure-sdk-for-java"); commands.add("git init"); commands.add("git remote add origin <LINK_0>"); commands.add("git config core.sparsecheckout true"); commands.add("echo sdk/spring > .git/info/sparse-checkout"); commands.add("git pull origin master"); commands.add("cd sdk/spring/"); commands.add("mvn package -Dmaven.test.skip=true"); commands.add("cd azure-spring-boot-test-application/target/"); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); vm.runCommand(new RunCommandInput().withCommandId("RunShellScript").withScript(commands)); final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }

Target:
public void keyVaultWithVirtualMachineMSI() { final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add("mkdir azure-sdk-for-java"); commands.add("cd azure-sdk-for-java"); commands.add("git init"); commands.add("git remote add origin <LINK_0>"); commands.add("git config core.sparsecheckout true"); commands.add("echo sdk/spring > .git/info/sparse-checkout"); commands.add("git pull origin master"); commands.add("cd sdk/spring/"); commands.add("mvn package -Dmaven.test.skip=true"); commands.add("cd azure-spring-boot-test-application/target/"); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); vm.runCommand(new RunCommandInput().withCommandId("RunShellScript").withScript(commands)); final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }
Source:
public Drawable getDrawableIconForPackage(ComponentName componentName, UserHandle userHandle) { if (iconsPackPackageName.equalsIgnoreCase("default") || iconsPackPackageName.equalsIgnoreCase("squircle") || iconsPackPackageName.equalsIgnoreCase("square") || iconsPackPackageName.equalsIgnoreCase("circle")) { return this.getDefaultAppDrawable(componentName, userHandle); } String drawable = packagesDrawables.get(componentName.toString()); if (drawable != null) { int id = iconPackres.getIdentifier(drawable, "drawable", iconsPackPackageName); if (id > 0) { try { return iconPackres.getDrawable(id); } catch (Resources.NotFoundException e) { e.printStackTrace(); } } } Drawable systemIcon = cacheGetDrawable(componentName.toString()); if (systemIcon != null) return systemIcon; systemIcon = this.getDefaultAppDrawable(componentName, userHandle); if (systemIcon instanceof BitmapDrawable) { Drawable generated = generateBitmap(systemIcon); cacheStoreDrawable(componentName.toString(), generated); return generated; } return systemIcon; }

Target:
public Drawable getDrawableIconForPackage(ComponentName componentName, UserHandle userHandle) { if (iconsPackPackageName.equalsIgnoreCase("default") || DrawableUtils.isIconsPackAdaptive(iconsPackPackageName)) { return this.getDefaultAppDrawable(componentName, userHandle); } String drawable = packagesDrawables.get(componentName.toString()); if (drawable != null) { int id = iconPackres.getIdentifier(drawable, "drawable", iconsPackPackageName); if (id > 0) { try { return iconPackres.getDrawable(id); } catch (Resources.NotFoundException e) { e.printStackTrace(); } } } Drawable systemIcon = cacheGetDrawable(componentName.toString()); if (systemIcon != null) return systemIcon; systemIcon = this.getDefaultAppDrawable(componentName, userHandle); if (systemIcon instanceof BitmapDrawable) { Drawable generated = generateBitmap(systemIcon); cacheStoreDrawable(componentName.toString(), generated); return generated; } return systemIcon; }
Source:
public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception { if (decodeState == STATE_CALLING_CHILD_DECODE) { decodeState = STATE_HANDLER_REMOVED_PENDING; return; } ByteBuf buf = cumulation; if (buf != null) { cumulation = null; int readable = buf.readableBytes(); if (readable > 0) { ctx.fireChannelRead(buf); ctx.fireChannelReadComplete(); } else { buf.release(); } } handlerRemoved0(ctx); decodeState = STATE_REMOVED; }

Target:
public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception { if (decodeState == STATE_CALLING_CHILD_DECODE) { decodeState = STATE_HANDLER_REMOVED_PENDING; return; } try { ByteBuf buf = cumulation; if (buf != null) { cumulation = null; int readable = buf.readableBytes(); if (readable > 0) { ctx.fireChannelRead(buf); ctx.fireChannelReadComplete(); } else { buf.release(); } } handlerRemoved0(ctx); } finally { decodeState = STATE_REMOVED; } }
Source:
public AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { String id = element.getAttribute(ID_ATTRIBUTE); Assert.hasText(id, "The id attribute must be specified"); String messageTemplate = element.getAttribute(MESSAGE_TEMPLATE_ATTRIBUTE); Assert.hasText(messageTemplate, "The message-template attribute must be specified"); String step = element.getAttribute(STEP_ATTRIBUTE); Assert.hasText(id, "The step attribute must be specified"); String replyChannel = element.getAttribute(REPLY_CHANNEL_ATTRIBUTE); Assert.hasText(replyChannel, "The replyChannel attribute must be specified"); BeanDefinitionRegistry beanDefinitionRegistry = parserContext.getRegistry(); BeanDefinition chunkMessageChannelItemWriter = BeanDefinitionBuilder .genericBeanDefinition(ChunkMessageChannelItemWriter.class) .addPropertyReference(MESSAGING_OPERATIONS_PROPERTY, messageTemplate) .addPropertyReference(REPLY_CHANNEL_PROPERTY, replyChannel) .getBeanDefinition(); beanDefinitionRegistry.registerBeanDefinition(id, chunkMessageChannelItemWriter); BeanDefinition remoteChunkHandlerFactoryBean = BeanDefinitionBuilder .genericBeanDefinition(RemoteChunkHandlerFactoryBean.class) .addPropertyValue(CHUNK_WRITER_PROPERTY, chunkMessageChannelItemWriter) .addPropertyValue(STEP_PROPERTY, step) .getBeanDefinition(); beanDefinitionRegistry.registerBeanDefinition(CHUNK_HANDLER_BEAN_NAME_PREFIX + step, remoteChunkHandlerFactoryBean); return null; }

Target:
public AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { String id = element.getAttribute(ID_ATTRIBUTE); Assert.hasText(id, "The id attribute must be specified"); String messageTemplate = element.getAttribute(MESSAGE_TEMPLATE_ATTRIBUTE); Assert.hasText(messageTemplate, "The message-template attribute must be specified"); String step = element.getAttribute(STEP_ATTRIBUTE); Assert.hasText(step, "The step attribute must be specified"); String replyChannel = element.getAttribute(REPLY_CHANNEL_ATTRIBUTE); Assert.hasText(replyChannel, "The reply-channel attribute must be specified"); BeanDefinitionRegistry beanDefinitionRegistry = parserContext.getRegistry(); BeanDefinition chunkMessageChannelItemWriter = BeanDefinitionBuilder .genericBeanDefinition(ChunkMessageChannelItemWriter.class) .addPropertyReference(MESSAGING_OPERATIONS_PROPERTY, messageTemplate) .addPropertyReference(REPLY_CHANNEL_PROPERTY, replyChannel) .getBeanDefinition(); beanDefinitionRegistry.registerBeanDefinition(id, chunkMessageChannelItemWriter); BeanDefinition remoteChunkHandlerFactoryBean = BeanDefinitionBuilder .genericBeanDefinition(RemoteChunkHandlerFactoryBean.class) .addPropertyValue(CHUNK_WRITER_PROPERTY, chunkMessageChannelItemWriter) .addPropertyValue(STEP_PROPERTY, step) .getBeanDefinition(); beanDefinitionRegistry.registerBeanDefinition(CHUNK_HANDLER_BEAN_NAME_PREFIX + step, remoteChunkHandlerFactoryBean); return null; }
Source:
private void testContentAndLogin() throws Exception { ______TS("content: no courses, 'welcome stranger' message"); String unregUserId = TestProperties.TEST_UNREG_ACCOUNT; String unregPassword = TestProperties.TEST_UNREG_PASSWORD; BackDoor.deleteStudent(unregUserId); logout(); studentHome = getHomePageNew().clickStudentLogin().loginAsStudent(unregUserId, unregPassword); browser.waitForPageLoad(); assertTrue(studentHome.verifyStrangerMessage()); ______TS("login successfully"); logout(); studentHome = getHomePageNew().clickStudentLogin() .loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, TestProperties.TEST_STUDENT1_PASSWORD); browser.waitForPageLoad(); assertTrue(studentHome.verifyFirstPanelFeedbackSessionName("[SHomeUiT.CS1101]: Programming Methodology")); ______TS("login successfully as admin (masquerade mode)"); AppUrl detailsPageUrl = createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE) .withUserId(testData.students.get("SHomeUiT.charlie.d@SHomeUiT.CS2104").googleId); StudentHomePageNew studentHomePage = loginAdminToPageNew(detailsPageUrl, StudentHomePageNew.class); browser.waitForPageLoad(); assertTrue(studentHomePage.verifyAdminPagePresent()); }

Target:
private void testContentAndLogin() { ______TS("login successfully"); getHomePage().clickStudentLogin().loginAsStudent( TestProperties.TEST_STUDENT1_ACCOUNT, TestProperties.TEST_STUDENT1_PASSWORD); browser.waitForPageLoad(); List<String> courseIds = getAllVisibleCourseIds(); for (int i = 0; i < courseIds.size(); i++) { String courseId = courseIds.get(i); assertTrue(verifyVisibleCourseToStudents(courseId, i)); String feedbackSessionName = testData.feedbackSessions.entrySet().stream() .filter(feedbackSession -> courseId.equals(feedbackSession.getValue().getCourseId())) .map(x -> x.getValue().getFeedbackSessionName()) .collect(Collectors.joining()); assertTrue(verifyVisibleFeedbackSessionToStudents(feedbackSessionName, i)); } }
Source:
public void start() { Runnable cb = getReloadCallback(); future = executor.scheduleWithFixedDelay(this, WAIT, WAIT, TimeUnit.MILLISECONDS); List<DynamicStringProperty> reloadList = getReloadSettings(); if (reloadList != null) { for(DynamicStringProperty reload : reloadList) { if (reload != null) { reload.addCallback(cb); } } } ProcessEngineUtils.HA_ENABLED.addCallback(cb); }

Target:
public void start() { Runnable cb = (new Runnable() { @Override public void run() { reload(); } }); future = executor.scheduleWithFixedDelay(this, WAIT, WAIT, TimeUnit.MILLISECONDS); List<DynamicStringProperty> reloadList = getReloadSettings(); if (reloadList != null) { for(DynamicStringProperty reload : reloadList) { if (reload != null) { reload.addCallback(cb); } } } ProcessEngineUtils.HA_ENABLED.addCallback(cb); }
Source:
private ListenableFuture<Void> startAsyncUpload(Digest digest, Chunker chunker) { try { chunker.reset(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } UUID uploadId = UUID.randomUUID(); String resourceName = buildUploadResourceName(instanceName, uploadId, digest); AsyncUpload newUpload = new AsyncUpload( channel, callCredentialsProvider, callTimeoutSecs, retrier, resourceName, chunker); ListenableFuture<Void> currUpload = newUpload.start(); currUpload.addListener( () -> { if (currUpload.isCancelled()) { newUpload.cancel(); } }, MoreExecutors.directExecutor()); return currUpload; }

Target:
private ListenableFuture<Void> startAsyncUpload(Digest digest, Chunker chunker) { try { chunker.reset(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } if (chunker.getSize() != digest.getSizeBytes()) { return Futures.immediateFailedFuture( new IllegalStateException( String.format( "Expected chunker size of %d, got %d", digest.getSizeBytes(), chunker.getSize()))); } UUID uploadId = UUID.randomUUID(); String resourceName = buildUploadResourceName(instanceName, uploadId, digest); AsyncUpload newUpload = new AsyncUpload( channel, callCredentialsProvider, callTimeoutSecs, retrier, resourceName, chunker); ListenableFuture<Void> currUpload = newUpload.start(); currUpload.addListener( () -> { if (currUpload.isCancelled()) { newUpload.cancel(); } }, MoreExecutors.directExecutor()); return currUpload; }
Source:
private Stream<Pair<String, Calendar>> createCalendar(String key, byte[] icsContent) { CalendarBuilder builder = new CalendarBuilder(); try { ByteArrayInputStream inputStream = new ByteArrayInputStream(icsContent); return Stream.of(Pair.of(key, builder.build(inputStream))); } catch (IOException e) { if (LOGGER.isErrorEnabled()) { String icsContentAsString; try { icsContentAsString = new String(icsContent, Charset.forName("UTF-8")); } catch (Throwable t) { LOGGER.error("Error while decoding ics content", t); icsContentAsString = new String(Hex.encodeHex(icsContent)); } LOGGER.error("Error while reading input: " + icsContentAsString, e); } return Stream.of(); } catch (ParserException e) { if (LOGGER.isErrorEnabled()) { String icsContentAsString; try { icsContentAsString = new String(icsContent, Charset.forName("UTF-8")); } catch (Throwable t) { LOGGER.error("Error while decoding ics content", t); icsContentAsString = new String(Hex.encodeHex(icsContent)); } LOGGER.error("Error while parsing ICal object: " + icsContentAsString, e); } return Stream.of(); } }

Target:
private Stream<Pair<String, Calendar>> createCalendar(String key, byte[] icsContent) { CalendarBuilder builder = new CalendarBuilder(); try { ByteArrayInputStream inputStream = new ByteArrayInputStream(icsContent); return Stream.of(Pair.of(key, builder.build(inputStream))); } catch (IOException e) { if (LOGGER.isErrorEnabled()) { LOGGER.error("Error while reading input: " + icsContentToString(icsContent), e); } return Stream.of(); } catch (ParserException e) { if (LOGGER.isErrorEnabled()) { LOGGER.error("Error while parsing ICal object: " + icsContentToString(icsContent), e); } return Stream.of(); } }
Source:
public static String parseOperationRequest(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException { return parseOperationRequestLine(commandLine, handler).getSubstitued(); }

Target:
public static String parseOperationRequest(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException { SubstitutedLine sl = parseOperationRequestLine(commandLine, handler); return sl == null ? null : sl.getSubstitued(); }
Source:
public void sweepNextBatch(ShardAndStrategy shardStrategy, long sweepTs) { metrics.updateSweepTimestamp(shardStrategy, sweepTs); long lastSweptTs = progress.getLastSweptTimestamp(shardStrategy); if (sweepTs <= lastSweptTs + 1) { log.warn("Last swept timestamp for is greater than or equal to the sweep timestamp {}.", lastSweptTs, shardStrategy.toText(), sweepTs); return; } log.info("Beginning iteration of targeted sweep for {}, and sweep timestamp {}. Last previously swept timestamp" + " for this shard and strategy was {}.", shardStrategy.toText(), sweepTs, lastSweptTs); SweepBatch sweepBatch = getNextBatchToSweep(shardStrategy, lastSweptTs, sweepTs); deleter.sweep(sweepBatch.writes(), Sweeper.of(shardStrategy)); log.info("Put ranged tombstones and swept up to timestamp for {}.", sweepBatch.writes().size(), sweepBatch.lastSweptTimestamp(), shardStrategy.toText()); cleaner.clean(shardStrategy, lastSweptTs, sweepBatch.lastSweptTimestamp()); metrics.updateNumberOfTombstones(shardStrategy, sweepBatch.writes().size()); metrics.updateProgressForShard(shardStrategy, sweepBatch.lastSweptTimestamp()); }

Target:
public void sweepNextBatch(ShardAndStrategy shardStrategy, long sweepTs) { metrics.updateSweepTimestamp(shardStrategy, sweepTs); long lastSweptTs = progress.getLastSweptTimestamp(shardStrategy); if (lastSweptTs + 1 >= sweepTs) { log.warn("Last swept timestamp for is inconsistent with the sweep timestamp {}, since there can be " + "no timestamps between the two values.", SafeArg.of("lastSweptTs", lastSweptTs), SafeArg.of("shardStrategy", shardStrategy.toText()), SafeArg.of("sweepTs", sweepTs)); return; } log.info("Beginning iteration of targeted sweep for {}, and sweep timestamp {}. Last previously swept timestamp" + " for this shard and strategy was {}.", SafeArg.of("shardStrategy", shardStrategy.toText()), SafeArg.of("sweepTs", sweepTs), SafeArg.of("lastSweptTs", lastSweptTs)); SweepBatch sweepBatch = getNextBatchToSweep(shardStrategy, lastSweptTs, sweepTs); deleter.sweep(sweepBatch.writes(), Sweeper.of(shardStrategy)); log.info("Put ranged tombstones and swept up to timestamp for {}.", SafeArg.of("tombstones", sweepBatch.writes().size()), SafeArg.of("lastSweptTs", sweepBatch.lastSweptTimestamp()), SafeArg.of("shardStrategy", shardStrategy.toText())); cleaner.clean(shardStrategy, lastSweptTs, sweepBatch.lastSweptTimestamp()); metrics.updateNumberOfTombstones(shardStrategy, sweepBatch.writes().size()); metrics.updateProgressForShard(shardStrategy, sweepBatch.lastSweptTimestamp()); }
Source:
private void addItemCollectionOnTarget( Collection<T> items, T target, String targetItemNotFoundErrorMessage, SerializableBiFunction<Integer, Boolean, Integer> insertItemsIndexProvider) { Objects.requireNonNull(items, NULL_COLLECTION_ERROR_MESSAGE); if (items.isEmpty()) { return; } final ListDataProvider<T> dataProvider = getDataProvider(); if (!contains(target, dataProvider)) { throw new IllegalArgumentException(targetItemNotFoundErrorMessage); } final Collection<T> backendItems = dataProvider.getItems(); if (backendItems instanceof List) { final List<T> itemList = (List<T>) backendItems; final AtomicBoolean containsTargetItem = new AtomicBoolean(false); items.forEach(item -> { if (equals(item, target, dataProvider)) { containsTargetItem.set(true); } else { removeItemIfPresent(item, dataProvider); } }); int targetItemIndex = getItemIndex(target, dataProvider::getId); if (containsTargetItem.get()) { itemList.remove(targetItemIndex); } final int indexToInsertItems = insertItemsIndexProvider.apply( targetItemIndex, containsTargetItem.get()); itemList.addAll(indexToInsertItems, items); dataProvider.refreshAll(); } else { throw new IllegalArgumentException( String.format(COLLECTION_TYPE_ERROR_MESSAGE_PATTERN, backendItems.getClass().getSimpleName())); } }

Target:
private void addItemCollectionOnTarget( Collection<T> items, T target, String targetItemNotFoundErrorMessage, SerializableBiFunction<Integer, Boolean, Integer> insertItemsIndexProvider) { Objects.requireNonNull(items, NULL_COLLECTION_ERROR_MESSAGE); if (items.isEmpty()) { return; } final ListDataProvider<T> dataProvider = getDataProvider(); final Collection<T> backendItems = dataProvider.getItems(); if (!(backendItems instanceof List)) { throw new IllegalArgumentException( String.format(COLLECTION_TYPE_ERROR_MESSAGE_PATTERN, backendItems.getClass().getSimpleName())); } if (!contains(target, dataProvider)) { throw new IllegalArgumentException(targetItemNotFoundErrorMessage); } final List<T> itemList = (List<T>) backendItems; final AtomicBoolean containsTargetItem = new AtomicBoolean(false); items.forEach(item -> { if (equals(item, target, dataProvider)) { containsTargetItem.set(true); } else { removeItemIfPresent(item, dataProvider); } }); int targetItemIndex = getItemIndex(target, dataProvider::getId); if (containsTargetItem.get()) { itemList.remove(targetItemIndex); } final int indexToInsertItems = insertItemsIndexProvider.apply( targetItemIndex, containsTargetItem.get()); itemList.addAll(indexToInsertItems, items); dataProvider.refreshAll(); }
Source:
@Override public int size() { int sz = 0; Iterator<ScanQueryView> iter = new QueryDataIterator(); while(iter.hasNext()) sz++; return sz; }

Target:
@Override public int size() { int sz = 0; QueryDataIterator iter = new QueryDataIterator(); while (iter.hasNext()) sz++; return sz; }
Source:
private Intent createCourseOutlineIntent(Activity activity, EnrolledCoursesResponse model, String courseComponentId, String lastAccessedId, boolean isVideosMode) { Bundle courseBundle = new Bundle(); courseBundle.putSerializable(EXTRA_COURSE_DATA, model); courseBundle.putString(EXTRA_COURSE_COMPONENT_ID, courseComponentId); final Intent courseDetail; { if (config.isTabsDashboardEnabled()) { courseDetail = new Intent(activity, NewCourseOutlineActivity.class); } else { courseDetail = new Intent(activity, CourseOutlineActivity.class); } } courseDetail.putExtra(EXTRA_BUNDLE, courseBundle); courseDetail.putExtra(EXTRA_LAST_ACCESSED_ID, lastAccessedId); courseDetail.putExtra(EXTRA_IS_VIDEOS_MODE, isVideosMode); return courseDetail; }

Target:
private Intent createCourseOutlineIntent(Activity activity, EnrolledCoursesResponse model, String courseComponentId, String lastAccessedId, boolean isVideosMode) { Bundle courseBundle = new Bundle(); courseBundle.putSerializable(EXTRA_COURSE_DATA, model); courseBundle.putString(EXTRA_COURSE_COMPONENT_ID, courseComponentId); final Intent intent; { if (config.isTabsDashboardEnabled()) { intent = new Intent(activity, NewCourseOutlineActivity.class); } else { intent = new Intent(activity, CourseOutlineActivity.class); } } intent.putExtra(EXTRA_BUNDLE, courseBundle); intent.putExtra(EXTRA_LAST_ACCESSED_ID, lastAccessedId); intent.putExtra(EXTRA_IS_VIDEOS_MODE, isVideosMode); return intent; }
Source:
public List<Map<String, WebElement>> getRowsMappedToHeadings(List<String> headings) { List<List<WebElement>> rows = getRows(); return rows.stream() .map(row -> row.stream().collect(toMap(e -> headings.get(row.indexOf(e)), e -> e))) .collect(toList()); }

Target:
public List<Map<String, WebElement>> getRowsMappedToHeadings(List<String> headings) { List<List<WebElement>> rows = getRows(); return rows.stream() .map(row -> row.stream() .collect(toMap(e -> headings.get(row.indexOf(e)), identity()))) .collect(toList()); }
Source:
public int getItemCount() { int SHIMMER_ITEM_NUMBER = 10; return showShimmer ? SHIMMER_ITEM_NUMBER : recentFiles.size(); }

Target:
public int getItemCount() { if (showShimmer) { return Constants.SHIMMER_ITEM_NUMBER; } else { return recentFiles.size(); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ArtifactCoordinates that = (ArtifactCoordinates) o; if (!getArtifactId().equals(that.getArtifactId())) return false; if (!getGroupId().equals(that.getGroupId())) return false; return getVersion().equals(that.getVersion()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ArtifactCoordinates that = (ArtifactCoordinates) o; if (!getArtifactId().equals(that.getArtifactId())) { return false; } if (!getGroupId().equals(that.getGroupId())) { return false; } return getVersion().equals(that.getVersion()); }