auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean verifyAvailability(List<? extends URI> locations, boolean one, IProgressMonitor monitor) throws IOException, CoreException { if (locations.isEmpty() || locations.size() > 5) { throw new IllegalArgumentException(); } int countFound = 0; for (URI location : locations) { try { getLastModified(location, monitor); if (one) { return true; } ++countFound; } catch (IOException | CoreException e) { if (!one) { return false; } continue; } } return countFound == locations.size(); }

Target:
public static boolean verifyAvailability(List<? extends URI> locations, boolean one, IProgressMonitor monitor) { if (locations.isEmpty() || locations.size() > 5) { throw new IllegalArgumentException(); } int countFound = 0; MultiStatus status = new MultiStatus(DiscoveryCore.ID_PLUGIN, 0, "Verifying resource availability failed", new Exception()); try { for (URI location : locations) { try { getLastModified(location, monitor); if (one) { return true; } ++countFound; } catch (IOException | CoreException e) { status.add(getStatus(e)); if (!one) { return false; } continue; } } } finally { if (!status.isOK()) { StatusHandler.log(status); } } return countFound == locations.size(); }
Source:
public SpringContextFactory(Config config, Class<?> c, Set<Class<?>> classes) { PersistentSet<Class> s = config.getClasses(); for(Class next : classes){ s = s.plus(next); } s= s.plus(c); Microserver microserver = c.getAnnotation(Microserver.class); final PersistentSet<Class> immutableS = s; s = Optional.ofNullable(microserver) .flatMap(ms -> Optional.ofNullable(ms.blacklistedClasses())) .map(bl -> { Set<Class> blacklistedClasses = Arrays.stream(bl) .collect(Collectors.toSet()); return (PersistentSet<Class>)immutableS.stream() .filter(clazz -> !blacklistedClasses.contains(clazz)).hashSet(); }) .orElse(immutableS); this.classes = s; this.config = config; springBuilder = ReactiveSeq.fromStream(PluginLoader.INSTANCE.plugins.get() .stream()) .filter(m -> m.springBuilder() != null) .map(Plugin::springBuilder) .findFirst() .orElse(new SpringApplicationConfigurator()); }

Target:
public SpringContextFactory(Config config, Class<?> c, Set<Class<?>> classes) { PersistentSet<Class> s = config.getClasses() .plusAll(classes); s= s.plus(c); Microserver microserver = c.getAnnotation(Microserver.class); final PersistentSet<Class> immutableS = s; s = Optional.ofNullable(microserver) .flatMap(ms -> Optional.ofNullable(ms.blacklistedClasses())) .map(bl -> { Set<Class> blacklistedClasses = Arrays.stream(bl) .collect(Collectors.toSet()); return (PersistentSet<Class>)immutableS.stream() .filter(clazz -> !blacklistedClasses.contains(clazz)).hashSet(); }) .orElse(immutableS); this.classes = s; this.config = config; springBuilder = ReactiveSeq.fromStream(PluginLoader.INSTANCE.plugins.get() .stream()) .filter(m -> m.springBuilder() != null) .map(Plugin::springBuilder) .findFirst() .orElse(new SpringApplicationConfigurator()); }
Source:
public void testGetAvailableCollectionTypes() throws Exception { assertEquals(3, oracle.getAvailableCollectionTypes().size()); assertTrue(oracle.getAvailableCollectionTypes().contains("List")); assertTrue(oracle.getAvailableCollectionTypes().contains("HashSet")); assertTrue(oracle.getAvailableCollectionTypes().contains("CustomCollection")); }

Target:
public void testGetAvailableCollectionTypes() throws Exception { assertEquals(3, oracle.getAvailableCollectionTypes().size()); assertTrue(oracle.getAvailableCollectionTypes().contains("List")); assertTrue(oracle.getAvailableCollectionTypes().contains("HashSet")); assertTrue(oracle.getAvailableCollectionTypes().contains("CustomCollectionOne")); assertFalse(oracle.getAvailableCollectionTypes().contains("SeemsAsCollection")); }
Source:
public int getCompletedPositions() { return 0; }

Target:
public long getCompletedPositions() { return completedPositions; }
Source:
public DockerTemplateOptions volumes(Map<String, String> volumes) { for (Map.Entry<String, String> entry : checkNotNull(volumes, "volumes").entrySet()) { checkNotNull(entry.getKey(), "host paths must not be null"); checkNotNull(entry.getValue(), "container paths must not be null"); } this.volumes = Optional.<Map<String, String>>of(ImmutableMap.copyOf(volumes)); return this; }

Target:
public DockerTemplateOptions volumes(Map<String, String> volumes) { this.volumes = Optional.<Map<String, String>>of(ImmutableMap.copyOf(checkNotNull(volumes, "volumes"))); return this; }
Source:
protected void processAnnotatedDiscovery(BeanArchiveBuilder builder) { List<String> builderClasses = new ArrayList<String>(builder.getClasses()); for (String className : builderClasses) { ClassInfo cinfo = cindex.getClassByName(DotName.createSimple(className)); if (!containsBeanDefiningAnnotation(cinfo.annotations().keySet())) { builder.removeClass(className); } } WeldSEBeanDeploymentArchive bda = builder.build(); addToArchives(bda); }

