auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testGetConfiguration() throws Exception { TaskRepository repository = actualFixture.repository(); BugzillaRestClient client = BugzillaRestConnector.getDefault().getClient(repository); BugzillaRestConfiguration configuration = client.getConfiguration(repository, new NullOperationMonitor()); Collection<Field> fields = configuration.getFields(); assertConfigurationFieldNames(fields); <START> String ss = new Gson().toJson(configuration).replaceAll(repository.getRepositoryUrl(), "<LINK_0>"); <END> assertEquals( IOUtils.toString(CommonTestUtil.getResource(this, "testdata/" + actualFixture.getVersion() + "/configuration.json")), new Gson().toJson(configuration).replaceAll(repository.getRepositoryUrl(), "<LINK_0>")); }</code><technical_language>is ss? used</technical_language>

Target:
public void testGetConfiguration() throws Exception { TaskRepository repository = actualFixture.repository(); BugzillaRestClient client = BugzillaRestConnector.getDefault().getClient(repository); BugzillaRestConfiguration configuration = client.getConfiguration(repository, new NullOperationMonitor()); Map<String, Field> fields = client.getFields(new NullOperationMonitor()); Collection<Field> fieldCollection = fields.values(); assertConfigurationFieldNames(fieldCollection); assertEquals( IOUtils.toString(CommonTestUtil.getResource(this, "testdata/" + actualFixture.getVersion() + "/configuration.json")), new Gson().toJson(configuration).replaceAll(repository.getRepositoryUrl(), "<LINK_0>")); }
Source:
<code>public String toString() { <START> return "Name: " + name + " LabelNames: " + labels.keySet() + " labelValues: " + labels.values() + <END> " Value: " + value; }</code><technical_language>keys values in order</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(name); if (labels != null && !labels.isEmpty()) { sb.append('{'); final Map<String, String> sortedLabels = new TreeMap<String, String>(labels); for (Map.Entry<String, String> label : sortedLabels.entrySet()) { sb.append(label.getKey()) .append('=') .append('\"') .append(escapeLabelValue(label.getValue())) .append("\","); } sb.append('}'); } sb.append(' ').append(doubleToGoString(value)); return sb.toString(); }
Source:
<code>private static void generateHelp (File addon, String name, String icon, String intro) { if (! addon.isDirectory()) { System.out.println(addon.getAbsolutePath() + " is not a directory"); return; } File resdir = new File (addon, "resources"); File helpdir = new File (resdir, "help"); if (helpdir.isDirectory()) { System.out.println(addon.getName() + " appears to already have help, aborting."); return; } if (helpdir.mkdirs()) { System.out.println("Created " + helpdir.getAbsolutePath()); } else { <START> System.out.println("Failed to create " + helpdir.getAbsolutePath()); <END> } Map<String, String> tokens = new HashMap<String, String>(); tokens.put("@@name@@", name); tokens.put("@@addon@@", addon.getName()); tokens.put("@@intro@@", intro); if (icon == null) { tokens.put("@@icon@@", ""); tokens.put("@@icon-map@@", ""); tokens.put("@@icon-image@@", ""); } else { tokens.put("@@icon@@", icon); tokens.put("@@icon-map@@", "<mapID target=\"" + addon.getName() + "-icon\" url=\"contents/images/" + icon + "\" />"); tokens.put("@@icon-image@@", "image=\"" + addon.getName() + "-icon\""); } recursiveCopy(TEMPLATE_DIR, helpdir, tokens); File f = null; try { f = new File(addon, "/resources/help/contents/" + addon.getName() + ".html"); FileUtils.moveFile( new File(addon, "/resources/help/contents/addon.html"), f); } catch (IOException e) { System.out.println("Failed to move file to " + f.getAbsolutePath()); e.printStackTrace(); } }</code><technical_language>return</technical_language>

Target:
private static void generateHelp (File addon, String name, String icon, String intro) throws IOException { if (! addon.isDirectory()) { System.out.println(addon.getAbsolutePath() + " is not a directory"); return; } File resdir = new File (addon, "resources"); File helpdir = new File (resdir, "help"); if (helpdir.isDirectory()) { System.out.println(addon.getName() + " appears to already have help, aborting."); return; } if (helpdir.mkdirs()) { System.out.println("Created " + helpdir.getAbsolutePath()); } else { System.out.println("Failed to create " + helpdir.getAbsolutePath()); return; } Map<String, String> tokens = new HashMap<String, String>(); tokens.put("@@name@@", name); tokens.put("@@addon@@", addon.getName()); tokens.put("@@intro@@", intro); if (icon == null) { tokens.put("@@icon@@", ""); tokens.put("@@icon-map@@", ""); tokens.put("@@icon-image@@", ""); } else { tokens.put("@@icon@@", icon); tokens.put("@@icon-map@@", "<mapID target=\"" + addon.getName() + "-icon\" url=\"contents/images/" + icon + "\" />"); tokens.put("@@icon-image@@", "image=\"" + addon.getName() + "-icon\""); } recursiveCopy(TEMPLATE_DIR, helpdir, tokens); File f = null; try { f = new File(addon, "/resources/help/contents/" + addon.getName() + ".html"); FileUtils.moveFile( new File(addon, "/resources/help/contents/addon.html"), f); } catch (IOException e) { System.out.println("Failed to move file to " + f.getAbsolutePath()); e.printStackTrace(); } }
Source:
<code>public void testGetAllView() throws Exception { Set<String> expViews = new HashSet<>(Arrays.asList( "BASELINE_NODES", "INDEXES", "LOCAL_CACHE_GROUPS_IO", <START> "LOCAL_SQL_QUERY_HISTORY", <END> "LOCAL_SQL_RUNNING_QUERIES", "NODES", "NODE_ATTRIBUTES", "NODE_METRICS", "SCHEMAS", "TABLES" )); Set<String> actViews = new HashSet<>(); try (Connection conn = DriverManager.getConnection(BASE_URL)) { DatabaseMetaData meta = conn.getMetaData(); ResultSet rs = meta.getTables(null, null, "%", new String[]{"VIEW"}); while (rs.next()) { assertEquals("VIEW", rs.getString("TABLE_TYPE")); assertEquals(JdbcUtils.CATALOG_NAME, rs.getString("TABLE_CAT")); assertEquals(QueryUtils.SCHEMA_SYS, rs.getString("TABLE_SCHEM")); actViews.add(rs.getString("TABLE_NAME")); } assertFalse(rs.next()); assertEquals(expViews, actViews); } }</code><technical_language>enabled system view default? enable views admin restart node, a good issue</technical_language>

