auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand() { setGlusterVolumeName(volume.getName()); if (volume.getAccessProtocols() == null) { volume.setAccessProtocol(AccessProtocol.GLUSTER); } VDSReturnValue returnValue = executeVdsCommand( VDSCommandType.CreateGlusterVolume, new CreateGlusterVolumeVDSParameters(getUpServer().getId(), volume)); if (!getSucceeded()) { errorType = AuditLogType.GLUSTER_VOLUME_CREATE_FAILED; return; } GlusterVolumeEntity createdVolume = (GlusterVolumeEntity) returnValue.getReturnValue(); addVolumeToDb(createdVolume); setVolumeOptions(createdVolume); }

Target:
protected void executeCommand() { setGlusterVolumeName(volume.getName()); volume.addAccessProtocol(AccessProtocol.GLUSTER); VDSReturnValue returnValue = runVdsCommand( VDSCommandType.CreateGlusterVolume, new CreateGlusterVolumeVDSParameters(getUpServer().getId(), volume)); setSucceeded(returnValue.getSucceeded()); GlusterVolumeEntity createdVolume = (GlusterVolumeEntity) returnValue.getReturnValue(); addVolumeToDb(createdVolume); setVolumeOptions(createdVolume); }
Source:
public boolean isTimeAtStart(long t) { synchronized (scoreBoardModel) { if (isCountDirectionDown()) { return t == getMaximumTime(); } else { return t == getMinimumTime(); } } }

Target:
public boolean isTimeAtStart(long t) { synchronized (coreLock) { if (isCountDirectionDown()) { return t == getMaximumTime(); } else { return t == getMinimumTime(); } } }
Source:
public void setContainers(Map<FactoryContainer, Attributes> map) { synchronized(_path) { _path.clear(); for (FactoryContainer key : getReversedKeyList(map)) { _path.put(key, map.get(key)); } } }

Target:
public void setContainers(Map<FactoryContainer, Attributes> map) { synchronized(_path) { _path.clear(); for (Entry<FactoryContainer, Attributes> entry : getReversed(_path.entrySet())) { _path.put(entry.getKey(), entry.getValue()); } } }
Source:
public boolean doCommand(final ILayer targetLayer, final FillHandlePasteCommand command) { TransactionalEditingDomain domain = TableEditingDomainUtils.getTableContextEditingDomain(tableManager.getTable()); AbstractTransactionalCommand o = new AbstractTransactionalCommand(domain, null, null) { @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { boolean res = PapyrusFillHandlePasteCommandHandler.super.doCommand(targetLayer, command); return CommandResult.newOKCommandResult(Boolean.valueOf(res)); } }; domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(o)); return ((Boolean) o.getCommandResult().getReturnValue()).booleanValue(); }

Target:
public boolean doCommand(final ILayer targetLayer, final FillHandlePasteCommand command) { TransactionalEditingDomain domain = TableEditingDomainUtils.getTableContextEditingDomain(tableManager.getTable()); final AbstractTransactionalCommand transactionalCommand = new AbstractTransactionalCommand(domain, null, null) { @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { final boolean result = PapyrusFillHandlePasteCommandHandler.super.doCommand(targetLayer, command); return CommandResult.newOKCommandResult(Boolean.valueOf(result)); } }; domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(transactionalCommand)); return ((Boolean) transactionalCommand.getCommandResult().getReturnValue()).booleanValue(); }
Source:
public void crcTest() { Crc32 crc = new Crc32(); byte[] buf = new byte[4000]; new Random().nextBytes(buf); crc.update(buf, 0, 4000); long value1 = crc.getValue(); crc = new Crc32(); crc.update(buf, 0, 4000); long value2 = crc.getValue(); Assert.assertEquals(value1, value2); }

Target:
public void crcTest() { Crc32 crc = new Crc32(); byte[] buf = new byte[4000]; new Random().nextBytes(buf); crc.update(buf, 0, 4000); long value1 = crc.getValue(); crc = new Crc32(); crc.update(buf, 0, 4000); long value2 = crc.getValue(); Assert.assertEquals(value1, value2); buf[3999] = (byte) (~buf[3999]); crc = new Crc32(); crc.update(buf, 0, 4000); long value3 = crc.getValue(); Assert.assertFalse(value1 == value3); }
Source:
private void updateStateForMessages(List<MessageInfo> messageEntries) throws StoreException { ListIterator<MessageInfo> messageEntriesIterator = messageEntries.listIterator(); while (messageEntriesIterator.hasNext()) { MessageInfo messageInfo = messageEntriesIterator.next(); if (!messageInfo.isDeleted()) { IndexValue indexValue = findKey(messageInfo.getStoreKey(), null, EnumSet.allOf(IndexEntryType.class)); messageInfo = new MessageInfo(messageInfo.getStoreKey(), messageInfo.getSize(), indexValue.isFlagSet(IndexValue.Flags.Delete_Index), indexValue.isFlagSet(IndexValue.Flags.Ttl_Update_Index), indexValue.getExpiresAtMs(), indexValue.getAccountId(), indexValue.getContainerId(), indexValue.getOperationTimeInMs()); messageEntriesIterator.set(messageInfo); } } }

Target:
private void updateStateForMessages(List<MessageInfo> messageEntries) throws StoreException { ListIterator<MessageInfo> messageEntriesIterator = messageEntries.listIterator(); while (messageEntriesIterator.hasNext()) { MessageInfo messageInfo = messageEntriesIterator.next(); if (!messageInfo.isDeleted()) { IndexValue indexValue = findKey(messageInfo.getStoreKey(), null, EnumSet.of(IndexEntryType.TTL_UPDATE, IndexEntryType.DELETE)); if (indexValue != null) { messageInfo = new MessageInfo(messageInfo.getStoreKey(), messageInfo.getSize(), indexValue.isFlagSet(IndexValue.Flags.Delete_Index), indexValue.isFlagSet(IndexValue.Flags.Ttl_Update_Index), indexValue.getExpiresAtMs(), indexValue.getAccountId(), indexValue.getContainerId(), indexValue.getOperationTimeInMs()); messageEntriesIterator.set(messageInfo); } } } }
Source:
private static String className(Class<?> clazz) { String className = clazz.getSimpleName() .replaceAll("(.)([A-Z][a-z]+)", "$1_$2") .replaceAll("([a-z0-9])([A-Z])", "$1_$2") .toLowerCase(); String[] parts = clazz.getPackage().getName().split("\\."); if (parts.length == 4) { className = parts[3] + "/" + className; } switch (className) { case "invoice_item": return "invoiceitem"; case "file_upload": return "file"; default: return className; } }