Target:
protected BeanDeploymentArchive processAnnotatedDiscovery(BeanArchiveBuilder builder) { Iterator<String> classIterator = builder.getClassIterator(); while (classIterator.hasNext()) { String className = classIterator.next(); ClassInfo cinfo = cindex.getClassByName(DotName.createSimple(className)); if (!containsBeanDefiningAnnotation(cinfo.annotations().keySet())) { classIterator.remove(); } } WeldSEBeanDeploymentArchive bda = builder.build(); return bda; }
Source:
public Set<SecurityGroup> listSecurityGroupsForNode(String name) { checkNotNull(name, "name"); final String virtualNetworkName; Deployment deployment = api.getDeploymentApiForService(name).get(name); virtualNetworkName = deployment.virtualNetworkName(); List<String> subnetNames = FluentIterable.from(deployment.roles()) .transformAndConcat(new Function<Role, Iterable<Role.ConfigurationSet>>() { @Override public Iterable<Role.ConfigurationSet> apply(Role input) { return input.configurationSets(); } }) .transformAndConcat(new Function<Role.ConfigurationSet, Iterable<Role.ConfigurationSet.SubnetName>>() { @Override public Iterable<Role.ConfigurationSet.SubnetName> apply(Role.ConfigurationSet input) { return input.subnetNames(); } }) .transform(new Function<Role.ConfigurationSet.SubnetName, String>() { @Override public String apply(Role.ConfigurationSet.SubnetName input) { return input.name(); } }) .toList(); return FluentIterable.from(subnetNames) .transform(new Function<String, NetworkSecurityGroup>() { @Override public NetworkSecurityGroup apply(String input) { return api.getNetworkSecurityGroupApi().getNetworkSecurityGroupAppliedToSubnet(virtualNetworkName, input); } }) .transform(new NetworkSecurityGroupSecurityGroupFunction()) .toSet(); }

Target:
public Set<SecurityGroup> listSecurityGroupsForNode(String name) { checkNotNull(name, "name"); Deployment deployment = api.getDeploymentApiForService(name).get(name); final String virtualNetworkName = deployment.virtualNetworkName(); List<String> subnetNames = FluentIterable.from(deployment.roles()) .transformAndConcat(new Function<Role, Iterable<Role.ConfigurationSet>>() { @Override public Iterable<Role.ConfigurationSet> apply(Role input) { return input.configurationSets(); } }) .transformAndConcat(new Function<Role.ConfigurationSet, Iterable<Role.ConfigurationSet.SubnetName>>() { @Override public Iterable<Role.ConfigurationSet.SubnetName> apply(Role.ConfigurationSet input) { return input.subnetNames(); } }) .transform(new Function<Role.ConfigurationSet.SubnetName, String>() { @Override public String apply(Role.ConfigurationSet.SubnetName input) { return input.name(); } }) .toList(); return FluentIterable.from(subnetNames) .transform(new Function<String, NetworkSecurityGroup>() { @Override public NetworkSecurityGroup apply(String input) { return api.getNetworkSecurityGroupApi().getNetworkSecurityGroupAppliedToSubnet(virtualNetworkName, input); } }) .transform(new NetworkSecurityGroupSecurityGroupFunction()) .toSet(); }
Source:
private void startConfigurationProviders(List<Object> components) { components.stream() .filter(component -> ConfigurationProvider.class.isAssignableFrom(component.getClass())) .forEach(configurationProviders -> { try { getMuleRegistry().applyLifecycle(configurationProviders, Initialisable.PHASE_NAME, Startable.PHASE_NAME); } catch (MuleException e) { throw new RuntimeException(e); } }); }

Target:
private void startConfigurationProviders(List<Object> components) { components.stream() .filter(component -> component instanceof ConfigurationProvider) .forEach(configurationProviders -> { try { getMuleRegistry().applyLifecycle(configurationProviders, Initialisable.PHASE_NAME, Startable.PHASE_NAME); } catch (MuleException e) { throw new RuntimeException(e); } }); }
Source:
public void refresh() { runOnMainThread(new Runnable() { @Override public void run() { mImageReader = mImageReaderCreator.create(mResolution); } }); }

Target:
public void refresh() { runOnMainThread(new Runnable() { @Override public void run() { if (mImageReader != null) { mImageReaderToReleaseList.add(mImageReader); } mImageReader = mImageReaderCreator.create(mResolution); } }); }
Source:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fConfigDir = null; SubMonitor subMonitor = SubMonitor.convert(monitor, 4); try { preLaunchCheck(configuration, launch, subMonitor.newChild(2)); } catch (CoreException e) { if (e.getStatus().getSeverity() == IStatus.CANCEL) { monitor.setCanceled(true); return; } throw e; } VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration)); runnerConfig.setVMArguments(getVMArguments(configuration)); runnerConfig.setProgramArguments(getProgramArguments(configuration)); runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath()); runnerConfig.setEnvironment(getEnvironment(configuration)); runnerConfig.setVMSpecificAttributesMap(getVMSpecificAttributesMap(configuration)); monitor.worked(1); setDefaultSourceLocator(configuration); manageLaunch(launch); IVMRunner runner = getVMRunner(configuration, mode); if (runner != null) runner.run(runnerConfig, launch, monitor); else monitor.setCanceled(true); monitor.done(); } catch (final CoreException e) { monitor.setCanceled(true); throw e; } }

Target:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fConfigDir = null; SubMonitor subMonitor = SubMonitor.convert(monitor, 4); try { preLaunchCheck(configuration, launch, subMonitor.newChild(2)); } catch (CoreException e) { if (e.getStatus().getSeverity() == IStatus.CANCEL) { monitor.setCanceled(true); return; } throw e; } VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration)); runnerConfig.setVMArguments(getVMArguments(configuration)); runnerConfig.setProgramArguments(getProgramArguments(configuration)); runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath()); runnerConfig.setEnvironment(getEnvironment(configuration)); runnerConfig.setVMSpecificAttributesMap(getVMSpecificAttributesMap(configuration)); subMonitor.worked(1); setDefaultSourceLocator(configuration); manageLaunch(launch); IVMRunner runner = getVMRunner(configuration, mode); if (runner != null) runner.run(runnerConfig, launch, subMonitor); else subMonitor.setCanceled(true); } catch (final CoreException e) { throw e; } }
Source:
public int unresponsiveHostBackoffTimeSeconds() { return MoreObjects.firstNonNull( ifRuntimeConfigPresent(CassandraKeyValueServiceRuntimeConfig::unresponsiveHostBackoffTimeSeconds), config.unresponsiveHostBackoffTimeSeconds()); }

