auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean handleOrphan(XAResource xares, Xid xid) { XAResourceOrphanFilter.Vote votingOutcome = XAResourceOrphanFilter.Vote.LEAVE_ALONE; for(XAResourceOrphanFilter filter : _xaResourceOrphanFilters) { XAResourceOrphanFilter.Vote vote = filter.checkXid(xid); if(jtaLogger.logger.isDebugEnabled()) { jtaLogger.logger.debug("XAResourceOrphanFilter " + filter.getClass().getName() + " voted " + vote); } if(vote == XAResourceOrphanFilter.Vote.LEAVE_ALONE) { return false; } else if(vote == XAResourceOrphanFilter.Vote.ROLLBACK) { votingOutcome = vote; } } try { if(votingOutcome == XAResourceOrphanFilter.Vote.ROLLBACK) { jtaLogger.i18NLogger.info_recovery_rollingback(XAHelper.xidToString(xid)); xares.rollback(xid); } } catch (XAException e1) { if(e1.errorCode == XAException.XAER_NOTA) { if(jtaLogger.logger.isDebugEnabled()) { jtaLogger.logger.debug("XAER_NOTA received while rolling back " + XAHelper.xidToString(xid)); } } else { jtaLogger.i18NLogger.warn_recovery_xarecovery1(_logName+".xaRecovery", XAHelper.printXAErrorCode(e1), e1); } switch (e1.errorCode) { case XAException.XAER_RMERR: break; case XAException.XA_HEURHAZ: case XAException.XA_HEURCOM: case XAException.XA_HEURMIX: case XAException.XA_HEURRB: case XAException.XA_RBROLLBACK: { return true; } default: break; } } catch (Exception e2) { jtaLogger.i18NLogger.warn_recovery_xarecovery2(_logName+".xaRecovery", e2); } return false; }

Target:
private boolean handleOrphan(XAResource xares, Xid xid) { XAResourceOrphanFilter.Vote votingOutcome = XAResourceOrphanFilter.Vote.LEAVE_ALONE; for(XAResourceOrphanFilter filter : _xaResourceOrphanFilters) { XAResourceOrphanFilter.Vote vote = filter.checkXid(xid); if(jtaLogger.logger.isDebugEnabled()) { jtaLogger.logger.debug("XAResourceOrphanFilter " + filter.getClass().getName() + " voted " + vote); } if(vote == XAResourceOrphanFilter.Vote.LEAVE_ALONE) { return false; } else if(vote == XAResourceOrphanFilter.Vote.ROLLBACK) { votingOutcome = vote; } } try { if(votingOutcome == XAResourceOrphanFilter.Vote.ROLLBACK) { jtaLogger.i18NLogger.info_recovery_rollingback(XAHelper.xidToString(xid)); xares.rollback(xid); } } catch (XAException e1) { if(e1.errorCode == XAException.XAER_NOTA) { if(jtaLogger.logger.isDebugEnabled()) { jtaLogger.logger.debug(_logName+".xaRecovery: XAER_NOTA received while rolling back " + XAHelper.xidToString(xid)); } } else { jtaLogger.i18NLogger.warn_recovery_xarecovery1(_logName+".xaRecovery", XAHelper.printXAErrorCode(e1), e1); } switch (e1.errorCode) { case XAException.XAER_RMERR: break; case XAException.XA_HEURHAZ: case XAException.XA_HEURCOM: case XAException.XA_HEURMIX: case XAException.XA_HEURRB: case XAException.XA_RBROLLBACK: { return true; } default: break; } } catch (Exception e2) { jtaLogger.i18NLogger.warn_recovery_xarecovery2(_logName+".xaRecovery", e2); } return false; }
Source:
public void task() { try { LOG.info("Starting ExchangeSceduleTask"); ExchangeInfoType exInfo = getExchangeDAO().loadExchangeInfo(); if (null != exInfo && exInfo.isRefreshActive()) { for (ExchangeType ex : exInfo.getExchanges().getExchange()) { if (EXCHANGE_TYPE.UDDI.toString().equalsIgnoreCase(ex.getType()) && StringUtils.isNotEmpty(ex.getUrl())) { LOG.info("Starting UDDI download"); ExchangeTransforms<BusinessDetail> transformer = new UDDITransform(); ex.setOrganizationList(transformer.transform(getUDDIManager(). forceRefreshUDDIFile(ex.getUrl()))); } } createFileBackupByRenaming(exInfo.getMaxNumberOfBackups()); exInfo.setLastUpdated(getTimestamp()); getExchangeDAO().saveExchangeInfo(exInfo); } } catch (ExchangeManagerException | UDDIAccessorException | DatatypeConfigurationException ex) { LOG.error("Unable to download from Exchange {}", ex.getLocalizedMessage(), ex); } }

Target:
public void task() { try { LOG.info("Starting ExchangeSceduleTask"); ExchangeInfoType exInfo = getExchangeDAO().loadExchangeInfo(); if (null != exInfo && exInfo.isRefreshActive()) { for (ExchangeType ex : exInfo.getExchanges().getExchange()) { if (EXCHANGE_TYPE.UDDI.toString().equalsIgnoreCase(ex.getType()) && StringUtils.isNotEmpty(ex.getUrl())) { LOG.info("Starting UDDI download from {}", ex.getUrl()); ExchangeTransforms<BusinessDetail> transformer = new UDDITransform(); ex.setOrganizationList(transformer.transform(getUDDIManager(). forceRefreshUDDIFile(ex.getUrl()))); } } createFileBackupByRenaming(exInfo.getMaxNumberOfBackups()); exInfo.setLastUpdated(getTimestamp()); getExchangeDAO().saveExchangeInfo(exInfo); } } catch (ExchangeManagerException | UDDIAccessorException | DatatypeConfigurationException ex) { LOG.error("Unable to download from Exchange {}", ex.getLocalizedMessage(), ex); } }
Source:
private void close(final boolean clean) { if (state() == State.CREATED) { transitionTo(State.CLOSING); } else { if (state() == State.RUNNING) { if (clean) commit(); transitionTo(State.CLOSING); } if (state() == State.CLOSING) { StateManagerUtil.closeStateManager(log, logPrefix, clean, false, stateMgr, stateDirectory, "standby"); } else { throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); } } closeTaskSensor.record(); transitionTo(State.CLOSED); }

