auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<String> normalize(String... strings) { <START> final Map<String, Pair<String, String>> stringParts = new HashMap<>(strings.length); Arrays.stream(strings) .filter(Objects::nonNull) .forEach(str -> stringParts.put(str, decompose(str))); final int maxNumericSuffixLength = stringParts.values() .stream() .filter(Objects::nonNull) .collect(Collectors.summarizingInt(pair -> pair.getSecond().length())) .getMax(); return Arrays.stream(strings) .map(str -> compose(str, stringParts, maxNumericSuffixLength)) .collect(Collectors.toList()); <END> }</code><technical_language>extract some methods more readable: Map<String, Pair<>> stringParts = decomposeIntoParts(strings); int maxNumericSuffixLength = computeMaxSuffixLength(stringParts); return padNumericParts(...)</technical_language>

Target:
public List<String> normalize(String... strings) { List<TextWithNumericSuffix> inputAsTextWithNumericSuffix = Arrays.stream(strings) .map(this::decompose) .collect(Collectors.toList()); return inputAsTextWithNumericSuffix.stream() .map(e -> compose(e, countMaximumSuffixLength(inputAsTextWithNumericSuffix))) .collect(Collectors.toList()); }
Source:
<code>private void processSimpleType(final XmlSchemaElement xmlSchemaElement) { final QName baseTypeName = <START> xmlSchemaElement.getSchemaType() != null <END> ? getBaseTypeQName((XmlSchemaSimpleType) xmlSchemaElement.getSchemaType()) : getBaseTypeQName(xmlSchemaElement.getSchemaTypeName()); if (baseTypeName != null) { mapSchemaElement(xmlSchemaElement, baseTypeName); } else { LOGGER.debug("Could not find the base type for simple type: {}", xmlSchemaElement.getQName()); } }</code><technical_language>this xmlSchemaElement.getSchemaType() intanceof XmlSchemaSimpleType</technical_language>

Target:
private void processSimpleType(final XmlSchemaElement xmlSchemaElement) { final QName baseTypeName = getBaseTypeQName((XmlSchemaSimpleType) xmlSchemaElement.getSchemaType()); if (baseTypeName != null) { mapSchemaElement(xmlSchemaElement, baseTypeName); } else { LOGGER.debug("Could not find the base type for simple type: {}", xmlSchemaElement.getQName()); } }
Source:
<code>protected void checkContainmentConflict(Comparison comparison, ReferenceChange diff, ReferenceChange candidate) { if (candidate.getReference().isContainment()) { ConflictKind kind = ConflictKind.REAL; <START> final boolean diffIsDelete = isDeleteOrUnsetDiff(diff); <END> final boolean candidateIsDelete = isDeleteOrUnsetDiff(candidate); if (diffIsDelete && candidateIsDelete) { kind = ConflictKind.PSEUDO; } else if (diff.getMatch() == candidate.getMatch() && diff.getReference() == candidate.getReference()) { if (!diffIsDelete && !candidateIsDelete && matchingIndices(comparison, diff.getMatch(), diff.getReference(), diff.getValue(), candidate.getValue())) { kind = ConflictKind.PSEUDO; } } conflictOn(comparison, diff, candidate, kind); } else if (diff.getKind() == DifferenceKind.DELETE) { if (candidate.getKind() == DifferenceKind.DELETE) { } else if (isDiffOfPseudoDeleteConflict(candidate)) { } else { conflictOn(comparison, diff, candidate, ConflictKind.REAL); } } }</code><technical_language>Move this out of if</technical_language>

Target:
protected void checkContainmentConflict(Comparison comparison, ReferenceChange diff, ReferenceChange candidate) { final boolean candidateIsDelete = isDeleteOrUnsetDiff(candidate); if (candidate.getReference().isContainment()) { ConflictKind kind = ConflictKind.REAL; final boolean diffIsDelete = isDeleteOrUnsetDiff(diff); if (diffIsDelete && candidateIsDelete) { kind = ConflictKind.PSEUDO; } else if (diff.getMatch() == candidate.getMatch() && diff.getReference() == candidate.getReference()) { if (!diffIsDelete && !candidateIsDelete && matchingIndices(comparison, diff.getMatch(), diff.getReference(), diff.getValue(), candidate.getValue())) { kind = ConflictKind.PSEUDO; } } conflictOn(comparison, diff, candidate, kind); } else if (diff.getKind() == DifferenceKind.DELETE) { if (candidateIsDelete) { } else { conflictOn(comparison, diff, candidate, ConflictKind.REAL); } } }
Source:
<code>public Integer getPage(String data) { int beginIndex = data.indexOf("via"); beginIndex = data.indexOf("patient", beginIndex) + 8; int endIndex = data.indexOf('/', beginIndex); <START> return Integer.parseInt(data.substring(beginIndex, endIndex - 2 )); <END> }</code><technical_language>constants here, +8 -2 means</technical_language>

Target:
public Integer getPage(String data) { int beginIndex = data.indexOf("via"); beginIndex = data.indexOf("patient", beginIndex) + "patient/".length(); int endIndex = data.indexOf('/', beginIndex) - "\" ".length(); return Integer.parseInt(data.substring(beginIndex, endIndex)); }
Source:
<code>public void testSetClassNameProperty() { Assertions.assertThrows(IllegalStateException.class, () -> { JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE); descriptor.setClassNameProperty(JavaBeanDescriptor.class.getName()); }); <START> JavaBeanDescriptor descriptor1 = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(), <END> JavaBeanDescriptor.TYPE_CLASS); String oldValue1 = descriptor1.setClassNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertNull(oldValue1); String oldValue2 = descriptor1.setClassNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertEquals(oldValue2, descriptor1.getClassNameProperty()); }</code><technical_language>this line</technical_language>

