auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<String> getDynamicDataColsForSkipScan() { if (pdataTable.isMultiTenant()) { return getDynamicDataCols(); } List<String> dataSqlTypes = Lists.newArrayList(); for (String colName : dataColNamesForSkipScan) { dataSqlTypes.add(dataColSqlTypeNamesForSkipScan.get(colName)); } return getDynamicCols(getUnqualifiedColNames(dataColNamesForSkipScan), dataSqlTypes); }

Target:
public List<String> getDynamicDataColsForSkipScan() { if (pdataTable.isMultiTenant()) { return getDynamicDataCols(); } return getDynamicCols(getUnqualifiedColNames(dataColNamesForSkipScan), dataColSqlTypeNames); }
Source:
public static void packRefs(ProgressMonitor pm, FileRepository repo) throws IOException { Set<Entry<String, Ref>> refEntries = repo.getAllRefs().entrySet(); pm.beginTask("pack refs", refEntries.size()); Collection<RefDirectoryUpdate> updates = new LinkedList<RefDirectoryUpdate>(); for (Map.Entry<String, Ref> entry : refEntries) { Ref ref = entry.getValue(); if (!ref.isSymbolic() && ref.getStorage().isLoose()) { updates.add(new RefDirectoryUpdate((RefDirectory) repo .getRefDatabase(), ref)); } pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(updates); }

Target:
public static void packRefs(ProgressMonitor pm, FileRepository repo) throws IOException { Set<Entry<String, Ref>> refEntries = repo.getAllRefs().entrySet(); pm.beginTask("pack refs", refEntries.size()); try { Collection<RefDirectoryUpdate> updates = new LinkedList<RefDirectoryUpdate>(); for (Map.Entry<String, Ref> entry : refEntries) { Ref ref = entry.getValue(); if (!ref.isSymbolic() && ref.getStorage().isLoose()) { updates.add(new RefDirectoryUpdate((RefDirectory) repo .getRefDatabase(), ref)); } pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(updates); } finally { pm.endTask(); } }
Source:
public void logDone() { log( "pageId", pageId, "pageHeight", pageHeight, "scrollFluxDown", scrollFluxDown, "scrollFluxUp", scrollFluxUp, "percentReached", getPercentReached() ); }

Target:
public void logDone() { log( "pageID", pageId, "pageHeight", (int) (pageHeight / app.getScreenDensity()), "scrollFluxDown", (int) (scrollFluxDown / app.getScreenDensity()), "scrollFluxUp", (int) (scrollFluxUp / app.getScreenDensity()), "maxPercentViewed", getMaxPercentViewed() ); }
Source:
private void readHttpHeaders(MessageContext messageContext, AssertionType assertion) { Message message = ((WrappedMessageContext) messageContext).getWrappedMessage(); if (message != null && message.get(Message.PROTOCOL_HEADERS) != null) { Map<String, List<String>> headers = CastUtils.cast((Map) message.get(Message.PROTOCOL_HEADERS)); if (headers != null && headers.keySet() != null && !headers.keySet().isEmpty()) { for (String headerName : headers.keySet()) { if (!headerHelper.isStandardHeader(headerName) && !headers.get(headerName).isEmpty()) { CONNECTCustomHttpHeadersType assertionHeader = new CONNECTCustomHttpHeadersType(); assertionHeader.setHeaderName(headerName); assertionHeader.setHeaderValue(headers.get(headerName).get(0)); assertion.getCONNECTCustomHttpHeaders().add(assertionHeader); } } } } }

Target:
private static void readHttpHeaders(MessageContext messageContext, AssertionType assertion) { Message message = ((WrappedMessageContext) messageContext).getWrappedMessage(); if (message != null && message.get(Message.PROTOCOL_HEADERS) != null) { Map<String, List<String>> headers = CastUtils.cast((Map) message.get(Message.PROTOCOL_HEADERS)); if (MapUtils.isNotEmpty(headers)) { addHeadersToAssertion(headers, assertion); } } }
Source:
private MucWrapper getOrCreateMucState(Jid mucJid) { synchronized (mucs) { MucWrapper mucWrapper = mucs.get(mucJid); if (mucWrapper == null) { mucWrapper = new MucWrapper(); mucs.put(mucJid, mucWrapper); } return mucWrapper; } }

Target:
private MucWrapper getOrCreateMucState(Jid mucJid) { return mucs.computeIfAbsent(mucJid, (k) -> new MucWrapper()); }
Source:
public void aWinIsThreePointsALossIsZeroPoints() throws Exception { Tournament tournament = new Tournament(); tournament.applyResults("Allegoric Alaskans;Blithering Badgers;win"); assertArrayEquals(new String[]{ "Team | MP | W | D | L | P", "Allegoric Alaskans | 1 | 1 | 0 | 0 | 3", "Blithering Badgers | 1 | 0 | 0 | 1 | 0" }, tournament.printTable().split("\n")); }

Target:
public void aWinIsThreePointsALossIsZeroPoints() { tournament.applyResults("Allegoric Alaskans;Blithering Badgers;win"); assertEquals( "Team | MP | W | D | L | P\n" + "Allegoric Alaskans | 1 | 1 | 0 | 0 | 3\n" + "Blithering Badgers | 1 | 0 | 0 | 1 | 0\n", tournament.printTable()); }
Source:
public static boolean hasFileScheme(String uri) { URI constructedURI = constructURI(uri); if (constructedURI == null) { constructedURI = new File(uri).toURI(); } String scheme = constructedURI.getScheme(); return scheme == null || "file".equalsIgnoreCase(scheme); }

Target:
public static boolean hasFileScheme(String uri) { URI constructedURI = constructURI(uri); if (constructedURI == null) { return true; } String scheme = constructedURI.getScheme(); return scheme == null || "file".equalsIgnoreCase(scheme); }
Source:
public MessageConverterConfigurer(BindingServiceProperties bindingServiceProperties, CompositeMessageConverterFactory compositeMessageConverterFactory, Map<String, PartitionKeyExtractorStrategy> partitionKeyExtractors, Map<String, PartitionSelectorStrategy> partitionSelectors) { Assert.notNull(compositeMessageConverterFactory, "The message converter factory cannot be null"); this.bindingServiceProperties = bindingServiceProperties; this.compositeMessageConverterFactory = compositeMessageConverterFactory; this.partitionKeyExtractors = partitionKeyExtractors == null ? Collections.EMPTY_MAP : partitionKeyExtractors; this.partitionSelectors = partitionSelectors == null ? Collections.EMPTY_MAP : partitionSelectors; }

Target:
public MessageConverterConfigurer(BindingServiceProperties bindingServiceProperties, CompositeMessageConverterFactory compositeMessageConverterFactory, Map<String, PartitionKeyExtractorStrategy> partitionKeyExtractors, Map<String, PartitionSelectorStrategy> partitionSelectors) { Assert.notNull(compositeMessageConverterFactory, "The message converter factory cannot be null"); this.bindingServiceProperties = bindingServiceProperties; this.compositeMessageConverterFactory = compositeMessageConverterFactory; this.partitionKeyExtractors = partitionKeyExtractors == null ? Collections.emptyMap() : partitionKeyExtractors; this.partitionSelectors = partitionSelectors == null ? Collections.emptyMap() : partitionSelectors; }
Source:
public List<ODataEntry> readTable(String tableName) { List<ODataEntry> entryList = new ArrayList<>(); DBCollection result = jongo.getDatabase().getCollection(tableName); Iterator<DBObject> cursor = result.find(); DBObject current; String tempValue; while (cursor.hasNext()) { ODataEntry dataEntry; current = cursor.next(); tempValue = current.toString(); Iterator<?> keys = new JSONObject(tempValue).keys(); dataEntry = createDataEntryFromResult(tempValue, keys); dataEntry.addValue(ETAG, ODataUtils.generateETag(this.configId, tableName, dataEntry)); entryList.add(dataEntry); } return entryList; }

Target:
public List<ODataEntry> readTable(String tableName) { List<ODataEntry> entryList = new ArrayList<>(); DBCollection readResult = jongo.getDatabase().getCollection(tableName); Iterator<DBObject> cursor = readResult.find(); DBObject documentData; String tempValue; while (cursor.hasNext()) { ODataEntry dataEntry; documentData = cursor.next(); tempValue = documentData.toString(); Iterator<?> keys = new JSONObject(tempValue).keys(); dataEntry = createDataEntryFromResult(tempValue, keys); dataEntry.addValue(ETAG, ODataUtils.generateETag(this.configId, tableName, dataEntry)); entryList.add(dataEntry); } return entryList; }
Source:
@Override protected List<?> run() throws Exception { if (step.generateInclusions) { return ParallelTestExecutor.findTestSplits(step.parallelism, build, listener, step.generateInclusions, new PreviousTestResultLookup.LookupInStage(step.stage)); } else { List<List<String>> result = new ArrayList<>(); for (InclusionExclusionPattern pattern : ParallelTestExecutor.findTestSplits(step.parallelism, build, listener, step.generateInclusions, new PreviousTestResultLookup.LookupInStage(step.stage))) { result.add(pattern.getList()); } return result; } }

Target:
@Override protected List<?> run() throws Exception { if (step.generateInclusions) { return ParallelTestExecutor.findTestSplits(step.parallelism, build, listener, step.generateInclusions, step.stage); } else { List<List<String>> result = new ArrayList<>(); for (InclusionExclusionPattern pattern : ParallelTestExecutor.findTestSplits(step.parallelism, build, listener, step.generateInclusions, step.stage)) { result.add(pattern.getList()); } return result; } }
Source:
public void saveLoadStateTest() throws FileTailerStateProcessorException { FileTailerStateProcessor stateProcessor = new FileTailerStateProcessorImpl(System.getProperty("user.home") + "/ft_state_dir", "ft.state"); FileTailerState state = new FileTailerState("name", 101, "hash".hashCode(), 102); File file = new File(System.getProperty("user.home") + "/ft_state_dir/ft.state"); stateProcessor.saveState(state); Assert.assertTrue(file.exists()); FileTailerState loadedState = stateProcessor.loadState(); Assert.assertEquals(state.getFileName(), loadedState.getFileName()); Assert.assertEquals(state.getPosition(), loadedState.getPosition()); Assert.assertEquals(state.getHash(), loadedState.getHash()); Assert.assertEquals(state.getLastModifyTime(), loadedState.getLastModifyTime()); new File(System.getProperty("user.home") + "/ft_state_dir").delete(); }

Target:
public void saveLoadStateTest() throws FileTailerStateProcessorException { FileTailerStateProcessor stateProcessor = new FileTailerStateProcessorImpl(new File("/tmp/ft_state_dir"), "ft.state"); FileTailerState state = new FileTailerState("name", 101, "hash".hashCode(), 102); File file = new File("/tmp/ft_state_dir/ft.state"); stateProcessor.saveState(state); Assert.assertTrue(file.exists()); FileTailerState loadedState = stateProcessor.loadState(); Assert.assertEquals(state.getFileName(), loadedState.getFileName()); Assert.assertEquals(state.getPosition(), loadedState.getPosition()); Assert.assertEquals(state.getHash(), loadedState.getHash()); Assert.assertEquals(state.getLastModifyTime(), loadedState.getLastModifyTime()); new File("/tmp/ft_state_dir/ft.state").delete(); new File("/tmp/ft_state_dir").delete(); }
Source:
public void updatePhysics(GlowBlock me) { super.updatePhysics(me); boolean powered = me.isBlockPowered() || me.isBlockIndirectlyPowered(); if (powered != (me.getType() == Material.REDSTONE_LAMP_ON)) { me.setType(powered ? Material.REDSTONE_LAMP_ON : Material.REDSTONE_LAMP_OFF); } }

Target:
public void updatePhysics(GlowBlock me) { boolean powered = me.isBlockPowered() || me.isBlockIndirectlyPowered(); if (powered != (me.getType() == Material.REDSTONE_LAMP_ON)) { me.setType(powered ? Material.REDSTONE_LAMP_ON : Material.REDSTONE_LAMP_OFF); } }
Source:
private static String formatForDisplay(String setterMethodName, List<Object> args) { StringBuffer sb = new StringBuffer(CompilerOptions.class.getName()); sb.append(".").append(setterMethodName).append("("); int i = 0; for (Object arg : args) { sb.append(i++ > 0 ? ", " : "").append(arg.toString()); } sb.append(")"); return sb.toString(); }

Target:
private static String formatForDisplay(String setterMethodName, List<Object> args) { StringBuilder sb = new StringBuilder(CompilerOptions.class.getName()); sb.append(".").append(setterMethodName).append("("); Joiner.on(",").appendTo(sb, args).append(")"); return sb.toString(); }
Source:
public void canDeserializeQosServerConfiguration() throws IOException { File testConfigFile = new File(QosServiceRuntimeConfig.class.getResource("/qos.yml").getPath()); QosServiceRuntimeConfig configuration = OBJECT_MAPPER.readValue(testConfigFile, QosServiceRuntimeConfig.class); assertThat(configuration.clientLimits()).hasSize(2); assertThat(configuration.clientLimits()).containsOnly(entry("test", 10L), entry("test2", 20L)); }

Target:
public void canDeserializeQosServerConfiguration() throws IOException { File testConfigFile = new File(QosServiceRuntimeConfig.class.getResource("/qos.yml").getPath()); QosServiceRuntimeConfig configuration = OBJECT_MAPPER.readValue(testConfigFile, QosServiceRuntimeConfig.class); assertThat(configuration).isEqualTo(ImmutableQosServiceRuntimeConfig.builder() .clientLimits(ImmutableMap.of("test", 10L, "test2", 20L)) .build()); }
Source:
private void saveKieServerInstanceData(Properties data) { try (OutputStream out = new FileOutputStream(userFile)) { data.store(out, "Kie Server Router"); } catch (FileNotFoundException e) { log.infof("file not found %1$s", userFile); } catch (IOException e) { log.errorf(e, "somo error ocurred during access to %1$s", userFile); } }

Target:
private void saveKieServerInstanceData(Properties data) { try (OutputStream out = new FileOutputStream(userFile)) { data.store(out, "Kie Server Router"); } catch (IOException e) { log.errorf(e, "An error ocurred. File <%1$s> is a directory, it cannot be created or it cannot be opened", userFile); } }
Source:
public void fail_when_assignee_is_not_member_of_organization_of_project_issue() throws Exception { OrganizationDto org = db.organizations().insert(organizationDto -> organizationDto.setKey("Organization key")); IssueDto issueDto = db.issues().insertIssue(org); setUserWithBrowsePermission(issueDto); OrganizationDto otherOrganization = db.organizations().insert(); UserDto assignee = db.users().insertUser("arthur"); db.organizations().addMember(otherOrganization, assignee); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("User 'arthur' is not member of organization 'Organization key'"); tester.newRequest() .setParam("issue", issueDto.getKey()) .setParam("assignee", "arthur") .execute(); }

Target:
public void fail_when_assignee_is_not_member_of_organization_of_project_issue() throws Exception { OrganizationDto org = db.organizations().insert(organizationDto -> organizationDto.setKey("Organization key")); IssueDto issueDto = db.issues().insertIssue(org); setUserWithBrowsePermission(issueDto); OrganizationDto otherOrganization = db.organizations().insert(); UserDto assignee = db.users().insertUser("arthur"); db.organizations().addMember(otherOrganization, assignee); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("User 'arthur' is not member of organization 'Organization key'"); ws.newRequest() .setParam("issue", issueDto.getKey()) .setParam("assignee", "arthur") .execute(); }
Source:
public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setLength(1); ent.setObjectId(data); }

Target:
public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setLength(length); ent.setObjectId(data); }
Source:
public void freezeRealm() { Realm frozenRealm = realm.freeze(); assertEquals(realm.getPath(), frozenRealm.getPath()); assertTrue(frozenRealm.isFrozen()); frozenRealm.close(); }

