auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected String getProcessedUrl( IMetaStore metastore, String url ) { if ( url == null ) { return null; } if ( metastore == null ) { <START> if ( Spoon.getInstance() != null ) { <END> metaStore = Spoon.getInstance().getMetaStore(); } } else { metaStore = metastore; } NamedCluster c = null; if ( metaStore != null ) { c = namedClusterService.getNamedClusterByName( sourceConfigurationName, metaStore ); } else { if ( namedClusterService.getClusterTemplate() != null ) { c = namedClusterService.getClusterTemplate().fromXmlForEmbed( embeddedNamedClusterNode ); } } if ( c != null ) { url = c.processURLsubstitution( url, metaStore, new Variables() ); } return url; }</code><technical_language>This creeps out. UI jar. "working" Pan kettle-ui, this is break some point. this instead: org.pentaho.di.metastore.MetaStoreConst#openLocalPentahoMetaStore</technical_language>

Target:
protected String getProcessedUrl( IMetaStore metastore, String url ) { if ( url == null ) { return null; } if ( metastore == null ) { try { metaStore = MetaStoreConst.openLocalPentahoMetaStore( false ); } catch ( Exception e ) { } } else { metaStore = metastore; } NamedCluster c = null; if ( metaStore != null ) { c = namedClusterService.getNamedClusterByName( sourceConfigurationName, metaStore ); } else { if ( namedClusterService.getClusterTemplate() != null ) { c = namedClusterService.getClusterTemplate().fromXmlForEmbed( embeddedNamedClusterNode ); } } if ( c != null ) { url = c.processURLsubstitution( url, metaStore, new Variables() ); } return url; }
Source:
<code>public static String generateSequence(int len, int skipPeriod, int skipLength) { <START> StringBuilder text = new StringBuilder(); <END> int skipStart = skipPeriod - skipLength; int skippedChars = 0; for (int i = 0; i - skippedChars < len; ++i) { if (skipPeriod == 0 || i % skipPeriod < skipStart) { text.append((char) (32 + i % 95)); } else { skippedChars++; } } return (text.toString()); }</code><technical_language>pass len allocate underlying char[] correct size</technical_language>

Target:
public static String generateSequence(int len, int skipPeriod, int skipLength) { StringBuilder text = new StringBuilder(len); int skipStart = skipPeriod - skipLength; int skippedChars = 0; for (int i = 0; i - skippedChars < len; ++i) { if (skipPeriod == 0 || i % skipPeriod < skipStart) { text.append((char) (32 + i % 95)); } else { skippedChars++; } } return text.toString(); }
Source:
<code>public void setupProperties() { super.setupProperties(); manualQuery.setValue(false); query.setTaggedValue(ComponentConstants.LINE_SEPARATOR_REPLACED_TO, " "); <START> convertColumnsAndTableToUppercase.setValue(true); <END> }</code><technical_language>set true initial in Property<Boolean> constructor. do need this line either</technical_language>

Target:
public void setupProperties() { super.setupProperties(); manualQuery.setValue(false); query.setTaggedValue(ComponentConstants.LINE_SEPARATOR_REPLACED_TO, " "); }
Source:
<code><START> public ResponseEntity deleteStringPattern(@PathVariable("tenant") final String tenant, <END> @PathVariable("name") final String name) throws IOException { _referenceDataDao.removeStringPattern(_contextFactory.getContext(tenant), name); return ResponseEntity.noContent().build(); }</code><technical_language>ResponseEntity is a raw type. References generic type ResponseEntity<T> parameterized</technical_language>

Target:
public ResponseEntity<Void> deleteStringPattern(@PathVariable("tenant") final String tenant, @PathVariable("name") final String name) throws IOException { _referenceDataDao.removeStringPattern(_contextFactory.getContext(tenant), name); return ResponseEntity.noContent().build(); }
Source:
<code>public static void checkFetchHints(EnumSet<FetchHint> fetchHints, FetchHint neededFetchHint) { <START> if (!fetchHints.contains(neededFetchHint)) { <END> throw new VertexiumMissingFetchHintException(fetchHints, EnumSet.of(neededFetchHint)); } }</code><technical_language>Small change. This method implemented as: checkFetchHints(fetchHints, EnumSet.of(neededFetchHint)) fine if stay though</technical_language>

Target:
public static void checkFetchHints(EnumSet<FetchHint> fetchHints, FetchHint neededFetchHint) { checkFetchHints(fetchHints, EnumSet.of(neededFetchHint)); }
Source:
<code>private static void writeContents( FileSystemAbstraction fileSystemAbstraction, File file, String contents ) { byte[] bytes = contents.getBytes(); try ( StoreChannel storeChannel = fileSystemAbstraction.create( file ) ) { storeChannel.write( ByteBuffer.wrap( bytes ) ); <START> storeChannel.close(); <END> } catch ( IOException e ) { throw new RuntimeException( e ); } }</code><technical_language>try-with-resources takes care of closing, right</technical_language>

Target:
private static void writeContents( FileSystemAbstraction fileSystemAbstraction, File file, String contents ) { byte[] bytes = contents.getBytes(); try ( StoreChannel storeChannel = fileSystemAbstraction.create( file ) ) { storeChannel.write( ByteBuffer.wrap( bytes ) ); } catch ( IOException e ) { throw new RuntimeException( e ); } }
Source:
<code>public boolean isSystemLibrary() { <START> String value = attributes.get(TAG_SYSTEMLIBRARY); <END> if (value == null) { return false; } return Boolean.parseBoolean(value); }</code><technical_language>I suggest reverting isSytemLibrary field</technical_language>

