auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void considersKillingVetos() throws Exception { if (ProcessTree.get() == ProcessTree.DEFAULT) <START> return; <END> ProcessBuilder pb = new ProcessBuilder(); pb.environment().put("cookie", "testKeepDaemonsAlive"); if (File.pathSeparatorChar == ';') { pb.command("cmd"); } else { pb.command("sleep", "5m"); } process = pb.start(); ProcessTree processTree = ProcessTree.get(); processTree.killAll(ImmutableMap.of("cookie", "testKeepDaemonsAlive")); try { process.exitValue(); fail("Process should have been excluded from the killing"); } catch (IllegalThreadStateException e) { } }</code><technical_language>This Assume correctly skip test</technical_language>

Target:
public void considersKillingVetos() throws Exception { assumeTrue(ProcessTree.get() != ProcessTree.DEFAULT); ProcessBuilder pb = new ProcessBuilder(); pb.environment().put("cookie", "testKeepDaemonsAlive"); if (File.pathSeparatorChar == ';') { pb.command("cmd"); } else { pb.command("sleep", "5m"); } process = pb.start(); ProcessTree processTree = ProcessTree.get(); processTree.killAll(ImmutableMap.of("cookie", "testKeepDaemonsAlive")); try { process.exitValue(); fail("Process should have been excluded from the killing"); } catch (IllegalThreadStateException e) { } }
Source:
<code>public ProtostreamTranscoder(SerializationContext ctx, ClassLoader classLoader) { super(APPLICATION_PROTOSTREAM, APPLICATION_OCTET_STREAM, TEXT_PLAIN, APPLICATION_OBJECT, APPLICATION_JSON, APPLICATION_UNKNOWN); this.ctx = ctx; this.marshaller = new ProtoStreamMarshaller(ctx); this.classLoader = classLoader; <START> } <END></code><technical_language>ProtoStreamMarshaller is SerializationContext. updated</technical_language>

Target:
public ProtostreamTranscoder(SerializationContext ctx, ClassLoader classLoader) { super(APPLICATION_PROTOSTREAM, APPLICATION_OCTET_STREAM, TEXT_PLAIN, APPLICATION_OBJECT, APPLICATION_JSON, APPLICATION_UNKNOWN); this.ctx = ctx; this.classLoader = classLoader; }
Source:
<code>public void run() { try { fLaunch.terminate(); <START> setImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_TERMINATE_DISABLED_COLOR)); <END> } catch (DebugException e) { GdbUIPlugin.log(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, "Unable to terminate launch", e)); } }</code><technical_language>shoudn't change active image instead disable action. Notice terminate button is pressed, icon currently 'disabled' press button. Calling setEnabled(false) disable action</technical_language>

Target:
public void run() { try { fLaunch.terminate(); } catch (DebugException e) { GdbUIPlugin.log(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, "Unable to terminate launch", e)); } }
Source:
<code>public long save() { validateToSave(); try { final Connection connection = DB.getConnection(); final PreparedStatement ps = connection.prepareStatement(CREATE_SQL); final long id = System.currentTimeMillis(); ps.setLong(1, id); ps.setDouble(2, getLengthInches()); ps.setString(3, getWood().name()); ps.setString(4, getCore().name()); ps.execute(); <START> ps.close(); <END> connection.close(); return id; } catch (final SQLException e) { throw new RuntimeException(e); } }</code><technical_language>I nitpicking is a good idea close resources in try block, in finally block. This matter in small example. I prefer violate practices</technical_language>

Target:
public long save() { validateToSave(); Connection connection = null; PreparedStatement ps = null; try { connection = DB.getConnection(); ps = connection.prepareStatement(CREATE_SQL); final long id = System.currentTimeMillis(); ps.setLong(1, id); ps.setDouble(2, getLengthInches()); ps.setString(3, getWood().name()); ps.setString(4, getCore().name()); ps.execute(); return id; } catch (final SQLException e) { throw new RuntimeException(e); } finally { DB.closePreparedStatement(ps); DB.closeConnection(connection); } }
Source:
<code>public static KafkaStateChangelogOffset fromString(String message) { if (StringUtils.isBlank(message)) { throw new IllegalArgumentException("Invalid checkpointed changelog message: " + message); } String[] checkpointIdAndOffset = message.split(SEPARATOR); <START> if (checkpointIdAndOffset.length < 2 || checkpointIdAndOffset.length > 3) { <END> throw new IllegalArgumentException("Invalid checkpointed changelog offset: " + message); } CheckpointId checkpointId = CheckpointId.fromString(checkpointIdAndOffset[0]); String offset = null; if (!"null".equals(checkpointIdAndOffset[1])) { offset = checkpointIdAndOffset[1]; } return new KafkaStateChangelogOffset(checkpointId, offset); }</code><technical_language>relax this check</technical_language>

Target:
public static KafkaStateChangelogOffset fromString(String message) { if (StringUtils.isBlank(message)) { throw new IllegalArgumentException("Invalid checkpointed changelog message: " + message); } String[] checkpointIdAndOffset = message.split(SEPARATOR); if (checkpointIdAndOffset.length != 2) { throw new IllegalArgumentException("Invalid checkpointed changelog offset: " + message); } CheckpointId checkpointId = CheckpointId.fromString(checkpointIdAndOffset[0]); String offset = null; if (!"null".equals(checkpointIdAndOffset[1])) { offset = checkpointIdAndOffset[1]; } return new KafkaStateChangelogOffset(checkpointId, offset); }
Source:
<code>public void preInit(FMLPreInitializationEvent evt) { RegistryHelper.useOtherModConfigFor(MODID, BCCore.MODID); BCSiliconConfig.preInit(); BCSiliconItems.preInit(); BCSiliconBlocks.preInit(); <START> BCSiliconConfig.reloadConfig(EnumRestartRequirement.GAME); <END> NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, BCSiliconProxy.getProxy()); BCSiliconProxy.getProxy().fmlPreInit(); }</code><technical_language>Put this in config preinit please</technical_language>