Target:
public void freezeRealm() { assertFalse(realm.isFrozen()); Realm frozenRealm = realm.freeze(); assertEquals(realm.getPath(), frozenRealm.getPath()); assertTrue(frozenRealm.isFrozen()); frozenRealm.close(); }
Source:
public SignatureVisitor() { super(Opcodes.ASM7_EXPERIMENTAL); }

Target:
public SignatureVisitor() { super(Opcodes.ASM7); }
Source:
private void selectTagInTree(SWTBotShell tagDialog, int numberOfRows, String expectedTag) { try { Thread.sleep(500); TestUtil.joinJobs(JobFamilies.FILL_TAG_LIST); } catch (InterruptedException e1) { } tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags) .unselect(); tagDialog.bot().textWithLabel(UIText.CreateTagDialog_tagName) .setText(""); try { SWTBotTableItem item = tagDialog.bot() .tableWithLabel(UIText.CreateTagDialog_existingTags) .getTableItem(numberOfRows - 1); assertNotNull("Not all expected tags were present!", item); } catch (Exception e) { Assert.fail("Not all expected tags were present!"); } tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags) .getTableItem(expectedTag).select(); assertEquals("Did not find the expected tag in the list", expectedTag, tagDialog.bot().textWithLabel(UIText.CreateTagDialog_tagName) .getText()); }