Target:
public void testSetClassNameProperty() { Assertions.assertThrows(IllegalStateException.class, () -> { JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE); descriptor.setClassNameProperty(JavaBeanDescriptor.class.getName()); }); JavaBeanDescriptor descriptor = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(), JavaBeanDescriptor.TYPE_CLASS); String oldValue1 = descriptor.setClassNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertNull(oldValue1); String oldValue2 = descriptor.setClassNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertEquals(oldValue2, descriptor.getClassNameProperty()); }
Source:
<code>protected void onMethodInvocationFound(MethodInvocationTree mit) { MethodTree method = findEnclosingMethod(mit); if (method != null) { Arguments args = mit.arguments(); if (SET_SSL_ON_CONNECT.matches(mit) && LiteralUtils.isTrue(args.get(0))) { MethodBodyApacheVisitor apacheVisitor = new MethodBodyApacheVisitor(); method.accept(apacheVisitor); if (!apacheVisitor.isSecured) { reportIssue(mit, "Enable server identity validation on this SMTP SSL connection."); } <START> } else if (HASHTABLE_PUT.matches(mit) && parametersSocketFactoryMatch(args.get(0), args.get(1))) { <END> MethodBodyHashtableVisitor hashVisitor = new MethodBodyHashtableVisitor(); method.accept(hashVisitor); if (!hashVisitor.isSecured) { reportIssue(mit, "Enable server identity validation, set \"mail.smtp.ssl.checkserveridentity\" to true"); } } } super.onMethodInvocationFound(mit); }</code><technical_language>safer parameters in MethodMatcher for Hashtable.put(...) 2 arguments</technical_language>

Target:
protected void onMethodInvocationFound(MethodInvocationTree mit) { MethodTree method = findEnclosingMethod(mit); if (method != null) { Arguments args = mit.arguments(); if (SET_SSL_ON_CONNECT.matches(mit) && LiteralUtils.isTrue(args.get(0))) { MethodBodyApacheVisitor apacheVisitor = new MethodBodyApacheVisitor(); method.accept(apacheVisitor); if (!apacheVisitor.isSecured) { reportIssue(mit, "Enable server identity validation on this SMTP SSL connection."); } } else if (HASHTABLE_PUT.matches(mit) && "mail.smtp.socketFactory.class".equals(ConstantUtils.resolveAsStringConstant(args.get(0))) && "javax.net.ssl.SSLSocketFactory".equals(ConstantUtils.resolveAsStringConstant(args.get(1)))) { MethodBodyHashtableVisitor hashVisitor = new MethodBodyHashtableVisitor(); method.accept(hashVisitor); if (!hashVisitor.isSecured) { reportIssue(mit, "Enable server identity validation, set \"mail.smtp.ssl.checkserveridentity\" to true"); } } } super.onMethodInvocationFound(mit); }
Source:
<code>public CassandraHttpSession getSession(String id) { Select select = QueryBuilder.select("id", "creation_time", "last_accessed", "max_inactive_interval_in_seconds", "attributes") .from(this.tableName); select.where(QueryBuilder.eq("id", UUID.fromString(id))); select.setConsistencyLevel(this.consistencyLevel); Row row = this.cassandraOperations.getSession().execute(select).one(); if (row == null) { return null; } <START> long creationTime = row.getLong(1); <END> long lastAccessed = row.getLong(2); int maxInactiveIntervalInSeconds = row.getInt(3); Map<String, String> attributes = row.getMap(4, String.class, String.class); CassandraHttpSession result = new CassandraHttpSession(id); result.setCreationTime(creationTime); result.setLastAccessedTime(lastAccessed); result.setMaxInactiveIntervalInSeconds(maxInactiveIntervalInSeconds); this.sessionAttributeDeserializer.inflateSession(attributes, result); result.onSave(); return result; }</code><technical_language>Index access is low-level. access column name</technical_language>

Target:
public CassandraHttpSession getSession(String id) { Select select = QueryBuilder.select("id", "creation_time", "last_accessed", "max_inactive_interval_in_seconds", "attributes") .from(this.tableName); select.where(QueryBuilder.eq("id", UUID.fromString(id))); select.setConsistencyLevel(this.consistencyLevel); Row row = this.cassandraOperations.getSession().execute(select).one(); if (row == null) { return null; } long creationTime = row.getLong("creation_time"); long lastAccessed = row.getLong("last_accessed"); int maxInactiveIntervalInSeconds = row.getInt("max_inactive_interval_in_seconds"); Map<String, String> attributes = row.getMap("attributes", String.class, String.class); CassandraHttpSession result = new CassandraHttpSession(id); result.setCreationTime(creationTime); result.setLastAccessedTime(lastAccessed); result.setMaxInactiveIntervalInSeconds(maxInactiveIntervalInSeconds); this.sessionAttributeDeserializer.inflateSession(attributes, result); result.onSave(); return result; }
Source:
<code>private void deleteRecords(List<String> recordIds) throws SQLException { Integer deletedRecordsCount = 0; try (Connection connection = getConnection(); PreparedStatement deleteStatement = connection.prepareStatement(DELETE_STATEMENT)) { deleteStatement.setArray(1, connection.createArrayOf("varchar", recordIds.toArray())); <START> deletedRecordsCount = deleteStatement.executeUpdate(); <END> } LOGGER.info("Cleaned records from database", deletedRecordsCount); }</code><technical_language>is this longer returned</technical_language>

