auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<?> parseFields(byte[] data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.keySet()); }

Target:
public List<?> parseFields(byte[] data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.values()); }
Source:
protected void setupCloneVmModel(UnitVmModel model, List<UICommand> uiCommands) { model.setTitle(ConstantsManager.getInstance().getConstants().cloneVmTitle()); model.setHelpTag(HelpTag.clone_vm); model.setHashName("clone_vm"); model.setIsClone(true); model.setCustomPropertiesKeysList(AsyncDataProvider.getInstance().getCustomPropertiesList()); model.setIsAdvancedModeLocalStorageKey("wa_vm_dialog"); setWindow(model); model.initialize(); VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand(); switchModeCommand.init(model); model.getCommands().add(switchModeCommand); model.getProvisioning().setEntity(true); for (UICommand uicommand : uiCommands) { model.getCommands().add(uicommand); } model.initForemanProviders(null); }

Target:
protected void setupCloneVmModel(UnitVmModel model, List<UICommand> uiCommands) { model.setTitle(ConstantsManager.getInstance().getConstants().cloneVmTitle()); model.setHelpTag(HelpTag.clone_vm); model.setHashName("clone_vm"); model.setIsClone(true); model.setCustomPropertiesKeysList(AsyncDataProvider.getInstance().getCustomPropertiesList()); model.setIsAdvancedModeLocalStorageKey("wa_vm_dialog"); setWindow(model); model.initialize(); VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand(); switchModeCommand.init(model); model.getCommands().add(switchModeCommand); model.getProvisioning().setEntity(true); model.getCommands().addAll(uiCommands); model.initForemanProviders(null); }
Source:
public static DbRepresentation createSomeData( Cluster cluster ) { try { cluster.coreTx( ( coreGraphDatabase, transaction ) -> { Node node = coreGraphDatabase.createNode( label ); node.setProperty( PROP_NAME, "Neo" ); node.setProperty( PROP_RANDOM, Math.random() * 10000 ); coreGraphDatabase.createNode().createRelationshipTo( node, RelationshipType.withName( "KNOWS" ) ); transaction.success(); } ); } catch ( Exception e ) { e.printStackTrace(); } return DbRepresentation.of( clusterLeader( cluster ).database() ); }

Target:
public static DbRepresentation createSomeData( Cluster cluster ) { try { cluster.coreTx( ClusterHelper::createSomeData ); } catch ( Exception e ) { throw launderedException( e ); } return DbRepresentation.of( clusterLeader( cluster ).database() ); }
Source:
private PopupContextTreeMenu getPopupContextTreeMenuExport() { if (popupContextTreeMenuExport == null) { popupContextTreeMenuExport = new PopupContextTreeMenu() { private static final long serialVersionUID = 1L; @Override public boolean isEnableForComponent(Component invoker) { if (invoker instanceof JTree && SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME.equals( invoker.getName())) { JTree contextTree = (JTree) invoker; this.setEnabled(contextTree.getSelectionCount() < 2); } return (super.isEnableForComponent(invoker)); } }; popupContextTreeMenuExport.setText( Constant.messages.getString("menu.file.context.export")); popupContextTreeMenuExport.setIcon( DisplayUtils.getScaledIcon( new ImageIcon( ExtensionStdMenus.class.getResource( "/resource/icon/fugue/application-blue-export.png")))); popupContextTreeMenuExport.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { Context context = Model.getSingleton() .getSession() .getContext(popupContextTreeMenuExport.getContextId()); ContextExportDialog exportDialog = new ContextExportDialog(View.getSingleton().getMainFrame()); exportDialog.setSelectedContext(context); exportDialog.setVisible(true); } }); popupContextTreeMenuExport.setEnabled( popupContextTreeMenuExport.getContextIds().size() < 2); } return popupContextTreeMenuExport; }

Target:
private PopupContextTreeMenu getPopupContextTreeMenuExport() { if (popupContextTreeMenuExport == null) { popupContextTreeMenuExport = new PopupContextTreeMenu(false); popupContextTreeMenuExport.setText( Constant.messages.getString("menu.file.context.export")); popupContextTreeMenuExport.setIcon( DisplayUtils.getScaledIcon( new ImageIcon( ExtensionStdMenus.class.getResource( "/resource/icon/fugue/application-blue-export.png")))); popupContextTreeMenuExport.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { Context context = Model.getSingleton() .getSession() .getContext(popupContextTreeMenuExport.getContextId()); ContextExportDialog exportDialog = new ContextExportDialog(View.getSingleton().getMainFrame()); exportDialog.setSelectedContext(context); exportDialog.setVisible(true); } }); } return popupContextTreeMenuExport; }
Source:
private void validateCacheDeserializedValuesOption(CacheDeserializedValues newValue) { if (!optimizeQueryExplicitlyInvoked) { return; } boolean optimizeQueryFlag = (cacheDeserializedValues == CacheDeserializedValues.ALWAYS); if (optimizeQueryFlag && newValue != CacheDeserializedValues.ALWAYS) { throw new ConfigurationException("Deprecated option 'optimize-queries' is set to `true`, " + "but 'cacheDeserializedValues' is being set to NEVER or INDEX_ONLY." + " These are conflicting options. Please remove the `optimize-queries'"); } else if (!optimizeQueryFlag && newValue == CacheDeserializedValues.ALWAYS) { throw new ConfigurationException("Deprecated option 'optimize-queries' is set to `false`, " + "but 'cacheDeserializedValues' is begin set to ALWAYS. These are conflicting options." + " Please remove the `optimize-queries'"); } }

