auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected VdcReturnValueBase evaluateCorrelationId(CommandBase<?> commandBase) { VdcReturnValueBase returnValue = null; returnValue = ExecutionHandler.evaluateCorrelationId(commandBase.getParameters()); if (returnValue != null) { log.warn("Validate of action '{}' failed. Reasons: {}", commandBase.getActionType(), StringUtils.join(returnValue.getValidateMessages(), ',')); } commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId()); return returnValue; }

Target:
protected VdcReturnValueBase evaluateCorrelationId(CommandBase<?> commandBase) { VdcReturnValueBase returnValue = null; returnValue = ExecutionHandler.evaluateCorrelationId(commandBase.getParameters()); if (returnValue != null) { log.warn("Validation of action '{}' failed. Reasons: {}", commandBase.getActionType(), StringUtils.join(returnValue.getValidationMessages(), ',')); } commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId()); return returnValue; }
Source:
public boolean equals(final Object other) { if(other == null) { return false; } if(this.getClass() != other.getClass()) { return false; } final Bin otherBin = (Bin)other; return this.referenceSequence == otherBin.referenceSequence && this.binNumber == otherBin.binNumber; }

Target:
public boolean equals(final Object other) { if(other == null) return false; if(this.getClass() != other.getClass()) return false; final Bin otherBin = (Bin)other; return this.referenceSequence == otherBin.referenceSequence && this.binNumber == otherBin.binNumber; }
Source:
private void parseConfiguration(String config) throws IllegalArgumentException { String[] mappings = config.split(","); for (String mapping : mappings) { String[] params = mapping.split(":"); if (params.length < 2) { throw new IllegalArgumentException("Configuration " + mapping + " is in-correctly formed. " + "Format should be <fieldname>:<decoder-type>"); } String field = params[0]; String type = params[1].toUpperCase(); DecoderType eType = DecoderType.valueOf(type); if (decodeMap.containsKey(field)) { throw new IllegalArgumentException("Field " + field + " already has decoder set. Check the mapping."); } else { decodeMap.put(field, eType); } } }

Target:
private void parseConfiguration(String config) throws IllegalArgumentException { String[] mappings = config.split(","); for (String mapping : mappings) { String[] params = mapping.split(":"); if (params.length < 2) { throw new IllegalArgumentException("Configuration '" + mapping + "' is incorrectly formed. " + "Format should be <fieldname>:<decoder-type>"); } String field = params[0]; String type = params[1].toUpperCase(); DecoderType eType = DecoderType.valueOf(type); if (decodeMap.containsKey(field)) { throw new IllegalArgumentException("Field " + field + " already has decoder set. Check the mapping."); } else { decodeMap.put(field, eType); } } }
Source:
public void channelRead(ChannelHandlerContext ctx, Object msg) { try { if (msg instanceof CorfuMsg) { CorfuMsg m = ((CorfuMsg) msg); AbstractServer handler = handlerMap.get(m.getMsgType()); if (handler == null) { log.warn("channelRead: Received unregistered message {}, dropping", m); } else { if (messageIsValid(m, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Message routed to {}: {}", handler.getClass().getSimpleName(), msg); } try { handler.handleMessage(m, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", m != null ? m.getMsgType() : "UNKNOWN", t.getClass().getSimpleName(), t.getMessage(), t); } } } } else if (msg instanceof RequestMsg) { RequestMsg request = ((RequestMsg) msg); RequestPayloadMsg payload = request.getPayload(); if (log.isDebugEnabled()) { log.debug("channelRead: Request from {}", payload.getPayloadCase().toString(), ctx.channel().remoteAddress()); } AbstractServer handler = requestTypeHandlerMap.get(payload.getPayloadCase()); if (handler == null) { log.warn("channelRead: Received unregistered request {}, dropping", payload.getPayloadCase().toString()); } else { if (requestIsValid(request, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Request routed to {}: {}", handler.getClass().getSimpleName(), request); } try { handler.handleRequest(request, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", payload.getPayloadCase().toString(), t.getClass().getSimpleName(), t.getMessage(), t); } } } } } catch (Exception e) { log.error("channelRead: Exception during read!", e); } }

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof CorfuMsg) { CorfuMsg m = ((CorfuMsg) msg); AbstractServer handler = handlerMap.get(m.getMsgType()); if (handler == null) { log.warn("channelRead: Received unregistered message {}, dropping", m); } else { if (messageIsValid(m, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Message routed to {}: {}", handler.getClass().getSimpleName(), msg); } try { handler.handleMessage(m, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", m != null ? m.getMsgType() : "UNKNOWN", t.getClass().getSimpleName(), t.getMessage(), t); } } } } else if (msg instanceof RequestMsg) { RequestMsg request = ((RequestMsg) msg); RequestPayloadMsg payload = request.getPayload(); AbstractServer handler = requestTypeHandlerMap.get(payload.getPayloadCase()); if (handler == null) { log.warn("channelRead: Received unregistered request {}, dropping", payload.getPayloadCase()); } else { if (validateRequest(request, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Request routed to {}: {}", handler.getClass().getSimpleName(), request); } try { handler.handleMessage(request, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", payload.getPayloadCase(), t.getClass().getSimpleName(), t.getMessage(), t); } } } } else { log.error("channelRead: Unknown message of class received", msg.getClass()); } }
Source:
public QueueClientBuilder connectionString(String connectionString) { Objects.requireNonNull(connectionString); this.sharedKeyCredential = SharedKeyCredential.fromConnectionString(connectionString); Objects.requireNonNull(connectionString); this.sharedKeyCredential = SharedKeyCredential.fromConnectionString(connectionString); getEndPointFromConnectionString(connectionString); return this; }

Target:
public QueueClientBuilder connectionString(String connectionString) { Objects.requireNonNull(connectionString); this.sharedKeyCredential = SharedKeyCredential.fromConnectionString(connectionString); getEndPointFromConnectionString(connectionString); return this; }
Source:
private void setupTimeoutAlert() { Object obj = RealtimeIndexTask.this.getContextValue("alertTimeout"); if (obj == null) { return; } long timeout = parseLong(obj); Timer timer = new Timer("RealtimeIndexTask-Timer", true); timer.schedule( new TimerTask() { @Override public void run() { log.makeAlert("RealtimeIndexTask hasn't finished in configured time [%d] ms.", timeout); } }, timeout ); }