Target:
private void selectTagInTree(SWTBotShell tagDialog, int numberOfRows, String expectedTag) throws InterruptedException { TestUtil.joinJobs(JobFamilies.FILL_TAG_LIST); assertEquals("tags count mismatch", numberOfRows, tagDialog.bot() .tableWithLabel(UIText.CreateTagDialog_existingTags) .rowCount()); tagDialog.bot().tableWithLabel(UIText.CreateTagDialog_existingTags) .getTableItem(expectedTag).select(); assertEquals("Did not find the expected tag in the list", expectedTag, tagDialog.bot().textWithLabel(UIText.CreateTagDialog_tagName) .getText()); }
Source:
private static boolean isValidType(GoType goType) { if (goType instanceof GoSpecType) { goType = ((GoSpecType)goType).getType(); } return goType instanceof GoArrayOrSliceType || goType instanceof GoMapType || goType instanceof GoChannelType || goType.getText().equals("string"); }

Target:
private static boolean isValidType(GoType goType) { if (goType instanceof GoSpecType) { goType = ((GoSpecType)goType).getType(); } return goType instanceof GoArrayOrSliceType || goType instanceof GoMapType || goType instanceof GoChannelType || (goType.textMatches("string") && GoPsiImplUtil.builtin(goType)); }
Source:
protected void addReplicationQueueTimeMetrics() { if (TableState.ONLINE != Tables.getTableState(master.getInstance(), ReplicationTable.ID)) { return; } if (replicationUtil.getPeers().isEmpty()) { return; } Set<Path> paths = replicationUtil.getPendingReplicationPaths(); long currentTime = System.currentTimeMillis(); for (Path path : paths) { if (!pathModTimes.containsKey(path)) { try { pathModTimes.put(path, master.getFileSystem().getFileStatus(path).getModificationTime()); } catch (IOException e) { } } } Set<Path> deletedPaths = new HashSet<>(pathModTimes.keySet()); deletedPaths.removeAll(paths); if (deletedPaths.isEmpty()) { return; } replicationQueueTimeStat.resetMinMax(); for (Path path : deletedPaths) { long modTime = pathModTimes.remove(path); long diff = Math.max(0, currentTime - modTime); replicationQueueTimeQuantiles.add(diff); replicationQueueTimeStat.add(diff); } }