Target:
private void validateCacheDeserializedValuesOption(CacheDeserializedValues newValue) { if (!optimizeQueryExplicitlyInvoked) { return; } boolean optimizeQueryFlag = (cacheDeserializedValues == CacheDeserializedValues.ALWAYS); if (optimizeQueryFlag && newValue != CacheDeserializedValues.ALWAYS) { throw new ConfigurationException("Deprecated option 'optimize-queries' is set to `true`, " + "but 'cacheDeserializedValues' is being set to NEVER or INDEX_ONLY." + " These are conflicting options. Please remove the `optimize-queries'"); } else if (!optimizeQueryFlag && newValue == CacheDeserializedValues.ALWAYS) { throw new ConfigurationException("Deprecated option 'optimize-queries' is set to `false`, " + "but 'cacheDeserializedValues' is being set to ALWAYS. These are conflicting options." + " Please remove the `optimize-queries'"); } }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Bundle bundle = getArguments(); courseData = (EnrolledCoursesResponse) bundle.getSerializable(CourseData); if (courseData != null) { IS_COURSEWARE_ACCESSIBLE = courseData.getCourse().getCoursewareAccess().hasAccess(); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Bundle args = getArguments(); courseData = (EnrolledCoursesResponse) args.getSerializable(CourseData); if (courseData != null) { isCoursewareAccessible = courseData.getCourse().getCoursewareAccess().hasAccess(); } }
Source:
public BasicAuthorizerPermission( ResourceAction resourceAction ) { this.resourceAction = resourceAction; try { this.resourceNamePattern = Pattern.compile(resourceAction.getResource().getName()); } catch (PatternSyntaxException pse) { throw new BasicSecurityDBResourceException( "Invalid permission, resource name regex[%s] does not compile.", resourceAction.getResource().getName() ); } }

Target:
public BasicAuthorizerPermission( ResourceAction resourceAction ) { this.resourceAction = resourceAction; try { this.resourceNamePattern = Pattern.compile(resourceAction.getResource().getName()); } catch (PatternSyntaxException pse) { throw new BasicSecurityDBResourceException( pse, "Invalid permission, resource name regex[%s] does not compile.", resourceAction.getResource().getName() ); } }
Source:
public boolean onPreferenceClick(Preference preference) { if (MultiClickGuard.allowClick(getClass().getName())) { PreferenceFragmentCompat basePreferenceFragment = null; switch (preference.getKey()) { case "protocol": basePreferenceFragment = new ServerPreferencesFragment(); break; case "user_interface": basePreferenceFragment = new UserInterfacePreferencesFragment(); break; case "maps": basePreferenceFragment = new MapsPreferences(); break; case "form_management": basePreferenceFragment = new FormManagementPreferences(); break; case "user_and_device_identity": basePreferenceFragment = new IdentityPreferences(); break; case "experimental": basePreferenceFragment = new ExperimentalPreferencesFragment(); break; } if (basePreferenceFragment != null) { getActivity().getSupportFragmentManager() .beginTransaction() .replace(R.id.preferences_fragment_container, basePreferenceFragment) .addToBackStack(null) .commit(); } return true; } return false; }

Target:
public boolean onPreferenceClick(Preference preference) { if (MultiClickGuard.allowClick(getClass().getName())) { PreferenceFragmentCompat basePreferenceFragment = getPreferenceFragment(preference.getKey()); if (basePreferenceFragment != null) { basePreferenceFragment.setArguments(getArguments()); getActivity().getSupportFragmentManager() .beginTransaction() .replace(R.id.preferences_fragment_container, basePreferenceFragment) .addToBackStack(null) .commit(); } return true; } return false; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StackFrame that = (StackFrame) o; return Objects.equals(bci, that.bci) && Objects.equals(lineNumber, that.lineNumber) && Objects.equals(methodId, that.methodId); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StackFrame that = (StackFrame) o; return Objects.equals(bci, that.bci) && Objects.equals(lineNumber, that.lineNumber) && Objects.equals(methodId, that.methodId); }
Source:
protected void registerChanges(final TextEditBasedChangeManager manager) throws CoreException { CompilationUnitRewrite rewrite= null; Set<Entry<ICompilationUnit, CompilationUnitRewrite>> entrySet= fCompilationUnitRewrites.entrySet(); for (Entry<ICompilationUnit, CompilationUnitRewrite> entry : entrySet) { ICompilationUnit unit= entry.getKey(); rewrite= entry.getValue(); if (rewrite != null) { final CompilationUnitChange change= rewrite.createChange(true); if (change != null) manager.manage(unit, change); } } }

Target:
protected void registerChanges(final TextEditBasedChangeManager manager) throws CoreException { CompilationUnitRewrite rewrite= null; for (Entry<ICompilationUnit, CompilationUnitRewrite> entry : fCompilationUnitRewrites.entrySet()) { ICompilationUnit unit= entry.getKey(); rewrite= entry.getValue(); if (rewrite != null) { final CompilationUnitChange change= rewrite.createChange(true); if (change != null) manager.manage(unit, change); } } }
Source:
public static void main(String[] args) { try { new StartMain(args).go(); System.exit(0); } catch(Throwable t) { logger.error("Application exited with an exception", t); System.exit(1); } }

Target:
public static void main(String[] args) { try { new StartMain(args).go(); System.exit(0); } catch(Throwable t) { WeldSELogger.LOG.error("Application exited with an exception", t); System.exit(1); } }
Source:
public void configure(Config config) throws Exception { String endpointUrl = config.getProperty( ENDPOINT_URL_PROPERTY, GeoservePlacesService.DEFAULT_ENDPOINT_URL ); int connectTimeout = Integer.parseInt( config.getProperty( CONNECT_TIMEOUT_PROPERTY, Integer.toString(GeoservePlacesService.DEFAULT_CONNECT_TIMEOUT) ) ); int readTimeout = Integer.parseInt( config.getProperty( READ_TIMEOUT_PROPERTY, Integer.toString(GeoservePlacesService.DEFAULT_READ_TIMEOUT) ) ); this.distanceThreshold = Double.parseDouble( config.getProperty( GEOSERVE_DISTANCE_THRESHOLD_PROPERTY, DEFAULT_GEOSERVE_DISTANCE_THRESHOLD.toString() ) ); LOGGER.config(String.format("[%s] GeoservePlacesService(%s, %d, %d)", this.getName(), endpointUrl, connectTimeout, readTimeout)); this.setPlacesService(new GeoservePlacesService(endpointUrl, connectTimeout, readTimeout)); }

