auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void exportFilesAsList() throws SemanticException, IOException { try (BufferedWriter writer = writer()) { <START> RemoteIterator<LocatedFileStatus> itr = dataFileSystem.listFiles(dataFileListPath, true); <END> while (itr.hasNext()) { LocatedFileStatus fileStatus = itr.next(); if (shouldExport(fileStatus)) { writer.write(encodedUri(fileStatus)); writer.newLine(); } } } }</code><technical_language>listFiles basically lists files. If sub-dir found, recursively list files inside. This means, if sub-dir names starts "_" ".", filter files sub-dir listing (using shouldExport). Also, this iterator lists files in directory in shot memory advantage. LoadSemanticAnalyzer.matchFilesOrDir base code</technical_language>

Target:
private void exportFilesAsList() throws SemanticException, IOException { try (BufferedWriter writer = writer()) { FileStatus[] fileStatuses = LoadSemanticAnalyzer.matchFilesOrDir(dataFileSystem, dataFileListPath); for (FileStatus fileStatus : fileStatuses) { writer.write(encodedUri(fileStatus)); writer.newLine(); } } }
Source:
<code>public static String decodeString(@Nonnull String s) { String out = ""; try { <START> out = URLDecoder.decode(s,"UTF-8"); <END> } catch (Exception e) return out; }</code><technical_language>Space comma</technical_language>

Target:
public static String decodeString(@Nonnull String s) { try { return URLDecoder.decode(s, "UTF-8"); } catch (UnsupportedEncodingException e) { return s; } }
Source:
<code>public List<ScriptSequenceAction> addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { <START> sequence.addAction(sprite.getActionFactory().createStitchAction(sprite)); <END> return null; }</code><technical_language>changing createStitchAction(sprite) a static method in ActionFactory, is internal state need instance of ActionFactory here</technical_language>

Target:
public List<ScriptSequenceAction> addActionToSequence(Sprite sprite, ScriptSequenceAction sequence) { sequence.addAction(ActionFactory.createStitchAction(sprite)); return null; }
Source:
<code>protected Query rewriteTermsQuery(TermsQuery query) { Map<String, List<SpanTermQuery>> spanQueries = new HashMap<>(); try { Field termsField = TermsQuery.class.getDeclaredField("termData"); termsField.setAccessible(true); PrefixCodedTerms terms = (PrefixCodedTerms) termsField.get(query); PrefixCodedTerms.TermIterator it = terms.iterator(); for (int i = 0; i < terms.size(); i++) { BytesRef term = BytesRef.deepCopyOf(it.next()); <START> if (!spanQueries.containsKey(it.field())) { <END> spanQueries.put(it.field(), new ArrayList<SpanTermQuery>()); } spanQueries.get(it.field()).add(new SpanTermQuery(new Term(it.field(), term))); } BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (Map.Entry<String,List<SpanTermQuery>> entry : spanQueries.entrySet()) { List<SpanTermQuery> termQueries = entry.getValue(); builder.add(new SpanOrQuery(termQueries.toArray(new SpanTermQuery[termQueries.size()])), BooleanClause.Occur.SHOULD); } return builder.build(); } catch (Exception e) { throw new IllegalStateException(e); } }</code><technical_language>Hm, this I disagree - I ! is easy miss squashed opening parenthesis, explicit == false is obvious</technical_language>

Target:
protected Query rewriteTermsQuery(TermsQuery query) { Map<String, List<SpanTermQuery>> spanQueries = new HashMap<>(); try { Field termsField = TermsQuery.class.getDeclaredField("termData"); termsField.setAccessible(true); PrefixCodedTerms terms = (PrefixCodedTerms) termsField.get(query); PrefixCodedTerms.TermIterator it = terms.iterator(); for (int i = 0; i < terms.size(); i++) { BytesRef term = BytesRef.deepCopyOf(it.next()); if (spanQueries.containsKey(it.field()) == false) { spanQueries.put(it.field(), new ArrayList<SpanTermQuery>()); } spanQueries.get(it.field()).add(new SpanTermQuery(new Term(it.field(), term))); } BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (Map.Entry<String,List<SpanTermQuery>> entry : spanQueries.entrySet()) { List<SpanTermQuery> termQueries = entry.getValue(); builder.add(new SpanOrQuery(termQueries.toArray(new SpanTermQuery[termQueries.size()])), BooleanClause.Occur.SHOULD); } return builder.build(); } catch (Exception e) { throw new IllegalStateException(e); } }
Source:
<code>public Collection<Service> getAll() { <START> if (services == null) { <END> return null; } return services.values(); }</code><technical_language>this happen</technical_language>

Target:
public Collection<Service> getAll() { return services.values(); }
Source:
<code>public Key(String group, ModuleType type, String label) { <START> Assert.notNull(group, "Stream is required"); <END> Assert.notNull(type, "Type is required"); Assert.hasText(label, "Label is required"); this.group = group; this.type = type; this.label = label; }</code><technical_language>"Group is required"</technical_language>

Target:
public Key(String group, ModuleType type, String label) { Assert.notNull(group, "Group is required"); Assert.notNull(type, "Type is required"); Assert.hasText(label, "Label is required"); this.group = group; this.type = type; this.label = label; }
Source:
<code>private static int[] calculateLevelOffsets(int numItems, int degree) { List<Integer> offsets = new ArrayList<>(); offsets.add(0); int level = 0; while (numItems > 1) { <START> int capacity = ((numItems + degree - 1) / degree) * degree; <END> offsets.add(offsets.get(level) + ENVELOPE_SIZE * capacity); numItems = capacity / degree; level += 1; } return offsets.stream().mapToInt(Integer::intValue).toArray(); }</code><technical_language>capacity -> numChildren match buildTree</technical_language>