Target:
public void preInit(FMLPreInitializationEvent evt) { RegistryHelper.useOtherModConfigFor(MODID, BCCore.MODID); BCSiliconConfig.preInit(); BCSiliconItems.preInit(); BCSiliconBlocks.preInit(); NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, BCSiliconProxy.getProxy()); BCSiliconProxy.getProxy().fmlPreInit(); }
Source:
<code>private SymbolStatsEstimate buildSymbolStatistics(List<Object> values, Session session, Type type) { List<Object> nonNullValues = values.stream() .filter(Objects::nonNull) .collect(toImmutableList()); if (nonNullValues.isEmpty()) { return SymbolStatsEstimate.builder() .setHighValue(NaN) .setLowValue(NaN) .setNullsFraction(1.0) .setDistinctValuesCount(0.0) <START> .build(); <END> } double[] valuesAsDoubles = nonNullValues.stream() .map(value -> toStatsRepresentation(metadata, session, type, value)) .filter(OptionalDouble::isPresent) .mapToDouble(OptionalDouble::getAsDouble) .toArray(); double lowValue = DoubleStream.of(valuesAsDoubles).min().orElse(Double.NEGATIVE_INFINITY); double highValue = DoubleStream.of(valuesAsDoubles).max().orElse(Double.POSITIVE_INFINITY); double valuesCount = values.size(); double nonNullValuesCount = nonNullValues.size(); long distinctValuesCount = nonNullValues.stream().distinct().count(); return SymbolStatsEstimate.builder() .setNullsFraction((valuesCount - nonNullValuesCount) / valuesCount) .setLowValue(lowValue) .setHighValue(highValue) .setDistinctValuesCount(distinctValuesCount) .build(); }</code><technical_language>avg size? - ctor. - Also, builder's method, please try call in order (let's ndv-nulls-low-high-avgsize). This easier compare/read code</technical_language>

Target:
private SymbolStatsEstimate buildSymbolStatistics(List<Object> values, Session session, Type type) { List<Object> nonNullValues = values.stream() .filter(Objects::nonNull) .collect(toImmutableList()); if (nonNullValues.isEmpty()) { return SymbolStatsEstimate.zero(); } double[] valuesAsDoubles = nonNullValues.stream() .map(value -> toStatsRepresentation(metadata, session, type, value)) .filter(OptionalDouble::isPresent) .mapToDouble(OptionalDouble::getAsDouble) .toArray(); double lowValue = DoubleStream.of(valuesAsDoubles).min().orElse(Double.NEGATIVE_INFINITY); double highValue = DoubleStream.of(valuesAsDoubles).max().orElse(Double.POSITIVE_INFINITY); double valuesCount = values.size(); double nonNullValuesCount = nonNullValues.size(); long distinctValuesCount = nonNullValues.stream().distinct().count(); return SymbolStatsEstimate.builder() .setNullsFraction((valuesCount - nonNullValuesCount) / valuesCount) .setLowValue(lowValue) .setHighValue(highValue) .setDistinctValuesCount(distinctValuesCount) .build(); }
Source:
<code><START> public int hashCode() { <END> int result = Objects.hashCode(summary); result += StringUtils.isEmpty(component) ? Objects.hashCode(description) : Objects.hashCode(component); return result * 31; }</code><technical_language>replace hashcode implementation *Objects.hash(...).*</technical_language>

Target:
public int hashCode() { return Objects.hash(summary, component, description); }
Source:
<code>private void calcStartAngles() { <START> startAngles[0] = firstSectorAngle; <END> for (int i = 1; i < numberOfValues; i++) { startAngles[i] = startAngles[i - 1] + arcLengths[i - 1]; } }</code><technical_language>This great, startAngles empty</technical_language>

Target:
private void calcStartAngles() { mStartAngles[0] = mFirstSectorAngle; for (int i = 1; i < mNumberOfValues; i++) { mStartAngles[i] = mStartAngles[i - 1] + mArcLengths[i - 1]; } }
Source:
<code><START> public void testRemoveAllIdentifiableNode() { <END> for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Node node = storage.createNode(Mods.NAME); node.add(storage.createNode("http://names.example/alice")); Node bob = storage.createNode("http://names.example/bob"); node.add(bob); node.add(storage.createNode("http://names.example/charlie")); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(3)); IdentifiableNode two = storage.createNodeReference(RDF.toURL(2)); assertThat(node.removeAll(two), contains(bob)); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(2)); assertThat(node.removeAll(two), is(nullValue())); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(2)); } }</code><technical_language>testing here</technical_language>

Target:
public void testRemoveAllIdentifiableNode() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Node node = storage.createNode(MODS_NAME); node.add(storage.createNode("http://names.example/alice")); Node bob = storage.createNode("http://names.example/bob"); node.add(bob); node.add(storage.createNode("http://names.example/charlie")); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(3)); IdentifiableNode two = storage.createNodeReference(RDF.toURL(2)); assertThat(node.removeAll(two), contains(bob)); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(2)); assertThat(node.removeAll(two), is(nullValue())); assertThat(node.getEnumerated().stream().mapToInt(r -> r.isAny() ? 1 : 0).sum(), is(2)); } }
Source:
<code>private void enterSettingScreen() { getActivity(); <START> onView(withId(R.id.decor_content_parent)).perform(TestUtils.clickScreenPosition(0, 0)); <END> onView(withText(R.string.settings)).perform(click()); }</code><technical_language>replace screen position click TestUtils.toggleNavigationDrawer()</technical_language>

Target:
private void enterSettingScreen() { getActivity(); TestUtils.toggleNavigationDrawer(); onView(withText(R.string.settings)).perform(click()); }
Source:
<code>public void print() { Iterator<Row> it = collect(); <START> while (it.hasNext()) { <END> Row row = it.next(); System.out.println(row.toString()); } }</code><technical_language>reusing some logic tableau format in SQL CLI, find in CliTableauResultView</technical_language>