Target:
public void configure(Config config) throws Exception { this.distanceThreshold = Integer.valueOf( config.getProperty( GEOSERVE_DISTANCE_THRESHOLD_PROPERTY, DEFAULT_GEOSERVE_DISTANCE_THRESHOLD.toString() ) ); String placesEndpointUrl = config.getProperty( PLACES_ENDPOINT_URL_PROPERTY, GeoservePlacesService.DEFAULT_ENDPOINT_URL ); int placesEndpointConnectTimeout = Integer.parseInt( config.getProperty( CONNECT_TIMEOUT_PROPERTY, Integer.toString(GeoservePlacesService.DEFAULT_CONNECT_TIMEOUT) ) ); int placesEndpointReadTimeout = Integer.parseInt( config.getProperty( READ_TIMEOUT_PROPERTY, Integer.toString(GeoservePlacesService.DEFAULT_READ_TIMEOUT) ) ); LOGGER.config( String.format("[%s] GeoservePlacesService(%s, %d, %d)", this.getName(), placesEndpointUrl, placesEndpointReadTimeout, placesEndpointReadTimeout ) ); this.setPlacesService( new GeoservePlacesService( placesEndpointUrl, placesEndpointConnectTimeout, placesEndpointReadTimeout ) ); String regionsEndpointUrl = config.getProperty( REGIONS_ENDPOINT_URL_PROPERTY, GeoserveRegionsService.DEFAULT_ENDPOINT_URL ); int regionsEndpointConnectTimeout = Integer.parseInt( config.getProperty( CONNECT_TIMEOUT_PROPERTY, Integer.toString(GeoserveRegionsService.DEFAULT_CONNECT_TIMEOUT) ) ); int regionsEndpointReadTimeout = Integer.parseInt( config.getProperty( READ_TIMEOUT_PROPERTY, Integer.toString(GeoserveRegionsService.DEFAULT_READ_TIMEOUT) ) ); LOGGER.config( String.format("[%s] GeoserveRegionsService(%s, %d, %d)", this.getName(), regionsEndpointUrl, regionsEndpointReadTimeout, regionsEndpointReadTimeout ) ); this.setRegionsService( new GeoserveRegionsService( regionsEndpointUrl, regionsEndpointConnectTimeout, regionsEndpointReadTimeout ) ); }
Source:
public List<IReconciler> getReconcilers(ISourceViewer sourceViewer, Set<IContentType> contentTypes) { if (this.outOfSync) { sync(); } List<IReconciler> reconcilers = this.extensions.values().stream() .filter(ext -> contentTypes.contains(ext.targetContentType)) .sorted(new ContentTypeSpecializationComparator<IReconciler>()) .map(GenericContentTypeRelatedExtension<IReconciler>::createDelegate) .collect(Collectors.toList()); Collections.reverse(reconcilers); return reconcilers; }

Target:
public List<IReconciler> getReconcilers(ISourceViewer sourceViewer, Set<IContentType> contentTypes) { if (this.outOfSync) { sync(); } List<IReconciler> reconcilers = this.extensions.values().stream() .filter(ext -> contentTypes.contains(ext.targetContentType)) .sorted(new ContentTypeSpecializationComparator<IReconciler>().reversed()) .map(GenericContentTypeRelatedExtension<IReconciler>::createDelegate) .collect(Collectors.toList()); return reconcilers; }
Source:
public void setup() throws Exception { TypeRegistry typeRegistry = new TypeRegistry(); DBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime()); dbi.registerMapper(new TableColumn.Mapper(typeRegistry)); dummyHandle = dbi.open(); metadataDao = dbi.onDemand(MetadataDao.class); createTablesWithRetry(dbi); dataDir = Files.createTempDir(); RaptorConnectorId connectorId = new RaptorConnectorId("test"); NodeManager nodeManager = new TestingNodeManager(); NodeSupplier nodeSupplier = nodeManager::getWorkerNodes; ShardManager shardManager = createShardManager(dbi); StorageManager storageManager = createOrcStorageManager(dbi, dataDir, true); StorageManagerConfig config = new StorageManagerConfig(); connector = new RaptorConnector( new LifeCycleManager(ImmutableList.of(), null), new TestingNodeManager(), new RaptorMetadataFactory(connectorId, dbi, shardManager, null), new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false), new RaptorPageSourceProvider(storageManager), new RaptorPageSinkProvider(storageManager, new PagesIndexPageSorter(new PagesIndex.TestingFactory(false)), new TemporalFunction(DateTimeZone.forID("America/Los_Angeles")), config), new RaptorNodePartitioningProvider(nodeSupplier), new RaptorSessionProperties(config), new RaptorTableProperties(typeRegistry), ImmutableSet.of(), new AllowAllAccessControl(), dbi); }

Target:
public void setup() throws Exception { TypeRegistry typeRegistry = new TypeRegistry(); DBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime()); dbi.registerMapper(new TableColumn.Mapper(typeRegistry)); dummyHandle = dbi.open(); metadataDao = dbi.onDemand(MetadataDao.class); createTablesWithRetry(dbi); dataDir = Files.createTempDir(); RaptorConnectorId connectorId = new RaptorConnectorId("test"); NodeManager nodeManager = new TestingNodeManager(); NodeSupplier nodeSupplier = nodeManager::getWorkerNodes; ShardManager shardManager = createShardManager(dbi); StorageManager storageManager = createOrcStorageManager(dbi, dataDir, true); StorageManagerConfig config = new StorageManagerConfig(); connector = new RaptorConnector( new LifeCycleManager(ImmutableList.of(), null), new TestingNodeManager(), new RaptorMetadataFactory(connectorId, dbi, shardManager, new TypeRegistry()), new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false), new RaptorPageSourceProvider(storageManager), new RaptorPageSinkProvider(storageManager, new PagesIndexPageSorter(new PagesIndex.TestingFactory(false)), new TemporalFunction(DateTimeZone.forID("America/Los_Angeles")), config), new RaptorNodePartitioningProvider(nodeSupplier), new RaptorSessionProperties(config), new RaptorTableProperties(typeRegistry), ImmutableSet.of(), new AllowAllAccessControl(), dbi); }
Source:
public void stop() { log.info("Stopping the container process manager"); containerAllocator.stop(); try { allocatorThread.join(); log.info("Stopped container allocator"); } catch (InterruptedException ie) { log.error("Allocator thread join threw an interrupted exception", ie); Thread.currentThread().interrupt(); } if (this.diagnosticsManager.isDefined()) { try { this.diagnosticsManager.get().stop(); } catch (InterruptedException e) { log.error("InterruptedException while stopping diagnosticsManager", e); } } if (containerProcessManagerMetrics != null) { try { if (this.metricsReporters != null) { this.metricsReporters.values().forEach(reporter -> reporter.stop()); } if (this.jvmMetrics != null) { jvmMetrics.stop(); } log.info("Stopped containerProcessManagerMetrics reporters"); } catch (Throwable e) { log.error("Exception while stopping containerProcessManagerMetrics", e); } } try { clusterResourceManager.stop(state.status); log.info("Stopped the cluster resource manager"); } catch (Throwable e) { log.error("Exception while stopping cluster resource manager", e); } log.info("Stopped the container process manager"); }