Target:
private int deleteRecords(List<String> recordIds) throws SQLException { int deletedRecordsCount = 0; try (Connection connection = getConnection(); PreparedStatement deleteStatement = connection.prepareStatement(DELETE_STATEMENT)) { deleteStatement.setArray(DELETE_STATEMENT_LIST_PARAM_INDEX, connection.createArrayOf("varchar", recordIds.toArray())); deletedRecordsCount = deleteStatement.executeUpdate(); } return deletedRecordsCount; }
Source:
<code>public Optional<PageReader> readColumnInBlock(int blockIndex, ColumnDescriptor columnDescriptor) throws IOException { BlockMetaData block = blocks.get(blockIndex); if (block.getRowCount() == 0) { throw new RuntimeException("Illegal row group of 0 rows"); } Optional<ColumnChunkMetaData> mc = findColumnByPath(block, columnDescriptor.getPath()); <START> if (mc.isPresent()) { <END> ColumnChunkMetaData column = mc.get(); ChunkDescriptor chunk = new ChunkDescriptor(columnDescriptor, column, column.getStartingPos(), (int) column.getTotalSize()); return Optional.of(readChunk(f, chunk)); } return Optional.empty(); }</code><technical_language>return mc.map(column -> { ChunkDescriptor chunk = new ChunkDescriptor(columnDescriptor, column, column.getStartingPos(), (int) column.getTotalSize()); return readChunk(f, chunk) });</technical_language>

Target:
Optional<PageReader> readColumnInBlock(int blockIndex, ColumnDescriptor columnDescriptor) { BlockMetaData block = blocks.get(blockIndex); if (block.getRowCount() == 0) { throw new RuntimeException("Illegal row group of 0 rows"); } Optional<ColumnChunkMetaData> mc = findColumnByPath(block, columnDescriptor.getPath()); return mc.map(column -> new ChunkDescriptor(columnDescriptor, column, column.getStartingPos(), (int) column.getTotalSize())) .map(chunk -> readChunk(f, chunk)); }
Source:
<code>public CollectionSet build(CollectionAgent agent, Object message, Long timestamp) throws ScriptException { final CollectionSetBuilder builder = new CollectionSetBuilder(agent); <START> if (timestamp != null) { <END> builder.withTimestamp(new Date(timestamp)); } final SimpleBindings globals = new SimpleBindings(); globals.put("agent", agent); globals.put("builder", builder); globals.put("msg", message); compiledScript.eval(globals); return builder.build(); }</code><technical_language>For Nxos, JTI check if is zero default value</technical_language>

Target:
public CollectionSet build(CollectionAgent agent, Object message, Long timestamp) throws ScriptException { final CollectionSetBuilder builder = new CollectionSetBuilder(agent); if (timestamp != null && timestamp > 0) { builder.withTimestamp(new Date(timestamp)); } final SimpleBindings globals = new SimpleBindings(); globals.put("agent", agent); globals.put("builder", builder); globals.put("msg", message); compiledScript.eval(globals); return builder.build(); }
Source:
<code>public void added(RuleTemplate element) { String templateUID = element.getUID(); Set<String> rules = new HashSet<String>(); synchronized (this) { Set<String> rulesForResolving = mapTemplateToRules.get(templateUID); if (rulesForResolving != null) { rules.addAll(rulesForResolving); } } for (String rUID : rules) { try { update(resolveRuleByTemplate(get(rUID))); <START> } catch (Exception e) { <END> logger.error("Resolving the rule '{}' by template '{}' failed", rUID, templateUID, e); } } }</code><technical_language>catch generic Exceptions. this more specific</technical_language>

Target:
public void added(RuleTemplate element) { String templateUID = element.getUID(); Set<String> rules = new HashSet<String>(); synchronized (this) { Set<String> rulesForResolving = mapTemplateToRules.get(templateUID); if (rulesForResolving != null) { rules.addAll(rulesForResolving); } } for (String rUID : rules) { try { Rule unresolvedRule = get(rUID); Rule resolvedRule = resolveRuleByTemplate(unresolvedRule); Provider<Rule> provider = getProvider(rUID); if (provider instanceof ManagedRuleProvider) { update(resolvedRule); } else { updated(provider, unresolvedRule, unresolvedRule); } } catch (IllegalArgumentException e) { logger.error("Resolving the rule '{}' by template '{}' failed", rUID, templateUID, e); } } }
Source:
<code>public Matrix div(final Matrix matrix) { if (matrix.isDense()) { <START> throw new UnsupportedOperationException(); <END> } else { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$div(((CSCMatrix) matrix).breezeMatrix, MatrixOps.EDIV_SS)); } }</code><technical_language>element-wise multiplication, breeze library supporting this operation. tested this in scala console (0.12 version)</technical_language>

Target:
public Matrix div(final Matrix matrix) { if (matrix.isDense()) { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$div(((DenseMatrix) matrix).getBreezeMatrix(), MatrixOps.EDIV_MM)); } else { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$div(((CSCMatrix) matrix).breezeMatrix, MatrixOps.EDIV_SS)); } }
Source:
<code><START> private void init(final Context context) { <END> mDropdownMultiQuestionViewStrategy = new DropdownMultiQuestionViewStrategy(context); inflate(context, R.layout.multi_question_tab_spinner_with_filter_row, this); header = (CustomTextView) findViewById(R.id.row_header_text); textViewButton = (TextView) findViewById(R.id.answer); textViewButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dialog = inflate(context, R.layout.dialog_spinner_with_filter, null); builder = new AlertDialog.Builder(context); builder.setView(dialog); final AlertDialog alertDialog = builder.show(); listView = (ListView) dialog.findViewById(R.id.listView); EditText editText = (EditText) dialog.findViewById(R.id.filter); editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { filter(listView, s.toString()); } }); setOptions(mOptionDBS); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { alertDialog.dismiss(); selectedOptionDB = null; OptionDB optionDB = (OptionDB) parent.getItemAtPosition(position); textViewButton.setText(optionDB.getInternationalizedName().toString()); if (!optionSetFromSavedValue) { if (position > 0) { notifyAnswerChanged(optionDB); selectedOptionDB = optionDB; } } else { optionSetFromSavedValue = false; } if (BuildConfig.validationInline) { if (position > 0) { Validation.getInstance().removeInputError(header); header.setError(null); } else { Validation.getInstance().addinvalidInput(header, getContext().getString( R.string.error_empty_question)); } } } }); editText.requestFocus(); } }); }</code><technical_language>this method is big, please refactor more readable code</technical_language>

