auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private GcsStorageService googleCloudStorageService( Storage storage, String dataFilename, GcsProperties gcsProperties) { GcsStorageService service; ExecutorService executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat(GcsStorageService.class.getName() + "-%s") .build()); service = new GcsStorageService( storage, gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), dataFilename, new ObjectMapper(), executor); service.ensureBucketExists(); log.info( "Using Google Cloud Storage bucket={} in project={}", value("bucket", gcsProperties.getBucket()), value("project", gcsProperties.getProject())); log.info( "Bucket versioning is {}.", value("versioning", service.supportsVersioning() ? "enabled" : "DISABLED")); return service; }

Target:
private GcsStorageService googleCloudStorageService( Storage storage, String dataFilename, GcsProperties gcsProperties) { ExecutorService executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat(GcsStorageService.class.getName() + "-%s") .build()); GcsStorageService service = new GcsStorageService( storage, gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), dataFilename, new ObjectMapper(), executor); log.info( "Using Google Cloud Storage bucket={} in project={}", value("bucket", gcsProperties.getBucket()), value("project", gcsProperties.getProject())); return service; }
Source:
private String lookupVolume(String volumeIdOrName) { if(! Utils.isEmptyOrWhitespaces(volumeIdOrName)) { DescribeVolumesRequest dvs = new DescribeVolumesRequest(Collections.singletonList(volumeIdOrName)); DescribeVolumesResult dvsresult = null; try { dvsresult = this.ec2Api.describeVolumes(dvs); } catch(Exception e) { dvsresult = null; } if(dvsresult == null || dvsresult.getVolumes() == null || dvsresult.getVolumes().size() < 1) { dvs = new DescribeVolumesRequest().withFilters(new Filter().withName("tag:Name").withValues(volumeIdOrName)); try { dvsresult = this.ec2Api.describeVolumes(dvs); } catch(Exception e) { dvsresult = null; } } if(dvsresult == null || dvsresult.getVolumes() == null || dvsresult.getVolumes().size() < 1) return null; else return dvsresult.getVolumes().get(0).getVolumeId(); } return null; }

Target:
private String lookupVolume(String volumeIdOrName) { String ret = null; if(! Utils.isEmptyOrWhitespaces(volumeIdOrName)) { DescribeVolumesRequest dvs = new DescribeVolumesRequest(Collections.singletonList(volumeIdOrName)); DescribeVolumesResult dvsresult = null; try { dvsresult = this.ec2Api.describeVolumes(dvs); } catch(Exception e) { dvsresult = null; } if(dvsresult == null || dvsresult.getVolumes() == null || dvsresult.getVolumes().size() < 1) { dvs = new DescribeVolumesRequest().withFilters(new Filter().withName("tag:Name").withValues(volumeIdOrName)); try { dvsresult = this.ec2Api.describeVolumes(dvs); } catch(Exception e) { dvsresult = null; } } if(dvsresult != null && dvsresult.getVolumes() != null && dvsresult.getVolumes().size() > 0) ret = dvsresult.getVolumes().get(0).getVolumeId(); } return ret; }
Source:
void save(@RequestParam(value = "version", required = false) String version, @RequestBody PipelineTemplate pipelineTemplate) { String templateId = StringUtils.isNotEmpty(version) ? String.format("%s:%s", pipelineTemplate.getId(), version) : pipelineTemplate.getId(); checkForDuplicatePipelineTemplate(templateId); getPipelineTemplateDAO().create(templateId, pipelineTemplate); saveDigest(pipelineTemplate); }

Target:
void save(@RequestParam(value = "version", required = false) String version, @RequestBody PipelineTemplate pipelineTemplate) { if (StringUtils.isNotEmpty(version)) { validatePipelineTemplateVersion(version); } String templateId = StringUtils.isNotEmpty(version) ? String.format("%s:%s", pipelineTemplate.getId(), version) : String.format("%s:%s", pipelineTemplate.getId(), "latest"); try { checkForDuplicatePipelineTemplate(templateId); } catch (DuplicateEntityException dee) { log.debug("Updating latest version for template with id: {}", templateId); return; } getPipelineTemplateDAO().create(templateId, pipelineTemplate); saveDigest(pipelineTemplate); }
Source:
public Docket api() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("org.activiti.services")) .paths(PathSelectors.any()) .build(); }

Target:
public Docket api() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("org.activiti.services.audit")) .paths(PathSelectors.any()) .build(); }
Source:
public InputStream getContent() throws IOException { InputStream in; try { in = connection.getInputStream(); } catch (IOException e) { in = connection.getErrorStream(); if (in == null) { throw e; } } statusCode = connection.getResponseCode(); successful = statusCode < 400; headers = new HashMap<String, Collection<String>>(); for (Entry<String, List<String>> entry : connection.getHeaderFields().entrySet()) { headers.put(entry.getKey(), entry.getValue()); } String encoding = connection.getHeaderField("Content-Encoding"); if (config.getMaxResponseSize() > 0) { in = new LimitingInputStream(config.getMaxResponseSize(), in); } if ("gzip".equals(encoding)) { in = new GZIPInputStream(in); } if (config.hasMessageHandlers() || config.isTraceMessage()) { byte[] bytes = FileUtil.toBytes(in); in = new ByteArrayInputStream(bytes); if (config.hasMessageHandlers()) { Iterator<MessageHandler> it = config.getMessagerHandlers(); while(it.hasNext()) { MessageHandler handler = it.next(); if (handler instanceof MessageHandlerWithHeaders) { ((MessageHandlerWithHeaders) handler).handleResponse(url, bytes, connection.getHeaderFields()); } else { handler.handleResponse(url, bytes); } } } if (config.isTraceMessage()) { Map<String, List<String>> headers = connection.getHeaderFields(); for (Map.Entry header : headers.entrySet()) { config.getTraceStream().print(header.getKey()); config.getTraceStream().print("="); config.getTraceStream().println(header.getValue()); } config.teeInputStream(bytes); } } return in; }

