auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private WebDriver createWebDriver() { System.out.print("Initializing Selenium: "); String browser = TestProperties.BROWSER; if (TestProperties.BROWSER_FIREFOX.equals(browser)) { System.out.println("Using Firefox."); String firefoxPath = TestProperties.FIREFOX_PATH; if (!firefoxPath.isEmpty()) { System.out.println("Custom path: " + firefoxPath); System.setProperty("webdriver.firefox.bin", firefoxPath); } FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.panel.shown", false); profile.setPreference("browser.helperApps.neverAsk.openFile", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.download.folderList", 2); profile.setPreference("browser.download.dir", System.getProperty("java.io.tmpdir")); <START> profile.setPreference("intl.accept_languages", "en-us, en"); <END> return new FirefoxDriver(profile); } else if (TestProperties.BROWSER_CHROME.equals(browser)) { System.out.println("Using Chrome with driver path: " + TestProperties.CHROMEDRIVER_PATH); System.setProperty("webdriver.chrome.driver", TestProperties.CHROMEDRIVER_PATH); ChromeOptions options = new ChromeOptions(); options.addArguments("--allow-file-access-from-files"); options.addArguments("--lang=en-us"); return new ChromeDriver(options); } System.out.println("Using " + browser + " is not supported!"); return null; }</code><technical_language>Remove this</technical_language>

Target:
private WebDriver createWebDriver() { System.out.print("Initializing Selenium: "); String browser = TestProperties.BROWSER; if (TestProperties.BROWSER_FIREFOX.equals(browser)) { System.out.println("Using Firefox."); String firefoxPath = TestProperties.FIREFOX_PATH; if (!firefoxPath.isEmpty()) { System.out.println("Custom path: " + firefoxPath); System.setProperty("webdriver.firefox.bin", firefoxPath); } FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.panel.shown", false); profile.setPreference("browser.helperApps.neverAsk.openFile", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.download.folderList", 2); profile.setPreference("browser.download.dir", System.getProperty("java.io.tmpdir")); return new FirefoxDriver(profile); } else if (TestProperties.BROWSER_CHROME.equals(browser)) { System.out.println("Using Chrome with driver path: " + TestProperties.CHROMEDRIVER_PATH); System.setProperty("webdriver.chrome.driver", TestProperties.CHROMEDRIVER_PATH); ChromeOptions options = new ChromeOptions(); options.addArguments("--allow-file-access-from-files"); return new ChromeDriver(options); } System.out.println("Using " + browser + " is not supported!"); return null; }
Source:
<code>protected void updateObserver() { List<Vector3> ungenerated = new ArrayList<>(); <START> final int viewDistance = network.getSyncDistance(); <END> World w = getWorld(); Transform t = physics.getTransform(); Point p = t.getPosition(); int cx = p.getChunkX(); int cy = p.getChunkY(); int cz = p.getChunkZ(); HashSet<SpoutChunk> observing = new HashSet<>((viewDistance * viewDistance * viewDistance * 3) / 2); Iterator<IntVector3> itr = observer.getLive(); if (itr == OBSERVING) { itr = new OutwardIterator(cx, cy, cz, viewDistance); } observeChunksFailed = false; while (itr.hasNext()) { IntVector3 v = itr.next(); Chunk chunk = w.getChunk(v.getX(), v.getY(), v.getZ(), LoadOption.LOAD_ONLY); if (chunk != null) { chunk.refreshObserver(this); observing.add((SpoutChunk) chunk); } else { ungenerated.add(new Vector3(v)); observeChunksFailed = true; } } observingChunks.removeAll(observing); for (SpoutChunk chunk : observingChunks) { if (chunk.isLoaded()) { chunk.removeObserver(this); } } observingChunks.clear(); observingChunks.addAll(observing); if (!ungenerated.isEmpty()) { w.queueChunksForGeneration(ungenerated); } }</code><technical_language>naming</technical_language>

Target:
protected void updateObserver() { List<Vector3> ungenerated = new ArrayList<>(); final int syncDistance = network.getSyncDistance(); World w = getWorld(); Transform t = physics.getTransform(); Point p = t.getPosition(); int cx = p.getChunkX(); int cy = p.getChunkY(); int cz = p.getChunkZ(); HashSet<SpoutChunk> observing = new HashSet<>((syncDistance * syncDistance * syncDistance * 3) / 2); Iterator<IntVector3> itr = observer.getLive(); if (itr == OBSERVING) { itr = new OutwardIterator(cx, cy, cz, syncDistance); } observeChunksFailed = false; while (itr.hasNext()) { IntVector3 v = itr.next(); Chunk chunk = w.getChunk(v.getX(), v.getY(), v.getZ(), LoadOption.LOAD_ONLY); if (chunk != null) { chunk.refreshObserver(this); observing.add((SpoutChunk) chunk); } else { ungenerated.add(new Vector3(v)); observeChunksFailed = true; } } observingChunks.removeAll(observing); for (SpoutChunk chunk : observingChunks) { if (chunk.isLoaded()) { chunk.removeObserver(this); } } observingChunks.clear(); observingChunks.addAll(observing); if (!ungenerated.isEmpty()) { w.queueChunksForGeneration(ungenerated); } }
Source:
<code>public static String computeXoauth(String username, String authToken) throws UnsupportedEncodingException { <START> return new String( <END> Base64.encodeBase64(String.format(XOAUTH_FORMAT, username, authToken).getBytes()), US_ASCII); }</code><technical_language>this line is packed logic, a couple of intermediate steps hurt</technical_language>

Target:
public static String computeXoauth(String username, String authToken) throws UnsupportedEncodingException { String formattedAuthenticationString = String.format(XOAUTH_FORMAT, username, authToken); byte[] base64encodedAuthenticationString = Base64.encodeBase64(formattedAuthenticationString.getBytes()); return new String(base64encodedAuthenticationString, US_ASCII); }
Source:
<code>public List<String> getHosts() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (hostsText == null) { return builder.build(); } <START> return builder.addAll(Splitter.on(',') <END> .trimResults() .omitEmptyStrings() .split(hostsText)) .build(); }</code><technical_language>property a JSON array of strings</technical_language>

