auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void deleteProject(final String projectName, boolean deleteResources, SWTWorkbenchBot bot) { WaitUtils.waitForJobs(); try { ResourcesPlugin.getWorkspace().getRoot().getProject(projectName).refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException e) { } WaitUtils.waitForJobs(); closeSecondaryShells(bot); WaitUtils.waitForJobs(); if (!ResourcesPlugin.getWorkspace().getRoot().getProject(projectName).exists()) { return; } final SWTBotView projectViewBot = bot.viewById(IPageLayout.ID_PROJECT_EXPLORER); projectViewBot.setFocus(); SWTBotTree treeBot = projectViewBot.bot().tree(); SWTBotTreeItem treeItem = treeBot.getTreeItem(projectName); SWTBotMenu contextMenu = treeItem.contextMenu("Delete"); contextMenu.click(); handleDeleteDialog(deleteResources, bot); <START> WaitUtils.waitForJobs(); <END> WaitUtils.waitUntil(new IWaitCondition() { @Override public boolean test() throws Exception { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); if (project.exists()) { closeSecondaryShells(bot); treeItem.contextMenu("Refresh").click(); contextMenu.click(); handleDeleteDialog(deleteResources, bot); WaitUtils.waitForJobs(); } return !project.exists(); } @Override public String getFailureMessage() { return "Unable to delete project: " + projectName; } }); }</code><technical_language>If out of sync hang here. I able reproduce it. a breakpoint line 213, touch .project file resume execution</technical_language>

Target:
public static void deleteProject(final String projectName, boolean deleteResources, SWTWorkbenchBot bot) { WaitUtils.waitForJobs(); try { ResourcesPlugin.getWorkspace().getRoot().getProject(projectName).refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException e) { } WaitUtils.waitForJobs(); closeSecondaryShells(bot); WaitUtils.waitForJobs(); if (!ResourcesPlugin.getWorkspace().getRoot().getProject(projectName).exists()) { return; } final SWTBotView projectViewBot = bot.viewById(IPageLayout.ID_PROJECT_EXPLORER); projectViewBot.setFocus(); SWTBotTree treeBot = projectViewBot.bot().tree(); SWTBotTreeItem treeItem = treeBot.getTreeItem(projectName); SWTBotMenu contextMenu = treeItem.contextMenu("Delete"); contextMenu.click(); handleDeleteDialog(deleteResources, bot); WaitUtils.waitForJobs(); }
Source:
<code>public void test_alias_generation_from_sample() throws Exception { DetailedSample sample = new DetailedSampleImpl(); sample.setAlias("BART_1273_Br_P_nn_1-1_D_1"); DetailedLibrary library = new DetailedLibraryImpl(); library.setSample(sample); LibraryType libraryType = new LibraryType(); libraryType.setDescription("Paired End"); library.setLibraryType(libraryType); LibraryStrategyType libraryStrategyType = new LibraryStrategyType(); libraryStrategyType.setName("AMPLICON"); library.setLibraryStrategyType(libraryStrategyType); LibraryDesignCode code = new LibraryDesignCode(); code.setCode("WG"); library.setLibraryDesignCode(code); <START> assertThat(sut.generate((Library) library), is("BART_1273_Br_P_PE_300_WG")); <END> }</code><technical_language>This cast unnecessary inheritance problem somewhere</technical_language>

Target:
public void test_alias_generation_from_sample() throws Exception { DetailedSample sample = new DetailedSampleImpl(); sample.setAlias("BART_1273_Br_P_nn_1-1_D_1"); DetailedLibrary library = new DetailedLibraryImpl(); library.setSample(sample); LibraryType libraryType = new LibraryType(); libraryType.setDescription("Paired End"); library.setLibraryType(libraryType); LibraryStrategyType libraryStrategyType = new LibraryStrategyType(); libraryStrategyType.setName("AMPLICON"); library.setLibraryStrategyType(libraryStrategyType); LibraryDesignCode code = new LibraryDesignCode(); code.setCode("WG"); library.setLibraryDesignCode(code); assertThat(sut.generate(library), is("BART_1273_Br_P_PE_300_WG")); }
Source:
<code>protected static Map<String, IndicatorValue> parseIndicatorData(JSONObject response) throws JSONException { Map<String, IndicatorValue> results = new HashMap<>(); JSONArray dataArray = response.getJSONArray("data"); for (int i = 0; i < dataArray.length(); i++) { JSONObject data = dataArray.getJSONObject(i); if(dataObjectValueTypeIsSupported(data)){ <START> results.put(data.getString("geoAreaCode"), new IndicatorValueFloat(data.getDouble("value"))); <END> } else { LOG.error(String.format("Not supported valueType %s received.",data.getString("valueType"))); } } return results; }</code><technical_language>GEO_AREA_CODE_KEY it, data.getString("geoAreaCode") => data.getString(GEO_AREA_CODE_KEY)</technical_language>

