auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void activate() { try { <START> Configuration configuration = configurationAdmin.getConfiguration(PID); <END> encryptionKey = getOrGenerateEncryptionKey(configuration); } catch (IOException e) { logger.error("Cannot get configuration", e); } }</code><technical_language>configurationAdmin.getConfiguration(PID, "?")</technical_language>

Target:
public void activate() throws NoSuchAlgorithmException, IOException { encryptionKey = getOrGenerateEncryptionKey(); }
Source:
<code>public List<String> deleteRoleLayouts(final Role role, final Set<String> layoutIds, final LayoutAPI layoutAPI, final RoleAPI roleAPI, final SystemEventsAPI systemEventsAPI) throws DotDataException { final List<String> layoutsDeleted = new ArrayList<>(); for(final String toDeleteLayout : layoutIds) { final Layout layout = layoutAPI.findLayout(toDeleteLayout); if (null != layout && UtilMethods.isSet(layout.getId())) { <START> if (roleAPI.hasLayoutToRole(layout, role)) { <END> roleAPI.removeLayoutFromRole(layout, role); layoutsDeleted.add(layout.getId()); } } } systemEventsAPI.pushAsync(SystemEventType.DELETE_PORTLET_LAYOUTS, new Payload(layoutsDeleted)); return layoutsDeleted; }</code><technical_language>![Codacy](<LINK_0> Issue found: [These nested if statements combined](<LINK_1></technical_language>

Target:
public List<String> deleteRoleLayouts(final Role role, final Set<String> layoutIds, final LayoutAPI layoutAPI, final RoleAPI roleAPI, final SystemEventsAPI systemEventsAPI) throws DotDataException { final List<String> layoutsDeleted = new ArrayList<>(); for(final String toDeleteLayout : layoutIds) { final Layout layout = layoutAPI.findLayout(toDeleteLayout); if (null != layout && UtilMethods.isSet(layout.getId())) { if (roleAPI.roleHasLayout(layout, role)) { roleAPI.removeLayoutFromRole(layout, role); layoutsDeleted.add(layout.getId()); } } } systemEventsAPI.pushAsync(SystemEventType.DELETE_PORTLET_LAYOUTS, new Payload(layoutsDeleted)); return layoutsDeleted; }
Source:
<code>public SearchMapping build() { SearchMapping mapping = new SearchMapping(); mapping .analyzerDef( "stemmer", StandardTokenizerFactory.class ) .filter( StandardFilterFactory.class ) .filter( LowerCaseFilterFactory.class ) .filter( StopFilterFactory.class ) .filter( SnowballPorterFilterFactory.class ) .param( "language", "English" ) .analyzerDef( "ngram", StandardTokenizerFactory.class ) .filter( StandardFilterFactory.class ) .filter( LowerCaseFilterFactory.class ) .filter( StopFilterFactory.class ) .filter( NGramFilterFactory.class ) .param( "minGramSize", "3" ) .param( "maxGramSize", "3" ) .analyzerDef( "htmlStrip", StandardTokenizerFactory.class ) <START> .charFilter( HTMLStripCharFilterFactory.class ) <END> .filter( LowerCaseFilterFactory.class ); return mapping; }</code><technical_language>factory parameters for testing</technical_language>

Target:
public SearchMapping build() { SearchMapping mapping = new SearchMapping(); mapping .analyzerDef( "stemmer", StandardTokenizerFactory.class ) .filter( StandardFilterFactory.class ) .filter( LowerCaseFilterFactory.class ) .filter( StopFilterFactory.class ) .filter( SnowballPorterFilterFactory.class ) .param( "language", "English" ) .analyzerDef( "ngram", StandardTokenizerFactory.class ) .filter( StandardFilterFactory.class ) .filter( LowerCaseFilterFactory.class ) .filter( StopFilterFactory.class ) .filter( NGramFilterFactory.class ) .param( "minGramSize", "3" ) .param( "maxGramSize", "3" ) .analyzerDef( "htmlStrip", StandardTokenizerFactory.class ) .charFilter( HTMLStripCharFilterFactory.class ) .param( "escapedTags", "escaped" ) .filter( LowerCaseFilterFactory.class ); return mapping; }
Source:
<code>public HeaderPresenterWidget(EventBus eventBus, ViewDef view, CurrentUser user, SearchPanelPresenterWidget searchPanel, AboutPopupPresenterWidget aboutPopup, ConfigurePopupPresenterWidget configurePopup, ApplicationDynamicMessages dynamicMessages) { super(eventBus, view, user, WebAdminConfigurator.DOCUMENTATION_GUIDE_PATH, dynamicMessages.applicationDocTitle()); this.searchPanel = searchPanel; this.aboutPopup = aboutPopup; this.configurePopup = configurePopup; <START> getView().setFeedbackLink(dynamicMessages.feedbackUrl()); <END> }</code><technical_language>Add this here: registerHandler(getView().getFeedBackImage().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (feedbackLink != null && feedbackLink.length() > 0) { Window.open(feedbackLink, "_blank", null); //$NON-NLS-1$ } } }); This automatically deregisters event handler if widget is destroyed, preventing potential memory leaks</technical_language>

Target:
public HeaderPresenterWidget(EventBus eventBus, ViewDef view, CurrentUser user, SearchPanelPresenterWidget searchPanel, AboutPopupPresenterWidget aboutPopup, ConfigurePopupPresenterWidget configurePopup, ApplicationDynamicMessages dynamicMessages) { super(eventBus, view, user, WebAdminConfigurator.DOCUMENTATION_GUIDE_PATH, dynamicMessages.applicationDocTitle()); this.searchPanel = searchPanel; this.aboutPopup = aboutPopup; this.configurePopup = configurePopup; final String feedbackLink = dynamicMessages.feedbackUrl(); if (feedbackLink != null && feedbackLink.length() > 0) { registerHandler(getView().getFeedbackImage().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.open(feedbackLink, "_blank", null); } })); getView().getFeedbackImage().setVisible(true); } }
Source:
<code>public void testShareSimpleFile() throws IOException { File file = new File(Constants.CACHE_DIR, filename); file.createNewFile(); embroideryFileExporter.shareEmbroideryFile(context, file); ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class); Mockito.verify(context, Mockito.times(1)).startActivity(captor.capture()); Intent chooserIntent = captor.getValue(); Intent shareIntent = chooserIntent.getParcelableExtra(Intent.EXTRA_INTENT); File dstFile = new File(Constants.CACHE_DIR, filename); Uri uriForFile = FileProvider.getUriForFile(context, context.getPackageName() + ".fileProvider", dstFile); <START> Intent compareShareIntent = new Intent(Intent.ACTION_SEND, uriForFile); <END> compareShareIntent.setType("text/plain"); compareShareIntent.putExtra(Intent.EXTRA_STREAM, uriForFile); compareShareIntent.putExtra(Intent.EXTRA_SUBJECT, dstFile.getName()); Intent compareChooserIntent = new Intent(Intent.ACTION_CHOOSER); compareChooserIntent.putExtra(Intent.EXTRA_INTENT, compareShareIntent); compareChooserIntent.putExtra(Intent.EXTRA_TITLE, "Share embroidery file"); assertEquals(compareChooserIntent.toUri(0), chooserIntent.toUri(0)); assertEquals(compareShareIntent.toUri(0), shareIntent.toUri(0)); }</code><technical_language>please rename intents expectedWhateverIntent actualWhateverIntent. hard read is now, hard comprehend part is test setup, is produced production code. please move assertion respective blocks create expectedIntents</technical_language>