Target:
private void setupTimeoutAlert() { if (spec.getTuningConfig().getAlertTimeout() > 0) { Timer timer = new Timer("RealtimeIndexTask-Timer", true); timer.schedule( new TimerTask() { @Override public void run() { log.makeAlert( "RealtimeIndexTask for dataSource [%s] hasn't finished in configured time [%d] ms.", spec.getDataSchema().getDataSource(), spec.getTuningConfig().getAlertTimeout() ).emit(); } }, spec.getTuningConfig().getAlertTimeout() ); } }
Source:
protected ITmfStateProvider createStateProvider() { ITmfTrace trace = getTrace(); if (!(trace instanceof LttngKernelTrace)) { throw new IllegalStateException(); } return new LttngKernelCpuUsageStateProvider(trace, ((LttngKernelTrace) trace).getEventLayout()); }

Target:
protected ITmfStateProvider createStateProvider() { ITmfTrace trace = getTrace(); IKernelAnalysisEventLayout layout; if (trace instanceof LttngKernelTrace) { layout = ((LttngKernelTrace) trace).getEventLayout(); } else { layout = LttngEventLayout.getInstance(); } return new LttngKernelCpuUsageStateProvider(trace, layout); }
Source:
public int getPropertyId() { if ( propertyIds.length != 1 ) { throw new IllegalStateException( "Single property schema required one property but had " + propertyIds.length ); } return propertyIds[0]; }

Target:
public int getPropertyId() { if ( propertyIds.length != 1 ) { throw new IllegalStateException( "Single property schema requires one property but had " + propertyIds.length ); } return propertyIds[0]; }
Source:
public HistoricalEventEmitter(EmittedEventDao emittedEventDao, StateTransitionQueue stateTransitionQueue, EventQueue eventQueue, RefundDao refundDao, boolean shouldForceEmission) { this.emittedEventDao = emittedEventDao; this.stateTransitionQueue = stateTransitionQueue; this.eventQueue = eventQueue; this.refundDao = refundDao; this.paymentGatewayStateTransitions = PaymentGatewayStateTransitions.getInstance(); this.doNotForceEmission = !shouldForceEmission; }

Target:
public HistoricalEventEmitter(EmittedEventDao emittedEventDao, StateTransitionQueue stateTransitionQueue, EventQueue eventQueue, RefundDao refundDao, boolean shouldForceEmission) { this.emittedEventDao = emittedEventDao; this.stateTransitionQueue = stateTransitionQueue; this.eventQueue = eventQueue; this.refundDao = refundDao; this.paymentGatewayStateTransitions = PaymentGatewayStateTransitions.getInstance(); this.shouldForceEmission = shouldForceEmission; }
Source:
public String getXRegistryAuthHeaderValue(String registry, @Nullable AuthConfigs paramsAuthConfigs) { Map<String, AuthConfig> authConfigsMap = null; if (paramsAuthConfigs != null) { authConfigsMap = paramsAuthConfigs.getConfigs(); } AuthConfig authConfig = null; if (authConfigsMap != null) { for(Map.Entry<String, AuthConfig> entry : authConfigsMap.entrySet()) { AuthConfig value = entry.getValue(); if (value.getServeraddress().contains(registry)) { authConfig = value; break; } } } if (authConfig == null) { if (DEFAULT_REGISTRY.equals(registry)) { registry = DEFAULT_REGISTRY_VALUE; } for(Map.Entry<String, AuthConfig> entry : initialAuthConfig.getAuthConfigs().getConfigs().entrySet()) { AuthConfig value = entry.getValue(); if (value.getServeraddress().contains(registry)) { authConfig = value; break; } } } if (authConfig != null) { XRegistryAuthUnit auth = new XRegistryAuthUnit(authConfig.getUsername(), authConfig.getPassword()); return Base64.encodeBase64String(JsonHelper.toJson(auth).getBytes()); } return Base64.encodeBase64String("{}".getBytes()); }

Target:
public String getXRegistryAuthHeaderValue(String registry, @Nullable AuthConfigs paramsAuthConfigs) { Map<String, AuthConfig> authConfigsMap = null; if (paramsAuthConfigs != null) { authConfigsMap = paramsAuthConfigs.getConfigs(); } if (DEFAULT_REGISTRY.contains(registry)) { registry = DEFAULT_REGISTRY_VALUE; } AuthConfig authConfig = null; if (authConfigsMap != null) { for(Map.Entry<String, AuthConfig> entry : authConfigsMap.entrySet()) { AuthConfig value = entry.getValue(); if (value.getServeraddress().contains(registry)) { authConfig = value; break; } } } if (authConfig == null) { for(Map.Entry<String, AuthConfig> entry : initialAuthConfig.getAuthConfigs().getConfigs().entrySet()) { AuthConfig value = entry.getValue(); if (value.getServeraddress().contains(registry)) { authConfig = value; break; } } } if (authConfig != null) { XRegistryAuthUnit auth = new XRegistryAuthUnit(authConfig.getUsername(), authConfig.getPassword()); return Base64.encodeBase64String(JsonHelper.toJson(auth).getBytes()); } return Base64.encodeBase64String("{}".getBytes()); }
Source:
void addEmptyColumnToDataPutMutation(Put put, PTable ptable, long ts) throws Exception{ PName pdefaultFamilyName = ptable.getDefaultFamilyName(); addCellToPutMutation(put, pdefaultFamilyName == null ? QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES : pdefaultFamilyName.getBytes(), QueryConstants.EMPTY_COLUMN_BYTES, ts, QueryConstants.EMPTY_COLUMN_VALUE_BYTES); }