Target:
private void close(final boolean clean) { if (state() == State.CREATED) { transitionTo(State.CLOSING); } else { if (state() == State.RUNNING) { if (clean) commit(); transitionTo(State.CLOSING); } if (state() == State.CLOSING) { StateManagerUtil.closeStateManager(log, logPrefix, clean, false, stateMgr, stateDirectory, TaskType.STANDBY); } else { throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); } } closeTaskSensor.record(); transitionTo(State.CLOSED); }
Source:
public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (byte[].class.equals(target) && Blob.class.isAssignableFrom(source)) { return new Converter() { @Override public <T> T convert(Object source, Class<T> target) throws Exception { if (source == null) { throw new IllegalArgumentException(); } Blob blob = (Blob) source; long length = blob.length(); if (length == 0) { return target.cast(new byte[0]); } if (length > Integer.MAX_VALUE) { return null; } int clength = (int) length; byte[] data = blob.getBytes(1, clength); return target.cast(data); } }; } return null; }

Target:
public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (byte[].class.equals(target) && Blob.class.isAssignableFrom(source)) { return new Converter() { @Override public <T> T convert(Object source, Class<T> target) throws Exception { if (source == null) { throw new IllegalArgumentException("source must not be null"); } Blob blob = (Blob) source; long length = blob.length(); if (length == 0) { return target.cast(new byte[0]); } if (length > Integer.MAX_VALUE) { return null; } int clength = (int) length; byte[] data = blob.getBytes(1, clength); return target.cast(data); } }; } return null; }
Source:
public void addChars(StringBuilder toAddTo, char toAdd, int countOfChar) { if(countOfChar != 1) { toAddTo.append(countOfChar); } countOfChar.append(toAdd); }

Target:
public void addChars(StringBuilder toAddTo, char toAdd, int countOfChar) { if(countOfChar != 1) { toAddTo.append(countOfChar); } toAddTo.append(toAdd); }
Source:
public static void scheduleQueueSyncJob(Context context) { if (context != null) { Configuration config = Blueshift.getInstance(context).getConfiguration(); if (config != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); if (jobScheduler != null) { ComponentName componentName = new ComponentName(context, RequestQueueJobService.class); int jobId = config.getNetworkChangeListenerJobId(); Log.d(LOG_TAG, "Job Id: " + jobId); JobInfo.Builder builder = new JobInfo.Builder(jobId, componentName); builder .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) .setPeriodic(30 * 60 * 1000); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { builder.setRequiresBatteryNotLow(true); } JobInfo jobInfo = builder.build(); if (JobScheduler.RESULT_SUCCESS == jobScheduler.schedule(jobInfo)) { Log.i(LOG_TAG, "Successfully scheduled request queue sync job on network change"); } else { Log.w(LOG_TAG, "Could not schedule request queue sync job on network change"); } } } } else { SdkLog.e(LOG_TAG, "Please initialize the SDK. Call initialize() method with a valid configuration object."); } } }

Target:
public static void scheduleQueueSyncJob(Context context) { if (context != null) { Configuration config = Blueshift.getInstance(context).getConfiguration(); if (config != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); if (jobScheduler != null) { @SuppressLint("JobSchedulerService") ComponentName componentName = new ComponentName(context, RequestQueueJobService.class); int jobId = config.getNetworkChangeListenerJobId(); Log.d(LOG_TAG, "Job Id: " + jobId); JobInfo.Builder builder = new JobInfo.Builder(jobId, componentName); builder .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) .setPeriodic(30 * 60 * 1000); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { builder.setRequiresBatteryNotLow(true); } JobInfo jobInfo = builder.build(); if (JobScheduler.RESULT_SUCCESS == jobScheduler.schedule(jobInfo)) { SdkLog.i(LOG_TAG, "Successfully scheduled request queue " + "sync job on network change"); } else { SdkLog.w(LOG_TAG, "Could not schedule request queue sync " + "job on network change"); } } } } else { Log.e(LOG_TAG, "Please initialize the SDK. Call initialize() method with " + "a valid configuration object."); } } }
Source:
public void isLeader() { synchronized (lock) { if (running) { leaderElectionEventHandler.onGrantLeadership(); } } }

Target:
public void isLeader() { leaderElectionEventHandler.onGrantLeadership(); }
Source:
public static String userToUri(String userName){ String uriString = ""; try { uriString = URIUtil.encodeQuery(userName, "UTF-8"); System.out.println(uriString); } catch (URIException e) { e.printStackTrace(); } uriString = uriString.replaceAll("!", toHex("!")); uriString = uriString.replaceAll("\\?", toHex("?")); uriString = uriString.replaceAll("\\+",toHex("+")); uriString = uriString.replaceAll("=", toHex("=")); return uriString; }

Target:
public static String userToUri(String userName){ String uriString = ""; try { uriString = URIUtil.encodeQuery(userName, "UTF-8"); } catch (URIException e) { e.printStackTrace(); } uriString = uriString.replaceAll("!", toHex("!")); uriString = uriString.replaceAll("\\?", toHex("?")); uriString = uriString.replaceAll("\\+", toHex("+")); uriString = uriString.replaceAll("=", toHex("=")); return uriString; }
Source:
public void testAddingWorkflowForumUrl() throws ApiException { ApiClient webClient = WorkflowIT.getWebClient(USER_2_USERNAME, testingPostgres); WorkflowsApi workflowsApi = new WorkflowsApi(webClient); UsersApi usersApi = new UsersApi(webClient); usersApi.getUser(); Workflow workflow = workflowsApi .manualRegister("github", "DockstoreTestUser2/test_lastmodified", "/Dockstore.cwl", "test-update-workflow", "cwl", "/test.json"); workflow.setForumUrl("hello.com"); workflowsApi.updateWorkflow(workflow.getId(), workflow); workflowsApi.refresh(workflow.getId()); final String updatedForumUrl = testingPostgres .runSelectStatement("select forumurl from workflow where workflowname = 'test-update-workflow'", String.class); assertEquals("forumUrl should be updated, it is " + updatedForumUrl, "hello.com", updatedForumUrl); }