Target:
public void stop() { log.info("Stopping the container process manager"); containerAllocator.stop(); try { allocatorThread.join(); log.info("Stopped container allocator"); } catch (InterruptedException ie) { log.error("Allocator thread join threw an interrupted exception", ie); Thread.currentThread().interrupt(); } if (this.diagnosticsManager.isDefined()) { try { this.diagnosticsManager.get().stop(); } catch (InterruptedException e) { log.error("InterruptedException while stopping diagnosticsManager", e); } } try { if (this.metricsReporters != null) { this.metricsReporters.values().forEach(reporter -> reporter.stop()); } if (this.jvmMetrics != null) { jvmMetrics.stop(); } log.info("Stopped containerProcessManagerMetrics reporters"); } catch (Throwable e) { log.error("Exception while stopping containerProcessManagerMetrics", e); } try { clusterResourceManager.stop(state.status); log.info("Stopped the cluster resource manager"); } catch (Throwable e) { log.error("Exception while stopping cluster resource manager", e); } log.info("Stopped the container process manager"); }
Source:
public void destroy() { this.filters.forEach(Filter::destroy); }

Target:
public void destroy() { for (int i = this.filters.size(); i-- > 0;) { Filter filter = this.filters.get(i); filter.destroy(); } }
Source:
private String bulkStringify(List<IMetric> metrics){ StringBuilder sb = new StringBuilder(); for(IMetric metric : metrics){ Locator locator = metric.getLocator(); sb.append(String.format( "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\", \"_id\" : \"%s\", \"routing\" : \"%s\" } }%n", AbstractElasticIO.ELASTICSEARCH_INDEX_NAME_WRITE, AbstractElasticIO.ELASTICSEARCH_DOCUMENT_TYPE, locator.getTenantId() + ":" + locator.getMetricName(), locator.getTenantId())); if(metric instanceof Metric && getUnit((Metric) metric) != null){ sb.append(String.format( "{ \"%s\" : \"%s\", \"%s\" : \"%s\", \"%s\" : \"%s\" }%n", ESFieldLabel.tenantId.toString(), locator.getTenantId(), ESFieldLabel.metric_name.toString(), locator.getMetricName(), ESFieldLabel.unit.toString(), getUnit((Metric) metric))); } else { sb.append(String.format( "{ \"%s\" : \"%s\", \"%s\" : \"%s\" }%n", ESFieldLabel.tenantId.toString(), locator.getTenantId(), ESFieldLabel.metric_name.toString(), locator.getMetricName())); } } return sb.toString(); }

Target:
private String bulkStringify(List<IMetric> metrics){ StringBuilder sb = new StringBuilder(); for(IMetric metric : metrics){ Locator locator = metric.getLocator(); if(locator.getMetricName() == null) throw new IllegalArgumentException("trying to insert metric discovery without a metricName"); sb.append(String.format( "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\", \"_id\" : \"%s\", \"routing\" : \"%s\" } }%n", AbstractElasticIO.ELASTICSEARCH_INDEX_NAME_WRITE, AbstractElasticIO.ELASTICSEARCH_DOCUMENT_TYPE, locator.getTenantId() + ":" + locator.getMetricName(), locator.getTenantId())); if(metric instanceof Metric && getUnit((Metric) metric) != null){ sb.append(String.format( "{ \"%s\" : \"%s\", \"%s\" : \"%s\", \"%s\" : \"%s\" }%n", ESFieldLabel.tenantId.toString(), locator.getTenantId(), ESFieldLabel.metric_name.toString(), locator.getMetricName(), ESFieldLabel.unit.toString(), getUnit((Metric) metric))); } else { sb.append(String.format( "{ \"%s\" : \"%s\", \"%s\" : \"%s\" }%n", ESFieldLabel.tenantId.toString(), locator.getTenantId(), ESFieldLabel.metric_name.toString(), locator.getMetricName())); } } return sb.toString(); }
Source:
public Long getMinValue() { return 0L; }

Target:
public Long getMinValue() { return Long.MIN_VALUE; }
Source:
boolean remove(GetOperation op) { if (getOperations.remove(op)) { routerMetrics.operationDequeuingRate.mark(); return true; } else { return false; } }

Target:
private boolean remove(GetOperation op) { if (getOperations.remove(op)) { routerMetrics.operationDequeuingRate.mark(); return true; } else { return false; } }
Source:
private boolean isConflictVsMoveAndDelete(Diff target, Diff conflictedDiff, boolean leftToRight) { boolean result = false; if (target.getConflict().getKind() != REAL) { return false; } if (target instanceof ReferenceChange && target.getKind() == MOVE) { ReferenceChange moveDiff = (ReferenceChange)target; if (conflictedDiff instanceof ReferenceChange && conflictedDiff.getKind() == DELETE) { ReferenceChange deleteDiff = (ReferenceChange)conflictedDiff; IEqualityHelper equalityHelper = target.getMatch().getComparison().getEqualityHelper(); result = equalityHelper.matchingAttributeValues(moveDiff.getValue(), deleteDiff.getValue()); } } return result; }

