auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static CommonTokenStream getTokenStream(File inputFile) throws IOException, ArgumentParserException { FileInputStream inputStream = new FileInputStream(inputFile); SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); if (!argumentParser.debugFlagSet()) { lexer.removeErrorListeners(); lexer.addErrorListener(new ErrorListener()); } try { return new CommonTokenStream(lexer); } catch (ErrorListener.ParseException e) { <START> return null; <END> } }</code><technical_language>semantically clearer return new CommonTokenStream(lexer); try-catch catch exception in analyzeFiles() returning null checking for that? declare (and initialize) tokenStream try-catch I is clearer. for getParseTree()</technical_language>

Target:
public static CommonTokenStream getTokenStream(File inputFile) throws IOException, ArgumentParserException { FileInputStream inputStream = new FileInputStream(inputFile); SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); if (!argumentParser.debugFlagSet()) { lexer.removeErrorListeners(); lexer.addErrorListener(new ErrorListener()); } return new CommonTokenStream(lexer); }
Source:
<code>public ConfigureLocalStorageModel() { setStorage(new LocalStorageModel()); setDataCenter(new DataCenterModel()); getDataCenter().getVersion().getSelectedItemChangedEvent().addListener(this); setCluster(new ClusterModel()); getCluster().init(false); setFormattedStorageName(new EntityModel()); Frontend.getInstance().getQueryStartedEvent().addListener(this); Frontend.getInstance().getQueryCompleteEvent().addListener(this); Frontend.getInstance().subscribe(new VdcQueryType[] { VdcQueryType.Search, VdcQueryType.GetVdsGroupsByStoragePoolId, VdcQueryType.GetAllVdsGroups, VdcQueryType.GetVdsGroupById, VdcQueryType.GetStoragePoolById, }); for (Boolean bool : getDataCenter().getStoragePoolType().getItems()) { <START> if (bool == Boolean.TRUE) { <END> getDataCenter().getStoragePoolType().setSelectedItem(bool); break; } } setIsGeneralTabValid(true); }</code><technical_language>Boolean is (unfortunately) Enum - is guarantee instances of Boolean.TRUE object - if(bool.booleanValue()). If bool null, Boolean.TRUE.equals(bool)</technical_language>

Target:
public ConfigureLocalStorageModel() { setStorage(new LocalStorageModel()); setDataCenter(new DataCenterModel()); getDataCenter().getVersion().getSelectedItemChangedEvent().addListener(this); setCluster(new ClusterModel()); getCluster().init(false); setFormattedStorageName(new EntityModel()); Frontend.getInstance().getQueryStartedEvent().addListener(this); Frontend.getInstance().getQueryCompleteEvent().addListener(this); Frontend.getInstance().subscribe(new VdcQueryType[] { VdcQueryType.Search, VdcQueryType.GetVdsGroupsByStoragePoolId, VdcQueryType.GetAllVdsGroups, VdcQueryType.GetVdsGroupById, VdcQueryType.GetStoragePoolById, }); for (Boolean bool : getDataCenter().getStoragePoolType().getItems()) { if (bool) { getDataCenter().getStoragePoolType().setSelectedItem(bool); break; } } setIsGeneralTabValid(true); }
Source:
<code>protected AuthType getMinAuthLevel() { <START> return AuthType.PUBLIC; <END> }</code><technical_language>suggestion return AuthType.LOGGED_IN;</technical_language>

Target:
protected AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; }
Source:
<code>public boolean isOnline() { <START> if (status == Type.AVAILABLE || status == Type.AWAY) return true; <END> return false; }</code><technical_language>return status == Type.AVAILABLE || status == Type.AWAY</technical_language>

Target:
public boolean isOnline() { return status == Type.AVAILABLE || status == Type.AWAY; }
Source:
<code>public ElasticSearchAdapter() { if (client != null) { return; } if (!isSearchEndpointConfigured()) { LOGGER.info("no valid elasticsearch endpoint configured."); return; } try { int portSeparator = endpoint.lastIndexOf(':'); String host = endpoint.substring(0, portSeparator); int port = Integer.parseInt(endpoint.substring(portSeparator + 1), 10); client = new PreBuiltTransportClient(Settings.builder() <START> .put("cluster.name", "elasticsearch").build()) <END> .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port)); } catch (UnknownHostException e) { LOGGER.warn("No elasticsearch cluster running."); } }</code><technical_language>is this clustername for? Is relevant this configurable? a bit generic, "scenarioo-elasticsearch" implications of this</technical_language>

Target:
public ElasticSearchAdapter() { if (client != null) { return; } if (!isSearchEndpointConfigured()) { LOGGER.info("no valid elasticsearch endpoint configured."); return; } try { int portSeparator = endpoint.lastIndexOf(':'); String host = endpoint.substring(0, portSeparator); int port = Integer.parseInt(endpoint.substring(portSeparator + 1), 10); client = new PreBuiltTransportClient(Settings.builder() .put("cluster.name", clusterName).build()) .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port)); } catch (UnknownHostException e) { LOGGER.warn("No elasticsearch cluster running."); } catch (Throwable e) { LOGGER.error("Could not connect to Elastic Search Engine", e); } }
Source:
<code><START> private List<SubDirectiveValueToken> splitByWSP(@Nonnull Token token) { <END> List<SubDirectiveValueToken> tokens = new ArrayList<>(); @Nullable Location startLocation = token.startLocation; if (startLocation == null) { for (String s : WSP.split(token.value)) { tokens.add(new SubDirectiveValueToken(s)); } } else { Matcher m = NotWSP.matcher(token.value); int offset = 0; while (m.find(offset)) { SubDirectiveValueToken dv = new SubDirectiveValueToken(token.value.substring(m.start(), m.end())); dv.startLocation = new Location(startLocation.line, startLocation.column + m.start(), startLocation.offset + m.start()); dv.endLocation = new Location(startLocation.line, startLocation.column + m.end(), startLocation.offset + m.end()); offset = m.end(); tokens.add(dv); } } return tokens; }</code><technical_language>Move this method next other helpers</technical_language>