Target:
public InputStream getContent() throws IOException { InputStream in; try { in = connection.getInputStream(); } catch (IOException e) { in = connection.getErrorStream(); if (in == null) { throw e; } } statusCode = connection.getResponseCode(); successful = statusCode < 400; headers = new HashMap<String, Collection<String>>(connection.getHeaderFields()); String encoding = connection.getHeaderField("Content-Encoding"); if (config.getMaxResponseSize() > 0) { in = new LimitingInputStream(config.getMaxResponseSize(), in); } if ("gzip".equals(encoding)) { in = new GZIPInputStream(in); } if (config.hasMessageHandlers() || config.isTraceMessage()) { byte[] bytes = FileUtil.toBytes(in); in = new ByteArrayInputStream(bytes); if (config.hasMessageHandlers()) { Iterator<MessageHandler> it = config.getMessagerHandlers(); while(it.hasNext()) { MessageHandler handler = it.next(); if (handler instanceof MessageHandlerWithHeaders) { ((MessageHandlerWithHeaders) handler).handleResponse(url, bytes, connection.getHeaderFields()); } else { handler.handleResponse(url, bytes); } } } if (config.isTraceMessage()) { Map<String, List<String>> headers = connection.getHeaderFields(); for (Map.Entry header : headers.entrySet()) { config.getTraceStream().print(header.getKey()); config.getTraceStream().print("="); config.getTraceStream().println(header.getValue()); } config.teeInputStream(bytes); } } return in; }
Source:
private PhoenixJson getPhoenixJsonInternal(String[] paths) { JsonNode node = this.rootNode; for (String path : paths) { JsonNode nodeTemp = null; if (node.isArray()) { int index = Integer.parseInt(path); nodeTemp = node.path(index); } else { nodeTemp = node.path(path); } if (nodeTemp == null || nodeTemp.isMissingNode()) { return null; } node = nodeTemp; } return new PhoenixJson(node, null); }

Target:
private PhoenixJson getPhoenixJsonInternal(String[] paths) { JsonNode node = this.rootNode; for (String path : paths) { JsonNode nodeTemp = null; if (node.isArray()) { int index = Integer.parseInt(path); nodeTemp = node.path(index); } else { nodeTemp = node.path(path); } if (nodeTemp == null || nodeTemp.isMissingNode()) { return null; } node = nodeTemp; } return new PhoenixJson(node, node.toString()); }
Source:
public int getNumberOfTestGroups(String sessionId) { getData(sessionId); int numberOfTestGroups = 0; Integer groupIndex = null; for (TestEntity testEntity : metricsPerTest.keySet()) { if (groupIndex == null) { groupIndex = testEntity.getTestGroupIndex(); numberOfTestGroups ++; } if (!groupIndex.equals(testEntity.getTestGroupIndex())) { numberOfTestGroups ++; } } return numberOfTestGroups; }

Target:
public int getNumberOfTestGroups(String sessionId) { getData(sessionId); Set<Integer> testGroupsIndexes = new HashSet<Integer>(); for (TestEntity testEntity : metricsPerTest.keySet()) { testGroupsIndexes.add(testEntity.getTestGroupIndex()); } return testGroupsIndexes.size(); }
Source:
public void testReleaseCheckpoint() throws Exception { Handle h = db.openHandle(); h.begin(); h.checkpoint("first"); h.insert("insert into something (id, name) values (:id, :name)", 1, "Martin"); h.release("first"); try { h.rollback("first"); fail("Should have thrown an exception of some kind"); } catch (TransactionException e) { assertThat(e).isNotNull(); h.rollback(); } }

Target:
public void testReleaseCheckpoint() throws Exception { Handle h = db.openHandle(); h.begin(); h.checkpoint("first"); h.insert("insert into something (id, name) values (:id, :name)", 1, "Martin"); h.release("first"); assertThatExceptionOfType(TransactionException.class) .isThrownBy(() -> h.rollback("first")); }
Source:
private void transfer(EmbeddedChannel outChannel, EmbeddedChannel inChannel) { while (true) { ByteBuf encoded = outChannel.readOutbound(); if (encoded == null) { return; } inChannel.writeInbound(encoded); } }