Target:
public List<String> getHosts() { return hosts; }
Source:
<code>public void closeForm() { try { if (askDialog.isOpened()) { askDialog.confirmAndWaitClosed(); } if (preferences.isPreferencesFormOpened()) { preferences.clickOnCloseButton(); } preferences.waitPreferencesFormIsClosed(); } catch (Exception e) { <START> LOG.error(e.getLocalizedMessage(), e); <END> } }</code><technical_language>If error, fail test. log warning, do all</technical_language>

Target:
public void closeForm() { if (preferences.isPreferencesFormOpened()) { preferences.clickOnCloseButton(); } if (askDialog.isOpened()) { askDialog.confirmAndWaitClosed(); } preferences.waitPreferencesFormIsClosed(); }
Source:
<code>public static long zip(File directory, File outputZipFile, boolean fsync) throws IOException { if (!isZip(outputZipFile.getName())) { log.warn("No .zip suffix[%s], putting files from [%s] into it anyway.", outputZipFile, directory); } if (fsync) { return FileUtils.writeAtomically(outputZipFile, out -> zip(directory, out)); } else { <START> try (final FileOutputStream out = new FileOutputStream(outputZipFile)) { <END> return zip(directory, out); } } }</code><technical_language>Please FileOutputStream FileInputStream in new code (and properly eliminated code too), finalizable. Please a static factory method in Files</technical_language>

Target:
public static long zip(File directory, File outputZipFile, boolean fsync) throws IOException { if (!isZip(outputZipFile.getName())) { log.warn("No .zip suffix[%s], putting files from [%s] into it anyway.", outputZipFile, directory); } if (fsync) { return FileUtils.writeAtomically(outputZipFile, out -> zip(directory, out)); } else { try ( final FileChannel fileChannel = FileChannel.open( outputZipFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE ); final OutputStream out = Channels.newOutputStream(fileChannel) ) { return zip(directory, out); } } }
Source:
<code>public List<Attribute> getAttributes(PerunSession sess, UserExtSource ues) throws InternalErrorException { try { return jdbc.query("select " + getAttributeMappingSelectQuery("ues") + " from attr_names " + <START> "left join user_ext_source_attr_values ues on user_id=? and ext_source_id=? " + <END> "where namespace=? or (namespace in (?,?) and (ues.attr_value is not null or ues.attr_value_text is not null))", new AttributeRowMapper(sess, this, ues), ues.getUserId(), ues.getExtSource().getId(), AttributesManager.NS_UES_ATTR_CORE, AttributesManager.NS_UES_ATTR_DEF, AttributesManager.NS_UES_ATTR_OPT); } catch(EmptyResultDataAccessException ex) { log.debug("No attribute for UserExtSource exists."); return new ArrayList<Attribute>(); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }</code><technical_language>Hi, please change sql references user_id ext_source_id columns single ues_id mentioned in #1306</technical_language>

Target:
public List<Attribute> getAttributes(PerunSession sess, UserExtSource ues) throws InternalErrorException { try { return jdbc.query("select " + getAttributeMappingSelectQuery("ues") + " from attr_names " + "left join user_ext_source_attr_values ues on id=ues.attr_id and user_ext_source_id=? " + "where namespace=? or (namespace in (?,?) and (ues.attr_value is not null or ues.attr_value_text is not null))", new AttributeRowMapper(sess, this, ues), ues.getId(), AttributesManager.NS_UES_ATTR_CORE, AttributesManager.NS_UES_ATTR_DEF, AttributesManager.NS_UES_ATTR_OPT); } catch(EmptyResultDataAccessException ex) { log.debug("No attribute for UserExtSource exists."); return new ArrayList<Attribute>(); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code>public boolean hasCertChangedSince(Consumer consumer, Date date) { if (date == null) { return true; } Environment env = consumer.getEnvironment(); Owner owner = consumer.getOwner(); OwnerEnvContentAccess oeca = ownerEnvContentAccessCurator.getContentAccess( owner.getId(), env == null ? null : env.getId()); <START> if (oeca == null || consumer.getContentAccessCert() == null || <END> oeca.getUpdated().getTime() > date.getTime()) { return true; } return false; }</code><technical_language>return oeca == null || consumer.getContentAccessCert() == null || oeca.getUpdated().getTime() > date.getTime())</technical_language>

Target:
public boolean hasCertChangedSince(Consumer consumer, Date date) { if (date == null) { return true; } Environment env = consumer.getEnvironment(); Owner owner = consumer.getOwner(); OwnerEnvContentAccess oeca = ownerEnvContentAccessCurator.getContentAccess( owner.getId(), env == null ? null : env.getId()); return oeca == null || consumer.getContentAccessCert() == null || oeca.getUpdated().getTime() > date.getTime(); }
Source:
<code>public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = new BasicHttpRequest( "DELETE", TICKETS_URI + ticketUUID, HttpVersion.HTTP_1_1); DefaultBHttpClientConnection conn = getConnection(); HttpEntity response = executeRequest(request, conn); <START> finalize(response, conn); <END> }</code><technical_language>above, try resources</technical_language>

Target:
public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = new BasicHttpRequest( "DELETE", TICKETS_URI + ticketUUID, HttpVersion.HTTP_1_1); try (DefaultBHttpClientConnection conn = getConnection()) { consumeResponse(executeRequest(request, conn)); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
<code>public boolean hasPermission(Permission permission) { Optional<Session> session = getSession(); if (!session.isPresent()) { return false; } if (permission.equals(Permission.ANY_PERMISSION)) { return true; } if (authorizer == null) { <START> LOGGER.warn("Authorizer is not configured and is null. This will result in all permission checks to " + <END> "return false if a permission is specified."); return false; } return authorizer.hasPermission(session.get().getUser(), permission); }</code><technical_language>put a log in app deployment time stating authorizer is null, is need for this log</technical_language>

Target:
public boolean hasPermission(Permission permission) { Optional<Session> session = getSession(); if (!session.isPresent()) { return false; } if (permission.equals(Permission.ANY_PERMISSION)) { return true; } if (authorizer == null) { return false; } return authorizer.hasPermission(session.get().getUser(), permission); }
Source:
<code>String createUserAgent() { <START> return String.format("contentful.java/%s", Util.getProperty("version.name")); <END> }</code><technical_language>interesting add some more information here, e.g. iOS SDK logs OS version</technical_language>

Target:
String createUserAgent() { final Properties properties = System.getProperties(); return String.format("contentful.java/%s(%s %s) %s/%s", Util.getProperty("version.name"), properties.getProperty("java.runtime.name"), properties.getProperty("java.runtime.version"), properties.getProperty("os.name"), properties.getProperty("os.version") ); }
Source:
<code>public void beginRecognizeContentFromUrl() { String formUrl = "{form_url}"; formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl).subscribe( recognizePollingOperation -> recognizePollingOperation.getFinalResult().subscribe(contentPageResult -> { contentPageResult.forEach(recognizedForm -> { <START> System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); <END> System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); System.out.println("Recognized Tables: "); recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); }); })); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string }</code><technical_language>suggestion System.out.printf("Text angle: %s%n", recognizedForm.getTextAngle());</technical_language>

