auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testGroupByLongColumn() { GroupByQuery query = GroupByQuery .builder() .setDataSource(QueryRunnerTestHelper.dataSource) .setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird) .setDimensions(Lists.<DimensionSpec>newArrayList(new DefaultDimensionSpec("__time", "time_alias", ValueType.LONG))) .setDimFilter(new SelectorDimFilter("quality", "entertainment", null)) .setAggregatorSpecs( Arrays.asList( QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index") ) ) .setGranularity(QueryRunnerTestHelper.dayGran) .build(); if (config.getDefaultStrategy().equals(GroupByStrategySelector.STRATEGY_V1)) { <START> expectedException.expect(UnsupportedOperationException.class); <END> } List<Row> expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", "time_alias", 1301616000000L, "rows", 1L, "idx", 158L ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-02", "time_alias", 1301702400000L, "rows", 1L, "idx", 166L ) ); Iterable<Row> results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, ""); }</code><technical_language>test more robust expectMessage too</technical_language>

Target:
public void testGroupByLongColumn() { if (config.getDefaultStrategy().equals(GroupByStrategySelector.STRATEGY_V1)) { expectedException.expect(UnsupportedOperationException.class); expectedException.expectMessage("GroupBy v1 only supports dimensions with an outputType of STRING."); } GroupByQuery query = GroupByQuery .builder() .setDataSource(QueryRunnerTestHelper.dataSource) .setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird) .setDimensions(Lists.<DimensionSpec>newArrayList(new DefaultDimensionSpec("qualityLong", "ql_alias", ValueType.LONG))) .setDimFilter(new SelectorDimFilter("quality", "entertainment", null)) .setAggregatorSpecs( Arrays.asList( QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index") ) ) .addOrderByColumn(new OrderByColumnSpec( "ql_alias", OrderByColumnSpec.Direction.ASCENDING, StringComparators.NUMERIC )) .setGranularity(QueryRunnerTestHelper.dayGran) .build(); Assert.assertEquals( Functions.<Sequence<Row>>identity(), query.getLimitSpec().build( query.getDimensions(), query.getAggregatorSpecs(), query.getPostAggregatorSpecs() ) ); List<Row> expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", "ql_alias", 1200L, "rows", 1L, "idx", 158L ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-02", "ql_alias", 1200L, "rows", 1L, "idx", 166L ) ); Iterable<Row> results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, ""); }
Source:
<code><START> public String removeBracketsForArrayString(String arrayString) { <END> return arrayString.substring(1, arrayString.length() - 1).trim(); }</code><technical_language>good change this private</technical_language>

Target:
private String removeBracketsForArrayString(String arrayString) { return arrayString.substring(1, arrayString.length() - 1).trim(); }
Source:
<code>public void remove () { if (currentIndex < 0) throw new IllegalStateException("next must be called before remove."); K[] keyTable = map.keyTable; V[] valueTable = map.valueTable; int loc = currentIndex; final int mask = map.mask; <START> K key; <END> while ((key = keyTable[loc + 1 & mask]) != null && (loc + 1 & mask) != map.place(key)) { keyTable[loc] = key; valueTable[loc] = valueTable[loc + 1 & mask]; ++loc; } if(loc != currentIndex) --nextIndex; keyTable[loc] = null; valueTable[loc] = null; --map.size; currentIndex = -1; }</code><technical_language>here, doubled calc</technical_language>

Target:
public void remove () { if (currentIndex < 0) throw new IllegalStateException("next must be called before remove."); K[] keyTable = map.keyTable; V[] valueTable = map.valueTable; final int mask = map.mask; int loc = currentIndex, nl = (loc + 1 & mask); K key; while ((key = keyTable[nl]) != null && nl != map.place(key)) { keyTable[loc] = key; valueTable[loc] = valueTable[nl]; loc = nl; nl = loc + 1 & mask; } if (loc != currentIndex) --nextIndex; keyTable[loc] = null; valueTable[loc] = null; --map.size; currentIndex = -1; }
Source:
<code>public void multiIndex_incompatibleAnalyzer_skipAnalysis() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.simpleQueryString().onField( absoluteFieldPath ).matching( TERM_5 ) .skipAnalysis() ) .toQuery(); <START> assertThat( query ).assertThat( query ).hasDocRefHitsAnyOrder( b -> { <END> b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }</code><technical_language>assertThat( query ).assertThat( query )</technical_language>

Target:
public void multiIndex_incompatibleAnalyzer_skipAnalysis() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.simpleQueryString().onField( absoluteFieldPath ).matching( TERM_5 ) .skipAnalysis() ) .toQuery(); assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }
Source:
<code>private void updateStickyProfile(IPerson person, UserProfile stickyProfile, String profileName) { if (person.getID() == -1) { try { throw new RuntimeException(); } catch (Exception e) { <START> e.printStackTrace(System.out); <END> } } stickyProfile.setProfileName(profileName); layoutStore.updateUserProfile(person, stickyProfile); }</code><technical_language>This seems... strange</technical_language>

Target:
private void updateStickyProfile(IPerson person, UserProfile stickyProfile, String profileName) { stickyProfile.setProfileName(profileName); layoutStore.updateUserProfile(person, stickyProfile); }
Source:
<code>public void testRankWithString() throws Exception { Client client = getClient(); long input[][] = expected.clone(); shuffleArrayOfLongs(input); ClientResponse cr; VoltTable vt; for (long row : input) { cr = client.callProcedure("T_STRING.insert", row[colA], row[colB], Long.toString(row[colC], 10)); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); } String sql = "select A, B, C, rank() over (partition by A order by B) as R from T_STRING ORDER BY A, B, C, R;"; cr = client.callProcedure("@AdHoc", sql); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); vt = cr.getResults()[0]; assertEquals(expected.length, vt.getRowCount()); for (int rowIdx = 0; vt.advanceRow(); rowIdx += 1) { assertEquals(expected[rowIdx][colA], vt.getLong(0)); assertEquals(expected[rowIdx][colB], vt.getLong(1)); assertEquals(Long.toString(expected[rowIdx][colC], 10), vt.getString(2)); <START> assertEquals(expected[rowIdx][colR_A], vt.getLong(3)); <END> } }</code><technical_language>Do tests do a PARTITION a string column</technical_language>