Target:
public boolean isSystemLibrary() { return this.isSystemLibrary; }
Source:
<code>public void addsPath() throws IOException { MatcherAssert.assertThat( <START> new Href("<LINK_2>").path("c").path("d").toString(), <END> Matchers.equalTo("<LINK_0>") ); }</code><technical_language>try this: new Href("<LINK_1>").path("c").path("d").toString()</technical_language>

Target:
public void addsPath() throws IOException { MatcherAssert.assertThat( new Href("<LINK_2>").path("c").path("d").toString(), Matchers.equalTo("<LINK_0>") ); MatcherAssert.assertThat( new Href("<LINK_1>").path("e").path("f").toString(), Matchers.equalTo("<LINK_1>e/f") ); }
Source:
<code>public Disposable scheduleDirect(@NonNull Runnable run) { <START> ObjectHelper.requireNonNull(run, "runnable is null"); <END> run.run(); return EmptyDisposable.INSTANCE; }</code><technical_language>"run is null", run.run() crashed anyway</technical_language>

Target:
public Disposable scheduleDirect(@NonNull Runnable run) { RxJavaPlugins.onSchedule(run).run(); return EmptyDisposable.INSTANCE; }
Source:
<code>private RepoCollectionMetadata fetchArticleCollection(ArticleIdentity id) { String identifier = id.getIdentifier(); Optional<Integer> versionNumber = id.getVersionNumber(); RepoCollectionMetadata collection; try { if (versionNumber.isPresent()) { collection = contentRepoService.getCollection(new RepoVersionNumber(identifier, versionNumber.get())); } else { collection = contentRepoService.getLatestCollection(identifier); } } catch(NotFoundException nfe) { <START> throw entityNotFound(nfe.getMessage() + ": " + identifier); <END> } return collection; }</code><technical_language>In cases of this pattern, throwing NotFoundException. if pass "cause" argument eventually construct RestClientException object</technical_language>

Target:
private RepoCollectionMetadata fetchArticleCollection(ArticleIdentity id) { String identifier = id.getIdentifier(); Optional<Integer> versionNumber = id.getVersionNumber(); RepoCollectionMetadata collection; try { if (versionNumber.isPresent()) { collection = contentRepoService.getCollection(new RepoVersionNumber(identifier, versionNumber.get())); } else { collection = contentRepoService.getLatestCollection(identifier); } } catch(NotFoundException nfe) { throw reportNotFound(id, "collection", nfe); } return collection; }
Source:
<code>public List<ValidationMessage> validateForRefOperation() throws RefOperationValidationException { List<ValidationMessage> messages = <START> Lists.newLinkedList(); <END> boolean withException = false; try { for (RefOperationValidationListener listener : refOperationValidationListeners) { messages.addAll(listener.onRefOperation(event)); } } catch (ValidationException e) { messages.add(new ValidationMessage(e.getMessage(), true)); withException = true; } finally { if (withException) { throwException(messages, event); } } return messages; }</code><technical_language>do a reason for linkedList instead of simple arrayList</technical_language>

Target:
public List<ValidationMessage> validateForRefOperation() throws RefOperationValidationException { List<ValidationMessage> messages = Lists.newArrayList(); boolean withException = false; try { for (RefOperationValidationListener listener : refOperationValidationListeners) { messages.addAll(listener.onRefOperation(event)); } } catch (ValidationException e) { messages.add(new ValidationMessage(e.getMessage(), true)); withException = true; } if (withException) { throwException(messages, event); } return messages; }
Source:
<code>public DBObject convert(Variant object) { String id = Variant.buildVariantId(object.getChromosome(), object.getStart(), object.getReference(), <START> object.getAlternate()); <END> BasicDBObject mongoVariant = new BasicDBObject("_id", id) .append(TYPE_FIELD, object.getType().name()) .append(CHROMOSOME_FIELD, object.getChromosome()) .append(START_FIELD, object.getStart()) .append(END_FIELD, object.getEnd()) .append(LENGTH_FIELD, object.getLength()) .append(REFERENCE_FIELD, object.getReference()) .append(ALTERNATE_FIELD, object.getAlternate()); appendAt(object, mongoVariant); appendHgvs(object, mongoVariant); appendFiles(object, mongoVariant); appendStatistics(object, mongoVariant); return mongoVariant; }</code><technical_language>This instance instead of class method</technical_language>

Target:
public DBObject convert(Variant object) { String id = object.buildVariantId(); BasicDBObject mongoVariant = new BasicDBObject("_id", id) .append(TYPE_FIELD, object.getType().name()) .append(CHROMOSOME_FIELD, object.getChromosome()) .append(START_FIELD, object.getStart()) .append(END_FIELD, object.getEnd()) .append(LENGTH_FIELD, object.getLength()) .append(REFERENCE_FIELD, object.getReference()) .append(ALTERNATE_FIELD, object.getAlternate()); appendAt(object, mongoVariant); appendHgvs(object, mongoVariant); appendFiles(object, mongoVariant); appendStatistics(object, mongoVariant); return mongoVariant; }
Source:
<code>public static String getLibraryUrl(String libraryId, String revision) { if (!SUPPORT_REPOSITORY_DEFAULTS.containsKey(libraryId)) { return null; } if (!AndroidSdkUtils.isAndroidSdkAvailable()) { <START> throw new IllegalStateException("No SDK Available. Please configure your SDK in the project structure."); <END> } String sdkLocation = AndroidSdkUtils.tryToChooseAndroidSdk().getLocation(); String path = String.format(SUPPORT_REPOSITORY_BASE_PATH, sdkLocation, libraryId + "-" + revision) + MAVEN_METADATA_FILE_NAME; path = FileUtil.toSystemIndependentName(path); File supportMetadataFile = new File(path); if (!supportMetadataFile.exists()) { return SUPPORT_REPOSITORY_DEFAULTS.get(libraryId); } String version = getLatestVersionFromMavenMetadata(supportMetadataFile); return String.format(SUPPORT_BASE_URL, libraryId, revision, version); }</code><technical_language>s/project structure/Project Structure dialog/</technical_language>