Target:
public void beginRecognizeContentFromUrl() { String formUrl = "{form_url}"; formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl).subscribe( recognizePollingOperation -> recognizePollingOperation.getFinalResult().subscribe(contentPageResult -> { contentPageResult.forEach(recognizedForm -> { System.out.printf("Text angle: %s%n", recognizedForm.getTextAngle()); System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); System.out.println("Recognized Tables: "); recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); }); })); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string }
Source:
<code>public MultivarGaussian(List params) { if (params.size() == 0) { expectMeanAsArg = true; expectCovarianceAsArg = true; return; } Object ob = params.get(0); int dims = 0; if (ob instanceof MatrixSpec) { dims = ((MatrixLib) ((MatrixSpec) ob).getValueIfNonRandom()).numRows(); } else { dims = ((MatrixLib) ob).numRows(); } <START> setDimension(dims); <END> if (params.size() == 1) { expectMeanAsArg = false; expectCovarianceAsArg = true; initParams(params); expectMeanAsArg = true; expectCovarianceAsArg = false; } else if (params.size() == 2) { expectMeanAsArg = true; expectCovarianceAsArg = true; initParams(params); expectMeanAsArg = false; expectCovarianceAsArg = false; } else { throw new IllegalArgumentException( "MultivarGaussian CPD expects at most 2 parameters, not " + params.size()); } }</code><technical_language>Line 82-90 put in initParams()</technical_language>

Target:
public MultivarGaussian(List params) { if (params.size() == 0) { expectMeanAsArg = true; expectCovarianceAsArg = true; return; } if (params.size() == 1) { expectMeanAsArg = false; expectCovarianceAsArg = true; initParams(params); expectMeanAsArg = true; expectCovarianceAsArg = false; } else if (params.size() == 2) { expectMeanAsArg = true; expectCovarianceAsArg = true; initParams(params); expectMeanAsArg = false; expectCovarianceAsArg = false; } else { throw new IllegalArgumentException( "MultivarGaussian CPD expects at most 2 parameters, not " + params.size()); } }
Source:
<code>private Priority getPriority(final String issueLevel) { Priority priority; if (issueLevel.contains("CriticalError")) { <START> priority = Priority.HIGH; <END> } else if (issueLevel.contains("Error")) { priority = Priority.HIGH; } else if (issueLevel.contains("CriticalWarning")) { priority = Priority.HIGH; } else if (issueLevel.contains("Warning")) { priority = Priority.NORMAL; } else { priority = Priority.LOW; } return priority; }</code><technical_language>einfacher: return Priority.HIGH und lokale Variable Priority lschen..</technical_language>

Target:
private Priority getPriority(final String issueLevel) { if (issueLevel == null || StringUtils.isEmpty(issueLevel)) { return Priority.HIGH; } if (issueLevel.contains("CriticalError")) { return Priority.HIGH; } else if (issueLevel.contains("Error")) { return Priority.HIGH; } else if (issueLevel.contains("CriticalWarning")) { return Priority.HIGH; } else if (issueLevel.contains("Warning")) { return Priority.NORMAL; } else { return Priority.LOW; } }
Source:
<code><START> public Integer getEstimatedMaxPartitionCount() { <END> return _estimatedMaxPartitionCount; }</code><technical_language>Return int? need autobox Integer</technical_language>

Target:
public int getEstimatedMaxPartitionCount() { return _estimatedMaxPartitionCount; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { <START> <END> }</code><technical_language>if fileRegex exists, try compiling invalid fails early pipeline creation failing runtime. If this in file move action, do too</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (config.fileRegex != null) { try { Pattern.compile(config.fileRegex); } catch (Exception e) { throw new IllegalArgumentException(String.format("File regex %s is invalid: %s", config.fileRegex, e.getMessage()), e); } } }
Source:
<code>private Optional<? extends Image> findImage(Integer id) { final String imageId = String.valueOf(id); Optional<? extends Image> image = Optional.fromNullable(images.get().get(imageId)); if (!image.isPresent()) { image = tryFind(images.get().values(), new Predicate<Image>() { @Override public boolean apply(Image input) { <START> return input.getProviderId().equals(imageId); <END> } }); } return image; }</code><technical_language>"image provider ID == image ID"? Is correct? protected private</technical_language>