Target:
private boolean isConflictVsMoveAndDelete(Diff target, Diff conflictedDiff, boolean leftToRight) { boolean result = false; if (target.getConflict() != null && target.getConflict().getKind() == REAL) { if (target instanceof ReferenceChange && target.getKind() == MOVE) { ReferenceChange moveDiff = (ReferenceChange)target; if (conflictedDiff instanceof ReferenceChange && conflictedDiff.getKind() == DELETE) { ReferenceChange deleteDiff = (ReferenceChange)conflictedDiff; IEqualityHelper equalityHelper = target.getMatch().getComparison().getEqualityHelper(); result = equalityHelper.matchingAttributeValues(moveDiff.getValue(), deleteDiff .getValue()); } } } return result; }
Source:
public Result getUpload(String uploadId) throws Exception { UserSession session = getAuthenticatedSession(Roles.RESEARCHER, Roles.ADMIN); if (uploadId.startsWith("recordId:")) { String recordId = uploadId.split(":")[1]; HealthDataRecord record = healthDataService.getRecordById(recordId); if (record == null) { throw new EntityNotFoundException(HealthDataRecord.class); } uploadId = record.getUploadId(); } UploadView uploadView = uploadService.getUploadView(uploadId); String studyId = session.getStudyIdentifier().getIdentifier(); if (!uploadView.getUpload().getStudyId().equals(studyId)) { throw new UnauthorizedException(); } return okResult(HealthDataRecord.PUBLIC_RECORD_WRITER, uploadView); }

Target:
public Result getUpload(String uploadId) throws Exception { getAuthenticatedSession(Roles.ADMIN); if (uploadId.startsWith("recordId:")) { String recordId = uploadId.split(":")[1]; HealthDataRecord record = healthDataService.getRecordById(recordId); if (record == null) { throw new EntityNotFoundException(HealthDataRecord.class); } uploadId = record.getUploadId(); } UploadView uploadView = uploadService.getUploadView(uploadId); return okResult(uploadView); }
Source:
void updateCurrentEventTime(long newTime) { if (fTrace != null) { TmfTimeRange timeRange = new TmfTimeRange(new TmfTimestamp(newTime, ITmfTimestamp.NANOSECOND_SCALE), TmfTimestamp.BIG_CRUNCH); HistogramRequest request = new HistogramRequest(fTimeRangeHistogram.getDataModel(), timeRange, 0, 1, 0, ExecutionType.BACKGROUND) { @Override public void handleData(ITmfEvent event) { if (event != null) { ITmfTimestamp ts = event.getTimestamp(); updateDisplayedCurrentTime(ts.normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue()); TmfTimeSynchSignal signal = new TmfTimeSynchSignal(this, ts); fTimeSyncThrottle.queue(signal); } } }; fTrace.sendRequest(request); } }

Target:
void updateCurrentEventTime(long newTime) { if (fTrace != null) { TmfTimeRange timeRange = new TmfTimeRange(new TmfTimestamp(newTime, ITmfTimestamp.NANOSECOND_SCALE), TmfTimestamp.BIG_CRUNCH); HistogramRequest request = new HistogramRequest(fTimeRangeHistogram.getDataModel(), timeRange, 0, 1, 0, ExecutionType.FOREGROUND) { @Override public void handleData(ITmfEvent event) { if (event != null) { ITmfTimestamp ts = event.getTimestamp(); updateDisplayedCurrentTime(ts.normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue()); TmfTimeSynchSignal signal = new TmfTimeSynchSignal(this, ts); fTimeSyncThrottle.queue(signal); } } }; fTrace.sendRequest(request); } }
Source:
public void onResponse(ReplicaId replicaId, Exception e) { numInflight--; if (e != null) { numFailed++; } else { numSucceeded++; } }

Target:
public void onResponse(ReplicaId replicaId, Exception e) { inflightCount--; if (e != null) { failedCount++; } else { succeededCount++; } }
Source:
public List getDocketFiles() { try { return Files.walk(Paths.get(ConfigCore.getParameter("xsltFolder"))) .filter(s -> s.toString().endsWith(".xsl")) .map(Path::getFileName) .sorted() .collect(Collectors.toList()); } catch (IOException e) { Helper.setErrorMessage("errorLoadingMany", new Object[] {Helper.getTranslation("dockets")}, logger, e); return new ArrayList<>(); } }

Target:
public List getDocketFiles() { try { return Files.walk(Paths.get(ConfigCore.getParameter(Parameters.DIR_XSLT))) .filter(s -> s.toString().endsWith(".xsl")) .map(Path::getFileName) .sorted() .collect(Collectors.toList()); } catch (IOException e) { Helper.setErrorMessage("errorLoadingMany", new Object[] {Helper.getTranslation("dockets")}, logger, e); return new ArrayList<>(); } }
Source:
void handleReceive(Message message) { if (message == null || tracing.isNoop()) return; MessageConsumerRequest request = new MessageConsumerRequest(message, destination(message)); TraceContextOrSamplingFlags extracted = jmsTracing.extractAndClearProperties(extractor, request, message); Span span = jmsTracing.nextMessagingSpan(sampler, request, extracted); if (!span.isNoop()) { span.name("receive").kind(Span.Kind.CONSUMER); Destination destination = destination(message); if (destination != null) jmsTracing.tagQueueOrTopic(request, span); if (remoteServiceName != null) span.remoteServiceName(remoteServiceName); long timestamp = tracing.clock(span.context()).currentTimeMicroseconds(); span.start(timestamp).finish(timestamp); } injector.inject(span.context(), request); if (message instanceof BytesMessage) { (BytesMessage message).reset(); } }

Target:
void handleReceive(Message message) { if (message == null || tracing.isNoop()) return; MessageConsumerRequest request = new MessageConsumerRequest(message, destination(message)); TraceContextOrSamplingFlags extracted = jmsTracing.extractAndClearProperties(extractor, request, message); Span span = jmsTracing.nextMessagingSpan(sampler, request, extracted); if (!span.isNoop()) { span.name("receive").kind(Span.Kind.CONSUMER); Destination destination = destination(message); if (destination != null) jmsTracing.tagQueueOrTopic(request, span); if (remoteServiceName != null) span.remoteServiceName(remoteServiceName); long timestamp = tracing.clock(span.context()).currentTimeMicroseconds(); span.start(timestamp).finish(timestamp); } injector.inject(span.context(), request); }
Source:
public void importReport(File reportFile, SensorContext context, Map<String, Integer> numberOfLinesOfCode) { Preconditions.checkNotNull(reportFile); TestSuites testSuites = parser.parse(reportFile); for (PhpUnitTestFileReport fileReport : testSuites.arrangeSuitesIntoTestFileReports()) { fileReport.saveTestMeasures(context); } }