Target:
protected void addReplicationQueueTimeMetrics() { Set<Path> paths = replicationUtil.getPendingReplicationPaths(); long currentTime = getCurrentTime(); for (Path path : paths) { if (!pathModTimes.containsKey(path)) { try { pathModTimes.put(path, master.getFileSystem().getFileStatus(path).getModificationTime()); } catch (IOException e) { log.trace("Failed to get file status for {}, file system is unavailable or it does not exist", path); } } } Set<Path> deletedPaths = new HashSet<>(pathModTimes.keySet()); deletedPaths.removeAll(paths); if (deletedPaths.isEmpty()) { return; } replicationQueueTimeStat.resetMinMax(); for (Path path : deletedPaths) { Long modTime = pathModTimes.remove(path); if (modTime != null) { long diff = Math.max(0, currentTime - modTime); replicationQueueTimeQuantiles.add(diff); replicationQueueTimeStat.add(diff); } } }
Source:
private void initRecyclerView() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { rvContributionsList.setLayoutManager(new GridLayoutManager(getContext(),SPAN_COUNT)); } else { rvContributionsList.setLayoutManager(new LinearLayoutManager(getContext())); } rvContributionsList.setAdapter(adapter); rvContributionsList.setItemViewCacheSize(0); adapter.setContributions(contributions); }

Target:
private void initRecyclerView() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { rvContributionsList.setLayoutManager(new GridLayoutManager(getContext(),SPAN_COUNT)); } else { rvContributionsList.setLayoutManager(new LinearLayoutManager(getContext())); } rvContributionsList.setAdapter(adapter); adapter.setContributions(contributions); }
Source:
protected boolean handlePreloadPackage(String packagePath, String libsPath) { ClassLoader loader = ApplicationLoaders.getDefault().getClassLoader(packagePath, Build.VERSION.SDK_INT, false, libsPath, null, null); try { Class providerClass = Class.forName(WebViewFactory.CHROMIUM_WEBVIEW_FACTORY, true, loader); Object result = providerClass.getMethod("preloadInZygote").invoke(null); if (!((Boolean)result).booleanValue()) { Log.e(TAG, "preloadInZygote returned false"); } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException e) { Log.e(TAG, "Exception while preloading package", e); } return false; }

Target:
protected boolean handlePreloadPackage(String packagePath, String libsPath) { ClassLoader loader = ApplicationLoaders.getDefault().createWebViewClassLoaderForZygote( packagePath, libsPath); try { Class providerClass = Class.forName(WebViewFactory.CHROMIUM_WEBVIEW_FACTORY, true, loader); Object result = providerClass.getMethod("preloadInZygote").invoke(null); if (!((Boolean)result).booleanValue()) { Log.e(TAG, "preloadInZygote returned false"); } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException e) { Log.e(TAG, "Exception while preloading package", e); } return false; }
Source:
private void initDb() throws SQLException { Statement stat = null; try { synchronized (server) { boolean tableFound; String pgCatalog = "PG_CATALOG", pgVersion = "PG_VERSION"; if (((JdbcConnection) conn).getSession().getStaticSettings().databaseToLower) { pgCatalog = pgCatalog.toLowerCase(); pgVersion = pgVersion.toLowerCase(); } try (ResultSet rs = conn.getMetaData().getTables(null, pgCatalog, pgVersion, null)) { tableFound = rs.next(); } stat = conn.createStatement(); if (!tableFound) { installPgCatalog(stat); } try (ResultSet rs = stat.executeQuery("select * from pg_catalog.pg_version")) { if (!rs.next() || rs.getInt(1) < 2) { installPgCatalog(stat); } else { int versionRead = rs.getInt(2); if (versionRead > 2) { throw DbException.throwInternalError("Incompatible PG_VERSION"); } } } } stat.execute("set search_path = PUBLIC, pg_catalog"); HashSet<Integer> typeSet = server.getTypeSet(); if (typeSet.isEmpty()) { try (ResultSet rs = stat.executeQuery("select oid from pg_catalog.pg_type")) { while (rs.next()) { typeSet.add(rs.getInt(1)); } } } } finally { JdbcUtils.closeSilently(stat); } }