Target:
public static String getLibraryUrl(String libraryId, String revision) { if (!SUPPORT_REPOSITORY_DEFAULTS.containsKey(libraryId)) { return null; } if (!AndroidSdkUtils.isAndroidSdkAvailable()) { throw new IllegalStateException("No SDK Available. Please configure your SDK in the Project Structure dialog."); } String sdkLocation = AndroidSdkUtils.tryToChooseAndroidSdk().getLocation(); String path = String.format(SUPPORT_REPOSITORY_BASE_PATH, sdkLocation, libraryId + "-" + revision) + MAVEN_METADATA_FILE_NAME; path = FileUtil.toSystemDependentName(path); File supportMetadataFile = new File(path); if (!supportMetadataFile.exists()) { return SUPPORT_REPOSITORY_DEFAULTS.get(libraryId); } String version = getLatestVersionFromMavenMetadata(supportMetadataFile); return String.format(SUPPORT_BASE_URL, libraryId, revision, version); }
Source:
<code>protected static DefaultCustomPage decode(int contextId, String encodedString) { String[] pieces = encodedString.split(FIELD_SEPARATOR, -1); DefaultCustomPage defaultCustomPage = null; try { defaultCustomPage = new DefaultCustomPage( contextId, new String( Base64.getDecoder().decode(pieces[0]), StandardCharsets.UTF_8), CustomPageMatcherLocation.getCustomPagePageMatcherLocationWithId( Integer.parseInt(pieces[1])), Boolean.parseBoolean(pieces[2]), Type.getCustomPageTypeWithId(Integer.parseInt(pieces[3])), Boolean.parseBoolean(pieces[4])); } catch (Exception ex) { <START> System.out.println(ex.getMessage()); <END> LOGGER.error( "An error occured while decoding DefaultCustomPage from: " + encodedString, ex); return null; } return defaultCustomPage; }</code><technical_language>Remove</technical_language>

Target:
protected static DefaultCustomPage decode(int contextId, String encodedString) { String[] pieces = encodedString.split(FIELD_SEPARATOR, -1); DefaultCustomPage defaultCustomPage = null; try { defaultCustomPage = new DefaultCustomPage( contextId, new String( Base64.getDecoder().decode(pieces[0]), StandardCharsets.UTF_8), CustomPageMatcherLocation.getCustomPagePageMatcherLocationWithId( Integer.parseInt(pieces[1])), Boolean.parseBoolean(pieces[2]), Type.getCustomPageTypeWithId(Integer.parseInt(pieces[3])), Boolean.parseBoolean(pieces[4])); } catch (Exception ex) { LOGGER.error( "An error occured while decoding DefaultCustomPage from: " + encodedString, ex); return null; } return defaultCustomPage; }
Source:
<code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES); mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS); mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS); mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL); setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE)); } else { mIndexes = new ArrayList<Integer>(); mFirstPositions = new ArrayList<Integer>(); mTops = new ArrayList<Integer>(); mHeightCell = 0; } SharedPreferences appPreferences = PreferenceManager <START> .getDefaultSharedPreferences(MainApp.getAppContext()); <END> mScale = appPreferences.getFloat(GRID_COLUMNS, -1.0f); }</code><technical_language>minimize dependencies getActivity() a context. is specific reason application context</technical_language>

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES); mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS); mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS); mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL); setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE)); } else { mIndexes = new ArrayList<Integer>(); mFirstPositions = new ArrayList<Integer>(); mTops = new ArrayList<Integer>(); mHeightCell = 0; } SharedPreferences appPreferences = PreferenceManager .getDefaultSharedPreferences(getContext()); mScale = appPreferences.getFloat(GRID_COLUMNS, -1.0f); }
Source:
<code>public void onBarrierStateChanged(final String version, ZkBarrierForVersionUpgrade.State state) { LOG.info("JobModel version " + version + " obtained consensus successfully!"); metrics.barrierStateChange.inc(); metrics.singleBarrierRebalancingTime.update(System.nanoTime() - startTime); if (ZkBarrierForVersionUpgrade.State.DONE.equals(state)) { debounceTimer.scheduleAfterDebounceTime(barrierAction, 0, () -> onNewJobModelConfirmed(version)); } else { if (ZkBarrierForVersionUpgrade.State.TIMED_OUT.equals(state)) { LOG.warn("Leader: barrier for version " + version + " timed out."); if (leaderElector.amILeader()) { debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.ON_PROCESSOR_CHANGE, debounceTimeMs, () -> <START> { <END> doOnProcessorChange(new ArrayList<>()); }); } } } }</code><technical_language>This guards processors change(for some reason processor remove itself) barrier timeout. contrary, redundant rebalancing phases (one barrier timeout, processor deleted. handle this cleanly pause functionality in SamzaContainer). create a JIRA for this</technical_language>