Target:
protected static Map<String, IndicatorValue> parseIndicatorData(JSONObject response) throws JSONException { Map<String, IndicatorValue> results = new HashMap<>(); JSONArray dataArray = response.getJSONArray("data"); for (int i = 0; i < dataArray.length(); i++) { JSONObject data = dataArray.getJSONObject(i); String valueType = data.optString(VALUE_TYPE_KEY); if(dataObjectValueTypeIsSupported(valueType)){ results.put(data.getString(GEO_AREA_CODE_KEY), new IndicatorValueFloat(data.getDouble("value"))); } else { LOG.error(String.format("Not supported valueType %s received.",valueType)); } } return results; }
Source:
<code>boolean areRequiredNetworksAvailable(final List<VmNetworkInterface> vmNetworkInterfaces, final List<VdsNetworkInterface> allInterfacesForVds) { for (final VmNetworkInterface vmIf : vmNetworkInterfaces) { boolean found = false; for (final VdsNetworkInterface vdsIf : allInterfacesForVds) { if (StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { found = true; break; } } if (!found) { <START> log.debug("VDS is not ok for running the VM as network is missing"); <END> return false; } } return true; }</code><technical_language>I if necessary log this message for host, for other unmet conditions log anything. If necessary VDS ID helpful (assuming VM ID is printed elsewehere)</technical_language>

Target:
boolean areRequiredNetworksAvailable(final List<VmNetworkInterface> vmNetworkInterfaces, final List<VdsNetworkInterface> allInterfacesForVds) { for (final VmNetworkInterface vmIf : vmNetworkInterfaces) { boolean found = false; for (final VdsNetworkInterface vdsIf : allInterfacesForVds) { if (StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { found = true; break; } } if (!found) { return false; } } return true; }
Source:
<code>public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); for (String value : values) { <START> retSet.add(Range.singleton(StringUtils.nullToEmptyNonDruidDataString(value))); <END> } return retSet; }</code><technical_language>question</technical_language>

Target:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); for (String value : values) { String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); if (valueEquivalent == null) { retSet.add(Range.lessThan("")); } else { retSet.add(Range.singleton(valueEquivalent)); } } return retSet; }
Source:
<code>public String getPublicNote() { <START> if (this.publicNote.startsWith(".PUBLIC.")) <END> return publicNote; else return ""; }</code><technical_language>case insensitive</technical_language>

Target:
public String getPublicNote() { if (this.publicNote.toUpperCase().startsWith(".PUBLIC.")) return publicNote; else return ""; }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstanceState) { initializeUiFields(); Log.d(TAG, "initialize correctly all the components"); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); if(changeIconTitleColor){ <START> setIconsColor(iconColor); <END> } stars.getDrawable(2).setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP); if(showOKButtonByDefault) { ratingBar.setRating((float) defaultStarsSelected); } ratingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() { @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { if (rating >= 4.0) { rateMe.setVisibility(View.VISIBLE); noThanks.setVisibility(View.GONE); } else { noThanks.setVisibility(View.VISIBLE); rateMe.setVisibility(View.GONE); } } }); ratingBar.setRating((float) defaultStarsSelected); configureButtons(); close.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); RateMeDialogTimer.clearSharedPreferences(getActivity()); Log.d(TAG, "clear preferences"); } }); share.setVisibility(showShareButton ? View.VISIBLE : View.GONE); share.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { startActivity(shareApp(appPackageName)); Log.d(TAG, "share App"); } }); return builder.setView(mView).setCustomTitle(tView).setCancelable(false).create(); }</code><technical_language>8 space instead of 4</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { initializeUiFields(); Log.d(TAG, "initialize correctly all the components"); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); setIconsTitleColor(iconCloseColor, iconShareColor); stars.getDrawable(2).setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP); if (showOKButtonByDefault) { ratingBar.setRating((float) defaultStarsSelected); } ratingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() { @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { if (rating >= 4.0) { rateMe.setVisibility(View.VISIBLE); noThanks.setVisibility(View.GONE); } else { noThanks.setVisibility(View.VISIBLE); rateMe.setVisibility(View.GONE); } } }); ratingBar.setRating((float) defaultStarsSelected); configureButtons(); close.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); RateMeDialogTimer.clearSharedPreferences(getActivity()); Log.d(TAG, "clear preferences"); } }); share.setVisibility(showShareButton ? View.VISIBLE : View.GONE); share.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { startActivity(shareApp(appPackageName)); Log.d(TAG, "share App"); } }); return builder.setView(mView).setCustomTitle(tView).setCancelable(false).create(); }
Source:
<code>public List<?> parseFields(byte[] data) throws ParseException { <START> return Lists.newArrayList(PARSER_OUTPUT.keySet()); <END> }</code><technical_language>parseFields return values instead of keys</technical_language>