Target:
public void importReport(File reportFile, SensorContext context, Map<String, Integer> numberOfLinesOfCode) { TestSuites testSuites = parser.parse(reportFile); for (PhpUnitTestFileReport fileReport : testSuites.arrangeSuitesIntoTestFileReports()) { fileReport.saveTestMeasures(context); } }
Source:
public void setup() throws Exception { super.setUp(); String apiKey = getProperty("discovery.apikey"); String url = "<LINK_0>"; Authenticator authenticator = new IamAuthenticator(apiKey); discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl(url); discovery.setDefaultHeaders(getDefaultHeaders()); uniqueName = UUID.randomUUID().toString(); }

Target:
public void setup() throws Exception { super.setUp(); String apiKey = getProperty("discovery.apikey"); String url = getProperty("discovery.url"); Authenticator authenticator = new IamAuthenticator(apiKey); discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl(url); discovery.setDefaultHeaders(getDefaultHeaders()); uniqueName = UUID.randomUUID().toString(); }
Source:
public void test_subSeries_picks_valid_dates() { LocalDateDoubleTimeSeries series = LocalDateDoubleTimeSeries.builder() .put(DATE_2015_01_02, 10) .put(DATE_2015_01_05, 11) .put(DATE_2015_01_06, 12) .put(DATE_2015_01_07, 13) .put(DATE_2015_01_08, 14) .put(DATE_2015_01_09, 15) .put(DATE_2015_01_12, 16) .build(); LocalDateDoubleTimeSeries subSeries = series.subSeries(date(2015, 1, 4), date(2015, 1, 10)); assertEquals(subSeries.size(), 5); assertEquals(subSeries.get(DATE_2015_01_02), OptionalDouble.empty()); assertEquals(subSeries.get(date(2015, 1, 4)), OptionalDouble.empty()); assertEquals(subSeries.get(DATE_2015_01_05), OptionalDouble.of(11)); assertEquals(subSeries.get(DATE_2015_01_06), OptionalDouble.of(12)); assertEquals(subSeries.get(DATE_2015_01_07), OptionalDouble.of(13)); assertEquals(subSeries.get(DATE_2015_01_08), OptionalDouble.of(14)); assertEquals(subSeries.get(DATE_2015_01_09), OptionalDouble.of(15)); assertEquals(subSeries.get(DATE_2015_01_12), OptionalDouble.empty()); }

Target:
public void test_subSeries_picks_valid_dates() { LocalDateDoubleTimeSeries series = LocalDateDoubleTimeSeries.builder() .put(DATE_2015_01_02, 10) .put(DATE_2015_01_05, 11) .put(DATE_2015_01_06, 12) .put(DATE_2015_01_07, 13) .put(DATE_2015_01_08, 14) .put(DATE_2015_01_09, 15) .put(DATE_2015_01_12, 16) .build(); LocalDateDoubleTimeSeries subSeries = series.subSeries(DATE_2015_01_04, date(2015, 1, 10)); assertEquals(subSeries.size(), 5); assertEquals(subSeries.get(DATE_2015_01_02), OptionalDouble.empty()); assertEquals(subSeries.get(DATE_2015_01_04), OptionalDouble.empty()); assertEquals(subSeries.get(DATE_2015_01_05), OptionalDouble.of(11)); assertEquals(subSeries.get(DATE_2015_01_06), OptionalDouble.of(12)); assertEquals(subSeries.get(DATE_2015_01_07), OptionalDouble.of(13)); assertEquals(subSeries.get(DATE_2015_01_08), OptionalDouble.of(14)); assertEquals(subSeries.get(DATE_2015_01_09), OptionalDouble.of(15)); assertEquals(subSeries.get(DATE_2015_01_12), OptionalDouble.empty()); }
Source:
private static DatabaseHolder createAndStartEmbeddedInstance() throws IOException { final File dataStore1 = Files.createTempDirectory("neo4j.db").toFile(); final GraphDatabaseService graphDatabaseService = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dataStore1) .newGraphDatabase(); return new DatabaseHolder(dataStore1, graphDatabaseService); }

Target:
private static DatabaseHolder createAndStartEmbeddedInstance() throws IOException { File dataStore1 = Files.createTempDirectory("neo4j.db").toFile(); GraphDatabaseService graphDatabaseService = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dataStore1) .newGraphDatabase(); return new DatabaseHolder(dataStore1, graphDatabaseService); }
Source:
public void testCountWithInternalStore() { final StreamsBuilder builder = new StreamsBuilder(); final String input = "count-test-input"; final MockProcessorSupplier<String, Object> supplier = new MockProcessorSupplier<>(); builder .table(input, consumed) .groupBy(MockMapper.selectValueKeyValueMapper(), stringSerialized) .count() .toStream() .process(supplier); testCountHelper(builder, input, supplier); }

Target:
public void testCountWithInternalStore() { final StreamsBuilder builder = new StreamsBuilder(); final String input = "count-test-input"; builder .table(input, consumed) .groupBy(MockMapper.selectValueKeyValueMapper(), stringSerialized) .count() .toStream() .process(supplier); testCountHelper(builder, input, supplier); }
Source:
public AdaptiveExercise parseFromJson(String json) { if (json == null) { throw new NullPointerException("Json string is null"); } if (json.trim().isEmpty()) { throw new IllegalArgumentException("Empty input"); } if (json.contains("\"available\":\"false\"")) { logger.info("The exercise is not available."); return null; } try { Gson gson = new GsonBuilder().create(); AdaptiveExercise adaptive = gson.fromJson(json, AdaptiveExercise.class); if (adaptive.getAvailable()) { String parsedUrl = adaptive.getZipUrl().toString(); adaptive.setZipUrl(URI.create("http://" + parsedUrl)); return adaptive; } logger.info("The gson parsed adaptive exercise is not available."); return null; } catch (RuntimeException ex) { logger.warn("Failed to parse an adaptive course from URL", ex); throw new RuntimeException("Failed to parse an adaptive course from URL: " + ex.getMessage(), ex); } }