Target:
private void initDb() throws SQLException { Statement stat = null; try { synchronized (server) { boolean tableFound; String pgCatalog = "PG_CATALOG", pgVersion = "PG_VERSION"; if (((JdbcConnection) conn).getSession().getStaticSettings().databaseToLower) { pgCatalog = StringUtils.toLowerEnglish(pgCatalog); pgVersion = StringUtils.toLowerEnglish(pgVersion); } try (ResultSet rs = conn.getMetaData().getTables(null, pgCatalog, pgVersion, null)) { tableFound = rs.next(); } stat = conn.createStatement(); if (!tableFound) { installPgCatalog(stat); } try (ResultSet rs = stat.executeQuery("select * from pg_catalog.pg_version")) { if (!rs.next() || rs.getInt(1) < 2) { installPgCatalog(stat); } else { int versionRead = rs.getInt(2); if (versionRead > 2) { throw DbException.throwInternalError("Incompatible PG_VERSION"); } } } } stat.execute("set search_path = PUBLIC, pg_catalog"); HashSet<Integer> typeSet = server.getTypeSet(); if (typeSet.isEmpty()) { try (ResultSet rs = stat.executeQuery("select oid from pg_catalog.pg_type")) { while (rs.next()) { typeSet.add(rs.getInt(1)); } } } } finally { JdbcUtils.closeSilently(stat); } }
Source:
public List<String> getNodesExceptHost(List<String> hostNames) { List<String> nodesList = new ArrayList<String>(); for (String host : nodeReportMap.keySet()) { String[] parts = host.split(":"); if (parts.length > 0) { if (hostNames.contains(parts[0]) || hostNames.contains(host)) { continue; } nodesList.add(parts[0]); } } return nodesList; }

Target:
public List<String> getNodesExceptHost(List<String> hostNames) { List<String> nodesList = new ArrayList<String>(); Set<String> hostNameSet = Sets.newHashSet(); hostNameSet.addAll(hostNames); for (String host : nodeReportMap.keySet()) { String[] parts = host.split(":"); if (parts.length > 0) { if (hostNameSet.contains(parts[0]) || hostNameSet.contains(host)) { continue; } nodesList.add(parts[0]); } } return nodesList; }
Source:
public void test6() { String def = "" + "module TEST " + "syntax Exp ::= Exp \"+\" Exp [klabel('Plus)] " + "| r\"[0-9]+\" [token] " + "endmodule"; Module test = ParserUtils.parseMainModuleOuterSyntax(def, "TEST"); ParseInModule parser = gen.getRuleGrammar(test); Tuple2<Either<Set<ParseFailedException>, Term>, Set<ParseFailedException>> rule = parser.parseString("1+2+3", startSymbol); Assert.assertEquals("Expected 1 warning: ", 1, rule._2().size()); Assert.assertTrue("Expected no errors here: ", rule._1().isRight()); printout(rule); }

Target:
public void test6() { String def = "" + "module TEST " + "syntax Exp ::= Exp \"+\" Exp [klabel('Plus)] " + "| r\"[0-9]+\" [token] " + "endmodule"; Tuple2<Either<Set<ParseFailedException>, Term>, Set<ParseFailedException>> rule = parseRule(def, "1+2+3"); Assert.assertEquals("Expected 1 warning: ", 1, rule._2().size()); Assert.assertTrue("Expected no errors here: ", rule._1().isRight()); printout(rule); }
Source:
default void addCharge(Location l, int charge) { Validate.isTrue(charge > 0, "You can only add a positive charge!"); int capacity = getCapacity(); if (capacity > 0) { int currentCharge = getCharge(l); if (currentCharge < capacity) { int newCharge = Math.min(capacity, currentCharge + charge); BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(newCharge), false); if (getEnergyComponentType() == EnergyNetComponentType.CAPACITOR) { SlimefunUtils.updateCapacitorTexture(l, charge, capacity); } } } }

Target:
default void addCharge(Location l, int charge) { Validate.notNull(l, "Location was null!"); Validate.isTrue(charge > 0, "You can only add a positive charge!"); int capacity = getCapacity(); if (capacity > 0) { int currentCharge = getCharge(l); if (currentCharge < capacity) { int newCharge = Math.min(capacity, currentCharge + charge); BlockStorage.addBlockInfo(l, "energy-charge", String.valueOf(newCharge), false); if (getEnergyComponentType() == EnergyNetComponentType.CAPACITOR) { SlimefunUtils.updateCapacitorTexture(l, charge, capacity); } } } }
Source:
public String getMetricsJson(String url) throws IOException { String responseJson; responseJson = HttpUtils.get(url, COLLECT_METRICS_TIMEOUT); return String.format("Url: %s%nResponse: %s", url, responseJson); }

Target:
public String getMetricsJson(String url) throws IOException { String responseJson = HttpUtils.get(url, COLLECT_METRICS_TIMEOUT); return String.format("Url: %s%nResponse: %s", url, responseJson); }
Source:
public void shutdown() { long shutdownBeginTime = System.currentTimeMillis(); isUp = false; try { if (securityService != null) { securityService.close(); securityService = null; } if (idConverter != null) { idConverter.close(); idConverter = null; } if (accountService != null) { accountService.close(); } logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } finally { frontendMetrics.blobStorageServiceShutdownTimeInMs.update(System.currentTimeMillis() - shutdownBeginTime); } }