Target:
public void testRankWithString() throws Exception { Client client = getClient(); long input[][] = expected.clone(); shuffleArrayOfLongs(input); ClientResponse cr; VoltTable vt; for (long row : input) { cr = client.callProcedure("T_STRING.insert", row[colA], row[colB], Long.toString(row[colC], 10)); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); cr = client.callProcedure("T_STRING_A.insert", Long.toString(row[colA], 10), row[colB], row[colC]); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); } String sql; sql = "select A, B, C, rank() over (partition by A order by B) as R from T_STRING ORDER BY A, B, C, R;"; cr = client.callProcedure("@AdHoc", sql); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); vt = cr.getResults()[0]; assertEquals(expected.length, vt.getRowCount()); for (int rowIdx = 0; vt.advanceRow(); rowIdx += 1) { assertEquals(expected[rowIdx][colA], vt.getLong(0)); assertEquals(expected[rowIdx][colB], vt.getLong(1)); assertEquals(Long.toString(expected[rowIdx][colC], 10), vt.getString(2)); assertEquals(expected[rowIdx][colR_A], vt.getLong(3)); } sql = "select A, B, C, rank() over (partition by A order by B) as R from T_STRING_A ORDER BY A, B, C, R;"; cr = client.callProcedure("@AdHoc", sql); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); vt = cr.getResults()[0]; assertEquals(expected.length, vt.getRowCount()); for (int rowIdx = 0; vt.advanceRow(); rowIdx += 1) { assertEquals(Long.toString(expected[rowIdx][colA], 10), vt.getString(0)); assertEquals(expected[rowIdx][colB], vt.getLong(1)); assertEquals(expected[rowIdx][colC], vt.getLong(2)); assertEquals(expected[rowIdx][colR_A], vt.getLong(3)); } }
Source:
<code>public String createTeam(@PathVariable int tournamentId, Model model, HttpSession session) { if (session.getAttribute("member") == null) { return "redirect:denied"; } <START> Member member = (Member) session.getAttribute("member"); <END> List<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); model.addAttribute("tournamentId", tournamentId); return "createTeam"; }</code><technical_language>Moving this checking if member object is null instead of accessing session</technical_language>

Target:
public String createTeam(@PathVariable int tournamentId, Model model, HttpSession session) { Member member = (Member) session.getAttribute("member"); if (member == null) { return "redirect:/denied"; } Set<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); model.addAttribute("tournamentId", tournamentId); return "createTeam"; }
Source:
<code>public void deleteIncludedGroups(final AccountGroup.Id groupId, final Set<AccountGroupIncludedGroup.Key> keys, final AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(final ReviewDb db) throws OrmException, NoSuchGroupException, Failure { final GroupControl control = groupControlFactory.validateFor(groupId); if (control.getAccountGroup().getType() != AccountGroup.Type.INTERNAL) { throw new Failure(new NameAlreadyUsedException()); } final Account.Id me = getAccountId(); <START> for (final AccountGroupIncludedGroup.Key k : keys) { <END> final AccountGroupIncludedGroup m = db.accountGroupIncludedGroups().get(k); if (m != null) { if (!control.canRemoveGroup(m.getIncludedGroupId())) { throw new Failure(new NoSuchEntityException()); } AccountGroupIncludedGroupAudit audit = null; for (AccountGroupIncludedGroupAudit a : db.accountGroupIncludedGroupsAudit() .byGroupIncludedGroup(m.getGroupId(), m.getIncludedGroupId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me); db.accountGroupIncludedGroupsAudit() .update(Collections.singleton(audit)); } db.accountGroupIncludedGroups().delete(Collections.singleton(m)); includedGroupCache.evictIncludedGroup(m.getIncludedGroupId()); } includedGroupCache.evictGroup(groupId); } return VoidResult.INSTANCE; } }); }</code><technical_language>validate group in matches groupId argument passed web UI. If match, this delete continue</technical_language>

