auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public HelixCloudProperty(CloudConfig cloudConfig) { this.setCloudEndabled(cloudConfig.isCloudEnabled()); this.setCloudId(cloudConfig.getCloudID()); this.setCloudProvider(cloudConfig.getCloudProvider()); <START> switch (cloudConfig.getCloudProvider()) { <END> case "AZURE": Properties azureProperties = new Properties(); try { InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(AZURE_CLOUD_PROPERTY_FILE); azureProperties.load(stream); } catch (Exception e) { String errMsg = "fail to open properties file: " + AZURE_CLOUD_PROPERTY_FILE; throw new IllegalArgumentException(errMsg, e); } logger.info("load helix Azure cloud properties: " + azureProperties); this.setCloudInfoSources(Collections.singletonList(azureProperties.getProperty("CLOUD_INFO_SOURCE"))); this.setCloudInfoProcessorName(azureProperties.getProperty("CLOUD_INFO_PROCESSFOR_NAME")); this.setCloudMaxRetry(azureProperties.getProperty("RETRY_MAX")); this.setCloudConnectionTimeout(azureProperties.getProperty("CONNECTION_TIMEOUT_MS")); this.setCloudRequestTimeout(azureProperties.getProperty("REQUEST_TIMEOUT_MS")); case "CUSTOMIZED": setCloudInfoSources(cloudConfig.getCloudInfoSources()); this.setCloudInfoProcessorName(cloudConfig.getCloudInfoProcessorName()); } }</code><technical_language>Need a default case</technical_language>

Target:
public HelixCloudProperty(CloudConfig cloudConfig) { setCloudEndabled(cloudConfig.isCloudEnabled()); if (cloudConfig.isCloudEnabled()) { setCloudId(cloudConfig.getCloudID()); setCloudProvider(cloudConfig.getCloudProvider()); switch (CloudProvider.valueOf(cloudConfig.getCloudProvider())) { case AZURE: Properties azureProperties = new Properties(); try { InputStream stream = Thread.currentThread().getContextClassLoader() .getResourceAsStream(AZURE_CLOUD_PROPERTY_FILE); azureProperties.load(stream); } catch (IOException e) { String errMsg = "failed to open Helix Azure cloud properties file: " + AZURE_CLOUD_PROPERTY_FILE; throw new IllegalArgumentException(errMsg, e); } LOG.info("Successfully loaded Helix Azure cloud properties: {}", azureProperties); setCloudInfoSources( Collections.singletonList(azureProperties.getProperty(CLOUD_INFO_SOURCE))); setCloudInfoProcessorName(azureProperties.getProperty(CLOUD_INFO_PROCESSFOR_NAME)); setCloudMaxRetry(Integer.valueOf(azureProperties.getProperty(CLOUD_MAX_RETRY))); setCloudConnectionTimeout(Long.valueOf(azureProperties.getProperty(CONNECTION_TIMEOUT_MS))); setCloudRequestTimeout(Long.valueOf(azureProperties.getProperty(REQUEST_TIMEOUT_MS))); break; case CUSTOMIZED: setCloudInfoSources(cloudConfig.getCloudInfoSources()); setCloudInfoProcessorName(cloudConfig.getCloudInfoProcessorName()); break; default: throw new HelixException( String.format("Unsupported cloud provider: %s", cloudConfig.getCloudProvider())); } } }
Source:
<code>protected void buildAndTag(ServiceHub hub, ImageConfiguration imageConfig) throws MojoExecutionException, DockerAccessException { EnvUtil.storeTimestamp(getBuildTimestampFile(), getBuildTimestamp()); BuildService.BuildContext buildContext = getBuildContext(); <START> hub.getBuildService().pullAndBuildImage(imageConfig, buildContext); <END> if (!skipTag) { tagImage(imageConfig.getName(), imageConfig, hub.getDockerAccess()); } }</code><technical_language>call 'buildImage' potential autopull of base image is more implementation detail</technical_language>

Target:
protected void buildAndTag(ServiceHub hub, ImageConfiguration imageConfig) throws MojoExecutionException, DockerAccessException { EnvUtil.storeTimestamp(getBuildTimestampFile(), getBuildTimestamp()); BuildService.BuildContext buildContext = getBuildContext(); BuildService buildService = hub.getBuildService(); buildService.buildImage(imageConfig, buildContext); if (!skipTag) { buildService.tagImage(imageConfig.getName(), imageConfig); } }
Source:
<code>public void setTabs() { List<Fragment> fragmentList = new ArrayList<>(); List<String> titleList = new ArrayList<>(); searchImageFragment = new SearchImageFragment(); searchCategoryFragment= new SearchCategoryFragment(); fragmentList.add(searchImageFragment); titleList.add(getResources().getString(R.string.search_tab_title_media)); fragmentList.add(searchCategoryFragment); titleList.add(getResources().getString(R.string.search_tab_title_categories)); viewPagerAdapter.setTabData(fragmentList, titleList); viewPagerAdapter.notifyDataSetChanged(); searchDisposable = RxSearchView.queryTextChanges(searchView) .takeUntil(RxView.detaches(searchView)) .debounce(500, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribe(query -> { this.query = query.toString(); if (!TextUtils.isEmpty(query)) { viewPager.setVisibility(View.VISIBLE); tabLayout.setVisibility(View.VISIBLE); searchHistoryContainer.setVisibility(View.GONE); <START> if (searchImageFragment != null <END> && searchImageFragment.isAdded() && !searchImageFragment.isDetached()) { searchImageFragment.updateImageList(query.toString()); } if (searchCategoryFragment != null && searchCategoryFragment.isAdded() && !searchCategoryFragment.isDetached()) { searchCategoryFragment.updateCategoryList(query.toString()); } } else { viewPager.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE); searchHistoryContainer.setVisibility(View.VISIBLE); recentSearchesFragment.updateRecentSearches(); } }); }</code><technical_language>FragmentUtils:isFragmentUIActive</technical_language>