Target:
public void print() { Iterator<Row> it = collect(); PrintUtils.printAsTableauForm(getTableSchema(), it, new PrintWriter(System.out)); }
Source:
<code>public Object perform(InvocationContext ctx) throws Throwable { Map<Object, Object> map = createMap(); for (Object key : keys) { CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (trace) { log.tracef("Entry for key %s not found", key); } <START> if (ch == null || ch.isKeyLocalToNode(localAddress, key)) { <END> map.put(key, null); } continue; } if (entry.isNull()) { if (trace) { log.tracef("Entry for key %s is null in current context", key); } map.put(key, null); continue; } if (entry.isRemoved()) { if (trace) { log.tracef("Entry for key %s has been deleted and is of type %s", key, entry.getClass().getSimpleName()); } map.put(key, null); continue; } if (returnEntries) { CacheEntry copy; if (ctx.isOriginLocal()) { copy = entryFactory.copy(entry); } else { copy = entry; } if (trace) { log.tracef("Found entry %s -> %s", key, entry); log.tracef("Returning copied entry %s", copy); } map.put(key, copy); } else { Object value = entry.getValue(); if (trace) { log.tracef("Found %s -> %s", key, toStr(value)); } map.put(key, value); } } return map; }</code><technical_language>distribution interceptor do this check put entry in context calling invokeNext</technical_language>

Target:
public Object perform(InvocationContext ctx) throws Throwable { Map<Object, Object> map = createMap(); for (Object key : keys) { CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (trace) { log.tracef("Entry for key %s not found", key); } continue; } if (entry.isNull()) { if (trace) { log.tracef("Entry for key %s is null in current context", key); } map.put(key, null); continue; } if (entry.isRemoved()) { if (trace) { log.tracef("Entry for key %s has been deleted and is of type %s", key, entry.getClass().getSimpleName()); } map.put(key, null); continue; } if (returnEntries) { CacheEntry copy; if (ctx.isOriginLocal()) { copy = entryFactory.copy(entry); } else { copy = entry; } if (trace) { log.tracef("Found entry %s -> %s", key, entry); log.tracef("Returning copied entry %s", copy); } map.put(key, copy); } else { Object value = entry.getValue(); if (trace) { log.tracef("Found %s -> %s", key, toStr(value)); } map.put(key, value); } } return map; }
Source:
<code>public void doScrape() throws Exception { MBeanServerConnection beanConn; JMXConnector jmxc = null; if (jmxUrl.isEmpty()) { beanConn = ManagementFactory.getPlatformMBeanServer(); } else { Map<String, Object> environment = new HashMap<String, Object>(); if (username != null && username.length() != 0 && password != null && password.length() != 0) { String[] credent = new String[] {username, password}; environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credent); } if (ssl) { environment.put(Context.SECURITY_PROTOCOL, "ssl"); SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory(); environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory); environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory); } jmxc = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), environment); beanConn = jmxc.getMBeanServerConnection(); } try { Set<ObjectInstance> mBeanNames = new HashSet(); for (ObjectName name : whitelistObjectNames) { mBeanNames.addAll(beanConn.queryMBeans(name, null)); } for (ObjectName name : blacklistObjectNames) { mBeanNames.removeAll(beanConn.queryMBeans(name, null)); } for (ObjectInstance name : mBeanNames) { long start = System.nanoTime(); scrapeBean(beanConn, name.getObjectName()); <START> logger.fine("TIME " + (System.nanoTime() - start) + " : " + name.getObjectName().toString()); <END> } } finally { if (jmxc != null) { jmxc.close(); } } }</code><technical_language>put unit in here? read code ns</technical_language>

Target:
public void doScrape() throws Exception { MBeanServerConnection beanConn; JMXConnector jmxc = null; if (jmxUrl.isEmpty()) { beanConn = ManagementFactory.getPlatformMBeanServer(); } else { Map<String, Object> environment = new HashMap<String, Object>(); if (username != null && username.length() != 0 && password != null && password.length() != 0) { String[] credent = new String[] {username, password}; environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credent); } if (ssl) { environment.put(Context.SECURITY_PROTOCOL, "ssl"); SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory(); environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory); environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory); } jmxc = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), environment); beanConn = jmxc.getMBeanServerConnection(); } try { Set<ObjectInstance> mBeanNames = new HashSet(); for (ObjectName name : whitelistObjectNames) { mBeanNames.addAll(beanConn.queryMBeans(name, null)); } for (ObjectName name : blacklistObjectNames) { mBeanNames.removeAll(beanConn.queryMBeans(name, null)); } for (ObjectInstance name : mBeanNames) { long start = System.nanoTime(); scrapeBean(beanConn, name.getObjectName()); logger.fine("TIME: " + (System.nanoTime() - start) + " ns for " + name.getObjectName().toString()); } } finally { if (jmxc != null) { jmxc.close(); } } }
Source:
<code>private static ORidBag readRidbag(BytesContainer bytes) { byte configByte = OByteSerializer.INSTANCE.deserialize(bytes.bytes, bytes.offset++); boolean isEmbedded = (configByte & 1) != 0; UUID uuid = null; ORidBag ridbag = null; if (isEmbedded) { ridbag = new ORidBag(); int size = OVarIntSerializer.readAsInteger(bytes); ridbag.getDelegate().setSize(size); for (int i = 0; i < size; i++) { OIdentifiable record = readLinkOptimizedEmbedded(bytes); if (record == null) { String errorMessage = "Deserialized null object during ridbag deserialization"; <START> OSerializationException exc = new OSerializationException(""); <END> OLogManager.instance().error(ORecordSerializerBinaryV1.class, errorMessage, null); throw exc; } else ((OEmbeddedRidBag) ridbag.getDelegate()).addEntry(record); } } else { long fileId = OVarIntSerializer.readAsLong(bytes); long pageIndex = OVarIntSerializer.readAsLong(bytes); int pageOffset = OVarIntSerializer.readAsInteger(bytes); OVarIntSerializer.readAsInteger(bytes); OBonsaiCollectionPointer pointer = null; if (fileId != -1) pointer = new OBonsaiCollectionPointer(fileId, new OBonsaiBucketPointer(pageIndex, pageOffset)); Map<OIdentifiable, Change> changes = new HashMap<>(); int changesSize = OVarIntSerializer.readAsInteger(bytes); for (int i = 0; i < changesSize; i++) { OIdentifiable recId = readLinkOptimizedSBTree(bytes); Change change = deserializeChange(bytes); changes.put(recId, change); } ridbag = new ORidBag(pointer, changes, uuid); ridbag.getDelegate().setSize(-1); } return ridbag; }</code><technical_language>add correct message</technical_language>