Target:
private static List<SubDirectiveValueToken> splitByWSP(@Nonnull Token token) { List<SubDirectiveValueToken> tokens = new ArrayList<>(); @Nullable Location startLocation = token.startLocation; if (startLocation == null) { for (String s : WSP.split(trimRHSWS(token.value))) { tokens.add(new SubDirectiveValueToken(s)); } } else { Matcher m = NotWSP.matcher(token.value); int offset = 0; while (m.find(offset)) { SubDirectiveValueToken dv = new SubDirectiveValueToken(token.value.substring(m.start(), m.end())); dv.startLocation = new Location(startLocation.line, startLocation.column + m.start(), startLocation.offset + m.start()); dv.endLocation = new Location(startLocation.line, startLocation.column + m.end(), startLocation.offset + m.end()); offset = m.end(); tokens.add(dv); } } return tokens; }
Source:
<code>public void onLocationChanged(Location location) { if (location == null) { return; } if (mMapActivity != null) { mMapActivity.get().setUserPositionAt(location); ClientPrefs.getInstance().setSimulationLat((float) location.getLatitude()); <START> ClientPrefs.getInstance().setSimulationLon((float) location.getLongitude()); <END> } }</code><technical_language>Do do this location? this seed time? Writing prefs heavily is I avoid. Is a Build.Debug flag wrap this code in</technical_language>

Target:
public void onLocationChanged(Location location) { if (location == null) { return; } if (mMapActivity != null) { mMapActivity.get().setUserPositionAt(location); ClientPrefs cPrefs = ClientPrefs.getInstance(); if (cPrefs.isDefaultSimulationLatLon()) { cPrefs.setSimulationLat((float) location.getLatitude()); cPrefs.setSimulationLon((float) location.getLongitude()); cPrefs.wroteSimulationLatLon(); } } }
Source:
<code>private static int contextTypes(IConfigurationElement cfgEl) { IConfigurationElement[] contextElements = cfgEl.getChildren(ELEM_CONTEXT); if (contextElements.length == 0) { return BUILD; } <START> int context = 0; <END> for (IConfigurationElement contextElement : contextElements) { String contextType = contextElement.getAttribute(ATTR_TYPE); context = context | ErrorParserContext.getValue(contextType); } return context; }</code><technical_language>Please this plural too: context -> contexts</technical_language>

Target:
private static int contextTypes(IConfigurationElement cfgEl) { IConfigurationElement[] contextElements = cfgEl.getChildren(ELEM_CONTEXT); if (contextElements.length == 0) { return BUILD; } int contexts = 0; for (IConfigurationElement contextElement : contextElements) { String contextType = contextElement.getAttribute(ATTR_TYPE); contexts = contexts | ErrorParserContext.getValue(contextType); } return contexts; }
Source:
<code>private void runWithRetries(Runnable block, SimpleResponseObserver responseObserver) throws IOException { for (int attemptedRetries = 0; ; attemptedRetries++) { block.run(); if (responseObserver.hasError()) { <START> if (attemptedRetries >= UPLOAD_RETRIES) { <END> throw new IOException( String.format("Failed to start resumable upload for '%s'", resourceId), responseObserver.getError()); } continue; } else { break; } } }</code><technical_language>Move this condition in for loop throw exception loop, return method if errors: java private void runWithRetries(Runnable block, SimpleResponseObserver responseObserver) throws IOException { for (int attemptedRetries = 0; attemptedRetries < UPLOAD_RETRIES; attemptedRetries++) { block.run(); if (!responseObserver.hasError()) { return; } } throw new IOException( String.format("Failed start resumable upload for '%s'", resourceId), responseObserver.getError()); }</technical_language>

Target:
private void runWithRetries(Runnable block, SimpleResponseObserver responseObserver) throws IOException { for (int attemptedRetries = 0; attemptedRetries < UPLOAD_RETRIES; attemptedRetries++) { block.run(); if (!responseObserver.hasError()) { return; } } throw new IOException( String.format("Failed to start resumable upload for '%s'", resourceId), responseObserver.getError()); }
Source:
<code><START> public <R> Streamlet<R> newSource(IRichSpout spout) { <END> StreamletImpl<R> retval = StreamletImpl.createSpoutStreamlet(spout); retval.setNumPartitions(1); sources.add(retval); return retval; }</code><technical_language>Thanks @nwangtw for working this PR. null check useful for spout parameter due public API StreamletUtils.require(spout != null, "spout null.");</technical_language>

Target:
public <R> Streamlet<R> newSource(IRichSpout spout) { StreamletUtils.require(spout != null, "spout must not be null."); StreamletImpl<R> retval = StreamletImpl.createSpoutStreamlet(spout); sources.add(retval); return retval; }
Source:
<code>public Optional<IndexedEmbeddedBindingContext> addIndexedEmbeddedIfIncluded( MappableTypeModel parentTypeModel, boolean multiValued, String relativePrefix, ObjectFieldStorage storage, Integer maxDepth, Set<String> includePaths) { return nestingContext.addIndexedEmbeddedIfIncluded( parentTypeModel, relativePrefix, maxDepth, includePaths, new NestedContextBuilderImpl( indexSchemaRootNodeBuilder, indexSchemaObjectNodeBuilder, storage, <START> isMultiValuedFromParentNotPropagated() || multiValued <END> ) ); }</code><technical_language>This is a personal doubt, I topic here. If field is declared multi-valued, threated isMultiValuedFromParentNotPropagated</technical_language>