Target:
public void testAddingWorkflowForumUrl() throws ApiException { ApiClient webClient = WorkflowIT.getWebClient(USER_2_USERNAME, testingPostgres); WorkflowsApi workflowsApi = new WorkflowsApi(webClient); Workflow workflow = workflowsApi .manualRegister(SourceControl.GITHUB.getFriendlyName(), "DockstoreTestUser2/test_lastmodified", "/Dockstore.cwl", "test-update-workflow", DescriptorLanguage.CWL.toString(), "/test.json"); workflow.setForumUrl("hello.com"); workflowsApi.updateWorkflow(workflow.getId(), workflow); workflowsApi.refresh(workflow.getId(), false); final String updatedForumUrl = testingPostgres .runSelectStatement("select forumurl from workflow where workflowname = 'test-update-workflow'", String.class); assertEquals("forumUrl should be updated, it is " + updatedForumUrl, "hello.com", updatedForumUrl); }
Source:
public BytesValues(byte[][] values, boolean nullAllowed) { super(nullAllowed); requireNonNull(values, "values is null"); checkArgument(values.length > 1, "values must contain at least 2 entries"); this.values = values; int hashTableSize = Integer.highestOneBit(values.length * 5); hashTableSizeMask = hashTableSize - 1; hashTable = new byte[hashTableSize][]; bloomSize = Math.max(1, hashTableSize / 8); bloom = new long[bloomSize]; for (byte[] value : values) { long hashCode = hash(value, 0, value.length); addBloom(hashCode); int position = (int) (hashCode & hashTableSizeMask); for (int i = position; i <= position + hashTableSizeMask; i++) { int index = i & hashTableSizeMask; if (hashTable[index] == null) { hashTable[index] = value; break; } if (compareRanges(value, 0, value.length, hashTable[index], 0, hashTable[index].length) == 0) { break; } } } }

Target:
private BytesValues(byte[][] values, boolean nullAllowed) { super(nullAllowed); requireNonNull(values, "values is null"); checkArgument(values.length > 1, "values must contain at least 2 entries"); this.values = values; int hashTableSize = Integer.highestOneBit(values.length * 4); hashTableSizeMask = hashTableSize - 1; hashTable = new byte[hashTableSize][]; bloomSize = Math.max(1, hashTableSize / 8); bloom = new long[bloomSize]; for (byte[] value : values) { long hashCode = hash(value, 0, value.length); bloom[bloomIndex(hashCode)] |= bloomMask(hashCode); int position = (int) (hashCode & hashTableSizeMask); for (int i = position; i <= position + hashTableSizeMask; i++) { int index = i & hashTableSizeMask; if (hashTable[index] == null) { hashTable[index] = value; break; } if (compareRanges(value, 0, value.length, hashTable[index], 0, hashTable[index].length) == 0) { break; } } } }
Source:
public ITmfStateSystem getSS() { return fSS; }

Target:
public @NonNull ITmfStateSystem getSS() { return fSS; }
Source:
public synchronized void close() throws IOException { this.isOpen = false; Collections.reverse(methodsToClose); for (Closeable toClose : methodsToClose) { toClose.close(); } }

Target:
public void close() throws IOException { if (state.compareAndSet(AVAILABLE, PROCESSING)) { Collections.reverse(methodsToClose); for (Closeable toClose : methodsToClose) { toClose.close(); } state.set(DONE); } }
Source:
public boolean equals(Object o) { BeanPathMetaConstraintProcessedUnit that = (BeanPathMetaConstraintProcessedUnit) o; if ( bean != that.bean ) { return false; } if ( metaConstraint != that.metaConstraint ) { return false; } if ( !path.equals( that.path ) ) { return false; } return true; }

Target:
public boolean equals(Object o) { if ( this == o ) { return true; } BeanPathMetaConstraintProcessedUnit that = (BeanPathMetaConstraintProcessedUnit) o; if ( bean != that.bean ) { return false; } if ( metaConstraint != that.metaConstraint ) { return false; } if ( !path.equals( that.path ) ) { return false; } return true; }
Source:
public MessageGroup addMessageToGroup(Object groupId, Message<?> message) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); try { SimpleMessageGroup group = this.groupIdToMessageGroup.get(groupId); if (group == null) { group = new SimpleMessageGroup(groupId); this.groupIdToMessageGroup.putIfAbsent(groupId, group); this.groupToUpperBound.putIfAbsent(groupId, new UpperBound(this.groupCapacity)); } if (!this.groupToUpperBound.get(groupId).tryAcquire(this.upperBoundTimeout)) { throw new MessagingException(this.getClass().getSimpleName() + " was out of capacity at for individual group, " + "try constructing it with a larger capacity."); } group.add(message); this.groupIdToMessageGroup.get(groupId).setLastModified(System.currentTimeMillis()); return group; } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }

Target:
public MessageGroup addMessageToGroup(Object groupId, Message<?> message) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); boolean unlocked = false; try { UpperBound upperBound; MessageGroup group = this.groupIdToMessageGroup.get(groupId); if (group == null) { group = getMessageGroupFactory().create(groupId); this.groupIdToMessageGroup.putIfAbsent(groupId, group); upperBound = new UpperBound(this.groupCapacity); upperBound.tryAcquire(-1); this.groupToUpperBound.putIfAbsent(groupId, upperBound); } else { upperBound = this.groupToUpperBound.get(groupId); Assert.state(upperBound != null, "'upperBound' must not be null."); lock.unlock(); if (!upperBound.tryAcquire(this.upperBoundTimeout)) { unlocked = true; throw new MessagingException(this.getClass().getSimpleName() + " was out of capacity (" + this.groupCapacity + ") for group '" + groupId + "', try constructing it with a larger capacity."); } lock.lockInterruptibly(); } group.add(message); group.setLastModified(System.currentTimeMillis()); return group; } finally { if (!unlocked) { lock.unlock(); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }
Source:
public void stop(final BundleContext context) throws Exception { SelectionRepositoryStateCache.INSTANCE.dispose(); if (focusListener != null) { if (PlatformUI.isWorkbenchRunning()) { PlatformUI.getWorkbench().removeWindowListener(focusListener); } focusListener = null; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Trying to cancel " + rcs.getName() + " job"); } getPreferenceStore().removePropertyChangeListener(rcs); rcs.setReschedule(false); rcs.cancel(); refreshJob.cancel(); rcs.join(); refreshJob.join(); if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Jobs terminated"); } if (resourceManager != null) { resourceManager.dispose(); resourceManager = null; } super.stop(context); plugin = null; }