Target:
public void onBarrierStateChanged(final String version, ZkBarrierForVersionUpgrade.State state) { LOG.info("JobModel version " + version + " obtained consensus successfully!"); metrics.barrierStateChange.inc(); metrics.singleBarrierRebalancingTime.update(System.nanoTime() - startTime); if (ZkBarrierForVersionUpgrade.State.DONE.equals(state)) { debounceTimer.scheduleAfterDebounceTime(barrierAction, 0, () -> onNewJobModelConfirmed(version)); } else { if (ZkBarrierForVersionUpgrade.State.TIMED_OUT.equals(state)) { LOG.warn("Barrier for version " + version + " timed out."); if (zkController.isLeader()) { LOG.info("Leader will schedule a new job model generation"); debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.ON_PROCESSOR_CHANGE, debounceTimeMs, () -> { doOnProcessorChange(new ArrayList<>()); }); } } } }
Source:
<code><START> public String getTypeName() { <END> return null; }</code><technical_language>Implement this</technical_language>

Target:
public String getTypeName() { return "Insertion Feature"; }
Source:
<code>public void clickOkButton() { <START> WaitUtils.sleepQuietly(2); <END> seleniumWebDriverHelper.waitAndClick(By.xpath(OK_BUTTON_XPATH)); }</code><technical_language>need wait 2 seconds if waiting web element later</technical_language>

Target:
public void clickOkButton() { seleniumWebDriverHelper.waitAndClick(By.xpath(OK_BUTTON_XPATH)); }
Source:
<code>public CategoryTree get() { <START> Logger.info("categoryTreeProvider"); <END> final PagedQueryResult<Category> pagedQueryResult = client.execute(CategoryQuery.of()).get(2000, TimeUnit.MILLISECONDS); return CategoryTree.of(pagedQueryResult.getResults()); }</code><technical_language>this message more informative</technical_language>

Target:
public CategoryTree get() { Logger.info("execute CategoryTreeProvider.get()"); final PagedQueryResult<Category> pagedQueryResult = client.execute(CategoryQuery.of()).get(2000, TimeUnit.MILLISECONDS); return CategoryTree.of(pagedQueryResult.getResults()); }
Source:
<code>public FileProcessor(DatastreamTask datastreamTask, DatastreamEventProducer producer) throws FileNotFoundException { _task = datastreamTask; _fileName = datastreamTask.getDatastreamSource().getConnectionString(); _positionValue = (FilePositionValue) PositionDataStore.getInstance() .computeIfAbsent(_task.getConnectorType(), s -> new ConcurrentHashMap<>()) .computeIfAbsent(new FilePositionKey(BrooklinInstanceInfo.getInstanceName(), _task.getTaskPrefix(), <START> _task.getDatastreamTaskName(), Instant.now(), _fileName), s -> new FilePositionValue()); <END> final File file = new File(_fileName); _positionValue.setFileLengthBytes(file.length()); _inputStream = new CountingInputStream(new FileInputStream(file)); _fileReader = new BufferedReader(new InputStreamReader(_inputStream)); _producer = producer; _isStopped = false; _cancelRequested = false; LOG.info("Created FileProcessor for " + datastreamTask); }</code><technical_language>is instant needed for key</technical_language>

Target:
public FileProcessor(DatastreamTask datastreamTask, DatastreamEventProducer producer) throws FileNotFoundException { _task = datastreamTask; _fileName = datastreamTask.getDatastreamSource().getConnectionString(); _positionValue = (FilePositionValue) ConnectorPositionsCache.getInstance() .computeIfAbsent(_task.getConnectorType(), s -> new ConcurrentHashMap<>()) .computeIfAbsent(new FilePositionKey(BrooklinInstanceInfo.getInstanceName(), _task.getTaskPrefix(), _task.getDatastreamTaskName(), Instant.now(), _fileName), s -> new FilePositionValue()); final File file = new File(_fileName); _positionValue.setFileLengthBytes(file.length()); _inputStream = new CountingInputStream(new FileInputStream(file)); _fileReader = new BufferedReader(new InputStreamReader(_inputStream)); _producer = producer; _isStopped = false; _cancelRequested = false; LOG.info("Created FileProcessor for " + datastreamTask); }
Source:
<code>public void run() { try { checkLogDir(logDirectory); } catch (LogDirNotFoundException e) { <START> LOG.error("Incorrect path to log directory. Directory: not exist", logDirectory); <END> return; } if (!charsetSetup()) { LOG.error("Charset: is not supported", charsetName); return; } FileTailerState fileTailerState = getSaveStateFromFile(); try { if (fileTailerState == null) { LOG.info("Fail state do not found. Start reading all directory"); runWithOutRestore(); } else { runFromSaveState(fileTailerState); } } catch (InterruptedException e) { LOG.info("Tailer daemon was interrupted"); } LOG.info("Tailer daemon stopped"); }</code><technical_language>"Incorrect path log directory; directory exist"</technical_language>

