auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Graph importJob(JobInstance job, final String baseUri) throws GoIntegrationException { <START> LOGGER.debug("Attempting to import job " + job); <END> JobXmlViewModel xmlModel = new JobXmlViewModel(job); Graph jobGraph = rdfizer.importURIUsingGRDDL(xmlModel, baseUri); URIReference jobURI = jobGraph.getURIReference(xmlModel.httpUrl(baseUri)); importArtifactsForJob(jobURI, jobGraph); LOGGER.debug("Done building jobs graph with " + jobGraph.size() + " triples"); return jobGraph; }</code><technical_language>change</technical_language>

Target:
public Graph importJob(JobInstance job, final String baseUri) throws GoIntegrationException { LOGGER.debug("Attempting to import job {}", job); JobXmlViewModel xmlModel = new JobXmlViewModel(job); Graph jobGraph = rdfizer.importURIUsingGRDDL(xmlModel, baseUri); URIReference jobURI = jobGraph.getURIReference(xmlModel.httpUrl(baseUri)); importArtifactsForJob(jobURI, jobGraph); LOGGER.debug("Done building jobs graph with triples", jobGraph.size()); return jobGraph; }
Source:
<code>private void logValue(final Bytes key, final BufferKey bufferKey, final BufferValue value) { final byte[] serializedBufferValue = value.serialize(); final int sizeOfBufferTime = Long.BYTES; <START> final int sizeOfBufferValue = serializedBufferValue.length; <END> final byte[] timeAndBufferValue = ByteBuffer.wrap(new byte[sizeOfBufferTime + sizeOfBufferValue]) .putLong(bufferKey.time()) .put(serializedBufferValue) .array(); collector.send( changelogTopic, key, timeAndBufferValue, V_2_CHANGELOG_HEADERS, partition, null, KEY_SERIALIZER, VALUE_SERIALIZER ); }</code><technical_language>I this is introduced in this PR, consider allocating buffer multiple times (here allocate times, in levels of object's serialize() function)</technical_language>

Target:
private void logValue(final Bytes key, final BufferKey bufferKey, final BufferValue value) { final int sizeOfBufferTime = Long.BYTES; final ByteBuffer buffer = value.serialize(sizeOfBufferTime); buffer.putLong(bufferKey.time()); collector.send( changelogTopic, key, buffer.array(), V_2_CHANGELOG_HEADERS, partition, null, KEY_SERIALIZER, VALUE_SERIALIZER ); }
Source:
<code>private void addPresentationMetaProperties() { StaticListClass displayTypeClass = new StaticListClass(this); displayTypeClass.setName("displayType"); displayTypeClass.setPrettyName("Display Type"); displayTypeClass.setValues("input|select|radio|checkbox"); safeput(displayTypeClass.getName(), displayTypeClass); BooleanClass multiSelectClass = newCheckBox(false); multiSelectClass.setName("multiSelect"); multiSelectClass.setPrettyName("Multiple Select"); safeput(multiSelectClass.getName(), multiSelectClass); BooleanClass pickerClass = newCheckBox(true); pickerClass.setName("picker"); pickerClass.setPrettyName("Use Suggest"); safeput(pickerClass.getName(), pickerClass); NumberClass sizeClass = new NumberClass(this); sizeClass.setName("size"); sizeClass.setPrettyName("Size"); sizeClass.setSize(5); sizeClass.setNumberType("integer"); safeput(sizeClass.getName(), sizeClass); addValueSeparatorMetaProperties(); StaticListClass sortClass = new StaticListClass(this); sortClass.setName("sort"); sortClass.setPrettyName("Sort"); sortClass.setValues("none|id|value"); safeput(sortClass.getName(), sortClass); StaticListClass freeTextClass = new StaticListClass(this); freeTextClass.setName("freeText"); freeTextClass.setPrettyName("Free text"); <START> freeTextClass.setValues("forbidden|discouraged|allowed"); <END> safeput(freeTextClass.getName(), freeTextClass); }</code><technical_language>I guess this means default for a new class (or editing class) is forbidden. Problem is I understand this is null behavior more discouraged</technical_language>

Target:
private void addPresentationMetaProperties() { StaticListClass displayTypeClass = new StaticListClass(this); displayTypeClass.setName("displayType"); displayTypeClass.setPrettyName("Display Type"); displayTypeClass.setValues("input|select|radio|checkbox"); safeput(displayTypeClass.getName(), displayTypeClass); BooleanClass multiSelectClass = newCheckBox(false); multiSelectClass.setName("multiSelect"); multiSelectClass.setPrettyName("Multiple Select"); safeput(multiSelectClass.getName(), multiSelectClass); BooleanClass pickerClass = newCheckBox(true); pickerClass.setName("picker"); pickerClass.setPrettyName("Use Suggest"); safeput(pickerClass.getName(), pickerClass); NumberClass sizeClass = new NumberClass(this); sizeClass.setName("size"); sizeClass.setPrettyName("Size"); sizeClass.setSize(5); sizeClass.setNumberType("integer"); safeput(sizeClass.getName(), sizeClass); addValueSeparatorMetaProperties(); StaticListClass sortClass = new StaticListClass(this); sortClass.setName("sort"); sortClass.setPrettyName("Sort"); sortClass.setValues("none|id|value"); safeput(sortClass.getName(), sortClass); StaticListClass freeTextClass = new StaticListClass(this); freeTextClass.setName("freeText"); freeTextClass.setPrettyName("Free text"); freeTextClass.setValues("discouraged|forbidden|allowed"); safeput(freeTextClass.getName(), freeTextClass); }
Source:
<code>private void refreshToplevelIcons() { findPreference("shareapp_package").setSummary(getPreferenceManager().getSharedPreferences().getString("shareapp_package", "")); <START> findPreference("pref_category_ui").setIcon(Utils.IconicsIcon(getActivity(), "cmd_monitor")); <END> findPreference("pref_category_interaction").setIcon(Utils.IconicsIcon(getContext(), "cmd_gesture_tap")); findPreference("pref_category_player").setIcon(Utils.IconicsIcon(getContext(), "cmd_play")); findPreference("pref_category_alarm").setIcon(Utils.IconicsIcon(getContext(), "cmd_clock_outline")); findPreference("pref_category_connectivity").setIcon(Utils.IconicsIcon(getContext(), "gmd_import_export")); findPreference("pref_category_recordings").setIcon(Utils.IconicsIcon(getContext(), "cmd_record_rec")); findPreference("pref_category_mpd").setIcon(Utils.IconicsIcon(getContext(), "cmd_speaker_wireless")); findPreference("pref_category_other").setIcon(Utils.IconicsIcon(getContext(), "cmd_information_outline")); }</code><technical_language>enum CommunityMaterial.Icon2.cmd_monitorand hardcoded strings</technical_language>

Target:
private void refreshToplevelIcons() { findPreference("shareapp_package").setSummary(getPreferenceManager().getSharedPreferences().getString("shareapp_package", "")); findPreference("pref_category_ui").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon2.cmd_monitor)); findPreference("pref_category_interaction").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon.cmd_gesture_tap)); findPreference("pref_category_player").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon2.cmd_play)); findPreference("pref_category_alarm").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon.cmd_clock_outline)); findPreference("pref_category_connectivity").setIcon(Utils.IconicsIcon(getContext(), GoogleMaterial.Icon.gmd_import_export)); findPreference("pref_category_recordings").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon2.cmd_record_rec)); findPreference("pref_category_mpd").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon2.cmd_speaker_wireless)); findPreference("pref_category_other").setIcon(Utils.IconicsIcon(getContext(), CommunityMaterial.Icon2.cmd_information_outline)); }
Source:
<code>public synchronized boolean hasNext() { if (cachedNext != null) { return true; } <START> if (!pageStore.isPagingDirtyRead()) { <END> return false; } cachedNext = next(); return cachedNext != null; }</code><technical_language>Concern is this ins't async case. Btw i change in QueueImpl: checkDepage new paging dirty read</technical_language>