Target:
private static int[] calculateLevelOffsets(int numItems, int degree) { List<Integer> offsets = new ArrayList<>(); offsets.add(0); int level = 0; while (numItems > 1) { int numChildren = (int) Math.ceil(1.0 * numItems / degree) * degree; offsets.add(offsets.get(level) + ENVELOPE_SIZE * numChildren); numItems = numChildren / degree; level += 1; } return offsets.stream().mapToInt(Integer::intValue).toArray(); }
Source:
<code>public void testWifiEnterpriseConfigSerializeDeserializeThrowsIllegalArgException() throws Exception { WifiEnterpriseConfig config = new WifiEnterpriseConfig(); config.setFieldValue(WifiEnterpriseConfig.IDENTITY_KEY, TEST_IDENTITY); config.setFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY, TEST_ANON_IDENTITY); config.setFieldValue(WifiEnterpriseConfig.PASSWORD_KEY, TEST_PASSWORD); config.setFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY, TEST_CLIENT_CERT); config.setFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, TEST_CA_CERT); config.setFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY, TEST_SUBJECT_MATCH); config.setFieldValue(WifiEnterpriseConfig.ENGINE_KEY, TEST_ENGINE); config.setFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY, TEST_ENGINE_ID); config.setFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY, TEST_PRIVATE_KEY_ID); config.setFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY, TEST_ALTSUBJECT_MATCH); config.setFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY, TEST_DOM_SUFFIX_MATCH); config.setFieldValue(WifiEnterpriseConfig.CA_PATH_KEY, TEST_CA_PATH); config.setEapMethod(TEST_EAP_METHOD); config.setPhase2Method(TEST_PHASE2_METHOD); String xmlString = new String(serializeWifiEnterpriseConfig(config)); xmlString = xmlString.replaceAll( String.format(XML_STRING_EAP_METHOD_REPLACE_FORMAT, TEST_EAP_METHOD), String.format(XML_STRING_EAP_METHOD_REPLACE_FORMAT, WifiEnterpriseConfig.Eap.NONE)); <START> deserializeWifiEnterpriseConfig(xmlString.getBytes()); <END> }</code><technical_language>internally String#getBytes() UTF-8 default charset, explicitly more clear</technical_language>

Target:
public void testWifiEnterpriseConfigSerializeDeserializeThrowsIllegalArgException() throws Exception { WifiEnterpriseConfig config = new WifiEnterpriseConfig(); config.setFieldValue(WifiEnterpriseConfig.IDENTITY_KEY, TEST_IDENTITY); config.setFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY, TEST_ANON_IDENTITY); config.setFieldValue(WifiEnterpriseConfig.PASSWORD_KEY, TEST_PASSWORD); config.setFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY, TEST_CLIENT_CERT); config.setFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, TEST_CA_CERT); config.setFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY, TEST_SUBJECT_MATCH); config.setFieldValue(WifiEnterpriseConfig.ENGINE_KEY, TEST_ENGINE); config.setFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY, TEST_ENGINE_ID); config.setFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY, TEST_PRIVATE_KEY_ID); config.setFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY, TEST_ALTSUBJECT_MATCH); config.setFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY, TEST_DOM_SUFFIX_MATCH); config.setFieldValue(WifiEnterpriseConfig.CA_PATH_KEY, TEST_CA_PATH); config.setEapMethod(TEST_EAP_METHOD); config.setPhase2Method(TEST_PHASE2_METHOD); String xmlString = new String(serializeWifiEnterpriseConfig(config)); xmlString = xmlString.replaceAll( String.format(XML_STRING_EAP_METHOD_REPLACE_FORMAT, TEST_EAP_METHOD), String.format(XML_STRING_EAP_METHOD_REPLACE_FORMAT, WifiEnterpriseConfig.Eap.NONE)); deserializeWifiEnterpriseConfig(xmlString.getBytes(StandardCharsets.UTF_8)); }
Source:
<code>public void shouldUploadFileWithDefaultOptions() throws URISyntaxException, IOException { final String uploadingFileName = "Aclass.java"; final String pathToUploadingFileInsideTheProject = format("%s/%s", PROJECT_NAME, uploadingFileName); final Path localPathToFileToUpload = get(PROJECT_SOURCES.getPath()) .resolve("src/main/java/che/eclipse/sample") .resolve(uploadingFileName); openFormAndSelectUploadFile(localPathToFileToUpload); uploadFileDialogPage.clickOnUploadButton(); uploadFileDialogPage.waitOnClose(); notificationPopup.waitExpectedMessageOnProgressPanelAndClosed( format("File '%s' has uploaded successfully", uploadingFileName)); projectExplorer.waitVisibleItem(format("%s/%s", PROJECT_NAME, uploadingFileName)); projectExplorer.openItemByPath(pathToUploadingFileInsideTheProject); editor.typeTextIntoEditor(TEXT_TO_INSERT); projectExplorer.waitAndSelectItem(PROJECT_NAME); <START> <END> openFormAndSelectUploadFile(localPathToFileToUpload); uploadFileDialogPage.clickOnUploadButton(); uploadFileDialogPage.waitOnClose(); notificationPopup.waitExpectedMessageOnProgressPanelAndClosed( format("File '%s' has uploaded successfully", uploadingFileName)); projectExplorer.waitVisibleItem(pathToUploadingFileInsideTheProject); projectExplorer.openItemByPath(pathToUploadingFileInsideTheProject); editor.waitTextIntoEditor(TEXT_TO_INSERT); }</code><technical_language>if steps belong logical part "// re-upload file" do separate empty rows</technical_language>

Target:
public void shouldUploadFileWithDefaultOptions() throws URISyntaxException, IOException { final String uploadingFileName = "Aclass.java"; final String pathToUploadingFileInsideTheProject = format("%s/%s", PROJECT_NAME, uploadingFileName); final Path localPathToFileToUpload = get(PROJECT_SOURCES.getPath()) .resolve("src/main/java/che/eclipse/sample") .resolve(uploadingFileName); openFormAndSelectUploadFile(localPathToFileToUpload); uploadFileDialogPage.clickOnUploadButton(); uploadFileDialogPage.waitOnClose(); eventsPanel.clickEventLogBtn(); eventsPanel.waitExpectedMessage( format("File '%s' has uploaded successfully", uploadingFileName)); projectExplorer.waitVisibleItem(format("%s/%s", PROJECT_NAME, uploadingFileName)); projectExplorer.openItemByPath(pathToUploadingFileInsideTheProject); editor.typeTextIntoEditor(TEXT_TO_INSERT); projectExplorer.waitAndSelectItem(PROJECT_NAME); openFormAndSelectUploadFile(localPathToFileToUpload); uploadFileDialogPage.clickOnUploadButton(); uploadFileDialogPage.waitOnClose(); eventsPanel.clickEventLogBtn(); eventsPanel.waitExpectedMessage( format("File '%s' has uploaded successfully", uploadingFileName)); projectExplorer.waitVisibleItem(pathToUploadingFileInsideTheProject); projectExplorer.openItemByPath(pathToUploadingFileInsideTheProject); editor.waitTextIntoEditor(TEXT_TO_INSERT); }
Source:
<code>private void varify() { if (!letConsts.isEmpty()) { for (Node n : letConsts) { if (n.isConst()) { for (Node child : n.children()) { <START> Node declaration = new Node(Token.VAR, child.detachFromParent()); <END> declaration.useSourceInfoFrom(n); JSDocInfo existingInfo = n.getJSDocInfo(); if (existingInfo == null) { existingInfo = child.getJSDocInfo(); child.setJSDocInfo(null); } JSDocInfoBuilder builder = JSDocInfoBuilder.maybeCopyFrom(existingInfo); builder.recordConstancy(); JSDocInfo info = builder.build(); declaration.setJSDocInfo(info); n.getParent().addChildAfter(declaration, n); } n.detachFromParent(); } else { n.setType(Token.VAR); } } compiler.reportCodeChange(); } }</code><technical_language>nit: IR.var() shorter</technical_language>