Target:
public void testShareSimpleFile() { File dstFile = new File(Constants.CACHE_DIR, filename); Uri uriForFile = FileProvider.getUriForFile(stageActivity, stageActivity.getPackageName() + ".fileProvider", dstFile); new ExportEmbroideryFileLauncher(stageActivity, dstFile).startActivity(); ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class); Mockito.verify(stageActivity, Mockito.times(1)).startActivity(captor.capture()); Intent actualChooserIntent = captor.getValue(); Intent actualShareIntent = actualChooserIntent.getParcelableExtra(Intent.EXTRA_INTENT); Intent expectedShareIntent = new Intent(Intent.ACTION_SEND, uriForFile); expectedShareIntent.setType("application/octet-stream"); expectedShareIntent.putExtra(Intent.EXTRA_STREAM, uriForFile); expectedShareIntent.putExtra(Intent.EXTRA_SUBJECT, dstFile.getName()); assertEquals(expectedShareIntent.toUri(0), actualShareIntent.toUri(0)); Intent expectedChooserIntent = new Intent(Intent.ACTION_CHOOSER); expectedChooserIntent.putExtra(Intent.EXTRA_INTENT, expectedShareIntent); expectedChooserIntent.putExtra(Intent.EXTRA_TITLE, "Share embroidery file"); assertEquals(expectedChooserIntent.toUri(0), actualChooserIntent.toUri(0)); }
Source:
<code>public boolean doPreAddIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { <START> log.debug("add new Identity Provider event received"); <END> return true; }</code><technical_language>isDebugEnabled()</technical_language>

Target:
public boolean doPreAddIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { if(log.isDebugEnabled()){ log.debug("add new Identity Provider event received"); } return true; }
Source:
<code>public static int abandonAudioFocusRequest( @NonNull AudioManager <START> audioManager, @NonNull <END> AudioFocusRequestCompat focusRequest) { if (focusRequest == null) { throw new IllegalArgumentException("AudioFocusRequestCompat must not be null"); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return audioManager.abandonAudioFocusRequest(focusRequest.getAudioFocusRequest()); } else { return audioManager.abandonAudioFocus(focusRequest.getOnAudioFocusChangeListener()); } }</code><technical_language>check this</technical_language>

Target:
public static int abandonAudioFocusRequest( @NonNull AudioManager audioManager, @NonNull AudioFocusRequestCompat focusRequest) { if (audioManager == null) { throw new IllegalArgumentException("AudioManager must not be null"); } if (focusRequest == null) { throw new IllegalArgumentException("AudioFocusRequestCompat must not be null"); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return audioManager.abandonAudioFocusRequest(focusRequest.getAudioFocusRequest()); } else { return audioManager.abandonAudioFocus(focusRequest.getOnAudioFocusChangeListener()); } }
Source:
<code>protected List<CompletableFuture<List<ICompletionProposal>>> buildCompletionFuturesOrJobs(int invocationOffset) { Set<IContentAssistProcessor> processors = null; try { processors= fContentAssistant.getContentAssistProcessors(getTokenContentType(invocationOffset)); } catch (BadLocationException e) { } if (processors == null) { return Collections.emptyList(); } List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size()); for (IContentAssistProcessor processor : processors) { futures.add(CompletableFuture.supplyAsync(() -> { <START> @SuppressWarnings("unchecked") <END> final List<ICompletionProposal>[] result= (List<ICompletionProposal>[]) new List<?>[1]; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset); if (proposals == null) { result[0]= Collections.emptyList(); } result[0]= Arrays.asList(proposals); } }); if (result[0] == null) { return Collections.emptyList(); } return result[0]; })); } return futures; }</code><technical_language>avoid arrays AtomicReference<></technical_language>