Target:
private static String className(Class<?> clazz) { String className = clazz.getSimpleName() .replaceAll("(.)([A-Z][a-z]+)", "$1_$2") .replaceAll("([a-z0-9])([A-Z])", "$1_$2") .toLowerCase(); String[] parts = clazz.getPackage().getName().split("\\."); assert parts.length == 3 || parts.length == 4; if (parts.length == 4) { className = parts[3] + "/" + className; } switch (className) { case "invoice_item": return "invoiceitem"; case "file_upload": return "file"; default: return className; } }
Source:
JobRecoveryNotActiveException(final UUID jobId, final Throwable cause) { super(buildMessage(jobId), cause); }

Target:
public JobRecoveryNotActiveException(final UUID jobId, final Throwable cause) { super(buildMessage(jobId), cause); }
Source:
public void newUserCanSignUpDesktop() { performSuccessfulSignUpOnDesktopAs(createNewUser()); }

Target:
public void newUserCanSignUpDesktop() { performSignUpOnDesktopAs(createNewUser()); }
Source:
private int getCorrectedMimeSpecificity(MimeType mimeType) { final int ret; final String mimeTypeStr = mimeType.toString(); if (mimeTypeStr.equals("application/octet-stream")) { ret = -1; } else if (mimeTypeStr.equals("text/plain")) { ret = 0; } else { ret = mimeType.getSpecificity(); } return ret; }

Target:
private int getCorrectedMimeSpecificity(MimeType mimeType) { final String mimeTypeStr = mimeType.toString(); if (mimeTypeStr.equals("application/octet-stream")) { return -1; } if (mimeTypeStr.equals("text/plain")) { return 0; } return mimeType.getSpecificity(); }
Source:
public Response getPropertyByPath(@PathParam("clusterId") String clusterId, @PathParam("path") String path) { path = "/" + path; if (!isPathValid(path)) { LOG.error("The path is mis-inputted for cluster {}", path, clusterId); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity( "Invalid path string. Valid path strings use slash as the directory separator and names the location of ZNode") .build()); } String propertyStoreRootPath = PropertyPathBuilder.propertyStore(clusterId); HelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<>( (ZkBaseDataAccessor<ZNRecord>) getDataAccssor(clusterId).getBaseDataAccessor(), propertyStoreRootPath, Collections.emptyList()); ZNRecord record = propertyStore.get(path, null, AccessOption.PERSISTENT); return JSONRepresentation(record); }

Target:
public Response getPropertyByPath(@PathParam("clusterId") String clusterId, @PathParam("path") String path) { path = "/" + path; if (!isPathValid(path)) { LOG.info("The propertyStore path is invalid for cluster {}", path, clusterId); return badRequest( "Invalid path string. Valid path strings use slash as the directory separator and names the location of ZNode"); } final String recordPath = PropertyPathBuilder.propertyStore(clusterId) + path; ZkBaseDataAccessor<byte[]> propertyStoreDataAccessor = getByteArrayDataAccessor(); if (propertyStoreDataAccessor.exists(recordPath, AccessOption.PERSISTENT)) { byte[] bytes = propertyStoreDataAccessor.get(recordPath, null, AccessOption.PERSISTENT); ZNRecord znRecord = (ZNRecord) ZN_RECORD_SERIALIZER.deserialize(bytes); if (znRecord == null) { ObjectNode jsonNode = OBJECT_MAPPER.createObjectNode(); jsonNode.put(CONTENT_KEY, new String(bytes)); return JSONRepresentation(jsonNode); } return JSONRepresentation(znRecord); } else { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND) .entity(String.format("The property store path %s doesn't exist", recordPath)).build()); } }
Source:
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeVInt(output, this.viewInfoTrackerList.size()); for (ViewInfoWritable viewInfoWritable : this.viewInfoTrackerList) { ViewInfoTracker viewInfoTracker = (ViewInfoTracker)viewInfoWritable; viewInfoTracker.write(output); } }