Target:
private void transfer(EmbeddedChannel outChannel, EmbeddedChannel inChannel) { for (;;) { ByteBuf encoded = outChannel.readOutbound(); if (encoded == null) { return; } inChannel.writeInbound(encoded); } }
Source:
public void mappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { kvStore = factory.newStore(factory.newConfiguration(factory.getKeyType(), factory.getValueType(), null, null, null)); Set<K> inputKeys = new HashSet<K>(); int nbElements = 10; for (long i = 0; i < nbElements; i++) { K k = factory.createKey(i); V v = factory.createValue(i); inputKeys.add(k); kvStore.put(k, v); } try { kvStore.bulkComputeIfAbsent(inputKeys, new Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends K> entries) { assertThat(entries.iterator().hasNext(), is(false)); return new HashMap<K, V>().entrySet(); } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }

Target:
public void mappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { Set<K> inputKeys = new HashSet<K>(); int nbElements = 10; for (long i = 0; i < nbElements; i++) { K k = factory.createKey(i); V v = factory.createValue(i); inputKeys.add(k); kvStore.put(k, v); } try { kvStore.bulkComputeIfAbsent(inputKeys, new Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends K> entries) { assertThat(entries.iterator().hasNext(), is(false)); return new HashMap<K, V>().entrySet(); } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }
Source:
private InetSocketAddress getAddress() { for (InetSocketAddress address : mConnectDetails.getAddresses()) { try { LOG.debug("Checking whether is listening for RPCs", address); pingMetaService(address); LOG.debug("Successfully connected to {}", address); return address; } catch (UnavailableException e) { LOG.debug("Failed to connect to {}", address); continue; } catch (DeadlineExceededException e) { LOG.debug("Timeout while connecting to {}", address); continue; } catch (AlluxioStatusException e) { LOG.debug("Exception while connecting to {}. error: {}", address, e.getMessage()); continue; } } return null; }

Target:
private InetSocketAddress getAddress() { for (InetSocketAddress address : mConnectDetails.getAddresses()) { try { LOG.debug("Checking whether is listening for RPCs", address); pingMetaService(address); LOG.debug("Successfully connected to {}", address); return address; } catch (UnavailableException e) { LOG.debug("Failed to connect to {}", address); continue; } catch (DeadlineExceededException e) { LOG.debug("Timeout while connecting to {}", address); continue; } catch (AlluxioStatusException e) { throw new RuntimeException( String.format("Received exception from %s. message: %s", address, e.getMessage()), e); } } return null; }
Source:
public void deleteAllGroups(PerunSession sess, Vo vo) throws InternalErrorException, GroupAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved { for(Group group: getGroupsManagerImpl().getGroups(sess, vo)) { if (group.getName().equals(VosManager.MEMBERS_GROUP)) { continue; } List<Resource> assignedResources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, group); try { for(Resource resource : assignedResources) { getPerunBl().getResourcesManagerBl().removeGroupFromResource(sess, group, resource); getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, resource, group); } getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, group); } catch(GroupNotDefinedOnResourceException ex) { throw new ConsistencyErrorException(ex); } catch(AttributeValueException ex) { throw new ConsistencyErrorException("All resources was removed from this group. So all attributes values can be removed.", ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { this.deleteGroup(sess, group, true); } catch (RelationExistsException | GroupNotExistsException e) { throw new ConsistencyErrorException(e); } } getPerunBl().getAuditer().log(sess, new AllGroupsFromVoDeleted(vo)); }

Target:
public void deleteAllGroups(PerunSession sess, Vo vo) throws InternalErrorException, GroupAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved { for(Group group: getGroupsManagerImpl().getGroups(sess, vo)) { if (group.getName().equals(VosManager.MEMBERS_GROUP)) { continue; } List<Resource> assignedResources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, group); try { for(Resource resource : assignedResources) { getPerunBl().getResourcesManagerBl().removeGroupFromResource(sess, group, resource); getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, resource, group); } getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, group); } catch(GroupNotDefinedOnResourceException ex) { throw new ConsistencyErrorException(ex); } catch(AttributeValueException ex) { throw new ConsistencyErrorException("All resources was removed from this group. So all attributes values can be removed.", ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { this.deleteGroup(sess, group, true); } catch (RelationExistsException | GroupNotExistsException e) { throw new ConsistencyErrorException(e); } } }
Source:
public Expression<?> visit(Path<?> expr, @Nullable Void context) { expr = (Path<?>) super.visit(expr, null); PathMetadata<?> pathMetadata = expr.getMetadata(); if (pathMetadata.getPathType() == PathType.MAPVALUE || pathMetadata.getPathType() == PathType.MAPVALUE_CONSTANT) { Path<?> replacement = replacements.get(expr); if (replacement == null) { Path parent = pathMetadata.getParent(); ParametrizedExpression parExpr = (ParametrizedExpression) parent; replacement = new PathImpl(parExpr.getParameter(1), ExpressionUtils.createRootVariable(parent)); metadata.addJoin(JoinType.JOIN, ExpressionUtils.as(parent, replacement)); metadata.addJoinCondition(ExpressionUtils.eq( Expressions.operation(parExpr.getParameter(0), JPQLOps.KEY, replacement), ExpressionUtils.toExpression(pathMetadata.getElement()))); replacements.put(expr, replacement); } return replacement; } else { return super.visit(expr, context); } }

Target:
public Expression<?> visit(Path<?> expr, @Nullable Void context) { expr = (Path<?>) super.visit(expr, null); PathMetadata pathMetadata = expr.getMetadata(); if (pathMetadata.getPathType() == PathType.MAPVALUE || pathMetadata.getPathType() == PathType.MAPVALUE_CONSTANT) { Path<?> replacement = replacements.get(expr); if (replacement == null) { Path parent = pathMetadata.getParent(); ParametrizedExpression parExpr = (ParametrizedExpression) parent; replacement = new PathImpl(parExpr.getParameter(1), ExpressionUtils.createRootVariable(parent)); metadata.addJoin(JoinType.JOIN, ExpressionUtils.as(parent, replacement)); metadata.addJoinCondition(ExpressionUtils.eq( Expressions.operation(parExpr.getParameter(0), JPQLOps.KEY, replacement), ExpressionUtils.toExpression(pathMetadata.getElement()))); replacements.put(expr, replacement); } return replacement; } else { return super.visit(expr, context); } }
Source:
private DashboardInfo findProjectDefaultDashboard(ProjectState projectState) { final Project.NameKey projectName = projectState.getProject().getNameKey(); Project.NameKey parent; DashboardInfo info; Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(projectName); boolean considerLocal = true; do { info = loadProjectDefaultDashboard(projectState, considerLocal); if (info != null) { return info; } parent = projectState.getProject().getParent(); if (parent == null || !seen.add(parent)) { break; } projectState = projectCache.get(parent); considerLocal = false; } while (projectState != null); projectState = projectCache.getAllProjects(); parent = projectState.getProject().getNameKey(); if (seen.add(parent)) { info = loadProjectDefaultDashboard(projectState, considerLocal); } return info; }