Target:
public Optional<IndexedEmbeddedBindingContext> addIndexedEmbeddedIfIncluded( MappableTypeModel parentTypeModel, boolean multiValued, String relativePrefix, ObjectFieldStorage storage, Integer maxDepth, Set<String> includePaths) { return nestingContext.addIndexedEmbeddedIfIncluded( parentTypeModel, relativePrefix, maxDepth, includePaths, new NestedContextBuilderImpl( indexSchemaRootNodeBuilder, indexSchemaObjectNodeBuilder, storage, isParentMultivaluedAndWithoutObjectField() || multiValued ) ); }
Source:
<code>public void testMessageWithEmptyArray() throws Exception { Foo foo = Foo.newBuilder().setInt32(5).setBool(true).build(); ByteArrayOutputStream bao = new ByteArrayOutputStream(); ProtobufDatumWriter<Foo> w = new ProtobufDatumWriter<>(Foo.class); Encoder e = EncoderFactory.get().binaryEncoder(bao, null); w.write(foo, e); e.flush(); Object o = new ProtobufDatumReader<>(Foo.class).read(null, DecoderFactory.get().binaryDecoder(new ByteArrayInputStream(bao.toByteArray()), null)); <START> assertEquals(foo, o); <END> }</code><technical_language>This test fails, 'foo' unset fields, while in 'o' set default value. Avro's protobuf support preserve set/unset status of fields</technical_language>

Target:
public void testMessageWithEmptyArray() throws Exception { Foo foo = Foo.newBuilder().setInt32(5).setBool(true).build(); ByteArrayOutputStream bao = new ByteArrayOutputStream(); ProtobufDatumWriter<Foo> w = new ProtobufDatumWriter<>(Foo.class); Encoder e = EncoderFactory.get().binaryEncoder(bao, null); w.write(foo, e); e.flush(); Foo o = new ProtobufDatumReader<>(Foo.class).read(null, DecoderFactory.get().binaryDecoder(new ByteArrayInputStream(bao.toByteArray()), null)); assertEquals(foo.getInt32(), o.getInt32()); assertEquals(foo.getBool(), o.getBool()); assertEquals(0, o.getFooArrayCount()); }
Source:
<code>final static public < A extends LongAccess > ArrayImg< Unsigned12BitType, A > unsigned12Bits( final A access, final long... dim ) { <START> final ArrayImg< Unsigned12BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 1, 64 ) ); <END> final Unsigned12BitType t = new Unsigned12BitType( img ); img.setLinkedType( t ); return img; }</code><technical_language>this new Fraction( t.getBitsPerPixel(), 64 ) instead of new Fraction( 1, 64 ) here</technical_language>

Target:
final static public < A extends LongAccess > ArrayImg< Unsigned12BitType, A > unsigned12Bits( final A access, final long... dim ) { final ArrayImg< Unsigned12BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 12, 64 ) ); final Unsigned12BitType t = new Unsigned12BitType( img ); img.setLinkedType( t ); return img; }
Source:
<code>public void deserializeRawResource() throws Exception { RawResource resource = new RawResource("ID", "FOO", "FEED", "BAR", null, Collections.singletonList( new Metric("metric", "m.metric", MetricUnit.BYTES, "sum($metric)", new HashMap<>(), new HashMap<>())), Collections.singletonMap("r.prop", "r.val1"), Collections.singletonMap("r.cfg", "r.val2")); String jsonResource = objectMapper.writeValueAsString(resource); RawResource deserialized = objectMapper.readValue(jsonResource, RawResource.class); assertThat(deserialized).isNotNull(); assertThat(deserialized.getId()).isEqualTo("ID"); assertThat(deserialized.getMetrics()).extracting(Metric::getDisplayName).containsExactly("metric"); <START> assertThat(deserialized.getMetrics()).extracting(Metric::getExpression).containsExactly("sum($metric)"); <END> assertThat(deserialized.getProperties()).containsOnly(entry("r.prop", "r.val1")); assertThat(deserialized.getConfig()).containsOnly(entry("r.cfg", "r.val2")); }</code><technical_language>I $metric is a thing, expression resolved</technical_language>

Target:
public void deserializeRawResource() throws Exception { RawResource resource = new RawResource("ID", "FOO", "FEED", "BAR", null, Collections.singletonList( new Metric("metric", "m.metric", MetricUnit.BYTES, "sum(m.metric)", new HashMap<>(), new HashMap<>())), Collections.singletonMap("r.prop", "r.val1"), Collections.singletonMap("r.cfg", "r.val2")); String jsonResource = objectMapper.writeValueAsString(resource); RawResource deserialized = objectMapper.readValue(jsonResource, RawResource.class); assertThat(deserialized).isNotNull(); assertThat(deserialized.getId()).isEqualTo("ID"); assertThat(deserialized.getMetrics()).extracting(Metric::getDisplayName).containsExactly("metric"); assertThat(deserialized.getMetrics()).extracting(Metric::getExpression).containsExactly("sum(m.metric)"); assertThat(deserialized.getProperties()).containsOnly(entry("r.prop", "r.val1")); assertThat(deserialized.getConfig()).containsOnly(entry("r.cfg", "r.val2")); }
Source:
<code>public boolean existIndexByColumns(String databaseName, String tableName, String[] columnNames) throws CatalogException { Connection conn = null; ResultSet res = null; PreparedStatement pstmt = null; boolean exist = false; try { int databaseId = getDatabaseId(databaseName); int tableId = getTableId(databaseId, databaseName, tableName); Schema relationSchema = new Schema(getTable(databaseName, tableName).getSchema()); String sql = "SELECT " + COL_INDEXES_PK + " FROM " + TB_INDEXES + " WHERE " + COL_DATABASES_PK + "=? AND " + COL_TABLES_PK + "=? AND COLUMN_NAMES=?"; if (LOG.isDebugEnabled()) { LOG.debug(sql); } <START> String FQUnifiedColumnName = CatalogUtil.buildFQName(databaseName, tableName, <END> CatalogUtil.getUnifiedSimpleColumnName(new Schema(relationSchema), columnNames)); conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setInt(2, tableId); pstmt.setString(3, FQUnifiedColumnName); res = pstmt.executeQuery(); exist = res.next(); } catch (SQLException se) { throw new CatalogException(se); } finally { CatalogUtil.closeQuietly(pstmt, res); } return exist; }</code><technical_language>check naming convention</technical_language>