Target:
public synchronized boolean hasNext() { if (cachedNext != null) { return true; } if (!pageStore.isPaging()) { return false; } cachedNext = next(); return cachedNext != null; }
Source:
<code>private GraphicsDevice getCompatibleGraphics(VmDeviceType videoDeviceType) { if (videoDeviceType == null) { return null; } GraphicsDevice graphicsDevice = null; GraphicsType compatibleType = null; <START> for (Pair<GraphicsType, DisplayType> graphicsDisplayPair : osRepository.getGraphicsAndDisplays().get(getVm().getStaticData().getOsId()).get(getVdsGroup().getcompatibility_version())) { <END> if (graphicsDisplayPair.getSecond().getDefaultVmDeviceType() == videoDeviceType) { compatibleType = graphicsDisplayPair.getFirst(); } } if (compatibleType != null) { graphicsDevice = new GraphicsDevice(compatibleType.getCorrespondingDeviceType()); graphicsDevice.setId(new VmDeviceId(Guid.newGuid(), getVmId())); } return graphicsDevice; }</code><technical_language>getVdsGroup() null</technical_language>

Target:
private GraphicsDevice getCompatibleGraphics(VmDeviceType videoDeviceType) { if (videoDeviceType == null || getVdsGroup() == null) { return null; } GraphicsDevice graphicsDevice = null; GraphicsType compatibleType = null; for (Pair<GraphicsType, DisplayType> graphicsDisplayPair : osRepository.getGraphicsAndDisplays().get(getVm().getStaticData().getOsId()).get(getVdsGroup().getcompatibility_version())) { if (graphicsDisplayPair.getSecond().getDefaultVmDeviceType() == videoDeviceType) { compatibleType = graphicsDisplayPair.getFirst(); } } if (compatibleType != null) { graphicsDevice = new GraphicsDevice(compatibleType.getCorrespondingDeviceType()); graphicsDevice.setId(new VmDeviceId(Guid.newGuid(), getVmId())); } return graphicsDevice; }
Source:
<code>private StatementStats execute(ClientSession session, String query, Consumer<QueryData> queryDataConsumer, Consumer<QueryError> queryErrorConsumer) { StatementClient client = new StatementClient(okHttpClient, session, query); while (client.isValid() && client.advance()) { QueryData queryData = client.currentData(); if (queryData != null) { <START> queryDataConsumer.accept(queryData); <END> } } if (client.isClosed()) { throw new IllegalStateException("Query aborted by user"); } if (client.isGone()) { throw new IllegalStateException("Query is gone (server restarted?)"); } QueryError resultsError = client.finalStatusInfo().getError(); if (resultsError != null) { queryErrorConsumer.accept(resultsError); } return client.finalStatusInfo().getStats(); }</code><technical_language>consumer notified if data is null? actually? error happened. empty result set. queryData==null resutlError==null mutually exclusive</technical_language>

Target:
private StatementStats execute(ClientSession session, String query, Consumer<QueryData> queryDataConsumer, Consumer<QueryError> queryErrorConsumer) { try (StatementClient client = new StatementClient(okHttpClient, session, query)) { while (client.isValid() && client.advance()) { queryDataConsumer.accept(client.currentData()); } if (client.isClosed()) { throw new IllegalStateException("Query aborted by user"); } if (client.isGone()) { throw new IllegalStateException("Query is gone (server restarted?)"); } QueryError resultsError = client.finalStatusInfo().getError(); if (resultsError != null) { queryErrorConsumer.accept(resultsError); } return client.finalStatusInfo().getStats(); } }
Source:
<code>public String toString() { <START> return "(" + profile + "," + authz + ")"; END> }</code><technical_language>better: authz (profile, profile, profile) this requires more logic... compromise... :) profile (authz)</technical_language>