Target:
public void testGetAllView() throws Exception { Set<String> expViews = new HashSet<>(Arrays.asList( "BASELINE_NODES", "CACHES", "CACHE_GROUPS", "INDEXES", "LOCAL_CACHE_GROUPS_IO", "LOCAL_SQL_QUERY_HISTORY", "LOCAL_SQL_RUNNING_QUERIES", "NODES", "NODE_ATTRIBUTES", "NODE_METRICS", "SCHEMAS", "TABLES", "TASKS", "SERVICES" )); Set<String> actViews = new HashSet<>(); try (Connection conn = DriverManager.getConnection(BASE_URL)) { DatabaseMetaData meta = conn.getMetaData(); ResultSet rs = meta.getTables(null, null, "%", new String[]{"VIEW"}); while (rs.next()) { assertEquals("VIEW", rs.getString("TABLE_TYPE")); assertEquals(JdbcUtils.CATALOG_NAME, rs.getString("TABLE_CAT")); assertEquals(QueryUtils.SCHEMA_SYS, rs.getString("TABLE_SCHEM")); actViews.add(rs.getString("TABLE_NAME")); } assertFalse(rs.next()); assertEquals(expViews, actViews); } }
Source:
<code>public Map<FieldName, Object> extractRawInputs(Tuple tuple) { LOG.debug("Extracting raw inputs from tuple: = [{}]", tuple); Object event = tuple.getValueByField(StreamlineEvent.STREAMLINE_EVENT); final Map<FieldName, Object> rawInputs = new LinkedHashMap<>(); if(event instanceof StreamlineEvent) { StreamlineEvent streamlineEvent = (StreamlineEvent) event; for (FieldName fieldName : getActiveFields()) { rawInputs.put(fieldName, streamlineEvent.get(fieldName.getValue())); } } else { <START> LOG.debug("Received invalid input tuple:[{}] with streamline event:[{}] and it is not processed.", tuple, event); <END> } LOG.debug("Raw inputs = [{}]", rawInputs); return rawInputs; }</code><technical_language>processing invalid input tuple ... delete "and is processed"</technical_language>

Target:
public Map<FieldName, Object> extractRawInputs(Tuple tuple) { LOG.debug("Extracting raw inputs from tuple: = [{}]", tuple); Object event = tuple.getValueByField(StreamlineEvent.STREAMLINE_EVENT); final Map<FieldName, Object> rawInputs = new LinkedHashMap<>(); if(event instanceof StreamlineEvent) { StreamlineEvent streamlineEvent = (StreamlineEvent) event; for (FieldName fieldName : getActiveFields()) { if (streamlineEvent.containsKey(fieldName.getValue())) { rawInputs.put(fieldName, streamlineEvent.get(fieldName.getValue())); } } } else { LOG.debug("Not processing invalid input tuple:[{}] with streamline event:[{}]", tuple, event); } LOG.debug("Raw inputs = [{}]", rawInputs); return rawInputs; }
Source:
<code>private void close(SelectionKey key) { if (key == null) { <START> return; <END> } SocketChannel socketChannel = channel(key); Transmissions transmissions = transmissions(key); if (transmissions != null) { logger.debug("Closing connection from {}", transmissions.connectionId); this.disconnected.add(transmissions.connectionId); this.keyMap.remove(transmissions.connectionId); activeConnections.set(this.keyMap.size()); transmissions.clearReceive(); transmissions.clearSend(); } key.attach(null); key.cancel(); try { socketChannel.socket().close(); socketChannel.close(); } catch (IOException e) { logger.error("Exception closing connection to node {}:", transmissions.connectionId, e); } this.metrics.selectorConnectionClosed.inc(); }</code><technical_language>this happen? throw illegal argument exception right</technical_language>

Target:
private void close(SelectionKey key) { SocketChannel socketChannel = channel(key); Transmissions transmissions = transmissions(key); if (transmissions != null) { logger.debug("Closing connection from {}", transmissions.connectionId); this.disconnected.add(transmissions.connectionId); this.keyMap.remove(transmissions.connectionId); activeConnections.set(this.keyMap.size()); transmissions.clearReceive(); transmissions.clearSend(); } key.attach(null); key.cancel(); try { socketChannel.socket().close(); socketChannel.close(); } catch (IOException e) { metrics.selectorCloseSocketErrorCount.inc(); logger.error("Exception closing connection to node {}:", transmissions.connectionId, e); } this.metrics.selectorConnectionClosed.inc(); }
Source:
<code><START> public Builder userDataDirectory(File userDataDirectory) throws IOException { <END> this.userDataDirectory = userDataDirectory; return this; }</code><technical_language>need for throws IOException</technical_language>

Target:
public Builder userDataDirectory(File userDataDirectory) { this.userDataDirectory = userDataDirectory; return this; }
Source:
<code>public void testProxyExpire() { CookieProxy proxy = ProxyBuilder.builder(CookieProxy.class, client.target(generateURL("/"))).build(); Response response = proxy.expire(); String res = response.readEntity(String.class); System.out.println(res); MultivaluedMap<String, String> headers = response.getStringHeaders(); <START> System.out.println(headers.get("Set-Cookie")); <END> Assert.assertTrue("Unexpected cookie expires:" + res, headers.get("Set-Cookie").contains(res)); response.close(); }</code><technical_language>this need a System.out.println</technical_language>

Target:
public void testProxyExpire() { CookieProxy proxy = ProxyBuilder.builder(CookieProxy.class, client.target(generateURL("/"))).build(); Response response = proxy.expire(); String res = response.readEntity(String.class); MultivaluedMap<String, String> headers = response.getStringHeaders(); Assert.assertTrue("Unexpected cookie expires:" + res, headers.get("Set-Cookie").contains(res)); response.close(); }
Source:
<code>public String[] getDisabledRuntimeDetectors() { <START> String enabledDetectors = getPreferences().get(DISABLED_DETECTORS,null); <END> return enabledDetectors == null ? null : enabledDetectors.split(","); }</code><technical_language>minor thing. change for code cleanliness sake: "enabledDetectors" -> "disabledDetectors"</technical_language>