Target:
public int unresponsiveHostBackoffTimeSeconds() { return chooseConfig(CassandraKeyValueServiceRuntimeConfig::unresponsiveHostBackoffTimeSeconds, config.unresponsiveHostBackoffTimeSeconds()); }
Source:
public void testCreateEmptyBucketedPartition() { testCreateEmptyBucketedPartition(HiveStorageFormat.RCBINARY); }

Target:
public void testCreateEmptyBucketedPartition() { for (TestingHiveStorageFormat storageFormat : getAllTestingHiveStorageFormat()) { testCreateEmptyBucketedPartition(storageFormat.getFormat()); } }
Source:
public OnErrorNotImplementedException(@NonNull Throwable e) { this("The onError handler in the subscribe() method is not provided. Please specify it to avoid this type of exception. Further reading: <LINK_0> | " + (e != null ? e.getMessage() : ""), e); }

Target:
public OnErrorNotImplementedException(@NonNull Throwable e) { this("The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: <LINK_1> | " + (e != null ? e.getMessage() : ""), e); }
Source:
void waitForLoadCompletion() { waitForCriteria(LOAD_TIMEOUT, () -> { return isLoaded(); }); clearLoad(); }

Target:
void waitForLoadCompletion() { waitForCriteria(LOAD_TIMEOUT, () -> isLoaded()); clearLoad(); }
Source:
public void setGroups(List<Group> groups) { Group group1 = Group.nobody(); for (Group group2 : groups) { group1 = group1.or(group2); } setGroup(group1); }

Target:
public void setGroups(List<Group> groups) { this.groups = groups; }
Source:
private static TimeUnit valueOfTimeUnit(String timeUnitString) { try { return Duration.valueOfTimeUnit(timeUnitString); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "TimeUnit string must be one of [ns, us, ms, s, m, h, d]"); } }

Target:
private static TimeUnit valueOfTimeUnit(String timeUnitString) { try { return Duration.valueOfTimeUnit(timeUnitString); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Time unit must be one of [ns, us, ms, s, m, h, d]", e); } }
Source:
public final synchronized Runnable getDelegatedTask() { if (isDestroyed()) { return null; } final Runnable task = SSL.getTask(ssl); if (task == null) { return task; } return new Runnable() { @Override public void run() { try { if (isDestroyed()) { return; } task.run(); } finally { needTask = false; } } }; }

Target:
public final synchronized Runnable getDelegatedTask() { if (isDestroyed()) { return null; } final Runnable task = SSL.getTask(ssl); if (task == null) { return null; } return new Runnable() { @Override public void run() { try { if (isDestroyed()) { return; } task.run(); } finally { needTask = false; } } }; }
Source:
public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); switch ("type") { case "NOT": writeField(generator, "field", fields.get(0)); break; default: writeField(generator, "fields", fields); } generator.writeEndObject(); }

Target:
public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); switch (type) { case "NOT": writeField(generator, "field", fields.get(0)); break; default: writeField(generator, "fields", fields); } generator.writeEndObject(); }
Source:
public void htmlUsage(final PrintStream stream, final String programName, final boolean printCommon) { stream.println("<a id=\"" + programName + "\"/>"); stream.println("<h3>" + programName + "</h3>"); stream.println("<section>"); stream.println("<p>" + htmlEscape(getUsagePreamble()) + "</p>"); boolean hasOptions = false; for (final OptionDefinition optionDefinition : optionDefinitions) { if (!optionDefinition.isCommon || printCommon) { hasOptions = true; break; } } if (hasOptions) { htmlPrintOptions(stream, printCommon); } stream.println("</section>"); }

Target:
public void htmlUsage(final PrintStream stream, final String programName, final boolean printCommon) { stream.println("<h3 id=\"" + programName + "\">" + programName + "</h3>"); stream.println("<section>"); stream.println("<p>" + getUsagePreamble() + "</p>"); boolean hasOptions = false; for (final OptionDefinition optionDefinition : optionDefinitions) { if (!optionDefinition.isCommon || printCommon) { hasOptions = true; break; } } if (hasOptions) { htmlPrintOptions(stream, printCommon); } stream.println("</section>"); }
Source:
public AbstractPostgresKeyValueStore(DataSource dataSource) { Objects.requireNonNull(dataSource); try { Connection connection = dataSource.getConnection(); selectStatement = connection.prepareStatement(String.format("SELECT %s, %s FROM %s WHERE %s = ? AND %s = ?", VALUE_COLUMN, EXPIRES_AT_COLUMN, getTableName(), KEY_COLUMN, CONTEXT_COLUMN)); upsertStatement = connection.prepareStatement(String.format( "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES (?, ?, ?, ?, " + getValueStatementPlaceholder() + ") " + "ON CONFLICT ON CONSTRAINT " + getPkConstraintName() + " DO " + "UPDATE SET %s = ?, %s = ?, %s = " + getValueStatementPlaceholder(), getTableName(), KEY_COLUMN, CONTEXT_COLUMN, LAST_UPDATED_COLUMN, EXPIRES_AT_COLUMN, VALUE_COLUMN, LAST_UPDATED_COLUMN, EXPIRES_AT_COLUMN, VALUE_COLUMN )); lastUpdatedStatement = connection.prepareStatement(String.format("SELECT %s, %s FROM %s WHERE %s = ? AND " + "%s =" + " ?", LAST_UPDATED_COLUMN, EXPIRES_AT_COLUMN, getTableName(), KEY_COLUMN, CONTEXT_COLUMN)); } catch (SQLException e) { throw new RuntimeException(e); } }

Target:
public AbstractPostgresKeyValueStore(DataSource dataSource) { this.dataSource = Objects.requireNonNull(dataSource); }
Source:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkConfig networkConfig, NetworkMetrics networkMetrics, SSLFactory sslFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, Time time) throws Exception { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.time = time; ocList = new ArrayList<OperationController>(routerConfig.routerScalingUnitCount); for (int i = 0; i < routerConfig.routerScalingUnitCount; i++) { ocList.add( new OperationController(this, routerConfig, networkConfig, networkMetrics, sslFactory, notificationSystem, clusterMap, time)); } }