Target:
public boolean existIndexByColumns(String databaseName, String tableName, String[] columnNames) throws CatalogException { Connection conn = null; ResultSet res = null; PreparedStatement pstmt = null; boolean exist = false; try { int databaseId = getDatabaseId(databaseName); int tableId = getTableId(databaseId, databaseName, tableName); Schema relationSchema = new Schema(getTable(databaseName, tableName).getSchema()); String sql = "SELECT " + COL_INDEXES_PK + " FROM " + TB_INDEXES + " WHERE " + COL_DATABASES_PK + "=? AND " + COL_TABLES_PK + "=? AND COLUMN_NAMES=?"; if (LOG.isDebugEnabled()) { LOG.debug(sql); } String unifiedName = CatalogUtil.buildFQName(databaseName, tableName, CatalogUtil.getUnifiedSimpleColumnName(new Schema(relationSchema), columnNames)); conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setInt(2, tableId); pstmt.setString(3, unifiedName); res = pstmt.executeQuery(); exist = res.next(); } catch (SQLException se) { throw new CatalogException(se); } finally { CatalogUtil.closeQuietly(pstmt, res); } return exist; }
Source:
<code>public Map<Integer, Integer> getStudyIdEnvironmentDatasetIdMap(final List<Integer> studyIds) { try { final Map<Integer, Integer> studyIdEnvironmentDatasetIdMap = new HashMap<>(); final String sqlString = "SELECT study_id AS studyId, project_id AS projectId FROM project " + " where dataset_type_id = " + DatasetTypeEnum.SUMMARY_DATA.getId() + " AND study_id IN (:studyIds)"; final SQLQuery sqlQuery = this.getSession().createSQLQuery(sqlString); sqlQuery.addScalar("studyId", new IntegerType()); sqlQuery.addScalar("projectId", new IntegerType()); sqlQuery.setParameterList("studyIds", studyIds); sqlQuery.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE); final List<Map<String, Object>> results = sqlQuery.list(); for (final Map<String, Object> result : results) { studyIdEnvironmentDatasetIdMap.put((Integer) result.get("studyId"), (Integer) result.get("projectId")); } return studyIdEnvironmentDatasetIdMap; } catch (final HibernateException e) { <START> throw new MiddlewareQueryException("Error getting getObservationLevelsMap for studyIds=" + studyIds + ":" + e.getMessage(), e); <END> } }</code><technical_language>be: "Error **getStudyIdEnvironmentDatasetIdMap** .."</technical_language>

Target:
public Map<Integer, Integer> getStudyIdEnvironmentDatasetIdMap(final List<Integer> studyIds) { try { final Map<Integer, Integer> studyIdEnvironmentDatasetIdMap = new HashMap<>(); final String sqlString = "SELECT study_id AS studyId, project_id AS projectId FROM project " + " where dataset_type_id = " + DatasetTypeEnum.SUMMARY_DATA.getId() + " AND study_id IN (:studyIds)"; final SQLQuery sqlQuery = this.getSession().createSQLQuery(sqlString); sqlQuery.addScalar("studyId", new IntegerType()); sqlQuery.addScalar("projectId", new IntegerType()); sqlQuery.setParameterList("studyIds", studyIds); sqlQuery.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE); final List<Map<String, Object>> results = sqlQuery.list(); for (final Map<String, Object> result : results) { studyIdEnvironmentDatasetIdMap.put((Integer) result.get("studyId"), (Integer) result.get("projectId")); } return studyIdEnvironmentDatasetIdMap; } catch (final HibernateException e) { throw new MiddlewareQueryException("Error getting getStudyIdEnvironmentDatasetIdMap for studyIds=" + studyIds + ":" + e.getMessage(), e); } }
Source:
<code>private ShardOrganizationManager createShardOrganizationManager(long intervalMillis) { <START> StorageManagerConfig config = new StorageManagerConfig(); <END> return new ShardOrganizationManager(dbi, "node1", createShardManager(dbi), createShardOrganizer(), new TemporalFunctionFactory(config), true, new Duration(intervalMillis, MILLISECONDS)); }</code><technical_language>This is once, need for a variable</technical_language>

Target:
private ShardOrganizationManager createShardOrganizationManager(long intervalMillis) { return new ShardOrganizationManager(dbi, "node1", createShardManager(dbi), createShardOrganizer(), TEMPORAL_FUNCTION, true, new Duration(intervalMillis, MILLISECONDS)); }
Source:
<code>public void visitSwitchStatement(SwitchStatementTree tree) { Set<Tree> caseExpressions = new HashSet<>(); for (CaseClauseTree caseClause : Iterables.filter(tree.cases(), CaseClauseTree.class)) { addCaseExpression(caseExpressions, caseClause.expression()); } ControlFlowGraph cfg = getControlFlowGraph(tree); SwitchClauseTree previousClauseWithStatement = null; for (SwitchClauseTree switchClause : tree.cases()) { if (previousClauseWithStatement != null <START> && (canBeFallenInto(switchClause, cfg, caseExpressions) || !hasNonEmptyStatement(previousClauseWithStatement))) { <END> addIssue(previousClauseWithStatement, MESSAGE); } if (!switchClause.statements().isEmpty()) { previousClauseWithStatement = switchClause; } } super.visitSwitchStatement(tree); }</code><technical_language>@pynicolas this double negation is confusing. remove it</technical_language>