Target:
public void deleteIncludedGroups(final AccountGroup.Id groupId, final Set<AccountGroupIncludedGroup.Key> keys, final AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(final ReviewDb db) throws OrmException, NoSuchGroupException, Failure { final GroupControl control = groupControlFactory.validateFor(groupId); if (control.getAccountGroup().getType() != AccountGroup.Type.INTERNAL) { throw new Failure(new NameAlreadyUsedException()); } for (final AccountGroupIncludedGroup.Key k : keys) { if (!groupId.equals(k.getGroupId())) { throw new Failure(new NoSuchEntityException()); } } final Account.Id me = getAccountId(); for (final AccountGroupIncludedGroup.Key k : keys) { final AccountGroupIncludedGroup m = db.accountGroupIncludedGroups().get(k); if (m != null) { if (!control.canRemoveGroup(m.getIncludedGroupId())) { throw new Failure(new NoSuchEntityException()); } AccountGroupIncludedGroupAudit audit = null; for (AccountGroupIncludedGroupAudit a : db .accountGroupIncludedGroupsAudit().byGroupIncludedGroup( m.getGroupId(), m.getIncludedGroupId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me); db.accountGroupIncludedGroupsAudit().update( Collections.singleton(audit)); } db.accountGroupIncludedGroups().delete(Collections.singleton(m)); includedGroupCache.evictIncludedGroup(m.getIncludedGroupId()); } } return VoidResult.INSTANCE; } }); }
Source:
<code>public PartialFileHistory getFileHistoryWithLastVersionByPath(String path) { try (PreparedStatement preparedStatement = getStatement("filehistory.select.master.findLatestFileVersionsForPath.sql")) { preparedStatement.setString(1, path); try (ResultSet resultSet = preparedStatement.executeQuery()) { String latestFileHistoryId = null; Long latestFileVersion = null; VectorClock latestVectorClock = null; while (resultSet.next()) { VectorClock clock = VectorClock.parseVectorClock(resultSet.getString("vectorclock_serialized")); <START> if (latestVectorClock == null || VectorClock.compare(clock, latestVectorClock) == VectorClock.VectorClockComparison.GREATER) { <END> latestVectorClock = clock; latestFileHistoryId = resultSet.getString("filehistory_id"); latestFileVersion = resultSet.getLong("version"); } } if (latestFileHistoryId == null) { return null; } PartialFileHistory fileHistory = getLastVersionByFileHistoryId(latestFileHistoryId); if (fileHistory.getLastVersion().getVersion() == latestFileVersion) { return fileHistory; } else { return null; } } } catch (SQLException e) { throw new RuntimeException(e); } }</code><technical_language>elegant. I thought of :+1:</technical_language>