Target:
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeVInt(output, this.viewInfoTrackerList.size()); for (ViewInfoWritable viewInfoWritable : this.viewInfoTrackerList) { if (viewInfoWritable instanceof ViewInfoTracker) { viewInfoWritable.write(output); } } }
Source:
public TransactorCache(Configuration config) { timeoutCache = CacheBuilder.newBuilder().maximumWeight(1000000).weigher(new Weigher<Long,Long>() { @Override public int weigh(Long key, Long value) { return 8 + 8; } }).concurrencyLevel(10).build(); this.config = config; cache = new PathChildrenCache(config.getSharedResources().getCurator(), TransactorID.getNodeRoot(config), true); try { cache.start(StartMode.BUILD_INITIAL_CACHE); status = TcStatus.OPEN; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public TransactorCache(Configuration config) { timeoutCache = CacheBuilder.newBuilder().maximumSize(1 << 15).expireAfterAccess(TxInfoCache.CACHE_TIMEOUT_MIN, TimeUnit.MINUTES).concurrencyLevel(10) .build(); this.config = config; cache = new PathChildrenCache(config.getSharedResources().getCurator(), TransactorID.getNodeRoot(config), true); try { cache.start(StartMode.BUILD_INITIAL_CACHE); status = TcStatus.OPEN; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
private Matcher<DockerContainer> fileExists(final String path) { return new Matcher<DockerContainer>("container with file '%s' in it", path) { @Override public boolean matchesSafely(DockerContainer dock) { try { int exit = Docker.cmd("exec", dock.getCid(), "test", "-e", path).system(); if (exit == 0) return true; if (exit == 1) return false; throw new Error("Unexpected return code while checking for file existence: " + exit); } catch (IOException|InterruptedException e) { throw new Error("Failed testing for file existence in the container", e); } } }; }

Target:
private Matcher<DockerContainer> fileExists(final String path) { return new Matcher<DockerContainer>("container with file/directory '%s' in it", path) { @Override public boolean matchesSafely(DockerContainer dock) { try { int exit = Docker.cmd("exec", dock.getCid(), "test", "-e", path).system(); if (exit == 0) return true; if (exit == 1) return false; throw new Error("Unexpected return code while checking for file existence: " + exit); } catch (IOException|InterruptedException e) { throw new Error("Failed testing for file existence in the container", e); } } }; }
Source:
private boolean noConflictingNetwork() { if (networkExists()) { addCanDoActionMessage(VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_CLUSTER); return false; } return true; }

Target:
private boolean noConflictingNetwork() { if (networkExists()) { return failCanDoAction(VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_CLUSTER); } return true; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } RepositoryVersion other = (RepositoryVersion) obj; if (major == null) { if (other.major != null) { return false; } } else if (!major.equals(other.major)) { return false; } if (micro == null) { if (other.micro != null) { return false; } } else if (!micro.equals(other.micro)) { return false; } if (minor == null) { if (other.minor != null) { return false; } } else if (!minor.equals(other.minor)) { return false; } if (qualifier == null) { if (other.qualifier != null) { return false; } } else if (!qualifier.equals(other.qualifier)) { return false; } return true; }

Target:
public boolean equals(Object obj) { boolean result; if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } RepositoryVersion other = (RepositoryVersion) obj; result = ObjectUtils.equals(major, other.major); if (result) { result = ObjectUtils.equals(minor, other.minor); if (result) { result = ObjectUtils.equals(minor, other.minor); if (result) { result = ObjectUtils.equals(qualifier, other.qualifier); } } } return result; }
Source:
public Blog createBlog(Blog blog) throws ClientServicesException { if (null == blog){ throw new ClientServicesException(null,"null blog"); } Response result = null; try { BaseBlogTransformer transformer = new BaseBlogTransformer(blog); Object payload = transformer.transform(blog.getFieldsMap()); Map<String, String> headers = new HashMap<String, String>(); headers.put("Content-Type", "application/atom+xml"); String createBlogUrl = BlogUrls.MY_BLOGS.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle)); result = createData(createBlogUrl, null, headers, payload); blog = getBlogFeedHandler().createEntity(result); } catch (Exception e) { throw new ClientServicesException(e, "error creating blog post"); } return blog; }

Target:
public Blog createBlog(Blog blog) throws ClientServicesException { if (null == blog){ throw new ClientServicesException(null,"null blog"); } Response result = null; try { BaseBlogTransformer transformer = new BaseBlogTransformer(blog); Object payload = transformer.transform(blog.getFieldsMap()); Map<String, String> headers = new HashMap<String, String>(); headers.put("Content-Type", "application/atom+xml"); String createBlogUrl = BlogUrls.MY_BLOGS.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle)); result = createData(createBlogUrl, null, headers, payload); blog = getBlogFeedHandler().createEntity(result); } catch (IOException e) { throw new ClientServicesException(e, "error creating blog"); } catch (TransformerException e) { throw new ClientServicesException(e, "error creating blog"); } return blog; }
Source:
@Override protected void afterTest() throws Exception { stopAllGrids(); cleanPersistenceDir(); super.afterTest(); }

Target:
@Override protected void afterTest() throws Exception { super.afterTest(); stopAllGrids(); cleanPersistenceDir(); }
Source:
private boolean storageContainsImage(AzureClient client, String resourceGroupName, String storageName, String image) { List<ListBlobItem> listBlobItems = client.listBlobInStorage(resourceGroupName, storageName, IMAGES_CONTAINER); for (ListBlobItem listBlobItem : listBlobItems) { if (getNameFromConnectionString(listBlobItem.getUri().getPath()).equals(image.split("/")[image.split("/").length - 1])) { return true; } } return false; }

Target:
private boolean storageContainsImage(AzureClient client, String resourceGroupName, String storageName, String image) { List<ListBlobItem> listBlobItems = client.listBlobInStorage(resourceGroupName, storageName, IMAGES_CONTAINER); for (ListBlobItem listBlobItem : listBlobItems) { if (getNameFromConnectionString(listBlobItem.getUri().getPath()).equals(getNameFromConnectionString(image))) { return true; } } return false; }
Source:
public Rule CriteriaOnlyFindQuery() { return Sequence( !builder.isCliQuery(), JsonObject() , builder.setOperation( Operation.FIND ), builder.setCriteria( match() ) ); }

Target:
public Rule CriteriaOnlyFindQuery() { return Sequence( !peek().isCliQuery(), JsonParameter( JsonObject() ) , peek().setOperation( Operation.FIND ), peek().setCriteria( match() ) ); }
Source:
public Point computeSize( int wHint, int hHint, boolean changed ) { checkWidget(); int height = 0, width = 0; if( wHint == SWT.DEFAULT || hHint == SWT.DEFAULT ) { Font font = getFont(); boolean wrap = ( style & SWT.WRAP ) != 0 ; int wrapWidth = 0; if( wrap && wHint != SWT.DEFAULT ) { wrapWidth = wHint; } Point extent; Point messageExtent = TextSizeUtil.stringExtent( font, message ); if( ( getStyle() & SWT.SINGLE ) != 0 ) { extent = TextSizeUtil.stringExtent( font, text ); } else { extent = TextSizeUtil.textExtent( font, text, wrapWidth ); } extent.x = Math.max( extent.x, messageExtent.x ); extent.y = Math.max( extent.y, messageExtent.y ); if( extent.x != 0 ) { width = extent.x; } if( extent.y != 0 ) { height = extent.y; } TextThemeAdapter themeAdapter = getThemeAdapter(); CssImage search = themeAdapter.getSearchIconImage( this ); CssImage cancel = themeAdapter.getCancelIconImage( this ); if( ( style & SWT.SEARCH ) != 0 ) { if( ( style & SWT.ICON_SEARCH ) != 0 ) { width += search.width + themeAdapter.getSearchIconSpacing( this ); height = Math.max( height, search.height ); } if( ( style & SWT.ICON_CANCEL ) != 0 ) { width += cancel.width + themeAdapter.getCancelIconSpacing( this ); height = Math.max( height, cancel.height ); } } } if( width == 0 ) { width = DEFAULT_WIDTH; } if( height == 0 ) { height = DEFAULT_HEIGHT; } if( wHint != SWT.DEFAULT ) { width = wHint; } if( hHint != SWT.DEFAULT ) { height = hHint; } height += 2; width += 1; Rectangle trim = computeTrim( 0, 0, width, height ); return new Point( trim.width, trim.height ); }