Target:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkConfig networkConfig, NetworkMetrics networkMetrics, SSLFactory sslFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkConfig = networkConfig; this.networkMetrics = networkMetrics; this.sslFactory = sslFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; this.time = time; ocList = new ArrayList<OperationController>(routerConfig.routerScalingUnitCount); for (int i = 0; i < routerConfig.routerScalingUnitCount; i++) { ocList.add(new OperationController()); } }
Source:
public void onPluginDirectoryFetched(PluginStore.OnPluginDirectoryFetched event) { if (isFinishing()) { return; } if (event.isError()) { AppLog.e(AppLog.T.PLUGINS, "An error occurred while fetching the plugin directory: " + event.type); } else { switch (event.type) { case POPULAR: refreshPlugins(PluginListType.POPULAR); break; case NEW: refreshPlugins(PluginListType.NEW); break; } } PluginListType listType = event.type == PluginDirectoryType.POPULAR ? PluginListType.POPULAR : PluginListType.NEW; PluginListFragment fragment = getListFragment(); if (fragment != null && fragment.getListType() == listType) { fragment.onLoadedMore(event.canLoadMore); } }

Target:
public void onPluginDirectoryFetched(PluginStore.OnPluginDirectoryFetched event) { if (isFinishing()) { return; } if (event.isError()) { AppLog.e(AppLog.T.PLUGINS, "An error occurred while fetching the plugin directory: " + event.type); return; } switch (event.type) { case POPULAR: reloadPlugins(PluginListType.POPULAR); break; case NEW: reloadPlugins(PluginListType.NEW); break; } PluginListType listType = event.type == PluginDirectoryType.POPULAR ? PluginListType.POPULAR : PluginListType.NEW; PluginListFragment fragment = getListFragment(); if (fragment != null && fragment.getListType() == listType) { fragment.onLoadedMore(event.canLoadMore); } }
Source:
public void testProxyAuthFail() throws Exception { startProxy(0, "user"); CountDownLatch latch = new CountDownLatch(1); final HttpClientOptions options = new HttpClientOptions() .setProxyOptions(new ProxyOptions() .setType(ProxyType.HTTP) .setHost("localhost") .setPort(proxy.getPort())); HttpClient client = vertx.createHttpClient(options); client.getAbs("https://localhost/", resp -> { log.info("this request is supposed to fail"); fail(); }) .exceptionHandler(e -> { log.warn("Exception", e); latch.countDown(); }) .end(); latch.await(); }

Target:
public void testProxyAuthFail() throws Exception { startProxy(0, "user"); final HttpClientOptions options = new HttpClientOptions() .setProxyOptions(new ProxyOptions() .setType(ProxyType.HTTP) .setHost("localhost") .setPort(proxy.getPort())); HttpClient client = vertx.createHttpClient(options); client.getAbs("https://localhost/", resp -> { fail(); }) .exceptionHandler(e -> testComplete()) .end(); await(); }
Source:
public void sendDocumentFinalizedMessage(IWantDocument iWantDocument) { BodyMailMessage message = buildDocumentFinalizedMessage(iWantDocument); try { emailService.sendMessage(message, false); } catch (Exception e) { String errorMessage = new String("sendDocumentFinalizedMessage, Email could not be sent for IWNT edoc# " + iWantDocument.getDocumentNumber()); LOG.error(errorMessage, e); } }

Target:
public void sendDocumentFinalizedMessage(IWantDocument iWantDocument) { BodyMailMessage message = buildDocumentFinalizedMessage(iWantDocument); try { emailService.sendMessage(message, false); } catch (Exception e) { LOG.error(("sendDocumentFinalizedMessage, Email could not be sent for IWNT edoc# " + iWantDocument.getDocumentNumber()), e); } }
Source:
public JsonObject renderFragment(HttpRequest request, HttpResponse response) { String uriWithoutContextPath = request.getUriWithoutContextPath(); String uriPart = uriWithoutContextPath.substring(UriUtils.FRAGMENTS_URI_PREFIX.length()); String fragmentName = NameUtils.getFullyQualifiedName(rootComponent.getName(), uriPart); Fragment fragment = lookup.getAllFragments().get(fragmentName); if (fragment == null) { throw new FragmentNotFoundException("Requested fragment '" + fragmentName + "' does not exists."); } Model model = new MapModel(request.getFormParams()); RequestLookup requestLookup = createRequestLookup(request, response); API api = new API(sessionRegistry, requestLookup); JsonObject renderedFragment = new JsonObject(); renderedFragment.addProperty("html", fragment.render(model, lookup, requestLookup, api)); renderedFragment.addProperty(Placeholder.headJs.name(), requestLookup.getPlaceholderContent(Placeholder.headJs).orElse(null)); renderedFragment.addProperty(Placeholder.js.name(), requestLookup.getPlaceholderContent(Placeholder.js).orElse(null)); renderedFragment.addProperty(Placeholder.css.name(), requestLookup.getPlaceholderContent(Placeholder.css).orElse(null)); return renderedFragment; }

Target:
public JsonObject renderFragment(HttpRequest request, HttpResponse response) { String uriWithoutContextPath = request.getUriWithoutContextPath(); String uriPart = uriWithoutContextPath.substring(UriUtils.FRAGMENTS_URI_PREFIX.length()); String fragmentName = NameUtils.getFullyQualifiedName(rootComponent.getName(), uriPart); Fragment fragment = lookup.getAllFragments().get(fragmentName); if (fragment == null) { throw new FragmentNotFoundException("Requested fragment '" + fragmentName + "' does not exists."); } Model model = new MapModel(request.getFormParams()); RequestLookup requestLookup = createRequestLookup(request, response); API api = new API(sessionRegistry, requestLookup); JsonObject output = new JsonObject(); output.addProperty("html", fragment.render(model, lookup, requestLookup, api)); output.addProperty(Placeholder.headJs.name(), requestLookup.getPlaceholderContent(Placeholder.headJs).orElse(null)); output.addProperty(Placeholder.js.name(), requestLookup.getPlaceholderContent(Placeholder.js).orElse(null)); output.addProperty(Placeholder.css.name(), requestLookup.getPlaceholderContent(Placeholder.css).orElse(null)); return output; }
Source:
private boolean nfsPing(String hostname) { return (RPC.ping(hostname, RPC.TCP, NFS_PROGRAM, 2) == 0) || (RPC.ping(hostname, RPC.UDP, NFS_PROGRAM, 2) == 0) || (RPC.ping(hostname, RPC.TCP, NFS_PROGRAM, 3) == 0) || (RPC.ping(hostname, RPC.UDP, NFS_PROGRAM, 3) == 0); }