Target:
private static ORidBag readRidbag(BytesContainer bytes) { byte configByte = OByteSerializer.INSTANCE.deserialize(bytes.bytes, bytes.offset++); boolean isEmbedded = (configByte & 1) != 0; UUID uuid = null; ORidBag ridbag = null; if (isEmbedded) { ridbag = new ORidBag(); int size = OVarIntSerializer.readAsInteger(bytes); ridbag.getDelegate().setSize(size); for (int i = 0; i < size; i++) { OIdentifiable record = readLinkOptimizedEmbedded(bytes); ((OEmbeddedRidBag) ridbag.getDelegate()).addEntry(record); } } else { long fileId = OVarIntSerializer.readAsLong(bytes); long pageIndex = OVarIntSerializer.readAsLong(bytes); int pageOffset = OVarIntSerializer.readAsInteger(bytes); OVarIntSerializer.readAsInteger(bytes); OBonsaiCollectionPointer pointer = null; if (fileId != -1) pointer = new OBonsaiCollectionPointer(fileId, new OBonsaiBucketPointer(pageIndex, pageOffset)); Map<OIdentifiable, Change> changes = new HashMap<>(); int changesSize = OVarIntSerializer.readAsInteger(bytes); for (int i = 0; i < changesSize; i++) { OIdentifiable recId = readLinkOptimizedSBTree(bytes); Change change = deserializeChange(bytes); changes.put(recId, change); } ridbag = new ORidBag(pointer, changes, uuid); ridbag.getDelegate().setSize(-1); } return ridbag; }
Source:
<code>private void applyFactorsFilter(final StringBuilder sql, final String variableId, final String variableType, final boolean performLikeOperation) { <START> final String observationUnitClause = VariableType.OBSERVATION_UNIT.name().equals(variableType) ? "nde.observation_unit_no" : null; <END> final String filterClause = factorsFilterMap.get(variableId); final String finalId = variableId.replace("-", ""); final String matchClause = performLikeOperation ? " LIKE :" + finalId + "_text " : " IN (:" + finalId + "_values) "; if (filterClause != null || observationUnitClause != null) { sql.append(" AND ").append(observationUnitClause != null ? observationUnitClause : filterClause).append(matchClause); return; } if (VariableType.GERMPLASM_DESCRIPTOR.name().equals(variableType)) { final String stockMatchClause = performLikeOperation ? "sp.value LIKE :" + variableId + "_text " : " (cvt.name IN (:" + variableId + "_values) OR sp.value IN (:" + variableId + "_values ))"; sql.append(" AND EXISTS ( SELECT 1 FROM stockprop sp " + "LEFT JOIN cvterm cvt ON cvt.cvterm_id = sp.value " + "WHERE sp.stock_id = s.stock_id AND sp.type_id = :" + variableId + "_Id AND ").append(stockMatchClause).append(" )"); } }</code><technical_language>this block is needed. do observation unit, sample in this case @lik-83</technical_language>

Target:
private void applyFactorsFilter(final StringBuilder sql, final String variableId, final String variableType, final boolean performLikeOperation) { final String filterClause = factorsFilterMap.get(variableId); if (filterClause != null) { final String finalId = variableId.replace("-", ""); final String matchClause = performLikeOperation ? " LIKE :" + finalId + "_text " : " IN (:" + finalId + "_values) "; sql.append(" AND ").append(filterClause).append(matchClause); if (variableId.equalsIgnoreCase(String.valueOf(TermId.GID_ACTIVE_LOTS_COUNT.getId())) || variableId.equalsIgnoreCase(String.valueOf(TermId.GID_UNIT.getId()))) sql.append(") "); return; } if (VariableType.GERMPLASM_DESCRIPTOR.name().equals(variableType)) { final String stockMatchClause = performLikeOperation ? "sp.value LIKE :" + variableId + "_text " : " (cvt.name IN (:" + variableId + "_values) OR sp.value IN (:" + variableId + "_values ))"; sql.append(" AND EXISTS ( SELECT 1 FROM stockprop sp " + "LEFT JOIN cvterm cvt ON cvt.cvterm_id = sp.value " + "WHERE sp.stock_id = s.stock_id AND sp.type_id = :" + variableId + "_Id AND ").append(stockMatchClause).append(" )"); } }
Source:
<code>public void shouldReturnAllSavedRules(){ <START> List<SpamRule> expectedList = listOfRandomSpamRules(10); <END> persistObjects(expectedList); List<SpamRule> actualList = dao.getAllRules(); assertReflectionEquals(expectedList, actualList); }</code><technical_language>be: List<SpamRule> expectedList = persistObjects(listOfRandomSpamRules(10));</technical_language>

Target:
public void shouldReturnAllSavedRules() { List<SpamRule> expectedList = persistObjects(listOfRandomSpamRules(10)); List<SpamRule> actualList = dao.getAllRules(); assertEquals(actualList.size(), expectedList.size()); for (SpamRule expected : expectedList) { assertTrue(actualList.contains(expected)); } }
Source:
<code>private GenContext serializeArguments(List<FormalArg> args, GenContext ctx) { if(isGeneric()) { ValueType type = this.genericStructuralType(); args.add(new FormalArg(GENERIC_PREFACE, type)); <START> ctx = ctx.extend(GENERIC_PREFACE, new Variable(GENERIC_PREFACE), type); <END> } for (NameBinding b : argNames) { String bName = b.getName(); Type t = b.getType(); ValueType type = null; if( isGeneric() && t instanceof UnresolvedType && ((UnresolvedType) t).getName().equals(this.genTypeName) ) { type = new NominalType(new Variable(GENERIC_PREFACE), GENERIC_MEMBER); } else { type = t.getILType(ctx); } FormalArg fa = new FormalArg(bName, type); args.add(fa); ctx = ctx.extend(bName, new Variable(bName), type); } return ctx; }</code><technical_language>instead, use: ctx = new TypeGenContext(genTypeName, GENERIC_PREFACE, ctx); This automatically translate references genTypeName a type GENERIC_PREFACE.genTypeName</technical_language>