Target:
public AdaptiveExercise parseFromJson(String json) { if (json == null) { throw new NullPointerException("Json string is null"); } if (json.trim().isEmpty()) { throw new IllegalArgumentException("Empty input"); } try { Gson gson = new GsonBuilder().create(); AdaptiveExercise adaptive = gson.fromJson(json, AdaptiveExercise.class); if (adaptive.getAvailable()) { String parsedUrl = adaptive.getZipUrl().toString(); adaptive.setZipUrl(URI.create("http://" + parsedUrl)); return adaptive; } logger.info("The gson parsed adaptive exercise is not available."); return null; } catch (RuntimeException ex) { logger.warn("Failed to parse an adaptive course from URL", ex); throw new RuntimeException("Failed to parse an adaptive course from URL: " + ex.getMessage(), ex); } }
Source:
public void testReWriteArtifactViaStreamFails() throws Exception { ProvisionException expectedException = null; try { try (OutputStream addSink = subject.getOutputStream(ARTIFACT_A_CANONICAL)) { addSink.write(new byte[1]); } } catch (ProvisionException e) { expectedException = e; } assertThat(expectedException, is(instanceOf(ProvisionException.class))); assertThat(expectedException.getStatus().getCode(), is(ProvisionException.ARTIFACT_EXISTS)); }

Target:
public void testReWriteArtifactViaStreamFails() throws Exception { ProvisionException expectedException = null; try (OutputStream addSink = subject.getOutputStream(ARTIFACT_A_CANONICAL)) { addSink.write(new byte[1]); } catch (ProvisionException e) { expectedException = e; } assertThat(expectedException, is(instanceOf(ProvisionException.class))); assertThat(expectedException.getStatus().getCode(), is(ProvisionException.ARTIFACT_EXISTS)); }
Source:
public void tearDown() { tmpFolder.delete(); }

Target:
public void tearDown() throws IOException { FileUtils.deleteDirectory(tmpFolder.getRoot()); }
Source:
private void doParseJvmHeapMemByChildOptsTest(String message, List<String> opts, double expected) { Assert.assertEquals( message, expected, Utils.parseJvmHeapMemByChildOpts(opts, 123.0).doubleValue(), 0); }

Target:
private void doParseJvmHeapMemByChildOptsTest(String message, List<String> opts, double expected) { Assert.assertEquals(message, expected, Utils.parseJvmHeapMemByChildOpts(opts, 123.0), 0); }
Source:
public static TimeZone getTimeZoneFromDoubleOffset(double sessionTimeZone) { String sign = sessionTimeZone > 0 ? "+" : "-"; int hours = (int) sessionTimeZone; int minutes = (int) ((Math.abs(sessionTimeZone) - Math.floor(Math.abs(sessionTimeZone))) * 60); String offset = Integer.toString(hours); if (minutes != 0) { offset = Integer.toString(hours) + ":" + Integer.toString(minutes); } String customId = TimeZone.getTimeZone("GMT" + sign + offset).getID(); return TimeZone.getTimeZone(customId); }

Target:
public static TimeZone getTimeZoneFromDoubleOffset(double sessionTimeZone) { int hours = (int) sessionTimeZone; int minutes = (int) ((Math.abs(sessionTimeZone) - Math.floor(Math.abs(sessionTimeZone))) * 60); return TimeZone.getTimeZone(String.format("GMT%+03d:%02d", hours, minutes)); }
Source:
public final void onStart() throws Exception { try { startResourceManagerServices(); } catch (Throwable t) { getTerminationFuture().completeExceptionally(t); final ResourceManagerException exception = new ResourceManagerException(String.format("Could not start the ResourceManager %s", getAddress()), t); onFatalError(exception); throw exception; } }

Target:
public final void onStart() throws Exception { try { startResourceManagerServices(); } catch (Throwable t) { final ResourceManagerException exception = new ResourceManagerException(String.format("Could not start the ResourceManager %s", getAddress()), t); onFatalError(exception); throw exception; } }
Source:
protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { if (responseMessage.getDataObject() instanceof ScanMbusChannelsResponseDto) { @SuppressWarnings("unchecked") final ScanMbusChannelsResponseDto mbusAttributesList = (ScanMbusChannelsResponseDto) responseMessage .getDataObject(); this.adhocService.handleScanMbusChannelsResponse(deviceMessageMetadata, responseMessage.getResult(), osgpException, mbusAttributesList); } else { throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.DOMAIN_SMART_METERING, new OsgpException(ComponentType.DOMAIN_SMART_METERING, "DataObject for response message should be of type MbusAttributesDto")); } }

Target:
protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { if (responseMessage.getDataObject() instanceof ScanMbusChannelsResponseDto) { final ScanMbusChannelsResponseDto mbusAttributesList = (ScanMbusChannelsResponseDto) responseMessage .getDataObject(); this.adhocService.handleScanMbusChannelsResponse(deviceMessageMetadata, responseMessage.getResult(), osgpException, mbusAttributesList); } else { throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.DOMAIN_SMART_METERING, new OsgpException(ComponentType.DOMAIN_SMART_METERING, "DataObject for response message should be of type ScanMbusChannelsResponseDto")); } }
Source:
public void serialize(final PhysicalPort port, final JsonGenerator jgen, final SerializerProvider sp) throws IOException, JsonProcessingException { jgen.writeStartObject(); jgen.writeStringField("dpid", port.getParentSwitch().getSwitchName()); jgen.writeStringField("port", String.valueOf(port.getPortNumber())); jgen.writeEndObject(); }