Target:
void addEmptyColumnToDataPutMutation(Put put, PTable ptable, long ts) throws Exception { addCellToPutMutation(put, SchemaUtil.getEmptyColumnFamily(ptable), QueryConstants.EMPTY_COLUMN_BYTES, ts, QueryConstants.EMPTY_COLUMN_VALUE_BYTES); }
Source:
public void subscribeToDataStoreInternal(@NonNull CompositeSubscription compositeSubscription) { Log.v(TAG, "subscribeToDataStoreInternal"); ConnectableObservable<DataStreamNotification<GitHubRepositorySearch>> repositorySearchSource = searchString .filter((string) -> string.length() > 2) .debounce(1000, TimeUnit.MILLISECONDS) .switchMap(getGitHubRepositorySearch::call) .publish(); compositeSubscription.add(repositorySearchSource .map(toProgressStatus()) .subscribe(this::setNetworkStatusText)); compositeSubscription.add(repositorySearchSource .filter(DataStreamNotification::isOnNext) .map(DataStreamNotification::getValue) .map(GitHubRepositorySearch::getItems) .flatMap(toGitHubRepositoryList()) .doOnNext(list -> Log.d(TAG, "Publishing " + list.size() + " repositories from the ViewModel")) .subscribe(RepositoriesViewModel.this.repositories::onNext)); compositeSubscription.add(repositorySearchSource.connect()); }

Target:
public void subscribeToDataStoreInternal(@NonNull CompositeSubscription compositeSubscription) { Log.v(TAG, "subscribeToDataStoreInternal"); ConnectableObservable<DataStreamNotification<GitHubRepositorySearch>> repositorySearchSource = searchString .filter((string) -> string.length() > 2) .debounce(SEARCH_INPUT_DELAY, TimeUnit.MILLISECONDS) .switchMap(getGitHubRepositorySearch::call) .publish(); compositeSubscription.add(repositorySearchSource .map(toProgressStatus()) .subscribe(this::setNetworkStatusText)); compositeSubscription.add(repositorySearchSource .filter(DataStreamNotification::isOnNext) .map(DataStreamNotification::getValue) .map(GitHubRepositorySearch::getItems) .flatMap(toGitHubRepositoryList()) .doOnNext(list -> Log.d(TAG, "Publishing " + list.size() + " repositories from the ViewModel")) .subscribe(RepositoriesViewModel.this.repositories::onNext)); compositeSubscription.add(repositorySearchSource.connect()); }
Source:
public synchronized Class<?> defineClass(String name, byte[] bytecode) { return defineClass(name, convertClassToResourcePath(name), bytecode); }

Target:
public Class<?> defineClass(String name, byte[] bytecode) { return defineClass(name, convertClassToResourcePath(name), bytecode); }
Source:
public void close() throws Exception { for (final EventProcessor eventProcessor : eventProcessors) { eventProcessor.close(); } }

Target:
public void close() throws Exception { eventProcessors.forEach(eventProcessor -> eventProcessor.close()); }
Source:
public void sendAsynchronousRequest(final ChannelBuffer message, final boolean oneway, final Listener listener) throws TException { final int sequenceId = extractSequenceId(message); executeInIoThread(new Runnable() { @Override public void run() { ChannelFuture sendFuture = writeRequest(message); final Request request = makeRequest(sequenceId, listener); queueSendTimeout(request); sendFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { cancelRequestTimeouts(request); listener.requestSent(); if (oneway) { retireRequest(sequenceId); } else { queueReceiveTimeout(request); } } else { TTransportException transportException = new TTransportException("Sending request failed", future.getCause()); listener.channelError(transportException); onError(transportException); } } }); } }); }

Target:
public void sendAsynchronousRequest(final ChannelBuffer message, final boolean oneway, final Listener listener) throws TException { final int sequenceId = extractSequenceId(message); executeInIoThread(new Runnable() { @Override public void run() { ChannelFuture sendFuture = writeRequest(message); final Request request = makeRequest(sequenceId, listener); queueSendTimeout(request); sendFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { cancelRequestTimeouts(request); listener.onRequestSent(); if (oneway) { retireRequest(sequenceId); } else { queueReceiveTimeout(request); } } else { TTransportException transportException = new TTransportException("Sending request failed", future.getCause()); listener.onChannelError(transportException); onError(transportException); } } }); } }); }
Source:
protected long toLastCommitted(TopicPartition topicPartition) { Long offset = lastCommittedOffsets.get(topicPartition); if (offset == null) { OffsetAndMetadata offsetMeta = consumer.committed(topicPartition); if (offsetMeta != null) { offset = offsetMeta.offset(); } } if (offset != null) { consumer.seek(topicPartition, offset); } else { consumer.seekToBeginning(Collections.singletonList(topicPartition)); offset = consumer.position(topicPartition); } log.debug(String.format(" toLastCommitted: %s-%02d:+%d", getNameForTopic(topicPartition.topic()), topicPartition.partition(), offset)); return offset; }

Target:
protected long toLastCommitted(TopicPartition topicPartition) { Long offset = lastCommittedOffsets.get(topicPartition); if (offset == null) { OffsetAndMetadata offsetMeta = consumer.committed(topicPartition); if (offsetMeta != null) { offset = offsetMeta.offset(); } } if (offset != null) { consumer.seek(topicPartition, offset); } else { consumer.seekToBeginning(Collections.singletonList(topicPartition)); offset = consumer.position(topicPartition); } if (log.isDebugEnabled()) { log.debug(String.format(" toLastCommitted: %s-%02d:+%d", getNameForTopic(topicPartition.topic()), topicPartition.partition(), offset)); } return offset; }
Source:
public void testLookupVariant() { @SuppressWarnings("null") VariantDefinition result = fixture.lookupVariant(ENUM_8); assertNull(result); }

Target:
public void testLookupVariant() { VariantDefinition result = fixture.lookupVariant(ENUM_8); assertNull(result); }
Source:
public final static VelocityModeHandler modeHandler(PageMode mode, HttpServletRequest request, HttpServletResponse response) { switch (mode) { case PREVIEW_MODE: return new VelocityPreviewMode(request, response); case EDIT_MODE: return new VelocityEditMode(request, response); default: return new VelocityLiveMode(request, response); } }