Target:
private GenContext serializeArguments(List<FormalArg> args, GenContext ctx) { if(isGeneric()) { for(String s : this.generics) { ValueType type = this.genericStructuralType(s); String genName = GENERIC_PREFIX + s; args.add(new FormalArg(genName, type)); ctx = new TypeGenContext(s, genName, ctx); ctx = ctx.extend(genName, new Variable(genName), type); } } for (NameBinding b : argNames) { String bName = b.getName(); Type t = b.getType(); ValueType type = t.getILType(ctx); FormalArg fa = new FormalArg(bName, type); args.add(fa); ctx = ctx.extend(bName, new Variable(bName), type); } return ctx; }
Source:
<code>ByteBuffer encrypt(ByteBuffer toEncrypt, T key) throws GeneralSecurityException; default ByteBuf encrypt(ByteBuf toEncrypt, T key) throws GeneralSecurityException { ByteBuffer encrypted = encrypt(toEncrypt.nioBuffer(), key); <START> ByteBuf result = ByteBufAllocator.DEFAULT.ioBuffer(encrypted.remaining()); <END> result.writeBytes(encrypted); return result; }</code><technical_language>Unpooled.wrappedBuffer in this case instead of copying</technical_language>

Target:
ByteBuffer encrypt(ByteBuffer toEncrypt, T key) throws GeneralSecurityException; default ByteBuf encrypt(ByteBuf toEncrypt, T key) throws GeneralSecurityException { ByteBuffer encrypted = encrypt(toEncrypt.nioBuffer(), key); return Unpooled.wrappedBuffer(encrypted); }
Source:
<code>public MetaData getMetaData(final MetaDataKey key) throws SomeException { DefaultMetaDataBuilder builder = new DefaultMetaDataBuilder(); <START> return new DefaultMetaData(builder.build()); <END> }</code><technical_language>this work? is import for builder DefaultMetaData</technical_language>

Target:
public MetaData getMetaData(final MetaDataKey key) throws SomeException { DefaultMetaDataBuilder builder = new DefaultMetaDataBuilder(); return null; }
Source:
<code>private boolean validateNetworkAttachmentsFromRequest(List<? extends BusinessEntity<?>> newOrUpdateBusinessEntities) { SeparateNewAndModifiedInstances instances = new SeparateNewAndModifiedInstances(newOrUpdateBusinessEntities); List<String> validationMessages = new ArrayList<>(); validationMessages.addAll(callValidationOnAllItems(instances.getNewEntities(), CreateEntity.class, Default.class)); validationMessages.addAll(callValidationOnAllItems(instances.getUpdatedEntities(), UpdateEntity.class, Default.class)); getReturnValue().getCanDoActionMessages().addAll(validationMessages); <START> return validationMessages.isEmpty(); <END> }</code><technical_language>just: return getReturnValue().getCanDoActionMessages().addAll(validationMessages);</technical_language>

Target:
private boolean validateNetworkAttachmentsFromRequest(List<? extends BusinessEntity<?>> newOrUpdateBusinessEntities) { SeparateNewAndModifiedInstances instances = new SeparateNewAndModifiedInstances(newOrUpdateBusinessEntities); List<String> validationMessages = new ArrayList<>(); validationMessages.addAll(callValidationOnAllItems(instances.getNewEntities(), CreateEntity.class, Default.class)); validationMessages.addAll(callValidationOnAllItems(instances.getUpdatedEntities(), UpdateEntity.class, Default.class)); return !getReturnValue().getCanDoActionMessages().addAll(validationMessages); }
Source:
<code>private ExpressionResult executeExpressions(final Expression expression, final Class<? extends Annotation> annotationClass, Expression.EvaluationMode mode) { ExpressionResult result = expression.evaluate(mode); if (log.isTraceEnabled()) { String checkKey = expression.toString(); Long checkOccurrences = checkStats.getOrDefault(checkKey, 0L) + 1; checkStats.put(checkKey, checkOccurrences); } if (result == DEFERRED) { if (mode == Expression.EvaluationMode.USER_CHECKS_ONLY) { return DEFERRED; } if (isInlineOnlyCheck(annotationClass)) { result = expression.evaluate(Expression.EvaluationMode.ALL_CHECKS); if (result == FAIL) { ForbiddenAccessException e = new ForbiddenAccessException( <START> getSimpleName(annotationClass), <END> expression, Expression.EvaluationMode.ALL_CHECKS); if (log.isTraceEnabled()) { log.trace("{}", e.getLoggedMessage()); } throw e; } } else { commitCheckQueue.add(new QueuedCheck(expression, annotationClass)); } return DEFERRED; } if (result == FAIL) { ForbiddenAccessException e = new ForbiddenAccessException(getSimpleName(annotationClass), expression, mode); if (log.isTraceEnabled()) { log.trace("{}", e.getLoggedMessage()); } throw e; } return result; }</code><technical_language>a static import here, fully qualified method is more clear</technical_language>

Target:
private ExpressionResult executeExpressions(final Expression expression, final Class<? extends Annotation> annotationClass, Expression.EvaluationMode mode) { ExpressionResult result = expression.evaluate(mode); if (log.isTraceEnabled()) { String checkKey = expression.toString(); Long checkOccurrences = checkStats.getOrDefault(checkKey, 0L) + 1; checkStats.put(checkKey, checkOccurrences); } if (result == DEFERRED) { if (mode == Expression.EvaluationMode.USER_CHECKS_ONLY) { return DEFERRED; } if (isInlineOnlyCheck(annotationClass)) { result = expression.evaluate(Expression.EvaluationMode.ALL_CHECKS); if (result == FAIL) { ForbiddenAccessException e = new ForbiddenAccessException( EntityDictionary.getSimpleName(annotationClass), expression, Expression.EvaluationMode.ALL_CHECKS); if (log.isTraceEnabled()) { log.trace("{}", e.getLoggedMessage()); } throw e; } } else { commitCheckQueue.add(new QueuedCheck(expression, annotationClass)); } return DEFERRED; } if (result == FAIL) { ForbiddenAccessException e = new ForbiddenAccessException( EntityDictionary.getSimpleName(annotationClass), expression, mode); if (log.isTraceEnabled()) { log.trace("{}", e.getLoggedMessage()); } throw e; } return result; }
Source:
<code>protected void internalProcessHttpErrorResponse(HttpWebRequest httpWebResponse, Exception webException, TraceFlags responseHeadersTraceFlag, TraceFlags responseTraceFlag) throws Exception { EwsUtilities.EwsAssert(500 != httpWebResponse.getResponseCode(), "ExchangeServiceBase.InternalProcessHttpErrorResponse", "InternalProcessHttpErrorResponse does not handle 500 ISE errors, the caller is supposed to handle this."); this.processHttpResponseHeaders(responseHeadersTraceFlag, httpWebResponse); if (httpWebResponse.getResponseCode() == 456) { String location = httpWebResponse.getResponseContentType(); URI accountUnlockUrl = null; if (checkURIPath(location)) { accountUnlockUrl = new URI(location); } this.traceMessage(responseTraceFlag, <START> String.format("Account is locked. Unlock URL is %s", accountUnlockUrl)); <END> throw new AccountIsLockedException(String.format(Strings.AccountIsLocked, accountUnlockUrl), accountUnlockUrl, webException); } }</code><technical_language>string concatenation too</technical_language>