Target:
public void run() { try { checkLogDirExists(logDirectory); } catch (LogDirNotFoundException e) { LOG.error("Incorrect path to log directory; directory does not exist", logDirectory.getAbsolutePath()); return; } FileTailerState fileTailerState = getSaveStateFromFile(); try { if (fileTailerState == null) { LOG.info("File Tailer state was not found; start reading all logs from the directory from the beginning"); runWithOutRestore(); } else { runFromSaveState(fileTailerState); } } catch (InterruptedException e) { LOG.info("Tailer daemon was interrupted"); } LOG.info("Tailer daemon stopped"); }
Source:
<code>public void OnInstall() { InstallModel model = (InstallModel) getWindow(); final boolean isOVirt = getEntity().getVdsType() == VDSType.oVirtNode; if (!model.Validate(isOVirt)) { return; } UpdateVdsActionParameters param = new UpdateVdsActionParameters(); param.setvds(getEntity()); param.setVdsId(getEntity().getId()); param.setRootPassword((String) model.getRootPassword().getEntity()); param.setIsReinstallOrUpgrade(true); param.setInstallVds(true); param.setoVirtIsoFile(isOVirt ? ((RpmVersion) model.getOVirtISO().getSelectedItem()).getRpmName() : null); param.setOverrideFirewall((Boolean) model.getOverrideIpTables().getEntity()); <START> param.setRebootAfterInstallation(isOVirt); <END> Frontend.RunAction( VdcActionType.UpdateVds, param, new IFrontendActionAsyncCallback() { @Override public void Executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValue = result.getReturnValue(); if (returnValue != null && returnValue.getSucceeded()) { Cancel(); } } } ); }</code><technical_language>reboot decided based type of cluster irrespective of node type</technical_language>

Target:
public void OnInstall() { InstallModel model = (InstallModel) getWindow(); final boolean isOVirt = getEntity().getVdsType() == VDSType.oVirtNode; if (!model.Validate(isOVirt)) { return; } UpdateVdsActionParameters param = new UpdateVdsActionParameters(); param.setvds(getEntity()); param.setVdsId(getEntity().getId()); param.setRootPassword((String) model.getRootPassword().getEntity()); param.setIsReinstallOrUpgrade(true); param.setInstallVds(true); param.setoVirtIsoFile(isOVirt ? ((RpmVersion) model.getOVirtISO().getSelectedItem()).getRpmName() : null); param.setOverrideFirewall((Boolean) model.getOverrideIpTables().getEntity()); AsyncDataProvider.GetClusterById(new AsyncQuery(param, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { VDSGroup cluster = (VDSGroup) returnValue; UpdateVdsActionParameters internalParam = (UpdateVdsActionParameters) model; internalParam.setRebootAfterInstallation(cluster.supportsVirtService()); Frontend.RunAction( VdcActionType.UpdateVds, internalParam, new IFrontendActionAsyncCallback() { @Override public void Executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValue = result.getReturnValue(); if (returnValue != null && returnValue.getSucceeded()) { Cancel(); } } } ); } }), getEntity().getVdsGroupId()); }
Source:
<code>@Override public boolean equals(Object obj) { <START> if (this == obj) <END> return true; if (!(obj instanceof MyStringKey)) return false; return toString().equals(obj.toString()); }</code><technical_language>I wrong. state a.hashCode() != b.hashCode() a.equals(b) is true</technical_language>

Target:
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || MyStringKey.class != obj.getClass()) return false; MyStringKey key = (MyStringKey)obj; return Objects.equals(str, key.str); }
Source:
<code>private boolean refinesMultiplicityChange(Diff input) { <START> for (Diff refinedDiff : input.getRefines()) { <END> if (refinedDiff instanceof MultiplicityElementChange) { return true; } } return false; }</code><technical_language>Replace method body return any(input.getRefines(), instanceOf(MultiplicityElementChange.class)); add static import of Iterables.any</technical_language>

Target:
private boolean refinesMultiplicityChange(Diff input) { return any(input.getRefines(), instanceOf(MultiplicityElementChange.class)); }
Source:
<code>public void show(final EditorPartPresenter editorPartPresenter) { if (!(editorPartPresenter instanceof TextEditor)) { Log.error(getClass(), "Open Declaration support only TextEditor as editor"); return; } activeEditor = ((TextEditor) editorPartPresenter); final VirtualFile file = activeEditor.getEditorInput().getFile(); if (file instanceof Resource) { final Project project = ((Resource) file).getProject(); final Optional<Resource> srcFolder = ((Resource) file).getParentWithMarker(SourceFolderMarker.ID); if (project == null || !srcFolder.isPresent()) { return; } final String fqn = JavaUtil.resolveFQN((Container) srcFolder.get(), (Resource) file); service .findImplementations( new FindImplementationsCommandParametersDto( new FindImplementationsCommandParameters( project.getLocation().toString(), fqn, activeEditor.getCursorOffset()))) .then( impls -> { int overridingSize = impls.getImplementations().size(); String title = locale.openImplementationWindowTitle(impls.getMemberName(), overridingSize); NoImplementationWidget noImplementationWidget = new NoImplementationWidget( popupResources, javaResources, locale, OpenImplementationPresenter.this, title); if (overridingSize == 1) { actionPerformed(impls.getImplementations().get(0)); } else if (overridingSize > 1) { <START> openOneImplementation( <END> impls, noImplementationWidget, (TextEditor) editorPartPresenter); } else if (!isNullOrEmpty(impls.getMemberName()) && overridingSize == 0) { showNoImplementations(noImplementationWidget, (TextEditor) editorPartPresenter); } }); } }</code><technical_language>PopupWidget handles case of elements. do complicate lives here</technical_language>