Target:
public Point computeSize( int wHint, int hHint, boolean changed ) { checkWidget(); int height = 0, width = 0; if( wHint == SWT.DEFAULT || hHint == SWT.DEFAULT ) { Font font = getFont(); boolean wrap = ( style & SWT.WRAP ) != 0 ; int wrapWidth = 0; if( wrap && wHint != SWT.DEFAULT ) { wrapWidth = wHint; } Point extent; Point messageExtent = TextSizeUtil.stringExtent( font, message ); if( ( getStyle() & SWT.SINGLE ) != 0 ) { extent = TextSizeUtil.stringExtent( font, text ); } else { extent = TextSizeUtil.textExtent( font, text, wrapWidth ); } extent.x = Math.max( extent.x, messageExtent.x ); extent.y = Math.max( extent.y, messageExtent.y ); if( extent.x != 0 ) { width = extent.x; } if( extent.y != 0 ) { height = extent.y; } TextThemeAdapter themeAdapter = getThemeAdapter(); CssImage searchImage = themeAdapter.getSearchIconImage( this ); CssImage cancelImage = themeAdapter.getCancelIconImage( this ); if( ( style & SWT.SEARCH ) != 0 ) { if( ( style & SWT.ICON_SEARCH ) != 0 ) { width += searchImage.width + themeAdapter.getSearchIconSpacing( this ); height = Math.max( height, searchImage.height ); } if( ( style & SWT.ICON_CANCEL ) != 0 ) { width += cancelImage.width + themeAdapter.getCancelIconSpacing( this ); height = Math.max( height, cancelImage.height ); } } } if( width == 0 ) { width = DEFAULT_WIDTH; } if( height == 0 ) { height = DEFAULT_HEIGHT; } if( wHint != SWT.DEFAULT ) { width = wHint; } if( hHint != SWT.DEFAULT ) { height = hHint; } height += 2; width += 1; Rectangle trim = computeTrim( 0, 0, width, height ); return new Point( trim.width, trim.height ); }
Source:
protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator + "whitespace" + File.separator + "TypecastParenPad" + File.separator + filename); }

Target:
protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator + "whitespace" + File.separator + "typecastparenpad" + File.separator + filename); }
Source:
protected static SpringApplicationBuilder embedApp( ConfigurableApplicationContext parentContext, String namespace, Class<?> app) { return new SpringApplicationBuilder(new Object[]{app, EmbeddedServletContainerAutoConfiguration.class, EndpointWebMvcManagementContextConfiguration.class, WebMvcAutoConfiguration.EnableWebMvcConfiguration.class, ServerPropertiesAutoConfiguration.class}) .web(true).main(app) .bannerMode(Mode.OFF) .properties("spring.jmx.default-domain=" + namespace) .properties( InternalPropertyNames.NAMESPACE_PROPERTY_NAME + "=" + namespace) .properties("server.port=-1") .registerShutdownHook(false).parent(parentContext); }

Target:
protected static SpringApplicationBuilder embedApp( ConfigurableApplicationContext parentContext, String namespace, Class<?> app) { return new SpringApplicationBuilder(new Object[] { app, RequestMappingConfiguration.class }) .web(false) .bannerMode(Mode.OFF) .properties("spring.jmx.default-domain=" + namespace) .properties( InternalPropertyNames.NAMESPACE_PROPERTY_NAME + "=" + namespace) .registerShutdownHook(false).parent(parentContext); }
Source:
protected boolean canDoAction() { final VM vm = getVm(); if (vm == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__SET); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_TICKET); return false; } final VMStatus status = vm.getstatus(); if (status != VMStatus.Up && status != VMStatus.Paused && status != VMStatus.PoweringUp && status != VMStatus.PoweringDown && status != VMStatus.RebootInProgress) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__SET); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_TICKET); return false; } return canConnectToConsole(); }

Target:
protected boolean canDoAction() { final VM vm = getVm(); if (vm == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); return false; } final VMStatus status = vm.getstatus(); if (status != VMStatus.Up && status != VMStatus.Paused && status != VMStatus.PoweringUp && status != VMStatus.PoweringDown && status != VMStatus.RebootInProgress) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); return false; } return canConnectToConsole(); }
Source:
public static final int compare(String lhs, String rhs) { Version lhsVersion = new Version(lhs); Version rhsVersion = new Version(rhs); int n = Math.max(lhsVersion.size(), rhsVersion.size()); for (int i = 0; i < n; i++) { int lhsComponent = lhsVersion.component(i); int rhsComponent = rhsVersion.component(i); if (lhsComponent < rhsComponent) return -1; else if (lhsComponent > rhsComponent) return 1; } return 0; }

Target:
public static final int compare(String lhs, String rhs) { Version lhsVersion = new Version(lhs); Version rhsVersion = new Version(rhs); return lhsVersion.compareTo(rhsVersion); }
Source:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { {false, "sample"}, {true, "sample:branch"} }); }

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { {false, "sample"}, {true, "sample:branch"}, {false, "sample:project"} }); }
Source:
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AffinityRulesEnforcementPerCluster that = (AffinityRulesEnforcementPerCluster) o; return new EqualsBuilder().append(clusterId, that.getClusterId()).isEquals(); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof AffinityRulesEnforcementPerCluster)) { return false; } AffinityRulesEnforcementPerCluster that = (AffinityRulesEnforcementPerCluster) o; return Objects.equals(clusterId, that.getClusterId()); }
Source:
public ResponseEntity setServerSettings(@RequestBody ServerSettingsForm serverSettingsForm, BindingResult bindingResult, @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader) { validateServerSettingsForm(serverSettingsForm, bindingResult); if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_SAVE_SERVER_SETTINGS, bindingResult); } configurationManagementService.setBaseUrl(serverSettingsForm.getBaseUrl()); configurationManagementService.setPort(serverSettingsForm.getPort()); configurationManagementService.setInstanceName(serverSettingsForm.getInstanceName()); if (serverSettingsForm.getCorsConfigurationForm() != null) { configurationManagementService.setCorsAllowedOrigins( serverSettingsForm.getCorsConfigurationForm().getAllowedOrigins() ); } if (serverSettingsForm.getSmtpConfigurationForm() != null) { configurationManagementService.setSmtpSettings( serverSettingsForm.getSmtpConfigurationForm().getMutableSmtpConfiguration() ); } if (serverSettingsForm.getProxyConfigurationForm() != null) { configurationManagementService.setProxyConfiguration( null, null, serverSettingsForm.getProxyConfigurationForm().getMutableProxyConfiguration() ); } return getSuccessfulResponseEntity(SUCCESSFUL_SAVE_SERVER_SETTINGS, acceptHeader); }