Target:
private void varify() { if (!letConsts.isEmpty()) { for (Node n : letConsts) { if (n.isConst()) { for (Node child : n.children()) { Node declaration = IR.var(child.detachFromParent()); declaration.useSourceInfoFrom(n); JSDocInfo existingInfo = n.getJSDocInfo(); if (existingInfo == null) { existingInfo = child.getJSDocInfo(); child.setJSDocInfo(null); } JSDocInfoBuilder builder = JSDocInfoBuilder.maybeCopyFrom(existingInfo); builder.recordConstancy(); JSDocInfo info = builder.build(); declaration.setJSDocInfo(info); n.getParent().addChildAfter(declaration, n); } n.detachFromParent(); } else { n.setType(Token.VAR); } } compiler.reportCodeChange(); } }
Source:
<code>public int run() throws Exception { SitePaths sitePaths = new SitePaths(getSitePath()); File newSecureStoreFile = new File(newSecureStoreLib); if (!newSecureStoreFile.exists()) { throw new RuntimeException(String.format("File %s doesn't exists", newSecureStoreFile.getAbsolutePath())); } String newSecureStore = getNewSecureStoreClassName(newSecureStoreFile); String currentSecureStoreName = getCurrentSecureStoreClassName(sitePaths); if (currentSecureStoreName.equals(newSecureStore)) { <START> log.error("Old and new SecureStore implementation names " + "are the same. Migration will not work"); return -1; <END> } IoUtil.loadJARs(newSecureStoreFile); SiteLibraryLoaderUtil.loadSiteLib(sitePaths.lib_dir); log.info("Current secureStoreClass property ({}) will be replaced with {}", currentSecureStoreName, newSecureStore); Injector dbInjector = createDbInjector(SINGLE_USER); SecureStore currentStore = getSecureStore(currentSecureStoreName, dbInjector); SecureStore newStore = getSecureStore(newSecureStore, dbInjector); migrateProperties(currentStore, newStore); removeOldLib(sitePaths, currentSecureStoreName); copyNewLib(sitePaths, newSecureStoreFile); updateGerritConfig(sitePaths, newSecureStore); return 0; }</code><technical_language>throw a RuntimeException is done in line 62</technical_language>

Target:
public int run() throws Exception { SitePaths sitePaths = new SitePaths(getSitePath()); File newSecureStoreFile = new File(newSecureStoreLib); if (!newSecureStoreFile.exists()) { log.error(String.format("File %s doesn't exists", newSecureStoreFile.getAbsolutePath())); return -1; } String newSecureStore = getNewSecureStoreClassName(newSecureStoreFile); String currentSecureStoreName = getCurrentSecureStoreClassName(sitePaths); if (currentSecureStoreName.equals(newSecureStore)) { log.error("Old and new SecureStore implementation names " + "are the same. Migration will not work"); return -1; } IoUtil.loadJARs(newSecureStoreFile); SiteLibraryLoaderUtil.loadSiteLib(sitePaths.lib_dir); log.info("Current secureStoreClass property ({}) will be replaced with {}", currentSecureStoreName, newSecureStore); Injector dbInjector = createDbInjector(SINGLE_USER); SecureStore currentStore = getSecureStore(currentSecureStoreName, dbInjector); SecureStore newStore = getSecureStore(newSecureStore, dbInjector); migrateProperties(currentStore, newStore); removeOldLib(sitePaths, currentSecureStoreName); copyNewLib(sitePaths, newSecureStoreFile); updateGerritConfig(sitePaths, newSecureStore); return 0; }
Source:
<code>private FilterTypeEntity getFilterTypeEntityById(final Long filterTypeId) throws EntityRetrievalException { Query query = entityManager.createQuery( "from FilterTypeEntity where (NOT deleted = true) " + "AND (id = :filterTypeId) ", FilterTypeEntity.class); query.setParameter("filterTypeId", filterTypeId); List<FilterTypeEntity> result = query.getResultList(); if (result == null || result.size() == 0) { <START> String msg = String.format(messageSource.getMessage(new DefaultMessageSourceResolvable("user.notFound"), <END> LocaleContextHolder.getLocale())); throw new EntityRetrievalException(msg); } else if (result.size() > 1) { throw new EntityRetrievalException("Data error. Duplicate filter type in database."); } if (result.size() == 0) { return null; } return result.get(0); }</code><technical_language>a error message</technical_language>