Target:
public PartialFileHistory getFileHistoryWithLastVersionByPath(String path) { try (PreparedStatement preparedStatement = getStatement("filehistory.select.master.findLatestFileVersionsForPath.sql")) { preparedStatement.setString(1, path); try (ResultSet resultSet = preparedStatement.executeQuery()) { String latestFileHistoryId = null; Long latestFileVersion = null; VectorClock latestVectorClock = null; while (resultSet.next()) { VectorClock resultSetVectorClock = VectorClock.parseVectorClock(resultSet.getString("vectorclock_serialized")); boolean vectorClockIsGreater = latestVectorClock == null || VectorClock.compare(resultSetVectorClock, latestVectorClock) == VectorClock.VectorClockComparison.GREATER; if (vectorClockIsGreater) { latestVectorClock = resultSetVectorClock; latestFileHistoryId = resultSet.getString("filehistory_id"); latestFileVersion = resultSet.getLong("version"); } } if (latestFileHistoryId == null) { return null; } PartialFileHistory fileHistory = getLastVersionByFileHistoryId(latestFileHistoryId); if (fileHistory.getLastVersion().getVersion() == latestFileVersion) { return fileHistory; } else { return null; } } } catch (SQLException e) { throw new RuntimeException(e); } }
Source:
<code>private static void runHeadless(Config options, String saveFile) { try { final Server server = new Server( options, false ); final String teamA = options.get("bc.game.team-a"); final URL teamAClasses; if (options.get("bc.game.team-a.classes") != null) { teamAClasses = new URL(options.get("bc.game.team-a.classes")); } else { teamAClasses = null; } final String teamAPackage; if (options.get("bc.game.team-a.package") != null) { teamAPackage = options.get("bc.game.team-a.package"); } else { teamAPackage = teamA; } final String teamB = options.get("bc.game.team-b"); final URL teamBClasses; if (options.get("bc.game.team-b.classes") != null) { teamBClasses = new URL(options.get("bc.game.team-b.classes")); } else { teamBClasses = null; } final String teamBPackage; if (options.get("bc.game.team-b.package") != null) { teamBPackage = options.get("bc.game.team-b.package"); } else { teamBPackage = teamB; } final String[] maps = options.get("bc.game.maps").split(","); final boolean bestOfThree; if (options.get("bc.game.best-of-three").equals("true") && maps.length == 3) { bestOfThree = true; } else { bestOfThree = false; } server.addGameNotification(new GameInfo( teamA, teamAPackage, teamAClasses, teamB, teamBPackage, teamBClasses, maps, new File(options.get("bc.server.save-file")), <START> bestOfThree <END> )); server.terminateNotification(); server.run(); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>options.getBoolean("bc.game.best-of-three")</technical_language>

Target:
private static void runHeadless(Config options, String saveFile) { try { final Server server = new Server( options, false ); final String teamA = options.get("bc.game.team-a"); final URL teamAClasses; if (options.get("bc.game.team-a.classes") != null) { teamAClasses = new URL(options.get("bc.game.team-a.classes")); } else { teamAClasses = null; } final String teamAPackage; if (options.get("bc.game.team-a.package") != null) { teamAPackage = options.get("bc.game.team-a.package"); } else { teamAPackage = teamA; } final String teamB = options.get("bc.game.team-b"); final URL teamBClasses; if (options.get("bc.game.team-b.classes") != null) { teamBClasses = new URL(options.get("bc.game.team-b.classes")); } else { teamBClasses = null; } final String teamBPackage; if (options.get("bc.game.team-b.package") != null) { teamBPackage = options.get("bc.game.team-b.package"); } else { teamBPackage = teamB; } final String[] maps = options.get("bc.game.maps").split(","); server.addGameNotification(new GameInfo( teamA, teamAPackage, teamAClasses, teamB, teamBPackage, teamBClasses, maps, new File(options.get("bc.server.save-file")), options.getBoolean("bc.game.best-of-three") && maps.length == 3 )); server.terminateNotification(); server.run(); } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>@Override @NonNull public View getView(int position, View convertView, @NonNull ViewGroup parent) { <START> LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); <END> ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.item_page_list_entry, null); holder = new ViewHolder(); holder.icon = (SimpleDraweeView) convertView.findViewById(R.id.page_list_item_image); holder.title = (TextView) convertView.findViewById(R.id.page_list_item_title); holder.description = (GoneIfEmptyTextView) convertView.findViewById(R.id.page_list_item_description); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final DisambigResult item = items[position]; holder.title.setText(item.getTitle().getDisplayText()); holder.description.setText(item.getTitle().getDescription()); ViewUtil.loadImageUrlInto(holder.icon, pageImagesCache.get(item.getTitle().getPrefixedText())); return convertView; }</code><technical_language>I this LayoutInflater.from(context)</technical_language>

Target:
@Override @NonNull public View getView(int position, View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.item_page_list_entry, null); holder = new ViewHolder(); holder.icon = (SimpleDraweeView) convertView.findViewById(R.id.page_list_item_image); holder.title = (TextView) convertView.findViewById(R.id.page_list_item_title); holder.description = (GoneIfEmptyTextView) convertView.findViewById(R.id.page_list_item_description); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final DisambigResult item = items[position]; holder.title.setText(item.getTitle().getDisplayText()); holder.description.setText(item.getTitle().getDescription()); ViewUtil.loadImageUrlInto(holder.icon, pageImagesCache.get(item.getTitle().getPrefixedText())); return convertView; }
Source:
<code>private static boolean isImagesExists(Iterable<DiskImage> images, Guid storagePoolId, Guid domainId, RefObject<ArrayList<DiskImage>> irsImages) { irsImages.argvalue = new ArrayList<DiskImage>(); boolean returnValue = true; for (DiskImage image : images) { Guid storageDomainId = !Guid.Empty.equals(domainId) ? domainId : image.getstorage_ids().get(0); DiskImage fromIrs = isImageExist(storagePoolId, storageDomainId, image); if (fromIrs == null) { <START> returnValue = false; <END> } else { irsImages.argvalue.add(fromIrs); } } return returnValue; }</code><technical_language>break loop (or list of images is relevant for caller, if return is false?)</technical_language>

Target:
private static boolean isImagesExists(Iterable<DiskImage> images, Guid storagePoolId, Guid domainId, RefObject<ArrayList<DiskImage>> irsImages) { irsImages.argvalue = new ArrayList<DiskImage>(); boolean returnValue = true; for (DiskImage image : images) { Guid storageDomainId = !Guid.Empty.equals(domainId) ? domainId : image.getstorage_ids().get(0); DiskImage fromIrs = isImageExist(storagePoolId, storageDomainId, image); if (fromIrs == null) { returnValue = false; break; } else { irsImages.argvalue.add(fromIrs); } } return returnValue; }
Source:
<code>public void getUrl() { String actual = influxDBContainer.getUrl(); <START> assertThat(actual, startsWith("http://localhost:")); <END> }</code><technical_language>this is true :)</technical_language>

Target:
public void getUrl() { String actual = influxDBContainer.getUrl(); assertThat(actual, notNullValue()); }
Source:
<code>private CompressedIntBufferObjectStrategy(final ByteOrder order, final CompressionStrategy compression, final int sizePer) { super( order, new BufferConverter<IntBuffer>() { @Override public IntBuffer convert(ByteBuffer buf) { return buf.asIntBuffer(); } @Override public int compare(IntBuffer lhs, IntBuffer rhs) { <START> return Ordering.natural().nullsFirst().compare(lhs, rhs); <END> } @Override public int sizeOf(int count) { return count * Ints.BYTES; } @Override public IntBuffer combine(ByteBuffer into, IntBuffer from) { return into.asIntBuffer().put(from); } }, compression, sizePer ); }</code><technical_language>replace a static</technical_language>