Target:
private DashboardInfo findProjectDefaultDashboard(ProjectState projectState) { final Project.NameKey projectName = projectState.getProject().getNameKey(); Project.NameKey parent; DashboardInfo info; Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(projectName); boolean considerLocal = true; do { info = loadProjectDefaultDashboard(projectState, considerLocal); if (info != null) { return info; } considerLocal = false; parent = projectState.getProject().getParent(allProjects); projectState = projectCache.get(parent); } while (projectState != null && seen.add(parent)); return info; }
Source:
public static void GetClustersWithPermittedAction(AsyncQuery aQuery, ActionGroup actionGroup, final boolean supportsVirtService, final boolean supportsGlusterService) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source != null) { ArrayList<VDSGroup> list = (ArrayList<VDSGroup>) source; final ArrayList<VDSGroup> filteredList = new ArrayList<VDSGroup>(); for(VDSGroup cluster : list) { if ((supportsVirtService && cluster.supportsVirtService()) || (supportsGlusterService && cluster.supportsGlusterService())) { filteredList.add(cluster); } } Collections.sort(filteredList, new Linq.VdsGroupByNameComparer()); return filteredList; } return new ArrayList<VDSGroup>(); } }; GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new GetEntitiesWithPermittedActionParameters(); getEntitiesWithPermittedActionParameters.setActionGroup(actionGroup); Frontend.RunQuery(VdcQueryType.GetClustersWithPermittedAction, getEntitiesWithPermittedActionParameters, aQuery); }

Target:
public static void GetClustersWithPermittedAction(AsyncQuery aQuery, ActionGroup actionGroup, final boolean supportsVirtService, final boolean supportsGlusterService) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source != null) { ArrayList<VDSGroup> list = (ArrayList<VDSGroup>) source; return getClusterByServiceList(list, supportsVirtService, supportsGlusterService); } return new ArrayList<VDSGroup>(); } }; GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new GetEntitiesWithPermittedActionParameters(); getEntitiesWithPermittedActionParameters.setActionGroup(actionGroup); Frontend.RunQuery(VdcQueryType.GetClustersWithPermittedAction, getEntitiesWithPermittedActionParameters, aQuery); }
Source:
private void closeWriters(String source, Map<String, AzureBlobWriter> sourceWriterMap) throws Exception { Set<CompletableFuture<Void>> pendingClose = ConcurrentHashMap.newKeySet(); try { sourceWriterMap.forEach((stream, writer) -> { LOG.info("Closing topic:{}", stream); CompletableFuture<Void> future = CompletableFuture.runAsync(new Runnable() { @Override public void run() { try { writer.close(); } catch (Throwable e) { throw new SystemProducerException("Close failed for topic " + stream, e); } } }, asyncBlobThreadPool); pendingClose.add(future); future.handle((aVoid, throwable) -> { sourceWriterMap.remove(writer); if (throwable != null) { throw new SystemProducerException("Close failed for topic " + stream, throwable); } else { LOG.info("Blob close finished for stream " + stream); return aVoid; } }); }); CompletableFuture<Void> future = CompletableFuture.allOf(pendingClose.toArray(new CompletableFuture[0])); LOG.info("Flush source: has pending closes: ", source, pendingClose.size()); future.get((long) closeTimeout, TimeUnit.MILLISECONDS); } finally { pendingClose.clear(); } }

Target:
private void closeWriters(String source, Map<String, AzureBlobWriter> sourceWriterMap) throws Exception { Set<CompletableFuture<Void>> pendingClose = ConcurrentHashMap.newKeySet(); try { sourceWriterMap.forEach((stream, writer) -> { LOG.info("Closing topic:{}", stream); CompletableFuture<Void> future = CompletableFuture.runAsync(new Runnable() { @Override public void run() { try { writer.close(); } catch (Exception e) { throw new SystemProducerException("Close failed for topic " + stream, e); } } }, asyncBlobThreadPool); pendingClose.add(future); future.handle((aVoid, throwable) -> { sourceWriterMap.remove(writer); if (throwable != null) { throw new SystemProducerException("Close failed for topic " + stream, throwable); } else { LOG.info("Blob close finished for stream " + stream); return aVoid; } }); }); CompletableFuture<Void> future = CompletableFuture.allOf(pendingClose.toArray(new CompletableFuture[0])); LOG.info("Flush source: has pending closes: ", source, pendingClose.size()); future.get((long) closeTimeout, TimeUnit.MILLISECONDS); } finally { pendingClose.clear(); } }
Source:
public void testRandomStrings() throws IOException { DeltaLengthByteArrayValuesWriter writer = new DeltaLengthByteArrayValuesWriter(64 * 1024, 64 * 1024, new DirectByteBufferAllocator()); DeltaLengthByteArrayValuesReader reader = new DeltaLengthByteArrayValuesReader(); String[] values = Utils.getRandomStringSamples(1000, 32); Utils.writeData(writer, values); Binary[] bin = Utils.readData(reader, writer.getBytes().toByteArray(), values.length); for(int i =0; i< bin.length ; i++) { Assert.assertEquals(Binary.fromString(values[i]).toStringUsingUTF8(), bin[i].toStringUsingUTF8()); } }

Target:
public void testRandomStrings() throws IOException { DeltaLengthByteArrayValuesWriter writer = getDeltaLengthByteArrayValuesWriter(); DeltaLengthByteArrayValuesReader reader = new DeltaLengthByteArrayValuesReader(); String[] values = Utils.getRandomStringSamples(1000, 32); Utils.writeData(writer, values); Binary[] bin = Utils.readData(reader, writer.getBytes().toByteArray(), values.length); for(int i =0; i< bin.length ; i++) { Assert.assertEquals(Binary.fromString(values[i]), bin[i]); } }
Source:
public Optional<String> getLocalHadoopConfigurationDirectory() { final String[] possibleHadoopConfPaths = new String[] { System.getenv(Constants.ENV_HADOOP_CONF_DIR), System.getenv(Constants.ENV_HADOOP_HOME + "/etc/hadoop"), System.getenv(Constants.ENV_HADOOP_HOME + "/conf") }; for (String hadoopConfPath: possibleHadoopConfPaths) { if (StringUtils.isNotBlank(hadoopConfPath)) { return Optional.of(hadoopConfPath); } } return Optional.empty(); }