Target:
public void setTabs() { List<Fragment> fragmentList = new ArrayList<>(); List<String> titleList = new ArrayList<>(); searchImageFragment = new SearchImageFragment(); searchCategoryFragment= new SearchCategoryFragment(); fragmentList.add(searchImageFragment); titleList.add(getResources().getString(R.string.search_tab_title_media)); fragmentList.add(searchCategoryFragment); titleList.add(getResources().getString(R.string.search_tab_title_categories)); viewPagerAdapter.setTabData(fragmentList, titleList); viewPagerAdapter.notifyDataSetChanged(); searchDisposable = RxSearchView.queryTextChanges(searchView) .takeUntil(RxView.detaches(searchView)) .debounce(500, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribe(query -> { this.query = query.toString(); if (!TextUtils.isEmpty(query)) { viewPager.setVisibility(View.VISIBLE); tabLayout.setVisibility(View.VISIBLE); searchHistoryContainer.setVisibility(View.GONE); if (FragmentUtils.isFragmentUIActive(searchImageFragment)) { searchImageFragment.updateImageList(query.toString()); } if (FragmentUtils.isFragmentUIActive(searchCategoryFragment)) { searchCategoryFragment.updateCategoryList(query.toString()); } } else { viewPager.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE); searchHistoryContainer.setVisibility(View.VISIBLE); recentSearchesFragment.updateRecentSearches(); } }); }
Source:
<code>public void maybeThrottle(double observed) throws InterruptedException { synchronized (lock) { observedSoFar += observed; long now = time.nanoseconds(); long elapsedNs = now - periodStartNs; if (elapsedNs > checkIntervalMs * Time.NsPerMs && observedSoFar > 0) { double rateInSecs = (observedSoFar * Time.NsPerSec) / elapsedNs; boolean needAdjustment = !(throttleDown ^ (rateInSecs > desiredRatePerSec)); if (needAdjustment) { double desiredRateMs = desiredRatePerSec / Time.MsPerSec; double elapsedMs = elapsedNs / Time.NsPerMs; long sleepTime = Math.round(observedSoFar / desiredRateMs - elapsedMs); if (sleepTime > 0) { logger.trace("Natural rate is per second but desired rate is {}, sleeping for ms to compensate.", rateInSecs, desiredRatePerSec, sleepTime); synchronized (waitGuard) { if (awakeCount == 0) { waiting = true; time.wait(waitGuard, sleepTime); waiting = false; } if (awakeCount > 0) { awakeCount--; } } } } <START> periodStartNs = now; <END> observedSoFar = 0; } } }</code><technical_language>general question is in code change. do nanoseconds instead of milliseconds here</technical_language>

Target:
public void maybeThrottle(double observed) throws InterruptedException { synchronized (lock) { observedSoFar += observed; long now = time.nanoseconds(); long elapsedNs = now - periodStartNs; if (elapsedNs > checkIntervalMs * Time.NsPerMs && observedSoFar > 0) { double rateInSecs = (observedSoFar * Time.NsPerSec) / elapsedNs; boolean needAdjustment = !(throttleDown ^ (rateInSecs > desiredRatePerSec)); if (needAdjustment) { double desiredRateMs = desiredRatePerSec / Time.MsPerSec; double elapsedMs = elapsedNs / Time.NsPerMs; long sleepTime = Math.round(observedSoFar / desiredRateMs - elapsedMs); if (sleepTime > 0) { logger.trace("Natural rate is per second but desired rate is {}, sleeping for ms to compensate.", rateInSecs, desiredRatePerSec, sleepTime); synchronized (waitGuard) { if (enabled) { time.wait(waitGuard, sleepTime); } } } } periodStartNs = now; observedSoFar = 0; } } }
Source:
<code>private void setFactionIcon(Faction faction) { if (faction == null) { return; } switch (faction) { case AEON: factionIcon.setVisible(true); factionIcon.setText("\uE900"); factionIcon.getStyleClass().add("aeon"); break; case CYBRAN: factionIcon.setVisible(true); <START> factionIcon.setText("\uE902"); <END> factionIcon.getStyleClass().add("cybran"); break; case SERAPHIM: factionIcon.setVisible(true); factionIcon.setText("\uE903"); factionIcon.getStyleClass().add("seraphim"); break; case UEF: factionIcon.setVisible(true); factionIcon.setText("\uE904"); factionIcon.getStyleClass().add("uef"); break; default: factionImage.setVisible(true); factionImage.setImage(randomImage); break; } }</code><technical_language>this line in case. moving switch</technical_language>

Target:
private void setFactionIcon(Faction faction) { if (faction == null) { return; } factionIcon.setVisible(true); switch (faction) { case AEON: factionIcon.setText("\uE900"); factionIcon.getStyleClass().add(AEON); break; case CYBRAN: factionIcon.setText("\uE902"); factionIcon.getStyleClass().add(CYBRAN); break; case SERAPHIM: factionIcon.setText("\uE903"); factionIcon.getStyleClass().add(SERAPHIM); break; case UEF: factionIcon.setText("\uE904"); factionIcon.getStyleClass().add(UEF); break; default: factionIcon.setVisible(false); factionImage.setVisible(true); factionImage.setImage(RANDOM_IMAGE); break; } }
Source:
<code>public void show(@NonNull PageTitle title) { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(title), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { if (!ViewCompat.isAttachedToWindow(anchorView)) { return; } ReadingListBookmarkMenu.this.page = page; PopupMenu menu = new PopupMenu(anchorView.getContext(), anchorView); menu.getMenuInflater().inflate(R.menu.menu_reading_list_page_toggle, menu.getMenu()); <START> menu.setOnMenuItemClickListener(new <END> PageSaveMenuClickListener()); menu.show(); } }); }</code><technical_language>access page.listKeys() property here, add a check update delete button label name specific list page is contained in spec, if page.listKeys().length() === 1? Fine kick this road a follow-up patch</technical_language>