Target:
public String toString() { return "profile (" + authz + ")"; }
Source:
<code>private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; List<IMethod> <START> rippleMethodsList= Arrays.asList(rippleMethods); <END> List<IMethod> filteredMethods= new ArrayList<>(rippleMethodsList.size()); for (Iterator<IMethod> iter= rippleMethodsList.iterator(); iter.hasNext(); ) { IMethod currentMethod= iter.next(); Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { fBinaryRefs.add((SearchMatch) match); } else { filteredMethods.add(currentMethod); } } fDeclarationToMatch= null; return filteredMethods.toArray(new IMethod[filteredMethods.size()]); }</code><technical_language>This is needed, foreach loop work original array code better</technical_language>

Target:
private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; List<IMethod> filteredMethods= new ArrayList<>(rippleMethods.length / 2); for (IMethod currentMethod : rippleMethods) { Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { fBinaryRefs.add((SearchMatch) match); } else { filteredMethods.add(currentMethod); } } fDeclarationToMatch= null; return filteredMethods.toArray(new IMethod[filteredMethods.size()]); }
Source:
<code>public void triggerMatchingJobs(String user, String url, String scm) { if ("git".equals(scm)) { SecurityContext old = Jenkins.getInstance().getACL().impersonate(ACL.SYSTEM); try { URIish remote = new URIish(url); for (Job<?,?> job : Hudson.getInstance().getAllItems(Job.class)) { BitBucketTrigger bTrigger = null; LOGGER.info("considering candidate job " + job.getName()); <START> ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) job; <END> if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { for (Trigger trigger : pJob.getTriggers().values()) { if (trigger instanceof BitBucketTrigger) { bTrigger = (BitBucketTrigger) trigger; break; } } } if (bTrigger != null) { LOGGER.info("Considering to poke " + job.getFullDisplayName()); SCMTriggerItem item = SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(job); for (SCM scmTrigger : item.getSCMs()) { if (match(scmTrigger, remote)) bTrigger.onPost(user); else LOGGER.info("job SCM doesn't match remote repo"); } } else LOGGER.info("job hasn't BitBucketTrigger set"); } } catch (URISyntaxException e) { LOGGER.warning("invalid repository URL " + url); } finally { SecurityContextHolder.setContext(old); } } else { throw new UnsupportedOperationException("unsupported SCM type " + scm); } }</code><technical_language>Unchecked cast. Please FindBugs create pull requests</technical_language>

Target:
public void triggerMatchingJobs(String user, String url, String scm) { if ("git".equals(scm)) { SecurityContext old = Jenkins.getInstance().getACL().impersonate(ACL.SYSTEM); try { URIish remote = new URIish(url); for (Job<?,?> job : Jenkins.getInstance().getAllItems(Job.class)) { BitBucketTrigger bTrigger = null; LOGGER.log(Level.FINE, "Considering candidate job {0}", job.getName()); if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) job; for (Trigger trigger : pJob.getTriggers().values()) { if (trigger instanceof BitBucketTrigger) { bTrigger = (BitBucketTrigger) trigger; break; } } } if (bTrigger != null) { LOGGER.log(Level.FINE, "Considering to poke {0}", job.getFullDisplayName()); SCMTriggerItem item = SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(job); for (SCM scmTrigger : item.getSCMs()) { if (match(scmTrigger, remote)) { LOGGER.log(Level.INFO, "Triggering BitBucket job {0}", job.getName()); bTrigger.onPost(user); } else LOGGER.log(Level.FINE, "{0} SCM doesn't match remote repo {1}", new Object[]{job.getName(), remote}); } } else LOGGER.log(Level.FINE, "{0} hasn't BitBucketTrigger set", job.getName()); } } catch (URISyntaxException e) { LOGGER.log(Level.WARNING, "Invalid repository URL {0}", url); } finally { SecurityContextHolder.setContext(old); } } else { throw new UnsupportedOperationException("Unsupported SCM type " + scm); } }
Source:
<code>public boolean equals(Object obj){ boolean result; if (obj == null) { result = false; } else { <START> User other = (User) obj; <END> result = macAddress.equals(other.getMacAddress()) && bluetoothID.equals(other.getBluetoothID()); } return result; }</code><technical_language>Needs a test for if obj instanceof User...if isnt, return false</technical_language>

Target:
public boolean equals(Object obj){ boolean result; if ((obj == null) || !(obj instanceof User)) { result = false; } else { User other = (User) obj; result = macAddress.equals(other.getMacAddress()) && bluetoothID.equals(other.getBluetoothID()); } return result; }
Source:
<code>private String extractBaseIdFromUri(Channel channel) { return channel.getUri() <START> .replace(uriPrefix, "") <END> .trim(); }</code><technical_language>URI a trailing '/' similar cruft</technical_language>

Target:
String extractBaseIdFromUri(Channel channel) { return channel.getUri() .replace(uriPrefix, "") .trim(); }
Source:
<code>public void sendTemplateToRecipientUrl(String url, String template) { PostMethod post = new PostMethod(url); try { post.setParameter("content-type", "application/xml"); HttpClient client = new HttpClient(); LOGGER.info("Sending template to URL: {}", url); int responseCode = client.executeMethod(post); LOGGER.info("Response code: {}", responseCode); LOGGER.info("Response body: {}", post.getResponseBodyAsString()); <START> } catch (ConnectException | HttpException e) { <END> LOGGER.error("Cannot connect with URL: {}", url); } catch (IOException e) { LOGGER.error("Cannot get body from response message. URL: {}", url); } }</code><technical_language>action fail a problem post request occurs, please throw this exceptions</technical_language>