Target:
protected Optional<? extends Image> findImage(Integer id) { final String imageId = String.valueOf(id); Optional<? extends Image> image = Optional.fromNullable(images.get().get(imageId)); if (!image.isPresent()) { image = tryFind(images.get().values(), new Predicate<Image>() { @Override public boolean apply(Image input) { return input.getProviderId().equals(imageId); } }); } return image; }
Source:
<code><START> public String getAnalysisUuid() { <END> return analysisUuid; }</code><technical_language>return Optional</technical_language>

Target:
public Optional<String> getAnalysisUuid() { return ofNullable(analysisUuid); }
Source:
<code>public void patchMetadataByAdmin() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); <START> String newName = "JohnReplace"; <END> List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.metadata", Matchers.allOf( MetadataMatcher.matchMetadata("eperson.firstname", newName)))); }</code><technical_language>This method is missing a context.restoreAuthSystemState(); creating EPerson</technical_language>

Target:
public void patchMetadataByAdmin() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@example.com") .build(); String newName = "JohnReplace"; context.restoreAuthSystemState(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.metadata", Matchers.allOf( MetadataMatcher.matchMetadata("eperson.firstname", newName)))); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasJsonPath("$.metadata", allOf( matchMetadata("eperson.firstname", newName))))); }
Source:
<code>public void sourceLikeCram( final String resourceName, final boolean isFile, final boolean expected) throws IOException { SeekableStream strm = isFile ? new SeekableFileStream(new File(TEST_DATA_DIR, resourceName)) : SeekableStreamFactory.getInstance().getStreamFor(new URL(resourceName)); <START> Assert.assertEquals(expected, SamStreams.sourceLikeCram(strm)); <END> }</code><technical_language>order actual, expected</technical_language>

Target:
public void sourceLikeCram( final String resourceName, final boolean isFile, final boolean expected) throws IOException { SeekableStream strm = isFile ? new SeekableFileStream(new File(TEST_DATA_DIR, resourceName)) : SeekableStreamFactory.getInstance().getStreamFor(new URL(resourceName)); Assert.assertEquals(SamStreams.sourceLikeCram(strm), expected); }
Source:
<code>public void onBlockDispense(BlockDispenseEvent event) { ConfigurationManager cfg = plugin.getGlobalStateManager(); WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld()); if (wcfg.blockPotions.size() > 0) { ItemStack item = event.getItem(); if (item.getType() == Material.POTION && !BukkitUtil.isWaterPotion(item)) { Potion potion = Potion.fromDamage(BukkitUtil.getPotionEffectBits(item)); for (PotionEffect effect : potion.getEffects()) { if (potion.isSplash() && wcfg.blockPotions.contains(effect.getType())) { event.setCancelled(true); return; } } } } <START> if (wcfg.disableArrowShooting && event.getItem().getTypeId() == ItemID.ARROW) <END> event.setCancelled(true); }</code><technical_language>a { end of this line</technical_language>

Target:
public void onBlockDispense(BlockDispenseEvent event) { ConfigurationManager cfg = plugin.getGlobalStateManager(); WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld()); if (wcfg.blockPotions.size() > 0) { ItemStack item = event.getItem(); if (item.getType() == Material.POTION && !BukkitUtil.isWaterPotion(item)) { Potion potion = Potion.fromDamage(BukkitUtil.getPotionEffectBits(item)); for (PotionEffect effect : potion.getEffects()) { if (potion.isSplash() && wcfg.blockPotions.contains(effect.getType())) { event.setCancelled(true); return; } } } } if (wcfg.disableArrowShooting && event.getItem().getTypeId() == ItemID.ARROW) { event.setCancelled(true); return; } }
Source:
<code>public void setUp() throws Exception { new File("src/test/resources/api/mappings").mkdirs(); new File("src/test/resources/api/__files").mkdirs(); new File("src/test/resources/raw/mappings").mkdirs(); new File("src/test/resources/raw/__files").mkdirs(); githubApi.enableRecordMappings(new SingleRootFileSource("src/test/resources/api/mappings"), new SingleRootFileSource("src/test/resources/api/__files")); githubRaw.enableRecordMappings(new SingleRootFileSource("src/test/resources/raw/mappings"), new SingleRootFileSource("src/test/resources/raw/__files")); githubApi.stubFor( get(urlMatching(".*")).atPriority(10).willReturn(aResponse().proxiedFrom("<LINK_0>"))); githubRaw.stubFor(get(urlMatching(".*")).atPriority(10) .willReturn(aResponse().proxiedFrom("<LINK_1>"))); github = Connector.connect("http://localhost:" + githubApi.port(), null); resetAllScenarios(); <START> handler = new RingBufferLogHandler(100); <END> final Logger logger = Logger.getLogger(getClass().getName()); logger.addHandler(handler); listener = new LogTaskListener(logger, Level.INFO); }</code><technical_language>want this 1000 so, some completely output get - basically want output check output</technical_language>

Target:
public void setUp() throws Exception { new File("src/test/resources/api/mappings").mkdirs(); new File("src/test/resources/api/__files").mkdirs(); new File("src/test/resources/raw/mappings").mkdirs(); new File("src/test/resources/raw/__files").mkdirs(); githubApi.enableRecordMappings(new SingleRootFileSource("src/test/resources/api/mappings"), new SingleRootFileSource("src/test/resources/api/__files")); githubRaw.enableRecordMappings(new SingleRootFileSource("src/test/resources/raw/mappings"), new SingleRootFileSource("src/test/resources/raw/__files")); githubApi.stubFor( get(urlMatching(".*")).atPriority(10).willReturn(aResponse().proxiedFrom("<LINK_0>"))); githubRaw.stubFor(get(urlMatching(".*")).atPriority(10) .willReturn(aResponse().proxiedFrom("<LINK_1>"))); github = Connector.connect("http://localhost:" + githubApi.port(), null); resetAllScenarios(); handler = new RingBufferLogHandler(1000); final Logger logger = Logger.getLogger(getClass().getName()); logger.addHandler(handler); listener = new LogTaskListener(logger, Level.INFO); ApiRateLimitChecker.setEntropy(entropy); ApiRateLimitChecker.setExpirationWaitMillis(20); ApiRateLimitChecker. setNotificationWaitMillis(60); }
Source:
<code>public Void visitSetPath(SetPath node, Integer indent) { builder.append("SET PATH "); <START> builder.append(node.getPath().stream().map(element -> format(element.toString())).collect(joining(", "))); <END> return null; }</code><technical_language>this is a bit complicated, split more readable: String setPath = node.getPath().stream() .map(element -> format(element.toString())) .collect(joining(", ")); builder.append(setPath);</technical_language>