Target:
public void stop(final BundleContext context) throws Exception { SelectionRepositoryStateCache.INSTANCE.dispose(); if (focusListener != null) { if (PlatformUI.isWorkbenchRunning()) { PlatformUI.getWorkbench().removeWindowListener(focusListener); } focusListener = null; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Trying to cancel " + rcs.getName() + " job"); } getPreferenceStore().removePropertyChangeListener(rcs); rcs.setReschedule(false); rcs.cancel(); refreshJob.cancel(); if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Jobs terminated"); } if (resourceManager != null) { resourceManager.dispose(); resourceManager = null; } super.stop(context); plugin = null; }
Source:
protected String prepareSearchUrl(String type) { URIBuilder url = null; String midUrl = "search/"; try { switch(type) { case "user": midUrl = "profile/"; url = new URIBuilder(this.baseUrl + midUrl + this.query); break; case "question": url = new URIBuilder(this.baseUrl + midUrl); url.addParameter("q", this.query); url.addParameter("type", "question"); break; case "answer": url = new URIBuilder(this.baseUrl + midUrl); url.addParameter("q", this.query); url.addParameter("type", "answer"); break; default: url = new URIBuilder(""); break; } } catch (URISyntaxException e) { DAO.log("Invalid Url: baseUrl = " + this.baseUrl + ", mid-URL = " + midUrl + "query = " + this.query + "type = " + type); return ""; } return url.toString(); }

Target:
protected String prepareSearchUrl(String type) { URIBuilder url = null; String midUrl = "search/"; try { switch(type) { case "user": midUrl = "profile/"; url = new URIBuilder(this.baseUrl + midUrl + this.query); break; case "question": url = new URIBuilder(this.baseUrl + midUrl); url.addParameter("q", this.query); url.addParameter("type", "question"); break; case "answer": url = new URIBuilder(this.baseUrl + midUrl); url.addParameter("q", this.query); url.addParameter("type", "answer"); break; default: url = new URIBuilder(""); break; } } catch (URISyntaxException e) { DAO.log("Invalid Url: baseUrl = " + this.baseUrl + ", mid-URL = " + midUrl + "query = " + this.query + "type = " + type); } return url.toString(); }
Source:
protected ValidationResult macAvailable() { VmNic nic = getParameters().getNic(); if (new VmInterfaceManager().tooManyPluggedInterfaceWithSameMac(nic, getMacPool())) { return new ValidationResult(EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString(VAR_MAC_IN_USE, nic.getMacAddress()), ReplacementUtils.createSetVariableString(VAR_IN_USE_BY, getVm().getName())); } return ValidationResult.VALID; }

Target:
protected ValidationResult macAvailable() { VmNic nic = getParameters().getNic(); Optional<VM> optionalVm = new VmInterfaceManager().getVmWithSameMacAs(nic, getMacPool()); return optionalVm.map(vm -> new ValidationResult(EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_MAC_ADDRESS, nic.getMacAddress()), ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_VM_NAME, vm.getName()))) .orElse(ValidationResult.VALID); }
Source:
void awaitTermination() { if (compactionExecutor != null) { try { compactionThread.join(2000); } catch (InterruptedException e) { logger.error("Compaction thread join wait was interrupted"); } } }

Target:
void awaitTermination() { if (compactionExecutor != null) { try { compactionThread.join(2000); } catch (InterruptedException e) { logger.error("Compaction thread join wait for was interrupted", mountPath); } } }
Source:
public ClusteringServiceConfiguration(Iterable<InetSocketAddress> servers, String cacheManagerName, Timeouts timeouts, boolean autoCreate, ServerSideConfiguration serverConfig, Properties properties) { this.clusterUri = null; this.servers = StreamSupport.stream(Objects.requireNonNull(servers, "Servers cannot be null").spliterator(), false).collect(toList()); this.cacheMangerName = Objects.requireNonNull(cacheManagerName, "Cache manager name cannot be null"); this.autoCreate = autoCreate; this.serverConfiguration = serverConfig; this.timeouts = Objects.requireNonNull(timeouts, "Operation timeouts cannot be null"); this.properties = (Properties) Objects.requireNonNull(properties, "Properties cannot be null").clone(); }

Target:
public ClusteringServiceConfiguration(Iterable<InetSocketAddress> servers, String cacheManagerName, Timeouts timeouts, boolean autoCreate, ServerSideConfiguration serverConfig, Properties properties) { this.connectionSource = new ConnectionSource(servers); this.cacheManagerName = Objects.requireNonNull(cacheManagerName, "Cache manager name cannot be null"); this.autoCreate = autoCreate; this.serverConfiguration = serverConfig; this.timeouts = Objects.requireNonNull(timeouts, "Operation timeouts cannot be null"); this.properties = (Properties) Objects.requireNonNull(properties, "Properties cannot be null").clone(); }
Source:
public ParametersBuilder add(int hour, int minute, int second, int nanosecond, ZoneId defaultTimeZone) { if ( isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, hour, minute, second, nanosecond, 1970, 1, 1 ); }

Target:
public ParametersBuilder add(int hour, int minute, int second, int nanosecond, ZoneId defaultTimeZone) { if ( !isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, hour, minute, second, nanosecond, 1970, 1, 1 ); }
Source:
public SslHandler newTLSHandler() { SslHandler sslHandler = sslContext.newHandler(PooledByteBufAllocator.DEFAULT); if (protocols != null && protocols.length != 0) { sslHandler.engine().setEnabledProtocols(protocols); } LOG.info("Enabled cipher protocols: ", Arrays.toString(sslHandler.engine().getEnabledProtocols())); if (ciphers != null && ciphers.length != 0) { sslHandler.engine().setEnabledCipherSuites(ciphers); } LOG.info("Enabled cipher suites: ", Arrays.toString(sslHandler.engine().getEnabledCipherSuites())); return sslHandler; }