Target:
public void show(@NonNull PageTitle title) { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(title), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { if (!ViewCompat.isAttachedToWindow(anchorView)) { return; } ReadingListBookmarkMenu.this.page = page; showMenu(); } }); }
Source:
<code>public void writeToFile(String msg, String fileName, StudySubject ss) { logger.debug("writing report to File"); File file = new File(fileName); PrintWriter writer = null; try { file.createNewFile(); writer = new PrintWriter(file.getPath(), "UTF-8"); String subStr = ""; writer.println("SubjectKey,ParticipantID,Status,Timestamp,Message"); SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); Date date = new Date(System.currentTimeMillis()); writer.println(ss.getOcOid()+","+ss.getLabel()+","+"Failed"+","+formatter.format(date)+","+"Error Detail:"); <START> msg = msg.replaceAll("\"", ""); <END> if(msg.length() > 100) { while(msg.length() > 100) { int endIndex = msg.indexOf(" ", 100); subStr = msg.substring(0, endIndex); writer.println(", , , ," + subStr); msg = msg.substring(endIndex); } writer.println(", , , ," +msg); }else { writer.println(", , , ," +msg); } } catch (IOException e) { logger.error("Error while accessing file to start writing: ",e); } finally { writer.close();; } }</code><technical_language>instead of replacing, escape quotes</technical_language>

Target:
public void writeToFile(String msg, String fileName, StudySubject ss) { logger.debug("writing report to File"); File file = new File(fileName); PrintWriter writer = null; try { file.createNewFile(); writer = new PrintWriter(file.getPath(), "UTF-8"); String subStr = ""; writer.println("SubjectKey|ParticipantID|Status|Timestamp|Message"); SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); Date date = new Date(System.currentTimeMillis()); writer.println(ss.getOcOid()+"|"+ss.getLabel()+"|"+"Failed"+"|"+formatter.format(date)+"|"+"Error Detail: "+ msg); } catch (IOException e) { logger.error("Error while accessing file to start writing: ",e); } finally { writer.close();; } }
Source:
<code>public void filter(Filter filter) throws NoTestsRemainException { synchronized (fLock) { <START> List<T> sortedChildren = new ArrayList<T>(getFilteredChildren()); <END> try { for (Iterator<T> iter = sortedChildren.iterator(); iter.hasNext(); ) { T each = iter.next(); if (shouldRun(filter, each)) { try { filter.apply(each); } catch (NoTestsRemainException e) { iter.remove(); } } else { iter.remove(); } } } finally { setFilteredChildren(sortedChildren); } } if (getFilteredChildren().isEmpty()) { throw new NoTestsRemainException(); } }</code><technical_language>nit: rename this variable filteredChildren</technical_language>

Target:
public void filter(Filter filter) throws NoTestsRemainException { synchronized (fChildrenLock) { List<T> filteredChildren = new ArrayList<T>(getFilteredChildren()); for (Iterator<T> iter = filteredChildren.iterator(); iter.hasNext(); ) { T each = iter.next(); if (shouldRun(filter, each)) { try { filter.apply(each); } catch (NoTestsRemainException e) { iter.remove(); } } else { iter.remove(); } } fFilteredChildren = Collections.unmodifiableCollection(filteredChildren); if (fFilteredChildren.isEmpty()) { throw new NoTestsRemainException(); } } }
Source:
<code><START> private static <T> List<T> extractList(Map<String, Object> xmlRpcStruct, String propertyName, boolean returnNullOnEmpty) { if (!xmlRpcStruct.containsKey(propertyName)){ return returnNullOnEmpty ? null : Collections.emptyList(); } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return returnNullOnEmpty ? null : Collections.emptyList(); } List<T> list = new ArrayList<>(); Arrays.stream(items).forEach(item -> list.add((T) item)); return list; <END> }</code><technical_language>Maybe: private static <T> List<T> extractList(Map<String, Object> xmlRpcStruct, String propertyName, boolean returnNullOnEmpty) { Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items != null && items.length != 0) { return Arrays.stream(items).map(item -> (T) item).collect(Collectors.toList()); } return returnNullOnEmpty ? null : Collections.emptyList(); }</technical_language>

Target:
private static <T> List<T> extractList(Map<String, Object> xmlRpcStruct, String propertyName, boolean returnNullOnEmpty) { if (!xmlRpcStruct.containsKey(propertyName)){ return returnNullOnEmpty ? null : Collections.emptyList(); } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return returnNullOnEmpty ? null : Collections.emptyList(); } return Arrays.stream(items).map(item -> (T) item).collect(Collectors.toList()); }
Source:
<code><START> public void UseLegacy(boolean useLegacy) { <END> this.useLegacy = useLegacy; }</code><technical_language>@ankritisachan Correct</technical_language>

Target:
public void UseLegacy(boolean useLegacy) { this.useLegacy = useLegacy; Stop(); if (useLegacy == true || Build.VERSION.SDK_INT<8) { speechRecognizerController = new IntentBasedSpeechRecognizer(container, recognizerIntent); } else { speechRecognizerController = new ServiceBasedSpeechRecognizer(container, recognizerIntent); } }
Source:
<code>public String getSearchTransformedNetwork(@ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; ConceptpowerReply reply = conceptpowerConnector.getById(conceptId); List<String> alternativeIdsForConcept = null; if (reply != null && reply.getConceptEntry().size() > 0) { searchNodeLabel = reply.getConceptEntry().get(0).getLemma(); lemma = reply.getConceptEntry().get(0).getDescription(); alternativeIdsForConcept = reply.getConceptEntry().get(0).getAlternativeIdList(); <START> } <END> if(alternativeIdsForConcept == null){ alternativeIdsForConcept = new ArrayList<String>(); } ITransformedNetwork transformedNetwork = transformationManager .getSearchTransformedNetwork(project.getProjectId(), conceptId, alternativeIdsForConcept, INetworkStatus.APPROVED); String json = null; if (transformedNetwork != null) { json = jsonCreator.getJson(transformedNetwork.getNodes(), transformedNetwork.getLinks()); } if (transformedNetwork == null || transformedNetwork.getNodes().size() == 0) { model.addAttribute("isNetworkEmpty", true); } model.addAttribute("jsonstring", json); model.addAttribute("networkid", "\"\""); model.addAttribute("project", project); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("unixName", projectUnixName); return "sites/networks/searchednetwork"; }</code><technical_language>concepts cached, a big deal if conceptconnector is called twice</technical_language>