Target:
public ResponseEntity setServerSettings(@RequestBody ServerSettingsForm serverSettingsForm, BindingResult bindingResult, @RequestHeader(HttpHeaders.ACCEPT) String acceptHeader) { if (serverSettingsForm == null) { return getBadRequestResponseEntity(FAILED_EMPTY_FORM, acceptHeader); } validateServerSettingsForm(serverSettingsForm, bindingResult); if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_SAVE_SERVER_SETTINGS, bindingResult); } configurationManagementService.setBaseUrl(serverSettingsForm.getBaseUrl()); configurationManagementService.setPort(serverSettingsForm.getPort()); configurationManagementService.setInstanceName(serverSettingsForm.getInstanceName()); if (serverSettingsForm.getCorsConfigurationForm() != null) { configurationManagementService.setCorsAllowedOrigins( serverSettingsForm.getCorsConfigurationForm().getAllowedOrigins() ); } if (serverSettingsForm.getSmtpConfigurationForm() != null) { configurationManagementService.setSmtpSettings( serverSettingsForm.getSmtpConfigurationForm().getMutableSmtpConfiguration() ); } if (serverSettingsForm.getProxyConfigurationForm() != null) { configurationManagementService.setProxyConfiguration( null, null, serverSettingsForm.getProxyConfigurationForm().getMutableProxyConfiguration() ); } return getSuccessfulResponseEntity(SUCCESSFUL_SAVE_SERVER_SETTINGS, acceptHeader); }
Source:
public void testGetCallbackWhenIsValid() { final DataType dataType = mock(DataType.class); final Command onSuccess = mock(Command.class); validator.getCallback(dataType, onSuccess).callback(true); verify(onSuccess).execute(); }

Target:
public void testGetCallbackWhenIsValid() { final DataType dataType = mock(DataType.class); final Command onSuccess = mock(Command.class); final DataTypeFlashMessage flashMessage = mock(DataTypeFlashMessage.class); when(nameIsInvalidErrorMessage.getFlashMessage(dataType)).thenReturn(flashMessage); validator.getCallback(dataType, onSuccess).callback(true); verify(onSuccess).execute(); verify(flashMessageEvent, never()).fire(flashMessage); }
Source:
public final Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { Map<String, List<String>> tagQueries = new HashMap<>(); Long timestamp = null; for (String field : fields) { if (field.startsWith(timestampKey)) { String[] timestampParts = field.split(tagPairDelimiter); if (timestampParts[1].contains(queryTimeSpanDelimiter)) { return Status.NOT_IMPLEMENTED; } timestamp = Long.valueOf(timestampParts[1]); } else { String[] queryParts = field.split(tagPairDelimiter); tagQueries.computeIfAbsent(queryParts[0], k -> new ArrayList<>()).add(queryParts[1]); } } return read(table, timestamp, tagQueries); }

Target:
public final Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { Map<String, List<String>> tagQueries = new HashMap<>(); Long timestamp = null; for (String field : fields) { if (field.startsWith(timestampKey)) { String[] timestampParts = field.split(tagPairDelimiter); if (timestampParts[1].contains(queryTimeSpanDelimiter)) { return Status.BAD_REQUEST; } timestamp = Long.valueOf(timestampParts[1]); } else { String[] queryParts = field.split(tagPairDelimiter); tagQueries.computeIfAbsent(queryParts[0], k -> new ArrayList<>()).add(queryParts[1]); } } if (timestamp == null) { return Status.BAD_REQUEST; } return read(table, timestamp, tagQueries); }
Source:
private DataFetchingEnvironmentImpl(Builder builder) { this.source = builder.source; this.arguments = builder.arguments == null ? Collections::emptyMap : builder.arguments; this.context = builder.context; this.localContext = builder.localContext; this.root = builder.root; this.fieldDefinition = builder.fieldDefinition; this.mergedField = builder.mergedField; this.fieldType = builder.fieldType; this.parentType = builder.parentType; this.graphQLSchema = builder.graphQLSchema; this.fragmentsByName = builder.fragmentsByName == null ? CollectionsUtil.emptyMap() : builder.fragmentsByName; this.executionId = builder.executionId; this.selectionSet = builder.selectionSet; this.executionStepInfo = builder.executionStepInfo; this.dataLoaderRegistry = builder.dataLoaderRegistry; this.cacheControl = builder.cacheControl; this.locale = builder.locale; this.operationDefinition = builder.operationDefinition; this.document = builder.document; this.variables = builder.variables == null ? ImmutableMapWithNullValues.empty() : builder.variables; this.queryDirectives = builder.queryDirectives; }