Target:
private CompressedIntBufferObjectStrategy(final ByteOrder order, final CompressionStrategy compression, final int sizePer) { super( order, new BufferConverter<IntBuffer>() { @Override public IntBuffer convert(ByteBuffer buf) { return buf.asIntBuffer(); } @Override public int compare(IntBuffer lhs, IntBuffer rhs) { return ORDERING.compare(lhs, rhs); } @Override public int sizeOf(int count) { return count * Ints.BYTES; } @Override public IntBuffer combine(ByteBuffer into, IntBuffer from) { return into.asIntBuffer().put(from); } }, compression, sizePer ); }
Source:
<code>static ConfigSelector.Builder configSelectorBuilder() { return ConfigSelector.builderOfScope("td") .addSecretOnlyAccess("apikey") <START> .addSecretSharedAccess("use_ssl", "proxy.enabled", "proxy.host", "proxy.port", "proxy.user", "proxy.password", "proxy.use_ssl", "endpoint", "host", "port", "user", "database"); <END> }</code><technical_language>proxy.password secret only</technical_language>

Target:
static ConfigSelector.Builder configSelectorBuilder() { return ConfigSelector.builderOfScope("td") .addSecretAccess("use_ssl", "proxy.enabled", "proxy.host", "proxy.port", "proxy.user", "proxy.password", "proxy.use_ssl", "endpoint", "host", "port", "user", "database") .addSecretOnlyAccess("apikey") ; }
Source:
<code>@Override public void printUsage(Logger log) { if (!experimentalEnabled()) return; usage(log, "Print metadata command help:", METADATA, HELP.toString() ); usage(log, "Print list of binary metadata types:", METADATA, LIST.toString() ); usage(log, "Print detailed info about specified binary type " + "(the type must be specified by type name or by type identifier):", METADATA, DETAILS.toString(), optional(MetadataTypeArgs.OPT_TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.OPT_TYPE_NAME, "<typeName>") ); usage(log, "Remove the metadata of the specified type " + "(the type must be specified by type name or by type identifier) from cluster and saves the removed " + "metadata to the specified file. \n" + "If the file name isn't specified the output file name is: '<typeId>.bin'", METADATA, REMOVE.toString(), optional(MetadataTypeArgs.OPT_TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.OPT_TYPE_NAME, "<typeName>"), optional(MetadataRemoveCommand.OPT_OUT_FILE_NAME, "<fileName>") ); usage(log, "Update cluster metadata from specified file (file name is required)", METADATA, UPDATE.toString(), <START> MetadataUpdateCommand.OPT_IN_FILE_NAME, "<fileName>" <END> ); }</code><technical_language>file name is optional, remove OPT_ prefix</technical_language>

Target:
@Override public void printUsage(Logger log) { if (!experimentalEnabled()) return; usage(log, "Print metadata command help:", METADATA, HELP.toString() ); usage(log, "Print list of binary metadata types:", METADATA, LIST.toString() ); usage(log, "Print detailed info about specified binary type " + "(the type must be specified by type name or by type identifier):", METADATA, DETAILS.toString(), optional(MetadataTypeArgs.TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.TYPE_NAME, "<typeName>") ); usage(log, "Remove the metadata of the specified type " + "(the type must be specified by type name or by type identifier) from cluster and saves the removed " + "metadata to the specified file. \n" + "If the file name isn't specified the output file name is: '<typeId>.bin'", METADATA, REMOVE.toString(), optional(MetadataTypeArgs.TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.TYPE_NAME, "<typeName>"), optional(MetadataRemoveCommand.OUT_FILE_NAME, "<fileName>") ); usage(log, "Update cluster metadata from specified file (file name is required)", METADATA, UPDATE.toString(), MetadataUpdateCommand.IN_FILE_NAME, "<fileName>" ); }
Source:
<code>public YieldExpressionTree yieldFromExpression(InternalSyntaxToken yieldToken, InternalSyntaxToken fromToken, ExpressionTree expr) { return "from".equals(fromToken.text()) ? new YieldExpressionTreeImpl(yieldToken, fromToken, expr) <START> : null; <END> }</code><technical_language>@vilchik-elena This method return null</technical_language>

Target:
public YieldExpressionTree yieldFromExpression(InternalSyntaxToken yieldToken, InternalSyntaxToken fromToken, ExpressionTree expr) { return new YieldExpressionTreeImpl(yieldToken, fromToken, expr); }
Source:
<code>private void finishAndShowSignInScreen() { if (!isAdded()) { return; } <START> endProgress(); <END> if (AppPrefs.isLoginWizardStyleActivated()) { if (mLoginListener != null) { mLoginListener.newUserCreatedButErrored(getEmail(), getPassword()); } } else { Intent intent = new Intent(); intent.putExtra("username", getUsername()); intent.putExtra("password", getPassword()); getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, intent); try { getFragmentManager().popBackStack(); } catch (IllegalStateException e) { AppLog.e(T.NUX, e); } } ToastUtils.showToast(getActivity(), R.string.signup_succeed_signin_failed, Duration.LONG); }</code><technical_language>This endProgress is unnecessary called finishAndShowSignInScreen in onAuthenticationChanged. I part of changes, a nice optimization if for it</technical_language>