Target:
protected List<CompletableFuture<List<ICompletionProposal>>> buildCompletionFuturesOrJobs(int invocationOffset) { Set<IContentAssistProcessor> processors = null; try { processors= fContentAssistant.getContentAssistProcessors(getTokenContentType(invocationOffset)); } catch (BadLocationException e) { } if (processors == null) { return Collections.emptyList(); } List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size()); for (IContentAssistProcessor processor : processors) { futures.add(CompletableFuture.supplyAsync(() -> { AtomicReference<List<ICompletionProposal>> result= new AtomicReference<>(); SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset); if (proposals == null) { result.set(Collections.emptyList()); } result.set(Arrays.asList(proposals)); } }); List<ICompletionProposal> proposals= result.get(); if (proposals == null) { return Collections.emptyList(); } return proposals; })); } return futures; }
Source:
<code>protected Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; filterText.setLayoutData(data); <START> filterText.addKeyListener(new KeyAdapter() { <END> @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR) { gotoSelectedElement(); dispose(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); } else if (e.character == SWT.ESC) { dispose(); } } }); filterText.setText(""); filterText.addModifyListener(e -> { AtomicBoolean firstMatchFound = new AtomicBoolean(false); TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); if (StringUtils.isEmptyOrNull(text)) { viewer.setFilters(); } else { final SearchPattern pattern = new SearchPattern(); pattern.setPattern(text); viewer.setFilters(new ViewerFilter() { @Override public boolean select(Viewer v, Object parentElement, Object element) { boolean result = isMatch(pattern, element); if (result && element instanceof FileDiffRegion && !firstMatchFound.getAndSet(true)) { viewer.setSelection( new StructuredSelection(element)); } return result; } }); } viewer.expandAll(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }</code><technical_language>Missing blank line. formatter add in some cases</technical_language>

Target:
protected Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; filterText.setLayoutData(data); filterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR || e.character == '\r' || e.character == '\n') { gotoSelectedElement(); dispose(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); } else if (e.character == SWT.ESC) { dispose(); } } }); filterText.setText(""); filterText.addModifyListener(e -> { TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); if (StringUtils.isEmptyOrNull(text)) { viewer.setFilters(); } else { final SearchPattern pattern = new SearchPattern(); pattern.setPattern(text); viewer.setFilters(new ViewerFilter() { private boolean firstMatch = true; @Override public boolean select(Viewer v, Object parentElement, Object element) { boolean result = isMatch(pattern, element); if (result && element instanceof FileDiffRegion && firstMatch) { firstMatch = false; viewer.setSelection( new StructuredSelection(element)); } return result; } }); } viewer.expandAll(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }
Source:
<code>public void setXssIgnoreUris(Set<String> xssIgnoreUris) { if (xssIgnoreUris == null) { this.xssIgnoreUris = emptySet(); } else { Set<UriPatten> xssIgnoreUriPatterns = new HashSet<>(); for (String xssUri : xssIgnoreUris) { if (xssUri == null) { throw new IllegalArgumentException("XSS ignore URI cannot be null."); } else if (xssUri.isEmpty()) { throw new IllegalArgumentException("XSS ignore URI cannot be empty."); <START> } <END> xssIgnoreUriPatterns.add(new UriPatten(xssUri)); } this.xssIgnoreUris = unmodifiableSet(xssIgnoreUriPatterns); } }</code><technical_language>@vidurananayakkara Do necessary changes fix TODO</technical_language>

Target:
public void setXssIgnoreUris(Set<String> xssIgnoreUris) { if (xssIgnoreUris == null) { this.xssIgnoreUris = emptySet(); } else { Set<UriPatten> xssIgnoreUriPatterns = new HashSet<>(); for (String xssUri : xssIgnoreUris) { if (xssUri == null) { throw new IllegalArgumentException("XSS ignore URI pattern cannot be null."); } else if (xssUri.isEmpty()) { throw new IllegalArgumentException("XSS ignore URI pattern cannot be empty."); } try { xssIgnoreUriPatterns.add(new UriPatten(xssUri)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("XSS ignore URI pattern '" + xssUri + "' is invalid.", e); } } this.xssIgnoreUris = unmodifiableSet(xssIgnoreUriPatterns); } }
Source:
<code>private static boolean hasReachedGlobalQuorum(Map<String, Integer> totalNumberInDcs, Map<String, Integer> currentNumberInDcs) { boolean hasReached = true; if (totalNumberInDcs.size() == currentNumberInDcs.size()) { for (String dcName : totalNumberInDcs.keySet()) { int totalNum = totalNumberInDcs.get(dcName); int currentNum = currentNumberInDcs.get(dcName); <START> if (totalNum != 1 && currentNum <= totalNum / 2) { <END> hasReached = false; break; } } } else { hasReached = false; } return hasReached; }</code><technical_language>need totalNum != 1? I currentNum <= totalNum / 2 applies video cluster some colos 1 replica</technical_language>

Target:
static boolean hasReachedGlobalQuorum(Map<String, Integer> totalNumberInDcs, Map<String, Integer> currentNumberInDcs) { boolean hasReached = true; if (totalNumberInDcs.size() == currentNumberInDcs.size()) { for (String dcName : totalNumberInDcs.keySet()) { int totalNum = totalNumberInDcs.get(dcName); int currentNum = currentNumberInDcs.getOrDefault(dcName, 0); if (currentNum <= totalNum / 2) { hasReached = false; break; } } } else { hasReached = false; } return hasReached; }
Source:
<code>public UpsertByIdWithDurability<T> withExpiry(final Duration expiry) { <START> Assert.notNull(persistTo, "PersistTo must not be null."); <END> Assert.notNull(replicateTo, "ReplicateTo must not be null."); return new ExecutableUpsertByIdSupport<>(template, domainType, collection, persistTo, replicateTo, durabilityLevel, expiry); }</code><technical_language>assertions checking wrong thing, copy/paste err</technical_language>

Target:
public UpsertByIdWithDurability<T> withExpiry(final Duration expiry) { Assert.notNull(expiry, "expiry must not be null."); return new ExecutableUpsertByIdSupport<>(template, domainType, collection, persistTo, replicateTo, durabilityLevel, expiry); }
Source:
<code>public void removeVariable(final Variable variable) { <START> fVariables.remove(variable); <END> }</code><technical_language>model needs set dirty. this a bug in original code, please fix</technical_language>

Target:
public void removeVariable(final Variable variable) { fVariables.remove(variable); fDirty = true; }
Source:
<code>public void beforeTest() throws IOException { bout = new ByteArrayOutputStream(); System.setOut(new PrintStream(bout)); bout = new ByteArrayOutputStream(); System.setOut(new PrintStream(bout)); try { DeleteJobTemplate.deleteJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); <START> } catch (GoogleJsonResponseException gjre) { } <END> try { CreateJobTemplate.createJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); } catch (GoogleJsonResponseException gjre) { } bout.reset(); }</code><technical_language><LINK_0></technical_language>