Target:
public void shutdown() { long shutdownBeginTime = System.currentTimeMillis(); isUp = false; try { if (securityService != null) { securityService.close(); securityService = null; } if (idConverter != null) { idConverter.close(); idConverter = null; } accountService.close(); logger.info("AmbryBlobStorageService shutdown complete"); } catch (IOException e) { logger.error("Downstream service close failed", e); } finally { frontendMetrics.blobStorageServiceShutdownTimeInMs.update(System.currentTimeMillis() - shutdownBeginTime); } }
Source:
void collectStats(final StatsCollector collector) { collector.record("compaction.count", complex_compactions); collector.record("compaction.duplicates", duplicates_same, "values=same"); collector.record("compaction.duplicates", duplicates_different, "values=different"); if (!tsdb.config.enable_compactions()) { return; } collector.record("compaction.queue.size", size); collector.record("compaction.errors", handle_read_error.errors, "rpc=read"); collector.record("compaction.errors", handle_write_error.errors, "rpc=put"); collector.record("compaction.errors", handle_delete_error.errors, "rpc=delete"); collector.record("compaction.writes", written_cells); collector.record("compaction.deletes", deleted_cells); }

Target:
void collectStats(final StatsCollector collector) { collector.record("compaction.count", compaction_count); collector.record("compaction.duplicates", duplicates_same, "type=identical"); collector.record("compaction.duplicates", duplicates_different, "type=variant"); if (!tsdb.config.enable_compactions()) { return; } collector.record("compaction.queue.size", size); collector.record("compaction.errors", handle_read_error.errors, "rpc=read"); collector.record("compaction.errors", handle_write_error.errors, "rpc=put"); collector.record("compaction.errors", handle_delete_error.errors, "rpc=delete"); collector.record("compaction.writes", written_cells); collector.record("compaction.deletes", deleted_cells); }
Source:
private void startEditExpenseClaimActivity(int position) { Intent editIntent = new Intent(this, ExpenseClaimDetailActivity.class); if(checkFilteredTags()) { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, filteredListModel.getItems().get(position)); position = listModel.getItems().indexOf(filteredListModel.getItems().get(position)); } else { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, listModel.getItems().get(position)); } editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, position); editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_USER, userManager.getActiveUser()); startActivityForResult(editIntent, EDIT_EXPENSE_CLAIM_REQUEST); }

Target:
private void startEditExpenseClaimActivity(int position) { Intent editIntent = new Intent(this, ExpenseClaimDetailActivity.class); if (!filteredTagsList.isEmpty()) { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, filteredListModel.getItems().get(position)); position = listModel.getItems().indexOf(filteredListModel.getItems().get(position)); } else { editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM, listModel.getItems().get(position)); } editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, position); editIntent.putExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_USER, userManager.getActiveUser()); startActivityForResult(editIntent, EDIT_EXPENSE_CLAIM_REQUEST); }
Source:
public ResponseEntity<?> getPaymentStatusForUser() { PaymentType paymentTypeEnum = PaymentType.USER_LICENSE; ChargeDTO resultDTO; try { resultDTO = paymentService.getPaymentStatus(paymentTypeEnum); } catch (ServiceException e) { LOG.log(Level.SEVERE, e.getMessage()); throw new BadRequestException(e.getMessage()); } return new ResponseEntity<>(resultDTO, HttpStatus.OK); }

Target:
public ResponseEntity<ChargeDTO> getPaymentStatusForUser() { PaymentType paymentTypeEnum = PaymentType.USER_LICENSE; ChargeDTO resultDTO; try { resultDTO = paymentService.getPaymentStatus(paymentTypeEnum); } catch (ServiceException e) { LOG.log(Level.SEVERE, e.getMessage()); throw new BadRequestException(e.getMessage()); } return new ResponseEntity<>(resultDTO, HttpStatus.OK); }
Source:
public void setUp() { solrLoader.setConfigurationPath("some/path"); solrLoader.setCopyConfiguration(true); solrLoader.setIndexesConfiguration(Lists.newArrayList(firstIndexConfiguration, secondIndexConfiguration)); solrLoader.setIndexConfigurationCopier(indexConfigurationCopier); solrLoader.setIndexReloader(indexReloader); }

Target:
public void setUp() { solrLoader.setConfigurationPath(CONFIGURATION_PATH); solrLoader.setCopyConfiguration(true); solrLoader.setIndexesConfiguration(Lists.newArrayList(firstIndexConfiguration, secondIndexConfiguration)); solrLoader.setIndexConfigurationCopier(indexConfigurationCopier); solrLoader.setIndexReloader(indexReloader); }
Source:
public static boolean updateFromStorage(IJavaProject eclipseProject, IProgressMonitor monitor) throws JavaModelException { PersistentModel model = CorePlugin.modelPersistence().loadModel(eclipseProject.getProject()); if (model.isEmptyModel()) { return false; } else { setClasspathContainer(eclipseProject, model.getClasspath(), monitor); return true; } }

Target:
public static boolean updateFromStorage(IJavaProject eclipseProject, IProgressMonitor monitor) throws JavaModelException { PersistentModel model = CorePlugin.modelPersistence().loadModel(eclipseProject.getProject()); if (model.isPresent()) { setClasspathContainer(eclipseProject, model.getClasspath(), monitor); return true; } else { return false; } }
Source:
public void testFilterVariableValueToEObjectVariableValueMigration() { copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, REPRESENTATIONS_FILE_PATH, REPRESENTATIONS_FILE_NAME, MODEL_FILE_NAME, MODELER_FILE_NAME); ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + REPRESENTATIONS_FILE_NAME, true), set); } catch (IOException e) { fail("Pb when loading the resource : " + e.getMessage()); } assertNotNull("Analysis is not retrieved.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { fail("Pb when saving the resource : " + e.getMessage()); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkRepMigrationEffect(analysis); }

Target:
public void testFilterVariableValueToEObjectVariableValueMigration() throws IOException { copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, REPRESENTATIONS_FILE_PATH, REPRESENTATIONS_FILE_NAME, MODEL_FILE_NAME, MODELER_FILE_NAME); ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + REPRESENTATIONS_FILE_NAME, true), set); assertNotNull("Analysis is not retrieved.", analysis); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); analysis.eResource().save(Collections.emptyMap()); version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkRepMigrationEffect(analysis); }
Source:
private static String pathWithTimestamp(ServletContext context, HttpServletRequest request, String path) { if (context != null) { try { URL resource = CodeUtils.getResource(context, path); if (resource != null) { URLConnection resourceConnection = resource.openConnection(); InputStream resourceInput = resourceConnection.getInputStream(); try { return StringUtils.addQueryParameters( request.getContextPath() + StringUtils.ensureStart(path, "/"), "_", resourceConnection.getLastModified()); } finally { resourceInput.close(); } } } catch (IOException error) { } } return path; }