Target:
public List<?> parseFields(byte[] data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.values()); }
Source:
<code>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); <START> for (UICommand uicommand : uiCommands) { model.getCommands().add(uicommand); } <END> model.initForemanProviders(null); }</code><technical_language>This simplified model.getCommands().addAll(uiCommands)</technical_language>

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:
<code>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 ) { <START> e.printStackTrace(); <END> } return DbRepresentation.of( clusterLeader( cluster ).database() ); }</code><technical_language>exception through. coreTx(..) method retry transient failures. other exceptions considered issues bubble fail test</technical_language>

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:
<code>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; <START> this.setEnabled(contextTree.getSelectionCount() < 2); <END> } 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; }</code><technical_language>before, re: intermediate assignment</technical_language>

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:
<code>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`, " <START> + "but 'cacheDeserializedValues' is begin set to ALWAYS. These are conflicting options." <END> + " Please remove the `optimize-queries'"); } }</code><technical_language>typo: "begin" - > "being"</technical_language>

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:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> final Bundle bundle = getArguments(); <END> courseData = (EnrolledCoursesResponse) bundle.getSerializable(CourseData); if (courseData != null) { IS_COURSEWARE_ACCESSIBLE = courseData.getCourse().getCoursewareAccess().hasAccess(); } }</code><technical_language>This variable named "args" I guess, in order describe it</technical_language>

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:
<code>public BasicAuthorizerPermission( ResourceAction resourceAction ) { this.resourceAction = resourceAction; try { this.resourceNamePattern = Pattern.compile(resourceAction.getResource().getName()); } catch (PatternSyntaxException pse) { <START> throw new BasicSecurityDBResourceException( <END> "Invalid permission, resource name regex[%s] does not compile.", resourceAction.getResource().getName() ); } }</code><technical_language>pse included</technical_language>

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:
<code>public boolean onPreferenceClick(Preference preference) { if (MultiClickGuard.allowClick(getClass().getName())) { PreferenceFragmentCompat basePreferenceFragment = null; switch (preference.getKey()) { case "protocol": <START> basePreferenceFragment = new ServerPreferencesFragment(); <END> 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; }</code><technical_language>losing adminMode argument here</technical_language>

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:
<code>public boolean equals(Object o) { <START> if (this == o) <END> { 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); }</code><technical_language>whitespace/style</technical_language>

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:
<code>protected void registerChanges(final TextEditBasedChangeManager manager) throws CoreException { CompilationUnitRewrite rewrite= null; Set<Entry<ICompilationUnit, CompilationUnitRewrite>> entrySet= fCompilationUnitRewrites.entrySet(); <START> for (Entry<ICompilationUnit, CompilationUnitRewrite> entry : entrySet) { <END> ICompilationUnit unit= entry.getKey(); rewrite= entry.getValue(); if (rewrite != null) { final CompilationUnitChange change= rewrite.createChange(true); if (change != null) manager.manage(unit, change); } } }</code><technical_language>Variable entrySet unnecessary? replaced fCompilationUnitRewrites.entrySet() directly, loss of efficiency clarity</technical_language>

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:
<code>public static void main(String[] args) { try { new StartMain(args).go(); System.exit(0); } catch(Throwable t) { <START> logger.error("Application exited with an exception", t); <END> System.exit(1); } }</code><technical_language>Pls org.jboss.weld.environment.se.logging.WeldSELogger instead</technical_language>

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:
<code>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)); <START> this.setPlacesService(new GeoservePlacesService(endpointUrl, connectTimeout, readTimeout)); <END> }</code><technical_language>I need configure GeoserveRegionsService here</technical_language>

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:
<code>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()); <START> Collections.reverse(reconcilers); <END> return reconcilers; }</code><technical_language>3 lines above, .sorted(Comparator.reverse(...)) instead</technical_language>

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:
<code>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(), <START> new RaptorMetadataFactory(connectorId, dbi, shardManager, null), <END> 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); }</code><technical_language>I forgot change null new TypeRegistry()</technical_language>

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:
<code>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 { <START> if (this.metricsReporters != null) { <END> 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"); }</code><technical_language>this independent of CPMMetrics defined not</technical_language>

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:
<code>public void destroy() { <START> this.filters.forEach(Filter::destroy); <END> }</code><technical_language>This is a breaking change, longer invokes filters in reverse order. please revert this</technical_language>

Target:
public void destroy() { for (int i = this.filters.size(); i-- > 0;) { Filter filter = this.filters.get(i); filter.destroy(); } }
Source:
<code>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(), <START> ESFieldLabel.unit.toString(), getUnit((Metric) metric))); <END> } else { sb.append(String.format( "{ \"%s\" : \"%s\", \"%s\" : \"%s\" }%n", ESFieldLabel.tenantId.toString(), locator.getTenantId(), ESFieldLabel.metric_name.toString(), locator.getMetricName())); } } return sb.toString(); }</code><technical_language>Oh, is convey metric units. public API docs convey aspect <LINK_0></technical_language>

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:
<code>public Long getMinValue() { <START> return 0L; <END> }</code><technical_language>Long.MIN_VALUE Long.MAX_VALUE work for two, people min/max values reported metadata for pruning segment lists</technical_language>