Target:
public String[] getDisabledRuntimeDetectors() { String disabledDetectors = getPreferences().get(DISABLED_DETECTORS,null); return disabledDetectors == null ? null : disabledDetectors.split(","); }
Source:
<code>public boolean getAllCleared() { synchronized (_listTasks) { for (EntityAsyncTask task : _listTasks.values()) { if (!taskWasCleared(task)) { <START> log.infoFormat("[within thread]: Some of the entity {0} were not cleared yet (Task {1} is in state {2}).", <END> getContainerId(), task.getTaskID(), task.getState()); return false; } } } return true; }</code><technical_language>Entity is singular "some of" "were" plural. If entities aligned parameter. this re-thought</technical_language>

Target:
public boolean getAllCleared() { synchronized (_listTasks) { for (EntityAsyncTask task : _listTasks.values()) { if (!taskWasCleared(task)) { log.infoFormat("[within thread]: Some of the tasks related to entity {0} were not cleared yet (Task {1} is in state {2}).", getContainerId(), task.getTaskID(), task.getState()); return false; } } } return true; }
Source:
<code>public void futureDateExpression() throws ParseException { <START> SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy", new Locale("test") ); <END> Date now = new Date(); Date nowPlus10Days = new Date( now.getTime() + MILLIS_IN_A_DAY * 10 ); Date date = dateFormat.parse( fakeValuesService.expression( "#{date.future '10','TimeUnit.DAYS'}", faker )); assertThat( date.getTime(), greaterThan( now.getTime() )); assertThat( date.getTime(), lessThan( nowPlus10Days.getTime() )); }</code><technical_language>is this change part of PR</technical_language>

Target:
public void futureDateExpression() throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy"); Date now = new Date(); Date nowPlus10Days = new Date( now.getTime() + MILLIS_IN_A_DAY * 10 ); Date date = dateFormat.parse( fakeValuesService.expression( "#{date.future '10','TimeUnit.DAYS'}", faker )); assertThat( date.getTime(), greaterThan( now.getTime() )); assertThat( date.getTime(), lessThan( nowPlus10Days.getTime() )); }
Source:
<code>public static ImmutableList<Struct> getStructsOrderedList(final ImmutableList<Struct> allStructs, final ImmutableSet<String> enumNames) throws ParseException { final Queue<Struct> structsQueue = new LinkedList<>(allStructs); final Set<String> existingStructs = new HashSet<>(); final ImmutableList.Builder<Struct> orderedStructsBuilder = ImmutableList.builder(); int skippedStructsCount = 0; while (!structsQueue.isEmpty()) { final int structsQueueSize = structsQueue.size(); final Struct structEntry = structsQueue.remove(); if (!StructHelper.requiresNewCustomParser(structEntry, existingStructs, enumNames)) { existingStructs.add(structEntry.getName()); LOG.info(structEntry.toString()); orderedStructsBuilder.add(structEntry); } else { structsQueue.add(structEntry); } if (structsQueueSize == structsQueue.size()) { skippedStructsCount++; if (skippedStructsCount == structsQueueSize) { LOG.warn("Unable to progress on remaining structs, aborting!"); LOG.warn(" Remaining structs[" + structsQueue.size() + "]"); for (final Struct struct : allStructs) { LOG.warn(" " + struct.toString() + "\n"); } <START> throw new ParseException("Unable to parse API Contract.", 0); <END> } } else { skippedStructsCount = 0; } } return orderedStructsBuilder.build(); }</code><technical_language>this is issue parsing contract, converting</technical_language>

Target:
public static ImmutableList<Struct> getStructsOrderedList(final ImmutableList<Struct> allStructs, final ImmutableSet<String> enumNames) throws ParseException { final Queue<Struct> structsQueue = new LinkedList<>(allStructs); final Set<String> existingStructs = new HashSet<>(); final ImmutableList.Builder<Struct> orderedStructsBuilder = ImmutableList.builder(); int skippedStructsCount = 0; while (!structsQueue.isEmpty()) { final int structsQueueSize = structsQueue.size(); final Struct structEntry = structsQueue.remove(); if (!StructHelper.requiresNewCustomParser(structEntry, existingStructs, enumNames)) { existingStructs.add(structEntry.getName()); LOG.info(structEntry.toString()); orderedStructsBuilder.add(structEntry); } else { structsQueue.add(structEntry); } if (structsQueueSize == structsQueue.size()) { skippedStructsCount++; if (skippedStructsCount == structsQueueSize) { LOG.warn("Unable to progress on remaining structs, aborting!"); LOG.warn(" Remaining structs[" + structsQueue.size() + "]"); for (final Struct struct : allStructs) { LOG.warn(" " + struct.toString() + "\n"); } throw new ParseException("Unable to Order provided structs.", 0); } } else { skippedStructsCount = 0; } } return orderedStructsBuilder.build(); }
Source:
<code>public String resolve() { <START> FilePropertyLoader fileLoaderObject = FilePropertyLoader.getFileLoaderInstance(); <END> fileLoaderObject.setFileValue(input); String filePropertyValue = fileLoaderObject.getFileValue(); LOG.debug("resolving PropertiesFile value "+filePropertyValue); if (filePropertyValue == null) { throw new ResolverException("File Property variable could not be found"); } return filePropertyValue; }</code><technical_language>normal convention is name 'getFileLoaderInstance()' 'getInstance()' for code radabiltiy</technical_language>

Target:
public String resolve() { FilePropertyLoader propertyLoader = FilePropertyLoader.getInstance(); String PropertyValue = propertyLoader.getValue(input); if (LOG.isDebugEnabled()) { LOG.debug("Resolving File Property value " + PropertyValue); } if (PropertyValue == null) { throw new ResolverException("File Property variable could not be found"); } return PropertyValue; }
Source:
<code>Mono<Response<KeyVaultKey>> createKeyWithResponse(CreateKeyOptions createKeyOptions, Context context) { Objects.requireNonNull(createKeyOptions, "The key create options parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() <START> .setKty(createKeyOptions.getKeyType()) <END> .setKeyOps(createKeyOptions.keyOperations()) .setKeyAttributes(new KeyRequestAttributes(createKeyOptions)); return service.createKey(endpoint, createKeyOptions.getName(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Creating key - {}", createKeyOptions.getName())) .doOnSuccess(response -> logger.info("Created key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to create key - {}", createKeyOptions.getName(), error)); }</code><technical_language>setKeyType(createKeyOptions.getKeyType())</technical_language>