Target:
private FilterTypeEntity getFilterTypeEntityById(final Long filterTypeId) throws EntityRetrievalException { Query query = entityManager.createQuery( "from FilterTypeEntity where (NOT deleted = true) " + "AND (id = :filterTypeId) ", FilterTypeEntity.class); query.setParameter("filterTypeId", filterTypeId); List<FilterTypeEntity> result = query.getResultList(); if (result == null || result.size() == 0) { throw new EntityRetrievalException("Date error. Filter type not found in database."); } else if (result.size() > 1) { throw new EntityRetrievalException("Data error. Duplicate filter type in database."); } if (result.size() == 0) { return null; } return result.get(0); }
Source:
<code>public void purgeDeletedCertificateCodeSnippets() { CertificateAsyncClient certificateAsyncClient = getCertificateAsyncClient(); certificateAsyncClient.purgeDeletedCertificate("deletedCertificateName") .subscriberContext(Context.of(key1, value1, key2, value2)) <START> .doOnSuccess(response -> System.out.println("Successfully Purged certificate \n")); <END> END: com.azure.security.keyvault.certificates.CertificateAsyncClient.purgeDeletedCertificate#string }</code><technical_language>need \n</technical_language>

Target:
public void purgeDeletedCertificateCodeSnippets() { CertificateAsyncClient certificateAsyncClient = getCertificateAsyncClient(); certificateAsyncClient.purgeDeletedCertificate("deletedCertificateName") .subscriberContext(Context.of(key1, value1, key2, value2)) .doOnSuccess(response -> System.out.println("Successfully Purged certificate")); END: com.azure.security.keyvault.certificates.CertificateAsyncClient.purgeDeletedCertificate#string }
Source:
<code><START> public RealmResults(BaseRealm realm, Collection collection, Class<E> clazz) { <END> super(realm, collection, clazz); }</code><technical_language>Is this needed</technical_language>

Target:
RealmResults(BaseRealm realm, Collection collection, Class<E> clazz) { super(realm, collection, clazz); }
Source:
<code>public RepositoryPath moveFromTemporaryDirectory(TempRepositoryPath tempPath) throws IOException { <START> logger.debug(String.format("Mooving [%s]", tempPath.getTarget())); <END> RepositoryPath path = tempPath.getTempTarget(); if (!Files.exists(tempPath.getTarget())) { throw new IOException(String.format("[%s] target for [%s] don't exists!", TempRepositoryPath.class.getSimpleName(), tempPath)); } if (!Files.exists(unwrap(path).getParent())) { Files.createDirectories(unwrap(path).getParent()); } if (Files.exists(path.getTarget())) { Files.delete(path.getTarget()); } Files.move(tempPath.getTarget(), path.getTarget(), StandardCopyOption.ATOMIC_MOVE); return path; }</code><technical_language>Cosmetic: a typo in "Moving"</technical_language>

Target:
public RepositoryPath moveFromTemporaryDirectory(TempRepositoryPath tempPath) throws IOException { logger.debug(String.format("Moving [%s]", tempPath.getTarget())); RepositoryPath path = tempPath.getTempTarget(); if (!Files.exists(tempPath.getTarget())) { throw new IOException(String.format("[%s] target for [%s] don't exists!", TempRepositoryPath.class.getSimpleName(), tempPath)); } if (!Files.exists(unwrap(path).getParent())) { Files.createDirectories(unwrap(path).getParent()); } if (Files.exists(path.getTarget())) { Files.delete(path.getTarget()); } Files.move(tempPath.getTarget(), path.getTarget(), StandardCopyOption.ATOMIC_MOVE); return path; }
Source:
<code>public void update() { openPageFromFloatingQueue = false; List<Tab> tabList = Prefs.getTabs(); boolean shouldShowFloatingQueue = tabList.size() > 0; if <START> (tabList.size() > 0) { <END> List<PageBackStackItem> backStackItems = tabList.get(tabList.size() - 1).getBackStack(); if (backStackItems.size() > 0) { PageTitle title = backStackItems.get(backStackItems.size() - 1).getTitle(); floatingQueueArticle.setText(title.getDisplayText()); boolean shouldShowImage = shouldShowImage(title); floatingQueueThumbnail.getImage().setLegacyVisibilityHandlingEnabled(true); String imageUrl = Prefs.getFloatingQueueImage() == null ? title.getThumbUrl() : Prefs.getFloatingQueueImage(); if ((floatingQueueThumbnail.getTag() == null || !floatingQueueThumbnail.getTag().equals(imageUrl))) { floatingQueueThumbnail.load(shouldShowImage ? imageUrl : null); floatingQueueThumbnail.setTag(imageUrl); } floatingQueueCounts.setText(String.valueOf(tabList.size())); floatingQueueCounts.setTextSize(TypedValue.COMPLEX_UNIT_SP, tabList.size() > 99 ? TAB_COUNT_TEXT_SIZE_SMALL : TAB_COUNT_TEXT_SIZE_DEFAULT); setOnClickListener((v) -> { openPageFromFloatingQueue = true; callback.onFloatingQueueClicked(title); }); animation(false); } else { shouldShowFloatingQueue = false; } } setVisibility(shouldShowFloatingQueue ? VISIBLE : INVISIBLE); }</code><technical_language>boolean for readability</technical_language>

Target:
public void update() { openPageFromFloatingQueue = false; List<Tab> tabList = WikipediaApp.getInstance().getTabList(); boolean shouldShowFloatingQueue = tabList.size() > 0; if (shouldShowFloatingQueue) { List<PageBackStackItem> backStackItems = tabList.get(tabList.size() - 1).getBackStack(); if (backStackItems.size() > 0) { PageTitle title = backStackItems.get(backStackItems.size() - 1).getTitle(); floatingQueueArticle.setText(title.getDisplayText()); boolean shouldShowImage = shouldShowImage(title); floatingQueueThumbnail.getImage().setLegacyVisibilityHandlingEnabled(true); String imageUrl = Prefs.getFloatingQueueImage() == null ? title.getThumbUrl() : Prefs.getFloatingQueueImage(); if ((floatingQueueThumbnail.getTag() == null || !floatingQueueThumbnail.getTag().equals(imageUrl))) { floatingQueueThumbnail.load(shouldShowImage ? imageUrl : null); floatingQueueThumbnail.setTag(imageUrl); } floatingQueueCounts.setText(String.valueOf(tabList.size())); floatingQueueCounts.setTextSize(TypedValue.COMPLEX_UNIT_SP, tabList.size() > 99 ? TAB_COUNT_TEXT_SIZE_SMALL : TAB_COUNT_TEXT_SIZE_DEFAULT); setOnClickListener((v) -> { openPageFromFloatingQueue = true; callback.onFloatingQueueClicked(title); }); animation(false); } else { shouldShowFloatingQueue = false; } } setVisibility(shouldShowFloatingQueue ? VISIBLE : INVISIBLE); }
Source:
<code>public static void setUp() throws IOException { <START> emulatorProcess = (new ProcessBuilder()).command("mvn", "function:run").start(); <END> }</code><technical_language>suggestion emulatorProcess = new ProcessBuilder("mvn", "function:run").start();</technical_language>

Target:
public static void setUp() throws IOException { String baseDir = System.getProperty("basedir"); emulatorProcess = new ProcessBuilder() .command("mvn", "function:run") .directory(new File(baseDir)) .start(); }
Source:
<code>private void search() { if (disposable != null) { disposable.dispose(); } progressBar.setVisibility(View.VISIBLE); emptyViewHandler.hide(); disposable = Observable.fromCallable(this::performSearch) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(results -> { progressBar.setVisibility(View.GONE); this.results = results.first; adapter.updateItems(results.first); <START> if(getArguments().getLong(ARG_FEED,0)==0) <END> { adapterFeeds.updateData(results.second); } else { adapterFeeds.updateData(null); } String query = getArguments().getString(ARG_QUERY); emptyViewHandler.setMessage(getString(R.string.no_results_for_query, query)); }, error -> Log.e(TAG, Log.getStackTraceString(error))); }</code><technical_language>For AntennaPod, a slightly code style. is based [Google Java code style](<LINK_0> find details changed "checks" tab GitHub</technical_language>

Target:
private void search() { if (disposable != null) { disposable.dispose(); } progressBar.setVisibility(View.VISIBLE); emptyViewHandler.hide(); disposable = Observable.fromCallable(this::performSearch) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(results -> { progressBar.setVisibility(View.GONE); this.results = results.first; adapter.updateItems(results.first); if (getArguments().getLong(ARG_FEED, 0) == 0) { adapterFeeds.updateData(results.second); } else { adapterFeeds.updateData(Collections.emptyList()); } String query = getArguments().getString(ARG_QUERY); emptyViewHandler.setMessage(getString(R.string.no_results_for_query, query)); }, error -> Log.e(TAG, Log.getStackTraceString(error))); }
Source:
<code><START> public void addListenerOnMainMenuButton(){ <END> mainMenu = (Button) findViewById(R.id.main_menu_button_gps); mainMenu.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(v.getContext(), MainMenuActivity.class); startActivity(i); } }); }</code><technical_language>public? DONE</technical_language>