Target:
private DataFetchingEnvironmentImpl(Builder builder) { this.source = builder.source; this.arguments = builder.arguments == null ? Collections::emptyMap : builder.arguments; this.context = builder.context; this.localContext = builder.localContext; this.root = builder.root; this.fieldDefinition = builder.fieldDefinition; this.mergedField = builder.mergedField; this.fieldType = builder.fieldType; this.parentType = builder.parentType; this.graphQLSchema = builder.graphQLSchema; this.fragmentsByName = builder.fragmentsByName == null ? ImmutableKit.emptyMap() : builder.fragmentsByName; this.executionId = builder.executionId; this.selectionSet = builder.selectionSet; this.executionStepInfo = builder.executionStepInfo; this.dataLoaderRegistry = builder.dataLoaderRegistry; this.cacheControl = builder.cacheControl; this.locale = builder.locale; this.operationDefinition = builder.operationDefinition; this.document = builder.document; this.variables = builder.variables == null ? ImmutableMapWithNullValues.emptyMap() : builder.variables; this.queryDirectives = builder.queryDirectives; }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); String reportsUrl = Config.<String> getValue(ConfigValues.RedirectServletReportsPage); OutputStream out = response.getOutputStream(); try { if (StringUtils.isEmpty(reportsUrl)) { out.write(REPORTS_WEBAPP_NOT_DEPLOYED_MSG.getBytes(Charset.forName("UTF-8"))); } else { copy(new URL(reportsUrl + "/reports.xml").openStream(), out); } } catch (IOException ex) { out.write(REPORTS_WEBAPP_NOT_DEPLOYED_MSG.getBytes(Charset.forName("UTF-8"))); } finally { out.flush(); out.close(); } }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); String reportsUrl = Config.<String> getValue(ConfigValues.RedirectServletReportsPage); OutputStream out = response.getOutputStream(); try { if (StringUtils.isEmpty(reportsUrl)) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); } else { copy(new URL(reportsUrl + "/reports.xml").openStream(), out); } } catch (IOException ex) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); } finally { out.flush(); out.close(); } }
Source:
@Override public boolean canHandleSource(BufferedSource source) { try { SVG.getFromInputStream(source.peek().inputStream()); return true; } catch (SVGParseException e) { return false; } }

Target:
@Override public boolean canHandleSource(BufferedSource source) { try { SVG.getFromInputStream(source.inputStream()); return true; } catch (SVGParseException e) { return false; } }
Source:
private boolean isElasticAgent(String elasticAgentId, String elasticPluginId) { return isNotBlank(elasticAgentId) || isNotBlank(elasticPluginId); }

Target:
private boolean isElasticAgent(String elasticAgentId, String elasticPluginId) { return isNotBlank(elasticAgentId) && isNotBlank(elasticPluginId); }
Source:
public void setUp() throws Exception { super.setUp(); dao = dbFacade.getStorageServerConnectionLunMapDao(); StorageServerConnectionDao storageServerConnectionDao = dbFacade.getStorageServerConnectionDao(); StorageServerConnections existingConnection = storageServerConnectionDao.get("0cc146e8-e5ed-482c-8814-270bc48c297e"); StorageServerConnections newServerConnection = new StorageServerConnections(); newServerConnection.setid("0cc146e8-e5ed-482c-8814-270bc48c2980"); newServerConnection.setconnection(EXISTING_DOMAIN_STORAGE_NAME); existingLUNStorageMap = dao.get(new LUNStorageServerConnectionMapId("1IET_00180001", existingConnection.getid())); newLUNStorageMap = new LUNStorageServerConnectionMap(FREE_LUN_ID, existingConnection.getid()); }

Target:
public void setUp() throws Exception { super.setUp(); dao = dbFacade.getStorageServerConnectionLunMapDao(); StorageServerConnectionDao storageServerConnectionDao = dbFacade.getStorageServerConnectionDao(); StorageServerConnections existingConnection = storageServerConnectionDao.get("0cc146e8-e5ed-482c-8814-270bc48c297e"); existingLUNStorageMap = dao.get(new LUNStorageServerConnectionMapId("1IET_00180001", existingConnection.getid())); newLUNStorageMap = new LUNStorageServerConnectionMap(FREE_LUN_ID, existingConnection.getid()); }
Source:
public PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedGroupEntry currentGroup = new PdpFeedGroupEntry(); currentGroup.setPayeeName(buildPayeeName(line.getEmployeeLastName(), line.getEmployeeFirstName(), line.getEmployeeMiddleInitital())); currentGroup.setPayeeId(buildPayeeIdEntry(line)); currentGroup.setPaymentDate(formatDate(line.getBatchDate())); currentGroup.setCombineGroupInd(ConcurConstants.COMBINED_GROUP_INDICATOR); currentGroup.setBankCode(ConcurConstants.BANK_CODE); currentGroup.setCustomerInstitutionIdentifier(StringUtils.EMPTY); addAddressesToGroup(line, currentGroup); return currentGroup; }

Target:
public PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedGroupEntry currentGroup = new PdpFeedGroupEntry(); currentGroup.setPayeeName(buildPayeeName(line.getEmployeeLastName(), line.getEmployeeFirstName(), line.getEmployeeMiddleInitital())); currentGroup.setPayeeId(buildPayeeIdEntry(line)); currentGroup.setPaymentDate(formatDate(line.getBatchDate())); currentGroup.setCombineGroupInd(ConcurConstants.COMBINED_GROUP_INDICATOR); currentGroup.setBankCode(ConcurConstants.BANK_CODE); currentGroup.setCustomerInstitutionIdentifier(StringUtils.EMPTY); return currentGroup; }
Source:
public void checkpoint(final Checkpoint checkpoint) throws IOException { memTable.flush(this, checkpoint); super.checkpoint(checkpoint); }

Target:
public void checkpoint(final Checkpoint checkpoint) throws IOException { long numBytesFlushed = memTable.flush(this, checkpoint); if (numBytesFlushed > 0) { entryLogger.rollLog(); } super.checkpoint(checkpoint); }
Source:
public void seek(long pos) throws IOException { checkIfClosed(); Preconditions.checkArgument(pos >= 0, PreconditionMessage.ERR_SEEK_NEGATIVE.toString(), pos); Preconditions .checkArgument(pos <= mLength, PreconditionMessage.ERR_SEEK_PAST_END_OF_REGION.toString(), mId); if (pos == mPos) { return; } if (pos < mPos) { mEOF = false; if (mDataReader instanceof NaiveSharedGrpcDataReader) { NaiveSharedGrpcDataReader reader = (NaiveSharedGrpcDataReader)mDataReader; reader.seek(pos); if (mCurrentChunk != null) { mCurrentChunk.release(); mCurrentChunk = null; } } else { closeDataReader(); } } else if (pos < mLength) { long curPos = mPos; while (mCurrentChunk != null && curPos < pos) { long nextPos = curPos + mCurrentChunk.readableBytes(); if (nextPos <= pos) { curPos = nextPos; mCurrentChunk.release(); mCurrentChunk = mDataReader.readChunkNoWait(); } else { int toRead = (int)(pos - curPos); final byte[] b = new byte[toRead]; mCurrentChunk.readBytes(b, 0, toRead); curPos = pos; } } if (curPos < pos) { closeDataReader(); } } else { closeDataReader(); } mPos = pos; }