Target:
private boolean nfsPing(String hostname) { return (RPC.ping(hostname, RPC.TCP, NFS_PROGRAM, 3) == 0) || (RPC.ping(hostname, RPC.UDP, NFS_PROGRAM, 3) == 0) || (RPC.ping(hostname, RPC.TCP, NFS_PROGRAM, 2) == 0) || (RPC.ping(hostname, RPC.UDP, NFS_PROGRAM, 2) == 0) || (RPC.ping(hostname, RPC.TCP, NFS_PROGRAM, 4) == 0) || (RPC.ping(hostname, RPC.UDP, NFS_PROGRAM, 4) == 0); }
Source:
private mxCell getOrCreateVertex(AccountDeviceInstance adi, CommunicationsManager commsManager, CommunicationsFilter currentFilter) { final AccountDeviceInstance accountDeviceInstance = adi; final String name = accountDeviceInstance.getAccount().getTypeSpecificID(); final mxCell vertex = nodeMap.computeIfAbsent(name + accountDeviceInstance.getDeviceId(), vertexName -> { long adiRelationshipsCount = 1; try { adiRelationshipsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, currentFilter); } catch (TskCoreException tskCoreException) { logger.log(Level.SEVERE, "Error", tskCoreException); } double size = Math.sqrt(adiRelationshipsCount) + 10; AccountDeviceInstanceKey adiKey = new AccountDeviceInstanceKey(adi, currentFilter, adiRelationshipsCount); mxCell newVertex = (mxCell) insertVertex( getDefaultParent(), name, adiKey, Math.random() * 400, Math.random() * 400, size, size); return newVertex; }); return vertex; }

Target:
private mxCell getOrCreateVertex(AccountDeviceInstance adi, CommunicationsManager commsManager, CommunicationsFilter currentFilter) { final AccountDeviceInstance accountDeviceInstance = adi; final String name = accountDeviceInstance.getAccount().getTypeSpecificID(); final mxCell vertex = nodeMap.computeIfAbsent(name + accountDeviceInstance.getDeviceId(), vertexName -> { long adiRelationshipsCount = 1; try { adiRelationshipsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, currentFilter); } catch (TskCoreException tskCoreException) { logger.log(Level.SEVERE, "There was an error fetching relationships for the node: " + accountDeviceInstance, tskCoreException); } double size = Math.sqrt(adiRelationshipsCount) + 10; AccountDeviceInstanceKey adiKey = new AccountDeviceInstanceKey(adi, currentFilter, adiRelationshipsCount); mxCell newVertex = (mxCell) insertVertex( getDefaultParent(), name, adiKey, Math.random() * 400, Math.random() * 400, size, size); return newVertex; }); return vertex; }
Source:
private String cutTrailingZerosofString(String number) { BigDecimal decimal = new BigDecimal(number); if (decimal.compareTo(BigDecimal.ZERO) == 0) { decimal = BigDecimal.ZERO; } else { decimal = decimal.stripTrailingZeros(); } return decimal.toPlainString(); }

Target:
private String cutTrailingZerosofString(String number) { return new BigDecimal(number).stripTrailingZeros().toPlainString(); }
Source:
public VectorizedParquetRecordReader( InputSplit inputSplit, JobConf conf) { try { serDeStats = new SerDeStats(); projectionPusher = new ProjectionPusher(); initialize(inputSplit, conf); colsToInclude = ColumnProjectionUtils.getReadColumnIDs(conf); rbCtx = new VectorizedRowBatchCtx(); rbCtx.init(createStructObjectInspector(), new String[0]); } catch (Throwable e) { LOG.error("Failed to create the vectorized reader due to exception " + e); throw new RuntimeException(e); } }

Target:
public VectorizedParquetRecordReader( InputSplit inputSplit, JobConf conf) { try { serDeStats = new SerDeStats(); projectionPusher = new ProjectionPusher(); initialize(inputSplit, conf); colsToInclude = ColumnProjectionUtils.getReadColumnIDs(conf); rbCtx = Utilities.getVectorizedRowBatchCtx(conf); } catch (Throwable e) { LOG.error("Failed to create the vectorized reader due to exception " + e); throw new RuntimeException(e); } }
Source:
public static QC to(QcDto dto) { QC to; switch (dto.getType().getQcTarget()) { case "Library": LibraryQC newLibraryQc = new LibraryQC(); Library ownerLibrary = new LibraryImpl(); ownerLibrary.setId(dto.getEntityId()); newLibraryQc.setLibrary(ownerLibrary); to = newLibraryQc; break; case "Sample": SampleQC newSampleQc = new SampleQC(); Sample ownerSample = new SampleImpl(); ownerSample.setId(dto.getEntityId()); newSampleQc.setSample(ownerSample); to = newSampleQc; break; case "Pool": PoolQC newPoolQc = new PoolQC(); Pool ownerPool = new PoolImpl(); ownerPool.setId(dto.getEntityId()); newPoolQc.setPool(ownerPool); to = newPoolQc; break; default: throw new IllegalArgumentException("No such QC target: " + dto.getType().getQcTarget()); } if (dto.getId() != null) { to.setId(dto.getId()); } to.setDate(parseDate(dto.getDate())); to.setResults(dto.getResults()); to.setType(to(dto.getType())); return to; }