Target:
public String getSearchTransformedNetwork(@ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; ConceptpowerReply reply = conceptpowerConnector.getById(conceptId); if (reply != null && reply.getConceptEntry().size() > 0) { searchNodeLabel = reply.getConceptEntry().get(0).getLemma(); lemma = reply.getConceptEntry().get(0).getDescription(); } ITransformedNetwork transformedNetwork = transformationManager .getSearchTransformedNetwork(project.getProjectId(), conceptId, INetworkStatus.APPROVED); String json = null; if (transformedNetwork != null) { json = jsonCreator.getJson(transformedNetwork.getNodes(), transformedNetwork.getLinks()); } if (transformedNetwork == null || transformedNetwork.getNodes().size() == 0) { model.addAttribute("isNetworkEmpty", true); } model.addAttribute("jsonstring", json); model.addAttribute("networkid", "\"\""); model.addAttribute("project", project); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("unixName", projectUnixName); return "sites/networks/searchednetwork"; }
Source:
<code><START> public PluginUploadResponse addPlugin(File uploadedPlugin, String filename) { <END> if (!validateJar(filename)) { Map<Integer, String> errors = new HashMap<Integer, String>(); errors.put(HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, "Please upload a jar."); return PluginUploadResponse.create(false, null, errors); } return uploadPlugin(uploadedPlugin, filename); }</code><technical_language>DefaultPluginManager a "runtime view of/access plugins". plugin locations filesystem, now. want that</technical_language>

Target:
public PluginUploadResponse addPlugin(File uploadedPlugin, String filename) { if (!pluginValidator.namecheckForJar(filename)) { Map<Integer, String> errors = new HashMap<Integer, String>(); errors.put(HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, "Please upload a jar."); return PluginUploadResponse.create(false, null, errors); } return pluginWriter.addPlugin(uploadedPlugin, filename); }
Source:
<code>public void toStart() { log.debug(String.format("toStart: %s", id)); cqTailer.toStart(); <START> if (! cqTailer.state().equals(TailerState.FOUND_CYCLE)) { <END> log.warn("Unable to move to start because the tailer is not initialized, " + this); } }</code><technical_language>space ! (several other instances below)</technical_language>

Target:
public void toStart() { log.debug(String.format("toStart: %s", id)); cqTailer.toStart(); if (!cqTailer.state().equals(TailerState.FOUND_CYCLE)) { log.info("Unable to move to start because the tailer is not initialized, " + this); } }
Source:
<code>public void shouldDeleteUsers() { User john = new User("john"); john.disable(); User joan = new User("joan"); joan.disable(); <START> List<String> userNames = new ArrayList<String>() {{ <END> add("john"); add("joan"); }}; userDao.saveOrUpdate(john); userDao.saveOrUpdate(joan); boolean result = userDao.deleteUsers(userNames); assertThat(result, is(true)); Users users = userDao.allUsers(); assertThat(users, is(empty())); }</code><technical_language>Arrays.asList</technical_language>

Target:
public void shouldDeleteUsers() { User john = new User("john"); john.disable(); User joan = new User("joan"); joan.disable(); List<String> userNames = Arrays.asList("john", "joan"); userDao.saveOrUpdate(john); userDao.saveOrUpdate(joan); boolean result = userDao.deleteUsers(userNames); assertThat(result, is(true)); Users users = userDao.allUsers(); assertThat(users, is(empty())); }
Source:
<code>public List<String> listTopics() { Seq<String> topics = zkUtils.getAllTopics(); <START> return scala.collection.JavaConversions.seqAsJavaList(topics); <END> }</code><technical_language>scala.collection.JavaConversions -> JavaConversions</technical_language>

Target:
public List<String> listTopics() { Seq<String> topics = zkUtils.getAllTopics(); return JavaConversions.seqAsJavaList(topics); }
Source:
<code>static void validateDetectedLanguages(List<DetectedLanguage> expectedLanguageList, List<DetectedLanguage> actualLanguageList) { <START> for (int i = 0; i < expectedLanguageList.size(); i++) { <END> DetectedLanguage expectedDetectedLanguage = expectedLanguageList.get(i); DetectedLanguage actualDetectedLanguage = actualLanguageList.get(i); validatePrimaryLanguage(expectedDetectedLanguage, actualDetectedLanguage); } }</code><technical_language>This assumes order of expectedLanguage is actualLanguageList. if returned "es", "en" "en", "es"? test fail</technical_language>

Target:
static void validateDetectedLanguages(List<DetectedLanguage> expectedLanguageList, List<DetectedLanguage> actualLanguageList) { assertEquals(expectedLanguageList.size(), actualLanguageList.size()); expectedLanguageList.sort(Comparator.comparing(DetectedLanguage::getName)); actualLanguageList.sort(Comparator.comparing(DetectedLanguage::getName)); for (int i = 0; i < expectedLanguageList.size(); i++) { DetectedLanguage expectedDetectedLanguage = expectedLanguageList.get(i); DetectedLanguage actualDetectedLanguage = actualLanguageList.get(i); validatePrimaryLanguage(expectedDetectedLanguage, actualDetectedLanguage); } }
Source:
<code>public void testSummaryOutput() throws IOException { Summary labelsAndQuantiles = Summary.build() .quantile(0.5, 0.05).quantile(0.9, 0.01).quantile(0.99, 0.001) .labelNames("l").name("labelsAndQuantiles").help("help").register(registry); <START> labelsAndQuantiles.labels("a").observe(2); <END> writer = new StringWriter(); TextFormat.write004(writer, registry.metricFamilySamples()); assertEquals("# HELP labelsAndQuantiles help\n" + "# TYPE labelsAndQuantiles summary\n" + "labelsAndQuantiles{l=\"a\",quantile=\"0.5\",} 2.0\n" + "labelsAndQuantiles{l=\"a\",quantile=\"0.9\",} 2.0\n" + "labelsAndQuantiles{l=\"a\",quantile=\"0.99\",} 2.0\n" + "labelsAndQuantiles_count{l=\"a\",} 1.0\n" + "labelsAndQuantiles_sum{l=\"a\",} 2.0\n", writer.toString()); }</code><technical_language>this too</technical_language>