Target:
public void seek(long pos) throws IOException { checkIfClosed(); Preconditions.checkArgument(pos >= 0, PreconditionMessage.ERR_SEEK_NEGATIVE.toString(), pos); Preconditions .checkArgument(pos <= mLength, PreconditionMessage.ERR_SEEK_PAST_END_OF_REGION.toString(), mId); if (pos == mPos) { return; } if (!mContext.getClusterConf().getBoolean(PropertyKey.FUSE_SHARED_CACHING_READER_ENABLED)) { if (pos < mPos) { mEOF = false; } closeDataReader(); mPos = pos; return; } if (pos < mPos) { mEOF = false; if (mDataReader instanceof SharedGrpcDataReader) { SharedGrpcDataReader reader = (SharedGrpcDataReader) mDataReader; reader.seek(pos); if (mCurrentChunk != null) { mCurrentChunk.release(); mCurrentChunk = null; } } else { closeDataReader(); } } else { long curPos = mPos; while (mCurrentChunk != null && curPos < pos) { long nextPos = curPos + mCurrentChunk.readableBytes(); if (nextPos <= pos) { curPos = nextPos; mCurrentChunk.release(); mCurrentChunk = mDataReader.readChunkIfReady(); } else { int toRead = (int) (pos - curPos); final byte[] b = new byte[toRead]; mCurrentChunk.readBytes(b, 0, toRead); curPos = pos; } } if (curPos < pos) { closeDataReader(); } } mPos = pos; }
Source:
private final String getConnectionUrl(){ return "plocal:data/" + database; }

Target:
private String getConnectionUrl() { return "remote:" + host + ":" + port + "/" + database; }
Source:
private SinkRecord convertAndTransformRecord(final ConsumerRecord<byte[], byte[]> msg) { SchemaAndValue keyAndSchema = retryWithToleranceOperator.execute(() -> keyConverter.toConnectData(msg.topic(), msg.headers(), msg.key()), Stage.KEY_CONVERTER, keyConverter.getClass()); SchemaAndValue valueAndSchema = retryWithToleranceOperator.execute(() -> valueConverter.toConnectData(msg.topic(), msg.headers(), msg.value()), Stage.VALUE_CONVERTER, valueConverter.getClass()); Headers headers = retryWithToleranceOperator.execute(() -> convertHeadersFor(msg), Stage.HEADER_CONVERTER, headerConverter.getClass()); if (retryWithToleranceOperator.failed()) { return null; } Long timestamp = ConnectUtils.checkAndConvertTimestamp(msg.timestamp()); SinkRecord origRecord = new SinkRecord(msg.topic(), msg.partition(), keyAndSchema.schema(), keyAndSchema.value(), valueAndSchema.schema(), valueAndSchema.value(), msg.offset(), timestamp, msg.timestampType(), headers); log.trace("{} Applying transformations to record in topic '{}' partition at offset and timestamp with key and value {}", this, msg.topic(), msg.partition(), msg.offset(), timestamp, keyAndSchema.value(), valueAndSchema.value()); if (workerConfig.getBoolean(TOPIC_TRACKING_ENABLE_CONFIG)) { recordActiveTopic(origRecord.topic()); } return transformationChain.apply(origRecord); }

Target:
private SinkRecord convertAndTransformRecord(final ConsumerRecord<byte[], byte[]> msg) { SchemaAndValue keyAndSchema = retryWithToleranceOperator.execute(() -> keyConverter.toConnectData(msg.topic(), msg.headers(), msg.key()), Stage.KEY_CONVERTER, keyConverter.getClass()); SchemaAndValue valueAndSchema = retryWithToleranceOperator.execute(() -> valueConverter.toConnectData(msg.topic(), msg.headers(), msg.value()), Stage.VALUE_CONVERTER, valueConverter.getClass()); Headers headers = retryWithToleranceOperator.execute(() -> convertHeadersFor(msg), Stage.HEADER_CONVERTER, headerConverter.getClass()); if (retryWithToleranceOperator.failed()) { return null; } Long timestamp = ConnectUtils.checkAndConvertTimestamp(msg.timestamp()); SinkRecord origRecord = new SinkRecord(msg.topic(), msg.partition(), keyAndSchema.schema(), keyAndSchema.value(), valueAndSchema.schema(), valueAndSchema.value(), msg.offset(), timestamp, msg.timestampType(), headers); log.trace("{} Applying transformations to record in topic '{}' partition at offset and timestamp with key and value {}", this, msg.topic(), msg.partition(), msg.offset(), timestamp, keyAndSchema.value(), valueAndSchema.value()); if (isTopicTrackingEnabled) { recordActiveTopic(origRecord.topic()); } return transformationChain.apply(origRecord); }
Source:
public int getVisibility(IBinding member) { try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getAccessibility(member); } catch (CoreException e) { CCorePlugin.log(e); throw new IllegalArgumentException(member.getName() + " is not a member of " + getName()); } }

Target:
public int getVisibility(IBinding member) { try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getVisibility(member); } catch (CoreException e) { CCorePlugin.log(e); throw new IllegalArgumentException(member.getName() + " is not a member of " + getName()); } }
Source:
public MarketDataResult buildBaseMarketData( MarketDataRequirements requirements, BaseMarketData suppliedData) { ImmutableMap.Builder<MarketDataId<?>, Result<?>> failureBuilder = ImmutableMap.builder(); ImmutableMap.Builder<MarketDataId<?>, Result<?>> timeSeriesFailureBuilder = ImmutableMap.builder(); BaseMarketData builtData = suppliedData; MarketDataNode root = MarketDataNode.buildDependencyTree(requirements, suppliedData, builders); while (!root.isLeaf()) { Pair<MarketDataNode, MarketDataRequirements> pair = root.withLeavesRemoved(); root = pair.getFirst(); MarketDataRequirements leafRequirements = pair.getSecond(); BaseMarketDataBuilder dataBuilder = builtData.toBuilder(); leafRequirements.getTimeSeries().stream() .filter(not(builtData::containsTimeSeries)) .forEach(id -> addTimeSeries(dataBuilder, timeSeriesFailureBuilder, id)); Set<ObservableId> observableIds = leafRequirements.getObservables().stream() .filter(not(builtData::containsValue)) .collect(toImmutableSet()); buildObservableData(observableIds, dataBuilder, failureBuilder); BaseMarketData tmpData = builtData; leafRequirements.getNonObservables().stream() .filter(not(builtData::containsValue)) .forEach(id -> buildNonObservableData(id, tmpData, dataBuilder, failureBuilder)); builtData = dataBuilder.build(); } return MarketDataResult.builder() .marketData(builtData) .singleValueFailures(failureBuilder.build()) .timeSeriesFailures(timeSeriesFailureBuilder.build()) .build(); }