Target:
public static QC to(QcDto dto) { QC to; switch (dto.getType().getQcTarget()) { case Library: LibraryQC newLibraryQc = new LibraryQC(); Library ownerLibrary = new LibraryImpl(); ownerLibrary.setId(dto.getEntityId()); newLibraryQc.setLibrary(ownerLibrary); to = newLibraryQc; break; case Sample: SampleQC newSampleQc = new SampleQC(); Sample ownerSample = new SampleImpl(); ownerSample.setId(dto.getEntityId()); newSampleQc.setSample(ownerSample); to = newSampleQc; break; case Pool: PoolQC newPoolQc = new PoolQC(); Pool ownerPool = new PoolImpl(); ownerPool.setId(dto.getEntityId()); newPoolQc.setPool(ownerPool); to = newPoolQc; break; default: throw new IllegalArgumentException("No such QC target: " + dto.getType().getQcTarget()); } if (dto.getId() != null) { to.setId(dto.getId()); } to.setDate(parseDate(dto.getDate())); to.setResults(dto.getResults()); to.setType(to(dto.getType())); return to; }
Source:
public void beginRecognizeReceiptsWithOptions() throws IOException { File sourceFile = new File("{file_source_url}"); Flux<ByteBuffer> buffer = Utility.convertStreamToByteBuffer( new ByteArrayInputStream(Files.readAllBytes(sourceFile.toPath()))); formRecognizerAsyncClient.beginRecognizeReceipts(buffer, sourceFile.length(), FormContentType.IMAGE_JPEG, true, Duration.ofSeconds(5)).subscribe(trainingOperationResponse -> { System.out.println("Polling completed successfully"); trainingOperationResponse.getFinalResult().subscribe(recognizedReceipts -> recognizedReceipts.forEach(recognizedReceipt -> { USReceipt usReceipt = ReceiptExtensions.asUSReceipt(recognizedReceipt); System.out.printf("Page Number: %s%n", usReceipt.getMerchantName().getPageNumber()); System.out.printf("Merchant Name %s%n", usReceipt.getMerchantName().getName()); System.out.printf("Merchant Name Value: %s%n", usReceipt.getMerchantName().getFieldValue()); System.out.printf("Merchant Address %s%n", usReceipt.getMerchantAddress().getName()); System.out.printf("Merchant Address Value: %s%n", usReceipt.getMerchantAddress().getFieldValue()); System.out.printf("Total: %s%n", usReceipt.getTotal().getName()); System.out.printf("Total Value: %s%n", usReceipt.getTotal().getFieldValue()); })); }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-FormContentType-boolean-Duration }

Target:
public void beginRecognizeReceiptsWithOptions() throws IOException { File sourceFile = new File("{file_source_url}"); boolean includeTextDetails = true; Flux<ByteBuffer> buffer = Utility.convertStreamToByteBuffer( new ByteArrayInputStream(Files.readAllBytes(sourceFile.toPath()))); formRecognizerAsyncClient.beginRecognizeReceipts(buffer, sourceFile.length(), FormContentType.IMAGE_JPEG, includeTextDetails, Duration.ofSeconds(5)).subscribe(recognizePollingOperation -> { recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> recognizedReceipts.forEach(recognizedReceipt -> { USReceipt usReceipt = ReceiptExtensions.asUSReceipt(recognizedReceipt); System.out.printf("Page Number: %s%n", usReceipt.getMerchantName().getPageNumber()); System.out.printf("Merchant Name: %s, confidence: %.2f%n", usReceipt.getMerchantName().getFieldValue(), usReceipt.getMerchantName().getConfidence()); System.out.printf("Merchant Address: %s, confidence: %.2f%n", usReceipt.getMerchantAddress().getFieldValue(), usReceipt.getMerchantAddress().getConfidence()); System.out.printf("Merchant Phone Number %s, confidence: %.2f%n", usReceipt.getMerchantPhoneNumber().getFieldValue(), usReceipt.getMerchantPhoneNumber().getConfidence()); System.out.printf("Total: %.2f, confidence: %.2f%n", usReceipt.getTotal().getFieldValue(), usReceipt.getTotal().getConfidence()); })); }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-FormContentType-boolean-Duration }
Source:
public <T> void setAttribute(Class<T> clazz, T value) { if (value == null) { removeAttribute(clazz); } else { synchronized (this) { checkType(clazz); context.setAttribute(clazz.getName(), value); } } }

Target:
public <T> void setAttribute(Class<T> clazz, T value) { if (value == null) { removeAttribute(clazz); } else { synchronized (getContext()) { checkLookupDuplicate(clazz); getContext().setAttribute(clazz.getName(), value); } } }
Source:
protected void registerExtraDatabaseTypes( Properties configuration ) throws KettlePluginException { String impalaSimbaDriverName = configuration.getProperty( "impala.simba.driver", "com.cloudera.impala.jdbc41.Driver" ); JDBC_POSSIBLE_DRIVER_MAP.put( "ImpalaSimba", impalaSimbaDriverName ); }

Target:
protected void registerExtraDatabaseTypes( Properties configuration ) throws KettlePluginException { }
Source:
public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadData(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { String tmp = data.get("give"); features.add(DiscreteFeature.create(data.get(lemma))); } return features; }

Target:
public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadData(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; }
Source:
public Optional<AuthorData> createFrom(DataHolder dataHolder) { if (dataHolder instanceof ItemStack) { if (((ItemStack) dataHolder).getItem() != Items.writable_book || ((ItemStack) dataHolder).getItem() != Items.written_book) { return Optional.empty(); } if (((ItemStack) dataHolder).getTagCompound() == null || ((ItemStack) dataHolder).getTagCompound().hasKey(NbtDataUtil.ITEM_BOOK_AUTHOR)) { return Optional.<AuthorData>of(new SpongeAuthorData()); } final String json = ((ItemStack) dataHolder).getTagCompound().getString(NbtDataUtil.ITEM_BOOK_AUTHOR); final Text author = Texts.json().fromUnchecked(json); return Optional.<AuthorData>of(new SpongeAuthorData(author)); } else { return Optional.empty(); } }

Target:
public Optional<AuthorData> createFrom(DataHolder dataHolder) { if (dataHolder instanceof ItemStack) { if (((ItemStack) dataHolder).getItem() != Items.writable_book && ((ItemStack) dataHolder).getItem() != Items.written_book) { return Optional.empty(); } if (!((ItemStack) dataHolder).hasTagCompound() || !((ItemStack) dataHolder).getTagCompound().hasKey(NbtDataUtil.ITEM_BOOK_AUTHOR)) { return Optional.<AuthorData>of(new SpongeAuthorData()); } final String json = ((ItemStack) dataHolder).getTagCompound().getString(NbtDataUtil.ITEM_BOOK_AUTHOR); final Text author = Texts.json().fromUnchecked(json); return Optional.<AuthorData>of(new SpongeAuthorData(author)); } else { return Optional.empty(); } }
Source:
public void horizontalConflictWithThreeQueens() { Queen queen1 = new Queen(0, row1, column1); Queen queen2 = new Queen(1, row1, column2); Queen queen3 = new Queen(2, row1, column3); constraintVerifier.forConstraint(constraintProvider::horizontalConflict) .given(queen1, queen2, queen3) .expectReward(3); }

Target:
public void horizontalConflictWithThreeQueens() { Queen queen1 = new Queen(0, row1, column1); Queen queen2 = new Queen(1, row1, column2); Queen queen3 = new Queen(2, row1, column3); constraintVerifier.verifyThat(constraintProvider::horizontalConflict) .given(queen1, queen2, queen3) .penalizesBy(3); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.list_fragment, container, false); adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1); ListView listView = (ListView) view.findViewById(android.R.id.list); listView.setAdapter(adapter); AndroidObservable.bindFragment(this, SampleObservables.numberStrings(1, 500, 100)) .observeOn(mainThread()) .lift(new BindAdapter()) .subscribe(); final ProgressBar progressBar = (ProgressBar) view.findViewById(android.R.id.progress); AndroidObservable.bindFragment(this, ViewObservable.listViewScroll(listView)) .subscribe(new Action1<OnListViewScrollEvent>() { @Override public void call(OnListViewScrollEvent event) { if (event.totalItemCount == 0) { return; } int progress = (int) ((100.0 * (event.firstVisibleItem + event.visibleItemCount)) / event.totalItemCount); progressBar.setProgress(progress); } }); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.list_fragment, container, false); adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1); ListView listView = (ListView) view.findViewById(android.R.id.list); listView.setAdapter(adapter); AndroidObservable.bindFragment(this, SampleObservables.numberStrings(1, 500, 100)) .observeOn(mainThread()) .lift(new BindAdapter()) .subscribe(); final ProgressBar progressBar = (ProgressBar) view.findViewById(android.R.id.progress); AndroidObservable.bindFragment(this, ViewObservable.listScrollEvents(listView)) .subscribe(new Action1<OnListViewScrollEvent>() { @Override public void call(OnListViewScrollEvent event) { if (event.totalItemCount == 0) { return; } int progress = (int) ((100.0 * (event.firstVisibleItem + event.visibleItemCount)) / event.totalItemCount); progressBar.setProgress(progress); } }); return view; }
Source:
protected void commitFile(JobContext job, Path source, Path target) throws IOException { log.info(String.format("Overwriting %s to %s", source, target)); try { FileContext.getFileContext(job.getConfiguration()).rename(source, target, Options.Rename.OVERWRITE); } catch (Exception e) { log.error(String.format("Failed to overwrite from %s to %s", source, target)); throw new IOException(String.format("Failed to overwrite from %s to %s", source, target)); } }