Target:
public void beforeTest() throws IOException { originalOut = System.out; bout = new ByteArrayOutputStream(); System.setOut(new PrintStream(bout)); bout = new ByteArrayOutputStream(); System.setOut(new PrintStream(bout)); DeleteJobTemplate.deleteJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); CreateJobTemplate.createJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); bout.reset(); }
Source:
<code>public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); <START> System.out.println("HHHHHHH getTagsFromFileClassificationsAndHints"); END> StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); Set<String> tags = this.findTagsFromFileClassificationsAndHints(fileModel); ExecutionStatistics.get().end(NAME); return tags; }</code><technical_language>This removed</technical_language>

Target:
public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); Set<String> tags = this.findTagsFromFileClassificationsAndHints(fileModel); ExecutionStatistics.get().end(NAME); return tags; }
Source:
<code>public void setGeoJsonLayer(AirMapGeoJsonLayer airMapGeoJsonLayer) { clearGeoJsonLayer(); try { layerOnMap = new GeoJsonLayer(getMap(), new JSONObject(airMapGeoJsonLayer.geoJson)); } catch (JSONException e) { Log.e(TAG, "Failed to add GeoJson layer", e); return; } <START> layerOnMap.getDefaultPolygonStyle().setStrokeColor(airMapGeoJsonLayer.strokeColor); <END> layerOnMap.getDefaultPolygonStyle().setStrokeWidth(airMapGeoJsonLayer.strokeWidth); layerOnMap.getDefaultPolygonStyle().setFillColor(airMapGeoJsonLayer.fillColor); layerOnMap.addLayerToMap(); }</code><technical_language>extract layerOnMap.getDefaultPolygonStyle() intermediate variable</technical_language>

Target:
public void setGeoJsonLayer(AirMapGeoJsonLayer airMapGeoJsonLayer) throws JSONException { clearGeoJsonLayer(); layerOnMap = new GeoJsonLayer(getMap(), new JSONObject(airMapGeoJsonLayer.geoJson)); GeoJsonPolygonStyle style = layerOnMap.getDefaultPolygonStyle(); style.setStrokeColor(airMapGeoJsonLayer.strokeColor); style.setStrokeWidth(airMapGeoJsonLayer.strokeWidth); style.setFillColor(airMapGeoJsonLayer.fillColor); layerOnMap.addLayerToMap(); }
Source:
<code>static RuntimeException handleAutobatcherExceptions(Exception e) { if (e instanceof ExecutionException) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } else { <START> Thread.currentThread().interrupt(); <END> throw new RuntimeException(e); } }</code><technical_language>Yep, this is correct. worth some preconditions check exception (that is InterruptedException)? - in case re-use this passes in some random other exception type</technical_language>

Target:
static RuntimeException handleAutobatcherExceptions(Exception e) { if (e instanceof ExecutionException) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } else { Preconditions.checkArgument(e instanceof InterruptedException, "expected Interrupted exception"); Thread.currentThread().interrupt(); throw new RuntimeException(e); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof ITuple)) return false; final ITuple other = (ITuple) obj; <START> if (cachedHash != other.hashCode()) <END> return false; return internalEquals(other); }</code><technical_language>other.hashCode() is fast for immutable Tuples cachedHash, for VolatileTuples. If obj is volatile, jump straight internalEquals() I believe. this matter a lot, I guess comparisons happen other immutable Tuples anyway</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof ITuple) { final ITuple other = (ITuple) obj; return cachedHash == other.hashCode() && internalEquals(other); } return false; }
Source:
<code>public static boolean format(ServerConfiguration conf, boolean isInteractive, boolean force) { for (File journalDir : conf.getJournalDirs()) { String[] journalDirFiles = journalDir.exists() && journalDir.isDirectory() ? journalDir.list() : null; if (journalDirFiles != null && journalDirFiles.length != 0) { try { boolean confirm = false; if (!isInteractive) { if (force) { confirm = true; } else { confirm = false; } } else { confirm = IOUtils .confirmPrompt("Are you sure to format Bookie data..?"); } if (!confirm) { LOG.error("Bookie format aborted!!"); return false; } } catch (IOException e) { LOG.error("Error during bookie format", e); return false; } } if (!cleanDir(journalDir)) { LOG.error("Formatting journal directory failed"); return false; } File[] ledgerDirs = conf.getLedgerDirs(); for (File dir : ledgerDirs) { if (!cleanDir(dir)) { LOG.error("Formatting ledger directory " + dir + " failed"); return false; } } File[] indexDirs = conf.getIndexDirs(); if (null != indexDirs) { for (File dir : indexDirs) { if (!cleanDir(dir)) { LOG.error("Formatting ledger directory " + dir + " failed"); return false; } } } File metadataDir = new File(conf.getGcEntryLogMetadataCachePath()); if (!cleanDir(metadataDir)) { <START> LOG.error("Formatting ledger metadata directory " + metadataDir + " failed"); <END> return false; } } LOG.info("Bookie format completed successfully"); return true; }</code><technical_language>Please a parametrized message <LINK_0></technical_language>