Target:
private void addListenerOnMainMenuButton() { mainMenu = (Button) findViewById(R.id.main_menu_button_gps); mainMenu.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(v.getContext(), MainMenuActivity.class); startActivity(i); } }); }
Source:
<code>public static Collection<ITmfTrace> getTraceSetWithExperiment(@Nullable ITmfTrace trace) { if (trace == null) { return ImmutableSet.of(); } List<@NonNull ITmfTrace> traces = trace.getChildren(ITmfTrace.class); <START> if (traces.size() > 0) { <END> Iterable<ITmfTrace> iterable = checkNotNull(Iterables.concat(Iterables.transform(traces, t -> getTraceSetWithExperiment(t)))); return ImmutableSet.<ITmfTrace>builder().add(trace).addAll(iterable).build(); } return Collections.singleton(trace); }</code><technical_language>isEmpty</technical_language>

Target:
public static Collection<ITmfTrace> getTraceSetWithExperiment(@Nullable ITmfTrace trace) { if (trace == null) { return ImmutableSet.of(); } List<@NonNull ITmfTrace> traces = trace.getChildren(ITmfTrace.class); if (!traces.isEmpty()) { Iterable<ITmfTrace> iterable = checkNotNull(Iterables.concat(Iterables.transform(traces, t -> getTraceSetWithExperiment(t)))); return ImmutableSet.<ITmfTrace>builder().add(trace).addAll(iterable).build(); } return Collections.singleton(trace); }
Source:
<code>protected DataSetReadyCallback createDataSetDomainSpecificCallback(final int startRange, final FilterSettings tableSettings, boolean lastPage) { return new AbstractDataSetReadyCallback(errorPopup, view, tableSettings.getUUID()) { @Override public void callback(DataSet dataSet) { Set<String> columns = new HashSet<String>(); for (int i = 0; i < dataSet.getRowCount(); i++) { Long processInstanceId = getColumnLongValue(dataSet, PROCESS_INSTANCE_ID, i); String variableName = getColumnStringValue(dataSet, VARIABLE_NAME, i); String variableValue = getColumnStringValue(dataSet, VARIABLE_VALUE, i); for (ProcessInstanceSummary pis : myProcessInstancesFromDataSet) { String initiator = pis.getInitiator(); if (pis.getProcessInstanceId().equals(processInstanceId) && !filterInitiator(variableName, variableValue, initiator)) { pis.addDomainData(variableName, variableValue); columns.add(variableName); } } } <START> final String filterValue = isFilteredByProcessId(tableSettings.getDataSetLookup().getOperationList()); <END> view.addDomainSpecifColumns(view.getListGrid(), columns, filterValue); updateDataOnCallback(myProcessInstancesFromDataSet, startRange, startRange + myProcessInstancesFromDataSet.size(), lastPage); } }; }</code><technical_language>this needed for fix</technical_language>

Target:
protected DataSetReadyCallback createDataSetDomainSpecificCallback(final int startRange, final FilterSettings tableSettings, boolean lastPage) { return errorHandlerBuilder.get().withUUID(tableSettings.getUUID()).withDataSetCallback( dataSet -> { Set<String> columns = new HashSet<String>(); for (int i = 0; i < dataSet.getRowCount(); i++) { Long processInstanceId = getColumnLongValue(dataSet, PROCESS_INSTANCE_ID, i); String variableName = getColumnStringValue(dataSet, VARIABLE_NAME, i); String variableValue = getColumnStringValue(dataSet, VARIABLE_VALUE, i); for (ProcessInstanceSummary pis : myProcessInstancesFromDataSet) { String initiator = pis.getInitiator(); if (pis.getProcessInstanceId().equals(processInstanceId) && !filterInitiator(variableName, variableValue, initiator)) { pis.addDomainData(variableName, variableValue); columns.add(variableName); } } } view.addDomainSpecifColumns(view.getListGrid(), columns); updateDataOnCallback(myProcessInstancesFromDataSet, startRange, startRange + myProcessInstancesFromDataSet.size(), lastPage); }) .withEmptyResultsCallback(() -> setEmptyResults()); }
Source:
<code>public static void main(String[] args) throws IOException { Configuration configuration = getCfg(); ServiceRegistry serviceRegistry = new ServiceRegistryCreator(getCfg()).getInstance(); br.com.caelum.vraptor.hibernate.SessionFactoryCreator sessionFactoryCreator = <START> new br.com.caelum.vraptor.hibernate.SessionFactoryCreator(configuration, serviceRegistry); <END> SchemaUpdate su = new SchemaUpdate(serviceRegistry, configuration); su.execute(true, false); }</code><technical_language>need full class name? change import</technical_language>