Target:
public void show(final EditorPartPresenter editorPartPresenter) { if (!(editorPartPresenter instanceof TextEditor)) { Log.error(getClass(), "Open Declaration support only TextEditor as editor"); return; } activeEditor = ((TextEditor) editorPartPresenter); final VirtualFile file = activeEditor.getEditorInput().getFile(); javaLanguageExtensionServiceClient .findImplementations( new TextDocumentPositionParamsDto( new TextDocumentPositionParams( new TextDocumentIdentifier(file.getLocation().toString()), new Position( activeEditor.getCursorPosition().getLine(), activeEditor.getCursorPosition().getCharacter())))) .then( impls -> { int overridingSize = impls.getImplementers().size(); String title = locale.openImplementationWindowTitle(impls.getSearchedElement(), overridingSize); PositionConverter.PixelCoordinates coordinates = activeEditor.getPositionConverter().offsetToPixel(activeEditor.getCursorOffset()); if (overridingSize == 1) { openOneImplementation(impls.getImplementers().get(0)); } else if (!isNullOrEmpty(impls.getSearchedElement())) { openImplementations(impls, title, coordinates); } }); }
Source:
<code>public Collection<?> getChildren(Object object) { Collection<Object> children = new ArrayList<Object>(); MatchResource matchResource = (MatchResource)object; Comparison comparison = matchResource.getComparison(); for (ResourceAttachmentChange rac : filter(comparison.getDifferences(), ResourceAttachmentChange.class)) { final String diffResourceURI = rac.getResourceURI(); <START> if (diffResourceURI.equals(matchResource.getLeftURI()) <END> || diffResourceURI.equals(matchResource.getRightURI())) { children.add(rac); } } return children; }</code><technical_language>test for origin carefull diffResourceURI is null if (diffResourceURI != null && (diffResourceURI.equals(matchResource.getLeftURI()) || diffResourceURI.equals(matchResource.getRightURI()) || diffResourceURI .equals(matchResource.getOriginURI())))</technical_language>

Target:
public Collection<?> getChildren(Object object) { Collection<Object> children = new ArrayList<Object>(); MatchResource matchResource = (MatchResource)object; Comparison comparison = matchResource.getComparison(); for (ResourceAttachmentChange rac : filter(comparison.getDifferences(), ResourceAttachmentChange.class)) { final String diffResourceURI = rac.getResourceURI(); if (diffResourceURI != null && (diffResourceURI.equals(matchResource.getLeftURI()) || diffResourceURI.equals(matchResource.getRightURI()) || diffResourceURI .equals(matchResource.getOriginURI()))) { children.add(rac); } } return children; }
Source:
<code>private void createMocksForStartVisit() { Observable observable = Observable.create((Observable.OnSubscribe<Location>) subscriber -> {}); PowerMockito.when(OpenMRS.getInstance()).thenReturn(openMRS); PowerMockito.when(LocationDAO.findLocationByName(anyString())).thenReturn(observable); <START> <END> when(openMRS.getLocation()).thenReturn("location"); when(openMRS.getVisitTypeUUID()).thenReturn("visitTypeUuid"); }</code><technical_language>curious LocationDAO methods static... idea</technical_language>

Target:
private void createMocksForStartVisit() { PowerMockito.when(OpenMRS.getInstance()).thenReturn(openMRS); PowerMockito.when(locationDAO.findLocationByName(anyString())).thenReturn(new Location()); when(openMRS.getLocation()).thenReturn("location"); when(openMRS.getVisitTypeUUID()).thenReturn("visitTypeUuid"); }
Source:
<code>public ModelNode correctOperation(ModelNode operation) { ModelNode op = operation.clone(); for (String attr : attributes) { ModelNode value = op.get(attr); ModelNode checkOp = op.clone(); checkOp.protect(); if (checkValue(checkOp, attr, value, false)) { AttributesPathAddressConfig<?> complexChildConfig = complexAttributes.get(attr); if (complexChildConfig == null) { ModelNode resolved = correctValue(op.get(attr), false); op.get(attr).set(resolved); } else { op.get(attr).set(complexChildConfig.correctOperation(operation.get(attr))); } } } <START> return op; <END> }</code><technical_language>safer track 'op' modified (ie 'if (checkValue...' block entered) return 'operation' if not. op.get call L429 modify 'op' changing semantic content is other code checks if return val this method equals passed in. a result check actual change mess up</technical_language>

Target:
public ModelNode correctOperation(ModelNode operation) { ModelNode op = operation.clone(); boolean corrected = false; for (String attr : attributes) { ModelNode value = op.get(attr); ModelNode checkOp = op.clone(); checkOp.protect(); if (checkValue(checkOp, attr, value, false)) { AttributesPathAddressConfig<?> complexChildConfig = complexAttributes.get(attr); if (complexChildConfig == null) { ModelNode resolved = correctValue(op.get(attr), false); op.get(attr).set(resolved); } else { op.get(attr).set(complexChildConfig.correctOperation(operation.get(attr))); } } corrected = true; } if (corrected) { return op; } else { return operation; } }
Source:
<code>protected static ImmutableList<Ds3Property> convertAllProperties( final ImmutableList<Ds3Property> properties, final NameMapper nameMapper) { if (properties == null || properties.isEmpty()) { return properties; } <START> ImmutableList.Builder<Ds3Property> builder = ImmutableList.builder(); <END> for (final Ds3Property property : properties) { final Ds3Property convertedProperty = new Ds3Property( property.getName(), property.getValue(), convertName(property.getValueType(), nameMapper)); builder.add(convertedProperty); } return builder.build(); }</code><technical_language>Missing final</technical_language>