Target:
public static boolean format(ServerConfiguration conf, boolean isInteractive, boolean force) { for (File journalDir : conf.getJournalDirs()) { String[] journalDirFiles = journalDir.exists() && journalDir.isDirectory() ? journalDir.list() : null; if (journalDirFiles != null && journalDirFiles.length != 0) { try { boolean confirm = false; if (!isInteractive) { if (force) { confirm = true; } else { confirm = false; } } else { confirm = IOUtils .confirmPrompt("Are you sure to format Bookie data..?"); } if (!confirm) { LOG.error("Bookie format aborted!!"); return false; } } catch (IOException e) { LOG.error("Error during bookie format", e); return false; } } if (!cleanDir(journalDir)) { LOG.error("Formatting journal directory failed"); return false; } File[] ledgerDirs = conf.getLedgerDirs(); for (File dir : ledgerDirs) { if (!cleanDir(dir)) { LOG.error("Formatting ledger directory " + dir + " failed"); return false; } } File[] indexDirs = conf.getIndexDirs(); if (null != indexDirs) { for (File dir : indexDirs) { if (!cleanDir(dir)) { LOG.error("Formatting ledger directory " + dir + " failed"); return false; } } } File metadataDir = new File(conf.getGcEntryLogMetadataCachePath()); if (!cleanDir(metadataDir)) { LOG.error("Formatting ledger metadata directory failed", metadataDir); return false; } } LOG.info("Bookie format completed successfully"); return true; }
Source:
<code>public void afterPropertiesSet() { if (!applicationContext.isPrototype(prototypeBeanName)) { throw new IncompatibleAggregateException( format("Cannot initialize repository '%s'. " + "The bean with name '%s' does not have the 'prototype' scope.", beanName, prototypeBeanName)); } AggregateModel<T> model; if (applicationContext.getBeanNamesForType(Configuration.class).length > 0) { Configuration configuration = applicationContext.getBean(Configuration.class); model = AnnotatedAggregateMetaModelFactory.inspectAggregate(getAggregateType(), configuration.parameterResolverFactory(), configuration .handlerDefinition(getAggregateType()), subtypes.keySet()); } else { model = AnnotatedAggregateMetaModelFactory.inspectAggregate(getAggregateType(), subtypes.keySet()); } this.delegate = new AbstractAggregateFactory<T>(model) { @Override protected T doCreateAggregate(String aggregateIdentifier, DomainEventMessage firstEvent) { return (T) applicationContext.getBean(prototype(firstEvent.getType())); } <START> private String prototype(String firstEventType) { <END> return aggregateModel.type(firstEventType) .map(subtypes::get) .orElseThrow(() -> new IncompatibleAggregateException(format( "The [%s] aggregate does not exist.", firstEventType))); } @Override protected T postProcessInstance(T aggregate) { applicationContext.getAutowireCapableBeanFactory() .configureBean(aggregate, subtypes.get(aggregate.getClass())); return aggregate; } }; }</code><technical_language>Confusing parameter name. type is of aggregate, event. fact type derived event, relevant in this scope anymore. I suggest "aggregateType" instead. Also, method allow inexistent types if substypes declared in aggregate, ensure compatibility 4.2, aggregate type initialize aggregate</technical_language>

Target:
public void afterPropertiesSet() { if (!applicationContext.isPrototype(prototypeBeanName)) { throw new IncompatibleAggregateException( format("Cannot initialize repository '%s'. " + "The bean with name '%s' does not have the 'prototype' scope.", beanName, prototypeBeanName)); } AggregateModel<T> model; if (applicationContext.getBeanNamesForType(Configuration.class).length > 0) { Configuration configuration = applicationContext.getBean(Configuration.class); model = AnnotatedAggregateMetaModelFactory.inspectAggregate(getAggregateType(), configuration.parameterResolverFactory(), configuration .handlerDefinition(getAggregateType()), subtypes.keySet()); } else { model = AnnotatedAggregateMetaModelFactory.inspectAggregate(getAggregateType(), subtypes.keySet()); } this.delegate = new AbstractAggregateFactory<T>(model) { @Override protected T doCreateAggregate(String aggregateIdentifier, DomainEventMessage firstEvent) { return (T) applicationContext.getBean(prototype(firstEvent.getType())); } private String prototype(String aggregateType) { return aggregateModel().type(aggregateType) .map(subtypes::get) .orElse(prototypeBeanName); } @Override protected T postProcessInstance(T aggregate) { applicationContext.getAutowireCapableBeanFactory() .configureBean(aggregate, subtypes.get(aggregate.getClass())); return aggregate; } }; }
Source:
<code><START> @Override public <T> Supplier<CompletableFuture<T>> execute(RexNode node) { <END> return () -> { final CompletableFuture<T> f = new CompletableFuture<>(); Scalar s = scalar(node, null); final Row r = ctx.rowHandler().factory(typeFactory.getJavaClass(node.getType())).create(); ctx.execute(() -> { try { s.execute(ctx, null, r); f.complete((T)ctx.rowHandler().get(0, r)); } catch (Throwable t) { f.completeExceptionally(t); } }); return f; }; }</code><technical_language>return a here? do need a) Supplier b) Future</technical_language>