Target:
public static final VelocityModeHandler modeHandler(PageMode mode, HttpServletRequest request, HttpServletResponse response) { switch (mode) { case PREVIEW_MODE: return new VelocityPreviewMode(request, response); case EDIT_MODE: return new VelocityEditMode(request, response); default: return new VelocityLiveMode(request, response); } }
Source:
public void addKoreRules(Module module, TermContext termContext) { KOREtoBackendKIL transformer = new KOREtoBackendKIL(termContext); JavaConversions.setAsJavaSet(module.sentences()).stream().forEach(s -> { if (s instanceof org.kframework.definition.Rule) { org.kframework.definition.Rule rule = (org.kframework.definition.Rule) s; K leftHandSide = RewriteToTop.toLeft(rule.body()); org.kframework.kil.Rule oldRule = new org.kframework.kil.Rule(); oldRule.setAttributes(new KOREtoKIL().convertAttributes(rule.att())); Location loc = rule.att().getOptional(Location.class).orElse(null); Source source = rule.att().getOptional(Source.class).orElse(null); oldRule.setLocation(loc); oldRule.setSource(source); if (leftHandSide instanceof KApply && module.attributesFor().apply(((KApply)leftHandSide).klabel()).contains("function")) { oldRule.putAttribute("function", ""); } addRule(new Rule( "", transformer.convert(leftHandSide), transformer.convert(RewriteToTop.toRight(rule.body())), Collections.singletonList(transformer.convert(rule.requires())), Collections.singletonList(transformer.convert(rule.ensures())), Collections.emptySet(), Collections.emptySet(), ConjunctiveFormula.of(termContext), false, null, null, null, null, oldRule, termContext)); } }); }

Target:
public void addKoreRules(Module module, TermContext termContext) { KOREtoBackendKIL transformer = new KOREtoBackendKIL(termContext); JavaConversions.setAsJavaSet(module.sentences()).stream().forEach(s -> { if (s instanceof org.kframework.definition.Rule) { org.kframework.definition.Rule rule = (org.kframework.definition.Rule) s; K leftHandSide = RewriteToTop.toLeft(rule.body()); org.kframework.kil.Rule oldRule = new org.kframework.kil.Rule(); oldRule.setAttributes(new KOREtoKIL().convertAttributes(rule.att())); Location loc = rule.att().getOptional(Location.class).orElse(null); Source source = rule.att().getOptional(Source.class).orElse(null); oldRule.setLocation(loc); oldRule.setSource(source); if (leftHandSide instanceof KApply && module.attributesFor().apply(((KApply)leftHandSide).klabel()).contains(Attribute.FUNCTION_KEY)) { oldRule.putAttribute(Attribute.FUNCTION_KEY, ""); } addRule(new Rule( "", transformer.convert(leftHandSide), transformer.convert(RewriteToTop.toRight(rule.body())), Collections.singletonList(transformer.convert(rule.requires())), Collections.singletonList(transformer.convert(rule.ensures())), Collections.emptySet(), Collections.emptySet(), ConjunctiveFormula.of(termContext), false, null, null, null, null, oldRule, termContext)); } }); }
Source:
private Downloader download(String url, String title, boolean expectedResult, boolean deleteExisting, String username, String password, boolean deleteOnFail) { FeedFile feedFile = setupFeedFile(url, title, deleteExisting); DownloadRequest request = new DownloadRequest(feedFile.getFile_url(), url, title, 0, feedFile.getTypeAsInt(), username, password, deleteOnFail, null, false); Downloader downloader = new HttpDownloader(request); downloader.call(); DownloadStatus status = downloader.getResult(); assertNotNull(status); assertEquals(status.isSuccessful(), expectedResult); assertTrue(status.isDone()); assertTrue(!deleteExisting || new File(feedFile.getFile_url()).exists() == expectedResult); return downloader; }

Target:
private Downloader download(String url, String title, boolean expectedResult, boolean deleteExisting, String username, String password, boolean deleteOnFail) { FeedFile feedFile = setupFeedFile(url, title, deleteExisting); DownloadRequest request = new DownloadRequest(feedFile.getFile_url(), url, title, 0, feedFile.getTypeAsInt(), username, password, deleteOnFail, null, false); Downloader downloader = new HttpDownloader(request); downloader.call(); DownloadStatus status = downloader.getResult(); assertNotNull(status); assertEquals(expectedResult, status.isSuccessful()); assertTrue(status.isDone()); assertTrue(!deleteExisting || new File(feedFile.getFile_url()).exists() == expectedResult); return downloader; }
Source:
private void refreshAccessToken() { if (refreshTokenNetworkRequest != null) { refreshTokenNetworkRequest.cancel(); } Future<?> task = SyncManager.NETWORK_POOL_EXECUTOR.submit(new ExponentialBackoffTask<AuthenticateResponse>() { @Override protected AuthenticateResponse execute() { return authServer.refreshUser(user.getUserToken(), configuration.getServerUrl(), user.getAuthenticationUrl()); } @Override protected void onSuccess(AuthenticateResponse response) { RealmLog.debug("Access Token refreshed successfully"); if (updateSessionAccessToken(response.getAccessToken().value())) { RealmLog.debug("Token applied"); ObjectServerUser.AccessDescription desc = new ObjectServerUser.AccessDescription( response.getAccessToken(), configuration.getPath(), configuration.shouldDeleteRealmOnLogout() ); user.addRealm(configuration.getServerUrl(), desc); scheduleRefreshAccessToken(response.getAccessToken().expiresMs()); } } @Override protected void onError(AuthenticateResponse response) { } }); refreshTokenNetworkRequest = new RealmAsyncTaskImpl(task, SyncManager.NETWORK_POOL_EXECUTOR); }