Target:
private void init(final Context context) { mDropdownMultiQuestionViewStrategy = new DropdownMultiQuestionViewStrategy(context); inflate(context, R.layout.multi_question_tab_spinner_with_filter_row, this); header = (CustomTextView) findViewById(R.id.row_header_text); spinnerAsButton = (Spinner) findViewById(R.id.answer); if(isEnabled()){ spinnerAsButton.setOnTouchListener(new OnTouchListener(context)); } }
Source:
<code>@NonNull public PreparedExecSql prepare() { <START> Checks.checkNotNull(rawQuery, "Please set query object"); <END> return new PreparedExecSql( storIOSQLiteDb, rawQuery ); }</code><technical_language>Static import</technical_language>

Target:
@NonNull public PreparedExecSql prepare() { checkNotNull(rawQuery, "Please set query object"); return new PreparedExecSql( storIOSQLiteDb, rawQuery ); }
Source:
<code>private String readablePoolsString() { <START> StringBuffer pools = new StringBuffer("resourcePools:\n"); <END> for(Map.Entry entry : serverConfiguration.getResourcePools().entrySet()) { pools.append(" " + entry.getKey() + ": " + entry.getValue() + "\n"); } return pools.toString(); }</code><technical_language>please StringBuilder</technical_language>

Target:
private String readablePoolsString() { StringBuilder pools = new StringBuilder("resourcePools:\n"); for(Map.Entry entry : serverConfiguration.getResourcePools().entrySet()) { pools.append(" " + entry.getKey() + ": " + entry.getValue() + "\n"); } return pools.toString(); }
Source:
<code>public static Map<String, Object> toMap(BytesReference bytes, XContentType xContentType) { <START> try { <END> final InputStream inputStream = getUncompressedInputStream(bytes); XContentParser parser = xContentType.xContent().createParser( NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, inputStream ); return parser.map(); } catch (IOException e) { throw new UncheckedIOException(e); } }</code><technical_language>utilize autoclosable input stream? try (InputStream inputStream = getUncompressedInputStream(bytes)) { .</technical_language>

Target:
public static Map<String, Object> toMap(BytesReference bytes, XContentType xContentType) { try (InputStream inputStream = getUncompressedInputStream(bytes)) { XContentParser parser = xContentType.xContent().createParser( NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, inputStream ); return parser.map(); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); final FutureCallable callable = new FutureCallable(() -> { if (isPolicyReset) { <START> int connectionId = client.getConnectionId(); <END> updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false); if (client.isClosed() && client.getConnectionId() == connectionId) { waitUntilCheck(client -> client.isClosed(), "Waiting on losing connection to {}", "Connection lost for {}"); } if (!client.isClosed() && client.getConnectionId() != connectionId) { waitUntilCheck(client -> !client.isClosed(), "Waiting on opening connection for {}", "Done reconnecting for {}!"); } } return new FutureMap(client, request).withResponseKey("status"); }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy(), true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }</code><technical_language>too, find symbol: [ERROR] Failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) project vdsbroker: Compilation failure: Compilation failure: [ERROR] /home/dcaro/Work/redhat/ovirt/ovirt-engine/rpmbuild/BUILD/ovirt-engine-4.0.0/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/jsonrpc/JsonRpcVdsServer.java:[471,41] error: find symbol [ERROR] variable client of type JsonRpcClient</technical_language>

Target:
public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); final FutureCallable callable = new FutureCallable(() -> { if (isPolicyReset) { int connectionId = client.getConnectionId(); updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false); if (client.isClosed() && client.getConnectionId() == connectionId) { waitUntilCheck(client -> client.isClosed(), "Waiting on losing connection to {}", "Connection lost for {}"); } } return new FutureMap(client, request).withResponseKey("status"); }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy(), true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }
Source:
<code>public CacheStore(CachingTier<K, V> cachingTier, AuthoritativeTier<K, V> authoritativeTier) { this.cachingTierRef = new AtomicReference<CachingTier<K, V>>(cachingTier); this.authoritativeTier = authoritativeTier; this.realCachingTier = cachingTier; this.noopCachingTier = new NoopCachingTier<K, V>(authoritativeTier); <START> cachingTier.setInvalidationListener(new CachingTier.InvalidationListener<K, V>() { <END> @Override public void onInvalidation(K key, ValueHolder<V> valueHolder) { CacheStore.this.authoritativeTier.flush(key, valueHolder); } }); StatisticsManager.associate(cachingTier).withParent(this); StatisticsManager.associate(authoritativeTier).withParent(this); cacheStoreStatsSettings = new CacheStoreStatsSettings(cachingTier, authoritativeTier); StatisticsManager.associate(cacheStoreStatsSettings).withParent(this); }</code><technical_language>This clearer if acted this.realCachingTier</technical_language>

Target:
public CacheStore(CachingTier<K, V> cachingTier, AuthoritativeTier<K, V> authoritativeTier) { this.cachingTierRef = new AtomicReference<CachingTier<K, V>>(cachingTier); this.authoritativeTier = authoritativeTier; this.realCachingTier = cachingTier; this.noopCachingTier = new NoopCachingTier<K, V>(authoritativeTier); this.realCachingTier.setInvalidationListener(new CachingTier.InvalidationListener<K, V>() { @Override public void onInvalidation(K key, ValueHolder<V> valueHolder) { CacheStore.this.authoritativeTier.flush(key, valueHolder); } }); StatisticsManager.associate(cachingTier).withParent(this); StatisticsManager.associate(authoritativeTier).withParent(this); cacheStoreStatsSettings = new CacheStoreStatsSettings(cachingTier, authoritativeTier); StatisticsManager.associate(cacheStoreStatsSettings).withParent(this); }
Source:
<code>public int getTemporalID(byte[] buf, int off, int len) { REDBlock redBlock = getPayloadBlock(buf, off, len); if (redBlock == null || redBlock.getLength() == 0) { return -1; } final byte vp8PT = getDynamicRTPPayloadType(Constants.VP8); if (redBlock.getPayloadType() == vp8PT) { return org.jitsi.impl .neomedia.codec.video.vp8.DePacketizer.VP8PayloadDescriptor .getTemporalLayerIndex( <START> buf, redBlock.getOffset(), redBlock.getLength()); <END> } else { return -1; } }</code><technical_language>I assume is correct 'buf' here, I easier read if 'redBlock.getBuffer()' (also assuming buffers same)</technical_language>