Target:
public SslHandler newTLSHandler() { SslHandler sslHandler = sslContext.newHandler(PooledByteBufAllocator.DEFAULT); if (protocols != null && protocols.length != 0) { sslHandler.engine().setEnabledProtocols(protocols); } if (LOG.isDebugEnabled()) { LOG.debug("Enabled cipher protocols: ", Arrays.toString(sslHandler.engine().getEnabledProtocols())); } if (ciphers != null && ciphers.length != 0) { sslHandler.engine().setEnabledCipherSuites(ciphers); } if (LOG.isDebugEnabled()) { LOG.debug("Enabled cipher suites: ", Arrays.toString(sslHandler.engine().getEnabledCipherSuites())); } return sslHandler; }
Source:
public static void openUrlExternal(Context context, @NonNull String url) { Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { WPActivityUtils.disableComponent(context, ReaderPostPagerActivity.class); context.startActivity(intent); AppLockManager.getInstance().setExtendedTimeout(); } catch (ActivityNotFoundException e) { ToastUtils.showToast(context, context.getString(R.string.no_default_app_available_to_open_link), ToastUtils.Duration.LONG); AppLog.e(AppLog.T.UTILS, "No default app available on the device to open the link: " + url, e); } catch (SecurityException se) { AppLog.e(AppLog.T.UTILS, "Error opening url in default browser. Url: " + url, se); List<ResolveInfo> infos = context.getPackageManager().queryIntentActivities(intent, 0); if (infos.size() == 1) { AppLog.d(AppLog.T.UTILS, "Only one url handler found so, bailing."); ToastUtils.showToast(context, context.getString(R.string.cant_open_url)); } else { Intent chooser = Intent.createChooser(intent, context.getString(R.string.error_please_choose_browser)); context.startActivity(chooser); } } finally { WPActivityUtils.enableComponent(context, ReaderPostPagerActivity.class); } }

Target:
public static void openUrlExternal(Context context, @NonNull String url) { Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { WPActivityUtils.disableComponent(context, ReaderPostPagerActivity.class); context.startActivity(intent); AppLockManager.getInstance().setExtendedTimeout(); } catch (ActivityNotFoundException e) { ToastUtils.showToast(context, context.getString(R.string.cant_open_url), ToastUtils.Duration.LONG); AppLog.e(AppLog.T.UTILS, "No default app available on the device to open the link: " + url, e); } catch (SecurityException se) { AppLog.e(AppLog.T.UTILS, "Error opening url in default browser. Url: " + url, se); List<ResolveInfo> infos = context.getPackageManager().queryIntentActivities(intent, 0); if (infos.size() == 1) { AppLog.d(AppLog.T.UTILS, "Only one url handler found so, bailing."); ToastUtils.showToast(context, context.getString(R.string.cant_open_url)); } else { Intent chooser = Intent.createChooser(intent, context.getString(R.string.error_please_choose_browser)); context.startActivity(chooser); AppLockManager.getInstance().setExtendedTimeout(); } } finally { WPActivityUtils.enableComponent(context, ReaderPostPagerActivity.class); } }
Source:
private Map<Object, String> insertDefaultValues(boolean includeLoaderEntry) { Cache<Object, String> cache0 = cache(0, cacheName); Map<Object, String> originalValues = new HashMap<>(); Object loaderKey; if (cacheMode.isDistributed() || cacheMode.isReplicated() || cacheMode.isScattered()) { Cache<Object, String> cache1 = cache(1, cacheName); Cache<Object, String> cache2 = cache(2, cacheName); originalValues.put(new MagicKey(cache0), "cache0"); originalValues.put(new MagicKey(cache1), "cache1"); originalValues.put(new MagicKey(cache2), "cache2"); loaderKey = new MagicKey(cache2); } else { originalValues.put(1, "value0"); originalValues.put(2, "value1"); originalValues.put(3, "value2"); loaderKey = 4; } cache0.putAll(originalValues); PersistenceManager persistenceManager = TestingUtil.extractComponent(cache0, PersistenceManager.class); DummyInMemoryStore store = persistenceManager.getStores(DummyInMemoryStore.class).iterator().next(); TestObjectStreamMarshaller sm = new TestObjectStreamMarshaller(); try { String loaderValue = "loader-value"; store.write(new MarshalledEntryImpl(loaderKey, loaderValue, null, sm)); if (includeLoaderEntry) { originalValues.put(loaderKey, loaderValue); } } finally { sm.stop(); } return originalValues; }

Target:
private Map<Object, String> insertDefaultValues(boolean includeLoaderEntry) { Cache<Object, String> cache0 = cache(0, cacheName); Map<Object, String> originalValues = new HashMap<>(); Object loaderKey; if (cacheMode.needsStateTransfer()) { Cache<Object, String> cache1 = cache(1, cacheName); Cache<Object, String> cache2 = cache(2, cacheName); originalValues.put(new MagicKey(cache0), "cache0"); originalValues.put(new MagicKey(cache1), "cache1"); originalValues.put(new MagicKey(cache2), "cache2"); loaderKey = new MagicKey(cache2); } else { originalValues.put(1, "value0"); originalValues.put(2, "value1"); originalValues.put(3, "value2"); loaderKey = 4; } cache0.putAll(originalValues); PersistenceManager persistenceManager = TestingUtil.extractComponent(cache0, PersistenceManager.class); DummyInMemoryStore store = persistenceManager.getStores(DummyInMemoryStore.class).iterator().next(); TestObjectStreamMarshaller sm = new TestObjectStreamMarshaller(); try { String loaderValue = "loader-value"; store.write(new MarshalledEntryImpl(loaderKey, loaderValue, null, sm)); if (includeLoaderEntry) { originalValues.put(loaderKey, loaderValue); } } finally { sm.stop(); } return originalValues; }
Source:
private void showNoInternetConnectionSnackbar() { snackbar = Snackbar.make(findViewById(android.R.id.content), getString(R.string.no_internet_connection_message), Snackbar.LENGTH_INDEFINITE); View sbView = snackbar.getView(); TextView textView = sbView.findViewById(com.google.android.material.R.id.snackbar_text); textView.setTextColor(Color.WHITE); snackbar.show(); }