Target:
@Override public <T> Supplier<T> execute(RexNode node) { return () -> { Scalar s = scalar(node, null); final Row r = ctx.rowHandler().factory(typeFactory.getJavaClass(node.getType())).create(); s.execute(ctx, null, r); return (T)ctx.rowHandler().get(0, r); }; }
Source:
<code>public JavaLanguageModule() { super(NAME, null, TERSE_NAME, JavaRuleChainVisitor.class, "java"); addVersion("1.3", new JavaLanguageHandler(3), false); addVersion("1.4", new JavaLanguageHandler(4), false); <START> addVersion("1.5", new JavaLanguageHandler(5), false, "5"); <END> addVersion("1.6", new JavaLanguageHandler(6), false, "6"); addVersion("1.7", new JavaLanguageHandler(7), false, "7"); addVersion("1.8", new JavaLanguageHandler(8), false, "8"); addVersion("9", new JavaLanguageHandler(9), false, "1.9"); addVersion("10", new JavaLanguageHandler(10), false, "1.10"); addVersion("11", new JavaLanguageHandler(11), false); addVersion("12", new JavaLanguageHandler(12), false); addVersion("13", new JavaLanguageHandler(13), false); addVersion("13-preview", new JavaLanguageHandler(13, true), false); addVersion("14", new JavaLanguageHandler(14), true); addVersion("14-preview", new JavaLanguageHandler(14, true), false); }</code><technical_language>I improve hiding isDefault parameter. default version, calls mention this false argument, is obscure is, in IDE. addVersion for non-default versions, a separate addDefaultVersion method</technical_language>

Target:
public JavaLanguageModule() { super(NAME, null, TERSE_NAME, JavaRuleChainVisitor.class, "java"); addVersion("1.3", new JavaLanguageHandler(3)); addVersion("1.4", new JavaLanguageHandler(4)); addVersion("1.5", new JavaLanguageHandler(5), "5"); addVersion("1.6", new JavaLanguageHandler(6), "6"); addVersion("1.7", new JavaLanguageHandler(7), "7"); addVersion("1.8", new JavaLanguageHandler(8), "8"); addVersion("9", new JavaLanguageHandler(9), "1.9"); addVersion("10", new JavaLanguageHandler(10), "1.10"); addVersion("11", new JavaLanguageHandler(11)); addVersion("12", new JavaLanguageHandler(12)); addVersion("13", new JavaLanguageHandler(13)); addVersion("13-preview", new JavaLanguageHandler(13, true)); addDefaultVersion("14", new JavaLanguageHandler(14)); addVersion("14-preview", new JavaLanguageHandler(14, true)); }
Source:
<code>public void testSingleResultQueryWithProjection() throws Exception { begin(); EntityManager em = createEntityManager(); String nativeQuery = "db.WILDE_POEM.find( " + "{ '$and' : [ { 'name' : 'Portia' }, { 'author' : 'Oscar Wilde' } ] }, " + "{ 'name' : 1 }" <START> + " )"; <END> String result = (String) em.createNativeQuery( nativeQuery, "poemAuthorNameMapping" ).getSingleResult(); assertThat( result ).isEqualTo( "Portia" ); commit(); close( em ); }</code><technical_language>a test check in this situation array of object is returned? I remember in this case</technical_language>

Target:
public void testSingleResultQueryWithProjection() throws Exception { begin(); EntityManager em = createEntityManager(); String nativeQuery = "db.WILDE_POEM.find( " + "{ '$and' : [ { 'name' : 'Portia' }, { 'author' : 'Oscar Wilde' } ] }, " + "{ 'name' : 1 }" + " )"; String result = (String) em.createNativeQuery( nativeQuery, "poemNameMapping" ).getSingleResult(); assertThat( result ).isEqualTo( "Portia" ); commit(); close( em ); }
Source:
<code>private void toggleMicToolBar() { <START> if ( mMicToolBar == null ) { <END> tempAudioPath = AudioView.generateTempAudioFile(this); mMicToolBar = AudioView.createRecorderInstance(this, R.drawable.av_play, R.drawable.av_pause, R.drawable.av_stop, R.drawable.av_rec, R.drawable.av_rec_stop, tempAudioPath); FrameLayout.LayoutParams lp2 = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mMicToolBar.setLayoutParams(lp2); LinearLayout micToolBarLayer = findViewById(R.id.mic_tool_bar_layer); micToolBarLayer.addView(mMicToolBar); } else { if( mMicToolBar.getVisibility() != View.VISIBLE) { mMicToolBar.setVisibility(View.VISIBLE); } else { mMicToolBar.setVisibility(View.GONE); } } }</code><technical_language>suggestion if (mMicToolBar == null) {</technical_language>

Target:
private void toggleMicToolBar() { if (mMicToolBar != null) { if (mMicToolBar.getVisibility() != View.VISIBLE) { mMicToolBar.setVisibility(View.VISIBLE); } else { mMicToolBar.setVisibility(View.GONE); } } else { mTempAudioPath = AudioView.generateTempAudioFile(this); if (mTempAudioPath == null) { return; } mMicToolBar = AudioView.createRecorderInstance(this, R.drawable.av_play, R.drawable.av_pause, R.drawable.av_stop, R.drawable.av_rec, R.drawable.av_rec_stop, mTempAudioPath); if (mMicToolBar == null) { mTempAudioPath = null; return; } FrameLayout.LayoutParams lp2 = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mMicToolBar.setLayoutParams(lp2); LinearLayout micToolBarLayer = findViewById(R.id.mic_tool_bar_layer); micToolBarLayer.addView(mMicToolBar); } }
Source:
<code>@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> setRetainInstance(true); <END> mBlogId = getArguments().getLong(ARG_BLOG_ID); mPostId = getArguments().getLong(ARG_POST_ID); }</code><technical_language>some benefits of retained fragment in this case</technical_language>