Target:
public void visitSwitchStatement(SwitchStatementTree tree) { Set<Tree> caseExpressions = new HashSet<>(); for (CaseClauseTree caseClause : Iterables.filter(tree.cases(), CaseClauseTree.class)) { addCaseExpression(caseExpressions, caseClause.expression()); } ControlFlowGraph cfg = getControlFlowGraph(tree); SwitchClauseTree previousClauseWithStatement = null; for (SwitchClauseTree switchClause : tree.cases()) { if (previousClauseWithStatement != null && (canBeFallenInto(switchClause, cfg, caseExpressions) || hasOnlyEmptyStatements(previousClauseWithStatement))) { addIssue(previousClauseWithStatement.keyword(), MESSAGE); } if (!switchClause.statements().isEmpty()) { previousClauseWithStatement = switchClause; } } super.visitSwitchStatement(tree); }
Source:
<code>public ValueAndTimestamp<V> priorValueForBuffered(final K key) { final Bytes serializedKey = Bytes.wrap(keySerde.serializer().serialize(changelogTopic, key)); final BufferKey bufferKey = index.get(serializedKey); if (bufferKey == null) { throw new NoSuchElementException("Key [" + key + "] is not in the buffer."); } else { final BufferValue bufferValue = sortedMap.get(bufferKey); final byte[] bytes = bufferValue.priorValue(); final V deserialize = valueSerde.innerSerde().deserializer().deserialize(changelogTopic + "-prior", bytes); <START> return ValueAndTimestamp.make(deserialize, RecordQueue.UNKNOWN); <END> } }</code><technical_language>Hm. important is get this timestamp right? necessary store timestamp in addition value..</technical_language>

Target:
public Maybe<ValueAndTimestamp<V>> priorValueForBuffered(final K key) { final Bytes serializedKey = Bytes.wrap(keySerde.serializer().serialize(changelogTopic, key)); if (index.containsKey(serializedKey)) { final byte[] serializedValue = internalPriorValueForBuffered(serializedKey); final V deserializedValue = valueSerde.innerSerde().deserializer().deserialize( changelogTopic, serializedValue ); return Maybe.defined(ValueAndTimestamp.make(deserializedValue, RecordQueue.UNKNOWN)); } else { return Maybe.undefined(); } }
Source:
<code><START> public boolean visit(CssRule x, Context ctx) { <END> List<CssProperty> properties = x.getProperties(); for (CssProperty cssProperty : properties) { if (propertyNamesToSkip.contains(cssProperty.getName())) { continue; } String cssPropertyString = cssProperty.getValues().toCss(); Matcher matcher = pattern.matcher(cssPropertyString); boolean needsUpdate = false; while (matcher.find()) { String upperCaseString = matcher.group(); if (!gssContantNames.contains(upperCaseString)) { System.err.println("[WARN] '" + cssProperty.getName() + "' from rule '" + x.getSelectors().toString() + "' since it uses an undefined constant: " + upperCaseString); if (lenient) { System.err.println( "[WARN] turning to lower case. This is probably not what you wanted here in the first place!"); cssPropertyString = cssPropertyString.replace(upperCaseString, upperCaseString.toLowerCase()); needsUpdate = true; } break; } } if (needsUpdate) { needsUpdate = false; cssProperty.setValue(new SimpleValue(cssPropertyString)); } } return false; }</code><technical_language>visit Cssproperty ? public boolean visit(CssProperty x, Context ctx)</technical_language>

Target:
public boolean visit(CssRule x, Context ctx) { List<CssProperty> properties = x.getProperties(); for (CssProperty cssProperty : properties) { if (propertyNamesToSkip.contains(cssProperty.getName())) { continue; } String cssPropertyString = cssProperty.getValues().toCss(); Matcher matcher = pattern.matcher(cssPropertyString); boolean needsUpdate = false; while (matcher.find()) { String upperCaseString = matcher.group(); if (!gssContantNames.contains(upperCaseString)) { System.err.println("[WARN] '" + cssProperty.getName() + "' from rule '" + x.getSelectors().toString() + "' since it uses an undefined constant: " + upperCaseString); if (lenient) { System.err.println( "[WARN] turning to lower case. This is probably not what you wanted here in the first place!"); cssPropertyString = cssPropertyString.replace(upperCaseString, upperCaseString.toLowerCase()); needsUpdate = true; } else { throw new Css2GssConversionException("Found undefined constant in input. " + cssProperty.getName() + "' from rule '" + x.getSelectors().toString() + "' undefined constant: " + upperCaseString); } break; } } if (needsUpdate) { needsUpdate = false; cssProperty.setValue(new SimpleValue(cssPropertyString)); } } return false; }
Source:
<code>public boolean onCommand(CommandPerformEvent event) { StringBuilder b = new StringBuilder(); for (int i = 1; i < event.getArgs().length; i++) { if (i != 1) b.append(" "); b.append(event.getArgs()[i]); <START> } <END> Nexus.getInstance().sendMessage(event.getArgs()[0], b.toString()); return true; }</code><technical_language>com.dsh105.nexus.util.StringUtil#combineSplit(int startIndex, String[] string, String separator)</technical_language>

Target:
public boolean onCommand(CommandPerformEvent event) { if (event.getArgs().length < 2){ return false; }else{ String message = StringUtil.combineSplit(1, event.getArgs(), " "); Nexus.getInstance().sendMessage(event.getArgs()[0], message); return true; } }
Source:
<code>private boolean isScheduled() { long lastStatsUpdateTime = asyncIndexesSizeStatsUpdate.getLastStatsUpdateTime(indexPath); long defaultStatsUpdateTime = asyncIndexesSizeStatsUpdate.getScheduleTimeInMillis(); <START> return (System.currentTimeMillis() > lastStatsUpdateTime + defaultStatsUpdateTime); <END> }</code><technical_language>Brackets needed</technical_language>