Target:
public int getTemporalID(byte[] buf, int off, int len) { REDBlock redBlock = getPayloadBlock(buf, off, len); if (redBlock == null || redBlock.getLength() == 0) { return -1; } final byte vp8PT = getDynamicRTPPayloadType(Constants.VP8); if (redBlock.getPayloadType() == vp8PT) { return org.jitsi.impl .neomedia.codec.video.vp8.DePacketizer.VP8PayloadDescriptor .getTemporalLayerIndex( redBlock.getBuffer(), redBlock.getOffset(), redBlock.getLength()); } else { return -1; } }
Source:
<code>private static void performWarmup() { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { Class.forName("org.eclipse.jetty.alpn.ALPN"); } catch (ClassNotFoundException e1) { LOG.warn( "Could not asynchronously the ssl context, since ALPN is not installed."); return; } try { @SuppressWarnings("unused") SslContext warmup = createSslContext(); } catch (SSLException e) { <START> LOG.warn("Could not asynchronously the ssl context", e); <END> } } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { @SuppressWarnings("unused") HttpTransport warmup = CredentialFactory.getHttpTransport(); } catch (IOException | GeneralSecurityException e) { LOG.warn("Could not asynchronously initialze httpTransport", e); } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { @SuppressWarnings("unused") InetAddress warmup = InetAddress.getByName(host); } catch (UnknownHostException e) { LOG.warn("Could not asynchronously initialze host: " + host, e); } } }); } connectionStartupExecutor.shutdown(); }</code><technical_language>asynchronously create ssl context</technical_language>

Target:
private static void performWarmup() { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { Class.forName("org.eclipse.jetty.alpn.ALPN"); } catch (ClassNotFoundException e1) { LOG.warn( "Could not asynchronously create the ssl context, since ALPN is not installed."); return; } try { createSslContext(); } catch (SSLException e) { LOG.warn("Could not asynchronously create the ssl context", e); } } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { CredentialFactory.getHttpTransport(); } catch (IOException | GeneralSecurityException e) { LOG.warn("Could not asynchronously initialze httpTransport", e); } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { LOG.warn("Could not asynchronously initialze host: " + host, e); } } }); } connectionStartupExecutor.shutdown(); }
Source:
<code>public String getOffsetForPosition(final long offset) { <START> return StringUtils.leftPad(String.valueOf(offset), VERSION_ZERO_MIN_OFFSET_LENGTH, '0'); <END> }</code><technical_language>is KafkaCursor.toNakadiOffset</technical_language>

Target:
public String getOffsetForPosition(final long offset) { return KafkaCursor.toNakadiOffset(offset); }
Source:
<code>String formatStepText(String keyword, String stepText, Format textFormat, Format argFormat, List<Argument> arguments) { int textStart = 0; StringBuilder result = new StringBuilder(textFormat.text(keyword)); for (Argument argument : arguments) { if (argument.getOffset() != null) { int textEnd = argument.getOffset(); if (textStart <= textEnd ) { String text = stepText.substring(textStart, textEnd); result.append(textFormat.text(text)); } } if (argument.getVal() != null) { result.append(argFormat.text(argument.getVal())); <START> textStart = argument.getOffset() + argument.getVal().length(); <END> } } if (textStart != stepText.length() && textStart >= 0) { String text = stepText.substring(textStart, stepText.length()); result.append(textFormat.text(text)); } return result.toString(); }</code><technical_language>I missing a bounds check here. I regret suggesting bounds checking in place solution. looked problem a bit more closely I more elegant skip nested arguments together. skip processing element in array continue statement. <LINK_0> <LINK_1></technical_language>

Target:
String formatStepText(String keyword, String stepText, Format textFormat, Format argFormat, List<Argument> arguments) { int beginIndex = 0; StringBuilder result = new StringBuilder(textFormat.text(keyword)); for (Argument argument : arguments) { if (argument.getOffset() != null) { int argumentOffset = argument.getOffset(); if (argumentOffset < beginIndex ) { continue; } String text = stepText.substring(beginIndex, argumentOffset); result.append(textFormat.text(text)); } if (argument.getVal() != null) { result.append(argFormat.text(argument.getVal())); int argumentEnd = argument.getOffset() + argument.getVal().length(); beginIndex = argumentEnd; } } if (beginIndex != stepText.length() && beginIndex >= 0) { String text = stepText.substring(beginIndex, stepText.length()); result.append(textFormat.text(text)); } return result.toString(); }
Source:
<code>public void allowsOverrideDefaultHeader() throws IOException { <START> final String expected = <END> String.format("%s: Non-Default-Value", DEF_HEADER); MatcherAssert.assertThat( new RqPrint( new RqWithDefaultHeader( new RqWithHeader( new RqFake(), DEF_HEADER, "Non-Default-Value" ), DEF_HEADER, DEF_HEADER_VAL ) ).print(), Matchers.startsWith( Joiner.on("\r\n").join( "GET /", "Host: www.example.com", expected ) ) ); }</code><technical_language>@exper0 get rid variable inline</technical_language>