Target:
Mono<Response<KeyVaultKey>> createKeyWithResponse(CreateKeyOptions createKeyOptions, Context context) { Objects.requireNonNull(createKeyOptions, "The key create options parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .setKty(createKeyOptions.getKeyType()) .setKeyOps(createKeyOptions.getKeyOperations()) .setKeyAttributes(new KeyRequestAttributes(createKeyOptions)); return service.createKey(vaultUrl, createKeyOptions.getName(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Creating key - {}", createKeyOptions.getName())) .doOnSuccess(response -> logger.info("Created key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to create key - {}", createKeyOptions.getName(), error)); }
Source:
<code>public void apply() throws InterruptedException { synchronized (workerThread) { final Map<K, PendingPull> pendingPulls = workerThread.pendingPulls; PendingPull pendingPull = pendingPulls.get(encodedKey.getKey()); if (pendingPull == null) { while (pendingPulls.size() >= MAX_PENDING_PULL_COUNT_PER_THREAD) { workerThread.wait(); } this.pullStartTime = ticker.read(); workerThread.pendingStat.put(pullStartTime - enqueueTime); final int requestId = workerThread.getNewRequestId(); pendingPull = new PendingPull(workerThread, encodedKey, requestId); pendingPulls.put(encodedKey.getKey(), pendingPull); sendPullMsg(encodedKey, requestId); } else { this.pullStartTime = ticker.read(); workerThread.pendingStat.put(pullStartTime - enqueueTime); } <START> pendingPull.addPendingOp(this); <END> } }</code><technical_language>I moving this line else block for _if_ block passing this constructor of PendingPull greatly code readability</technical_language>

Target:
public void apply() throws InterruptedException { synchronized (workerThread) { final Map<K, PullRequest> pendingPullRequests = workerThread.pendingPullRequests; PullRequest pullRequest = pendingPullRequests.get(encodedKey.getKey()); if (pullRequest == null) { while (pendingPullRequests.size() >= maxPendingPullsPerThread) { workerThread.wait(); } this.pullStartTime = ticker.read(); workerThread.waitingStat.put(pullStartTime - enqueueTime); pullRequest = new PullRequest(workerThread, encodedKey, this); requestId = pullRequest.getRequestId(); pendingPullRequests.put(encodedKey.getKey(), pullRequest); sendPullMsg(encodedKey, requestId); } else { this.pullStartTime = ticker.read(); workerThread.waitingStat.put(pullStartTime - enqueueTime); pullRequest.addPendingOp(this); } } }
Source:
<code>protected String validateURL(String url) throws MalformedURLException { if (url == null) { throw new MalformedURLException(); } <START> if(url.equals("")) <END> { return url; } url = url.trim(); if (url.indexOf ("://") == -1) { url = "http://" + url; } try { URL u = new URL(url); } catch (MalformedURLException e1) { try { Pattern pattern = Pattern.compile("\\s*([a-zA-Z0-9]+)://([^\\n]+)"); Matcher matcher = pattern.matcher(url); if(matcher.matches()) { URL test = new URL("http://" + matcher.group(2)); } else { throw e1; } } catch (MalformedURLException e2) { throw e1; } } return url; }</code><technical_language>removed .trim() ...Was redundant</technical_language>

Target:
protected String validateURL(String url) throws MalformedURLException { if (url == null) { throw new MalformedURLException(); } if(url.trim().equals("")) { return url; } url = url.trim(); if (url.indexOf ("://") == -1) { url = "http://" + url; } try { URL u = new URL(url); } catch (MalformedURLException e1) { try { Pattern pattern = Pattern.compile("\\s*([a-zA-Z0-9]+)://([^\\n]+)"); Matcher matcher = pattern.matcher(url); if(matcher.matches()) { URL test = new URL("http://" + matcher.group(2)); } else { throw e1; } } catch (MalformedURLException e2) { throw e1; } } return url; }
Source:
<code>public Page getNextPage() { try { pageId++; int currentPageSize = rcFileReader.advance(); if (currentPageSize < 0) { close(); return null; } Block[] blocks = new Block[hiveColumnIndexes.length]; for (int fieldId = 0; fieldId < blocks.length; fieldId++) { if (constantBlocks[fieldId] != null) { blocks[fieldId] = new RunLengthEncodedBlock(constantBlocks[fieldId], currentPageSize); } else { blocks[fieldId] = createBlock(currentPageSize, fieldId); } } Page page = new Page(currentPageSize, blocks); return page; } catch (PrestoException e) { closeWithSuppression(e); throw e; } catch (RcFileCorruptionException e) { closeWithSuppression(e); throw new PrestoException(HIVE_BAD_DATA, e); } catch (IOException | RuntimeException e) { closeWithSuppression(e); <START> throw new PrestoException(HIVE_CURSOR_ERROR, e.getMessage() + ": " + rcFileReader.getDataSourceInfo(), e); <END> } }</code><technical_language>java "Failed read RCFile: " + path</technical_language>

Target:
public Page getNextPage() { try { pageId++; int currentPageSize = rcFileReader.advance(); if (currentPageSize < 0) { close(); return null; } Block[] blocks = new Block[hiveColumnIndexes.length]; for (int fieldId = 0; fieldId < blocks.length; fieldId++) { if (constantBlocks[fieldId] != null) { blocks[fieldId] = new RunLengthEncodedBlock(constantBlocks[fieldId], currentPageSize); } else { blocks[fieldId] = createBlock(currentPageSize, fieldId); } } Page page = new Page(currentPageSize, blocks); return page; } catch (PrestoException e) { closeWithSuppression(e); throw e; } catch (RcFileCorruptionException e) { closeWithSuppression(e); throw new PrestoException(HIVE_BAD_DATA, format("Corrupted RC file: %s", rcFileReader.getId()), e); } catch (IOException | RuntimeException e) { closeWithSuppression(e); throw new PrestoException(HIVE_CURSOR_ERROR, format("Failed to read RC file: %s", rcFileReader.getId()), e); } }
Source:
<code>public List<AndroidManifest> getAllManifests() { <START> Set<AndroidManifest> unique = new HashSet<>(); <END> List<AndroidManifest> list = new ArrayList<>(); addTransitiveManifests(unique, list); return list; }</code><technical_language>nit: consider renaming variables for improved readability. unique == processedManifests lists = allManifests</technical_language>