Target:
public Void visitSetPath(SetPath node, Integer indent) { builder.append("SET PATH "); builder.append(Joiner.on(", ").join(node.getPathSpecification().getPath())); return null; }
Source:
<code>public void handleEvent(Event event) { EventContext ctx = event.getContext(); if (ctx instanceof DocumentEventContext) { DocumentEventContext docCtx = (DocumentEventContext) ctx; <START> CoreSession session = docCtx.getCoreSession(); <END> DocumentModel doc = docCtx.getSourceDocument(); if (doc == null) { return; } DocumentRef versionRef = (DocumentRef) ctx.getProperty("checkedInVersionRef"); if (session.hasChild(versionRef, COMMENTS_DIRECTORY)) { DocumentModel comments = session.getChild(versionRef, COMMENTS_DIRECTORY); updateCommentProperties(session, comments.getId(), versionRef.reference().toString()); } } }</code><technical_language>move if it</technical_language>

Target:
protected void handleEvent(Event event) { EventContext ctx = event.getContext(); CoreSession session = ctx.getCoreSession(); DocumentRef versionRef = (DocumentRef) ctx.getProperty("checkedInVersionRef"); if (versionRef != null && session.hasChild(versionRef, COMMENTS_DIRECTORY)) { DocumentModel comments = session.getChild(versionRef, COMMENTS_DIRECTORY); updateCommentProperties(session, comments.getId(), versionRef.reference().toString()); } }
Source:
<code>public List<Variant> mapLine(String line, int lineNumber) throws Exception { <START> Assert.notNull(factory, this.getClass().getSimpleName() + " should be used to read aggregated VCFs only " + <END> "(hint: do not set Aggregation to NONE)"); return factory.create(fileId, studyId, line); }</code><technical_language>this optimized Java compiler JVM, but, instead of checking factory is null in line, throw exception in constructor if aggregation is recognized (adding a default switch-case)</technical_language>

Target:
public List<Variant> mapLine(String line, int lineNumber) throws Exception { return factory.create(fileId, studyId, line); }
Source:
<code>public void showRevisions() { project = appContext.getCurrentProject().getRootProject(); <START> String pattern; <END> String path; Selection<ResourceBasedNode< ? >> selection = getExplorerSelection(); if (selection == null || selection.getHeadElement() == null) { path = project.getPath(); } else { path = ((HasStorablePath)selection.getHeadElement()).getStorablePath(); } pattern = path.replaceFirst(project.getPath(), ""); selectedFile = (pattern.startsWith("/")) ? pattern.replaceFirst("/", "") : pattern; getRevisions(); }</code><technical_language>do need declaration of this field here</technical_language>

Target:
public void showRevisions() { project = appContext.getCurrentProject().getRootProject(); String path; Selection<?> selection = getExplorerSelection(); if (selection == null || selection.getHeadElement() == null) { path = project.getPath(); } else { path = ((HasStorablePath)selection.getHeadElement()).getStorablePath(); } String pattern = path.replaceFirst(project.getPath(), ""); selectedFile = (pattern.startsWith("/")) ? pattern.replaceFirst("/", "") : pattern; getRevisions(); }
Source:
<code>public String getXWidgetsXml() { switch (source) { case FILE: <START> return OseeInf.getResourceContents(getClass().getSimpleName(), getClass()); <END> case DEFAULT: default: StringBuilder sb = new StringBuilder(); sb.append("<xWidgets>"); sb.append(branchXWidgetXml); sb.append(BRANCH_VIEW_WIDGET); sb.append("</xWidgets>"); return sb.toString(); } }</code><technical_language>call getXwidgetsXmlFromUiFile (fixed below)</technical_language>

Target:
public String getXWidgetsXml() { switch (source) { case FILE: return getXWidgetsXmlFromUiFile(getClass().getSimpleName(), getClass()); case DEFAULT: default: StringBuilder sb = new StringBuilder(); sb.append("<xWidgets>"); sb.append(branchXWidgetXml); sb.append(BRANCH_VIEW_WIDGET); sb.append("</xWidgets>"); return sb.toString(); } }
Source:
<code>protected HttpURLConnection createConnection(URL url, String username, String password, String authKey, String authIV, String userAgent, String acceptedVersion, String acceptedMediaType, ISSLCertificateCallback callback, int timeout) throws IOException { LOGGER.trace( "creating connection to using username \"{}\" and password \"{}\"", new Object[] { url, username, password }); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); <START> if (isHttps(url)) { <END> HttpsURLConnection httpsConnection = (HttpsURLConnection) connection; SSLContext sslContext = setSSLCallback(sslCertificateCallback, url, httpsConnection); setCipherFilter(excludedSSLCipherRegex, sslContext, url, httpsConnection); } setAuthorisation(username, password, authKey, authIV, connection); connection.setUseCaches(false); connection.setDoInput(true); connection.setAllowUserInteraction(false); setConnectTimeout(NO_TIMEOUT, connection); setReadTimeout(timeout, connection); connection.setInstanceFollowRedirects(true); setUserAgent(userAgent, authKey, connection); setAcceptHeader(acceptedVersion, acceptedMediaType, connection); return connection; }</code><technical_language>this _only_ added if certificate needs rewired</technical_language>