Target:
private void refreshAccessToken() { if (refreshTokenNetworkRequest != null) { refreshTokenNetworkRequest.cancel(); } Future<?> task = SyncManager.NETWORK_POOL_EXECUTOR.submit(new ExponentialBackoffTask<AuthenticateResponse>() { @Override protected AuthenticateResponse execute() { return authServer.refreshUser(user.getUserToken(), configuration.getServerUrl(), user.getAuthenticationUrl()); } @Override protected void onSuccess(AuthenticateResponse response) { synchronized (ObjectServerSession.this) { RealmLog.debug("Access Token refreshed successfully"); if (updateSessionAccessToken(response.getAccessToken().value())) { RealmLog.debug("Token applied"); ObjectServerUser.AccessDescription desc = new ObjectServerUser.AccessDescription( response.getAccessToken(), configuration.getPath(), configuration.shouldDeleteRealmOnLogout() ); user.addRealm(configuration.getServerUrl(), desc); scheduleRefreshAccessToken(response.getAccessToken().expiresMs()); } } } @Override protected void onError(AuthenticateResponse response) { RealmLog.error("Unrecoverable error, while refreshing the access Token (" + response.getError().toString() + ") reschedule will not happen"); } }); refreshTokenNetworkRequest = new RealmAsyncTaskImpl(task, SyncManager.NETWORK_POOL_EXECUTOR); }
Source:
public Feature< Link, Double, DoublePropertyMap< Link > > compute( final Model model ) { final ModelGraph graph = model.getGraph(); final DoublePropertyMap< Link > pm = new DoublePropertyMap<>( graph.edges(), Double.NaN ); final Spot ref1 = graph.vertexRef(); final Spot ref2 = graph.vertexRef(); @SuppressWarnings( "unchecked" ) final Feature< Link, Double, DoublePropertyMap< Link > > displacementFeature = ( Feature< Link, Double, DoublePropertyMap< Link > > ) model.getFeatureModel().getFeature( LinkDisplacementComputer.KEY ); final DoublePropertyMap< Link > displacement = displacementFeature.getPropertyMap(); for ( final Link link : graph.edges() ) { if ( displacement.isSet( link ) ) { final double disp = displacement.getDouble( link ); final Spot source = link.getSource( ref1 ); final Spot target = link.getTarget( ref2 ); final double dt = Math.abs( source.getTimepoint() - target.getTimepoint() ); pm.set( link, disp / dt ); } } graph.releaseRef( ref1 ); graph.releaseRef( ref2 ); final Map< String, FeatureProjection< Link > > projections = Collections.singletonMap( KEY, FeatureProjectors.project( pm ) ); final Feature< Link, Double, DoublePropertyMap< Link > > feature = new Feature<>( KEY, Link.class, pm, projections ); return feature; }

Target:
public Feature< Link, DoublePropertyMap< Link > > compute( final Model model ) { final ModelGraph graph = model.getGraph(); final DoublePropertyMap< Link > pm = new DoublePropertyMap<>( graph.edges(), Double.NaN ); final Spot ref1 = graph.vertexRef(); final Spot ref2 = graph.vertexRef(); @SuppressWarnings( "unchecked" ) final Feature< Link, DoublePropertyMap< Link > > displacementFeature = ( Feature< Link, DoublePropertyMap< Link > > ) model.getFeatureModel().getFeature( LinkDisplacementComputer.KEY ); final DoublePropertyMap< Link > displacement = displacementFeature.getPropertyMap(); for ( final Link link : graph.edges() ) { if ( displacement.isSet( link ) ) { final double disp = displacement.getDouble( link ); final Spot source = link.getSource( ref1 ); final Spot target = link.getTarget( ref2 ); final double dt = Math.abs( source.getTimepoint() - target.getTimepoint() ); pm.set( link, disp / dt ); } } graph.releaseRef( ref1 ); graph.releaseRef( ref2 ); final Map< String, FeatureProjection< Link > > projections = Collections.singletonMap( KEY, FeatureProjectors.project( pm ) ); final Feature< Link, DoublePropertyMap< Link > > feature = new Feature<>( KEY, Link.class, pm, projections ); return feature; }
Source:
public RegisteredService findServiceBy(final String serviceId) { if (StringUtils.isBlank(serviceId)) { return null; } RegisteredService service = getCandidateServicesToMatch(serviceId) .filter(r -> r.matches(serviceId)) .findFirst() .orElse(null); if (service == null) { service = this.serviceRegistry.findServiceByExactServiceId(serviceId); } if (service != null) { service.initialize(); } return validateRegisteredService(service); }

Target:
public RegisteredService findServiceBy(final String serviceId) { if (StringUtils.isBlank(serviceId)) { return null; } var service = getCandidateServicesToMatch(serviceId) .filter(r -> r.matches(serviceId)) .findFirst() .orElse(null); if (service == null) { LOGGER.trace("The service that matches the serviceId is not found in the cache, trying to find it from [{}]", serviceId, serviceRegistry.getName()); service = serviceRegistry.findServiceBy(serviceId); if (service != null) { services.put(service.getId(), service); LOGGER.trace("The service is found in and populated to the cache ", serviceRegistry.getName(), service); } } if (service != null) { service.initialize(); } return validateRegisteredService(service); }
Source:
public void close() throws Exception { closeAll(stream, file::release, () -> buffersToClose.forEach(Buffer::recycleBuffer)); }

Target:
public void close() throws Exception { closeAll(stream, file::release); }
Source:
public String getDisplayName() { return "Azure DevOps Services Release Webhook"; }

Target:
public String getDisplayName() { return "TFS/Team Services Release Webhook"; }
Source:
private void doAuthenticate(ExtMap input, ExtMap output) { input.putIfAbsent(Base.ContextKeys.CONFIGURATION, configuration); broker.runAdAction( AdActionType.AuthenticateUser, new LdapUserPasswordBaseParameters(input, output) ); output.mput( Authn.InvokeKeys.USER_MESSAGE, configuration.getProperty("config.change.password.msg") ).mput( Authn.InvokeKeys.CREDENTIALS_CHANGE_URL, configuration.getProperty("config.change.password.url" ) ); }

Target:
private void doAuthenticate(ExtMap input, ExtMap output) { output.mput( (ExtMap) broker.runAdAction( AdActionType.AuthenticateUser, new LdapUserPasswordBaseParameters( configuration, input.<String> get(Authn.InvokeKeys.USER), input.<String> get(Authn.InvokeKeys.CREDENTIALS) ) ).getReturnValue()); output.mput( Authn.InvokeKeys.USER_MESSAGE, configuration.getProperty("config.change.password.msg") ).mput( Authn.InvokeKeys.CREDENTIALS_CHANGE_URL, configuration.getProperty("config.change.password.url" ) ); }
Source:
public void matchEmpiAndUpdateLinks(ResourceModifiedMessage theMsg) { String resourceType = theMsg.getId(myFhirContext).getResourceType(); validateResourceType(resourceType); EmpiTransactionContext empiContext = createEmpiContext(theMsg); try { switch (theMsg.getOperationType()) { case CREATE: handleCreatePatientOrPractitioner(theMsg, empiContext); break; case UPDATE: case MANUALLY_TRIGGERED: handleUpdatePatientOrPractitioner(theMsg, empiContext); break; case DELETE: default: ourLog.trace("Not processing modified message for {}", theMsg.getOperationType()); } }catch (Exception e) { log(empiContext, "Failure during EMPI processing: " + e.getMessage()); } finally { HookParams params = new HookParams() .add(BaseResourceModifiedMessage.class, (BaseResourceModifiedMessage) theMsg) .add(TransactionLogMessages.class, empiContext.getTransactionLogMessages()); myInterceptorBroadcaster.callHooks(Pointcut.EMPI_AFTER_PERSISTED_RESOURCE_CHECKED, params); } }