Target:
private void finishAndShowSignInScreen() { if (!isAdded()) { return; } if (AppPrefs.isLoginWizardStyleActivated()) { if (mLoginListener != null) { mLoginListener.newUserCreatedButErrored(getEmail(), getPassword()); } } else { Intent intent = new Intent(); intent.putExtra("username", getUsername()); intent.putExtra("password", getPassword()); getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, intent); try { getFragmentManager().popBackStack(); } catch (IllegalStateException e) { AppLog.e(T.NUX, e); } } ToastUtils.showToast(getActivity(), R.string.signup_succeed_signin_failed, Duration.LONG); }
Source:
<code>public void listKeySnippets() { KeyClient keyClient = createClient(); for (KeyBase key : keyClient.listKeys()) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys for (KeyBase key : keyClient.listKeys(new Context(key2, value2))) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys#Context keyClient.listKeys().iterableByPage().forEach(resp -> { <START> System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.headers(), <END> resp.request().url(), resp.statusCode()); resp.items().forEach(value -> { Key keyWithMaterial = keyClient.getKey(value); System.out.printf("Received key with name %s and type %s %n", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); }); }); END: com.azure.keyvault.keys.keyclient.listKeys.iterableByPage }</code><technical_language>Is this toString correctly for headers? If want do associations for URL status code show this: URL: %s, Status code: %d</technical_language>

Target:
public void listKeySnippets() { KeyClient keyClient = createClient(); for (KeyBase key : keyClient.listKeys()) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys for (KeyBase key : keyClient.listKeys(new Context(key2, value2))) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys#Context keyClient.listKeys().iterableByPage().forEach(resp -> { System.out.printf("Got response headers . Url: %s, Status code: %d %n", resp.request().url(), resp.statusCode()); resp.items().forEach(value -> { Key keyWithMaterial = keyClient.getKey(value); System.out.printf("Received key with name %s and type %s %n", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); }); }); END: com.azure.keyvault.keys.keyclient.listKeys.iterableByPage }
Source:
<code>public List<Folder> getContentFolders() { <START> return typeGenerateImages <END> ? process.getProject().getFolders().parallelStream() .filter(folder -> folder.getDerivative().isPresent() || folder.getDpi().isPresent() || folder.getImageScale().isPresent() || folder.getImageSize().isPresent()) .collect(Collectors.toList()) : Collections.emptyList(); }</code><technical_language>here, please avoid long streams/filters in return statements</technical_language>

Target:
public List<Folder> getContentFolders() { List<Folder> contentFolders = typeGenerateImages ? process.getProject().getFolders().parallelStream() .filter(folder -> folder.getDerivative().isPresent() || folder.getDpi().isPresent() || folder.getImageScale().isPresent() || folder.getImageSize().isPresent()) .collect(Collectors.toList()) : Collections.emptyList(); return contentFolders; }
Source:
<code>public Text (Composite parent, int style) { super (parent, checkStyle (style)); if ((style & SWT.SEARCH) != 0) { if ((style & SWT.ICON_CANCEL) != 0) { this.style |= SWT.ICON_CANCEL; OS.gtk_entry_set_icon_from_icon_name (handle, <START> OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_CLEAR); <END> OS.gtk_entry_set_icon_sensitive (handle, OS.GTK_ENTRY_ICON_SECONDARY, false); } if ((style & SWT.ICON_SEARCH) != 0) { this.style |= SWT.ICON_SEARCH; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_FIND); } } }</code><technical_language>This correct me. Set primary icon set secondary sensitivity. please explain this change</technical_language>

Target:
public Text (Composite parent, int style) { super (parent, checkStyle (style)); if ((style & SWT.SEARCH) != 0) { if ((style & SWT.ICON_CANCEL) != 0) { this.style |= SWT.ICON_CANCEL; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_SECONDARY, OS.GTK_NAMED_ICON_CLEAR); OS.gtk_entry_set_icon_sensitive (handle, OS.GTK_ENTRY_ICON_SECONDARY, false); } if ((style & SWT.ICON_SEARCH) != 0) { this.style |= SWT.ICON_SEARCH; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_FIND); } } }
Source:
<code>public void testZipFileName() { <START> String path = "github.com-dockstore-hello_world"; <END> String versionName = "master"; Assert.assertEquals("github.com-dockstore-hello_world-master.zip", EntryVersionHelper.generateZipFileName(path, versionName)); }</code><technical_language>"github.com/dockstore/hello_world"</technical_language>

Target:
public void testZipFileName() { String path = "github.com/dockstore/hello_world"; String versionName = "master"; Assert.assertEquals("github.com-dockstore-hello_world-master.zip", EntryVersionHelper.generateZipFileName(path, versionName)); }
Source:
<code>protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { ExchangeNode exchangeNode = (ExchangeNode) node; Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, exchangeNode.getInputs().get(i), exchangeNode.getOutputSymbols()); if (estimate.isPresent()) { <START> estimate = Optional.of(addStatsAndSumDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); <END> } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } verify(estimate.isPresent()); return estimate; }</code><technical_language>I realize heuristics, reason for summing distinct values vs. get partition stats max distinct values</technical_language>