Target:
public void sendTemplateToRecipientUrl(String url, String template) throws IOException { PostMethod post = new PostMethod(url); post.setRequestEntity(new StringRequestEntity(template, "application/xml", "utf-8")); HttpClient client = new HttpClient(); LOGGER.info("Sending template to URL: {}", url); int responseCode = client.executeMethod(post); LOGGER.info("Response code: {}", responseCode); }
Source:
<code>public void not_save_zero_coverage_sq_62() throws Exception { Settings newSettings = new Settings().setProperty(FORCE_ZERO_COVERAGE_KEY, "true"); context.setSettings(newSettings); utCoverageSensor.execute(context, linesOfCode, RUN_WITH_SQ_6_2); assertThat(context.lineHits("moduleKey:file1.js", CoverageType.UNIT, 1)).isNull(); newSettings.setProperty(JavaScriptPlugin.LCOV_UT_REPORT_PATH, "reports/report_ut.lcov"); context.setSettings(newSettings); itCoverageSensor.execute(context, linesOfCode, RUN_WITH_SQ_6_2); assertThat(context.lineHits("moduleKey:file1.js", CoverageType.IT, 1)).isNull(); overallCoverageSensor.execute(context, linesOfCode, RUN_WITH_SQ_6_2); <START> assertThat(context.lineHits("moduleKey:file1.js", CoverageType.OVERALL, 1)).isEqualTo(2); <END> }</code><technical_language>@vilchik-elena Why</technical_language>

Target:
public void not_save_zero_coverage_sq_62() throws Exception { Settings newSettings = new Settings().setProperty(FORCE_ZERO_COVERAGE_KEY, "true"); context.setSettings(newSettings); utCoverageSensor.execute(context, linesOfCode, RUN_WITH_SQ_6_2); assertThat(context.lineHits("moduleKey:file1.js", CoverageType.UNIT, 1)).isNull(); newSettings.setProperty(JavaScriptPlugin.LCOV_UT_REPORT_PATH, "reports/report_ut.lcov"); context.setSettings(newSettings); itCoverageSensor.execute(context, linesOfCode, RUN_WITH_SQ_6_2); assertThat(context.lineHits("moduleKey:file1.js", CoverageType.IT, 1)).isNull(); }
Source:
<code>private static KernelTransactions createTransactions( StorageEngine storageEngine, TransactionCommitProcess commitProcess, TransactionIdStore transactionIdStore, Tracers tracers, StatementLocksFactory statementLocksFactory, StatementOperationParts statementOperations, SystemNanoClock clock, AvailabilityGuard availabilityGuard ) { return new KernelTransactions( statementLocksFactory, null, statementOperations, null, DEFAULT, commitProcess, null, null, new TransactionHooks(), mock( TransactionMonitor.class ), availabilityGuard, tracers, storageEngine, new Procedures(), transactionIdStore, clock, new AtomicReference<>( CpuClock.NOT_AVAILABLE ), new AtomicReference<>( HeapAllocation.NOT_AVAILABLE ), new CanWrite(), DefaultCursors::new, AutoIndexing.UNSUPPORTED, mock( ExplicitIndexStore.class ), EmptyVersionContextSupplier.EMPTY, ON_HEAP, mock( ConstraintSemantics.class ), mock( SchemaState.class ), <START> mock( IndexingProvidersService.class) ); <END> }</code><technical_language>Auto formatting</technical_language>

Target:
private static KernelTransactions createTransactions( StorageEngine storageEngine, TransactionCommitProcess commitProcess, TransactionIdStore transactionIdStore, Tracers tracers, StatementLocksFactory statementLocksFactory, StatementOperationParts statementOperations, SystemNanoClock clock, AvailabilityGuard availabilityGuard ) { return new KernelTransactions( statementLocksFactory, null, statementOperations, null, DEFAULT, commitProcess, null, null, new TransactionHooks(), mock( TransactionMonitor.class ), availabilityGuard, tracers, storageEngine, new Procedures(), transactionIdStore, clock, new AtomicReference<>( CpuClock.NOT_AVAILABLE ), new AtomicReference<>( HeapAllocation.NOT_AVAILABLE ), new CanWrite(), DefaultCursors::new, AutoIndexing.UNSUPPORTED, mock( ExplicitIndexStore.class ), EmptyVersionContextSupplier.EMPTY, ON_HEAP, mock( ConstraintSemantics.class ), mock( SchemaState.class ), mock( IndexingProvidersService.class), mock( PropertyKeyTokenHolder.class ) ); }
Source:
<code>public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { int viewType = getItemViewType(position); <START> if (viewType == VIEW_TYPE_HEADER) { <END> } else if (viewType == VIEW_TYPE_INPUT) { final InputViewHolder inputViewHolder = (InputViewHolder) holder; inputViewHolder.progressBar.setVisibility(mIsLoading ? View.VISIBLE : View.GONE); if (inputViewHolder.input.getTag() == null) { inputViewHolder.input.setText(mKeywords); inputViewHolder.input.setTag(Boolean.TRUE); inputViewHolder.input.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(final Editable editable) { mDebouncer.debounce(Void.class, new Runnable() { @Override public void run() { mOnAdapterListener.onKeywordsChange(editable.toString()); } }, 400, TimeUnit.MILLISECONDS); } }); } } else { final DomainSuggestionResponse suggestion = getItem(position); final DomainViewHolder domainViewHolder = (DomainViewHolder) holder; domainViewHolder.radioButton.setChecked(suggestion.equals(mSelectedDomain)); domainViewHolder.textView.setText(suggestion.domain_name); View.OnClickListener clickListener = new View.OnClickListener() { @Override public void onClick(View view) { if (!suggestion.equals(mSelectedDomain)) { mSelectedDomain = suggestion; notifyDataSetChanged(); mOnAdapterListener.onSelectionChange(mSelectedDomain.domain_name); } } }; holder.itemView.setOnClickListener(clickListener); domainViewHolder.radioButton.setOnClickListener(clickListener); } }</code><technical_language>This is another case for a switch statement</technical_language>