Target:
public void matchEmpiAndUpdateLinks(ResourceModifiedMessage theMsg) { String resourceType = theMsg.getId(myFhirContext).getResourceType(); validateResourceType(resourceType); EmpiTransactionContext empiContext = createEmpiContext(theMsg); try { switch (theMsg.getOperationType()) { case CREATE: handleCreatePatientOrPractitioner(theMsg, empiContext); break; case UPDATE: case MANUALLY_TRIGGERED: handleUpdatePatientOrPractitioner(theMsg, empiContext); break; case DELETE: default: ourLog.trace("Not processing modified message for {}", theMsg.getOperationType()); } }catch (Exception e) { log(empiContext, "Failure during EMPI processing: " + e.getMessage()); } finally { ResourceOperationMessage outgoingMsg = new ResourceOperationMessage(myFhirContext, theMsg.getPayload(myFhirContext), theMsg.getOperationType()); outgoingMsg.setTransactionId(theMsg.getTransactionId()); HookParams params = new HookParams() .add(ResourceOperationMessage.class, outgoingMsg) .add(TransactionLogMessages.class, empiContext.getTransactionLogMessages()); myInterceptorBroadcaster.callHooks(Pointcut.EMPI_AFTER_PERSISTED_RESOURCE_CHECKED, params); } }
Source:
private List<Network> findNetworksOnInterface(VdsNetworkInterface iface) { String nameWithoutVlanId = NetworkUtils.StripVlan(iface.getName()); List<Network> networks = new ArrayList<Network>(); for (VdsNetworkInterface tmp : params.getInterfaces()) { if (NetworkUtils.StripVlan(tmp.getName()).equals(nameWithoutVlanId) && tmp.getNetworkName() != null) { if (existingClusterNetworks.containsKey(tmp.getNetworkName())) { networks.add(existingClusterNetworks.get(tmp.getNetworkName())); } } } return networks; }

Target:
private List<Network> findNetworksOnInterface(VdsNetworkInterface iface) { String nameWithoutVlanId = NetworkUtils.StripVlan(iface.getName()); List<Network> networks = new ArrayList<Network>(); for (VdsNetworkInterface tmp : params.getInterfaces()) { if (NetworkUtils.StripVlan(tmp.getName()).equals(nameWithoutVlanId) && tmp.getNetworkName() != null) { if (getExistingClusterNetworks().containsKey(tmp.getNetworkName())) { networks.add(getExistingClusterNetworks().get(tmp.getNetworkName())); } } } return networks; }
Source:
public void nickname() { SyncCredentials creds = SyncCredentials.nickname("foo", false); assertEquals(SyncCredentials.IdentityProvider.NICKNAME, creds.getIdentityProvider()); assertFalse(creds.getUserInfo().isEmpty()); }

Target:
public void nickname() { SyncCredentials creds = SyncCredentials.nickname("foo", false); assertEquals(SyncCredentials.IdentityProvider.NICKNAME, creds.getIdentityProvider()); assertFalse(creds.getUserInfo().isEmpty()); assertFalse((Boolean) creds.getUserInfo().get("is_admin")); }
Source:
public int runCmd(CommandLine cmdLine) throws Exception { final long lid = getOptionLedgerIdValue(cmdLine, "ledgerid", -1); if (lid == -1) { System.err.println("Must specify a ledger id"); return -1; } LedgerManagerFactory mFactory = null; LedgerManager m = null; try { mFactory = LedgerManagerFactory.newLedgerManagerFactory( bkConf, new ZkLayoutManager( ZooKeeperClient.newBuilder() .connectString(bkConf.getZkServers()) .sessionTimeoutMs(bkConf.getZkTimeout()) .build(), bkConf.getZkLedgersRootPath(), ZkUtils.getACLs(bkConf))); m = mFactory.newLedgerManager(); ReadMetadataCallback cb = new ReadMetadataCallback(lid); m.readLedgerMetadata(lid, cb); printLedgerMetadata(cb); } finally { if (m != null) { try { m.close(); mFactory.uninitialize(); } catch (IOException ioe) { LOG.error("Failed to close ledger manager : ", ioe); } } } return 0; }

Target:
public int runCmd(CommandLine cmdLine) throws Exception { final long lid = getOptionLedgerIdValue(cmdLine, "ledgerid", -1); if (lid == -1) { System.err.println("Must specify a ledger id"); return -1; } try (RegistrationManager rm = RegistrationManager.instantiateRegistrationManager(bkConf)) { try (LedgerManagerFactory mFactory = LedgerManagerFactory.newLedgerManagerFactory(bkConf, rm.getLayoutManager())){ try (LedgerManager m = mFactory.newLedgerManager()) { ReadMetadataCallback cb = new ReadMetadataCallback(lid); m.readLedgerMetadata(lid, cb); printLedgerMetadata(cb); } } } return 0; }
Source:
private static void readTrace(CtfTestTrace testTrace, String testName, boolean inGlobalSummary) { assumeTrue(testTrace.exists()); Performance perf = Performance.getDefault(); PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); perf.tagAsSummary(pm, TEST_SUITE_NAME + ':' + testName, Dimension.CPU_TIME); if (inGlobalSummary) { perf.tagAsGlobalSummary(pm, TEST_SUITE_NAME + ':' + testName, Dimension.CPU_TIME); } for (int loops = 0; loops < LOOP_COUNT; loops++) { pm.start(); try (CTFTrace trace = testTrace.getTrace(); CTFTraceReader traceReader = new CTFTraceReader(trace);) { while (traceReader.hasMoreEvents()) { EventDefinition ed = traceReader.getCurrentEventDef(); ed.getCPU(); traceReader.advance(); } } catch (CTFReaderException e) { fail(); } finally { pm.stop(); } } pm.commit(); }