Target:
public void testSummaryOutput() throws IOException { Summary noLabels = (Summary) Summary.build().name("nolabels").help("help").register(registry); noLabels.observe(2); TextFormat.write004(writer, registry.metricFamilySamples()); assertEquals("# HELP nolabels help\n" + "# TYPE nolabels summary\n" + "nolabels_count 1.0\n" + "nolabels_sum 2.0\n", writer.toString()); }
Source:
<code>protected String processDistinctKeyword( String sql, QueryParameters parameters) { if ( !parameters.isPassDistinctThrough() ) { if ( sql.contains( SELECT_DISTINCT ) ) { <START> return sql.replaceAll( SELECT_DISTINCT, SELECT ); <END> } } return sql; }</code><technical_language>Hmmm, this changes semantic of do significantly replace occurrence in query. risk that</technical_language>

Target:
protected String processDistinctKeyword( String sql, QueryParameters parameters) { if ( !parameters.isPassDistinctThrough() ) { int selectDistinctIndex = sql.indexOf( SELECT_DISTINCT ); if ( selectDistinctIndex > -1 ) { StringBuilder builder = ( selectDistinctIndex > 0 ) ? new StringBuilder( sql.substring( 0, selectDistinctIndex ) ) : new StringBuilder(); builder.append( SELECT ) .append( sql.substring( selectDistinctIndex + SELECT_DISTINCT.length() ) ); return builder.toString(); } } return sql; }
Source:
<code>private void connectToOneServerWithRetry(String hostname, int port) { long sleep = m_initialRetryIntervalMS; while (m_shouldContinue.get()) { try { m_client.createConnection(hostname, port); LOG.info(String.format("Connected to VoltDB node at %s:%d.", hostname, port)); <START> synchronized (m_client) { <END> m_client.notifyAll(); } break; } catch (Exception e) { LOG.warn(String.format("Connection to VoltDB node at %s:%d failed - retrying in %d second(s).", hostname, port, TimeUnit.MILLISECONDS.toSeconds(sleep))); try { Thread.sleep(sleep); } catch (Exception ignored) { } if (sleep < m_maxRetryIntervalMS) { sleep = Math.min(sleep + sleep, m_maxRetryIntervalMS); } } } }</code><technical_language>do need this? Is this case cluster is get connection? this auto connect is enabled</technical_language>

Target:
private void connectToOneServerWithRetry(String hostname, int port) { long sleep = m_initialRetryIntervalMS; while (m_shouldContinue.get()) { try { m_client.createConnection(hostname, port); LOG.info(String.format("Connected to VoltDB node at %s:%d.", hostname, port)); break; } catch (Exception e) { LOG.warn(String.format("Connection to VoltDB node at %s:%d failed - retrying in %d second(s).", hostname, port, TimeUnit.MILLISECONDS.toSeconds(sleep))); try { Thread.sleep(sleep); } catch (Exception ignored) { } if (sleep < m_maxRetryIntervalMS) { sleep = Math.min(sleep + sleep, m_maxRetryIntervalMS); } } } }
Source:
<code>public void setup() { try { <START> this.espConn = new Connection("http://" + testClusterIp + ":8010?test"); <END> espConn.setUserName(""); espConn.setPassword(""); } catch (Exception e) }</code><technical_language>require ?test param</technical_language>

Target:
public void setup() { try { this.espConn = new Connection("http://" + testClusterIp + ":8010"); espConn.setUserName(""); espConn.setPassword(""); } catch (Exception e) }
Source:
<code>public ExtractionType getExtractionType(){ <START> return (child != null) <END> ? ((child.getExtractionType() == ExtractionType.MANY_TO_ONE) ? ExtractionType.MANY_TO_ONE : fn.getExtractionType() ) : fn.getExtractionType(); }</code><technical_language>I this set of conditions is a bit hard read, change like: if (child != null && child.getExtractionType() == ExtractionType.MANY_TO_ONE) { return ExtractionType.MANY_TO_ONE; } else { return fn.getExtractionType(); }</technical_language>

Target:
public ExtractionType getExtractionType(){ if (child != null && child.getExtractionType() == ExtractionType.MANY_TO_ONE) { return ExtractionType.MANY_TO_ONE; } else { return fn.getExtractionType(); } }
Source:
<code><START> public void addControl(String id, Control control) { <END> if (controls.containsKey(id)) { throw new IllegalArgumentException( MessageFormat.format("A control with id {0} already exists", id)); } controls.put(id, control); }</code><technical_language>is this public</technical_language>

Target:
protected void addControl(String id, Control control) { if (controls.containsKey(id)) { throw new IllegalArgumentException( MessageFormat.format("A control with id {0} already exists", id)); } controls.put(id, control); }
Source:
<code><START> public void test_ecb_eur_gbp_dates() { <END> FxIndex test = FxIndices.ECB_EUR_GBP; assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 13)), date(2014, 10, 15)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 15)), date(2014, 10, 13)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 16)), date(2014, 10, 20)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 20)), date(2014, 10, 16)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 17)), date(2014, 10, 21)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 21)), date(2014, 10, 17)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 19)), date(2014, 10, 22)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 19)), date(2014, 10, 16)); }</code><technical_language>tests show interaction of 2 holiday calendars</technical_language>