Target:
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { int viewType = getItemViewType(position); switch (viewType) { case VIEW_TYPE_INPUT: bindInput((InputViewHolder) holder); break; case VIEW_TYPE_ITEM: bindSuggest((DomainViewHolder) holder, position); break; } }
Source:
<code>public <T> T loadFiles(Class<T> type, List<File> files, List<String> resources) { if (files == null) { return loadResources(type, resources); } Config config = null; for (File file : files) { if (config == null) { config = ConfigFactory.parseFile(file, ConfigParseOptions.defaults().setAllowMissing(false)); } else { config = config.withFallback(ConfigFactory.parseFile(file, ConfigParseOptions.defaults().setAllowMissing(false))); } } for (String resource : resources) { if (config == null) { config = ConfigFactory.load(classLoader, resource); } else { config = config.withFallback(ConfigFactory.load(classLoader, resource)); } } <START> return map(Objects.requireNonNull(config).resolve(), type); <END> }</code><technical_language>I Preconditions.checkNotNull for consistency</technical_language>

Target:
public <T> T loadFiles(Class<T> type, List<File> files, List<String> resources) { if (files == null) { return loadResources(type, resources); } Config config = null; for (File file : files) { if (config == null) { config = ConfigFactory.parseFile(file, ConfigParseOptions.defaults().setAllowMissing(false)); } else { config = config.withFallback(ConfigFactory.parseFile(file, ConfigParseOptions.defaults().setAllowMissing(false))); } } for (String resource : resources) { if (config == null) { config = ConfigFactory.load(classLoader, resource); } else { config = config.withFallback(ConfigFactory.load(classLoader, resource)); } } return map(checkNotNull(config, "config cannot be null").resolve(), type); }
Source:
<code>public Attribute getAttributeValue(PerunSessionImpl sess, User user, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); String url = "<LINK_0>"; try { <START> Attribute attributeDef = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":elixirBonaFideStatusREMS"); <END> String attrDefValue = (String) attributeDef.getValue(); if (attrDefValue != null && !attrDefValue.isEmpty()) { attribute.setValue(attrDefValue); } else { Attribute uesAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_VIRT + ":eduPersonScopedAffiliations"); List<String> affiliations = (List<String>)uesAttribute.getValue(); for (String affiliation : affiliations) { if (affiliation != null && affiliation.startsWith("faculty@")) { attribute.setValue(url); break; } } } } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { log.error("Cannot read elixirBonaFideStatusREMS from user " + user.getId(), e); } return attribute; }</code><technical_language>Please do "attributeDef" name, "attributeDefinition" object AttributeDefinition is Attribute template value</technical_language>