Target:
private static String pathWithTimestamp(ServletContext context, HttpServletRequest request, String path) { if (context != null) { try { URL resource = CodeUtils.getResource(context, path); if (resource != null) { URLConnection resourceConnection = resource.openConnection(); InputStream resourceInput = resourceConnection.getInputStream(); try { String contextPath = request != null ? request.getContextPath() : ""; return StringUtils.addQueryParameters( contextPath + StringUtils.ensureStart(path, "/"), "_", resourceConnection.getLastModified()); } finally { resourceInput.close(); } } } catch (IOException error) { } } return path; }
Source:
public JdbcFilterDao() { getIpListTimer = metricRegistry.timer("getIPAddressList"); jmxReporter = JmxReporter.forRegistry(metricRegistry).inDomain("org.opennms.netmgt.config").build(); jmxReporter.start(); }

Target:
public JdbcFilterDao() { getIpListTimer = metricRegistry.timer("getIPAddressListForFilter"); }
Source:
public InternalThreadExecutor(ThreadFactory threadFactory) { super(Config.<Integer> getValue(ConfigValues.DefaultMinThreadPoolSize), Config.<Integer> getValue(ConfigValues.DefaultMaxThreadPoolSize), 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(Config.<Integer>getValue(ConfigValues.DefaultMaxThreadWaitQueueSize)), threadFactory); }