Target:
public void test_ecb_eur_gbp_dates() { FxIndex test = FxIndices.ECB_EUR_GBP; assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 13)), date(2014, 10, 15)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 15)), date(2014, 10, 13)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 16)), date(2014, 10, 20)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 20)), date(2014, 10, 16)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 17)), date(2014, 10, 21)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 21)), date(2014, 10, 17)); assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 19)), date(2014, 10, 22)); assertEquals(test.calculateFixingFromMaturity(date(2014, 10, 19)), date(2014, 10, 16)); assertEquals(test.calculateMaturityFromFixing(date(2014, 4, 30)), date(2014, 5, 6)); assertEquals(test.calculateFixingFromMaturity(date(2014, 5, 6)), date(2014, 4, 30)); }
Source:
<code>default void moveTo(int paragraphIndex, int columnIndex, SelectionPolicy selectionPolicy) { int pos = getAbsoluteCharPosition(paragraphIndex, columnIndex); switch(selectionPolicy) { case CLEAR: selectRange(pos, pos); break; case ADJUST: selectRange(getAnchor(), pos); break; case EXTEND: IndexRange sel = getSelection(); int anchor; if(pos <= sel.getStart()) anchor = sel.getEnd(); else if(pos >= sel.getEnd()) anchor = sel.getStart(); else anchor = getAnchor(); selectRange(anchor, pos); break; } <START> } <END></code><technical_language>a repetitive wrt. method above</technical_language>

Target:
default void moveTo(int paragraphIndex, int columnIndex, SelectionPolicy selectionPolicy) { int pos = getAbsolutePosition(paragraphIndex, columnIndex); moveTo(pos, selectionPolicy); }
Source:
<code>public void evict(AccountExternalId id) { byKey.remove(id.getKey()); byAccountId.remove(id.getAccountId()); <START> byEmail.remove(new EmailWrapper(id.getEmailAddress())); <END> }</code><technical_language>getEmailAddress return null</technical_language>

Target:
public void evict(AccountExternalId id) { byKey.remove(id.getKey()); byAccountId.remove(id.getAccountId()); if (id.getEmailAddress() != null) { byEmail.remove(new EmailWrapper(id.getEmailAddress())); } }
Source:
<code>public void singleHopGetAllShouldRetrySOECausedBySerialzationExp() { when(region.getFullPath()).thenReturn("/testRegion") .thenThrow(new ServerOperationException(new SerializationException("testRetry"))) .thenReturn("/testRegion"); VersionedObjectList vol = new VersionedObjectList(); when(pool.execute(any())).thenReturn(vol); GetAllOp.execute(pool, region, keys, -1, null); <START> } <END></code><technical_language>this needs assertion operation retried</technical_language>

Target:
public void singleHopGetAllShouldRetrySOECausedBySerialzationExp() { when(region.getFullPath()).thenReturn("/testRegion") .thenThrow(new ServerOperationException(new SerializationException("testRetry"))) .thenReturn("/testRegion"); VersionedObjectList vol = new VersionedObjectList(); when(pool.execute(any())).thenReturn(vol); VersionedObjectList result = GetAllOp.execute(pool, region, keys, -1, null); assertThat(result.getKeys()).isEqualTo(keys); Mockito.verify(pool, times(1)).execute(any()); }
Source:
<code>public void replaceTokens(ZestVariables tokens) { if (this.urlToken != null) { this.setUrlToken(tokens.replaceInString(this.urlToken, true)); try { this.setUrl(new URL(this.getUrlToken())); } catch (MalformedURLException e) { } } else if (this.url != null) { try { this.setUrl(new URL(tokens.replaceInString(this.url.toString(), true))); } catch (MalformedURLException e) { } } this.setMethod(tokens.replaceInString(this.getMethod(), false)); this.setHeaders(tokens.replaceInString(this.getHeaders(), false)); this.setData(tokens.replaceInString(this.getData(), false)); List<ZestCookie> replacedCookies = new ArrayList<>(); for (ZestCookie cookie : this.cookies) { <START> replacedCookies.add(new ZestCookie(cookie.getDomain(), tokens.replaceInString(cookie.getName(), false), <END> tokens.replaceInString(cookie.getValue(), false), cookie.getPath(), cookie.getExpiryDate(), cookie.getSecure())); } this.cookies = replacedCookies; }</code><technical_language>replace other fields (i.e. domain, path)? variables. - need create new cookies? (It setters.)</technical_language>

Target:
public void replaceTokens(ZestVariables tokens) { if (this.urlToken != null) { this.setUrlToken(tokens.replaceInString(this.urlToken, true)); try { this.setUrl(new URL(this.getUrlToken())); } catch (MalformedURLException e) { } } else if (this.url != null) { try { this.setUrl(new URL(tokens.replaceInString(this.url.toString(), true))); } catch (MalformedURLException e) { } } this.setMethod(tokens.replaceInString(this.getMethod(), false)); this.setHeaders(tokens.replaceInString(this.getHeaders(), false)); this.setData(tokens.replaceInString(this.getData(), false)); for (ZestCookie cookie : this.cookies) { cookie.setDomain(tokens.replaceInString(cookie.getDomain(),false)); cookie.setName(tokens.replaceInString(cookie.getName(),false)); cookie.setValue(tokens.replaceInString(cookie.getValue(),false)); cookie.setPath(tokens.replaceInString(cookie.getPath(),false)); } }
Source:
<code>public void startBridge() throws Exception { final Module module; if (moduleName != null) { ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName); <START> module = Module.getCallerModuleLoader().loadModule(moduleID); <END> } else { module = Module.getCallerModule(); } ClassLoader oldTccl= WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader()); bridge.start(); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } MessagingLogger.MESSAGING_LOGGER.startedService("JMS Bridge", bridgeName); }</code><technical_language>this need getCallerModuleLoader? I realize previous code this, ways obtain a module loader. (getClallerModuleLoader stack crawling is slow)</technical_language>