Target:
public void allowsOverrideDefaultHeader() throws IOException { final String req = "POST /"; final String header = "X-Default-Header2"; MatcherAssert.assertThat( new RqPrint( new RqWithDefaultHeader( new RqWithHeader( new RqFake(Collections.singletonList(req), "body2"), header, "Non-Default-Value2" ), header, "X-Default-Value" ) ).print(), Matchers.startsWith( Joiner.on(RqWithDefaultHeaderTest.CRLF).join( req, "X-Default-Header2: Non-Default-Value" ) ) ); }
Source:
<code>public int hashCode() { <START> return Objects.hash(position, scores); <END> }</code><technical_language>issue</technical_language>

Target:
public int hashCode() { int result = Objects.hash(position); result = 31 * result + Arrays.hashCode(scores); return result; }
Source:
<code>public void testOnLoadClassWithClassAndNullHandler() { when(view.getNewClassName()).thenReturn("NewClassName"); presenter.addLoadClassesHandler(null); assertNull(presenter.getClasses()); presenter.onLoadClass(); assertNotNull(presenter.getClasses()); assertEquals(1, <START> presenter.getClasses().size()); <END> assertEquals("NewClassName", presenter.getClasses().get(0).getClassName()); verify(view, times(1)).redraw(); }</code><technical_language>If changing asserts, AssertJ - in this case, Assertions.assertThat(presenter.getClasses()).hasSize(1). This reads better, error message nicer, allow get rid of nullity assert immediately this one</technical_language>

Target:
public void testOnLoadClassWithClassAndNullHandler() { when(view.getNewClassName()).thenReturn("NewClassName"); presenter.addLoadClassesHandler(null); assertThat(presenter.getClasses()).isNull(); presenter.onLoadClass(); assertThat(presenter.getClasses()).hasSize(1); assertThat(presenter.getClasses().get(0).getClassName()).isEqualTo("NewClassName"); verify(view, times(1)).redraw(); }
Source:
<code>public void testCloseNotifyWaiters() throws Exception { final int numWorkers = 2; BufferPool pool = new BufferPool(1, 1, metrics, Time.SYSTEM, metricGroup); ByteBuffer buffer = pool.allocate(1, Long.MAX_VALUE); CountDownLatch ready = new CountDownLatch(numWorkers); CountDownLatch completed = new CountDownLatch(numWorkers); ExecutorService executor = Executors.newFixedThreadPool(numWorkers); Callable<Void> work = new Callable<Void>() { public Void call() throws Exception { ready.countDown(); assertThrows(KafkaException.class, () -> pool.allocate(1, Long.MAX_VALUE)); completed.countDown(); return null; } }; for (int i = 0; i < numWorkers; ++i) { executor.submit(work); } ready.await(15, TimeUnit.SECONDS); <START> Thread.sleep(100); <END> assertEquals("Allocation shouldn't have happened yet, waiting on memory", numWorkers, completed.getCount()); pool.close(); completed.await(15, TimeUnit.SECONDS); pool.deallocate(buffer); }</code><technical_language>Do sleep is needed ? experiment, 1 millis sleep suffices. timeout for completed.await() shortened allocate() call return immediately</technical_language>

Target:
public void testCloseNotifyWaiters() throws Exception { final int numWorkers = 2; BufferPool pool = new BufferPool(1, 1, metrics, Time.SYSTEM, metricGroup); ByteBuffer buffer = pool.allocate(1, Long.MAX_VALUE); ExecutorService executor = Executors.newFixedThreadPool(numWorkers); Callable<Void> work = new Callable<Void>() { public Void call() throws Exception { assertThrows(KafkaException.class, () -> pool.allocate(1, Long.MAX_VALUE)); return null; } }; for (int i = 0; i < numWorkers; ++i) { executor.submit(work); } TestUtils.waitForCondition(() -> pool.queued() == numWorkers, "Awaiting " + numWorkers + " workers to be blocked on allocation"); pool.close(); TestUtils.waitForCondition(() -> pool.queued() == 0, "Awaiting " + numWorkers + " workers to be interrupted from allocation"); pool.deallocate(buffer); }
Source:
<code>public void testParseMetadataFromToolWithTagNameAndReferenceMismatch() { ContainersApi toolsApi = setupWebService(); DockstoreTool tool = getContainer(); tool.setDefaultVersion("1.0"); DockstoreTool toolTest = toolsApi.registerManual(tool); toolsApi.refresh(toolTest.getId()); DockstoreTool refreshedTool = toolsApi.getContainer(toolTest.getId()); <START> assertTrue("Author should be set, even if tag name and tag reference are mismatched.", refreshedTool.getAuthor() != null); <END> }</code><technical_language>Assert.assertNonNull</technical_language>

Target:
public void testParseMetadataFromToolWithTagNameAndReferenceMismatch() { ContainersApi toolsApi = setupWebService(); DockstoreTool tool = getContainer(); tool.setDefaultVersion("1.0"); DockstoreTool toolTest = toolsApi.registerManual(tool); toolsApi.refresh(toolTest.getId()); DockstoreTool refreshedTool = toolsApi.getContainer(toolTest.getId()); assertNotNull("Author should be set, even if tag name and tag reference are mismatched.", refreshedTool.getAuthor()); }
Source:
<code>private void updateConfigs() { Gson gson = new Gson(); String jsonText = gson.toJson(configs, Configs.class); ByteArrayResource resource = new ByteArrayResource(jsonText.getBytes()); settingsFacade.saveRawConfig(OPEN_MRS_CONFIGS_FILE_NAME, resource); Map<String, Object> parameters = new HashMap<>(); <START> eventRelay.sendEventMessage(new MotechEvent(Constants.CONFIG_CHANGE_EVENT, parameters)); <END> }</code><technical_language>MotechEvent a constructor takes subject. it</technical_language>