Target:
private void showNoInternetConnectionSnackbar() { snackbar = make(findViewById(android.R.id.content), getString(R.string.no_internet_connection_message), LENGTH_INDEFINITE); View sbView = snackbar.getView(); TextView textView = sbView.findViewById(R.id.snackbar_text); textView.setTextColor(Color.WHITE); snackbar.show(); }
Source:
private Set<TopicPartition> getAssignedTopicPartitionFromTask() { return _datastreamTask.getPartitionsV2().stream().map(str -> { int i = str.lastIndexOf("-"); int partition = Integer.valueOf(str.substring(i + 1)); String topic = str.substring(0, i); return new TopicPartition(topic, partition); }).collect(Collectors.toSet()); }

Target:
private Set<TopicPartition> getAssignedTopicPartitionFromTask() { return _datastreamTask.getPartitionsV2().stream() .map(TopicPartitionUtil::createTopicPartition).collect(Collectors.toSet()); }
Source:
protected void scheduleContainer(Container container) { if (maxOppQueueLength <= 0) { startAllocatedContainer(container); return; } if (queuedGuaranteedContainers.isEmpty() && queuedOpportunisticContainers.isEmpty() && this.utilizationManager.hasResourcesAvailable(container)) { startAllocatedContainer(container); } else { LOG.info("No available resources for container to start its execution " + "immediately.", container.getContainerId()); boolean isQueued = true; if (container.getContainerTokenIdentifier().getExecutionType() == ExecutionType.GUARANTEED) { queuedGuaranteedContainers.put(container.getContainerId(), container); killOpportunisticContainers(container); } else { if (queuedOpportunisticContainers.size() <= maxOppQueueLength) { LOG.info("Opportunistic container will be queued at the NM.", container.getContainerId()); queuedOpportunisticContainers.put( container.getContainerId(), container); } else { isQueued = false; LOG.info("Opportunistic container will not be queued at the NM" + "since max queue length has been reached", container.getContainerId(), maxOppQueueLength); container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Opportunistic container queue is full."); } } if (isQueued) { try { this.context.getNMStateStore().storeContainerQueued( container.getContainerId()); } catch (IOException e) { LOG.warn("Could not store container state into store..", e); } } } }

Target:
protected void scheduleContainer(Container container) { if (maxOppQueueLength <= 0) { startAllocatedContainer(container); return; } if (queuedGuaranteedContainers.isEmpty() && queuedOpportunisticContainers.isEmpty() && this.utilizationTracker.hasResourcesAvailable(container)) { startAllocatedContainer(container); } else { LOG.info("No available resources for container to start its execution " + "immediately.", container.getContainerId()); boolean isQueued = true; if (container.getContainerTokenIdentifier().getExecutionType() == ExecutionType.GUARANTEED) { queuedGuaranteedContainers.put(container.getContainerId(), container); killOpportunisticContainers(container); } else { if (queuedOpportunisticContainers.size() <= maxOppQueueLength) { LOG.info("Opportunistic container will be queued at the NM.", container.getContainerId()); queuedOpportunisticContainers.put( container.getContainerId(), container); } else { isQueued = false; LOG.info("Opportunistic container will not be queued at the NM" + "since max queue length has been reached", container.getContainerId(), maxOppQueueLength); container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Opportunistic container queue is full."); } } if (isQueued) { try { this.context.getNMStateStore().storeContainerQueued( container.getContainerId()); } catch (IOException e) { LOG.warn("Could not store container [" + container.getContainerId() + "] state. The Container has been queued.", e); } } } }
Source:
public void testSeekStatistics() throws IOException { describe("Testing the values of statistics from seek operations in " + "AbfsInputStream"); AzureBlobFileSystem fs = getFileSystem(); AzureBlobFileSystemStore abfss = fs.getAbfsStore(); Path seekStatPath = path(getMethodName()); AbfsOutputStream out = null; AbfsInputStream in = null; try { out = createAbfsOutputStreamWithFlushEnabled(fs, seekStatPath); out.write(defBuffer); out.hflush(); in = abfss.openFileForRead(seekStatPath, fs.getFsStatistics()); int result = in.read(defBuffer, 0, ONE_MB); LOG.info("Result of read : {}", result); for (int i = 0; i < OPERATIONS; i++) { in.seek(0); in.seek(ONE_MB); } AbfsInputStreamStatisticsImpl stats = (AbfsInputStreamStatisticsImpl) in.getStreamStatistics(); LOG.info("STATISTICS: {}", stats.toString()); assertEquals("Mismatch in seekOps value", 2 * OPERATIONS, stats.getSeekOperations()); assertEquals("Mismatch in backwardSeekOps value", OPERATIONS, stats.getBackwardSeekOperations()); assertEquals("Mismatch in forwardSeekOps value", OPERATIONS, stats.getForwardSeekOperations()); assertEquals("Mismatch in bytesBackwardsOnSeek value", OPERATIONS * ONE_MB, stats.getNegativeBytesBackwardsOnSeek()); assertEquals("Mismatch in bytesSkippedOnSeek value", 0, stats.getBytesSkippedOnSeek()); assertEquals("Mismatch in seekInBuffer value", 2 * OPERATIONS, stats.getSeekInBuffer()); in.close(); LOG.info("STATISTICS after closing: {}", stats.toString()); } finally { IOUtils.cleanupWithLogger(LOG, out, in); } }

Target:
public void testSeekStatistics() throws IOException { describe("Testing the values of statistics from seek operations in " + "AbfsInputStream"); AzureBlobFileSystem fs = getFileSystem(); AzureBlobFileSystemStore abfss = fs.getAbfsStore(); Path seekStatPath = path(getMethodName()); AbfsOutputStream out = null; AbfsInputStream in = null; try { out = createAbfsOutputStreamWithFlushEnabled(fs, seekStatPath); out.write(defBuffer); out.hflush(); in = abfss.openFileForRead(seekStatPath, fs.getFsStatistics()); int result = in.read(defBuffer, 0, ONE_MB); LOG.info("Result of read : {}", result); for (int i = 0; i < OPERATIONS; i++) { in.seek(0); in.seek(ONE_MB); } AbfsInputStreamStatisticsImpl stats = (AbfsInputStreamStatisticsImpl) in.getStreamStatistics(); LOG.info("STATISTICS: {}", stats.toString()); assertEquals("Mismatch in seekOps value", 2 * OPERATIONS, stats.getSeekOperations()); assertEquals("Mismatch in backwardSeekOps value", OPERATIONS, stats.getBackwardSeekOperations()); assertEquals("Mismatch in forwardSeekOps value", OPERATIONS, stats.getForwardSeekOperations()); assertEquals("Mismatch in bytesBackwardsOnSeek value", OPERATIONS * ONE_MB, stats.getBytesBackwardsOnSeek()); assertEquals("Mismatch in bytesSkippedOnSeek value", 0, stats.getBytesSkippedOnSeek()); assertEquals("Mismatch in seekInBuffer value", 2 * OPERATIONS, stats.getSeekInBuffer()); in.close(); LOG.info("STATISTICS after closing: {}", stats.toString()); } finally { IOUtils.cleanupWithLogger(LOG, out, in); } }
Source:
private @NonNull InneractiveAdSpot.RequestListener createFyberInterstitialAdListener() { return new InneractiveAdSpot.RequestListener() { @Override public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot adSpot) { if (!(mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { mMediationInterstitialListener.onAdFailedToLoad(FyberMediationAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController) mInterstitialSpot .getSelectedUnitController(); InneractiveFullscreenAdEventsListener listener = createFyberInterstitialListener(); controller.setEventsListener(listener); mMediationInterstitialListener.onAdLoaded(FyberMediationAdapter.this); } @Override public void onInneractiveFailedAdRequest(InneractiveAdSpot adSpot, InneractiveErrorCode inneractiveErrorCode) { int adMobErrorCode = AdRequest.ERROR_CODE_INTERNAL_ERROR; if (inneractiveErrorCode == InneractiveErrorCode.CONNECTION_ERROR || inneractiveErrorCode == InneractiveErrorCode.CONNECTION_TIMEOUT) { adMobErrorCode = AdRequest.ERROR_CODE_NETWORK_ERROR; } else if (inneractiveErrorCode == InneractiveErrorCode.NO_FILL) { adMobErrorCode = AdRequest.ERROR_CODE_NO_FILL; } mMediationInterstitialListener.onAdFailedToLoad(FyberMediationAdapter.this, adMobErrorCode); } }; }

Target:
private @NonNull InneractiveAdSpot.RequestListener createFyberInterstitialAdListener() { return new InneractiveAdSpot.RequestListener() { @Override public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot adSpot) { if (!(mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { mMediationInterstitialListener.onAdFailedToLoad(FyberMediationAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); mInterstitialSpot.destroy(); } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController) mInterstitialSpot .getSelectedUnitController(); InneractiveFullscreenAdEventsListener listener = createFyberInterstitialListener(); controller.setEventsListener(listener); mMediationInterstitialListener.onAdLoaded(FyberMediationAdapter.this); } @Override public void onInneractiveFailedAdRequest(InneractiveAdSpot adSpot, InneractiveErrorCode inneractiveErrorCode) { int adMobErrorCode = AdRequest.ERROR_CODE_INTERNAL_ERROR; if (inneractiveErrorCode == InneractiveErrorCode.CONNECTION_ERROR || inneractiveErrorCode == InneractiveErrorCode.CONNECTION_TIMEOUT) { adMobErrorCode = AdRequest.ERROR_CODE_NETWORK_ERROR; } else if (inneractiveErrorCode == InneractiveErrorCode.NO_FILL) { adMobErrorCode = AdRequest.ERROR_CODE_NO_FILL; } mMediationInterstitialListener.onAdFailedToLoad(FyberMediationAdapter.this, adMobErrorCode); } }; }
Source:
protected void assertSelectionEquals(String message, TestElement expected) { ISelection selection = fViewer.getStructuredSelection(); assertTrue(selection instanceof IStructuredSelection); IStructuredSelection expectedSelection = new StructuredSelection( expected); assertEquals("selectionEquals - " + message, selection, expectedSelection); }

Target:
protected void assertSelectionEquals(String message, TestElement expected) { IStructuredSelection structuredSelection = fViewer.getStructuredSelection(); IStructuredSelection expectedSelection = new StructuredSelection(expected); assertEquals("selectionEquals - " + message, structuredSelection, expectedSelection); }
Source:
public synchronized void dispose() { for (Entry<String, IObservableValue> entry : expressionMap.entrySet()) { entry.getValue().dispose(); } super.dispose(); }

Target:
public synchronized void dispose() { for (Entry<String, IObservableValue> entry : expressionMap.entrySet()) { entry.getValue().dispose(); } expressionMap.clear(); super.dispose(); }
Source:
boolean canPerform(String permissionName) { List<PermissionRule> access = access(permissionName); Set<ProjectRef> allows = Sets.newHashSet(); Set<ProjectRef> blocks = Sets.newHashSet(); for (PermissionRule rule : access) { if (rule.isBlock() && !rule.getForce()) { blocks.add(relevant.getRuleProps(rule)); } else { allows.add(relevant.getRuleProps(rule)); } } blocks.removeAll(allows); return blocks.isEmpty() && !allows.isEmpty(); }

Target:
boolean canPerform(String permissionName) { return canPerform(permissionName, false); }
Source:
protected void configure() { DynamicSet.setOf(binder(), CacheRemovalListener.class); install(new FactoryModule() { @Override protected void configure() { factory(ForwardingRemovalListener.Factory.class); } }); bind(DefaultCacheFactory.class); bind(MemoryCacheFactory.class).to(DefaultCacheFactory.class); bind(PersistentCacheFactory.class).to(H2CacheFactory.class); listener().to(H2CacheFactory.class); }

Target:
protected void configure() { install(new FactoryModule() { @Override protected void configure() { factory(ForwardingRemovalListener.Factory.class); } }); bind(DefaultCacheFactory.class); bind(MemoryCacheFactory.class).to(DefaultCacheFactory.class); bind(PersistentCacheFactory.class).to(H2CacheFactory.class); listener().to(H2CacheFactory.class); }
Source:
public void show() { this.assets.finishLoading(); this.stage = new Stage(); Texture texture = new Texture(Gdx.files.internal("data/loading.jpeg")); TextureRegion region = new TextureRegion(texture, 0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); Image image = new Image(region); image.setFillParent(true); this.stage.addActor(image); this.assets.load(getFileName("end.jpg"), Texture.class); this.assets.load(getFileName("sector.png"), Texture.class); this.assets.load(getFileName("ship.png"), Texture.class); this.assets.load(getFileName("raccoon.png"), Texture.class); this.assets.load(getFileName("grass.jpg"), Texture.class); this.assets.load(getFileName("field.jpg"), Texture.class); this.assets.load(getFileName("river.png"), Texture.class); this.assets.load(getFileName("cannonball.png"), Texture.class); this.assets.load(getFileName("cannonballCrop.png"), Texture.class); this.assets.load(getFileName("iceberg.png"), Texture.class); this.assets.load(getFileName("win.png"), Texture.class); this.assets.load(getFileName("lose.png"), Texture.class); this.assets.load(getFileName("bootje.jpg"), Texture.class); this.assets.load(getFileName("wood-floor.jpg"), Texture.class); this.assets.load(getFileName("dividingLine.png"), Texture.class); }

Target:
public void show() { this.assets.finishLoading(); this.stage = new Stage(); Texture texture = new Texture(Gdx.files.internal("data/loading.jpeg")); TextureRegion region = new TextureRegion(texture, 0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); Image image = new Image(region); image.setFillParent(true); this.stage.addActor(image); this.assets.load(getFileName("end.jpg"), Texture.class); this.assets.load(getFileName("sector.png"), Texture.class); this.assets.load(getFileName("ship.png"), Texture.class); this.assets.load(getFileName("raccoon.png"), Texture.class); this.assets.load(getFileName("grass.jpg"), Texture.class); this.assets.load(getFileName("field.jpg"), Texture.class); this.assets.load(getFileName("river.png"), Texture.class); this.assets.load(getFileName("cannonballCrop.png"), Texture.class); this.assets.load(getFileName("iceberg.png"), Texture.class); this.assets.load(getFileName("win.png"), Texture.class); this.assets.load(getFileName("lose.png"), Texture.class); this.assets.load(getFileName("bootje.jpg"), Texture.class); this.assets.load(getFileName("wood-floor.jpg"), Texture.class); this.assets.load(getFileName("dividingLine.png"), Texture.class); }
Source:
private static boolean isVerifiableClassMemberAccess(ExpressionTree tree) { return tree.is(Tree.Kind.CLASS_MEMBER_ACCESS) && ((MemberAccessTree) tree).member().is(Tree.Kind.NAME_IDENTIFIER) && ((((MemberAccessTree) tree).object().is(Tree.Kind.NAMESPACE_NAME) && ((NamespaceNameTree) ((MemberAccessTree) tree).object()).fullName().equals("self")) || (((MemberAccessTree) tree).object().is(Tree.Kind.NAME_IDENTIFIER) && ((NameIdentifierTree) ((MemberAccessTree) tree).object()).text().equals("static"))); }

Target:
private static boolean isVerifiableClassMemberAccess(ExpressionTree tree) { if (tree.is(Kind.CLASS_MEMBER_ACCESS) && ((MemberAccessTree) tree).member().is(Kind.NAME_IDENTIFIER)) { Tree object = ((MemberAccessTree) tree).object(); return ((object.is(Kind.NAMESPACE_NAME) && ((NamespaceNameTree) object).fullName().equals("self")) || (object.is(Kind.NAME_IDENTIFIER) && ((NameIdentifierTree) object).text().equals("static"))); } return false; }
Source:
public static void registerProtoFiles(SerializationContext ctx) throws IOException { FileDescriptorSource fileDescriptorSource = new FileDescriptorSource(); fileDescriptorSource.addProtoFile(QUERY_PROTO_RES, MarshallerRegistration.class.getResourceAsStream(QUERY_PROTO_RES)); fileDescriptorSource.addProtoFile(WrappedMessage.PROTO_FILE, MarshallerRegistration.class.getResourceAsStream(WrappedMessage.PROTO_FILE)); ctx.registerProtoFiles(fileDescriptorSource); }

Target:
public static void registerProtoFiles(SerializationContext ctx) throws IOException { ctx.registerProtoFiles(FileDescriptorSource.fromResources(MarshallerRegistration.class.getClassLoader(), QUERY_PROTO_RES, WrappedMessage.PROTO_FILE)); }
Source:
public void testUncompressedVcf() throws Exception { ExecutionContext executionContext = MetaDataInstanceFactory.createStepExecution().getExecutionContext(); final String inputFilePath = "/small20.vcf.gz"; String inputFile = VcfReaderTest.class.getResource(inputFilePath).getFile(); File tempFile = JobTestUtils.createTempFile(); JobTestUtils.uncompress(inputFile, tempFile); String fileId = "5"; String studyId = "7"; String studyName = "study name"; VariantSource source = new VariantSource(tempFile.getAbsolutePath(), fileId, studyId, studyName, VariantStudy.StudyType.COLLECTION, VariantSource.Aggregation.NONE); VcfReader vcfReader = new VcfReader(source, tempFile); vcfReader.setSaveState(false); vcfReader.open(executionContext); consumeReader(inputFile, source, vcfReader); }

Target:
public void testUncompressedVcf() throws Exception { ExecutionContext executionContext = MetaDataInstanceFactory.createStepExecution().getExecutionContext(); final String inputFilePath = "/small20.vcf.gz"; String inputFile = VcfReaderTest.class.getResource(inputFilePath).getFile(); File tempFile = JobTestUtils.createTempFile(); JobTestUtils.uncompress(inputFile, tempFile); String fileId = "5"; String studyId = "7"; String studyName = "study name"; VcfHeaderReader headerReader = new VcfHeaderReader(new File(inputFile), fileId, studyId, studyName, VariantStudy.StudyType.COLLECTION, VariantSource.Aggregation.NONE); VariantSource source = headerReader.read(); VcfReader vcfReader = new VcfReader(source, tempFile); vcfReader.setSaveState(false); vcfReader.open(executionContext); consumeReader(inputFile, vcfReader); }
Source:
public void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { throw HttpResponses.error(404, "Promotion processes may not be build directly"); }

Target:
public void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { throw HttpResponses.error(404, "Promotion processes may not be built directly"); }
Source:
public String getName () { return NAME; }

Target:
public String getName() { return "Worldcat Fetcher"; }