Target:
protected void internalProcessHttpErrorResponse(HttpWebRequest httpWebResponse, Exception webException, TraceFlags responseHeadersTraceFlag, TraceFlags responseTraceFlag) throws Exception { EwsUtilities.EwsAssert(500 != httpWebResponse.getResponseCode(), "ExchangeServiceBase.InternalProcessHttpErrorResponse", "InternalProcessHttpErrorResponse does not handle 500 ISE errors, the caller is supposed to handle this."); this.processHttpResponseHeaders(responseHeadersTraceFlag, httpWebResponse); if (httpWebResponse.getResponseCode() == 456) { String location = httpWebResponse.getResponseContentType(); URI accountUnlockUrl = null; if (checkURIPath(location)) { accountUnlockUrl = new URI(location); } final String message = String.format(Strings.AccountIsLocked, accountUnlockUrl); this.traceMessage(responseTraceFlag, message); throw new AccountIsLockedException(message, accountUnlockUrl, webException); } }
Source:
<code>private void addPlugins(CucumberOptions options, List<String> args) { List<String> plugins = new ArrayList<String>(); plugins.addAll(asList(options.plugin())); for (String plugin : plugins) { args.add("--plugin"); args.add(plugin); if (PluginFactory.isPluginName(plugin)) { <START> pluginSpecified = true; <END> } } }</code><technical_language>Okay. null formatter is (replaced formatter), this test changed check if formatter is instead</technical_language>

Target:
private void addPlugins(CucumberOptions options, List<String> args) { List<String> plugins = new ArrayList<>(); plugins.addAll(asList(options.plugin())); for (String plugin : plugins) { args.add("--plugin"); args.add(plugin); } }
Source:
<code>private static void appendUserFiles(PythonEnvironment env, List<Path> userFileList) throws IOException { List<String> pythonPathList = new ArrayList<>(); Path tmpDirPath = new Path(env.tempDirectory); for (Path pythonFile : userFileList) { String sourceFileName = pythonFile.getName(); Path targetPath = new Path( tmpDirPath, String.join(File.separator, UUID.randomUUID().toString(), sourceFileName)); try { if (!pythonFile.getFileSystem().isDistributedFS()) { if (!pythonFile.getFileSystem().exists(pythonFile)) { LOG.error(pythonFile + " not exists, skipping..."); continue; } new File(targetPath.getParent().toString()).mkdir(); createSymbolicLinkForPyflinkLib( Paths.get(new File(pythonFile.getPath()).getAbsolutePath()), Paths.get(targetPath.toString())); } else { FileUtils.copy(pythonFile, targetPath, true); } } catch (Exception e) { <START> LOG.error("Error occured when copying user python files, skipping...", e); <END> continue; } if (Files.isRegularFile(Paths.get(targetPath.toString()).toRealPath()) && sourceFileName.endsWith(".py")) { pythonPathList.add(targetPath.getParent().toString()); } else { pythonPathList.add(targetPath.toString()); } } if (env.pythonPath != null && !env.pythonPath.isEmpty()) { pythonPathList.add(env.pythonPath); } env.pythonPath = String.join(File.pathSeparator, pythonPathList); }</code><technical_language>throw out exception in this case</technical_language>

Target:
private static void appendUserFiles(PythonEnvironment env, List<Path> userFileList) throws IOException { List<String> pythonPathList = new ArrayList<>(); Path tmpDirPath = new Path(env.tempDirectory); for (Path pythonFile : userFileList) { String sourceFileName = pythonFile.getName(); Path targetPath = new Path( tmpDirPath, String.join(File.separator, UUID.randomUUID().toString(), sourceFileName)); if (!pythonFile.getFileSystem().isDistributedFS()) { new File(targetPath.getParent().toString()).mkdir(); createSymbolicLinkForPyflinkLib( Paths.get(new File(pythonFile.getPath()).getAbsolutePath()), Paths.get(targetPath.toString())); } else { try { FileUtils.copy(pythonFile, targetPath, true); } catch (Exception e) { LOG.error("Error occured when copying user python files from DFS, skipping...", e); continue; } } if (Files.isRegularFile(Paths.get(targetPath.toString()).toRealPath()) && sourceFileName.endsWith(".py")) { pythonPathList.add(targetPath.getParent().toString()); } else { pythonPathList.add(targetPath.toString()); } } if (env.pythonPath != null && !env.pythonPath.isEmpty()) { pythonPathList.add(env.pythonPath); } env.pythonPath = String.join(File.pathSeparator, pythonPathList); }
Source:
<code>private static boolean isSerdeSupported(Properties schema) { String serdeName = getDeserializerClassName(schema); <START> if (!SUPPORTED_SERDES.contains(serdeName)) { <END> return false; } return true; }</code><technical_language>return SUPPORTED_SERDES.contains(serdeName);</technical_language>

Target:
private static boolean isSerdeSupported(Properties schema) { String serdeName = getDeserializerClassName(schema); return SUPPORTED_SERDES.contains(serdeName); }
Source:
<code>public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); ElasticsearchTableDescription table = tableDescriptions.get(new SchemaTableName(schemaName, tableName)); if (table == null) { return null; } if (table.getColumns().isPresent()) { return table; } List<ElasticsearchColumn> columns = buildColumns(table); ElasticsearchTableDescription result = new ElasticsearchTableDescription( table.getTableName(), table.getSchemaName(), table.getHost(), table.getPort(), table.getClusterName(), table.getIndex(), table.getIndexExactMatch(), table.getType(), Optional.of(columns)); <START> return result; <END> }</code><technical_language>Redundant local variable, return new ElasticsearchTableDescription(...)</technical_language>