Target:
public List<AndroidManifest> getAllManifests() { Set<AndroidManifest> seenManifests = new HashSet<>(); List<AndroidManifest> uniqueManifests = new ArrayList<>(); addTransitiveManifests(seenManifests, uniqueManifests); return uniqueManifests; }
Source:
<code>public String encode(Class<?> fieldClass, long value){ initializeSalts(); String hashedValue = ""; <START> switch (fieldClass.getTypeName()){ <END> case "svc.models.Municipality": hashedValue = municipalityHashids.encode(value); break; case "svc.models.Judge": hashedValue = judgeHashids.encode(value); break; case "svc.models.Court": hashedValue = courtHashids.encode(value); break; } return hashedValue; }</code><technical_language>getSimpleName instead - this code break if rename a package <LINK_0></technical_language>

Target:
public String encode(Class<?> fieldClass, long value){ initializeSalts(); String hashedValue = ""; switch (fieldClass.getSimpleName()){ case "Municipality": hashedValue = municipalityHashids.encode(value); break; case "Judge": hashedValue = judgeHashids.encode(value); break; case "Court": hashedValue = courtHashids.encode(value); break; } return hashedValue; }
Source:
<code>AllProjectsCreator( GitRepositoryManager mgr, AllProjectsName allProjectsName, @GerritPersonIdent PersonIdent serverUser) { this.mgr = mgr; this.allProjectsName = allProjectsName; this.serverUser = serverUser; this.anonymous = SystemGroupBackend.getGroup(ANONYMOUS_USERS); this.registered = SystemGroupBackend.getGroup(REGISTERED_USERS); this.owners = SystemGroupBackend.getGroup(PROJECT_OWNERS); <START> this.owners = <END> SystemGroupBackend.getGroup(CHANGE_OWNER); }</code><technical_language>replacing Project Owners Change Owners here</technical_language>

Target:
AllProjectsCreator( GitRepositoryManager mgr, AllProjectsName allProjectsName, @GerritPersonIdent PersonIdent serverUser) { this.mgr = mgr; this.allProjectsName = allProjectsName; this.serverUser = serverUser; this.anonymous = SystemGroupBackend.getGroup(ANONYMOUS_USERS); this.registered = SystemGroupBackend.getGroup(REGISTERED_USERS); this.owners = SystemGroupBackend.getGroup(PROJECT_OWNERS); this.changeOwner = SystemGroupBackend.getGroup(CHANGE_OWNER); }
Source:
<code>public LifecycleInjector createInjector(Stage stage, Module module) { final GovernatorFeatureSetImpl featureSet = new GovernatorFeatureSetImpl(features); final LifecycleManager manager = new LifecycleManager(); try { onBeforeInjectorCreated(); Injector injector = Guice.createInjector( stage, module, new LifecycleModule(), new LegacyScopesModule(), new AbstractModule() { @Override protected void configure() { bind(GovernatorFeatureSet.class).toInstance(featureSet); bind(LifecycleManager.class).toInstance(manager); bind(new TypeLiteral<Set<String>>() {}).annotatedWith(Profiles.class).toInstance(profiles); bind(String[].class).annotatedWith(Arguments.class).toInstance(args); requestInjection(LifecycleInjectorCreator.this); } }); manager.notifyStarted(); return LifecycleInjector.wrapInjector(injector, manager); } catch (ProvisionException|CreationException|ConfigurationException e) { LOG.error("Failed to create injector", e); try { manager.notifyStartFailed(e); } catch (Exception e2) { LOG.error("Failed to notify injector creation failure", e2 ); } if (!featureSet.get(GovernatorFeatures.SHUTDOWN_ON_ERROR)) { return LifecycleInjector.createFailedInjector(manager); } else { <START> throw e; <END> } } finally { onAfterInjectorCreated(); } }</code><technical_language>finally's onAfterInjectorCreated() apply for this exception. this is fatal case for create injector, execute onAfterInjectorCreated()</technical_language>

Target:
public LifecycleInjector createInjector(Stage stage, Module module) { final GovernatorFeatureSetImpl featureSet = new GovernatorFeatureSetImpl(features); final LifecycleManager manager = new LifecycleManager(); try { onBeforeInjectorCreate(); Injector injector = Guice.createInjector( stage, module, new LifecycleModule(), new LegacyScopesModule(), new AbstractModule() { @Override protected void configure() { bind(GovernatorFeatureSet.class).toInstance(featureSet); bind(LifecycleManager.class).toInstance(manager); bind(new TypeLiteral<Set<String>>() {}).annotatedWith(Profiles.class).toInstance(profiles); bind(String[].class).annotatedWith(Arguments.class).toInstance(args); requestInjection(LifecycleInjectorCreator.this); } }); manager.notifyStarted(); LifecycleInjector lifecycleInjector = LifecycleInjector.wrapInjector(injector, manager); onSuccessfulInjectorCreate(); return lifecycleInjector; } catch (Exception e) { LOG.error("Failed to create injector", e); onFailedInjectorCreate(e); try { manager.notifyStartFailed(e); } catch (Exception e2) { LOG.error("Failed to notify injector creation failure", e2 ); } if (!featureSet.get(GovernatorFeatures.SHUTDOWN_ON_ERROR)) { return LifecycleInjector.createFailedInjector(manager); } else { throw e; } } finally { onCompletedInjectorCreate(); } }
Source:
<code>public void setDefaults(ILaunchConfigurationWorkingCopy configuration, boolean isJUnit) { configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, <START> !isJUnit); <END> boolean useDefaultArea = !isJUnit || LaunchArgumentsHelper.getDefaultJUnitWorkspaceIsContainer(); configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, useDefaultArea); String location; if (isJUnit && !useDefaultArea) { location = LaunchArgumentsHelper.getDefaultJUnitConfigurationLocation(); } else { location = DEFAULT_DIR + configuration.getName(); } configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, location); }</code><technical_language>please seto true. Before: true for tests false for users. true default for all</technical_language>