Target:
public Attribute getAttributeValue(PerunSessionImpl sess, User user, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); try { Attribute statusAttr = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":" + USER_REMS_ATTR_NAME); String statusAttrValue = (String) statusAttr.getValue(); if (statusAttrValue != null && !statusAttrValue.isEmpty()) { attribute.setValue(URL); } } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { log.error("Cannot read from user {}", USER_REMS_ATTR_NAME, user, e); } if (attribute.getValue() == null) { try { Attribute userAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_VIRT + ":" + USER_AFFILIATIONS_ATTR_NAME); if (userAttribute.getValue() != null) { List<String> affiliations = (List<String>) userAttribute.getValue(); for (String affiliation : affiliations) { if (affiliation != null && affiliation.startsWith("faculty@")) { attribute.setValue(URL); break; } } } } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { log.error("Cannot read from user {}", USER_AFFILIATIONS_ATTR_NAME, user, e); } } return attribute; }
Source:
<code>public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters().getCommandStep(), getParameters().getChildCommands()); Guid currentChildId = getCurrentChildId(getParameters().getCommandStep(), getParameters().getChildCommands()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Executing Cold Merge command step '{}'", getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: nextCommand = new Pair<>(VdcActionType.PrepareMerge, <START> buildColdMergeParameters(getImageId(), getDestinationImageId())); <END> getParameters().setNextCommandStep(RemoveSnapshotSingleDiskStep.MERGE); break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; case COMPLETE: getParameters().setDestroyImageCommandComplete(true); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommand(getParameters().getParentCommand(), true); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }</code><technical_language>fit previous line</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { log.info("Executing Cold Merge command step '{}'", getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: nextCommand = new Pair<>(VdcActionType.PrepareMerge, buildColdMergeParameters(getImageId(), getDestinationImageId())); getParameters().setNextCommandStep(RemoveSnapshotSingleDiskStep.MERGE); break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; case COMPLETE: getParameters().setDestroyImageCommandComplete(true); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommand(getParameters().getParentCommand(), true); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
<code>public void testCreateExternalGoogleCloudFileHandleFromExistingFile() throws Exception { Assume.assumeTrue(config.getGoogleCloudEnabled()); assertNotNull(imageFile); assertTrue(imageFile.exists()); String md5 = MD5ChecksumHelper.getMD5Checksum(imageFile); String baseKey = "integration-test/IT049FileHandleTest/testCreateExternalGoogleCloudFileHandleFromExistingFile/" + UUID.randomUUID().toString(); String key = baseKey + FILE_NAME; uploadOwnerTxtToGoogleCloud(googleCloudBucket, baseKey, synapse.getUserProfile(userToDelete.toString()).getUserName()); googleCloudStorageClient.putObject(googleCloudBucket, key, imageFile); <START> <END> ExternalGoogleCloudStorageLocationSetting storageLocationSetting = new ExternalGoogleCloudStorageLocationSetting(); storageLocationSetting.setBucket(googleCloudBucket); storageLocationSetting.setBaseKey(baseKey); storageLocationSetting.setUploadType(UploadType.GOOGLECLOUDSTORAGE); storageLocationSetting = synapse.createStorageLocationSetting(storageLocationSetting); GoogleCloudFileHandle fh = new GoogleCloudFileHandle(); fh.setStorageLocationId(storageLocationSetting.getStorageLocationId()); fh.setBucketName(googleCloudBucket); fh.setKey(key); fh.setContentMd5(md5); GoogleCloudFileHandle result = synapse.createExternalGoogleCloudFileHandle(fh); assertNotNull(result); toDelete.add(result); assertNotNull(result.getFileName()); }</code><technical_language>wait for object</technical_language>

Target:
public void testCreateExternalGoogleCloudFileHandleFromExistingFile() throws Exception { Assume.assumeTrue(config.getGoogleCloudEnabled()); assertNotNull(imageFile); assertTrue(imageFile.exists()); String md5 = MD5ChecksumHelper.getMD5Checksum(imageFile); String baseKey = "integration-test/IT049FileHandleTest/testCreateExternalGoogleCloudFileHandleFromExistingFile/" + UUID.randomUUID().toString(); String key = baseKey + FILE_NAME; uploadOwnerTxtToGoogleCloud(googleCloudBucket, baseKey, synapse.getUserProfile(userToDelete.toString()).getUserName()); putToGoogleCloudWaitForConsistency(googleCloudBucket, key, imageFile); ExternalGoogleCloudStorageLocationSetting storageLocationSetting = new ExternalGoogleCloudStorageLocationSetting(); storageLocationSetting.setBucket(googleCloudBucket); storageLocationSetting.setBaseKey(baseKey); storageLocationSetting.setUploadType(UploadType.GOOGLECLOUDSTORAGE); storageLocationSetting = synapse.createStorageLocationSetting(storageLocationSetting); GoogleCloudFileHandle fh = new GoogleCloudFileHandle(); fh.setStorageLocationId(storageLocationSetting.getStorageLocationId()); fh.setBucketName(googleCloudBucket); fh.setKey(key); fh.setContentMd5(md5); GoogleCloudFileHandle result = synapse.createExternalGoogleCloudFileHandle(fh); assertNotNull(result); toDelete.add(result); assertNotNull(result.getFileName()); }
Source:
<code>private DiscoveryService providesDiscoveryService(final ZKClientService zkClient, final ZKDiscoveryService delegate) { return new DiscoveryService() { @Override public Cancellable register(Discoverable discoverable) { <START> zkClient.startAndWait(); <END> return delegate.register(discoverable); } }; }</code><technical_language>isRunning() method in ZKClientService</technical_language>

Target:
private DiscoveryService providesDiscoveryService(final ZKClientService zkClient, final ZKDiscoveryService delegate) { return new DiscoveryService() { @Override public Cancellable register(Discoverable discoverable) { if (!zkClient.isRunning()) { zkClient.startAndWait(); } return delegate.register(discoverable); } }; }
Source:
<code><START> public SolrInputDocument makeContainerDocument(PID pid, String title, ResourceType type, PID... ancestors) { <END> SolrInputDocument newDoc = new SolrInputDocument(); newDoc.addField("title", title); newDoc.addField("id", pid.getPid()); newDoc.addField("rollup", pid.getPid()); newDoc.addField("ancestorIds", makeAncestorIds(pid, ancestors)); newDoc.addField("ancestorPath", makeAncestorPath(ancestors)); newDoc.addField("resourceType", type.name()); return newDoc; }</code><technical_language>is this method (and following) public</technical_language>

Target:
private SolrInputDocument makeContainerDocument(PID pid, String title, ResourceType type, PID... ancestors) { SolrInputDocument newDoc = new SolrInputDocument(); newDoc.addField("title", title); newDoc.addField("id", pid.getPid()); newDoc.addField("rollup", pid.getPid()); newDoc.addField("ancestorIds", makeAncestorIds(pid, ancestors)); newDoc.addField("ancestorPath", makeAncestorPath(ancestors)); newDoc.addField("resourceType", type.name()); return newDoc; }
Source:
<code>public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) { try { super.initialize(keyClass, persistentClass, properties); this.conf = HBaseConfiguration.create(getConf()); admin = new HBaseAdmin(this.conf); mapping = readMapping(getConf().get(PARSE_MAPPING_FILE_KEY, DEFAULT_MAPPING_FILE)); filterUtil = new HBaseFilterUtil<>(this.conf); } catch (FileNotFoundException ex) { <START> LOG.error(DEFAULT_MAPPING_FILE + " is not found, please check the file."); <END> throw new RuntimeException(ex); } catch (Exception e) { throw new RuntimeException(e); } try { this.setScannerCaching( Integer.valueOf(DataStoreFactory.findProperty(this.properties, this, SCANNER_CACHING_PROPERTIES_KEY, String.valueOf(SCANNER_CACHING_PROPERTIES_DEFAULT)))) ; }catch(Exception e){ LOG.error("Can not load " + SCANNER_CACHING_PROPERTIES_KEY + " from gora.properties. Setting to default value: " + SCANNER_CACHING_PROPERTIES_DEFAULT, e) ; this.setScannerCaching(SCANNER_CACHING_PROPERTIES_DEFAULT) ; } if(autoCreateSchema) { createSchema(); } try{ boolean autoflush = this.conf.getBoolean("hbase.client.autoflush.default", false); table = new HBaseTableConnection(getConf(), getSchemaName(), autoflush); } catch(IOException ex2){ LOG.error(ex2.getMessage(), ex2); } }</code><technical_language>please paramaterized slf4j logging notation here? e.g. + LOG.error("{} is found, please check file.", DEFAULT_MAPPING_FILE);</technical_language>