Target:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { ExchangeNode exchangeNode = (ExchangeNode) node; Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, exchangeNode.getInputs().get(i), exchangeNode.getOutputSymbols()); if (estimate.isPresent()) { estimate = Optional.of(addStatsAndMaxDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } verify(estimate.isPresent()); return estimate; }
Source:
<code>public HistoryScanHolder(final View itemView, final String productUrl, Activity activity) { super(itemView); txtTitle = itemView.findViewById(R.id.titleHistory); txtBarcode = itemView.findViewById(R.id.barcodeHistory); txtProductDetails = itemView.findViewById(R.id.productDetailsHistory); imgProduct = itemView.findViewById(R.id.imgHistoryProduct); imgNutritionGrade = itemView.findViewById(R.id.nutritionGradeImage); txtDate = itemView.findViewById(R.id.dateView); mActivity = activity; historyImageProgressbar = itemView.findViewById(R.id.historyImageProgressbar); itemView.setOnClickListener(v -> { ConnectivityManager cm = (ConnectivityManager) v.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); if (isConnected) { OpenFoodAPIClient api = new OpenFoodAPIClient(mActivity); api.getProduct(txtBarcode.getText().toString(), (Activity) v.getContext()); } else { <START> Toast.makeText(mActivity, "Sorry! There was a network error! Please check your internet connection", Toast.LENGTH_SHORT).show(); <END> } }); }</code><technical_language>rephrase "The product loaded. Please try online." popup is highlighting a weakness of app (ie store a copy of history for offline viewing)</technical_language>

Target:
public HistoryScanHolder(final View itemView, final String productUrl, Activity activity) { super(itemView); txtTitle = itemView.findViewById(R.id.titleHistory); txtBarcode = itemView.findViewById(R.id.barcodeHistory); txtProductDetails = itemView.findViewById(R.id.productDetailsHistory); imgProduct = itemView.findViewById(R.id.imgHistoryProduct); imgNutritionGrade = itemView.findViewById(R.id.nutritionGradeImage); txtDate = itemView.findViewById(R.id.dateView); mActivity = activity; historyImageProgressbar = itemView.findViewById(R.id.historyImageProgressbar); itemView.setOnClickListener(v -> { ConnectivityManager cm = (ConnectivityManager) v.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); if (isConnected) { OpenFoodAPIClient api = new OpenFoodAPIClient(mActivity); api.getProduct(txtBarcode.getText().toString(), (Activity) v.getContext()); } else { Toast.makeText(mActivity, R.string.history_network_error, Toast.LENGTH_SHORT).show(); } }); }
Source:
<code>public void setUp() throws Exception { denseThenSparseStrategy = new DenseThenSparseStrategy(); denseThenSparseStrategy.setNetworkParameters(UnitTestParams.get()); BlockStore blockStore = new MemoryBlockStore(UnitTestParams.get()); Wallet wallet = new Wallet(UnitTestParams.get()); blockChain = new BlockChain(UnitTestParams.get(), wallet,blockStore); Block b1 = createFakeBlock(blockStore, Block.BLOCK_HEIGHT_GENESIS).block; blockChain.add(b1); for (int i=blockChain.getBestChainHeight() + 1; i<100; i++) { try { Block b = createFakeBlock(blockStore, i).block; blockChain.add(b); } catch (Exception e) { <START> log.error("fails at i {}", i, e); <END> break; } } }</code><technical_language>unit test params a difficulty interval of 10. Block.createNextBlock() account (yet). If option you, try running test TestNetParams/MainNetParams</technical_language>

Target:
public void setUp() throws Exception { NetworkParameters params = MainNetParams.get(); Context context = new Context(params); URL resource = this.getClass().getResource("/org/bitcoinj/core/first-100k-blocks.dat"); File blockFile = new File(resource.toURI()); loader = new BlockFileLoader(params, Arrays.asList(blockFile)); FullPrunedBlockStore blockStore = new MemoryFullPrunedBlockStore(params, 100); blockChain = new FullPrunedBlockChain(context, blockStore); denseThenSparseStrategy = new DenseThenSparseStrategy(); denseThenSparseStrategy.setNetworkParameters(params); }
Source:
<code>private Response load() throws IOException { <START> if (this.saved.get() == null) { <END> Iterable<String> head; InputStream body; try { head = this.origin.head(); body = this.origin.body(); } catch (final RsForward ex) { head = ex.head(); body = ex.body(); } this.saved.compareAndSet(null, new RsSimple(head, body)); } return this.saved.get(); }</code><technical_language>@essobedo this code is thread-safe</technical_language>

Target:
private Response load() throws IOException { synchronized (this.saved) { if (this.saved.isEmpty()) { Iterable<String> head; InputStream body; try { head = this.origin.head(); body = this.origin.body(); } catch (final RsForward ex) { head = ex.head(); body = ex.body(); } this.saved.add(new RsSimple(head, body)); } } return this.saved.get(0); }
Source:
<code>public void testMarkerColor() { RGBAColor rgbaColor; RGBA rgbaColorToCompare; for (int i = 0; i < TEST_COLORS.length; i++) { TraceMarker traceMarker = new TraceMarker("Marker" + String.valueOf(i), null, fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), TEST_COLORS[i]); rgbaColor = new RGBAColor(Integer.parseInt(X11ColorUtils.toHexColor(TEST_COLORS[i]).substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } TraceMarker traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), ""); rgbaColor = new <START> RGBAColor(Integer.parseInt(X11ColorUtils.toHexColor(DEFAULT_COLOR).substring(1), <END> 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), "invalid"); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), null); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); }</code><technical_language>This is nullable error. put in Objects.requireNonNull if null, is case a unit test, fine. extract a local variable null check, approach is fine</technical_language>