Target:
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mBlogId = getArguments().getLong(ARG_BLOG_ID); mPostId = getArguments().getLong(ARG_POST_ID); }
Source:
<code>private void handleMessage(Message message) { try { <START> messageHandler.handleMessage(message); <END> getSuccessCounter().increment(); } catch (Exception e) { log.error("failed to process message {}", message, e); getErrorCounter(e).increment(); } }</code><technical_language>is messageHandler's job mark message handled successfully? sense put responsibility in here, error return message queue a failure status eventually get DLQ'd (otherwise redrive visiblity timeout expires - a longer backoff want)</technical_language>

Target:
private void handleMessage(Message message) { Exception caught = null; try { messageHandler.handleMessage(message); getSuccessCounter().increment(); } catch (Exception e) { log.error("failed to process message {}", message, e); getErrorCounter(e).increment(); caught = e; } if (caught == null) { messageAcknowledger.ack(subscriptionInfo, message); } else { messageAcknowledger.nack(subscriptionInfo, message); } }
Source:
<code>public Observable<DynamicRealmObject> from(DynamicRealm realm, final DynamicRealmObject object) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<DynamicRealmObject>() { @Override public void call(final Subscriber<? super DynamicRealmObject> subscriber) { final DynamicRealm observableRealm = DynamicRealm.getInstance(realmConfig); objectRefs.get().acquireReference(object); final RealmChangeListener<DynamicRealmObject> listener = new RealmChangeListener<DynamicRealmObject>() { @Override <START> public void onChange(DynamicRealmObject result) { <END> if (!subscriber.isUnsubscribed()) { subscriber.onNext(object); } } }; RealmObject.addChangeListener(object, listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { RealmObject.removeChangeListener(object, listener); observableRealm.close(); objectRefs.get().releaseReference(object); } })); subscriber.onNext(object); } }); }</code><technical_language>object result</technical_language>

Target:
public Observable<DynamicRealmObject> from(DynamicRealm realm, final DynamicRealmObject object) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<DynamicRealmObject>() { @Override public void call(final Subscriber<? super DynamicRealmObject> subscriber) { final DynamicRealm observableRealm = DynamicRealm.getInstance(realmConfig); objectRefs.get().acquireReference(object); final RealmChangeListener<DynamicRealmObject> listener = new RealmChangeListener<DynamicRealmObject>() { @Override public void onChange(DynamicRealmObject object) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(object); } } }; RealmObject.addChangeListener(object, listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { RealmObject.removeChangeListener(object, listener); observableRealm.close(); objectRefs.get().releaseReference(object); } })); subscriber.onNext(object); } }); }
Source:
<code>public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { Activator.getDefault().logError("Error writing the file <START> "+file+" ", e); <END> } finally { fLock.readLock().unlock(); } }</code><technical_language>remove space end of string</technical_language>

Target:
public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { Activator.getDefault().logError("Error writing the file"+file, e); } finally { fLock.readLock().unlock(); } }
Source:
<code>private static void mergeSequences( final ArrayList<Move> sequence, final List<ArrayList<Move>> sequences) { for (final var otherSequence : sequences) { boolean merge = (otherSequence.size() == sequence.size()); for (int j = 0; merge && j < sequence.size(); j++) { merge = sequence.get(j).canMergeWith(otherSequence.get(j)); } if (!merge) { continue; } for (int j = 0; j < sequence.size(); j++) { if (!sequence.get(j).mergeWith(otherSequence.get(j))) { <START> throw new RuntimeException("Unexpected"); <END> } } otherSequence.clear(); } }</code><technical_language>Ok, this is a bad message. expected exception in general, exception extraordinary event definition. 2 options here: 1. This is supposed impossible condition, in this case throwing IlegalStateException more here. a message this state is illegal though. 2. This exception happen time time, in this case a simple message explaining happened sufficient already</technical_language>

Target:
private static void mergeSequences( final ArrayList<Move> sequence, final List<ArrayList<Move>> sequences) { for (final var otherSequence : sequences) { boolean merge = (otherSequence.size() == sequence.size()); for (int i = 0; merge && i < sequence.size(); i++) { merge = sequence.get(i).canMergeWith(otherSequence.get(i)); } if (!merge) { continue; } for (int i = 0; i < sequence.size(); i++) { if (!sequence.get(i).mergeWith(otherSequence.get(i))) { throw new IllegalStateException( "Could not merge move despite checking canMergeWith() earlier."); } } otherSequence.clear(); } }
Source:
<code>public void start() { this.stateCache = cacheManager .<ScopedState, CounterConfiguration>getCache(GlobalConfigurationManager.CONFIG_STATE_CACHE_NAME) .getAdvancedCache(); listener = new CounterConfigurationListener(); Map<String, CounterConfiguration> persisted = storage.loadAll(); persisted.forEach((name, cfg) -> stateCache.putIfAbsent(stateKey(name), cfg)); counterCacheStarted.set(false); <START> stateCache.addFilteredListener(listener, new ScopeFilter(COUNTER_SCOPE), null, Util.asSet(CacheEntryCreated.class, CacheEntryModified.class)); <END> if (!persisted.isEmpty() || stateCache.keySet().stream() .anyMatch(scopedState -> COUNTER_SCOPE.equals(scopedState.getScope()))) { startCounterCache(); } }</code><technical_language>need event types, this is handled annotation itself. This is for remote listeners access annotations this point</technical_language>