Target:
private static void readTrace(CtfTestTrace testTrace, String testName, boolean inGlobalSummary) { assumeTrue(testTrace.exists()); Performance perf = Performance.getDefault(); PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); perf.tagAsSummary(pm, TEST_SUITE_NAME + ':' + testName, Dimension.CPU_TIME); if (inGlobalSummary) { perf.tagAsGlobalSummary(pm, TEST_SUITE_NAME + ':' + testName, Dimension.CPU_TIME); } for (int loop = 0; loop < LOOP_COUNT; loop++) { pm.start(); try (CTFTrace trace = testTrace.getTrace(); CTFTraceReader traceReader = new CTFTraceReader(trace);) { while (traceReader.hasMoreEvents()) { EventDefinition ed = traceReader.getCurrentEventDef(); ed.getCPU(); traceReader.advance(); } } catch (CTFReaderException e) { fail("Test failed at iteration " + loop + ':' + e.getMessage()); } pm.stop(); } pm.commit(); }
Source:
void baiIndexInitializationCheck() { if (byteOffsetFromContainer == UNINITIALIZED_INDEXING_PARAMETER) { throw new CRAMException("Cannot index this Slice for BAI because its byteOffsetFromContainer is unknown."); } if (containerByteOffset == UNINITIALIZED_INDEXING_PARAMETER) { throw new CRAMException("Cannot index this Slice for BAI because its containerByteOffset is unknown."); } if (index == UNINITIALIZED_INDEXING_PARAMETER) { throw new CRAMException("Cannot index this Slice for BAI because its index is unknown."); } }

Target:
public void baiIndexInitializationCheck() { final StringBuilder error = new StringBuilder(); if (byteOffsetFromContainer == UNINITIALIZED_INDEXING_PARAMETER) { error.append("Cannot index this Slice for BAI because its byteOffsetFromContainer is unknown.").append(System.lineSeparator()); } if (containerByteOffset == UNINITIALIZED_INDEXING_PARAMETER) { error.append("Cannot index this Slice for BAI because its containerByteOffset is unknown.").append(System.lineSeparator()); } if (index == UNINITIALIZED_INDEXING_PARAMETER) { error.append("Cannot index this Slice for BAI because its index is unknown.").append(System.lineSeparator()); } if (error.length() > 0) { throw new CRAMException(error.toString()); } }
Source:
public void shouldReturnTheCorrectLengthOfAnNonEmptyList() { final List<Integer> list = Collections.unmodifiableList( IntStream.range(0, 4) .boxed() .collect(Collectors.toList()) ); final int actual = ListOps.length(list); final int expected = list.size(); assertEquals(expected, actual); }

Target:
public void shouldReturnTheCorrectLengthOfAnNonEmptyList() { final List<Integer> list = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4) ); final int actual = ListOps.length(list); final int expected = list.size(); assertEquals(expected, actual); }
Source:
public void createTxTest() throws Exception { FedoraTransaction tx = repository.startTransaction(); FolderObject obj = repository.createFolderObject(pid, model); assertTrue(FedoraTransaction.hasTxId()); assertTrue(obj.getTypes().contains(Cdr.Folder.getURI())); assertTrue(obj.getTypes().contains(PcdmModels.Object.getURI())); assertEquals("Folder Title", obj.getResource() .getProperty(DcElements.title).getString()); tx.close(); assertFalse(FedoraTransaction.hasTxId()); assertNull(tx.getTxUri()); }

Target:
public void createTxTest() throws Exception { FedoraTransaction tx = repository.startTransaction(); FolderObject obj = null; try { obj = repository.createFolderObject(pid, model); assertTrue(FedoraTransaction.hasTxId()); assertTrue(obj.getTypes().contains(Cdr.Folder.getURI())); assertTrue(obj.getTypes().contains(PcdmModels.Object.getURI())); assertEquals("Folder Title", obj.getResource() .getProperty(DcElements.title).getString()); } finally { tx.close(); } assertFalse(FedoraTransaction.hasTxId()); assertNull(tx.getTxUri()); verifyNonTxStatusCode(obj.getPid(), 200); }
Source:
protected Object adaptToViewItem(IServer server) { ControllableServerBehavior beh = (ControllableServerBehavior)server.loadAdapter(ControllableServerBehavior.class, new NullProgressMonitor()); ServiceManagerEnvironment adb = null; if( beh != null ) { adb = (ServiceManagerEnvironment)beh.getSharedData(ServiceManagerEnvironment.SHARED_INFO_KEY); } if( adb != null ) { OpenshiftUIModel model = new OpenshiftUIModel(); return model.getConnectionWrapperForConnection(new CDKOpenshiftUtility().findExistingOpenshiftConnection(server, adb)); } return null; }

Target:
protected Object adaptToViewItem(IServer server) { ControllableServerBehavior beh = (ControllableServerBehavior)server.loadAdapter(ControllableServerBehavior.class, new NullProgressMonitor()); ServiceManagerEnvironment adb = null; if( beh != null ) { adb = (ServiceManagerEnvironment)beh.getSharedData(ServiceManagerEnvironment.SHARED_INFO_KEY); } if( adb != null ) { return OpenshiftUIModel.getInstance().getConnectionWrapperForConnection( new CDKOpenshiftUtility().findExistingOpenshiftConnection(server, adb)); } return null; }
Source:
private void upload(UploadRequest request, String senderReference) { BrokerServiceExternalBasicStreamedSF brokerServiceExternalBasicStreamedSF; brokerServiceExternalBasicStreamedSF = new BrokerServiceExternalBasicStreamedSF(configuration.getStreamingServiceUrl()); IBrokerServiceExternalBasicStreamed streamingService = brokerServiceExternalBasicStreamedSF.getBasicHttpBindingIBrokerServiceExternalBasicStreamed(); BindingProvider bp = (BindingProvider) streamingService; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configuration.getStreamingServiceUrl().toString()); try { StreamedPayloadBasicBE parameters = new StreamedPayloadBasicBE(); AltinnPackage altinnPackage = AltinnPackage.from(request); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); altinnPackage.write(outputStream); parameters.setDataStream(outputStream.toByteArray()); ReceiptExternalStreamedBE receiptExternal = streamingService.uploadFileStreamedBasic(parameters, FILE_NAME, senderReference, request.getSender(), configuration.getPassword(), configuration.getUsername()); } catch (IBrokerServiceExternalBasicStreamedUploadFileStreamedBasicAltinnFaultFaultFaultMessage e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, AltinnReason.from(e), e); } catch (IOException e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, e); } }