Target:
private void updateConfigs() { Gson gson = new Gson(); String jsonText = gson.toJson(configs, Configs.class); ByteArrayResource resource = new ByteArrayResource(jsonText.getBytes()); settingsFacade.saveRawConfig(OPEN_MRS_CONFIGS_FILE_NAME, resource); eventRelay.sendEventMessage(new MotechEvent(Constants.CONFIG_CHANGE_EVENT)); }
Source:
<code>public void setContentType(String type) throws RestServiceException { <START> HttpHeaders headers = changeResponseHeader(HttpHeaders.Names.CONTENT_TYPE, type); <END> if (!type.equals(headers.get(HttpHeaders.Names.CONTENT_TYPE))) { nettyMetrics.responseMetadataBuildingFailure.inc(); throw new RestServiceException("Unable to set content-type to " + type, RestServiceErrorCode.ResponseMetadataBuildingFailure); } logger.trace("Set content type to for response on channel {}", type, ctx.channel()); }</code><technical_language>this thrown exception if content type set. do need check explicitly</technical_language>

Target:
public void setContentType(String type) throws RestServiceException { HttpHeaders headers = setResponseHeader(HttpHeaders.Names.CONTENT_TYPE, type); if (!type.equals(headers.get(HttpHeaders.Names.CONTENT_TYPE))) { nettyMetrics.responseMetadataBuildingFailure.inc(); throw new RestServiceException("Unable to set content-type to " + type, RestServiceErrorCode.ResponseMetadataBuildingFailure); } logger.trace("Set content type to for response on channel {}", type, ctx.channel()); }
Source:
<code>public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) { Fragment fragment = (Fragment)object; if (fragment != mCurrentPrimaryItem) { if (mCurrentPrimaryItem != null) { mCurrentPrimaryItem.setMenuVisibility(false); if (mResumeOnlyCurrentFragment) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } mCurTransaction.setMaxLifecycle(mCurrentPrimaryItem, Lifecycle.State.STARTED); } else { fragment.setUserVisibleHint(false); } } fragment.setMenuVisibility(true); if <START> (mCurTransaction != null && <END> mResumeOnlyCurrentFragment) { mCurTransaction.setMaxLifecycle(fragment, Lifecycle.State.RESUMED); } else { fragment.setUserVisibleHint(true); } mCurrentPrimaryItem = fragment; } }</code><technical_language>This part of this if statement. needs type of if check cases mCurrentPrimaryItem == null code, need create Transaction here</technical_language>

Target:
public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) { Fragment fragment = (Fragment)object; if (fragment != mCurrentPrimaryItem) { if (mCurrentPrimaryItem != null) { mCurrentPrimaryItem.setMenuVisibility(false); if (mResumeOnlyCurrentFragment) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } mCurTransaction.setMaxLifecycle(mCurrentPrimaryItem, Lifecycle.State.STARTED); } else { fragment.setUserVisibleHint(false); } } fragment.setMenuVisibility(true); if (mResumeOnlyCurrentFragment) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } mCurTransaction.setMaxLifecycle(fragment, Lifecycle.State.RESUMED); } else { fragment.setUserVisibleHint(true); } mCurrentPrimaryItem = fragment; } }
Source:
<code>private <P extends Properties> void resolvePropertiesList(ArrayNode objectNode, PropertiesList<P> properties) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException { List<P> subProperties = new ArrayList<>(); for (int i = 0; i < objectNode.size(); i++) { <START> P nestedProps = properties.getNestedPropertiesFactory().createAndInit("row" + i); <END> subProperties.add(resolveJson((ObjectNode) objectNode.get(i), nestedProps)); } properties.setRows(subProperties); }</code><technical_language>I refer constant : ROW_NAME_PREFIX</technical_language>

Target:
private <P extends Properties> void resolvePropertiesList(ArrayNode objectNode, PropertiesList<P> properties) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException { List<P> subProperties = new ArrayList<>(); for (int i = 0; i < objectNode.size(); i++) { P nestedProps = properties.getNestedPropertiesFactory().createAndInit(PropertiesList.ROW_NAME_PREFIX + i); subProperties.add(resolveJson((ObjectNode) objectNode.get(i), nestedProps)); } properties.setRows(subProperties); }
Source:
<code>public static double getImagingSetupSec(Config conf) { if (conf.containsItem(GUIDE_WITH_OIWFS_KEY)) { <START> String guideWithOIWFS = conf.getItemValue(GUIDE_WITH_OIWFS_KEY).toString(); <END> if (guideWithOIWFS.equals("guide")) { return IMAGING_SETUP_TIME_OIWFS; } } return IMAGING_SETUP_TIME_PWFS2; }</code><technical_language>I this key a GuideOption ask is active. java import edu.gemini.spModel.guide.GuideOption; ... public static double getImagingSetupSec(Config conf) { return ImOption.apply(conf.getItemValue(GUIDE_WITH_OIWFS_KEY)) .exists(g -> ((GuideOption) g).isActive) ? IMAGING_SETUP_TIME_OIWFS : IMAGING_SETUP_TIME_PWFS2; }</technical_language>