Target:
protected HttpURLConnection createConnection(URL url, String username, String password, String authKey, String authIV, String userAgent, String acceptedVersion, String acceptedMediaType, ISSLCertificateCallback callback, int timeout) throws IOException { LOGGER.trace( "creating connection to using username \"{}\" and password \"{}\"", new Object[] { url, username, password }); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); if (isHttps(url)) { HttpsURLConnection httpsConnection = (HttpsURLConnection) connection; SSLContext sslContext = setSSLCallback(sslAuthorizationCallback, url, httpsConnection); setFilteredCiphers(excludedSSLCipherRegex, sslContext, httpsConnection); } setAuthorisation(username, password, authKey, authIV, connection); connection.setUseCaches(false); connection.setDoInput(true); connection.setAllowUserInteraction(false); setConnectTimeout(NO_TIMEOUT, connection); setReadTimeout(timeout, connection); connection.setInstanceFollowRedirects(true); setUserAgent(userAgent, authKey, connection); setAcceptHeader(acceptedVersion, acceptedMediaType, connection); return connection; }
Source:
<code>public ValuesMatcher( Map<String, Integer> outputSymbolAliases, Optional<Integer> expectedOutputSymbolCount, Optional<List<List<Expression>>> expectedRows) { <START> this.outputSymbolAliases = requireNonNull(outputSymbolAliases, "outputSymbolAliases is null"); <END> this.expectedOutputSymbolCount = requireNonNull(expectedOutputSymbolCount, "expectedOutputSymbolCount is null"); this.expectedRows = requireNonNull(expectedRows, "expectedRows is null"); }</code><technical_language>ImmutableMap.copyOf()</technical_language>

Target:
public ValuesMatcher( Map<String, Integer> outputSymbolAliases, Optional<Integer> expectedOutputSymbolCount, Optional<List<List<Expression>>> expectedRows) { this.outputSymbolAliases = ImmutableMap.copyOf(outputSymbolAliases); this.expectedOutputSymbolCount = requireNonNull(expectedOutputSymbolCount, "expectedOutputSymbolCount is null"); this.expectedRows = requireNonNull(expectedRows, "expectedRows is null"); }
Source:
<code>public static String authorsAlpha(AuthorList authorList) { StringBuilder authors = new StringBuilder(); <START> String[] tokens = authorList.getAuthors().stream().map(Author::getLastOnly).toArray(String[]::new); <END> int max = tokens.length > 4 ? 3 : tokens.length; if (max == 1) { String[] firstAuthor = tokens[0].replaceAll("\\s+", " ").trim().split(" "); for (int j = 0; j < (firstAuthor.length - 1); j++) { authors.append(firstAuthor[j].substring(0, 1)); } authors.append(firstAuthor[firstAuthor.length - 1], 0, Math.min(3, firstAuthor[firstAuthor.length - 1].length())); } else { for (int i = 0; i < max; i++) { String[] curAuthor = tokens[i].replaceAll("\\s+", " ").trim().split(" "); for (String aCurAuthor : curAuthor) { authors.append(aCurAuthor, 0, 1); } } if (tokens.length > 4) { authors.append("+"); } } return authors.toString(); }</code><technical_language>a list instead of array</technical_language>

Target:
private static String authorsAlpha(AuthorList authorList) { StringBuilder alphaStyle = new StringBuilder(); int maxAuthors = authorList.getNumberOfAuthors() <= MAX_ALPHA_AUTHORS ? authorList.getNumberOfAuthors() : (MAX_ALPHA_AUTHORS - 1); if (authorList.getNumberOfAuthors() == 1) { String[] firstAuthor = authorList.getAuthor(0).getLastOnly() .replaceAll("\\s+", " ").trim().split(" "); for (int j = 0; j < (firstAuthor.length - 1); j++) { alphaStyle.append(firstAuthor[j], 0, 1); } alphaStyle.append(firstAuthor[firstAuthor.length - 1], 0, Math.min(3, firstAuthor[firstAuthor.length - 1].length())); } else { List<String> vonAndLastNames = authorList.getAuthors().stream() .limit(maxAuthors).map(Author::getLastOnly) .collect(Collectors.toList()); for (String vonAndLast : vonAndLastNames) { String[] nameParts = vonAndLast.replaceAll("\\s+", " ").trim().split(" "); for (String part : nameParts) { alphaStyle.append(part, 0, 1); } } if (authorList.getNumberOfAuthors() > MAX_ALPHA_AUTHORS) { alphaStyle.append("+"); } } return alphaStyle.toString(); }
Source:
<code><START> private void ensureIndexes() { <END> storageStrategy.ensureIndexes(template.eventCollection(), template.snapshotCollection()); }</code><technical_language>Adjusting this private a breaking change - please public. replacing @PostConstruct for @Deprecated is sufficient I think</technical_language>

Target:
public void ensureIndexes() { storageStrategy.ensureIndexes(template.eventCollection(), template.snapshotCollection()); }
Source:
<code>private void postError(RealmNotifier handler, final AppException error, App.Callback<T> callback) { boolean errorHandled; Runnable action = new Runnable() { @Override public void run() { if (!isCancelled) { callback.onResult(App.Result.withError(error)); <START> isCancelled = true; <END> } } }; errorHandled = handler.post(action); if (!errorHandled) { RealmLog.error(error, "An error was thrown, but could not be posted: \n" + error.toString()); } }</code><technical_language>Is this semantically correct</technical_language>