Target:
private boolean isScheduled() { long lastStatsUpdateTime = asyncIndexesSizeStatsUpdate.getLastStatsUpdateTime(indexPath); long defaultStatsUpdateTime = asyncIndexesSizeStatsUpdate.getScheduleTimeInMillis(); return System.currentTimeMillis() > lastStatsUpdateTime + defaultStatsUpdateTime; }
Source:
<code>public org.codice.solr.client.solrj.SolrClient newClient(String core) { checkConfig(); LOGGER.debug( "Solr({}): Creating a Solr Cloud client using Zookeeper hosts [{}]", core, zookeeperHosts); SolrClientAdapter adaptor = new SolrClientAdapter(core, () -> createSolrCloudClient(zookeeperHosts, core)); try { if (!adaptor.isAvailable(30, 5, TimeUnit.SECONDS)) { LOGGER.warn("Solr Client is not available after 30 seconds", core); } } catch (InterruptedException e) { <START> LOGGER.error("Unable to connect to solr client {}: ", core, e.getStackTrace()); <END> } return adaptor; }</code><technical_language>Improper handle interruptions. need propagated re-interrupting current thread</technical_language>

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String core) { checkConfig(); LOGGER.debug( "Solr({}): Creating a Solr Cloud client using Zookeeper hosts [{}]", core, zookeeperHosts); SolrClientAdapter adaptor = new SolrClientAdapter(core, () -> createSolrCloudClient(zookeeperHosts, core)); try { if (!adaptor.isAvailable(30, 5, TimeUnit.SECONDS)) { LOGGER.warn("Solr Client is not available after 30 seconds", core); } } catch (InterruptedException e) { LOGGER.error("Unable to connect to solr client {}: ", core, e.getStackTrace()); Thread.currentThread().interrupt(); } return adaptor; }
Source:
<code>private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType) || sameType(nestedType, fInitializers[fIndex].getType())) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } <START> if (!(initializer.isConstantExpression()) && cost.isNarrowingConversion()) { <END> return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }</code><technical_language>constexpr values, do literals (if check for EvalFixed)? identifier naming a constexpr variable (check for EvalBinding EvalMemberAccess)</technical_language>

Target:
private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (initFromStringLiteral(nestedType, fInitializers[fIndex])) { Cost cost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.CONVERSION); fIndex++; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType)) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } if (!(initializer.isConstantExpression()) && cost.isNarrowingConversion()) { return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }
Source:
<code>public MesosClientBuilder<Send, Receive> onBackpressureBuffer( ) { this.byteStreamTransformer = observable -> observable.onBackpressureBuffer(); <START> return this; <END> }</code><technical_language>Style: remove blank line pull close paren curly brace line 180</technical_language>

Target:
public MesosClientBuilder<Send, Receive> onBackpressureBuffer( ) { this.backpressureTransformer = observable -> observable.onBackpressureBuffer(); return this; }
Source:
<code>private void stageSchemaFiles(Configuration config){ if (config.m_userSchema == null){ return; } assert( config.m_userSchema.isFile() ); <START> File stagedCatalog = new VoltFile(getStagedCatalogPath()); <END> if (!config.m_forceVoltdbCreate && stagedCatalog.exists() && stagedCatalog.canRead()){ VoltDB.crashLocalVoltDB("Staged catalog from \"init\" or a previous database is present, but \"voltdb init --force\" was not specified."); } final boolean standalone = true; final boolean isXCDR = false; VoltCompiler compiler = new VoltCompiler(standalone, isXCDR); if (!compiler.compileFromDDL(stagedCatalog.getAbsolutePath(), config.m_userSchema.getAbsolutePath())){ VoltDB.crashLocalVoltDB("Could not compile specified schema " + config.m_userSchema, false, null); } }</code><technical_language>is change dont change variable names unnecessarily. diff big</technical_language>

Target:
private void stageSchemaFiles(Configuration config) { if (config.m_userSchema == null) { return; } assert( config.m_userSchema.isFile() ); File stagedCatalogFH = new VoltFile(getStagedCatalogPath(getVoltDBRootPath())); if (!config.m_forceVoltdbCreate && stagedCatalogFH.exists()) { VoltDB.crashLocalVoltDB("A previous database was initialized with a schema. You must init with --force to overwrite the schema."); } final boolean standalone = true; final boolean isXCDR = false; final boolean generateReports = false; VoltCompiler compiler = new VoltCompiler(standalone, isXCDR, generateReports); if (!compiler.compileFromDDL(stagedCatalogFH.getAbsolutePath(), config.m_userSchema.getAbsolutePath())) { VoltDB.crashLocalVoltDB("Could not compile specified schema " + config.m_userSchema); } }
Source:
<code>public void impl(@Nonnull CorfuRuntime runtime) throws Exception { runtime.invalidateLayout(); Layout layout = runtime.getLayoutView().getLayout(); PrefixTrimRedundancyCalculator redundancyCalculator = new PrefixTrimRedundancyCalculator(currentNode, runtime); StateTransferManager transferManager = new StateTransferManager(streamLog, runtime.getParameters().getBulkReadSize()); LogUnitClientMap map = (CorfuRuntime rt) -> { Layout currentLayout = rt.getLayoutView().getLayout(); Set<String> allActiveServers = currentLayout.getAllActiveServers(); return allActiveServers.stream() .map(server -> { RuntimeLayout runtimeLayout = rt.getLayoutView().getRuntimeLayout(); return new Tuple<>(server, runtimeLayout.getLogUnitClient(server)); }) .collect(Collectors.toMap(tuple -> tuple.first, tuple -> tuple.second)); }; ImmutableList<TransferSegment> stateList = redundancyCalculator.createStateList(layout); log.info("State transfer on {}: Initial state list: {}", currentNode, stateList); <START> while (RedundancyCalculator.requiresRedundancyRestoration(layout, currentNode) || <END> RedundancyCalculator.requiresMerge(layout, currentNode)) { ProtocolBatchProcessor batchProcessor = ProtocolBatchProcessor .builder() .addressSpaceView(runtime.getAddressSpaceView()) .streamLog(streamLog) .build(); stateList = transferManager.handleTransfer(stateList, batchProcessor); RestoreStatus restoreStatus = restoreWithBackOff(stateList, runtime); if (restoreStatus == RESTORED) { log.info("State transfer on {}: Updating status map.", currentNode); layout = runtime.invalidateLayout().join(); ImmutableList<TransferSegment> newLayoutStateList = redundancyCalculator.createStateList(layout); stateList = redundancyCalculator.mergeLists(stateList, newLayoutStateList); } } log.info("State transfer on {}: Restored.", currentNode); }</code><technical_language>provide additional method in RedundancyCalculator check conditions. RedundancyCalculator.needsRestorationOrMerge</technical_language>