Target:
public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); ElasticsearchTableDescription table = tableDescriptions.get(new SchemaTableName(schemaName, tableName)); if (table == null) { return null; } if (table.getColumns().isPresent()) { return table; } return new ElasticsearchTableDescription( table.getTableName(), table.getSchemaName(), table.getHost(), table.getPort(), table.getClusterName(), table.getIndex(), table.getIndexExactMatch(), table.getType(), Optional.of(buildColumns(table))); }
Source:
<code>public String getLabel() { <START> return String.format("Replace Bundle's Execution Environment with %s", this.fRequiredEE); END> }</code><technical_language>Please do so</technical_language>

Target:
public String getLabel() { return NLS.bind(Messages.ReplaceExecEnvironment_Marker_Label, this.fRequiredEE); }
Source:
<code>synchronized Long startTick(Span span) { <START> return span.startTick; <END> }</code><technical_language>this synchronizing span this</technical_language>

Target:
Long startTick(Span span) { synchronized (span) { return span.startTick; } }
Source:
<code>public static boolean isUnix() { <START> return (OperatingSystem.indexOf("nix") >= 0 || OperatingSystem.indexOf("nux") >= 0 || OperatingSystem.indexOf("aix") > 0 ); <END> }</code><technical_language>.. this line is loooooooooong</technical_language>

Target:
public static boolean isUnix() { return (Os.indexOf("nix") >= 0 || Os.indexOf("nux") >= 0 || Os.indexOf("aix") > 0 ); }
Source:
<code>private void writeResult(String testName, String resultXml) throws IOException { String finalPath = getXmlFileName(testName); <START> Writer fw = null; <END> try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(finalPath), StandardCharsets.UTF_8.displayName())); fw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); fw.write(resultXml); } finally { if (fw != null) { fw.close(); } } }</code><technical_language>'try-with-resources'</technical_language>

Target:
private void writeResult(String testName, String resultXml) throws IOException { String finalPath = getXmlFileName(testName); try (Writer fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(finalPath), StandardCharsets.UTF_8))) { fw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); fw.write(resultXml); } }
Source:
<code>public void convertsToJsonWhenContextAbsent() { <START> final String pending = "Kragle is drying..."; <END> MatcherAssert.assertThat( new Statuses.StatusCreate(Status.State.PENDING) .withTargetUrl(Optional.of(URL)) .withDescription(pending) .json().toString(), Matchers.equalTo("{\"state\":\"pending\",\"description\":\"Kragle is drying...\",\"target_url\":\"<LINK_0>\"}") ); }</code><technical_language>@cvrebert too, pass withDescription</technical_language>

Target:
public void convertsToJsonWhenContextAbsent() { final String pending = "Kragle is drying..."; MatcherAssert.assertThat( new Statuses.StatusCreate(Status.State.PENDING) .withTargetUrl(Optional.of(StatusesTest.URL)) .withDescription(pending) .json().toString(), Matchers.equalTo( Json.createObjectBuilder() .add(StatusesTest.STATE_PROP, "pending") .add(StatusesTest.DESCRIPTION_PROP, pending) .add(StatusesTest.TARGET_PROP, StatusesTest.URL) .build().toString() ) ); }
Source:
<code>private static String extractToken(CloseableHttpResponse response) throws OAuthException, IOException { int responseCode = response.getStatusLine().getStatusCode(); BufferedReader reader = new BufferedReader(new InputStreamReader(response <START> .getEntity().getContent(), StandardCharsets.UTF_8)); <END> String inputLine; StringBuilder stringBuilder = new StringBuilder(); while ((inputLine = reader.readLine()) != null) { stringBuilder.append(inputLine); } if (log.isDebugEnabled()) { log.debug("Response: [status-code] " + responseCode + " [message] " + stringBuilder.toString()); } if (!(responseCode == HttpStatus.SC_OK)) { throw new OAuthException("Error while accessing the Token URL. " + response.getStatusLine()); } JsonParser parser = new JsonParser(); JsonObject jsonResponse = (JsonObject) parser.parse(stringBuilder.toString()); if (jsonResponse.has(OAuthConstants.ACCESS_TOKEN)) { return jsonResponse.get(OAuthConstants.ACCESS_TOKEN).getAsString(); } throw new OAuthException("Missing key [access_token] in the response from the OAuth server"); }</code><technical_language>default UTF-8 If content-type header mention charset</technical_language>

Target:
private static String extractToken(CloseableHttpResponse response) throws OAuthException, IOException { int responseCode = response.getStatusLine().getStatusCode(); HttpEntity entity = response.getEntity(); Charset charset = ContentType.getOrDefault(entity).getCharset(); if (charset == null) { charset = StandardCharsets.UTF_8; } BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent(), charset)); String inputLine; StringBuilder stringBuilder = new StringBuilder(); while ((inputLine = reader.readLine()) != null) { stringBuilder.append(inputLine); } if (log.isDebugEnabled()) { log.debug("Response: [status-code] " + responseCode + " [message] " + stringBuilder.toString()); } if (responseCode != HttpStatus.SC_OK) { throw new OAuthException("Error while accessing the Token URL. " + response.getStatusLine()); } JsonParser parser = new JsonParser(); JsonObject jsonResponse = (JsonObject) parser.parse(stringBuilder.toString()); if (jsonResponse.has(OAuthConstants.ACCESS_TOKEN)) { return jsonResponse.get(OAuthConstants.ACCESS_TOKEN).getAsString(); } throw new OAuthException("Missing key [access_token] in the response from the OAuth server"); }
Source:
<code>public BlockFluix() { super( BlockFluix.class, Material.iron ); <START> setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); <END> }</code><technical_language>more fitting quartz, apparently native sound of quartz is soundTypePiston</technical_language>