Target:
public static void main(String[] args) throws IOException { Configuration configuration = getCfg(); LOG.info("Executing SchemaUpdate. environment=" + environmentType); ServiceRegistry serviceRegistry = new ServiceRegistryCreator(getCfg()).getInstance(); SchemaUpdate su = new SchemaUpdate(serviceRegistry, configuration); su.execute(true, false); LOG.info("SchemaUpdate finished."); }
Source:
<code>public void updateMission(Mission mission) { SQLiteDatabase database = getWritableDatabase(); <START> ContentValues values = getValuesOfMission(Objects.requireNonNull(mission, "mission is null")); <END> String ts = String.valueOf(mission.timestamp); int rowsAffected; if (mission instanceof FinishedMission) { if (mission.storage.isInvalid()) { rowsAffected = database.update(FINISHED_TABLE_NAME, values, KEY_TIMESTAMP + " = ?", new String[]{ts}); } else { rowsAffected = database.update(FINISHED_TABLE_NAME, values, KEY_PATH + " = ?", new String[]{ mission.storage.getUri().toString() }); } } else { throw new UnsupportedOperationException("DownloadMission"); } if (rowsAffected != 1) { Log.e("FinishedMissionStore", "Expected 1 row to be affected by update but got " + rowsAffected); } }</code><technical_language>move this</technical_language>

Target:
public void updateMission(Mission mission) { ContentValues values = getValuesOfMission(Objects.requireNonNull(mission)); SQLiteDatabase database = getWritableDatabase(); String ts = String.valueOf(mission.timestamp); int rowsAffected; if (mission instanceof FinishedMission) { if (mission.storage.isInvalid()) { rowsAffected = database.update(FINISHED_TABLE_NAME, values, KEY_TIMESTAMP + " = ?", new String[]{ts}); } else { rowsAffected = database.update(FINISHED_TABLE_NAME, values, KEY_PATH + " = ?", new String[]{ mission.storage.getUri().toString() }); } } else { throw new UnsupportedOperationException("DownloadMission"); } if (rowsAffected != 1) { Log.e("FinishedMissionStore", "Expected 1 row to be affected by update but got " + rowsAffected); } }
Source:
<code>public void run() throws Exception { <START> metrics.timeStart = System.currentTimeMillis(); <END> super.run(); reportMetrics(); addOutliers(); }</code><technical_language>create a setter for timeStart</technical_language>

Target:
public void run() throws Exception { metrics.setTimeStart(System.currentTimeMillis()); super.run(); reportMetrics(); addOutliers(); }
Source:
<code>public void testTimestampFilter() { SWTBotView viewBot = fBot.viewById(FilterView.ID); viewBot.setFocus(); <START> SWTBot filterBot = viewBot.bot(); <END> SWTBotTree treeBot = filterBot.tree(); viewBot.toolbarButton("Add new filter").click(); treeBot.getTreeItem("FILTER <name>").select(); SWTBotText textBot = filterBot.text(); textBot.setFocus(); String filterName = "timestamp"; textBot.setText(filterName); SWTBotTreeItem filterNodeBot = treeBot.getTreeItem(FILTER_TEST + filterName); filterNodeBot.click(); filterNodeBot.contextMenu("TRACETYPE").click(); filterNodeBot.expand(); SWTBotCombo comboBot = filterBot.comboBox(); comboBot.setSelection(TRACETYPE); filterNodeBot.getNode(WITH_TRACETYPE).expand(); filterNodeBot.getNode(WITH_TRACETYPE).contextMenu(AND).click(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).contextMenu(CONTAINS).click(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).expand(); comboBot = selectCombo(filterBot); comboBot.setSelection(comboBot.itemCount() - 3); textBot = filterBot.text(); textBot.setFocus(); textBot.setText("100"); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).getNode("Timestamp CONTAINS \"100\"").select(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).select(); viewBot.toolbarButton("Save filters").click(); String ret = applyFilter(fBot, filterName); assertEquals("10/100", ret); }</code><technical_language>fBot</technical_language>

Target:
public void testTimestampFilter() { SWTBotView viewBot = fBot.viewById(FilterView.ID); viewBot.setFocus(); SWTBot filterBot = viewBot.bot(); SWTBotTree treeBot = filterBot.tree(); viewBot.toolbarButton("Add new filter").click(); treeBot.getTreeItem("FILTER <name>").select(); SWTBotText textBot = filterBot.text(); textBot.setFocus(); String filterName = "timestamp"; textBot.setText(filterName); SWTBotTreeItem filterNodeBot = treeBot.getTreeItem(FILTER_TEST + filterName); filterNodeBot.click(); filterNodeBot.contextMenu("TRACETYPE").click(); filterNodeBot.expand(); SWTBotCombo comboBot = filterBot.comboBox(); comboBot.setSelection(TRACETYPE); filterNodeBot.getNode(WITH_TRACETYPE).expand(); filterNodeBot.getNode(WITH_TRACETYPE).contextMenu(AND).click(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).contextMenu(CONTAINS).click(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).expand(); comboBot = filterBot.comboBox(); comboBot.setSelection(comboBot.itemCount() - 3); textBot = filterBot.text(); textBot.setFocus(); textBot.setText("100"); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).getNode("Timestamp CONTAINS \"100\"").select(); filterNodeBot.getNode(WITH_TRACETYPE).getNode(AND).select(); viewBot.toolbarButton("Save filters").click(); String ret = applyFilter(fBot, filterName); assertEquals("10/100", ret); }
Source:
<code>private static LogicalType fromSchemaImpl(Schema schema, boolean throwErrors) { String typeName = schema.getProp(LogicalType.LOGICAL_TYPE_PROP); LogicalType logicalType; try { if (TIMESTAMP_MILLIS.equals(typeName)) { logicalType = TIMESTAMP_MILLIS_TYPE; } else if (DECIMAL.equals(typeName)) { logicalType = new Decimal(schema); } else if (UUID.equals(typeName)) { logicalType = UUID_TYPE; } else if (DATE.equals(typeName)) { logicalType = DATE_TYPE; } else if (TIMESTAMP_MICROS.equals(typeName)) { logicalType = TIMESTAMP_MICROS_TYPE; } else if (TIME_MILLIS.equals(typeName)) { logicalType = TIME_MILLIS_TYPE; } else if (TIME_MICROS.equals(typeName)) { logicalType = TIME_MICROS_TYPE; } else if (REGISTERED_TYPES.containsKey(typeName)) { logicalType = REGISTERED_TYPES.get(typeName).fromSchema(schema); } else { logicalType = null; } if (logicalType != null) { logicalType.validate(schema); } } catch (RuntimeException e) { if (throwErrors) { throw e; } else { LOGGER.warn("Ignoring invalid logical type for name: {}", typeName); <START> LOGGER.debug("Invalid logical type found", e); <END> } logicalType = null; } return logicalType; }</code><technical_language>Optional: I suggest moving LOGGER.debug line if</technical_language>