Target:
protected void commitFile(JobContext job, Path source, Path target) throws IOException { if (FileSystem.get(job.getConfiguration()).exists(target)) { log.info(String.format("Overwriting %s to %s", source, target)); try { FileContext.getFileContext(job.getConfiguration()).rename(source, target, Options.Rename.OVERWRITE); } catch (Exception e) { log.error(String.format("Failed to overwrite from %s to %s", source, target)); throw new IOException(String.format("Failed to overwrite from %s to %s", source, target)); } } else { super.commitFile(job, source, target); } }
Source:
public Comparator getComparator() { return (Comparator<Object>) (o1, o2) -> { try { if (o1 instanceof ByteBuffer && o2 instanceof ByteBuffer) { BloomKFilter o1f = BloomKFilter.deserialize((ByteBuffer) o1); BloomKFilter o2f = BloomKFilter.deserialize((ByteBuffer) o2); return Ints.compare(o1f.getNumSetBits(), o2f.getNumSetBits()); } else if (o1 instanceof BloomKFilter && o2 instanceof BloomKFilter) { BloomKFilter o1f = (BloomKFilter) o1; BloomKFilter o2f = (BloomKFilter) o2; return Ints.compare(o1f.getNumSetBits(), o2f.getNumSetBits()); } else { throw new RE("Unable to compare unexpected types [%s]", o1.getClass().getName()); } } catch (IOException ioe) { throw new RuntimeException("Failed to deserialize BloomKFilter"); } }; }

Target:
public Comparator getComparator() { return COMPARATOR; }
Source:
public void install(File artifact) throws IOException { log.debug(String.format("ConnectorDeployer.install(\"%s\")", artifact.getAbsolutePath())); ConnectorFile configFile = new ConnectorFile(artifact); ConnectorConfiguration newConfig = ConnectorConfigurationUtil.loadFromFile(configFile); authenticate(AUTH_USER, AUTH_PASSWORD); if (newConfig.getContent().getProperties().get(Constants.SERVICE_RANKING) == null && ConnectorFile.isRootService(artifact)) { newConfig.getContent().getProperties().put(Constants.SERVICE_RANKING, "-1"); } try { serviceManager.createService(newConfig.getConnectorId(), newConfig.getContent()); } catch (ServiceValidationFailedException e) { throw new RuntimeException(e); } }