Target:
public void setDefaults(ILaunchConfigurationWorkingCopy configuration, boolean isJUnit) { configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, true); boolean useDefaultArea = !isJUnit || LaunchArgumentsHelper.getDefaultJUnitWorkspaceIsContainer(); configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, useDefaultArea); String location; if (isJUnit && !useDefaultArea) { location = LaunchArgumentsHelper.getDefaultJUnitConfigurationLocation(); } else { location = DEFAULT_DIR + configuration.getName(); } configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, location); }
Source:
<code>protected Bitmap doInBackground(String... strings) { Bitmap mIcon11 = null; String url = strings[0]; try { InputStream in = new java.net.URL(url).openStream(); mIcon11 = BitmapFactory.decodeStream(in); <START> } catch (Exception e) { <END> Log.e(TAG, e.getMessage()); } return mIcon11; }</code><technical_language>this more specific (IOException maybe?)</technical_language>

Target:
protected Bitmap doInBackground(String... strings) { Bitmap mIcon11 = null; String url = strings[0]; try { InputStream in = new URL(url).openStream(); mIcon11 = BitmapFactory.decodeStream(in); } catch (IOException e) { Log.e(TAG, e.getMessage()); } return mIcon11; }
Source:
<code>public MyOHClient(String uuid, String secret) { mUUID = uuid; mSecret = secret; mRunningRequests = new HashMap<Integer, MyOHExchange>(); mJettyClient = new HttpClient(); mJettyClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL); mJettyClient.setMaxConnectionsPerAddress(200); <START> mJettyClient.setTimeout(30000); <END> try { mJettyClient.start(); } catch (Exception e) { logger.error("Error starting JettyClient: {}", e.getMessage()); } }</code><technical_language>extract numbers constants for sake of readability</technical_language>

Target:
public MyOHClient(String uuid, String secret) { mUUID = uuid; mSecret = secret; mRunningRequests = new HashMap<Integer, MyOHExchange>(); mJettyClient = new HttpClient(); mJettyClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL); mJettyClient.setMaxConnectionsPerAddress(HTTP_CLIENT_MAX_CONNECTOPNS_PER_ADDRESS); mJettyClient.setTimeout(HTTP_CLIENT_TIMEOUT); try { mJettyClient.start(); } catch (Exception e) { logger.error("Error starting JettyClient: {}", e.getMessage()); } }
Source:
<code>public Void visitWindow(WindowNode node, Void context) { visitPlan(node, context); node.getWindowFunctions().values().forEach( <START> windowModeFunction -> windowModeFunction.getFunctionCall().getArguments().forEach(Visitor::checkNotOriginalExpression)); <END> return null; }</code><technical_language>typo windowModeFunction -> function</technical_language>

Target:
public Void visitWindow(WindowNode node, Void context) { visitPlan(node, context); node.getWindowFunctions().values().forEach( windowNodeFunction -> windowNodeFunction.getFunctionCall().getArguments().forEach(Visitor::checkNotOriginalExpression)); return null; }
Source:
<code>public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws IOException { <START> return null; <END> }</code><technical_language>Instead of returning null for these, throw a NotYetImplementedException NotAvailableFromExchangeException</technical_language>

Target:
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws IOException { throw new NotYetImplementedForExchangeException(); }
Source:
<code>public void verifyNoVideo() { if(checkIfElementOnPage(mediaNode)) <START> throw new AssertionError("Media Node is still on the page"); <END> else PageObjectLogging.log("verifyNoVideo", "Verified no video is on page", true, driver); }</code><technical_language>please put in brackets easier read</technical_language>

Target:
public void verifyNoVideo() { if(checkIfElementOnPage(mediaNode)) { throw new AssertionError("Media Node is still on the page"); } else { PageObjectLogging.log("verifyNoVideo", "Verified no video is on page", true, driver); } }
Source:
<code>public CompactJavaSerializer(ClassLoader loader, StateRepository stateRepository) { this.loader = loader; this.readLookup = stateRepository.getPersistentConcurrentMap("readLookup"); <START> if (!readLookup.isEmpty()) { <END> for (Entry<Integer, ObjectStreamClass> entry : readLookup.entrySet()) { if (writeLookup.putIfAbsent(new SerializableDataKey(disconnect(entry.getValue()), true), entry.getKey()) != null) { throw new AssertionError("Corrupted data " + readLookup.toString()); } } } }</code><technical_language>Is this check necessary</technical_language>

Target:
public CompactJavaSerializer(ClassLoader loader, StateRepository stateRepository) { this.loader = loader; this.readLookup = stateRepository.getPersistentConcurrentMap("CompactJavaSerializer-ObjectStreamClassIndex"); for (Entry<Integer, ObjectStreamClass> entry : readLookup.entrySet()) { Integer index = entry.getKey(); if (writeLookup.putIfAbsent(new SerializableDataKey(disconnect(entry.getValue()), true), index) != null) { throw new AssertionError("Corrupted data " + readLookup); } if (nextStreamIndex.get() < index + 1) { nextStreamIndex.set(index + 1); } } }
Source:
<code>protected Void run() throws Exception { ExtendedEmailPublisher publisher = new ExtendedEmailPublisher(); publisher.configuredTriggers.clear(); AlwaysTrigger.DescriptorImpl descriptor = Jenkins.getInstance().getDescriptorByType(AlwaysTrigger.DescriptorImpl.class); publisher.configuredTriggers.add(descriptor.createDefault()); publisher.defaultSubject = step.subject; publisher.defaultContent = step.body; publisher.attachBuildLog = step.attachLog; publisher.compressBuildLog = step.compressLog; if(StringUtils.isNotBlank(step.to)) { publisher.recipientList = step.to; } if(StringUtils.isNotBlank(step.replyTo)) { publisher.replyTo = step.replyTo; } if(StringUtils.isNotBlank(step.attachmentsPattern)) { publisher.attachmentsPattern = step.attachmentsPattern; } if(StringUtils.isNotBlank(step.mimeType)) { publisher.contentType = step.mimeType; } final ExtendedEmailPublisherContext ctx = new ExtendedEmailPublisherContext(publisher, run, workspace, launcher, listener); final Multimap<String, EmailTrigger> triggered = ArrayListMultimap.create(); <START> triggered.put(AlwaysTrigger.TRIGGER_NAME, publisher.configuredTriggers.get(0)); <END> ctx.setTrigger(publisher.configuredTriggers.get(0)); publisher.sendMail(ctx); return null; }</code><technical_language>Is triggered for anything</technical_language>