Target:
public BlockFluix() { super( BlockFluix.class, Material.rock ); setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); }
Source:
<code>private static void cleanCppCache(IProject project) { IPath projectSpecificWorkDir = project.getWorkingLocation(SonarLintCorePlugin.PLUGIN_ID); Path cppCacheDir = projectSpecificWorkDir.toFile().toPath().resolve("cfamily").resolve("pph"); <START> if (Files.exists(cppCacheDir)) { <END> SonarLintCorePlugin.getDefault().debug("Deleting cache: " + cppCacheDir.toString()); FileUtils.deleteDirectory(cppCacheDir); } }</code><technical_language>![MAJOR](<LINK_1> Replace this a call "toFile().exists" method [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void cleanCppCache(IProject project) { IPath projectSpecificWorkDir = project.getWorkingLocation(SonarLintCorePlugin.PLUGIN_ID); Path cppCacheDir = projectSpecificWorkDir.toFile().toPath().resolve("cfamily").resolve("pph"); if (Files.exists(cppCacheDir)) { core.debug("Deleting cache: " + cppCacheDir.toString()); FileUtils.deleteDirectory(cppCacheDir); } }
Source:
<code>public void testLookup() { <START> scripts.addScript("", "utils"); <END> scripts.addScript("", "jquery"); scripts.addScript("", "diff"); scripts.addScript("", "jquery-tablesorter"); assertEquals(4, scripts.size()); scripts.sort(); int prev = -1; for (Script s : scripts) { if (prev > s.getPriority()) { fail("The scripts must be sorted in ascending order by the priority, " + prev + " > " + s.getPriority()); } prev = s.getPriority(); } for (Entry<String, Script> s : Scripts.SCRIPTS.entrySet()) { if (!s.getKey().equals("utils") && !s.getKey().equals("jquery") && !s.getKey().equals("jquery-tablesorter") && !s.getKey().equals("diff")) { continue; } assertTrue(scripts.toHtml() + " must contain <script type=\"text/javascript\"" + " src=\"" + s.getValue().getScript() + "\"" + " data-priority=\"" + s.getValue().getPriority() + "\"></script>", scripts.toHtml() .contains("<script type=\"text/javascript\"" + " src=\"" + s.getValue().getScript() + "\"" + " data-priority=\"" + s.getValue().getPriority() + "\"></script>")); } }</code><technical_language>test benefit non-empty context path</technical_language>

Target:
public void testLookup() { scripts.addScript("", "utils"); scripts.addScript("", "jquery"); scripts.addScript("", "diff"); scripts.addScript("", "jquery-tablesorter"); assertEquals(4, scripts.size()); int prev = -1; for (Script s : scripts) { if (prev > s.getPriority()) { fail("The scripts must be sorted in ascending order by the priority, " + prev + " > " + s.getPriority()); } prev = s.getPriority(); } for (Entry<String, Script> s : Scripts.SCRIPTS.entrySet()) { if (!s.getKey().equals("utils") && !s.getKey().equals("jquery") && !s.getKey().equals("jquery-tablesorter") && !s.getKey().equals("diff")) { continue; } assertTrue(scripts.toHtml() + " must contain <script type=\"text/javascript\"" + " src=\"" + s.getValue().getScriptData() + "\"" + " data-priority=\"" + s.getValue().getPriority() + "\"></script>", scripts.toHtml() .contains("<script type=\"text/javascript\"" + " src=\"" + s.getValue().getScriptData() + "\"" + " data-priority=\"" + s.getValue().getPriority() + "\"></script>")); } }
Source:
<code>public void handleGet(RestRequest restRequest, RestResponseChannel restResponseChannel) { adminMetrics.getOperationRate.mark(); handlePrechecks(restRequest, restResponseChannel); <START> AsyncRequestResponseHandler responseHandler = requestResponseHandlerController.getHandler(); <END> try { logger.trace("Handling GET request - {}", restRequest.getUri()); String operationOrBlobId = getOperationOrBlobIdFromUri(restRequest); logger.trace("GET operation requested - {}", operationOrBlobId); AdminOperationType operationType = AdminOperationType.getAdminOperationType(operationOrBlobId); ReadableStreamChannel response; switch (operationType) { case echo: response = EchoHandler.handleGetRequest(restRequest, restResponseChannel, adminMetrics); submitResponse(restRequest, restResponseChannel, responseHandler, response, null); break; case getReplicasForBlobId: response = GetReplicasForBlobIdHandler.handleGetRequest(restRequest, restResponseChannel, clusterMap, adminMetrics); submitResponse(restRequest, restResponseChannel, responseHandler, response, null); break; default: HeadForGetCallback callback = new HeadForGetCallback(restRequest, restResponseChannel, responseHandler, router, cacheValidityInSecs); router.getBlobInfo(operationOrBlobId, callback); } } catch (Exception e) { submitResponse(restRequest, restResponseChannel, responseHandler, null, e); } }</code><technical_language>requestResponseHandler. in other methods well. (post, deletes...)</technical_language>

Target:
public void handleGet(RestRequest restRequest, RestResponseChannel restResponseChannel) { adminMetrics.getOperationRate.mark(); handlePrechecks(restRequest, restResponseChannel); AsyncRequestResponseHandler responseHandler = requestResponseHandlerController.getHandler(); try { logger.trace("Handling GET request - {}", restRequest.getUri()); String operationOrBlobId = getOperationOrBlobIdFromUri(restRequest); logger.trace("GET operation/blob ID requested - {}", operationOrBlobId); ReadableStreamChannel response; if (adminOperations.contains(operationOrBlobId)) { if (operationOrBlobId.equals(ECHO)) { response = EchoHandler.handleGetRequest(restRequest, restResponseChannel, adminMetrics); submitResponse(restRequest, restResponseChannel, responseHandler, response, null); } else if (operationOrBlobId.equals(GET_REPLICAS_FOR_BLOB_ID)) { response = GetReplicasForBlobIdHandler.handleGetRequest(restRequest, restResponseChannel, clusterMap, adminMetrics); submitResponse(restRequest, restResponseChannel, responseHandler, response, null); } else { RestServiceException exception = new RestServiceException("No handler available for valid admin operation - " + operationOrBlobId, RestServiceErrorCode.ServiceUnavailable); submitResponse(restRequest, restResponseChannel, responseHandler, null, exception); } } else { HeadForGetCallback callback = new HeadForGetCallback(restRequest, restResponseChannel, responseHandler, router, cacheValidityInSecs); router.getBlobInfo(operationOrBlobId, callback); } } catch (Exception e) { submitResponse(restRequest, restResponseChannel, responseHandler, null, e); } }