Target:
public MarketDataResult buildBaseMarketData( MarketDataRequirements requirements, BaseMarketData suppliedData) { ImmutableMap.Builder<MarketDataId<?>, Result<?>> failureBuilder = ImmutableMap.builder(); ImmutableMap.Builder<MarketDataId<?>, Result<?>> timeSeriesFailureBuilder = ImmutableMap.builder(); BaseMarketData builtData = suppliedData; MarketDataNode root = MarketDataNode.buildDependencyTree(requirements, suppliedData, builders); while (!root.isLeaf()) { Pair<MarketDataNode, MarketDataRequirements> pair = root.withLeavesRemoved(); MarketDataRequirements leafRequirements = pair.getSecond(); BaseMarketDataBuilder dataBuilder = builtData.toBuilder(); leafRequirements.getTimeSeries().stream() .filter(not(builtData::containsTimeSeries)) .forEach(id -> addTimeSeries(dataBuilder, timeSeriesFailureBuilder, id)); Set<ObservableId> observableIds = leafRequirements.getObservables().stream() .filter(not(builtData::containsValue)) .collect(toImmutableSet()); buildObservableData(observableIds, dataBuilder, failureBuilder); BaseMarketData tmpData = builtData; leafRequirements.getNonObservables().stream() .filter(not(builtData::containsValue)) .forEach(id -> buildNonObservableData(id, tmpData, dataBuilder, failureBuilder)); builtData = dataBuilder.build(); root = pair.getFirst(); } return MarketDataResult.builder() .marketData(builtData) .singleValueFailures(failureBuilder.build()) .timeSeriesFailures(timeSeriesFailureBuilder.build()) .build(); }
Source:
public void onTraversalStart() { if (artifactModes.size() == 0) { artifactModes.add(DEFAULT_ARTIFACT_MODE); } artifactModes.sort(null); final MetricsFile<SequencingArtifactMetrics.PreAdapterDetailMetrics, Comparable<?>> mf = new MetricsFile<>(); try { mf.read(new FileReader(preAdapterMetricsFile)); } catch (final FileNotFoundException fnfe) { throw new UserException("Could not find file: " + preAdapterMetricsFile.getAbsolutePath()); } firstPassVariants = new ArrayList<>(); relevantArtifactModes = new TreeSet<>(); for (String artifactMode: artifactModes) { final String[] splitArtifactMode = artifactMode.split("/"); if (!isValidArtifactMode(splitArtifactMode)) { throw new UserException("Invalid artifact mode: " + String.join("/", splitArtifactMode)); } relevantArtifactModes.add(ArtifactMode.of(splitArtifactMode[0].charAt(0), splitArtifactMode[1].charAt(0))); } artifactModeToPreAdapterScoreMap = PreAdapterOrientationScorer.scoreOrientationBiasMetricsOverContext(mf.getMetrics()); logger.info("preAdapter scores:"); artifactModeToPreAdapterScoreMap.keySet().stream().forEach(k -> logger.info(k + ": " + artifactModeToPreAdapterScoreMap.get(k))); setupVCFWriter(); }

Target:
public void onTraversalStart() { if (transitions.size() == 0) { transitions.add(DEFAULT_ARTIFACT_MODE); } transitions.sort(null); final MetricsFile<SequencingArtifactMetrics.PreAdapterDetailMetrics, Comparable<?>> mf = new MetricsFile<>(); try { mf.read(new FileReader(preAdapterMetricsFile)); } catch (final FileNotFoundException fnfe) { throw new UserException("Could not find file: " + preAdapterMetricsFile.getAbsolutePath()); } relevantTransitions.addAll(transitions.stream().map(s -> convertParameterToTransition(s)).collect(Collectors.toSet())); transitionToPreAdapterScoreMap = PreAdapterOrientationScorer.scoreOrientationBiasMetricsOverContext(mf.getMetrics()); logger.info("preAdapter scores:"); transitionToPreAdapterScoreMap.keySet().stream().forEach(k -> logger.info(k + ": " + transitionToPreAdapterScoreMap.get(k))); setupVCFWriter(); }
Source:
public void before() throws Exception { DOWNLOAD_CACHE.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); Path currentModulePath = Paths.get("").toAbsolutePath(); Path flinkHomePath = loadProjectRootDirectory(currentModulePath); String hadoopClasspath = Paths.get(flinkHomePath.toString(), YARN_CLASSPATH).toString(); File hadoopClasspathFile = new File(hadoopClasspath); if (!hadoopClasspathFile.exists()) { throw new FileNotFoundException(hadoopClasspath); } String classPathContent = FileUtils.readFileUtf8(hadoopClasspathFile); hadoopClasspathJars = Arrays.stream(classPathContent.split(":")) .map(jar -> Paths.get(jar)) .collect(Collectors.toList()); }

Target:
public void before() throws Exception { DOWNLOAD_CACHE.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); File hadoopClasspathFile = new File(hadoopClasspath.toAbsolutePath().toString()); if (!hadoopClasspathFile.exists()) { throw new FileNotFoundException("File that contains hadoop classpath " + hadoopClasspath.toString() + " does not exist."); } String classPathContent = FileUtils.readFileUtf8(hadoopClasspathFile); hadoopClasspathJars = Arrays.stream(classPathContent.split(":")) .map(jar -> Paths.get(jar)) .collect(Collectors.toList()); }