Target:
public void startBridge() throws Exception { final Module module; if (moduleName != null) { ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName); module = Module.getContextModuleLoader().loadModule(moduleID); } else { module = Module.forClass(JMSBridgeService.class); } ClassLoader oldTccl= WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader()); bridge.start(); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } MessagingLogger.MESSAGING_LOGGER.startedService("JMS Bridge", bridgeName); }
Source:
<code>static String getLiveChatId(YouTube youtube, String videoId) throws IOException { if (videoId != null && !videoId.isEmpty()) { YouTube.Videos.List videoList = youtube.videos() .list("liveStreamingDetails") .setFields("items/liveStreamingDetails/activeLiveChatId") .setId(videoId); VideoListResponse response = videoList.execute(); for (Video v : response.getItems()) { String liveChatId = v.getLiveStreamingDetails().getActiveLiveChatId(); if (liveChatId != null && !liveChatId.isEmpty()) { return liveChatId; } } } else { YouTube.LiveBroadcasts.List broadcastList = youtube .liveBroadcasts() .list("snippet") .setFields("items/snippet/liveChatId") .setBroadcastType("all") <START> .setBroadcastStatus("active"); <END> LiveBroadcastListResponse broadcastListResponse = broadcastList.execute(); for (LiveBroadcast b : broadcastListResponse.getItems()) { String liveChatId = b.getSnippet().getLiveChatId(); if (liveChatId != null && !liveChatId.isEmpty()) { return liveChatId; } } } return null; }</code><technical_language>Is this query return more broadcast? If so, is a intended liveChatId? For example, if videoId specified, sense retrieve authorized channel's persistent, active broadcast? (Though, honest, if of those.)</technical_language>

Target:
static String getLiveChatId(YouTube youtube, String videoId) throws IOException { YouTube.Videos.List videoList = youtube.videos() .list("liveStreamingDetails") .setFields("items/liveStreamingDetails/activeLiveChatId") .setId(videoId); VideoListResponse response = videoList.execute(); for (Video v : response.getItems()) { String liveChatId = v.getLiveStreamingDetails().getActiveLiveChatId(); if (liveChatId != null && !liveChatId.isEmpty()) { return liveChatId; } } return null; }
Source:
<code><START> public static boolean matchesPartially(final MbusChannelElementsDto mbusChannelElements, <END> final ChannelElementValuesDto channelElementValues) { if (!channelElementValues.isMbusSlaveDeviceConfigured()) { return false; } if (mbusChannelElements.hasMbusIdentificationNumber() && channelElementValues.hasIdentificationNumber() && !mbusChannelElements.getMbusIdentificationNumber() .equals(channelElementValues.getIdentificationNumber())) { return false; } if (mbusChannelElements.hasMbusManufacturerIdentification() && channelElementValues.hasManufacturerIdentification() && !mbusChannelElements.getMbusManufacturerIdentification() .equals(channelElementValues.getManufacturerIdentification())) { return false; } if (mbusChannelElements.hasMbusVersion() && channelElementValues.hasVersion() && !mbusChannelElements.getMbusVersion().equals(channelElementValues.getVersion())) { return false; } if (mbusChannelElements.hasMbusDeviceTypeIdentification() && channelElementValues.hasDeviceTypeIdentification() && !mbusChannelElements.getMbusDeviceTypeIdentification() .equals(channelElementValues.getDeviceTypeIdentification())) { return false; } return true; }</code><technical_language>Fix cyclomatic complexity sonar issue</technical_language>