Target:
public Optional<String> getLocalHadoopConfigurationDirectory() { final String[] possibleHadoopConfPaths = new String[] { System.getenv(Constants.ENV_HADOOP_CONF_DIR), System.getenv(Constants.ENV_HADOOP_HOME) + "/etc/hadoop", System.getenv(Constants.ENV_HADOOP_HOME) + "/conf" }; for (String hadoopConfPath: possibleHadoopConfPaths) { if (StringUtils.isNotBlank(hadoopConfPath)) { return Optional.of(hadoopConfPath); } } return Optional.empty(); }
Source:
private void doInit(String scheme, String hostname, int port, String loginUsername, String password, ConnectOptions connectOptions) { CouchDbProperties props = new CouchDbProperties(scheme, hostname, port); if (loginUsername != null && password != null) { CookieInterceptor cookieInterceptor = new CookieInterceptor(loginUsername, password); props.addRequestInterceptors(cookieInterceptor); props.addResponseInterceptors(cookieInterceptor); } if (connectOptions != null) { props.addRequestInterceptors(new TimeoutCustomizationInterceptor(connectOptions .getConnectionTimeout(), connectOptions.getReadTimeout())); props.setMaxConnections(connectOptions.getMaxConnections()); props.setProxyURL(connectOptions.getProxyURL()); if (connectOptions.getProxyUser() != null) { props.addRequestInterceptors(new ProxyAuthInterceptor(connectOptions.getProxyUser (), connectOptions.getProxyPassword())); } if (connectOptions.isSSLAuthenticationDisabled()) { props.addRequestInterceptors(SSLCustomizerInterceptor .SSL_AUTH_DISABLED_INTERCEPTOR); } else { if (connectOptions.getAuthenticatedModeSSLSocketFactory() != null) { props.addRequestInterceptors(new SSLCustomizerInterceptor(connectOptions .getAuthenticatedModeSSLSocketFactory())); } } } this.client = new CouchDbClient(props); setGsonBuilder(new GsonBuilder()); }

Target:
private void doInit(String scheme, String hostname, int port, String loginUsername, String password, ConnectOptions connectOptions) { CouchDbProperties props = new CouchDbProperties(scheme, hostname, port); if (loginUsername != null && password != null) { CookieInterceptor cookieInterceptor = new CookieInterceptor(loginUsername, password); props.addRequestInterceptors(cookieInterceptor); props.addResponseInterceptors(cookieInterceptor); } else { if (loginUsername != null || password != null) { throw new CouchDbException("Either a username and password must be provided, or " + "both values must be null. Please check the credentials and try again."); } } if (connectOptions != null) { props.addRequestInterceptors(new TimeoutCustomizationInterceptor(connectOptions .getConnectionTimeout(), connectOptions.getReadTimeout())); props.setMaxConnections(connectOptions.getMaxConnections()); props.setProxyURL(connectOptions.getProxyURL()); if (connectOptions.getProxyUser() != null) { props.addRequestInterceptors(new ProxyAuthInterceptor(connectOptions.getProxyUser (), connectOptions.getProxyPassword())); } if (connectOptions.isSSLAuthenticationDisabled()) { props.addRequestInterceptors(SSLCustomizerInterceptor .SSL_AUTH_DISABLED_INTERCEPTOR); } else { if (connectOptions.getAuthenticatedModeSSLSocketFactory() != null) { props.addRequestInterceptors(new SSLCustomizerInterceptor(connectOptions .getAuthenticatedModeSSLSocketFactory())); } } } this.client = new CouchDbClient(props); setGsonBuilder(new GsonBuilder()); }
Source:
public void setArmed(boolean newState) { if (this.armed != newState) { this.armed = newState; myDrone.notifyDroneEvent(DroneEventsType.ARMING); if (newState) { myDrone.getWaypointManager().getWaypoints(); }else{ if (mode == ApmModes.ROTOR_RTL | mode == ApmModes.ROTOR_LAND) { changeFlightMode(ApmModes.ROTOR_LOITER); } } } }

Target:
public void setArmed(boolean newState) { if (this.armed != newState) { this.armed = newState; myDrone.notifyDroneEvent(DroneEventsType.ARMING); if (newState) { myDrone.getWaypointManager().getWaypoints(); }else{ if (mode == ApmModes.ROTOR_RTL || mode == ApmModes.ROTOR_LAND) { changeFlightMode(ApmModes.ROTOR_LOITER); } } } }
Source:
private static boolean hasIgnoreAsCallingClassAnnotation(String className) { try { Class< ? > clazz = Class.forName(className); return clazz.isAnnotationPresent(IgnoreAsCallingClass.class); } catch (ClassNotFoundException ignore) { return false; } }

Target:
private static boolean hasIgnoreAsCallingClassAnnotation(String className) { try { Class< ? > clazz = Context.getClassLoader().loadClass(className); return clazz.isAnnotationPresent(IgnoreAsCallingClass.class); } catch (ClassNotFoundException ignore) { return false; } }
Source:
public static ResourceBundle findResourceBundle(String aBundleName, Locale locale) { String key = createMissesKey(aBundleName, locale); ResourceBundle bundle = null; ClassLoader classLoader = getThreadCurrentThreadGetContextClassLoader(); try { key = classLoader.hashCode()+key; if (!bundlesMap.containsKey(key)) { bundle = ResourceBundle.getBundle(aBundleName, locale, classLoader); bundlesMap.putIfAbsent(key, bundle); } else { bundle = bundlesMap.get(key); } } catch (MissingResourceException ex) { if (delegatedClassLoaderMap.containsKey(classLoader.hashCode())) { try { if (!bundlesMap.containsKey(key)) { bundle = ResourceBundle.getBundle(aBundleName, locale, delegatedClassLoaderMap.get(classLoader.hashCode())); bundlesMap.putIfAbsent(key, bundle); } else { bundle = bundlesMap.get(key); } } catch (MissingResourceException e) { } } } return bundle; }