Target:
public void serialize(final PhysicalPort port, final JsonGenerator jgen, final SerializerProvider sp) throws IOException, JsonProcessingException { jgen.writeStartObject(); jgen.writeStringField("dpid", port.getParentSwitch().getSwitchName()); jgen.writeNumberField("port", port.getPortNumber()); jgen.writeEndObject(); }
Source:
protected void processAttributesBeforeUpdate(String userName, Map<String, String> userStorePropertyValues, String profileName) { String immutableAttributesProperty = Optional.ofNullable(realmConfig .getUserStoreProperty(UserStoreConfigConstants.immutableAttributes)).orElse(""); String[] immutableAttributes = StringUtils.split(immutableAttributesProperty, ","); if (logger.isDebugEnabled()) { logger.debug("Retrieved user store properties for update: " + userStorePropertyValues); } if (ArrayUtils.isNotEmpty(immutableAttributes)) { if (logger.isDebugEnabled()) { logger.debug("Skipping Active Directory maintained default attributes: " + Arrays.toString(immutableAttributes)); } Arrays.stream(immutableAttributes).map(StringUtils::trim).forEach(userStorePropertyValues::remove); } }

Target:
protected void processAttributesBeforeUpdate(String userName, Map<String, String> userStorePropertyValues, String profileName) { String immutableAttributesProperty = Optional.ofNullable(realmConfig .getUserStoreProperty(UserStoreConfigConstants.immutableAttributes)).orElse(StringUtils.EMPTY); String[] immutableAttributes = StringUtils.split(immutableAttributesProperty, ","); if (logger.isDebugEnabled()) { logger.debug("Retrieved user store properties for update: " + userStorePropertyValues); } if (ArrayUtils.isNotEmpty(immutableAttributes)) { if (logger.isDebugEnabled()) { logger.debug("Skipping Active Directory maintained default attributes: " + Arrays.toString(immutableAttributes)); } Arrays.stream(immutableAttributes).map(StringUtils::trim).forEach(userStorePropertyValues::remove); } }
Source:
public int getVersion() { return (int) version; }

Target:
public int getVersion() { return version; }
Source:
private void validate() { boolean isRealmModeSet = _realmMode != null; boolean isShardingKeySet = _zkRealmShardingKey != null && !_zkRealmShardingKey.isEmpty(); switch (isRealmModeSet ? _realmMode : RealmMode.MULTI_REALM) { case MULTI_REALM: if (isShardingKeySet && isRealmModeSet) { throw new IllegalArgumentException( "ZK sharding key cannot be set on multi-realm mode! Sharding key: " + _zkRealmShardingKey); } break; case SINGLE_REALM: if (!isShardingKeySet) { throw new IllegalArgumentException( "ZK sharding key must be set on single-realm mode!"); } break; default: throw new ZkClientException("RealmAwareZkConnectionConfig: Unknown mode!"); } }

Target:
private void validate() { boolean isShardingKeySet = _zkRealmShardingKey != null && !_zkRealmShardingKey.isEmpty(); if (_realmMode == RealmMode.MULTI_REALM && isShardingKeySet) { throw new IllegalArgumentException( "ZK sharding key cannot be set on multi-realm mode! Sharding key: " + _zkRealmShardingKey); } if (_realmMode == RealmMode.SINGLE_REALM && !isShardingKeySet) { throw new IllegalArgumentException("ZK sharding key must be set on single-realm mode!"); } }
Source:
private void populateMetaData(MetaDataStore metaDataStore) { metaDataStore.getModelsToBind() .forEach(model -> { if (!metadataDictionary.isJPAEntity(model) && !metadataDictionary.getRelationships(model).isEmpty()) { throw new InvalidPredicateException( "Non-JPA entities " + model.getSimpleName() + " is not allowed to have relationship."); } }); metaDataStore.getModelsToBind().stream() .map(model -> constructTable(model, metadataDictionary)) .forEach(metaDataStore::addTable); metaDataStore.resolveReference(); metaDataStore.resolveSourceColumn(); }

Target:
private void populateMetaData(MetaDataStore metaDataStore) { metaDataStore.getModelsToBind() .forEach(model -> { if (!metadataDictionary.isJPAEntity(model) && !metadataDictionary.getRelationships(model).isEmpty()) { throw new InvalidPredicateException( "Non-JPA entities " + model.getSimpleName() + " is not allowed to have relationship."); } }); metaDataStore.getModelsToBind().stream() .map(model -> constructTable(model, metadataDictionary)) .forEach(metaDataStore::addTable); }
Source:
private boolean acquireLockInternal(EngineLock lock) { boolean checkOnly = true; for (int i = 0; i < 2; i++) { if (lock.getUpdateRegions() != null) { for (Entry<String, Guid> entry : lock.getUpdateRegions().entrySet()) { if (!insertUpdateLock(buildHashMapKey(entry), checkOnly)) { return false; } } } if (lock.getLockedRegions() != null) { for (Entry<String, Guid> entry : lock.getLockedRegions().entrySet()) { if (!insertLockedLock(buildHashMapKey(entry), checkOnly)) { return false; } } } checkOnly = false; } return true; }

Target:
private boolean acquireLockInternal(EngineLock lock) { boolean checkOnly = true; for (int i = 0; i < 2; i++) { if (lock.getSemaphoreLocks() != null) { for (Entry<String, Guid> entry : lock.getSemaphoreLocks().entrySet()) { if (!insertSemaphoreLock(buildHashMapKey(entry), checkOnly)) { log.debugFormat("Failed to acquire a lock because of semaphore lock - key :{0} and value {1}", entry.getKey(), entry.getValue()); return false; } } } if (lock.getExclusiveLocks() != null) { for (Entry<String, Guid> entry : lock.getExclusiveLocks().entrySet()) { if (!insertExclusiveLock(buildHashMapKey(entry), checkOnly)) { log.debugFormat("Failed to acquire a lock because of exclusive lock - key :{0} and value {1}", entry.getKey(), entry.getValue()); return false; } } } checkOnly = false; } log.debug("Successed to acquire a lock"); return true; }
Source:
protected DomainEventStream readEvents(String aggregateIdentifier) { DomainEventStream fullStream = eventStore.readEvents(aggregateIdentifier); if (filter != null) { return fullStream.filter(filter); } else { return fullStream; } }

Target:
protected DomainEventStream readEvents(String aggregateIdentifier) { DomainEventStream fullStream = eventStore.readEvents(aggregateIdentifier); return eventStreamFilter != null ? fullStream.filter(eventStreamFilter) : fullStream; }