Target:
protected Void run() throws Exception { ExtendedEmailPublisher publisher = new ExtendedEmailPublisher(); publisher.configuredTriggers.clear(); AlwaysTrigger.DescriptorImpl descriptor = Jenkins.getActiveInstance().getDescriptorByType(AlwaysTrigger.DescriptorImpl.class); publisher.configuredTriggers.add(descriptor.createDefault()); publisher.defaultSubject = step.subject; publisher.defaultContent = step.body; publisher.attachBuildLog = step.attachLog; publisher.compressBuildLog = step.compressLog; if (StringUtils.isNotBlank(step.to)) { publisher.recipientList = step.to; } if (StringUtils.isNotBlank(step.replyTo)) { publisher.replyTo = step.replyTo; } if (StringUtils.isNotBlank(step.attachmentsPattern)) { publisher.attachmentsPattern = step.attachmentsPattern; } if (StringUtils.isNotBlank(step.mimeType)) { publisher.contentType = step.mimeType; } final ExtendedEmailPublisherContext ctx = new ExtendedEmailPublisherContext(publisher, run, workspace, launcher, listener); final Multimap<String, EmailTrigger> triggered = ArrayListMultimap.create(); triggered.put(AlwaysTrigger.TRIGGER_NAME, publisher.configuredTriggers.get(0)); ctx.setTrigger(publisher.configuredTriggers.get(0)); ctx.setTriggered(triggered); publisher.sendMail(ctx); return null; }
Source:
<code><START> public static <T> Transformer<List<ChangeNotification<T>>, List<ChangeNotification<T>>> emitAndAggregateChanges( <END> final Comparator<T> identityComparator, final long interval, final TimeUnit timeUnit, final Scheduler scheduler) { return new Transformer<List<ChangeNotification<T>>, List<ChangeNotification<T>>>() { @Override public Observable<List<ChangeNotification<T>>> call(final Observable<List<ChangeNotification<T>>> batchUpdates) { return batchUpdates.lift(new Operator<List<ChangeNotification<T>>, List<ChangeNotification<T>>>() { @Override public Subscriber<? super List<ChangeNotification<T>>> call(final Subscriber<? super List<ChangeNotification<T>>> subscriber) { final AtomicBoolean first = new AtomicBoolean(); final PublishSubject<List<ChangeNotification<T>>> aggregateSubject = PublishSubject.create(); return new Subscriber<List<ChangeNotification<T>>>() { @Override public void onCompleted() { subscriber.onCompleted(); } @Override public void onError(Throwable e) { subscriber.onError(e); } @Override public void onNext(List<ChangeNotification<T>> notifications) { if (!first.get()) { subscriber.onNext(collapse(notifications, identityComparator)); first.set(true); Transformer<List<ChangeNotification<T>>, List<ChangeNotification<T>>> transformer = aggregateChanges(identityComparator, interval, timeUnit, scheduler); aggregateSubject.compose(transformer).subscribe(subscriber); } else { aggregateSubject.onNext(notifications); } } }; } }); } }; }</code><technical_language>layers of aggregateChanges collapse necessary? emitAndAggregateChanges() is function externally</technical_language>

Target:
public static <T> Transformer<List<ChangeNotification<T>>, List<ChangeNotification<T>>> emitAndAggregateChanges( final Comparator<T> identityComparator, final long interval, final TimeUnit timeUnit, final Scheduler scheduler) { return new Transformer<List<ChangeNotification<T>>, List<ChangeNotification<T>>>() { @Override public Observable<List<ChangeNotification<T>>> call(Observable<List<ChangeNotification<T>>> batchUpdates) { return batchUpdates.buffer(Observable.timer(0, interval, timeUnit, scheduler)).compose(collapseLists(identityComparator)); } }; }
Source:
<code>public void writeBatch(Iterable<MarshalledEntry<? extends K, ? extends V>> marshalledEntries) { try { List<WriteBatch> writeBatches = new ArrayList<>(); <START> int batchSize = 0; <END> WriteBatch writeBatch = new WriteBatch(); for (MarshalledEntry entry : marshalledEntries) { writeBatch.put(marshall(entry.getKey()), marshall(entry)); batchSize++; if (batchSize == configuration.maxBatchSize()) { batchSize = 0; writeBatches.add(writeBatch); writeBatch = new WriteBatch(); } } if (batchSize != 0) writeBatches.add(writeBatch); semaphore.acquire(); try { if (stopped) throw new PersistenceException("RocksDB is stopped"); for (WriteBatch batch : writeBatches) db.write(dataWriteOptions(), batch); } finally { semaphore.release(); } for (MarshalledEntry entry : marshalledEntries) { InternalMetadata meta = entry.getMetadata(); if (meta != null && meta.expiryTime() > -1) addNewExpiry(entry); } } catch (Exception e) { throw new PersistenceException(e); } }</code><technical_language>Hrmm I batching is done here. end putting _all_ entries batches, retain batches. write batch is filled do other stores clear it</technical_language>

Target:
public void writeBatch(Iterable<MarshalledEntry<? extends K, ? extends V>> marshalledEntries) { try { int batchSize = 0; WriteBatch batch = new WriteBatch(); for (MarshalledEntry entry : marshalledEntries) { batch.put(marshall(entry.getKey()), marshall(entry)); batchSize++; if (batchSize == configuration.maxBatchSize()) { batchSize = 0; writeBatch(batch); batch = new WriteBatch(); } } if (batchSize != 0) writeBatch(batch); for (MarshalledEntry entry : marshalledEntries) { InternalMetadata meta = entry.getMetadata(); if (meta != null && meta.expiryTime() > -1) addNewExpiry(entry); } } catch (Exception e) { throw new PersistenceException(e); } }
Source:
<code>public void login_and_logout() { User user = realm.signup().fullname(FULL_NAME).email(EMAIL).password(PWD).signup(NAME); jenkins.login().doLogin(user.id(), PWD); assertEquals(user, jenkins.getCurrentUser()); jenkins.logout(); try { jenkins.getCurrentUser().id(); fail("id() Should throw RuntimeException for logged-out user"); <START> } catch (RuntimeException e) { <END> } }</code><technical_language>I fix User.getCurrent() preserve null semantics. I broke in c26b4e0cec687f5d802c6d4805bf6c09c5ea6790</technical_language>