Target:
public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) { try { super.initialize(keyClass, persistentClass, properties); this.conf = HBaseConfiguration.create(getConf()); admin = new HBaseAdmin(this.conf); mapping = readMapping(getConf().get(PARSE_MAPPING_FILE_KEY, DEFAULT_MAPPING_FILE)); filterUtil = new HBaseFilterUtil<>(this.conf); } catch (FileNotFoundException ex) { LOG.error("{} is not found, please check the file.", DEFAULT_MAPPING_FILE); throw new RuntimeException(ex); } catch (Exception e) { throw new RuntimeException(e); } try { this.setScannerCaching( Integer.valueOf(DataStoreFactory.findProperty(this.properties, this, SCANNER_CACHING_PROPERTIES_KEY, String.valueOf(SCANNER_CACHING_PROPERTIES_DEFAULT)))) ; }catch(Exception e){ LOG.error("Can not load " + SCANNER_CACHING_PROPERTIES_KEY + " from gora.properties. Setting to default value: " + SCANNER_CACHING_PROPERTIES_DEFAULT, e) ; this.setScannerCaching(SCANNER_CACHING_PROPERTIES_DEFAULT) ; } if(autoCreateSchema) { createSchema(); } try{ boolean autoflush = this.conf.getBoolean("hbase.client.autoflush.default", false); table = new HBaseTableConnection(getConf(), getSchemaName(), autoflush); } catch(IOException ex2){ LOG.error(ex2.getMessage(), ex2); } }
Source:
<code>protected Optional<VirtualFile> findChildInDirectory(VirtualFile parent, String name) { try { SmbFile parentFile = parent.tryAs(SmbFile.class) .orElseThrow(() -> new IllegalArgumentException(Strings.apply( <START> "Invalid parent: %s! Expecte a SmbFile!", <END> parent))); SmbFile child = new SmbFile(parentFile, name); if (child.isDirectory()) { return Optional.of(wrapSmbFile(parent, new SmbFile(parentFile, name + "/"))); } return Optional.of(wrapSmbFile(parent, child)); } catch (Exception e) { throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 3/CIFS: Cannot resolve file: %s in parent: %s - %s (%s)", name, parent) .handle(); } }</code><technical_language>suggestion "Invalid parent: %s! Expected a SmbFile!",</technical_language>

Target:
protected Optional<VirtualFile> findChildInDirectory(VirtualFile parent, String name) { try { SmbFile parentFile = parent.tryAs(SmbFile.class) .orElseThrow(() -> new IllegalArgumentException(Strings.apply( "Invalid parent: %s! Expected a SmbFile!", parent))); SmbFile child = new SmbFile(parentFile, name); if (child.isDirectory()) { return Optional.of(wrapSmbFile(parent, new SmbFile(parentFile, name + "/"))); } return Optional.of(wrapSmbFile(parent, child)); } catch (Exception e) { throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 3/CIFS: Cannot resolve file: %s in parent: %s - %s (%s)", name, parent) .handle(); } }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!GlusterUtil.getInstance().isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } if (getDbFacade().getGlusterVolumeSnapshotDao().getByName(getGlusterVolumeId(), snapshot.getSnapshotName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_ALREADY_EXISTS); } List<GlusterBrickEntity> bricks = volume.getBricks(); for (GlusterBrickEntity brick : bricks) { if <START> (brick.getStatus() == GlusterStatus.DOWN) { <END> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } for (GlusterGeoRepSession session : georepSessions) { if (session.getSlaveNodeUuid() == null || session.getSlaveVolumeId() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE); } } return true; }</code><technical_language>1. need disable brick status is UNKNOWN. brick.isOnline() used. 2. Do need bricks in case of replicated volume</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!GlusterUtil.getInstance().isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } if (getDbFacade().getGlusterVolumeSnapshotDao().getByName(getGlusterVolumeId(), snapshot.getSnapshotName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_ALREADY_EXISTS); } List<GlusterBrickEntity> bricks = volume.getBricks(); for (GlusterBrickEntity brick : bricks) { if (!brick.isOnline()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } for (GlusterGeoRepSession session : georepSessions) { if (session.getSlaveNodeUuid() == null || session.getSlaveVolumeId() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE); } } return true; }
Source:
<code>private static SchemaTableName parseTableName(String schemaTableName) { <START> checkArgument(!isNullOrEmpty(schemaTableName), "schemaTableName is null or is empty"); <END> List<String> parts = Splitter.on('.').splitToList(schemaTableName); checkArgument(parts.size() == 2, "Invalid schemaTableName: %s", schemaTableName); return new SchemaTableName(parts.get(0), parts.get(1)); }</code><technical_language>nit: is null is empty -> is null empty</technical_language>

Target:
private static SchemaTableName parseTableName(String schemaTableName) { checkArgument(!isNullOrEmpty(schemaTableName), "schemaTableName is null or empty"); List<String> parts = Splitter.on('.').splitToList(schemaTableName); verify(parts.size() == 2, "Invalid schemaTableName: %s", schemaTableName); return new SchemaTableName(parts.get(0), parts.get(1)); }
Source:
<code>public void cleanup() { <START> long start = System.currentTimeMillis(); <END> System.out.println("About to invoke cluster.cleanup()"); if (plaintextCluster != null) { plaintextCluster.cleanup(); } System.out.println("cluster.cleanup() took " + (System.currentTimeMillis() - start) + " ms."); }</code><technical_language>I this is before, in tests do notice this? If not, remove this</technical_language>

Target:
public void cleanup() throws IOException { long start = System.currentTimeMillis(); System.out.println("About to invoke cluster.cleanup()"); if (plaintextCluster != null) { plaintextCluster.cleanup(); } System.out.println("cluster.cleanup() took " + (System.currentTimeMillis() - start) + " ms."); }
Source:
<code>public T signalNext() throws InterruptedException { T element = nextT(); <START> return signalNext(element); <END> }</code><technical_language>return signalNext(nextT())</technical_language>

Target:
public T signalNext() throws InterruptedException { return signalNext(nextT()); }
Source:
<code>public void generatedInterfaceHasDelegateMethod() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = extractNonStaticMethods(GenericsTester.class); <START> generatedMethods.removeAll(originalMethods); <END> assertThat(generatedMethods.size(), is(1)); assertThat(generatedMethods.iterator().next(), containsString("delegate")); }</code><technical_language>similarly here: java assertThat(Sets.difference(generatedMethods, originalMethods)) .containsOnly("delegate");</technical_language>

Target:
public void generatedInterfaceHasDelegateMethod() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = TestingUtils.extractNonStaticMethods(GenericsTester.class); assertThat(Sets.difference(generatedMethods, originalMethods)).haveAtLeastOne( new Condition<>(string -> string.contains("delegate"), "contains the string 'delegate'")); }
Source:
<code>protected boolean checkActiveVdsInStoragePool() { List<VDS> vdss = getVdsDAO().getAllForStoragePool(getParameters().getStoragePoolId()); for (VDS vds : vdss) { if (vds.getStatus() == VDSStatus.Up) { return true; } } addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_ACTIVE_HOST_IN_STORAGE_POOL); <START> return false; <END> }</code><technical_language>for missing this in previous revision, this method considerably simplified simply querying active VDSs: protected boolean checkActiveVdsInStoragePool() { List<VDS> vdss = getVdsDAO().getAllForStoragePoolAndStatus(getParameters().getStoragePoolId(), VDSStatus.Up); if (vdss.isEmpty) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_ACTIVE_HOST_IN_STORAGE_POOL); return false; } return true; }</technical_language>