Target:
protected static ImmutableList<Ds3Property> convertAllProperties( final ImmutableList<Ds3Property> properties, final NameMapper nameMapper) { if (properties == null || properties.isEmpty()) { return properties; } final ImmutableList.Builder<Ds3Property> builder = ImmutableList.builder(); for (final Ds3Property property : properties) { final Ds3Property convertedProperty = new Ds3Property( property.getName(), property.getValue(), convertName(property.getValueType(), nameMapper)); builder.add(convertedProperty); } return builder.build(); }
Source:
<code>private void verifySameCourseDataStudent(CourseData actualCourse, CourseAttributes expectedCourse) { assertEquals(actualCourse.getCourseId(), expectedCourse.getId()); assertEquals(actualCourse.getCourseName(), expectedCourse.getName()); assertEquals(actualCourse.getCreationTimestamp(), 0); <START> if (expectedCourse.getDeletedAt() != null) { <END> assertEquals(actualCourse.getDeletionTimestamp(), 0); } assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); }</code><technical_language>This is unnecessary condition</technical_language>

Target:
private void verifySameCourseDataStudent(CourseData actualCourse, CourseAttributes expectedCourse) { assertEquals(actualCourse.getCourseId(), expectedCourse.getId()); assertEquals(actualCourse.getCourseName(), expectedCourse.getName()); assertEquals(actualCourse.getCreationTimestamp(), 0); assertEquals(actualCourse.getDeletionTimestamp(), 0); assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); }
Source:
<code><START> public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus hookStatus, <END> String template) { switch (hookStatus) { case DISABLED: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.DISABLED.toString(); case ENABLED: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.ENABLED.toString(); case MISSING: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.MISSING.toString(); default: return null; } }</code><technical_language>this mapping happen public enum mapping backend enum string</technical_language>

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus hookStatus, String template) { switch (hookStatus) { case DISABLED: return HookStatus.DISABLED.toString(); case ENABLED: return HookStatus.ENABLED.toString(); case MISSING: return HookStatus.MISSING.toString(); default: return null; } }
Source:
<code>public List<VDS> getFiltered(String filter) { <START> HttpMethod method = new GetMethod(hostProvider.getUrl() + "/api/hosts" + (filter.isEmpty()? StringUtils.EMPTY : "?&search=" + filter) + "&format=json"); <END> return runHostListMethod(method); }</code><technical_language>awesome some constants - for &search= &fornat=json /api/hosts Thanks</technical_language>

Target:
public List<VDS> getFiltered(String filter) { String url = hostProvider.getUrl() + HOSTS_ENTRY_POINT + String.format(SEARCH_QUERY_FORMAT, filter); HttpMethod method = new GetMethod(url); return runHostListMethod(method); }
Source:
<code>public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); VoltDB.instance().getStatsAgent().registerStatsSource( StatsSelector.IMPORTER, myHostId, statsCollector); m_self = em; em.initializeChannelDistributer(); <START> em.applyCatalogToImporters(catalogContext, false); <END> }</code><technical_language>Cleaner apply method returns bool if needs restart restart based it</technical_language>

Target:
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); VoltDB.instance().getStatsAgent().registerStatsSource( StatsSelector.IMPORTER, myHostId, statsCollector); m_self = em; em.create(catalogContext); }
Source:
<code>private void discoverHostName_SelectedItemChanged() { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + <START> (dhg.getDomainName() != null ? dhg.getDomainName() : "")); END> } updateModelFromVds(vds, null, false, null); }</code><technical_language>constants.empty() well</technical_language>

Target:
private void discoverHostName_SelectedItemChanged() { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + (dhg.getDomainName() != null ? dhg.getDomainName() : constants.empty())); } updateModelFromVds(vds, null, false, null); }
Source:
<code>public List<ERepositoryObjectType> getTypes() { List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>(); toReturn.add(ERepositoryObjectType.PROCESS_MR); toReturn.add(ERepositoryObjectType.PROCESS_STORM); <START> return toReturn; <END> }</code><technical_language>return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM) if needs modifiable - add new ArrayList<>(...)</technical_language>

Target:
public List<ERepositoryObjectType> getTypes() { return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM); }
Source:
<code>public Decision shouldReject( ResourceRef subject, ImmutableSet<EquivalenceGraph> existingGraphs, EquivalenceGraphUpdate graphUpdate ) { Decision decision = Decision.OK; if (shouldWarn(subject, graphUpdate)) { decision = Decision.WARN; } if (shouldReject(existingGraphs, graphUpdate)) { <START> decision = Decision.FAIL; <END> } return decision; }</code><technical_language>flip return early, no? I.e., default OK, check for FAIL, WARN</technical_language>

Target:
public Decision shouldReject( ResourceRef subject, ImmutableSet<EquivalenceGraph> existingGraphs, EquivalenceGraphUpdate graphUpdate ) { Decision decision = Decision.OK; ImmutableList<EquivalenceGraph> graphsOverWarningThreshold = getGraphsOverAlertingThreshold( subject, graphUpdate ); if (!graphsOverWarningThreshold.isEmpty()) { decision = Decision.WARN; } if (shouldReject(existingGraphs, graphUpdate)) { decision = Decision.FAIL; } return decision; }
Source:
<code>public void makeBucket(String bucketName, String region) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(MakeBucketArgs.newBuilder().bucket("my-bucketname").build()); this.makeBucket( MakeBucketArgs.newBuilder().bucket("my-bucketname").region("us-east-1").build()); this.makeBucket( MakeBucketArgs.newBuilder() .bucket("my-bucketname") .region("us-east-1") .objectLock(true) <START> .build()); <END> this.makeBucket(MakeBucketArgs.newBuilder().bucket(bucketName).region(region).build()); }</code><technical_language>Remove examples</technical_language>

Target:
public void makeBucket(String bucketName, String region) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(new MakeBucketArgs.Builder().bucket(bucketName).region(region).build()); }
Source:
<code>public void tearDown() <START> throws Exception { <END> setFixture(null); }</code><technical_language>necessary. quality rule : MITRE, CWE-397 - Declaration of Throws for Generic Exception</technical_language>