Target:
public static ResourceBundle findResourceBundle(String aBundleName, Locale locale) { ResourceBundle bundle = null; ClassLoader classLoader = getCurrentThreadContextClassLoader(); String key = createMissesKey(String.valueOf(classLoader.hashCode()), aBundleName, locale); try { if (!bundlesMap.containsKey(key)) { bundle = ResourceBundle.getBundle(aBundleName, locale, classLoader); bundlesMap.putIfAbsent(key, bundle); } else { bundle = bundlesMap.get(key); } } catch (MissingResourceException ex) { if (delegatedClassLoaderMap.containsKey(classLoader.hashCode())) { try { if (!bundlesMap.containsKey(key)) { bundle = ResourceBundle.getBundle(aBundleName, locale, delegatedClassLoaderMap.get(classLoader.hashCode())); bundlesMap.putIfAbsent(key, bundle); } else { bundle = bundlesMap.get(key); } } catch (MissingResourceException e) { } } } return bundle; }
Source:
protected void startAdapter(BootstrapProperties bootProperties) throws Exception { boolean startQuietly = bootProperties.isEnabled(CFG_KEY_START_QUIETLY); final UnifiedBootstrap bootstrap = new UnifiedBootstrap(bootProperties); if (!configCheckOnly()) { if (jettyOnly) { System.err.println("Starting Jetty/UI without a local adapter"); bootstrap.init(null); } else { bootstrap.init(bootstrap.createAdapter()); } Runtime.getRuntime().addShutdownHook(new ShutdownHandler(bootProperties)); launchAdapter(bootstrap, startQuietly); } else { new ConfigurationCheckRunner().runChecks(bootProperties, bootstrap).forEach(report -> { System.err.println("\n********************"); System.err.println(report.toString()); System.err.println("\n"); }); LoggingConfigurator.newConfigurator().requestShutdown(); System.err.println("\nConfig check only; terminating"); } }

Target:
protected void startAdapter(BootstrapProperties bootProperties) throws Exception { boolean startQuietly = bootProperties.isEnabled(CFG_KEY_START_QUIETLY); final UnifiedBootstrap bootstrap = new UnifiedBootstrap(bootProperties); if (!configCheckOnly()) { if (jettyOnly) { System.err.println("Starting Jetty/UI without a local adapter"); bootstrap.init(null); } else { bootstrap.init(bootstrap.createAdapter()); } Runtime.getRuntime().addShutdownHook(new ShutdownHandler(bootProperties)); launchAdapter(bootstrap, startQuietly); } else { final List<Exception> fatals = new ArrayList<>(); new ConfigurationCheckRunner().runChecks(bootProperties, bootstrap).forEach(report -> { System.err.println("\n" + report.toString()); if(report.getFailureExceptions().size() > 0) fatals.addAll(report.getFailureExceptions()); }); LoggingConfigurator.newConfigurator().requestShutdown(); System.err.println("\nConfig check only; terminating"); System.exit(fatals.size() > 0 ? 1 : 0); } }
Source:
public void setFlushSize(int flushSize) { this.flushSize = flushSize; }

Target:
public void setFlushSize(int flushSize) { Assert.state(flushSize >= 0, "'flushSize' cannot be less than '0'."); this.flushSize = flushSize; }
Source:
public HTableInterface getTable(ImmutableBytesPtr tablename) throws IOException { String tableName = Bytes.toString(tablename.copyBytesIfNecessary()); if (LOG.isDebugEnabled()) { LOG.debug("Creating new HTable: " + tableName); } return this.e.getTable(TableName.valueOf(tablename.copyBytesIfNecessary())); }

Target:
public HTableInterface getTable(ImmutableBytesPtr tablename) throws IOException { String tableName = Bytes.toString(tablename.copyBytesIfNecessary()); if (LOG.isDebugEnabled()) { LOG.debug("Creating new HTable: " + tableName); } return this.e.getTable(TableName.valueOf(tableName)); }
Source:
public void initializeShallowCommits() throws IOException { assertNotStarted(); ((StartGenerator) pending).initializeShallowCommits(); }

Target:
private void initializeShallowCommits() throws IOException { if (shallowCommitsInitialized) return; shallowCommitsInitialized = true; for (ObjectId id : reader.getShallowCommits()) { final RevCommit commit = lookupCommit(id); commit.parents = new RevCommit[0]; } }
Source:
public RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType batchSubmitTransaction(RespondingGatewayCrossGatewayBatchSubmissionRequestType body, WebServiceContext context) { RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType oResponse = null; try { COREEnvelopeBatchSubmissionResponse oBatchSubmissionResponse = outboundCORE_X12DSGenericBatchRequest.batchSubmitTransaction(body.getCOREEnvelopeBatchSubmission(), body.getAssertion(), body.getNhinTargetCommunities(), null); oResponse = new RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType(); oResponse.setCOREEnvelopeBatchSubmissionResponse(oBatchSubmissionResponse); oResponse.setAssertion(body.getAssertion()); oResponse.setNhinTargetCommunities(body.getNhinTargetCommunities()); } catch (Exception e) { e.printStackTrace(); LOG.error("Failed to send X12DS request to Nwhin. " + e); } return oResponse; }

Target:
public RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType batchSubmitTransaction(RespondingGatewayCrossGatewayBatchSubmissionRequestType body, WebServiceContext context) { RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType oResponse = null; try { COREEnvelopeBatchSubmissionResponse oBatchSubmissionResponse = outboundCORE_X12DSGenericBatchRequest.batchSubmitTransaction(body.getCOREEnvelopeBatchSubmission(), body.getAssertion(), body.getNhinTargetCommunities(), null); oResponse = new RespondingGatewayCrossGatewayBatchSubmissionResponseMessageRequestType(); oResponse.setCOREEnvelopeBatchSubmissionResponse(oBatchSubmissionResponse); oResponse.setAssertion(body.getAssertion()); oResponse.setNhinTargetCommunities(body.getNhinTargetCommunities()); } catch (Exception e) { LOG.error("Failed to send X12DS request to Nwhin. " + e); } return oResponse; }
Source:
public PreferenceMultiLine(Context ctx, AttributeSet attrs) { this(ctx, attrs, 0); }