Target:
protected boolean checkActiveVdsInStoragePool() { List<VDS> vdss = getVdsDAO().getAllForStoragePoolAndStatus(getParameters().getStoragePoolId(), VDSStatus.Up); if (vdss.isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_ACTIVE_VDS_IN_STORAGE_POOL); return false; } return true; }
Source:
<code>public MetricsSinksConfig(String metricsSinksConfigFilename, String overrideConfigFilename) throws FileNotFoundException { FileInputStream sinkConfigStream = new FileInputStream(new File(metricsSinksConfigFilename)); FileInputStream overrideStream = new FileInputStream(new File(overrideConfigFilename)); try { Yaml yaml = new Yaml(); Map<Object, Object> sinkConfig = (Map<Object, Object>) yaml.load(sinkConfigStream); Map<Object, Object> overrideConfig = (Map<Object, Object>) yaml.load(overrideStream); if (sinkConfig == null) { <START> throw new RuntimeException("Could not parse metrics-sinks config file"); <END> } if (overrideConfig == null) { throw new RuntimeException("Could not parse override config file"); } Map<Object, Object> allConfig = new HashMap<>(); allConfig.putAll(sinkConfig); allConfig.putAll(overrideConfig); for (String sinkId : TypeUtils.getListOfStrings(allConfig.get(CONFIG_KEY_METRICS_SINKS))) { sinksConfigs.put(sinkId, (Map<String, Object>) allConfig.get(sinkId)); } } finally { SysUtils.closeIgnoringExceptions(sinkConfigStream); SysUtils.closeIgnoringExceptions(overrideStream); } }</code><technical_language>include file name in message</technical_language>

Target:
public MetricsSinksConfig(String metricsSinksConfigFilename, String overrideConfigFilename) throws IOException { Map<Object, Object> allConfig = new HashMap<>(); allConfig.putAll(readConfig(metricsSinksConfigFilename)); allConfig.putAll(readConfig(overrideConfigFilename)); if (allConfig.isEmpty()) { throw new RuntimeException("Missing required config 'sinks' for metrics manager"); } for (String sinkId : TypeUtils.getListOfStrings(allConfig.get(CONFIG_KEY_METRICS_SINKS))) { sinksConfigs.put(sinkId, (Map<String, Object>) allConfig.get(sinkId)); } }
Source:
<code>private boolean setReleased() { do { LockState state = lockState; switch (state) { case WAITING: case AVAILABLE: case ACQUIRED: <START> if (casState(state, LockState.RELEASED)) { <END> cleanup(); notifyListeners(); return true; } break; case TIMED_OUT: case DEADLOCKED: if (casState(state, LockState.RELEASED)) { cleanup(); return true; } break; default: return false; } } while (true); }</code><technical_language>Is ok WAITING straight RELEASED</technical_language>

Target:
private boolean setReleased() { do { LockState state = lockState; switch (state) { case WAITING: case ACQUIRED: if (casState(state, LockState.RELEASED)) { cleanup(); notifyListeners(); return true; } break; case TIMED_OUT: case DEADLOCKED: if (casState(state, LockState.RELEASED)) { cleanup(); return true; } break; default: return false; } } while (true); }
Source:
<code>List<StudyInstance> convertToStudyInstances(final ModelMapper mapper, final List<org.generationcp.middleware.service.impl.study.StudyInstance> middlewareStudyInstances) { final List<StudyInstance> instances = new ArrayList(); for (final org.generationcp.middleware.service.impl.study.StudyInstance instance : middlewareStudyInstances) { final StudyInstance datasetInstance = mapper.map(instance, StudyInstance.class); <START> datasetInstance.setCustomLocationAbbreviation(""); <END> instances.add(datasetInstance); } return instances; }</code><technical_language>is clear setting this empty if query is retrieving custom value</technical_language>

Target:
List<StudyInstance> convertToStudyInstances(final ModelMapper mapper, final List<org.generationcp.middleware.service.impl.study.StudyInstance> middlewareStudyInstances) { final List<StudyInstance> instances = new ArrayList(); for (final org.generationcp.middleware.service.impl.study.StudyInstance instance : middlewareStudyInstances) { final StudyInstance datasetInstance = mapper.map(instance, StudyInstance.class); instances.add(datasetInstance); } return instances; }