Target:
private static LogicalType fromSchemaImpl(Schema schema, boolean throwErrors) { String typeName = schema.getProp(LogicalType.LOGICAL_TYPE_PROP); LogicalType logicalType; try { if (TIMESTAMP_MILLIS.equals(typeName)) { logicalType = TIMESTAMP_MILLIS_TYPE; } else if (DECIMAL.equals(typeName)) { logicalType = new Decimal(schema); } else if (UUID.equals(typeName)) { logicalType = UUID_TYPE; } else if (DATE.equals(typeName)) { logicalType = DATE_TYPE; } else if (TIMESTAMP_MICROS.equals(typeName)) { logicalType = TIMESTAMP_MICROS_TYPE; } else if (TIME_MILLIS.equals(typeName)) { logicalType = TIME_MILLIS_TYPE; } else if (TIME_MICROS.equals(typeName)) { logicalType = TIME_MICROS_TYPE; } else if (REGISTERED_TYPES.containsKey(typeName)) { logicalType = REGISTERED_TYPES.get(typeName).fromSchema(schema); } else { logicalType = null; } if (logicalType != null) { logicalType.validate(schema); } } catch (RuntimeException e) { LOG.debug("Invalid logical type found", e); if (throwErrors) { throw e; } LOG.warn("Ignoring invalid logical type for name: {}", typeName); logicalType = null; } return logicalType; }
Source:
<code>private void updateInfo(Workflow oldWorkflow, Workflow newWorkflow) { if (Objects.equals(oldWorkflow.getMode(), WorkflowMode.STUB)) { <START> oldWorkflow.setDescriptorType(newWorkflow.getDescriptorType()); <END> } oldWorkflow.setDefaultWorkflowPath(newWorkflow.getDefaultWorkflowPath()); oldWorkflow.setDefaultTestParameterFilePath(newWorkflow.getDefaultTestParameterFilePath()); if (newWorkflow.getDefaultVersion() != null) { if (!oldWorkflow.checkAndSetDefaultVersion(newWorkflow.getDefaultVersion())) { throw new CustomWebApplicationException("Workflow version does not exist.", HttpStatus.SC_BAD_REQUEST); } } }</code><technical_language>Hmm, user in this case a BAD_REQUEST similar</technical_language>

Target:
private void updateInfo(Workflow oldWorkflow, Workflow newWorkflow) { if (Objects.equals(oldWorkflow.getMode(), WorkflowMode.FULL) && !Objects.equals(oldWorkflow.getDescriptorType(), newWorkflow.getDescriptorType())) { throw new CustomWebApplicationException("You cannot change the descriptor type of a FULL workflow.", HttpStatus.SC_BAD_REQUEST); } if (Objects.equals(oldWorkflow.getMode(), WorkflowMode.STUB)) { oldWorkflow.setDescriptorType(newWorkflow.getDescriptorType()); } oldWorkflow.setDefaultWorkflowPath(newWorkflow.getDefaultWorkflowPath()); oldWorkflow.setDefaultTestParameterFilePath(newWorkflow.getDefaultTestParameterFilePath()); if (newWorkflow.getDefaultVersion() != null) { if (!oldWorkflow.checkAndSetDefaultVersion(newWorkflow.getDefaultVersion())) { throw new CustomWebApplicationException("Workflow version does not exist.", HttpStatus.SC_BAD_REQUEST); } } }
Source:
<code>public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object root = context.getDefaultVariable(); IContainer container = null; <START> if (root instanceof IContainer) { <END> container = (IContainer)root; } else if (root instanceof IAdaptable) { container = ((IAdaptable)root).getAdapter(IContainer.class); } if (container != null) { RecursiveSuffixFileFinder finder = new RecursiveSuffixFileFinder(); container.accept(finder); return EvaluationResult.valueOf(finder.foundFileWithSuffix()); } return EvaluationResult.FALSE; }</code><technical_language>handled Adapters.adapt</technical_language>

Target:
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object root = context.getDefaultVariable(); IContainer container = Adapters.adapt(root, IContainer.class); if (container != null) { RecursiveSuffixFileFinder finder = new RecursiveSuffixFileFinder(); container.accept(finder); return EvaluationResult.valueOf(finder.foundFileWithSuffix()); } return EvaluationResult.FALSE; }
Source:
<code>public static boolean isSuccess(final ResponseCode code) { <START> return code.codeClass == CodeClass.SUCCESS_RESPONSE.value; <END> }</code><technical_language>if code == null? return false throw a NPE</technical_language>

Target:
public static boolean isSuccess(final ResponseCode code) { if (null == code) { throw new NullPointerException("ResponseCode must not be null!"); } return code.codeClass == CodeClass.SUCCESS_RESPONSE.value; }
Source:
<code>public Object clone() { BibEntry clone = new BibEntry(type.getValue()); if (StandardEntryType.Misc.equals(type.getValue())) { <START> clone.changed = true; <END> } clone.fields = FXCollections.observableMap(new ConcurrentHashMap<>(fields)); return clone; }</code><technical_language>I doubt this fixed issue for other types. -- entry type is Article, clone is unchanged, too. Thus, serialization written</technical_language>

Target:
public Object clone() { BibEntry clone = new BibEntry(type.getValue()); clone.fields = FXCollections.observableMap(new ConcurrentHashMap<>(fields)); clone.commentsBeforeEntry = new String(commentsBeforeEntry); clone.parsedSerialization = new String(parsedSerialization); clone.changed = changed; return clone; }
Source:
<code>public List queryByAuditOptions(Integer outcome, List<String> eventTypeList, String userId, List<String> remoteHcidList, Date startDate, Date endDate) { Session session = null; List<AuditRepositoryRecord> queryList = null; try { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); session = sessionFactory.openSession(); LOG.info("Getting Record for Audit Query "); Criteria queryCriteria = session.createCriteria(AuditRepositoryRecord.class); if (outcome != null && outcome >= 0) { queryCriteria.add(Restrictions.eq("outcome", outcome)); } if (NullChecker.isNotNullish(eventTypeList)) { queryCriteria.add(Restrictions.in("eventType", eventTypeList)); } if (NullChecker.isNotNullish(userId)) { queryCriteria.add(Restrictions.eq("userId", userId)); } if (NullChecker.isNotNullish(remoteHcidList)) { queryCriteria.add(Restrictions.in("remoteHcid", remoteHcidList)); } if (startDate != null && endDate != null) { queryCriteria.add(Expression.between("eventTimestamp", new Date(startDate.getTime()), new Date(endDate.getTime()))); <START> } else if (startDate != null && endDate == null) { <END> queryCriteria.add(Restrictions.ge("eventTimestamp", new Date(startDate.getTime()))); } else if (startDate == null && endDate != null) { queryCriteria.add(Restrictions.le("eventTimestamp", new Date(endDate.getTime()))); } queryList = setProjectionFields(queryCriteria).list(); } catch (HibernateException e) { LOG.error("Exception in AuditLog.get() occurred due to :" + e.getLocalizedMessage(), e); } finally { closeSession(session, false); } return queryList; }</code><technical_language>Do need create a new Date object here? startDate endDate of type Date</technical_language>