Target:
public PreferenceMultiLine(Context ctx, AttributeSet attrs) { super(ctx, attrs); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StreamEdge that = (StreamEdge) o; return edgeId != null && edgeId.equals(that.edgeId) && ((outputTag == null && that.outputTag == null) || (outputTag != null && that.outputTag != null && outputTag.equals(that.outputTag))); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StreamEdge that = (StreamEdge) o; return Objects.equals(edgeId, that.edgeId) && Objects.equals(outputTag, that.outputTag); }
Source:
public void publishWithBadHostShouldNotRethrowExceptions() { StandardSlackService service = new StandardSlackService("", "foo", false, "#general", false,"token"); service.setHost("hostvaluethatwillcausepublishtofail"); service.publish("message"); }

Target:
public void publishWithBadHostShouldNotRethrowExceptions() { StandardSlackService service = new StandardSlackService( StandardSlackService.builder() .withBaseUrl("") .withTeamDomain("foo") .withBotUser(false) .withRoomId("#general") .withReplyBroadcast(false) .withPopulatedToken("token")); service.setHost("hostvaluethatwillcausepublishtofail"); service.publish("message"); }
Source:
public void samRecordFactoryTest(final String inputFile) { final File input = new File(TEST_DATA_DIR, inputFile); final SAMRecordFactoryTester factory = new SAMRecordFactoryTester(); final SamReader reader = SamReaderFactory.makeDefault().samRecordFactory(factory).open(input); int i = 0; for (final SAMRecord rec : reader) { ++i; } CloserUtil.close(reader); Assert.assertTrue(i > 0); if (inputFile.endsWith(".sam") || inputFile.endsWith(".sam.gz")) Assert.assertEquals(factory.samRecordsCreated, i); else if (inputFile.endsWith(".bam")) Assert.assertEquals(factory.bamRecordsCreated, i); }

Target:
public void samRecordFactoryTest(final String inputFile) throws IOException { final File input = new File(TEST_DATA_DIR, inputFile); final SAMRecordFactoryTester factory = new SAMRecordFactoryTester(); int i = 0; try(final SamReader reader = SamReaderFactory.makeDefault().samRecordFactory(factory).open(input)){ for (final SAMRecord rec : reader) { ++i; } } Assert.assertTrue(i > 0); if (inputFile.endsWith(".sam") || inputFile.endsWith(".sam.gz")) { Assert.assertEquals(factory.samRecordsCreated, i); } else if (inputFile.endsWith(".bam")) { Assert.assertEquals(factory.bamRecordsCreated, i); } }
Source:
public void init(EmptyAssetsScreen presenter) { this.presenter = presenter; if (!this.presenter.canUpdateProject()) { this.addAsset.disabled = true; } }

Target:
public void init(EmptyAssetsScreen presenter) { this.presenter = presenter; }
Source:
private static List<String> getAddressHierarchyLevels() { List<String> l = new ArrayList<String>(); try { Class<?> svcClass = Context.loadClass("org.openmrs.module.addresshierarchy.service.AddressHierarchyService"); Object svc = Context.getService(svcClass); List<Object> levels = (List<Object>) svcClass.getMethod("getOrderedAddressHierarchyLevels", Boolean.class, Boolean.class).invoke(svc, true, true); Class<?> levelClass = Context.loadClass("org.openmrs.module.addresshierarchy.AddressHierarchyLevel"); Class<?> fieldClass = Context.loadClass("org.openmrs.module.addresshierarchy.AddressField"); for (Object o : levels) { Object addressField = levelClass.getMethod("getAddressField").invoke(o); String fieldName = (String) fieldClass.getMethod("getName").invoke(addressField); l.add(fieldName); } if (l.size() > 1) { Collections.reverse(l); } } catch (Exception e) { throw new APIException("Error obtaining address hierarchy levels", e); } return l; }

Target:
private static List<String> getAddressHierarchyLevels() { List<String> l = new ArrayList<String>(); try { Class<?> svcClass = Context.loadClass("org.openmrs.module.addresshierarchy.service.AddressHierarchyService"); Object svc = Context.getService(svcClass); List<Object> levels = (List<Object>) svcClass.getMethod("getOrderedAddressHierarchyLevels", Boolean.class, Boolean.class).invoke(svc, true, true); Class<?> levelClass = Context.loadClass("org.openmrs.module.addresshierarchy.AddressHierarchyLevel"); Class<?> fieldClass = Context.loadClass("org.openmrs.module.addresshierarchy.AddressField"); for (Object o : levels) { Object addressField = levelClass.getMethod("getAddressField").invoke(o); String fieldName = (String) fieldClass.getMethod("getName").invoke(addressField); l.add(fieldName); } if (l.size() > 1) { Collections.reverse(l); } } catch (ClassNotFoundException cnfe) { } catch (Exception e) { throw new APIException("Error obtaining address hierarchy levels", e); } return l; }
Source:
public void findImplementations() { ResolverUtil<VFS> resolverUtil = new ResolverUtil<>(); resolverUtil.findImplementations(VFS.class, "org.apache.ibatis.io"); Set<Class<? extends VFS>> classSets = resolverUtil.getClasses(); classSets.forEach(c -> Assert.assertTrue(VFS.class.isAssignableFrom(c))); }