Target:
public void impl(@Nonnull CorfuRuntime runtime) throws Exception { runtime.invalidateLayout(); Layout layout = runtime.getLayoutView().getLayout(); LogUnitClient logUnitClient = runtime.getLayoutView().getRuntimeLayout(layout).getLogUnitClient(currentNode); ProtocolBatchProcessor batchProcessor = ProtocolBatchProcessor .builder() .addressSpaceView(runtime.getAddressSpaceView()) .logUnitClient(logUnitClient) .build(); StateTransferManager transferManager = StateTransferManager .builder() .logUnitClient(logUnitClient) .batchSize(runtime.getParameters().getBulkReadSize()) .batchProcessor(batchProcessor) .build(); while (RedundancyCalculator.canRestoreRedundancyOrMergeSegments(layout, currentNode)) { layout = restoreWithBackOff(runtime, transferManager); } log.info("State transfer on {}: Restored.", currentNode); }
Source:
<code><START> public static <END> Color getSystemForegroundColor() { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); Color foreground = colorRegistry.get(JFacePreferences.INFORMATION_FOREGROUND_COLOR); if (foreground == null) { return JFaceColors.getInformationViewerForegroundColor(Display.getDefault()); } return foreground; }</code><technical_language>need this public</technical_language>

Target:
private static Color getSystemForegroundColor() { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); Color foreground = colorRegistry.get(JFacePreferences.INFORMATION_FOREGROUND_COLOR); if (foreground == null) { return JFaceColors.getInformationViewerForegroundColor(Display.getDefault()); } return foreground; }
Source:
<code>public Map<String, Object> calculateInputVariables(DelegateExecution execution) { <START> ActivitExpressionParser parser = new ActivitExpressionParser(execution); <END> ProcessExtensionModel extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = parser.resolveExpressionsMap(calculateConstants(execution, extensions)); if (extensions.getExtensions().hasEmptyInputsMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboudVariables; if (!extensions.getExtensions().hasMapping(execution.getCurrentActivityId())) { inboudVariables = execution.getVariables(); } else { inboudVariables = calculateInputVariables(execution, extensions); } inboudVariables = parser.resolveExpressionsMap(inboudVariables); inboudVariables.putAll(constants); return inboudVariables; }</code><technical_language>I mentioned before, prefer ActivitiExpressionParser injected constructor</technical_language>

Target:
public Map<String, Object> calculateInputVariables(DelegateExecution execution) { ProcessExtensionModel extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (extensions.getExtensions().hasEmptyInputsMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboudVariables; if (!extensions.getExtensions().hasMapping(execution.getCurrentActivityId())) { inboudVariables = execution.getVariables(); } else { inboudVariables = calculateInputVariables(execution, extensions); } inboudVariables = expressionResolver.resolveExpressionsMap(execution,inboudVariables); inboudVariables.putAll(constants); return inboudVariables; }
Source:
<code>public boolean apply(final LineRange range) { <START> return range != null && range.within(this.proposed); <END> }</code><technical_language>@JimDeanSpivey need for null checks</technical_language>

Target:
public boolean apply(final LineRange range) { return range != null && range.within(this.given); }
Source:
<code>private boolean readyForAutosave(BibDatabaseContext context) { return ((context.getLocation() == DatabaseLocation.SHARED) || ((context.getLocation() == DatabaseLocation.LOCAL) && preferences.getBoolean(JabRefPreferences.LOCAL_AUTO_SAVE))) <START> && <END> context.getDatabasePath().isPresent(); }</code><technical_language>please refactor introducing a local variable. This is hard read understand</technical_language>

Target:
private boolean readyForAutosave(BibDatabaseContext context) { return ((context.getLocation() == DatabaseLocation.SHARED) || ((context.getLocation() == DatabaseLocation.LOCAL) && preferences.shouldAutosave())) && context.getDatabasePath().isPresent(); }
Source:
<code>public static Swap of(SwapLeg... legs) { ArgChecker.notNull(legs, "legs"); return Swap.builder() <START> .legs(ImmutableList.copyOf(legs)) <END> .build(); }</code><technical_language>need copy JB supplies a varargs method in builder</technical_language>

Target:
public static Swap of(SwapLeg... legs) { ArgChecker.notEmpty(legs, "legs"); return new Swap(ImmutableSet.copyOf(legs)); }
Source:
<code>private void addShortcut(LayoutElementParcelable path) { <START> final Context ctx = getActivity().getApplicationContext(); <END> if (!ShortcutManagerCompat.isRequestPinShortcutSupported(ctx)) { Toast.makeText(getActivity(), getString(R.string.addshortcut_not_supported_by_launcher), Toast.LENGTH_SHORT).show(); return; } Intent shortcutIntent = new Intent(ctx, MainActivity.class); shortcutIntent.putExtra("path", path.desc); shortcutIntent.setAction(Intent.ACTION_MAIN); shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); ShortcutInfoCompat info = new ShortcutInfoCompat.Builder(ctx, path.desc) .setActivity(getMainActivity().getComponentName()) .setIcon(IconCompat.createWithResource(ctx, R.mipmap.ic_launcher)) .setIntent(shortcutIntent) .setLongLabel(path.desc) .setShortLabel(new File(path.desc).getName()) .build(); ShortcutManagerCompat.requestPinShortcut(ctx, info, null); }</code><technical_language>Reason for getContext()</technical_language>

Target:
private void addShortcut(LayoutElementParcelable path) { final Context ctx = getContext(); if (!ShortcutManagerCompat.isRequestPinShortcutSupported(ctx)) { Toast.makeText(getActivity(), getString(R.string.addshortcut_not_supported_by_launcher), Toast.LENGTH_SHORT).show(); return; } Intent shortcutIntent = new Intent(ctx, MainActivity.class); shortcutIntent.putExtra("path", path.desc); shortcutIntent.setAction(Intent.ACTION_MAIN); shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); ShortcutInfoCompat info = new ShortcutInfoCompat.Builder(ctx, path.desc) .setActivity(getMainActivity().getComponentName()) .setIcon(IconCompat.createWithResource(ctx, R.mipmap.ic_launcher)) .setIntent(shortcutIntent) .setLongLabel(path.desc) .setShortLabel(new File(path.desc).getName()) .build(); ShortcutManagerCompat.requestPinShortcut(ctx, info, null); }
Source:
<code>private static void checkGeometryToBingTilesLimits(Geometry geometry, boolean pointOrRectangle, long tileCount) { if (pointOrRectangle) { checkCondition(tileCount <= 1_000_000, "The number of input tiles is too large (more than 1M) to compute a set of covering Bing tiles."); } else { checkCondition((int) tileCount == tileCount, "The zoom level is too high to compute a set of covering Bing tiles."); long complexity = 0; try { <START> complexity = Math.multiplyExact(tileCount, getPointCount(geometry)); <END> } catch (ArithmeticException e) { checkCondition(false, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } checkCondition(complexity <= 25_000_000, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } }</code><technical_language>Static import</technical_language>

Target:
private static void checkGeometryToBingTilesLimits(Geometry geometry, boolean pointOrRectangle, long tileCount) { if (pointOrRectangle) { checkCondition(tileCount <= 1_000_000, "The number of input tiles is too large (more than 1M) to compute a set of covering Bing tiles."); } else { checkCondition((int) tileCount == tileCount, "The zoom level is too high to compute a set of covering Bing tiles."); long complexity = 0; try { complexity = multiplyExact(tileCount, getPointCount(geometry)); } catch (ArithmeticException e) { checkCondition(false, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } checkCondition(complexity <= 25_000_000, "The zoom level is too high or the geometry is too complex to compute a set of covering Bing tiles. " + "Please use a lower zoom level or convert the geometry to its bounding box using the ST_Envelope function."); } }
Source:
<code>public String toString() { return toStringHelper() .add("clientId", clientId) <START> .add("clientSecret", clientSecret) <END> .add("refreshToken", refreshToken) .add("tokenServerUri", tokenServerUri) .add("transportFactoryClassName", transportFactoryClassName) .toString(); }</code><technical_language>is client secret a private key</technical_language>

Target:
public String toString() { return toStringHelper() .add("clientId", clientId) .add("refreshToken", refreshToken) .add("tokenServerUri", tokenServerUri) .add("transportFactoryClassName", transportFactoryClassName) .toString(); }
Source:
<code>@Test public void testDigestChallengeWithStrictRfc2617Header() { Headers headers = new Headers.Builder() .add("WWW-Authenticate", "Digest realm=\"myrealm\", nonce=\"fjalskdflwejrlaskdfjlaskdjflaks" + "jdflkasdf\", qop=\"auth\", stale=\"FALSE\"") .build(); <START> List<Challenge> challenges = HttpHeadersKt.parseChallenges(headers, "WWW-Authenticate"); <END> assertThat(challenges.size()).isEqualTo(1); assertThat(challenges.get(0).scheme()).isEqualTo("Digest"); assertThat(challenges.get(0).realm()).isEqualTo("myrealm"); Map<String, String> expectedAuthParams = new LinkedHashMap<>(); expectedAuthParams.put("realm", "myrealm"); expectedAuthParams.put("nonce", "fjalskdflwejrlaskdfjlaskdjflaksjdflkasdf"); expectedAuthParams.put("qop", "auth"); expectedAuthParams.put("stale", "FALSE"); assertThat(challenges.get(0).authParams()).isEqualTo(expectedAuthParams); }</code><technical_language>wanna change jvm name HttpHeaders</technical_language>

Target:
@Test public void testDigestChallengeWithStrictRfc2617Header() { Headers headers = new Headers.Builder() .add("WWW-Authenticate", "Digest realm=\"myrealm\", nonce=\"fjalskdflwejrlaskdfjlaskdjflaks" + "jdflkasdf\", qop=\"auth\", stale=\"FALSE\"") .build(); List<Challenge> challenges = HttpHeaders.parseChallenges(headers, "WWW-Authenticate"); assertThat(challenges.size()).isEqualTo(1); assertThat(challenges.get(0).scheme()).isEqualTo("Digest"); assertThat(challenges.get(0).realm()).isEqualTo("myrealm"); Map<String, String> expectedAuthParams = new LinkedHashMap<>(); expectedAuthParams.put("realm", "myrealm"); expectedAuthParams.put("nonce", "fjalskdflwejrlaskdfjlaskdjflaksjdflkasdf"); expectedAuthParams.put("qop", "auth"); expectedAuthParams.put("stale", "FALSE"); assertThat(challenges.get(0).authParams()).isEqualTo(expectedAuthParams); }
Source:
<code>public void changeBrand(Brand brand) { $("body").removeClass(); <START> $("body").addClass(getStyle(brand)); <END> setHomeHref(brand); setProductsHref(brand); }</code><technical_language>$(body).removeClass().addClass(getStyle(brand)); (body is GQuery.body)</technical_language>

Target:
public void changeBrand(Brand brand) { $(body).removeClass().addClass(getStyle(brand)); setHomeHref(brand); setProductsHref(brand); }
Source:
<code><START> public void getPosition(Vector3f output) { <END> LocationComponent location = entity.getComponent(LocationComponent.class); if (location == null) { output.x = 0; output.y = 0; output.z = 0; } else { location.getWorldPosition(output); } }</code><technical_language>recommend this method return output Vector3f, easier use</technical_language>

Target:
public Vector3f getPosition(Vector3f output) { LocationComponent location = entity.getComponent(LocationComponent.class); if (location == null) { output.x = 0; output.y = 0; output.z = 0; } else { location.getWorldPosition(output); } return output; }