Target:
public InternalThreadExecutor(ThreadFactory threadFactory) { super(Integer.parseInt(System.getProperty("org.ovirt.engine.core.utils.threadpool.minSize")), Integer.parseInt(System.getProperty("org.ovirt.engine.core.utils.threadpool.maxSize")), 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(Integer.parseInt( System.getProperty("org.ovirt.engine.core.utils.threadpool.maxWaitQueueSize"))), threadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); }
Source:
public void openmrsDateFormat_shouldNotAllowDatesWithInvalidDaysOrMonths() throws Exception { try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("1/13/2001"); fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("32/1/2001"); fail("Date with invalid day should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("13/1/2001"); fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("1/32/2001"); fail("Date with invalid day should throw exception."); } catch (ParseException e) }

Target:
public void openmrsDateFormat_shouldNotAllowDatesWithInvalidDaysOrMonths() throws Exception { try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("1/13/2001"); Assert.fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "GB")); sdf.parse("32/1/2001"); Assert.fail("Date with invalid day should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("13/1/2001"); Assert.fail("Date with invalid month should throw exception."); } catch (ParseException e) try { SimpleDateFormat sdf = OpenmrsUtil.getDateFormat(new Locale("en", "US")); sdf.parse("1/32/2001"); Assert.fail("Date with invalid day should throw exception."); } catch (ParseException e) }
Source:
private List<ColumnOrder> getColumnOrders(MessageType schema) { List<ColumnOrder> columnOrders = new ArrayList<>(); for (int i = 0, n = schema.getPaths().size(); i < n; ++i) { ColumnOrder columnOrder = new ColumnOrder(); columnOrder.setTYPE_ORDER(new TypeDefinedOrder()); columnOrders.add(columnOrder); } return columnOrders; }

Target:
private List<ColumnOrder> getColumnOrders(MessageType schema) { List<ColumnOrder> columnOrders = new ArrayList<>(); for (int i = 0, n = schema.getPaths().size(); i < n; ++i) { ColumnOrder columnOrder = new ColumnOrder(); columnOrder.setTYPE_ORDER(TYPE_DEFINED_ORDER); columnOrders.add(columnOrder); } return columnOrders; }
Source:
public CompletableSource apply(Completable upstream) { return Completable.amb( Arrays.asList( upstream, takeUntilCorrespondingEvent(sharedLifecycle, correspondingEvents) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ) ); }

Target:
public CompletableSource apply(Completable upstream) { return Completable.ambArray( upstream, takeUntilCorrespondingEvent(sharedLifecycle, correspondingEvents) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ); }
Source:
public void cancelSchedule(ScheduleToken scheduleToken) { shutdownLatch.ifShuttingDown("Cannot dispatch new events as this scheduler is being shutdown"); Assert.isTrue(scheduleToken instanceof SimpleScheduleToken, () -> "Invalid tracking token type. Must be SimpleScheduleToken."); String token = ((SimpleScheduleToken) scheduleToken).getTokenId(); Channel channel = axonServerConnectionManager.getChannel(axonServerConfiguration.getContext()); EventSchedulerGrpc.EventSchedulerFutureStub scheduleStub = EventSchedulerGrpc.newFutureStub(channel); try { InstructionAck instructionAck = scheduleStub.cancelScheduledEvent(CancelScheduledEventRequest.newBuilder() .setToken( token) .build()) .get(); if (!instructionAck.getSuccess()) { throw ErrorCode.getFromCode(instructionAck.getError().getErrorCode()).convert(instructionAck .getError()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } }

Target:
public void cancelSchedule(ScheduleToken scheduleToken) { Assert.isTrue(started.get(), () -> "Scheduler is being shutdown"); Assert.isTrue(scheduleToken instanceof SimpleScheduleToken, () -> "Invalid tracking token type. Must be SimpleScheduleToken."); String token = ((SimpleScheduleToken) scheduleToken).getTokenId(); try { InstructionAck instructionAck = eventSchedulerStub().cancelScheduledEvent(CancelScheduledEventRequest .newBuilder() .setToken( token) .build()) .get(); if (!instructionAck.getSuccess()) { throw ErrorCode.getFromCode(instructionAck.getError().getErrorCode()).convert(instructionAck .getError()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw GrpcExceptionParser.parse(e); } catch (ExecutionException e) { throw GrpcExceptionParser.parse(e.getCause()); } }
Source:
private void pushLaunchPopup() { Config config = context.get(Config.class); TelemetryConfig telemetryConfig = config.getTelemetryConfig(); LaunchPopupConfig launchPopupConfig = config.getLaunchPopupConfig(); TranslationSystem translationSystem = context.get(TranslationSystem.class); TelemetryLogstashAppender appender = TelemetryUtils.fetchTelemetryLogstashAppender(); if (!launchPopupConfig.isLaunchPopupDisabled()) { String telemetryTitle = translationSystem.translate("${engine:menu#telemetry-launch-popup-title}"); String telemetryMessage = translationSystem.translate("${engine:menu#telemetry-launch-popup-text}"); LaunchPopup telemetryConfirmPopup = nuiManager.pushScreen(LaunchPopup.ASSET_URI, LaunchPopup.class); telemetryConfirmPopup.setMessage(telemetryTitle, telemetryMessage); telemetryConfirmPopup.setYesHandler(() -> { telemetryConfig.setAllEnabled(true); appender.start(); }); telemetryConfirmPopup.setNoHandler(() -> { telemetryConfig.setAllEnabled(false); appender.stop(); }); telemetryConfirmPopup.setOptionButtonText(translationSystem.translate("${engine:menu#telemetry-button}")); telemetryConfirmPopup.setOptionHandler(()-> { nuiManager.pushScreen(TelemetryScreen.ASSET_URI,TelemetryScreen.class); }); } }

Target:
private void pushLaunchPopup() { Config config = context.get(Config.class); TelemetryConfig telemetryConfig = config.getTelemetryConfig(); TranslationSystem translationSystem = context.get(TranslationSystem.class); TelemetryLogstashAppender appender = TelemetryUtils.fetchTelemetryLogstashAppender(); if (!telemetryConfig.isLaunchPopupDisabled()) { String telemetryTitle = translationSystem.translate("${engine:menu#telemetry-launch-popup-title}"); String telemetryMessage = translationSystem.translate("${engine:menu#telemetry-launch-popup-text}"); LaunchPopup telemetryConfirmPopup = nuiManager.pushScreen(LaunchPopup.ASSET_URI, LaunchPopup.class); telemetryConfirmPopup.setMessage(telemetryTitle, telemetryMessage); telemetryConfirmPopup.setYesHandler(() -> { telemetryConfig.setTelemetryAndErrorReportingEnable(true); appender.start(); }); telemetryConfirmPopup.setNoHandler(() -> { telemetryConfig.setTelemetryAndErrorReportingEnable(false); appender.stop(); }); telemetryConfirmPopup.setOptionButtonText(translationSystem.translate("${engine:menu#telemetry-button}")); telemetryConfirmPopup.setOptionHandler(()-> { nuiManager.pushScreen(TelemetryScreen.ASSET_URI, TelemetryScreen.class); }); } }
Source:
public T get(final int index) { try { return this.origin.get(index); } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException(this.message, ex); } }

Target:
public T get(final int index) { try { return this.origin.get(index); } catch (final IndexOutOfBoundsException ex) { throw this.wrapException(ex); } }
Source:
Mono<Response<Map<String, String>>> getTagsWithResponse(Context context) { return this.azureBlobStorage.blobs().getTagsWithRestResponseAsync(null, null, null, null, snapshot, null , context) .map(response -> { Map<String, String> tags = new HashMap<>(); for(BlobTag tag : response.getValue().getBlobTagSet()) { tags.put(tag.getKey(), tag.getValue()); } return new SimpleResponse<>(response, tags); }); }

Target:
Mono<Response<Map<String, String>>> getTagsWithResponse(Context context) { return this.azureBlobStorage.blobs().getTagsWithRestResponseAsync(null, null, null, null, snapshot, versionId, context) .map(response -> { Map<String, String> tags = new HashMap<>(); for (BlobTag tag : response.getValue().getBlobTagSet()) { tags.put(tag.getKey(), tag.getValue()); } return new SimpleResponse<>(response, tags); }); }
Source:
public TextView addTitleBar(String title) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_title_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTitleView); if (mCustomDialogBundle.hasProgressDialog() || mCustomDialogBundle.hasLoadingBar()) { mFieldsLayout.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT); p.weight = 2; field.setLayoutParams(p); field.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); textView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setTextColor(ContextCompat.getColor(getContext(), R.color.black)); } textView.setText(title); textView.setSingleLine(true); mFieldsLayout.addView(field); return textView; }

Target:
public TextView addTitleBar(String title) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_title_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTitleView); if (mCustomDialogBundle.hasProgressDialog() || mCustomDialogBundle.hasLoadingBar()) { mFieldsLayout.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT); params.weight = 2; field.setLayoutParams(params); field.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); textView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white)); textView.setTextColor(ContextCompat.getColor(getContext(), R.color.black)); } textView.setText(title); textView.setSingleLine(true); mFieldsLayout.addView(field); return textView; }
Source:
public void addRequest(HttpServletRequest req, String category) { AtomicLong val = requestCategories.get(category); if (val == null) { val = new AtomicLong(0); } val.incrementAndGet(); requestCategories.put(category, val); }

Target:
synchronized public void addRequest(HttpServletRequest req, String category) { Long val = requestCategories.get(category); if (val == null) { val = new Long(0); } val += 1; requestCategories.put(category, val); }