Target:
public void login_and_logout() { User user = realm.signup().fullname(FULL_NAME).email(EMAIL).password(PWD).signup(NAME); jenkins.login().doLogin(user.id(), PWD); assertEquals(user, jenkins.getCurrentUser()); jenkins.logout(); assertEquals(null, jenkins.getCurrentUser().id()); }
Source:
<code>public void synchronizeGroups() { ParkingPositionPlugin plugin = OsmandPlugin.getEnabledPlugin(ParkingPositionPlugin.class); boolean parkingPluginEnable = plugin != null; favoriteGroups.clear(); groups.clear(); List<FavoriteGroup> disablesGroups = new ArrayList<>(); List<FavoriteGroup> gs = helper.getFavoriteGroups(); Set<?> flt = filter; for (FavoriteGroup key : gs) { boolean empty = true; if (flt == null || flt.contains(key)) { if (key.name.equals(PersonalFavouritePoint.PERSONAL)) { ArrayList<FavouritePoint> list = new ArrayList<>(); for (FavouritePoint p : key.points) { if (p.getName().equals(PersonalFavouritePoint.PointType.PARKING.name())) { <START> if (parkingPluginEnable) { <END> list.add(p); empty = false; } } else { list.add(p); empty = false; } } favoriteGroups.put(key, list); } else { empty = false; favoriteGroups.put(key, new ArrayList<>(key.points)); } } else { ArrayList<FavouritePoint> list = new ArrayList<>(); for (FavouritePoint p : key.points) { if (flt.contains(p)) { if (p.getName().equals(PersonalFavouritePoint.PointType.PARKING.name())) { if (parkingPluginEnable) { list.add(p); empty = false; } } else { list.add(p); empty = false; } } } favoriteGroups.put(key, list); } if (!empty) { if (key.visible) { groups.add(key); } else { disablesGroups.add(key); } } } groups.addAll(disablesGroups); notifyDataSetChanged(); }</code><technical_language>Strange code. I guess plugin asked FavsDB</technical_language>

Target:
void synchronizeGroups() { favoriteGroups.clear(); groups.clear(); List<FavoriteGroup> disablesGroups = new ArrayList<>(); List<FavoriteGroup> gs = helper.getFavoriteGroups(); Set<?> flt = filter; for (FavoriteGroup key : gs) { boolean empty = true; if (flt == null || flt.contains(key)) { empty = false; favoriteGroups.put(key, new ArrayList<>(key.points)); } else { ArrayList<FavouritePoint> list = new ArrayList<>(); for (FavouritePoint p : key.points) { if (flt.contains(p)) { list.add(p); empty = false; } } favoriteGroups.put(key, list); } if (!empty) { if (key.visible) { groups.add(key); } else { disablesGroups.add(key); } } } groups.addAll(disablesGroups); notifyDataSetChanged(); }
Source:
<code>public static void deleteRecursive(@NonNull File fileOrDirectory, @NonNull List<String> exceptions) { <START> if (exceptions.size() > 0 && exceptions.contains(fileOrDirectory.getName())) return; <END> if (fileOrDirectory.isDirectory()) { File[] filesList = fileOrDirectory.listFiles(); if (filesList != null) { for (File child : filesList) { deleteRecursive(child, exceptions); } } } fileOrDirectory.delete(); }</code><technical_language>size() > 0 check is completely redundant, removed</technical_language>

Target:
public static void deleteRecursive(@NonNull File fileOrDirectory, @NonNull List<String> exceptions) { if (exceptions.contains(fileOrDirectory.getName())) return; if (fileOrDirectory.isDirectory()) { File[] filesList = fileOrDirectory.listFiles(); if (filesList != null) { for (File child : filesList) { deleteRecursive(child, exceptions); } } } fileOrDirectory.delete(); }
Source:
<code>private void layoutPageTitle(final int fontSizeSp, final OnLeadImageLayoutListener listener, final int sequence) { if (!isFragmentAdded()) { return; } <START> pageTitleText.setLayoutDirection(isLangRTL(parentFragment.getTitle().getSite().getLanguageCode()) ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR); <END> pageTitleText.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp); if (pageTitleText.getHeight() == 0) { final int postDelay = 50; pageTitleText.postDelayed(new Runnable() { @Override public void run() { layoutPageTitle(fontSizeSp, listener, sequence); } }, postDelay); } else { pageTitleText.post(new Runnable() { @Override public void run() { if (!isFragmentAdded()) { return; } if (((int) (pageTitleText.getHeight() / displayDensity) > TITLE_MAX_HEIGHT_DP) && (fontSizeSp > TITLE_MIN_TEXT_SIZE_SP)) { int newSize = fontSizeSp - TITLE_TEXT_SIZE_DECREMENT_SP; if (newSize < TITLE_MIN_TEXT_SIZE_SP) { newSize = TITLE_MIN_TEXT_SIZE_SP; } layoutPageTitle(newSize, listener, sequence); } else { layoutViews(listener, sequence); } } }); } }</code><technical_language>question RTL awareness in xml</technical_language>

Target:
private void layoutPageTitle(final int fontSizeSp, final OnLeadImageLayoutListener listener, final int sequence) { if (!isFragmentAdded()) { return; } setLayoutDirection(pageTitleText, parentFragment.getTitle().getSite().getLanguageCode()); pageTitleText.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp); if (pageTitleText.getHeight() == 0) { final int postDelay = 50; pageTitleText.postDelayed(new Runnable() { @Override public void run() { layoutPageTitle(fontSizeSp, listener, sequence); } }, postDelay); } else { pageTitleText.post(new Runnable() { @Override public void run() { if (!isFragmentAdded()) { return; } if (((int) (pageTitleText.getHeight() / displayDensity) > TITLE_MAX_HEIGHT_DP) && (fontSizeSp > TITLE_MIN_TEXT_SIZE_SP)) { int newSize = fontSizeSp - TITLE_TEXT_SIZE_DECREMENT_SP; if (newSize < TITLE_MIN_TEXT_SIZE_SP) { newSize = TITLE_MIN_TEXT_SIZE_SP; } layoutPageTitle(newSize, listener, sequence); } else { layoutViews(listener, sequence); } } }); } }
Source:
<code><START> public void onLocationPermissionsGranted() { <END> googleMap.setMyLocationEnabled(myLocationEnabled); }</code><technical_language>annotation in line method signature</technical_language>

Target:
@Override public void onLocationPermissionsGranted() { googleMap.setMyLocationEnabled(myLocationEnabled); }