Target:
public static double getImagingSetupSec(Config conf) { return ImOption.apply(conf.getItemValue(GUIDE_WITH_OIWFS_KEY)) .exists(g -> ((GuideOption) g).isActive()) ? IMAGING_SETUP_TIME_OIWFS : IMAGING_SETUP_TIME_PWFS2; }
Source:
<code>public void configurePhoneNumber() { PhoneNumber phoneNumber = new PhoneNumber("PHONENUMBER_TO_CONFIGURE"); PstnConfiguration pstnConfiguration = new PstnConfiguration(); pstnConfiguration.setApplicationId("APPLICATION_ID"); <START> pstnConfiguration.setAzurePstnTargetId("AZURE_PSTN_TARGET_ID"); <END> pstnConfiguration.setCallbackUrl("CALLBACK_URL"); try { PhoneNumberClient phoneNumberClient = createPhoneNumberClient(); phoneNumberClient.configureNumber(phoneNumber, pstnConfiguration); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>remove this line. This target id accidentally added request object exposed user</technical_language>

Target:
public void configurePhoneNumber() { PhoneNumber phoneNumber = new PhoneNumber("PHONENUMBER_TO_CONFIGURE"); PstnConfiguration pstnConfiguration = new PstnConfiguration(); pstnConfiguration.setApplicationId("APPLICATION_ID"); pstnConfiguration.setCallbackUrl("CALLBACK_URL"); try { PhoneNumberClient phoneNumberClient = createPhoneNumberClient(); phoneNumberClient.configureNumber(phoneNumber, pstnConfiguration); } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>public ThingImpl(ThingUID thingUID) throws IllegalArgumentException { this.uid = thingUID; <START> this.thingTypeUID = new ThingTypeUID(thingUID.getBindingId(), thingUID.getThingTypeId()); <END> this.channels = new ArrayList<>(0); }</code><technical_language>this throw IllegalArgumentException in case thingTypeId is empty</technical_language>

Target:
public ThingImpl(ThingUID thingUID) throws IllegalArgumentException { if ("".equals(thingUID.getThingTypeId())) { throw new IllegalArgumentException( "The given ThingUID does not specify a ThingType. You might want to use ThingImpl(ThingTypeUID, ThingUID) instead."); } this.uid = thingUID; this.thingTypeUID = new ThingTypeUID(thingUID.getBindingId(), thingUID.getThingTypeId()); this.channels = new ArrayList<>(0); }
Source:
<code>private List<String> getCapabilitiesFromServer() { if (config.isJms()) { if (config.isJmsTransactional()) { <START> kieServerInfo = getServerInfoInTransaction(); <END> } else { ResponseHandler responseHandler = getResponseHandler(); setResponseHandler(new RequestReplyResponseHandler()); kieServerInfo = getServerInfo().getResult(); setResponseHandler(responseHandler); } } else { kieServerInfo = getServerInfo().getResult(); } logger.debug("KieServicesClient connected to: version {}", kieServerInfo.getServerId(), kieServerInfo.getVersion()); List<String> capabilities = kieServerInfo.getCapabilities(); logger.debug("Supported capabilities by the server: {}", capabilities); return capabilities; }</code><technical_language>case for transactional jms is send message server transaction completes in async response tx completes. for async execution expected server capabilities needs provided loaded automatically response arrive on. KieServicesClients need tx dependencies free run tx context need do manual ups itself. setting jms delivery transactional ConnectionFactory is XA/JTA deliver message if transaction commits</technical_language>

Target:
private List<String> getCapabilitiesFromServer() { ResponseHandler responseHandler = getResponseHandler(); if (config.isJms() && !(responseHandler instanceof RequestReplyResponseHandler)) { setResponseHandler(new RequestReplyResponseHandler()); kieServerInfo = getServerInfo().getResult(); setResponseHandler(responseHandler); } else { kieServerInfo = getServerInfo().getResult(); } logger.debug("KieServicesClient connected to: version {}", kieServerInfo.getServerId(), kieServerInfo.getVersion()); List<String> capabilities = kieServerInfo.getCapabilities(); logger.debug("Supported capabilities by the server: {}", capabilities); return capabilities; }
Source:
<code>public SizeOfEngineProvider create(ServiceCreationConfiguration<SizeOfEngineProvider> configuration) { <START> long maxDepth = Long.MAX_VALUE; <END> long maxSize = Long.MAX_VALUE; if(configuration != null) { DefaultSizeOfEngineProviderConfiguration sizeOfEngineConfiguration = (DefaultSizeOfEngineProviderConfiguration)configuration; maxDepth = sizeOfEngineConfiguration.getMaxDepth(); maxSize = sizeOfEngineConfiguration.getMaxSize(); } return new DefaultSizeOfEngineProvider(maxDepth, maxSize); }</code><technical_language>I if default value. IIRC ehcache 2 100 default, open suggestion this</technical_language>

Target:
public SizeOfEngineProvider create(ServiceCreationConfiguration<SizeOfEngineProvider> configuration) { long maxDepth = 1000; long maxSize = Long.MAX_VALUE; if(configuration != null) { DefaultSizeOfEngineProviderConfiguration sizeOfEngineConfiguration = (DefaultSizeOfEngineProviderConfiguration)configuration; maxDepth = sizeOfEngineConfiguration.getMaxDepth(); maxSize = sizeOfEngineConfiguration.getMaxSize(); } return new DefaultSizeOfEngineProvider(maxDepth, maxSize); }
Source:
<code>static void setInputPortType(JsonObject op, int index, String schema) { JsonArray inputs = op.get("inputs").getAsJsonArray(); JsonObject input = inputs.get(index).getAsJsonObject(); <START> input.remove("type"); <END> input.addProperty("type", schema); }</code><technical_language>need a remove of property is there</technical_language>

Target:
static void setInputPortType(JsonObject op, int index, String schema) { JsonArray inputs = op.get("inputs").getAsJsonArray(); JsonObject input = inputs.get(index).getAsJsonObject(); input.addProperty("type", schema); }
Source:
<code>public BufferedHttpResponse(HttpResponse innerHttpResponse) { super(innerHttpResponse.getRequest()); this.innerHttpResponse = innerHttpResponse; this.cachedBody = FluxUtil.collectBytesInByteBufferStream(innerHttpResponse.getBody()) <START> .map(bytes -> ByteBuffer.wrap(bytes)) <END> .flux() .cache(); }</code><technical_language>suggestion .map(ByteBuffer::wrap)</technical_language>

Target:
public BufferedHttpResponse(HttpResponse innerHttpResponse) { super(innerHttpResponse.getRequest()); this.innerHttpResponse = innerHttpResponse; this.cachedBody = FluxUtil.collectBytesInByteBufferStream(innerHttpResponse.getBody()) .map(ByteBuffer::wrap) .flux() .cache(); }
Source:
<code>protected String formatCommand(Command command, String format, String... keys) { <START> return super.formatCommand(command, format, this, keys); <END> }</code><technical_language>super</technical_language>

Target:
protected String formatCommand(Command command, String format, String... keys) { return formatCommand(command, format, this, keys); }