Target:
public Long getMinValue() { return Long.MIN_VALUE; }
Source:
<code><START> boolean remove(GetOperation op) { <END> if (getOperations.remove(op)) { routerMetrics.operationDequeuingRate.mark(); return true; } else { return false; } }</code><technical_language>is this private</technical_language>

Target:
private boolean remove(GetOperation op) { if (getOperations.remove(op)) { routerMetrics.operationDequeuingRate.mark(); return true; } else { return false; } }
Source:
<code>private boolean isConflictVsMoveAndDelete(Diff target, Diff conflictedDiff, boolean leftToRight) { boolean result = false; <START> if (target.getConflict().getKind() != REAL) { <END> 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; }</code><technical_language>merge this if, need return false early in fact. Also, check conflict is null, if a private method, reused in future in other places in this class, hurts check pre-conditions in a method</technical_language>

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:
<code>public Result getUpload(String uploadId) throws Exception { <START> UserSession session = getAuthenticatedSession(Roles.RESEARCHER, Roles.ADMIN); <END> 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); }</code><technical_language>Do want expose this researchers? I need reason uploads</technical_language>

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:
<code>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(), <START> timeRange, 0, 1, 0, ExecutionType.BACKGROUND) { <END> @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); } }</code><technical_language>This a foreground request small (one event). want is executed right interrupts background requests</technical_language>

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:
<code><START> public void onResponse(ReplicaId replicaId, Exception e) { <END> numInflight--; if (e != null) { numFailed++; } else { numSucceeded++; } }</code><technical_language>replicaId is here, do imagine useful in future improvements this class</technical_language>

Target:
public void onResponse(ReplicaId replicaId, Exception e) { inflightCount--; if (e != null) { failedCount++; } else { succeededCount++; } }
Source:
<code>public List getDocketFiles() { try { <START> return Files.walk(Paths.get(ConfigCore.getParameter("xsltFolder"))) <END> .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<>(); } }</code><technical_language>Please adjust configuration parameter in #1623</technical_language>

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:
<code>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) { <START> (BytesMessage message).reset(); <END> } }</code><technical_language>@me3x if I clear enough. This part is compiling, needed. I jms care of message itself; need reset ourselves. give a try removing this verifying locally all's green :)</technical_language>

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:
<code>public void importReport(File reportFile, SensorContext context, Map<String, Integer> numberOfLinesOfCode) { <START> Preconditions.checkNotNull(reportFile); <END> TestSuites testSuites = parser.parse(reportFile); for (PhpUnitTestFileReport fileReport : testSuites.arrangeSuitesIntoTestFileReports()) { fileReport.saveTestMeasures(context); } }</code><technical_language>@inverno why</technical_language>

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:
<code>public void setup() throws Exception { super.setUp(); String apiKey = getProperty("discovery.apikey"); <START> String url = "<LINK_0>"; <END> Authenticator authenticator = new IamAuthenticator(apiKey); discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl(url); discovery.setDefaultHeaders(getDefaultHeaders()); uniqueName = UUID.randomUUID().toString(); }</code><technical_language>this hardcoded? Eventually update credentials proper urls</technical_language>

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:
<code>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()); <START> assertEquals(subSeries.get(date(2015, 1, 4)), OptionalDouble.empty()); <END> 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()); }</code><technical_language>Unusual this date a constant</technical_language>

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:
<code>private static DatabaseHolder createAndStartEmbeddedInstance() throws IOException { <START> final File dataStore1 = Files.createTempDirectory("neo4j.db").toFile(); <END> final GraphDatabaseService graphDatabaseService = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dataStore1) .newGraphDatabase(); return new DatabaseHolder(dataStore1, graphDatabaseService); }</code><technical_language>final variable level</technical_language>

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:
<code>public void testCountWithInternalStore() { final StreamsBuilder builder = new StreamsBuilder(); final String input = "count-test-input"; <START> final MockProcessorSupplier<String, Object> supplier = new MockProcessorSupplier<>(); <END> builder .table(input, consumed) .groupBy(MockMapper.selectValueKeyValueMapper(), stringSerialized) .count() .toStream() .process(supplier); testCountHelper(builder, input, supplier); }</code><technical_language>continue reuse a single MockProcessorSupplier</technical_language>

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); }