Target:
public void start() { this.stateCache = cacheManager .<ScopedState, CounterConfiguration>getCache(GlobalConfigurationManager.CONFIG_STATE_CACHE_NAME) .getAdvancedCache(); listener = new CounterConfigurationListener(); Map<String, CounterConfiguration> persisted = storage.loadAll(); persisted.forEach((name, cfg) -> stateCache.putIfAbsent(stateKey(name), cfg)); counterCacheStarted.set(false); stateCache.addListener(listener, new ScopeFilter(COUNTER_SCOPE), null); if (!persisted.isEmpty() || stateCache.keySet().stream() .anyMatch(scopedState -> COUNTER_SCOPE.equals(scopedState.getScope()))) { startCounterCache(); } }
Source:
<code>public static void main(String[] args) { TestChunkerModels test = null; if (args.length != 3) { <START> if (args.length == 1) <END> test = new TestChunkerModels(null, args[0], null); else { logger.error("Usage: " + NAME + " testData modelDir modelName"); logger.error("OR " + NAME + " testData"); System.exit(-1); } } else test = new TestChunkerModels(args[1], args[0], args[2]); test.testAccuracy(); }</code><technical_language>in main(), this is a usage warning, please leave println()</technical_language>

Target:
public static void main(String[] args) { TestChunkerModels test = null; if (args.length != 3) { if (args.length == 1) test = new TestChunkerModels(null, args[0], null); else { System.err.println("Usage: " + NAME + " testData modelDir modelName"); System.err.println("OR " + NAME + " testData"); System.exit(-1); } } else test = new TestChunkerModels(args[1], args[0], args[2]); test.testAccuracy(); }
Source:
<code>public List<Sentence> collectAndRemoveListProds(List<Sentence> sentences) { listProds = new HashMap<>(); List<Sentence> ret = new ArrayList<>(sentences); Iterator<Sentence> iter = ret.iterator(); while (iter.hasNext()) { Sentence sentence = iter.next(); if (sentence instanceof SyntaxProduction) { SyntaxProduction prod = (SyntaxProduction) sentence; List<K> attrs = stream(prod.att().att()).collect(Collectors.toList()); <START> Option<String> listType = prod.att().getString("userList"); <END> if (!listType.isEmpty()) { List<SyntaxProduction> prods = listProds.get(listType.get()); if (prods == null) { prods = new ArrayList<>(3); listProds.put(listType.get(), prods); } prods.add(prod); iter.remove(); } } } generateUserLists(); return ret; }</code><technical_language>Java 8's Optional</technical_language>

Target:
public List<Sentence> collectAndRemoveListProds(List<Sentence> sentences) { listProds = new HashMap<>(); List<Sentence> ret = new ArrayList<>(sentences); Iterator<Sentence> iter = ret.iterator(); while (iter.hasNext()) { Sentence sentence = iter.next(); if (sentence instanceof SyntaxProduction) { SyntaxProduction prod = (SyntaxProduction) sentence; List<K> attrs = stream(prod.att().att()).collect(Collectors.toList()); Optional<String> listType = prod.att().getOptionalString("userList"); if (listType.isPresent()) { List<SyntaxProduction> prods = listProds.get(listType.get()); if (prods == null) { prods = new ArrayList<>(3); listProds.put(listType.get(), prods); } prods.add(prod); iter.remove(); } } } generateUserLists(); return ret; }
Source:
<code>public void handleNotification(Notification notification) { try { if (acquireScanLock()) { <START> ROOT_LOGGER.warn("Notification processed"); <END> switch (notification.getType()) { case DEPLOYMENT_DEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (!deployed.containsKey(runtimeName)) { updateDeploymentStatusAfterNotification(deploymentDir.toPath(), runtimeName); } break; } case DEPLOYMENT_UNDEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (deployed.containsKey(runtimeName)) { clearMarkers(deployed.get(runtimeName).parentFolder.toPath(), runtimeName); deployed.remove(runtimeName); } break; } default: } } } finally { releaseScanLock(); } }</code><technical_language>This a tracef removed</technical_language>

Target:
public void handleNotification(Notification notification) { if (acquireScanLock()) { try { switch (notification.getType()) { case DEPLOYMENT_DEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (!deployed.containsKey(runtimeName)) { updateDeploymentStatusAfterNotification(deploymentDir.toPath(), runtimeName); } break; } case DEPLOYMENT_UNDEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (deployed.containsKey(runtimeName)) { clearMarkers(deployed.get(runtimeName).parentFolder.toPath(), runtimeName); deployed.remove(runtimeName); } break; } default: } } finally { releaseScanLock(); } } }
Source:
<code>void setup() { <START> Constant.getInstance(); I18N i18n = Mockito.mock(I18N.class, withSettings().lenient()); given(i18n.getString(anyString())).willReturn(""); given(i18n.getString(anyString(), any())).willReturn(""); given(i18n.getLocal()).willReturn(Locale.getDefault()); Constant.messages = i18n; <END> extensionAuthentication = new ExtensionAuthentication(); }</code><technical_language>needed</technical_language>

Target:
void setup() { extensionAuthentication = new ExtensionAuthentication(); }