Target:
public void tearDown(){ setFixture(null); }
Source:
<code>protected Map<String, String> buildReplacements() throws ConfigException { <START> ConfigPropertiesUtil configUtil = new ConfigPropertiesUtil(); <END> Map<String, String> replacements = new HashMap<>(); Properties properties = configUtil.getConfigProperties(); Enumeration e = properties.propertyNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); replacements.put(key, properties.getProperty(key)); } return replacements; }</code><technical_language>I pattern is Guice for dependency injection, invoke new in a method</technical_language>

Target:
protected Map<String, String> buildReplacements() throws ConfigException { Map<String, String> replacements = new HashMap<>(); Properties properties = _service.getConfigProperties(); if ( properties != null ) { Enumeration e = properties.propertyNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); replacements.put(key, properties.getProperty(key)); } } return replacements; }
Source:
<code>public final void initialize(final URL location, final ResourceBundle resources) { hide(); listItems = FXCollections.observableArrayList(); filteredItems = new FilteredList<AbstractBookmark>(listItems); bookmarkList.setItems(filteredItems); <START> bookmarkList.setCellFactory(new Callback<ListView<AbstractBookmark>, <END> ListCell<AbstractBookmark>>() { @Override public ListCell<AbstractBookmark> call( final ListView<AbstractBookmark> param) { final ListCell<AbstractBookmark> cell = new ListCell<AbstractBookmark>() { public void updateItem(final AbstractBookmark item, final boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.toCellString()); setOnMouseClicked(event -> { if (event.getClickCount() == 2) { shout(Message.GOTO, "" , Long.valueOf(item.getUnifiedPosition())); } }); } } }; return cell; } }); initListeners(); }</code><technical_language>anonymous class for Callback replaced a lambda code more readable bulky</technical_language>

Target:
public final void initialize(final URL location, final ResourceBundle resources) { setVisibility(false); listItems = FXCollections.observableArrayList(); filteredItems = new FilteredList<AbstractBookmark>(listItems); bookmarkList.setItems(filteredItems); bookmarkList.setCellFactory(param -> { final ListCell<AbstractBookmark> cell = new ListCell<AbstractBookmark>() { public void updateItem(final AbstractBookmark item, final boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.toCellString()); setOnMouseClicked(event -> { if (event.getClickCount() == 2) { shout(Message.GOTO, "" , Long.valueOf(item.getUnifiedPosition())); } }); } } }; return cell; }); initListeners(); }
Source:
<code>protected void readHeader(XmlNode header) { super.readHeader(header); <START> version = header != null ? header.attributes.get("ovf:version").getValue() : ""; <END> }</code><technical_language>a setter for this</technical_language>

Target:
protected void readHeader(XmlNode header) { super.readHeader(header); setVersion(header != null ? header.attributes.get("ovf:version").getValue() : ""); }
Source:
<code>public void dispose() { mDestroyed.set(true); <START> auth_rsp = new IccIoResult(0x6F, 0, (byte[]) null); <END> synchronized (mLock) { mLock.notifyAll(); } mParentApp = null; mFh = null; mCi = null; mContext = null; }</code><technical_language>Change this null instead add auth_rsp != null check in getIccSimChallengeResponse(). function return null if auth_rsp is null</technical_language>

Target:
public void dispose() { mDestroyed.set(true); auth_rsp = null; synchronized (mLock) { mLock.notifyAll(); } mParentApp = null; mFh = null; mCi = null; mContext = null; }
Source:
<code>public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); try { File stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); File stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } String freezeOutput = IOUtils.toString(new FileInputStream(stdoutFile)); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipkernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } LOGGER.info("IPython prerequisite is meet"); } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); } return ""; <START> } <END></code><technical_language>if exception return a generic error string here</technical_language>

Target:
public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); try { File stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); File stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } String freezeOutput = IOUtils.toString(new FileInputStream(stdoutFile)); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipkernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } LOGGER.info("IPython prerequisite is meet"); } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); return "Fail to checkIPythonPrerequisite: " + ExceptionUtils.getStackTrace(e); } return ""; }
Source:
<code>public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { FeedbackContributionResponseDetails frd = (FeedbackContributionResponseDetails) existingResponseDetails; int points = frd.getAnswer(); String optionSelectFragmentsHtml = getContributionOptionsHtml(points); return Templates.populateTemplate( FormTemplates.CONTRIB_SUBMISSION_FORM, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CONTRIB_SELECT_FRAGMENTS_HTML, optionSelectFragmentsHtml, "${equalShareHelp}", responseIdx == 0 ? "<span class=\"glyphicon glyphicon-info-sign\"></span>" + " More info about the equal share scale" <START> : ""); <END> }</code><technical_language>lines of code in this class, extract out responseIdx == 0 onwards a separate method. This helps avoid "custom indentation" problem</technical_language>

Target:
public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { FeedbackContributionResponseDetails frd = (FeedbackContributionResponseDetails) existingResponseDetails; int points = frd.getAnswer(); String optionSelectFragmentsHtml = getContributionOptionsHtml(points); return Templates.populateTemplate( FormTemplates.CONTRIB_SUBMISSION_FORM, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CONTRIB_SELECT_FRAGMENTS_HTML, optionSelectFragmentsHtml, Slots.CONTRIB_EQUAL_SHARE_HELP, getEqualShareHelpLinkIfNeeded(responseIdx)); }