Target:
private void postError(RealmNotifier handler, final AppException error, App.Callback<T> callback) { boolean errorHandled; Runnable action = new Runnable() { @Override public void run() { if (!isCancelled) { callback.onResult(App.Result.withError(error)); } } }; errorHandled = handler.post(action); if (!errorHandled) { RealmLog.error(error, "An error was thrown, but could not be posted: \n" + error.toString()); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (dataCollection == null ? 0 : dataCollection.hashCode()); <START> return result; <END> }</code><technical_language>return (dataCollection == null ? 0 : dataCollection.hashCode());</technical_language>

Target:
public int hashCode() { return dataCollection == null ? 0 : dataCollection.hashCode(); }
Source:
<code>public static String getDefaultRepositoryDir() { String key = GitCorePreferences.core_defaultRepositoryDir; String dir = migrateRepoRootPreference(); IEclipsePreferences p = InstanceScope.INSTANCE .getNode(Activator.getPluginId()); if (dir == null) { dir = Platform.getPreferencesService().getString( Activator.getPluginId(), key, getDefaultDefaultRepositoryDir(), null); } else { p.put(key, dir); } IStringVariableManager manager = VariablesPlugin.getDefault() .getStringVariableManager(); String result; try { result = manager.performStringSubstitution(dir); } catch (CoreException e) { result = ""; } if (result == null || result.isEmpty()) { result = ResourcesPlugin.getWorkspace().getRoot().getRawLocation() .toOSString(); } try { result = FileSystems.getDefault().getPath(result).normalize() .toAbsolutePath().toString(); } catch (Exception e) { <START> } <END> return result; }</code><technical_language>roads lead Rome... I done return FileUtils.canonicalize(new File(result)).toString(); (using org.eclipse.jgit.util.FileUtils)</technical_language>

Target:
public static String getDefaultRepositoryDir() { String key = GitCorePreferences.core_defaultRepositoryDir; String dir = migrateRepoRootPreference(); IEclipsePreferences p = InstanceScope.INSTANCE .getNode(Activator.getPluginId()); if (dir == null) { dir = Platform.getPreferencesService().getString( Activator.getPluginId(), key, getDefaultDefaultRepositoryDir(), null); } else { p.put(key, dir); } IStringVariableManager manager = VariablesPlugin.getDefault() .getStringVariableManager(); String result; try { result = manager.performStringSubstitution(dir); } catch (CoreException e) { result = ""; } if (result == null || result.isEmpty()) { result = ResourcesPlugin.getWorkspace().getRoot().getRawLocation() .toOSString(); } return FileUtils.canonicalize(new File(result)).toString(); }
Source:
<code>protected void writeTextFields() { super.writeTextFields(); setTextField(PROTOMECH_INDEX, "PROTOMECH " + (unitIndex + 1)); splitName(); if (getEntity().hasUMU()) { setTextField(LBL_JUMP, "Underwater:"); setTextField(MP_JUMP, getEntity().getAllUMUCount()); } printTorsoCritChart(); if (!proto.hasMainGun()) { hideElement(MAIN_GUN_ARMOR); hideElement(MAIN_GUN_SHADOW); hideElement(MAIN_GUN_TEXT); } if (proto.hasUMU()) { <START> setTextField(LBL_JUMP, "Underwater"); <END> } }</code><technical_language>This redundant and/or replaces line 90</technical_language>

Target:
protected void writeTextFields() { super.writeTextFields(); setTextField(PROTOMECH_INDEX, "PROTOMECH " + (unitIndex + 1)); splitName(); if (getEntity().hasUMU()) { setTextField(LBL_JUMP, "Underwater:"); setTextField(MP_JUMP, getEntity().getAllUMUCount()); } printTorsoCritChart(); if (!proto.hasMainGun()) { hideElement(MAIN_GUN_ARMOR); hideElement(MAIN_GUN_SHADOW); hideElement(MAIN_GUN_TEXT); } }
Source:
<code>public DenseMatrix horzcatDense(final List<Vector> vectors) { <START> List<breeze.linalg.DenseVector<Double>> breezeVecList = Lists.transform(vectors, <END> new Function<Vector, breeze.linalg.DenseVector<Double>>() { public breeze.linalg.DenseVector<Double> apply(final Vector vector) { return ((DenseVector) vector).getBreezeVector(); } }); return new DenseMatrix( breeze.linalg.DenseVector.horzcat(JavaConversions.asScalaBuffer(breezeVecList), TAG, ZERO)); }</code><technical_language>Please add final</technical_language>

Target:
public DenseMatrix horzcatDense(final List<Vector> vectors) { final List<breeze.linalg.DenseVector<Double>> breezeVecList = Lists.transform(vectors, new Function<Vector, breeze.linalg.DenseVector<Double>>() { public breeze.linalg.DenseVector<Double> apply(final Vector vector) { return ((DenseVector) vector).getBreezeVector(); } }); return new DenseMatrix( breeze.linalg.DenseVector.horzcat(JavaConversions.asScalaBuffer(breezeVecList), TAG, ZERO)); }
Source:
<code><START> public PinotConnectorPlanOptimizer(PinotQueryGenerator pinotQueryGenerator, TypeManager typeManager, FunctionMetadataManager functionMetadataManager, LogicalRowExpressions logicalRowExpressions, StandardFunctionResolution standardFunctionResolution) <END> { this.pinotQueryGenerator = requireNonNull(pinotQueryGenerator, "pinot query generator is null"); this.typeManager = requireNonNull(typeManager, "type manager"); this.functionMetadataManager = requireNonNull(functionMetadataManager, "function manager"); this.logicalRowExpressions = requireNonNull(logicalRowExpressions, "logical row expressions"); this.standardFunctionResolution = requireNonNull(standardFunctionResolution, "standard function resolution"); }</code><technical_language>If argument list long, prefer write argument line</technical_language>

Target:
public PinotConnectorPlanOptimizer( PinotQueryGenerator pinotQueryGenerator, TypeManager typeManager, FunctionMetadataManager functionMetadataManager, LogicalRowExpressions logicalRowExpressions, StandardFunctionResolution standardFunctionResolution) { this.pinotQueryGenerator = requireNonNull(pinotQueryGenerator, "pinot query generator is null"); this.typeManager = requireNonNull(typeManager, "type manager is null"); this.functionMetadataManager = requireNonNull(functionMetadataManager, "function manager is null"); this.logicalRowExpressions = requireNonNull(logicalRowExpressions, "logical row expressions is null"); this.standardFunctionResolution = requireNonNull(standardFunctionResolution, "standard function resolution is null"); }
Source:
<code>public String[] getIdentityColumns() { checkInitialized(); final String table = getTableAlias(); if ( table == null ) { throw new IllegalStateException( "No table alias for node " + this ); } final String[] propertyNames = getIdentifierPropertyNames(); List<String> columns = new ArrayList<>(); final boolean inSelect = getWalker().getStatementType() == HqlSqlTokenTypes.SELECT; for ( int i = 0; i < propertyNames.length; i++ ) { String[] propertyNameColumns = toColumns( table, propertyNames[i], inSelect ); <START> columns.addAll(Arrays.asList(propertyNameColumns)); <END> } return columns.toArray( new String[columns.size()] ); }</code><technical_language>is a a new Arrays.asList wrapper allocated. java.util.Collections.addAll();</technical_language>

Target:
public String[] getIdentityColumns() { checkInitialized(); final String table = getTableAlias(); if ( table == null ) { throw new IllegalStateException( "No table alias for node " + this ); } final String[] propertyNames = getIdentifierPropertyNames(); ArrayList<String> columns = new ArrayList<>( propertyNames.length ); final boolean inSelect = getWalker().getStatementType() == HqlSqlTokenTypes.SELECT; for ( String propertyName : propertyNames ) { String[] propertyNameColumns = toColumns( table, propertyName, inSelect ); columns.ensureCapacity( columns.size() + propertyNameColumns.length ); Collections.addAll( columns,propertyNameColumns ); } return columns.toArray( new String[0] ); }
Source:
<code>public void remove(ExtSed sed) { if (sedPreferences.containsKey(sed)) { <START> } <END> sedPreferences.get(sed).removeAll(); sedPreferences.remove(sed); fire(sed, VisualizerCommand.RESET); }</code><technical_language>This if-statement anything. put lines this statement</technical_language>

Target:
public void remove(ExtSed sed) { if (!sedPreferences.containsKey(sed)) { return; } sedPreferences.get(sed).removeAll(); sedPreferences.remove(sed); fire(sed, VisualizerCommand.RESET); }
Source:
<code>public long estimateEncodedKeyComponentSize(int[] key) { long estimatedSize = (key.length * Integer.BYTES); estimatedSize += Arrays.stream(key) .filter(element -> dimLookup.getValue(element) != null) <START> .mapToLong(element -> dimLookup.getValue(element).length() * Character.BYTES).sum(); <END> return estimatedSize; }</code><technical_language>nit: Druid code convention is .mapToLong(element -> dimLookup.getValue(element).length() * Character.BYTES) .sum();</technical_language>

Target:
public long estimateEncodedKeyComponentSize(int[] key) { long estimatedSize = key.length * Integer.BYTES; estimatedSize += Arrays.stream(key) .filter(element -> dimLookup.getValue(element) != null) .mapToLong(element -> dimLookup.getValue(element).length() * Character.BYTES) .sum(); return estimatedSize; }
Source:
<code>public long acceptWay(ReaderWay way) { String highwayValue = way.getTag("highway"); if (highwayValue == null) { if (way.hasTag("route", ferries)) { String bikeTag = way.getTag("bicycle"); if (bikeTag == null && !way.hasTag("foot") || "yes".equals(bikeTag)) return acceptBit | ferryBit; } if (way.hasTag("railway", "platform")) return acceptBit; return 0; } if (!highwaySpeeds.containsKey(highwayValue)) return 0; String sacScale = way.getTag("sac_scale"); if (sacScale != null) { if ((way.hasTag("highway", "cycleway")) && (way.hasTag("sac_scale", "hiking"))) return acceptBit; if (!isSacScaleAllowed(sacScale)) return 0; } if (way.hasTag("bicycle", intendedValues) || way.hasTag("bicycle", "dismount") || <START> (way.hasTag("highway", "cycleway"))) <END> return acceptBit; if ("motorway".equals(highwayValue) || "motorway_link".equals(highwayValue)) return 0; if (way.hasTag("motorroad", "yes")) return 0; if (isBlockFords() && (way.hasTag("highway", "ford") || way.hasTag("ford"))) return 0; if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way)) return 0; if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way)) return 0; else return acceptBit; }</code><technical_language>mind remove double brackets (way....)? for statement</technical_language>

Target:
public long acceptWay(ReaderWay way) { String highwayValue = way.getTag("highway"); if (highwayValue == null) { if (way.hasTag("route", ferries)) { String bikeTag = way.getTag("bicycle"); if (bikeTag == null && !way.hasTag("foot") || "yes".equals(bikeTag)) return acceptBit | ferryBit; } if (way.hasTag("railway", "platform")) return acceptBit; return 0; } if (!highwaySpeeds.containsKey(highwayValue)) return 0; String sacScale = way.getTag("sac_scale"); if (sacScale != null) { if ((way.hasTag("highway", "cycleway")) && (way.hasTag("sac_scale", "hiking"))) return acceptBit; if (!isSacScaleAllowed(sacScale)) return 0; } if (way.hasTag("bicycle", intendedValues) || way.hasTag("bicycle", "dismount") || way.hasTag("highway", "cycleway")) return acceptBit; if ("motorway".equals(highwayValue) || "motorway_link".equals(highwayValue)) return 0; if (way.hasTag("motorroad", "yes")) return 0; if (isBlockFords() && (way.hasTag("highway", "ford") || way.hasTag("ford"))) return 0; if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way)) return 0; if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way)) return 0; else return acceptBit; }