Target:
public List queryByAuditOptions(Integer outcome, List<String> eventTypeList, String userId, List<String> remoteHcidList, Date startDate, Date endDate) { Session session = null; List<AuditRepositoryRecord> queryList = null; try { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); session = sessionFactory.openSession(); LOG.info("Getting Record for Audit Query "); Criteria queryCriteria = session.createCriteria(AuditRepositoryRecord.class); if (outcome != null && outcome >= 0) { queryCriteria.add(Restrictions.eq("outcome", outcome)); } if (NullChecker.isNotNullish(eventTypeList)) { queryCriteria.add(Restrictions.in("eventType", eventTypeList)); } if (NullChecker.isNotNullish(userId)) { queryCriteria.add(Restrictions.eq("userId", userId)); } if (NullChecker.isNotNullish(remoteHcidList)) { queryCriteria.add(Restrictions.in("remoteHcid", remoteHcidList)); } if (startDate != null && endDate != null) { queryCriteria.add(Expression.between("eventTimestamp", startDate, endDate)); } else if (startDate != null && endDate == null) { queryCriteria.add(Restrictions.ge("eventTimestamp", startDate)); } else if (startDate == null && endDate != null) { queryCriteria.add(Restrictions.le("eventTimestamp", endDate)); } queryList = setProjectionFields(queryCriteria).list(); } catch (HibernateException e) { LOG.error("Exception in AuditLog.get() occurred due to :" + e.getLocalizedMessage(), e); } finally { closeSession(session, false); } return queryList; }
Source:
<code>public JoinProcessorSupplier( final String stateStoreName, final IterativeJoin join, final List<String> joinVars, final List<String> allVars, final ProcessorResultFactory resultFactory) throws IllegalArgumentException { super(resultFactory); this.stateStoreName = requireNonNull(stateStoreName); this.join = requireNonNull(join); this.joinVars = requireNonNull(joinVars); this.allVars = requireNonNull(allVars); if(!allVars.subList(0, joinVars.size()).equals(joinVars)) { <START> throw new IllegalArgumentException("All vars must be lead by the join vars, but it did not. " + <END> "Join Vars: " + joinVars + ", All Vars: " + allVars); } }</code><technical_language>Awkward Exception message</technical_language>

Target:
public JoinProcessorSupplier( final String stateStoreName, final IterativeJoin join, final List<String> joinVars, final List<String> allVars, final ProcessorResultFactory resultFactory) throws IllegalArgumentException { super(resultFactory); this.stateStoreName = requireNonNull(stateStoreName); this.join = requireNonNull(join); this.joinVars = requireNonNull(joinVars); this.allVars = requireNonNull(allVars); if(!allVars.subList(0, joinVars.size()).equals(joinVars)) { throw new IllegalArgumentException("The allVars list must start with the joinVars list, but it did not. " + "Join Vars: " + joinVars + ", All Vars: " + allVars); } }
Source:
<code>public String setFormat() { <START> return "Drei Worte: !set option_name value_to_set. Versuch !help falls dir drei-Wort-Sätze zu kompliziert sind."; END> }</code><technical_language>No, perfect. Y'know obligatory comma. > Versuch !help, falls</technical_language>

Target:
public String setFormat() { return "Drei Worte: !set option_name value_to_set. Versuch !help, falls dir drei-Wort-Sätze zu kompliziert sind."; }
Source:
<code>private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } <START> LinkPreviewFunnel linkPreviewFunnel = new LinkPreviewFunnel(app, title); <END> if (linkPreviewFunnel.getVersion() == 0 || app.getReleaseType() == WikipediaApp.RELEASE_PROD) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); ((PageActivity) getActivity()).displayNewPage(title, historyEntry); linkPreviewFunnel.logLinkClick(); } else { LinkPreviewDialog dialog = LinkPreviewDialog.newInstance(title, linkPreviewFunnel.getVersion()); dialog.show(getActivity().getSupportFragmentManager(), "link_preview_dialog"); } }</code><technical_language>need LinkPreviewVersion</technical_language>

Target:
private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } LinkPreviewFunnel linkPreviewFunnel = new LinkPreviewFunnel(app, title); if (app.getReleaseType() == WikipediaApp.RELEASE_PROD || LinkPreviewVersion.getVersion(app) == 0) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); ((PageActivity) getActivity()).displayNewPage(title, historyEntry); linkPreviewFunnel.logNavigate(); } else { LinkPreviewDialog dialog = LinkPreviewDialog.newInstance(title, LinkPreviewVersion.getVersion(app)); dialog.show(getActivity().getSupportFragmentManager(), "link_preview_dialog"); } }
Source:
<code>public void detachDelegate() throws IOException { <START> wrapped.flush(); <END> wrapped = null; }</code><technical_language>NPE if invoked detached</technical_language>

Target:
public void detachDelegate() throws IOException { Preconditions.checkState(wrapped != null); wrapped.flush(); wrapped = null; }
Source:
<code>boolean isMeasurementWithinLimits() { double measurement; try { measurement = (double) currentValue(); } catch (ClassCastException ex) { return true; } <START> return Double.compare(lowerLimit(), measurement) <= 0 <END> && Double.compare(upperLimit(), measurement) >= 0; }</code><technical_language>this more readable lowerLimit() < measurement && measurement < upperLimit()</technical_language>

Target:
boolean isMeasurementWithinLimits() { double measurement; try { measurement = Double.valueOf(currentValue().toString()); } catch (ClassCastException ex) { return true; } return lowerLimit() <= measurement && measurement <= upperLimit(); }