Target:
public void install(File artifact) throws IOException { LOGGER.debug("ConnectorDeployer.install(\"{}\")", artifact.getAbsolutePath()); ConnectorFile configFile = new ConnectorFile(artifact); ConnectorConfiguration newConfig = configFile.load(); authenticate(AUTH_USER, AUTH_PASSWORD); if (newConfig.getContent().getProperties().get(Constants.SERVICE_RANKING) == null && ConnectorFile.isRootService(artifact)) { newConfig.getContent().getProperties().put(Constants.SERVICE_RANKING, "-1"); } LOGGER.info("Loading instance {}", newConfig.getConnectorId()); try { serviceManager.create(newConfig.getConnectorId(), newConfig.getContent()); } catch (ConnectorValidationFailedException e) { throw new RuntimeException(e); } }
Source:
public void setSeverityLevel(int severityLevel) { this.severityLevel = severityLevel; }

Target:
public void setSeverityLevel(int severityLevel) { if (severityLevel < 1 || severityLevel > 5) { throw new IllegalArgumentException("The severty level should be between 1-5"); } this.severityLevel = severityLevel; }
Source:
public void credentialsChanged(Credentials credentials) { executor.needToRefreshCreds = true; }

Target:
public void credentialsChanged(Credentials credentials) { executor.setNeedToRefreshCreds(); }
Source:
private static Observable<NetworkStatus.State> createObservable(Merlin merlin) { return Observable.create(new MerlinAction(merlin), Emitter.BackpressureMode.LATEST) .distinctUntilChanged(); }

Target:
private static Observable<NetworkStatus> createObservable(Merlin merlin) { return Observable.create(new MerlinAction(merlin), Emitter.BackpressureMode.LATEST); }
Source:
final AsyncFunction<ResultSet, R> iterate() { return resultSet -> { Preconditions.checkArgument(resultSet != null, "ResultSet should not be null when iterating"); rowStreamAccumulator.accumulateRowStream(Streams.stream(resultSet) .limit(resultSet.getAvailableWithoutFetching())); boolean wasLastPage = resultSet.getExecutionInfo().getPagingState() == null; if (wasLastPage) { return Futures.immediateFuture(rowStreamAccumulator.result()); } else { ListenableFuture<ResultSet> future = resultSet.fetchMoreResults(); return Futures.transformAsync(future, iterate(), executor); } }; }

Target:
private AsyncFunction<ResultSet, R> iterate() { return resultSet -> { rowStreamAccumulator.accumulateRowStream(Streams.stream(resultSet) .limit(resultSet.getAvailableWithoutFetching())); boolean wasLastPage = resultSet.getExecutionInfo().getPagingState() == null; if (wasLastPage) { return Futures.immediateFuture(rowStreamAccumulator.result()); } else { ListenableFuture<ResultSet> future = resultSet.fetchMoreResults(); return Futures.transformAsync(future, iterate(), executorService); } }; }
Source:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (!statisticsAggregationOperator.isFinished()) { verify(statisticsAggregationOperator.isBlocked().isDone()); Page page = statisticsAggregationOperator.getOutput(); if (page == null) { return null; } for (int position = 0; position < page.getPositionCount(); position++) { computedStatisticsBuilder.add(getComputedStatistics(page, position)); } return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; outputMetadata = tableFinisher.finishTable(fragmentBuilder.build(), computedStatisticsBuilder.build()); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }

Target:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (!statisticsAggregationOperator.isFinished()) { verify(statisticsAggregationOperator.isBlocked().isDone(), "aggregation operator should not be blocked"); Page page = statisticsAggregationOperator.getOutput(); if (page == null) { return null; } for (int position = 0; position < page.getPositionCount(); position++) { computedStatisticsBuilder.add(getComputedStatistics(page, position)); } return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; outputMetadata = tableFinisher.finishTable(fragmentBuilder.build(), computedStatisticsBuilder.build()); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }
Source:
private CurrencyAmount(Currency currency, double amount) { ArgChecker.notNull(currency, "currency"); this.currency = currency; this.amount = amount; }

Target:
private CurrencyAmount(Currency currency, double amount) { this.currency = ArgChecker.notNull(currency, "currency"); this.amount = amount; }
Source:
protected void addVmWatchdog() { VmWatchdog vmWatchdog = getParameters().getWatchdog(); if (vmWatchdog != null && !VmDeviceUtils.hasWatchdog(getVmTemplateId())) { WatchdogParameters parameters = new WatchdogParameters(); parameters.setId(getParameters().getVmId()); parameters.setAction(vmWatchdog.getAction()); parameters.setModel(vmWatchdog.getModel()); runInternalAction(VdcActionType.AddWatchdog, parameters, cloneContextAndDetachFromParent()); } }

Target:
protected void addVmWatchdog() { VmWatchdog vmWatchdog = getParameters().getWatchdog(); if (vmWatchdog != null) { VdcActionType actionType = VmDeviceUtils.hasWatchdog(getVmTemplateId()) ? VdcActionType.UpdateWatchdog : VdcActionType.AddWatchdog; runInternalAction(actionType, buildAddOrUpdateWatchdogParameters(vmWatchdog), cloneContextAndDetachFromParent()); } }
Source:
public static SecurityPriceInfo ofCurrencyMinorUnit(Currency currency) { int digits = currency.getMinorUnitDigits(); double unitAmount = 1; for (int i = 0; i < digits; i++) { unitAmount = unitAmount / 10; } return new SecurityPriceInfo(unitAmount, CurrencyAmount.of(currency, unitAmount), 1); }

Target:
public static SecurityPriceInfo ofCurrencyMinorUnit(Currency currency) { int digits = currency.getMinorUnitDigits(); double unitAmount = Math.pow(10, -digits); return new SecurityPriceInfo(unitAmount, CurrencyAmount.of(currency, unitAmount), 1); }
Source:
public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.get().checkPermission(Jenkins.SYSTEM_READ); } return this; }

Target:
public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.get().checkPermission(Jenkins.ADMINISTER); } return this; }