Target:
public static boolean matchesPartially(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { if (!channelElementValues.isMbusSlaveDeviceConfigured()) { return false; } if (failPartialMatchOnMbusIdentificationNumber(mbusChannelElements, channelElementValues) || failPartialMatchOnMbusManufacturerIdentification(mbusChannelElements, channelElementValues) || failPartialMatchOnMbusVersion(mbusChannelElements, channelElementValues) || failPartialMatchOnMbusDeviceTypeIdentification(mbusChannelElements, channelElementValues)) { return false; } return true; }
Source:
<code>public String getSourcePresentationName() { String result = StringUtils.EMPTY; if (getSourceExecutionCourse() != null) { <START> result += getSourceExecutionCourse().getNameI18N().getContent(); <END> final Set<DegreeCurricularPlan> plans; if (getDegree() != null) { plans = Sets.intersection(getDegree().getDegreeCurricularPlansSet(), Sets.newHashSet(getSourceExecutionCourse().getAssociatedDegreeCurricularPlans())); } else { plans = Sets.newHashSet(getSourceExecutionCourse().getAssociatedDegreeCurricularPlans()); } result += getDegreeCurricularPlansPresentationString(plans); } return result; }</code><technical_language>This a StringBuilder</technical_language>

Target:
public String getSourcePresentationName() { StringBuilder result = new StringBuilder(); if (getSourceExecutionCourse() != null) { result.append(getSourceExecutionCourse().getNameI18N().getContent()); final Set<DegreeCurricularPlan> plans; if (getDegree() != null) { plans = Sets.intersection(getDegree().getDegreeCurricularPlansSet(), Sets.newHashSet(getSourceExecutionCourse().getAssociatedDegreeCurricularPlans())); } else { plans = Sets.newHashSet(getSourceExecutionCourse().getAssociatedDegreeCurricularPlans()); } result.append(getDegreeCurricularPlansPresentationString(plans)); } return result.toString(); }
Source:
<code>private void saveDirStrings(Set<String> gitDirStrings) { StringBuilder sb = new StringBuilder(); for (String gitDirString : gitDirStrings) { sb.append(gitDirString); sb.append(File.pathSeparatorChar); } IEclipsePreferences prefs = new InstanceScope().getNode(Activator .getPluginId()); prefs.put(PREFS_DIRECTORIES, sb.toString()); try { prefs.flush(); } catch (BackingStoreException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>forgot something</technical_language>

Target:
private void saveDirStrings(Set<String> gitDirStrings) { StringBuilder sb = new StringBuilder(); for (String gitDirString : gitDirStrings) { sb.append(gitDirString); sb.append(File.pathSeparatorChar); } IEclipsePreferences prefs = new InstanceScope().getNode(Activator .getPluginId()); prefs.put(PREFS_DIRECTORIES, sb.toString()); try { prefs.flush(); } catch (BackingStoreException e) { IStatus error = new Status(IStatus.ERROR, Activator.getPluginId(), e.getMessage(), e); Activator.getDefault().getLog().log(error); } }
Source:
<code>protected void startDebugger(final DebugSessionDto debugSessionDto) { List<BreakpointDto> breakpoints = new ArrayList<>(); for (Breakpoint breakpoint : breakpointManager.getBreakpointList()) { Location location = breakpoint.getLocation(); LocationDto locationDto = dtoFactory.createDto(LocationDto.class); locationDto.setLineNumber(location.getLineNumber()); locationDto.setTarget(location.getTarget()); locationDto.setResourceProjectPath(location.getResourceProjectPath()); <START> BreakpointConfigurationDto conditions = <END> dtoFactory .createDto(BreakpointConfigurationDto.class) .withCondition(breakpoint.getBreakpointConfiguration().getCondition()) .withHitCount(breakpoint.getBreakpointConfiguration().getHitCount()); BreakpointDto breakpointDto = dtoFactory.createDto(BreakpointDto.class); breakpointDto.setLocation(locationDto); breakpointDto.setEnabled(true); breakpointDto.setBreakpointConfiguration(conditions); breakpoints.add(breakpointDto); } StartActionDto action = dtoFactory.createDto(StartActionDto.class); action.setType(Action.TYPE.START); action.setBreakpoints(breakpoints); service.start(debugSessionDto.getId(), action); }</code><technical_language>conditions -> breakpointConfiguration</technical_language>

Target:
protected void startDebugger(final DebugSessionDto debugSessionDto) { List<BreakpointDto> breakpoints = new ArrayList<>(); for (Breakpoint breakpoint : breakpointManager.getBreakpointList()) { BreakpointDto breakpointDto = dtoFactory.createDto(BreakpointDto.class); breakpointDto.setLocation(toDto(breakpoint.getLocation())); breakpointDto.setEnabled(true); breakpointDto.setCondition(breakpoint.getCondition()); breakpoints.add(breakpointDto); } StartActionDto action = dtoFactory.createDto(StartActionDto.class); action.setType(Action.TYPE.START); action.setBreakpoints(breakpoints); service.start(debugSessionDto.getId(), action); }
Source:
<code>protected Transferable createTransferable(JComponent c) { indices = list.getSelectedIndices(); <START> if (list.isSelectionEmpty()) return null; <END> return new ActionTransferable((ArrayList<Action>) list.getSelectedValuesList()); }</code><technical_language>this line? right before. check returned list is empty. do both</technical_language>

Target:
protected Transferable createTransferable(JComponent c) { if (list.isSelectionEmpty()) return null; indices = list.getSelectedIndices(); return new ActionTransferable((ArrayList<Action>) list.getSelectedValuesList()); }
Source:
<code>public GraphBuilder setCHProfiles(List<CHProfile> chProfiles) { if (chProfiles.size() != new HashSet<>(chProfiles).size()) { <START> throw new IllegalArgumentException("Duplicate CH profile: " + chProfiles); <END> } this.chProfiles = chProfiles; return this; }</code><technical_language>message is slightly confusing "Contains duplicate CH profile:" (?)</technical_language>

Target:
public GraphBuilder setCHProfiles(List<CHProfile> chProfiles) { if (chProfiles.size() != new HashSet<>(chProfiles).size()) { throw new IllegalArgumentException("Given CH profiles contain duplicates, given: " + chProfiles); } this.chProfiles = chProfiles; return this; }
Source:
<code>synchronized void shutdown() { m_isShutdown = true; try { DeferredSerialization ds = null; while ((ds = m_queuedWrites.poll()) != null) { ds.cancel(); } <START> <END> int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); EncryptFrame frame = null; while ((frame = m_encrypted.poll()) != null) { frame.frame.release(); } for (EncryptFrame ef: m_partial) { ef.frame.release(); } m_partial.clear(); m_outbuf.release(); final int unqueue = -m_ledger; updateQueued(unqueue, false); } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }</code><technical_language>Dont need check for exceptions too</technical_language>

Target:
synchronized void shutdown() { m_isShutdown = true; try { DeferredSerialization ds = null; while ((ds = m_queuedWrites.poll()) != null) { ds.cancel(); } int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); EncryptFrame frame = null; while ((frame = m_encrypted.poll()) != null) { frame.frame.release(); } for (EncryptFrame ef: m_partial) { ef.frame.release(); } m_partial.clear(); m_outbuf.release(); final int unqueue = -m_queuedBytes; updateQueued(unqueue, false); } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }
Source:
<code>public static String getAtsId(Artifact art) throws OseeCoreException { <START> String toReturn = art.getSoleAttributeValueAsString(AtsAttributeTypes.AtsId, AtsUtilCore.DEFAULT_ATS_ID_VALUE); <END> if (AtsUtilCore.DEFAULT_ATS_ID_VALUE.equals(toReturn)) { toReturn = art.getGuid(); } return toReturn; }</code><technical_language>check for null artifact using</technical_language>

Target:
public static String getAtsId(Artifact art) throws OseeCoreException { String toReturn = art.getSoleAttributeValueAsString(AtsAttributeTypes.AtsId, AtsUtilCore.DEFAULT_ATS_ID_VALUE); Conditions.checkNotNull("AtsId", "AtsId"); if (AtsUtilCore.DEFAULT_ATS_ID_VALUE.equals(toReturn)) { toReturn = art.getGuid(); } return toReturn; }