Target:
void findImplementations() { ResolverUtil<VFS> resolverUtil = new ResolverUtil<>(); resolverUtil.findImplementations(VFS.class, "org.apache.ibatis.io"); Set<Class<? extends VFS>> classSets = resolverUtil.getClasses(); assertEquals(classSets.size(), 3); classSets.forEach(c -> assertTrue(VFS.class.isAssignableFrom(c))); }
Source:
protected boolean handleReadException(Exception e) { boolean doClose = true; if (!this.isServer() && e instanceof SocketTimeoutException) { long now = System.currentTimeMillis(); try { int soTimeout = this.socket.getSoTimeout(); if (now - this.lastSend < soTimeout && now - this.lastRead < soTimeout * 2) { doClose = false; } else { this.setTimedOut(true); } if (!doClose && logger.isDebugEnabled()) { logger.debug("Skipping a socket timeout because we have a recent send " + this.getConnectionId()); } } catch (SocketException e1) { logger.error("Error accessing soTimeout", e1); doClose = true; } } if (doClose) { boolean noReadErrorOnClose = this.isNoReadErrorOnClose(); this.closeConnection(); if (!(e instanceof SoftEndOfStreamException)) { if (e instanceof SocketTimeoutException && this.isSingleUse()) { if (logger.isDebugEnabled()) { logger.debug("Closed single use socket after timeout:" + this.getConnectionId()); } } else { if (noReadErrorOnClose) { if (logger.isTraceEnabled()) { logger.trace("Read exception " + this.getConnectionId(), e); } else if (logger.isDebugEnabled()) { logger.debug("Read exception " + this.getConnectionId() + " " + e.getClass().getSimpleName() + ":" + (e.getCause() != null ? e.getCause() + ":" : "") + e.getMessage()); } } else if (logger.isTraceEnabled()) { logger.error("Read exception " + this.getConnectionId(), e); } else { logger.error("Read exception " + this.getConnectionId() + " " + e.getClass().getSimpleName() + ":" + (e.getCause() != null ? e.getCause() + ":" : "") + e.getMessage()); } this.sendExceptionToListener(e); } } } return doClose; }

Target:
protected boolean handleReadException(Exception e) { boolean doClose = true; if (!this.isServer() && e instanceof SocketTimeoutException) { long now = System.currentTimeMillis(); try { int soTimeout = this.socket.getSoTimeout(); if (now - this.lastSend < soTimeout && now - this.lastRead < soTimeout * 2) { doClose = false; } if (!doClose && logger.isDebugEnabled()) { logger.debug("Skipping a socket timeout because we have a recent send " + this.getConnectionId()); } } catch (SocketException e1) { logger.error("Error accessing soTimeout", e1); } } if (doClose) { boolean noReadErrorOnClose = this.isNoReadErrorOnClose(); this.closeConnection(true); if (!(e instanceof SoftEndOfStreamException)) { if (e instanceof SocketTimeoutException && this.isSingleUse()) { if (logger.isDebugEnabled()) { logger.debug("Closed single use socket after timeout:" + this.getConnectionId()); } } else { if (noReadErrorOnClose) { if (logger.isTraceEnabled()) { logger.trace("Read exception " + this.getConnectionId(), e); } else if (logger.isDebugEnabled()) { logger.debug("Read exception " + this.getConnectionId() + " " + e.getClass().getSimpleName() + ":" + (e.getCause() != null ? e.getCause() + ":" : "") + e.getMessage()); } } else if (logger.isTraceEnabled()) { logger.error("Read exception " + this.getConnectionId(), e); } else { logger.error("Read exception " + this.getConnectionId() + " " + e.getClass().getSimpleName() + ":" + (e.getCause() != null ? e.getCause() + ":" : "") + e.getMessage()); } this.sendExceptionToListener(e); } } } return doClose; }
Source:
public Iterable<User> users( @NotNull(message = "Search keywords can't be NULL") final String keywords, @NotNull(message = "Sort field can't be NULL") final String sort, @NotNull(message = "Sort order can't be NULL") final String order) throws IOException { return new RtSearchPagination<User>( this.entry, "/search/users", keywords, sort, order, new RtPagination.Mapping<User>() { @Override public User map(final JsonObject object) { return new RtUser( RtSearch.this.ghub, RtSearch.this.entry, object.getString("login") ); } } ); }

Target:
public Iterable<User> users( @NotNull(message = "Search keywords can't be NULL") final String keywords, @NotNull(message = "Sort field can't be NULL") final String sort, @NotNull(message = "Sort order can't be NULL") final String order) throws IOException { return new RtSearchPagination<User>( this.request, "users", keywords, sort, order, new RtPagination.Mapping<User, JsonObject>() { @Override public User map(final JsonObject object) { return RtSearch.this.ghub.users().get( object.getString("login") ); } } ); }
Source:
public int compress(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off > b.length - len) { throw new ArrayIndexOutOfBoundsException(); } int n = compressedDirectBuf.remaining(); if (n > 0) { n = Math.min(n, len); ((ByteBuffer) compressedDirectBuf).get(b, off, n); bytesWritten += n; return n; } compressedDirectBuf.clear(); compressedDirectBuf.limit(0); if (0 == uncompressedDirectBuf.position()) { setInputFromSavedData(); if (0 == uncompressedDirectBuf.position()) { finished = true; return 0; } } n = compressBytesDirect(); compressedDirectBuf.limit(n); uncompressedDirectBuf.clear(); if (0 == userBufLen) { finished = true; } bytesWritten += n; ((ByteBuffer) compressedDirectBuf).get(b, off, n); return n; }

Target:
public int compress(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off > b.length - len) { throw new ArrayIndexOutOfBoundsException(); } int n = compressedDirectBuf.remaining(); if (n > 0) { n = Math.min(n, len); ((ByteBuffer) compressedDirectBuf).get(b, off, n); bytesWritten += n; return n; } compressedDirectBuf.clear(); compressedDirectBuf.limit(0); if (0 == uncompressedDirectBuf.position()) { setInputFromSavedData(); if (0 == uncompressedDirectBuf.position()) { finished = true; return 0; } } n = compressBytesDirect(); compressedDirectBuf.limit(n); uncompressedDirectBuf.clear(); if (0 == userBufLen) { finished = true; } n = Math.min(n, len); bytesWritten += n; ((ByteBuffer) compressedDirectBuf).get(b, off, n); return n; }
Source:
public Executor createExecutor() { return Runnable::run; }

Target:
public Executor createExecutor() { return ForkJoinPool.commonPool(); }
Source:
public double simpleOptionPrice(SimpleOptionData option) { return BlackFormulaRepository.price(option, _surface.getZValue(option.getTimeToExpiry(), option.getStrike())); }

Target:
public double simpleOptionPrice(SimpleOptionData option) { ArgumentChecker.notNull(option, "option"); return BlackFormulaRepository.price(option, _surface.getZValue(option.getTimeToExpiry(), option.getStrike())); }