Target:
private void upload(UploadRequest request, String senderReference) { BrokerServiceExternalBasicStreamedSF brokerServiceExternalBasicStreamedSF = new BrokerServiceExternalBasicStreamedSF(configuration.getStreamingServiceUrl()); IBrokerServiceExternalBasicStreamed streamingService = brokerServiceExternalBasicStreamedSF.getBasicHttpBindingIBrokerServiceExternalBasicStreamed(); BindingProvider bp = (BindingProvider) streamingService; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configuration.getStreamingServiceUrl().toString()); try { StreamedPayloadBasicBE parameters = new StreamedPayloadBasicBE(); AltinnPackage altinnPackage = AltinnPackage.from(request); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); altinnPackage.write(outputStream); parameters.setDataStream(outputStream.toByteArray()); streamingService.uploadFileStreamedBasic(parameters, FILE_NAME, senderReference, request.getSender(), configuration.getPassword(), configuration.getUsername()); } catch (IBrokerServiceExternalBasicStreamedUploadFileStreamedBasicAltinnFaultFaultFaultMessage e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, AltinnReasonFactory.from(e), e); } catch (IOException e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, e); } }
Source:
void testGetCoordinatesOfElement() { WebElement element = mock(WebElement.class); int x = 1; int y = 2; int height = 3; int width = 4; when(element.getLocation()).thenReturn(new Point(x, y)); when(element.getSize()).thenReturn(new Dimension(4, 3)); Coords coords = webDriverCoordsProvider.ofElement(null, element); assertAll( () -> assertEquals(x, coords.x), () -> assertEquals(y, coords.y), () -> assertEquals(height, coords.height), () -> assertEquals(width, coords.width) ); }

Target:
void testGetCoordinatesOfElement() { WebElement element = mock(WebElement.class); int x = 1; int y = 2; int height = 3; int width = 4; when(element.getLocation()).thenReturn(new Point(x, y)); when(element.getSize()).thenReturn(new Dimension(width, height)); Coords coords = webDriverCoordsProvider.ofElement(null, element); assertAll( () -> assertEquals(x, coords.x), () -> assertEquals(y, coords.y), () -> assertEquals(height, coords.height), () -> assertEquals(width, coords.width) ); }
Source:
public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { ImageResourceCell imageCell = new ImageResourceCell(); imageCell.setStyle("text-align: center;"); if (value.getIsIncluded() || value.isRemoveLunSelected()) { if (value.isRemoveLunSelected()) { imageCell.setStyle("text-align: center; opacity: 0.2; filter: alpha(opacity=20);"); } imageCell.render(context, resources.okSmallImage(), sb, id); } else if (!value.getIsAccessible()) { imageCell.render(context, resources.logWarningImage(), sb, id); } else if (!multiSelection){ boolean checked = value.getIsSelected(); boolean disabled = value.getIsGrayedOut(); String inputId = id + "_input"; String type = "radio"; SafeHtml input; if (checked && !disabled) { input = templates.inputChecked(inputId, type); } else if (checked && disabled) { input = templates.inputCheckedDisabled(inputId, type); } else if (!checked && !disabled) { input = templates.inputUnchecked(inputId, type); } else { input = templates.inputUncheckedDisabled(inputId, type); } sb.append(templates.span(id, input)); } }

Target:
public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { ImageResourceCell imageCell = new ImageResourceCell(); imageCell.setStyle("text-align: center;"); if (value.isRemoveLunSelected()) { imageCell.setStyle("text-align: center; opacity: 0.2; filter: alpha(opacity=20);"); } if (value.getIsIncluded()) { imageCell.render(context, resources.okSmallImage(), sb, id); } else if (!value.getIsAccessible()) { imageCell.render(context, resources.logWarningImage(), sb, id); } else if (!multiSelection){ boolean checked = value.getIsSelected(); boolean disabled = value.getIsGrayedOut(); String inputId = id + "_input"; String type = "radio"; SafeHtml input; if (checked && !disabled) { input = templates.inputChecked(inputId, type); } else if (checked && disabled) { input = templates.inputCheckedDisabled(inputId, type); } else if (!checked && !disabled) { input = templates.inputUnchecked(inputId, type); } else { input = templates.inputUncheckedDisabled(inputId, type); } sb.append(templates.span(id, input)); } }
Source:
public void testProbeVideo() throws IOException { FFmpegProbeResult info = ffprobe.probe(Samples.big_buck_bunny_720p_1mb); assertFalse(info.hasError()); assertThat(info.getStreams(), hasSize(2)); assertThat(info.getStreams().get(0).codec_type, is(FFmpegStream.CodecType.VIDEO)); assertThat(info.getStreams().get(1).codec_type, is(FFmpegStream.CodecType.AUDIO)); assertThat(info.getStreams().get(1).channels, is(6)); assertThat(info.getStreams().get(1).sample_rate, is(48_000)); assertTrue(info.getChapters().isEmpty()); }

Target:
public void testProbeVideo() throws IOException { FFmpegProbeResult info = ffprobe.probe(Samples.big_buck_bunny_720p_1mb); assertFalse(info.hasError()); assertThat(info.getStreams(), hasSize(2)); assertThat(info.getStreams().get(0).codec_type, is(FFmpegStream.CodecType.VIDEO)); assertThat(info.getStreams().get(1).codec_type, is(FFmpegStream.CodecType.AUDIO)); assertThat(info.getStreams().get(1).channels, is(6)); assertThat(info.getStreams().get(1).sample_rate, is(48_000)); assertThat(info.getChapters().isEmpty(), is(true)); }
Source:
public boolean equals(Object obj) { if (obj != null && obj instanceof AssignSensorType) { return this.toString().equals(obj.toString()); } return false; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AssignSensorType)) { return false; } AssignSensorType other = (AssignSensorType) obj; if (dsuid == null) { if (other.dsuid != null) { return false; } } else if (!dsuid.equals(other.dsuid)) { return false; } if (sensorType != other.sensorType) { return false; } return true; }
Source:
public void addResult(DistributedMember memberID, T resultOfSingleExecution) { result = resultOfSingleExecution; }

Target:
public void addResult(DistributedMember memberID, T resultOfSingleExecution) { if (result != null) { String s = String.format( "This function should only return a single result. Received a second result[%s] from member[%s].", resultOfSingleExecution, memberID); throw new IllegalStateException(s); } result = resultOfSingleExecution; }