Target:
public void testMarkerColor() { RGBAColor rgbaColor; RGBA rgbaColorToCompare; String[] testColors = X11TestColors.getColors(); for (int i = 0; i < testColors.length; i++) { TraceMarker traceMarker = new TraceMarker("Marker" + String.valueOf(i), null, fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), testColors[i]); String hexColor = X11ColorUtils.toHexColor(testColors[i]); if (hexColor != null) { rgbaColor = new RGBAColor(Integer.parseInt(hexColor.substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } else { fail(X11_COLOR_ERROR_MESSAGE); } } TraceMarker traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), ""); String hexColor = X11ColorUtils.toHexColor(DEFAULT_COLOR); if (hexColor != null) { rgbaColor = new RGBAColor(Integer.parseInt(hexColor.substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), "invalid"); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), null); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } else { fail(X11_COLOR_ERROR_MESSAGE); } }
Source:
<code>public FetchedDataChunk(ByteBufferMessageSet messages, PartitionTopicInfo topicInfo, long fetchOffset) { <START> super(); <END> this.messages = messages; this.topicInfo = topicInfo; this.fetchOffset = fetchOffset; }</code><technical_language>remove</technical_language>

Target:
public FetchedDataChunk(ByteBufferMessageSet messages, PartitionTopicInfo topicInfo, long fetchOffset) { this.messages = messages; this.topicInfo = topicInfo; this.fetchOffset = fetchOffset; }
Source:
<code>public Optional<StudyEntryPropertyData> getStudyEntryPropertyData(final int studyEntryPropertyId) { final StockProperty stockProperty = this.daoFactory.getStockPropertyDao().getById(studyEntryPropertyId); if (stockProperty != null) { <START> final StudyEntryPropertyData studyEntryPropertyData = new StudyEntryPropertyData(); <END> studyEntryPropertyData.setVariableId(stockProperty.getTypeId()); studyEntryPropertyData.setStudyEntryPropertyId(stockProperty.getStockPropId()); studyEntryPropertyData.setValue(stockProperty.getValue()); return Optional.of(studyEntryPropertyData); } return Optional.empty(); }</code><technical_language>constructor variableId, studyEntryPropertyId fields</technical_language>

Target:
public Optional<StudyEntryPropertyData> getStudyEntryPropertyData(final int studyEntryPropertyId) { final StockProperty stockProperty = this.daoFactory.getStockPropertyDao().getById(studyEntryPropertyId); if (stockProperty != null) { return Optional .of(new StudyEntryPropertyData(stockProperty.getStockPropId(), stockProperty.getTypeId(), stockProperty.getValue())); } return Optional.empty(); }
Source:
<code>private int getIndex(int seqNum, boolean updateRoc) { if (highestSeqNumReceived == -1) { if (updateRoc) { highestSeqNumReceived = seqNum; } return seqNum; } int v; if (rolledOverTo(seqNum, highestSeqNumReceived)) { v = roc - 1; } else if (rolledOverTo(highestSeqNumReceived, seqNum)) { v = roc + 1; if (updateRoc) roc = v; } else { v = roc; } if (updateRoc && isNewerThan(seqNum, highestSeqNumReceived)) { highestSeqNumReceived = seqNum; } <START> return 0x8000 * v + seqNum; <END> }</code><technical_language>This work expected if sender 7-bit PictureIDs. I implementations do this, is explicitly allowed in RFC7741: a 7-bit PictureID bits set 1, sender wrap PictureID 0 extend 15 bits continue incrementing. of a detect if happens, log</technical_language>

Target:
private int getIndex(int seqNum, boolean updateRoc) { if (highestSeqNumReceived == -1) { if (updateRoc) { highestSeqNumReceived = seqNum; } return seqNum; } int delta = Vp8Utils.getExtendedPictureIdDelta(seqNum, highestSeqNumReceived); int v; if (delta < 0 && highestSeqNumReceived < seqNum) { v = roc - 1; } else if (delta > 0 && seqNum < highestSeqNumReceived) { v = roc + 1; if (updateRoc) roc = v; } else { v = roc; } if (updateRoc && delta > 0) { highestSeqNumReceived = seqNum; } return 0x8000 * v + seqNum; }
Source:
<code>default boolean collisionExtendsVertically(BlockState state, IBlockReader world, BlockPos pos, Entity collidingEntity) { <START> return false; <END> }</code><technical_language>argue change contains checks tags vanilla did, move remove check original method, override this false if is in fences wall tags. give more flexibility..</technical_language>

Target:
default boolean collisionExtendsVertically(BlockState state, IBlockReader world, BlockPos pos, Entity collidingEntity) { return getBlock().isIn(BlockTags.FENCES) || getBlock().isIn(BlockTags.WALLS) || getBlock() instanceof FenceGateBlock; }