auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void post(Object entity, InputStream stdin, ResultCallback<Frame> resultCallback) { Request request = requestBuilder .post(RequestBody.create(MediaType.parse("application/json"), objectMapper.writeValueAsBytes(entity))) .build(); OkHttpClient okHttpClient = this.okHttpClient; if (stdin != null) { okHttpClient = okHttpClient.newBuilder() <START> .hostnameVerifier(new HostnameVerifier() { <END> @Override public boolean verify(String hostname, SSLSession session) { return true; } }) .addNetworkInterceptor(chain -> { Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { Thread thread = new Thread() { @Override @SneakyThrows public void run() { Field sinkField = RealConnection.class.getDeclaredField("sink"); sinkField.setAccessible(true); try ( BufferedSink sink = (BufferedSink) sinkField.get(chain.connection()); Source source = Okio.source(stdin); ) { sink.writeAll(source); } } }; thread.start(); } return response; }) .build(); } executeAndStream( okHttpClient, request, resultCallback, new FramedSink(resultCallback) ); }</code><technical_language>okHttpClient.newBuilder inherit parent's hostnameVerifier</technical_language>

Target:
public void post(Object entity, InputStream stdin, ResultCallback<Frame> resultCallback) { Request request = requestBuilder .post(RequestBody.create(MediaType.parse("application/json"), objectMapper.writeValueAsBytes(entity))) .build(); OkHttpClient okHttpClient = this.okHttpClient; if (stdin != null) { okHttpClient = okHttpClient.newBuilder() .hostnameVerifier((hostname, sslSession) -> true) .addNetworkInterceptor(chain -> { Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { Thread thread = new Thread() { @Override @SneakyThrows public void run() { Field sinkField = RealConnection.class.getDeclaredField("sink"); sinkField.setAccessible(true); try ( BufferedSink sink = (BufferedSink) sinkField.get(chain.connection()); Source source = Okio.source(stdin); ) { sink.writeAll(source); } } }; thread.start(); } return response; }) .build(); } executeAndStream( okHttpClient, request, resultCallback, new FramedSink(resultCallback) ); }
Source:
<code>public void deleteReferencedBlobs(String referencingEntity, String referenceDesignator, @Nullable String excludedBlobKey) { if (Strings.isEmpty(referencingEntity)) { return; } if (Strings.isEmpty(referenceDesignator)) { return; } <START> SmartQuery<SQLBlob> qry = oma.select(SQLBlob.class) <END> .eq(SQLBlob.SPACE_NAME, spaceName) .eq(SQLBlob.REFERENCE, referencingEntity) .eq(SQLBlob.REFERENCE_DESIGNATOR, referenceDesignator); if (Strings.isFilled(excludedBlobKey)) { qry.ne(SQLBlob.BLOB_KEY, excludedBlobKey); } qry.delete(); }</code><technical_language>suggestion SmartQuery<SQLBlob> query = oma.select(SQLBlob.class)</technical_language>

Target:
public void deleteReferencedBlobs(String referencingEntity, String referenceDesignator, @Nullable String excludedBlobKey) { if (Strings.isEmpty(referencingEntity)) { return; } if (Strings.isEmpty(referenceDesignator)) { return; } SmartQuery<SQLBlob> query = oma.select(SQLBlob.class) .eq(SQLBlob.SPACE_NAME, spaceName) .eq(SQLBlob.REFERENCE, referencingEntity) .eq(SQLBlob.REFERENCE_DESIGNATOR, referenceDesignator); if (Strings.isFilled(excludedBlobKey)) { query.ne(SQLBlob.BLOB_KEY, excludedBlobKey); } query.delete(); }
Source:
<code><START> private String getSources() <END> { if ( parsedSources == null ) { parsedSources = project.getBuild().getSourceDirectory(); } return parsedSources; }</code><technical_language>this work nicely. I this significant project if works</technical_language>

Target:
private String getSources() { if ( parsedSources == null ) { parsedSources = new File( project.getBuild().getSourceDirectory() ).getAbsolutePath(); } return parsedSources; }
Source:
<code>public SearchEventRest createSearchEvent() throws AuthorizeException, SQLException { Context context = obtainContext(); HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); <START> List<SearchFilter> result = new LinkedList<>(); <END> ObjectMapper mapper = new ObjectMapper(); SearchEventRest searchEventRest = null; try { ServletInputStream input = req.getInputStream(); searchEventRest = mapper.readValue(input, SearchEventRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body", e1); } checkSearchEventRestValidity(searchEventRest); RestUsageSearchEvent restUsageSearchEvent = searchEventConverter.convert(context, req, searchEventRest); eventService.fireEvent(restUsageSearchEvent); return searchEventRest; }</code><technical_language>Unused</technical_language>

Target:
public SearchEventRest createSearchEvent() { Context context = obtainContext(); HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); SearchEventRest searchEventRest = null; try { ServletInputStream input = req.getInputStream(); searchEventRest = mapper.readValue(input, SearchEventRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body", e1); } checkSearchEventRestValidity(searchEventRest); UsageSearchEvent usageSearchEvent = searchEventConverter.convert(context, req, searchEventRest); eventService.fireEvent(usageSearchEvent); return searchEventRest; }
Source:
<code>public void run() { try { this.acceptKey = acceptSocket.register(selector, SelectionKey.OP_ACCEPT); while (!stopped && !acceptSocket.socket().isClosed()) { try { select(); } catch (RuntimeException e) { LOG.warn("Ignoring unexpected runtime exception", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception", e); } } } catch (IOException e) { <START> LOG.error("Exception when running accept thread. Unable to register selector?", e); <END> } finally { closeSelector(); if (!reconfiguring) { NIOServerCnxnFactory.this.stop(); } LOG.info("accept thread exitted run method"); } }</code><technical_language>abort server</technical_language>

Target:
public void run() { try { while (!stopped && !acceptSocket.socket().isClosed()) { try { select(); } catch (RuntimeException e) { LOG.warn("Ignoring unexpected runtime exception", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception", e); } } } finally { closeSelector(); if (!reconfiguring) { NIOServerCnxnFactory.this.stop(); } LOG.info("accept thread exitted run method"); } }
Source:
<code>WebDriver create(final Proxy proxy) { <START> System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "/dev/null"); <END> return createFirefoxDriver(proxy); }</code><technical_language>System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "/dev/null"))</technical_language>

Target:
WebDriver create(final Proxy proxy) { String logFilePath = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "/dev/null"); System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, logFilePath); return createFirefoxDriver(proxy); }
Source:
<code>protected Response invokeGet(String docsUri) { <START> logger.info("[GET] " + docsUri); <END> WebTarget clientRequest = httpClient.target(docsUri); return clientRequest.request().get(); }</code><technical_language>please change log level debug</technical_language>

Target:
protected Response invokeGet(String docsUri) { logger.debug("[GET] " + docsUri); WebTarget clientRequest = httpClient.target(docsUri); return clientRequest.request().get(); }
Source:
<code><START> public MutationException(Row mutation, Throwable throwable) { <END> this.mutation = mutation; this.throwable = throwable; }</code><technical_language>odd a public constructor, other access it. access getters instead of access private fields</technical_language>

Target:
private MutationException(Row mutation, Throwable throwable) { this.mutation = mutation; this.throwable = throwable; }
Source:
<code>private void addNewGroup(long groupId, Block block, int position, long count) { <START> checkState(isEmpty(), "bucket %s not empty, points to %s", bucketId, buckets.get(bucketId)); <END> int nextValuePosition = valueStore.getPosition(type, block, position, valueOnlyRawHash); valuePositions.set(nodePointerToUse, nextValuePosition); valueRawHashList.set(nodePointerToUse, valueRawHash); buckets.set(bucketId, nodePointerToUse); counts.set(nodePointerToUse, count); groupIds.set(nodePointerToUse, groupId); int currentHead = (int) headPointers.get(groupId); headPointers.set(groupId, nodePointerToUse); nextPointers.set(nodePointerToUse, currentHead); }</code><technical_language>I a class for this buys anything. (possibly static) methods of enclosing class</technical_language>

Target:
private void addNewGroup(long groupId, Block block, int position, long count) { checkState(isEmpty(), "bucket %s not empty, points to %s", bucketId, buckets.get(bucketId)); int nextValuePosition = valueStore.addAndGetPosition(type, block, position, valueHash); valuePositions.set(nodePointerToUse, nextValuePosition); valueAndGroupHashes.set(nodePointerToUse, valueAndGroupHash); buckets.set(bucketId, nodePointerToUse); counts.set(nodePointerToUse, count); groupIds.set(nodePointerToUse, groupId); int currentHead = (int) headPointers.get(groupId); headPointers.set(groupId, nodePointerToUse); nextPointers.set(nodePointerToUse, currentHead); }
Source:
<code>public static List<Pair<SizeUnit, Double>> getMathOperationSafeOperands(Pair<SizeUnit, Double>... operands) { List<Pair<SizeUnit, Double>> operatoinReadyOperands = new ArrayList<>(); SizeUnit finalUnit = leastUnitInList(operands); for(Pair<SizeUnit, Double> operand : operands) { if(operand.getFirst() != finalUnit) { operand.setSecond(convert(operand.getSecond().longValue(), operand.getFirst(), finalUnit).doubleValue()); <START> operand.setFirst(finalUnit); <END> } } return operatoinReadyOperands; }</code><technical_language>return a new list instead of modifying passed values directly</technical_language>

Target:
public static List<Pair<SizeUnit, Double>> getMathOperationSafeOperands(Pair<SizeUnit, Double>... operands) { List<Pair<SizeUnit, Double>> operationReadyOperands = new ArrayList<>(); List<Pair<SizeUnit, Double>> convertedOperands = new ArrayList<>(); for (Pair<SizeUnit, Double> operand : operands) { convertedOperands.add(autoConvert(operand.getSecond().longValue(), operand.getFirst())); } SizeUnit finalUnit = leastUnitInList(convertedOperands); for (Pair<SizeUnit, Double> operand : convertedOperands) { if(operand.getFirst() != finalUnit) { operationReadyOperands.add(new Pair<SizeConverter.SizeUnit, Double>(finalUnit, convert(operand.getSecond().longValue(), operand.getFirst(), finalUnit).doubleValue())); } else { operationReadyOperands.add(operand); } } return operationReadyOperands; }
Source:
<code>public Callable<ProbeResult> createRequest() { return () -> { try { ConnectionPoolMonitor pool = context.getConnectionPoolMonitor(); List<String> infoList = Lists.newArrayList(); <START> infoList.add("Socket timeouts: " + Long.toString(pool.getSocketTimeoutCount())); <END> infoList.add("Transport errors: " + Long.toString(pool.getTransportErrorCount())); infoList.add("Pool-exhausted timeouts: " + Long.toString(pool.getPoolExhaustedTimeoutCount())); infoList.add("Connections opened: " + Long.toString(pool.getConnectionCreatedCount())); infoList.add("Connections closed: " + Long.toString(pool.getConnectionClosedCount())); infoList.add("Active hosts: " + Long.toString(pool.getHostActiveCount())); if (isUnhealthy(pool)) { return ProbeResult.unhealthy(identifier, Strings.join(infoList, ", ")); } return ProbeResult.healthy(identifier); } catch (Exception e) { return ProbeResult.unhealthy(identifier, e); } }; }</code><technical_language>need preserve this info. health checks mixed health metric responsibilities</technical_language>

Target:
public Callable<ProbeResult> createRequest() { return () -> { try { ConnectionPoolMonitor pool = context.getConnectionPoolMonitor(); if (pool.getHostActiveCount() <= 0) { return ProbeResult.unhealthy(identifier, "No active hosts"); } return ProbeResult.healthy(identifier); } catch (Exception e) { return ProbeResult.unhealthy(identifier, e); } }; }
Source:
<code>private void enqueueExceptionalPaths(ProgramState ps, SymbolicValue.ExceptionalSymbolicValue exceptionSV) { Set<CFG.Block> exceptionBlocks = node.programPoint.block.exceptions(); List<CFG.Block> catchBlocks = exceptionBlocks.stream().filter(CFG.Block.IS_CATCH_BLOCK).collect(Collectors.toList()); Optional<CFG.Block> firstMatchingCatchBlock = catchBlocks.stream() .filter(b -> isValidCatchBlock(b, exceptionSV.exceptionType())) .sorted((b1, b2) -> Integer.compare(b2.id(), b1.id())) .findFirst(); if (firstMatchingCatchBlock.isPresent()) { enqueue(new ExplodedGraph.ProgramPoint(firstMatchingCatchBlock.get(), 0), ps); return; } catchBlocks.stream() .filter(ExplodedGraphWalker::isCatchingUncheckedException) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), ps)); exceptionBlocks.stream() .filter(CFG.Block.IS_CATCH_BLOCK.negate()) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), ps, true)); ProgramState newPs = ps.clearStack().stackValue(exceptionSV); <START> newPs.storeExitValue(); <END> node.programPoint.block.successors().stream() .filter(CFG.Block::isMethodExitBlock) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), newPs, true)); }</code><technical_language>This handle properly case a return in finally (and a return in finally in fact)</technical_language>

Target:
private void enqueueExceptionalPaths(ProgramState ps, SymbolicValue.ExceptionalSymbolicValue exceptionSV) { Set<CFG.Block> exceptionBlocks = node.programPoint.block.exceptions(); List<CFG.Block> catchBlocks = exceptionBlocks.stream().filter(CFG.Block.IS_CATCH_BLOCK).collect(Collectors.toList()); Optional<CFG.Block> firstMatchingCatchBlock = catchBlocks.stream() .filter(b -> isCaughtByBlock(exceptionSV.exceptionType(), b)) .sorted((b1, b2) -> Integer.compare(b2.id(), b1.id())) .findFirst(); if (firstMatchingCatchBlock.isPresent()) { enqueue(new ExplodedGraph.ProgramPoint(firstMatchingCatchBlock.get(), 0), ps); return; } catchBlocks.stream() .filter(ExplodedGraphWalker::isCatchingUncheckedException) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), ps)); ProgramState newPs = ps.clearStack().stackValue(exceptionSV); newPs.storeExitValue(); exceptionBlocks.stream() .filter(CFG.Block.IS_CATCH_BLOCK.negate()) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), newPs, true)); node.programPoint.block.successors().stream() .filter(CFG.Block::isMethodExitBlock) .forEach(b -> enqueue(new ExplodedGraph.ProgramPoint(b, 0), newPs, true)); }
Source:
<code>private ChargeStatus determineTerminalState(GatewayResponse<BaseCancelResponse> cancelResponse, StatusFlow statusFlow) { if (!cancelResponse.isSuccessful() && !cancelResponse.getBaseResponse().isPresent()) { return statusFlow.getFailureTerminalState(); } switch (cancelResponse.getBaseResponse().get().cancelStatus()) { case CANCELLED: return statusFlow.getSuccessTerminalState(); case SUBMITTED: return statusFlow.getSubmittedState(); } <START> return statusFlow.getFailureTerminalState(); <END> }</code><technical_language>Simply awesome, Alex</technical_language>

Target:
private ChargeStatus determineTerminalState(GatewayResponse<BaseCancelResponse> cancelResponse, StatusFlow statusFlow) { return cancelResponse.getBaseResponse().map(response -> { switch (response.cancelStatus()) { case CANCELLED: return statusFlow.getSuccessTerminalState(); case SUBMITTED: return statusFlow.getSubmittedState(); default: return statusFlow.getFailureTerminalState(); } }).orElse(statusFlow.getFailureTerminalState()); }
Source:
<code>public void shouldEditAnAutoGenerationOptionByAnyNumberOFArguments() throws Exception { assertTrue( <START> identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); <END> assertTrue(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertFalse( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertFalse(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); }</code><technical_language>do need call Integer.parseInt(getUuid()) more in a method</technical_language>

Target:
public void shouldEditAnAutoGenerationOptionByAnyNumberOFArguments() throws Exception { AutoGenerationOption autogenerationOption = identifierSourceService.getAutoGenerationOption(getId()); assertTrue(autogenerationOption.isAutomaticGenerationEnabled()); assertTrue(autogenerationOption.isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); AutoGenerationOption updatedAutogenerationOption = identifierSourceService.getAutoGenerationOption(getId()); assertFalse(updatedAutogenerationOption.isAutomaticGenerationEnabled()); assertFalse(updatedAutogenerationOption.isManualEntryEnabled()); }
Source:
<code>private static void storeGroups(String groupFilePath, Multimap<String, String> groups) throws ManageUsersException { try { try (PrintWriter writer = new PrintWriter(new FileWriter(groupFilePath))) { for (Map.Entry<String, String> userEntry : groups.entries()) { writer.println(userEntry.getKey() + ":" + userEntry.getValue()); } } } catch (IOException e) { exitWithErrorMessage("could not write group file : " + groupFilePath, null, e); } <START> System.out.println("Stored group file in " + groupFilePath); <END> }</code><technical_language>![MAJOR](<LINK_1> Replace this usage of System.out System.err a logger. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private static void storeGroups(String groupFilePath, Multimap<String, String> groups) throws ManageUsersException { try { try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(groupFilePath)))) { for (Map.Entry<String, String> userEntry : groups.entries()) { writer.println(userEntry.getKey() + ":" + userEntry.getValue()); } } } catch (IOException e) { exitWithErrorMessage("could not write group file : " + groupFilePath, null, e); } System.out.println("Stored group file in " + groupFilePath); }
Source:
<code>public void statusRedundancyWithExcludeRegionArgumentReturnsStatusForAllExceptThatRegion() { createAndPopulateRegions(); String command = new CommandStringBuilder(COMMAND_NAME) .addOption(EXCLUDE_REGION, ZERO_COPIES_REGION) .getCommandString(); CommandResultAssert commandResult = gfsh.executeAndAssertThat(command); commandResult.statusIsSuccess() .hasNoSection(ZERO_REDUNDANCY_SECTION) .doesNotContainOutput(ZERO_COPIES_REGION); verifySummarySection(commandResult, 0, 1, 2); <START> InfoResultModelAssert underRedundancy = commandResult.hasInfoSection(UNDER_REDUNDANCY_SECTION); underRedundancy.hasHeader().isEqualTo(REDUNDANCY_NOT_SATISFIED_FOR_REGIONS); underRedundancy.hasOutput().contains(UNSATISFIED_REGION); InfoResultModelAssert satisfiedRedundancy = commandResult.hasInfoSection(SATISFIED_REDUNDANCY_SECTION); satisfiedRedundancy.hasHeader().isEqualTo(REDUNDANCY_SATISFIED_FOR_REGIONS); satisfiedRedundancy.hasOutput().contains(SATISFIED_REGION, NO_CONFIGURED_REDUNDANCY_REGION); <END> }</code><technical_language>This code block is duplicated test, extracted a separate method</technical_language>

Target:
public void statusRedundancyWithExcludeRegionArgumentReturnsStatusForAllExceptThatRegion() { createAndPopulateRegions(); String excludedRegion = ZERO_COPIES_REGION; String command = new CommandStringBuilder(STATUS_REDUNDANCY) .addOption(REDUNDANCY_EXCLUDE_REGION, excludedRegion) .getCommandString(); CommandResultAssert commandResult = gfsh.executeAndAssertThat(command).statusIsSuccess() .doesNotContainOutput(excludedRegion); List<String> satisfiedRegions = Arrays.asList(SATISFIED_REGION, NO_CONFIGURED_REDUNDANCY_REGION); verifyGfshOutput(commandResult, new ArrayList<>(), Collections.singletonList(UNSATISFIED_REGION), satisfiedRegions); }
Source:
<code>private static String readMapping() { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); try (InputStream inputStream = classloader.getResourceAsStream("mapping.json")) { String mapping = IOUtils.toString(inputStream, "UTF-8"); <START> JsonObject jsonObject = Json.createReader(new StringReader(mapping)).readObject(); <END> return jsonObject.toString(); } catch (IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return ""; } }</code><technical_language>here. JsonReader is closeable a try-with-resources statement for closing object is a good idea</technical_language>

Target:
private static String readMapping() { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); try (InputStream inputStream = classloader.getResourceAsStream("mapping.json")) { String mapping = IOUtils.toString(inputStream, "UTF-8"); try (JsonReader jsonReader = Json.createReader(new StringReader(mapping))) { JsonObject jsonObject = jsonReader.readObject(); return jsonObject.toString(); } } catch (IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return ""; } }
Source:
<code>private Composite createFillComp(Composite parent) { Composite comp = createComposite(parent); <START> comp.setLayout(GridLayoutFactory.fillDefaults().create()); <END> Label l = createLabel(comp, longText); l.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).create()); return comp; }</code><technical_language>applyTo() create()</technical_language>

Target:
private Composite createFillComp(Composite parent) { Composite comp = createComposite(parent); GridLayoutFactory.fillDefaults().applyTo(comp); Label l = createLabel(comp, longText); GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(l); return comp; }
Source:
<code>public void create() { super.create(); Shell shell = getShell(); shell.addShellListener(fActivationListener); <START> PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, "org.eclipse.tracecompass.tmf.ui.widgets.timegraph.dialogs.find_dialog"); <END> fFindField.removeModifyListener(fFindModifyListener); updateCombo(fFindField, fFindHistory); fFindField.addModifyListener(fFindModifyListener); initFindStringFromSelection(); if (fDialogPositionInit != null) { shell.setBounds(fDialogPositionInit); } shell.setText("Find"); }</code><technical_language>In Trace Compass implemented context-sensitive help. remove this line. implement bring back</technical_language>

Target:
public void create() { super.create(); Shell shell = getShell(); shell.addShellListener(fActivationListener); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, "org.eclipse.tracecompass.tmf.ui.widgets.timegraph.dialogs.find_dialog"); fFindField.removeModifyListener(fFindModifyListener); updateCombo(fFindField, fFindHistory); fFindField.addModifyListener(fFindModifyListener); initFindStringFromSelection(); if (fDialogPositionInit != null) { shell.setBounds(fDialogPositionInit); } shell.setText(Messages.TimeGraphFindDialog_Find_title); }
Source:
<code>public SubTabHostBiosView(DetailModelProvider<HostListModel, HostBiosModel> modelProvider, ApplicationResources resources, ApplicationConstants constants) { super(modelProvider); this.resources = resources; formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Driver.driver.initialize(this); formBuilder = new FormBuilder(formPanel, 3, 6); formBuilder.setColumnsWidth("230px", "120px", "270px"); ArrayList<FormItem> formItems = new ArrayList<FormItem>(); <START> formItems.add(new FormItem(constants.biosManufacturerGeneral(), biosManufacturer, 0, 0)); <END> formItems.add(new FormItem(constants.biosProductNameGeneral(), biosProductName, 1, 0)); formItems.add(new FormItem(constants.biosUUIDGeneral(), biosUUID, 2, 0)); formItems.add(new FormItem(constants.biosVersionGeneral(), biosVersion, 3, 0)); formItems.add(new FormItem(constants.biosSerialNumberGeneral(), biosSerialNumber, 4, 0)); formItems.add(new FormItem(constants.biosFamilyGeneral(), biosFamily, 5, 0)); for (FormItem formItem : formItems) { formBuilder.addFormItem(formItem); } }</code><technical_language>need for 'formItems' variable - simply call 'formBuilder.addFormItem' new FormItem</technical_language>

Target:
public SubTabHostBiosView(DetailModelProvider<HostListModel, HostBiosModel> modelProvider, ApplicationResources resources, ApplicationConstants constants) { super(modelProvider); this.resources = resources; formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Driver.driver.initialize(this); formBuilder = new FormBuilder(formPanel, 3, 6); formBuilder.setColumnsWidth("230px", "120px", "270px"); formBuilder.addFormItem(new FormItem(constants.biosManufacturerGeneral(), biosManufacturer, 0, 0)); formBuilder.addFormItem(new FormItem(constants.biosProductNameGeneral(), biosProductName, 1, 0)); formBuilder.addFormItem(new FormItem(constants.biosUUIDGeneral(), biosUUID, 2, 0)); formBuilder.addFormItem(new FormItem(constants.biosVersionGeneral(), biosVersion, 3, 0)); formBuilder.addFormItem(new FormItem(constants.biosSerialNumberGeneral(), biosSerialNumber, 4, 0)); formBuilder.addFormItem(new FormItem(constants.biosFamilyGeneral(), biosFamily, 5, 0)); }
Source:
<code>protected void handleMessageInternal(Message<?> message) throws Exception { MessageValues messageToSend = (this.supportsSerializationNatively) ? new MessageValues(message) : serializePayloadIfNecessary(message); <START> this.delegate.handleMessage(embedHeadersIfApplicable(messageToSend)); <END> }</code><technical_language>embed headers if encoding natively</technical_language>

Target:
protected void handleMessageInternal(Message<?> message) throws Exception { Message<?> messageToSend = (this.useNativeEncoding) ? getMessageBuilderFactory().withPayload(message.getPayload()) .copyHeaders(message.getHeaders()).build() : serializeAndEmbedHeadersIfApplicable(message); this.delegate.handleMessage(messageToSend); }
Source:
<code>public DataTransactionResult set(DataHolder dataHolder, SneakingData manipulator, MergeFunction function) { if (dataHolder instanceof Entity) { final ImmutableValue<Boolean> newValue = manipulator.sneaking().asImmutable(); final SneakingData old = from(dataHolder).get(); final ImmutableValue<Boolean> oldValue = old.asImmutable().sneaking(); final SneakingData newData = checkNotNull(function, "function").merge(old, manipulator); final boolean sneaking = newData.sneaking().get(); try { ((Entity) dataHolder).setSneaking(sneaking); <START> return DataTransactionBuilder.successReplaceResult(newValue, oldValue); <END> } catch (Exception e) { DataTransactionBuilder.errorResult(newValue); } } return DataTransactionBuilder.failResult(manipulator.getValues()); }</code><technical_language>This needs merged new value, new manipulator</technical_language>

Target:
public DataTransactionResult set(DataHolder dataHolder, SneakingData manipulator, MergeFunction function) { if (dataHolder instanceof Entity) { final ImmutableValue<Boolean> newValue = manipulator.sneaking().asImmutable(); final SneakingData oldData = from(dataHolder).get(); final ImmutableValue<Boolean> oldValue = oldData.sneaking().asImmutable(); final SneakingData mergedData = checkNotNull(function, "function").merge(oldData, manipulator); final ImmutableValue<Boolean> mergedValue = mergedData.sneaking().asImmutable(); final boolean sneaking = mergedData.sneaking().get(); try { ((Entity) dataHolder).setSneaking(sneaking); return DataTransactionBuilder.successReplaceResult(mergedValue, oldValue); } catch (Exception e) { DataTransactionBuilder.errorResult(newValue); } } return DataTransactionBuilder.failResult(manipulator.getValues()); }
Source:
<code>public void run() { int TARGET = 42; while (continueBusyLoop) { inBusyLoop = true; } Instant osrDeadline = Instant.now().plusSeconds(expectOsr ? 600 : 3); do { inBusyLoop = true; } while (hasJit() && !Main.isInOsrCode("run") && osrDeadline.compareTo(Instant.now()) > 0); if (hasJit()) { boolean inOsr = Main.isInOsrCode("run"); if (allowJit) { inOsr = inOsr || <START> !Main.isInterpreted(); <END> } if (expectOsr && !inOsr) { throw new Error( "Expected to be in OSR but was not. interpreter: " + Main.isInterpreted()); } else if (!expectOsr && inOsr) { throw new Error( "Expected not to be in OSR but was. interpreter: " + Main.isInterpreted()); } } reportValue(TARGET); }</code><technical_language>I prefer ensure entry JITed (Main.isInterpreted invariant in beginning). Nicolas, do good infrastructure do that</technical_language>

Target:
public void run() { int TARGET = 42; if (hasJit() && expectOsr && !Main.isInterpreted()) { System.out.println("Unexpectedly in jit code prior to restarting the JIT!"); } startJit(); while (continueBusyLoop) { inBusyLoop = true; } Instant osrDeadline = Instant.now().plusSeconds(expectOsr ? 600 : 3); do { inBusyLoop = true; } while (hasJit() && !Main.isInOsrCode("run") && osrDeadline.compareTo(Instant.now()) > 0); if (hasJit()) { boolean inOsr = Main.isInOsrCode("run"); if (expectOsr && !inOsr) { throw new Error( "Expected to be in OSR but was not. interpreter: " + Main.isInterpreted()); } else if (!expectOsr && inOsr) { throw new Error( "Expected not to be in OSR but was. interpreter: " + Main.isInterpreted()); } } reportValue(TARGET); }
Source:
<code>private ObjectId insertMergeResult(TemporaryBuffer buf, Attributes attributes) throws IOException { InputStream in = buf.openInputStream(); try (LfsInputStream is = LFS.getInstance().getCleanFiltered( getRepository(), in, buf.length(), attributes.get(Constants.ATTR_MERGE))) { return getObjectInserter().insert(OBJ_BLOB, <START> is.length, is.stream); <END> } }</code><technical_language>getLength()</technical_language>

Target:
private ObjectId insertMergeResult(TemporaryBuffer buf, Attributes attributes) throws IOException { InputStream in = buf.openInputStream(); try (LfsInputStream is = LfsFactory.getInstance().applyCleanFilter( getRepository(), in, buf.length(), attributes.get(Constants.ATTR_MERGE))) { return getObjectInserter().insert(OBJ_BLOB, is.getLength(), is); } }
Source:
<code>public void ensureMCWUsesRealTail() throws Exception { Map<String, String> map = getDefaultRuntime().getObjectsView().build() .setTypeToken(new TypeToken<SMRMap<String, String>>() { }) .setStreamName("test") .open(); final int initMapSize = 10; for (int x = 0; x < initMapSize; x++) { map.put(String.valueOf(x), String.valueOf(x)); } for (int x = 0; x < initMapSize; x++) { getDefaultRuntime().getSequencerView().next(); } MultiCheckpointWriter mcw = new MultiCheckpointWriter(); mcw.addMap(map); Token trimAddress = mcw.appendCheckpoints(getRuntime(), "author"); Token staleTrimAddress = new Token(trimAddress.getEpoch() - 1, trimAddress.getSequence()); <START> getRuntime().getAddressSpaceView().prefixTrim(staleTrimAddress); <END> }</code><technical_language>check LogUnitServer TRIM_MARK_REQUEST correct/expected trim mark address</technical_language>

Target:
public void ensureMCWUsesRealTail() throws Exception { Map<String, String> map = getDefaultRuntime().getObjectsView().build() .setTypeToken(new TypeToken<SMRMap<String, String>>() { }) .setStreamName("test") .open(); final int initMapSize = 10; for (int x = 0; x < initMapSize; x++) { map.put(String.valueOf(x), String.valueOf(x)); } for (int x = 0; x < initMapSize; x++) { getDefaultRuntime().getSequencerView().next(); } MultiCheckpointWriter mcw = new MultiCheckpointWriter(); mcw.addMap(map); Token trimAddress = mcw.appendCheckpoints(getRuntime(), "author"); Token staleTrimAddress = new Token(trimAddress.getEpoch() - 1, trimAddress.getSequence()); getRuntime().getAddressSpaceView().prefixTrim(staleTrimAddress); Token expectedTrimMark = new Token(getRuntime().getLayoutView().getLayout().getEpoch(), staleTrimAddress.getSequence() + 1); assertThat(getRuntime().getAddressSpaceView().getTrimMark()) .isEqualByComparingTo(expectedTrimMark); }
Source:
<code>public void splitUuidConstructor_Test() { final RequestConstructor constructor = new RequestConstructor(SIMPLE_PARAMS, SIMPLE_ARGS, argsToQueryParams(SIMPLE_ARGS), ImmutableList.of(), ""); final ImmutableList<RequestConstructor> result = splitUuidConstructor(constructor); assertThat(result.size(), is(2)); <START> assertTrue(result.get(0).getParameters().stream() <END> .anyMatch(param -> param.getType().equals("UUID"))); assertThat(getQueryParamTypes(result.get(0).getQueryParams()), hasItem("UUID")); assertThat(getAllArgumentTypes(result.get(0).getAssignments()), hasItem("UUID")); result.get(1).getParameters().forEach(param -> assertThat(param.getType(), not("UUID"))); assertThat(getQueryParamTypes(result.get(1).getQueryParams()), not(hasItem("UUID"))); assertThat(getAllArgumentTypes(result.get(1).getAssignments()), not(hasItem("UUID"))); }</code><technical_language>Consider AssertJ for kinds of asserts, other asserts (but do later.)</technical_language>

Target:
public void splitUuidConstructor_Test() { final RequestConstructor constructor = new RequestConstructor(SIMPLE_PARAMS, SIMPLE_ARGS, argsToQueryParams(SIMPLE_ARGS), ImmutableList.of(), ""); final ImmutableList<RequestConstructor> result = splitUuidConstructor(constructor); assertThat(result).hasSize(2); assertThat(result.get(0).getParameters()).extracting(ConstructorParam::getType).contains("UUID"); assertThat(result.get(0).getQueryParams()).extracting(QueryParam::getType).contains("UUID"); assertThat(result.get(0).getAssignments()).extracting(Arguments::getType).contains("UUID"); assertThat(result.get(1).getParameters()).extracting(ConstructorParam::getType).doesNotContain("UUID"); assertThat(result.get(1).getQueryParams()).extracting(QueryParam::getType).doesNotContain("UUID"); assertThat(result.get(1).getAssignments()).extracting(Arguments::getType).doesNotContain("UUID"); }
Source:
<code>public BiMap<@Nullable String, Integer> getMap() { <START> return fMap; <END> }</code><technical_language>Do expose internal structure directly. is ImmutableBiMap, that</technical_language>

Target:
public BiMap<String, Integer> getMap() { return ImmutableBiMap.copyOf(fMap); }
Source:
<code>public void init(Map<String, Serializable> args) throws Exception { if (args.containsKey("sftpHostname")) { sftpHostname = args.get("sftpHostname").toString(); } if (args.containsKey("sftpPort")) { sftpPort = Integer.parseInt(args.get("sftpPort").toString()); } if (args.containsKey("sftpMode")) { sftpMode = args.get("sftpMode").toString(); } if (args.containsKey("sftpExtractArchive")) { sftpExtractArchive = Boolean.parseBoolean(args.get("sftpExtractArchive").toString()); } if (args.containsKey(SFTP_LOCAL_RELATIVE_PATH_ARG) && !args.get(SFTP_LOCAL_RELATIVE_PATH_ARG).toString().isEmpty()) { sftpLocalRelativePath = args.get(SFTP_LOCAL_RELATIVE_PATH_ARG).toString(); } else { if (sftpMode.equals("PUT")) { throw new IllegalArgumentException("you have to specify the local relative path. empty value is not allowed."); } sftpLocalRelativePath = getLocalSpace(); } if (args.containsKey("sftpRemoteRelativePath")) { sftpRemoteRelativePath = args.get("sftpRemoteRelativePath").toString(); } sftpUsername = getThirdPartyCredential("SFTP_USERNAME"); <START> sftpPassword = getThirdPartyCredential("SFTP_PASSWORD"); <END> if (sftpUsername == null || sftpPassword == null) { throw new IllegalArgumentException("you first need to add your ftp username and password (SFTP_USERNAME, SFTP_PASSWORD) to the third party credentials"); } }</code><technical_language>sorry, I meant: key: username@sftp://sftpHostname:sftpPort</technical_language>

Target:
public void init(Map<String, Serializable> args) throws Exception { if (args.containsKey("sftpHostname")) { sftpHostname = args.get("sftpHostname").toString(); } if (args.containsKey("sftpPort")) { try { sftpPort = Integer.parseInt(args.get("sftpPort").toString()); } catch (NumberFormatException e) { getOut().println("Invalid port number. Using default sftp port=" + DEFAULT_SFTP_PORT); } } if (args.containsKey("sftpMode")) { sftpMode = args.get("sftpMode").toString(); } if (args.containsKey("sftpExtractArchive")) { sftpExtractArchive = Boolean.parseBoolean(args.get("sftpExtractArchive").toString()); } if (args.containsKey(SFTP_LOCAL_RELATIVE_PATH_ARG) && !args.get(SFTP_LOCAL_RELATIVE_PATH_ARG).toString().isEmpty()) { sftpLocalAbsolutePath = Paths.get(getLocalSpace(), args.get(SFTP_LOCAL_RELATIVE_PATH_ARG).toString()) .toString(); } else { if (sftpMode.equals(PUT)) { throw new IllegalArgumentException("Please specify a local relative path. Empty value is not allowed."); } sftpLocalAbsolutePath = getLocalSpace(); } if (args.containsKey("sftpRemoteRelativePath")) { sftpRemoteRelativePath = args.get("sftpRemoteRelativePath").toString(); } if (args.containsKey("sftpUsername")) { sftpUsername = args.get("sftpUsername").toString(); } if (sftpUsername == null) { throw new IllegalArgumentException("Username is required to access an SFTP server"); } sftpUrlKey = "sftp://" + sftpUsername + "@" + sftpHostname; sftpPassword = getThirdPartyCredential(sftpUrlKey); if (sftpPassword == null) { throw new IllegalArgumentException("Please add your sftp password to 3rd-party credentials under the key :\"" + SFTP_URL_KEY + "\""); } }
Source:
<code>public DmsProject getParentStudyByDataset(Integer datasetId) throws MiddlewareQueryException { try { Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.createAlias("relatedTos", "pr"); criteria.add(Restrictions.eq("pr.typeId", TermId.BELONGS_TO_STUDY.getId())); criteria.add(Restrictions.eq("pr.subjectProject.projectId", datasetId)); criteria.setProjection(Projections.property("pr.objectProject")); return (DmsProject) criteria.uniqueResult(); <START> <END> } catch (HibernateException e) { this.logAndThrowException("Error in getParentStudyByDataset= " + datasetId + " query in DmsProjectDao: " + e.getMessage(), e); } return null; }</code><technical_language>Cleanup: Remove **throws MiddlewareQueryException** clauses</technical_language>

Target:
public DmsProject getParentStudyByDataset(Integer datasetId) { try { Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.createAlias("relatedTos", "pr"); criteria.add(Restrictions.eq("pr.typeId", TermId.BELONGS_TO_STUDY.getId())); criteria.add(Restrictions.eq("pr.subjectProject.projectId", datasetId)); criteria.setProjection(Projections.property("pr.objectProject")); return (DmsProject) criteria.uniqueResult(); } catch (HibernateException e) { this.logAndThrowException("Error in getParentStudyByDataset= " + datasetId + " query in DmsProjectDao: " + e.getMessage(), e); } return null; }
Source:
<code>public void unregisterService(ServiceDescription description) { for (JmDNS instance : jmdnsInstances) { <START> logger.debug("Unregistering service at port (instance {})", description.serviceType, <END> description.servicePort, instance.getName()); ServiceInfo serviceInfo = ServiceInfo.create(description.serviceType, description.serviceName, description.servicePort, 0, 0, description.serviceProperties); instance.unregisterService(serviceInfo); } }</code><technical_language>suggest change this logger.debug("Unregistering service {}:{} ({})", description.serviceType, instance.getInetAddress().getHostAddress(), description.servicePort, instance.getName());</technical_language>

Target:
public void unregisterService(ServiceDescription description) { for (JmDNS instance : jmdnsInstances) { try { logger.debug("Unregistering service at {}:{} ({})", description.serviceType, instance.getInetAddress().getHostAddress(), description.servicePort, instance.getName()); } catch (IOException e) { logger.debug("Unregistering service ({})", description.serviceType, instance.getName()); } ServiceInfo serviceInfo = ServiceInfo.create(description.serviceType, description.serviceName, description.servicePort, 0, 0, description.serviceProperties); instance.unregisterService(serviceInfo); } }
Source:
<code>public void testSecondaryRequestsPropagatedToChildren() throws InterruptedException { Observable<Integer> o1 = Observable.from(Arrays.asList(1, 2, 3)) .delay(100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation()); Observable<Integer> o2 = Observable.from(Arrays.asList(4, 5, 6)) .delay(200, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation()); TestSubscriber<Integer> ts = new TestSubscriber<Integer>(); <START> ts.requestMore(1); <END> Observable.amb(o1, o2).subscribe(ts); ts.requestMore(20); ts.awaitTerminalEvent(5, TimeUnit.SECONDS); ts.assertNoErrors(); }</code><technical_language>if this is a valid case. Actually, I request called subscribe</technical_language>

Target:
public void testSecondaryRequestsPropagatedToChildren() throws InterruptedException { Observable<Integer> o1 = Observable.from(Arrays.asList(1, 2, 3)) .delay(100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation()); Observable<Integer> o2 = Observable.from(Arrays.asList(4, 5, 6)) .delay(200, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation()); TestSubscriber<Integer> ts = new TestSubscriber<Integer>() { @Override public void onStart() { request(1); }}; Observable.amb(o1, o2).subscribe(ts); ts.requestMore(20); ts.awaitTerminalEvent(5, TimeUnit.SECONDS); ts.assertNoErrors(); }
Source:
<code>public Map<String, String> getBinaryFulltext(Serializable id) { if (fulltextDescriptor.getFulltextDisabled()) { return null; } RowId rowId = new RowId(Model.FULLTEXT_TABLE_NAME, id); Map<String, String> map = mapper.getBinaryFulltext(rowId); <START> if (fulltextDescriptor.getFulltextStoredInBlob()) { String key = map.get("binarytext"); if (key != null) { <END> DocumentBlobManager blobManager = Framework.getService(DocumentBlobManager.class); try { BlobInfo blobInfo = new BlobInfo(); blobInfo.key = key; Blob blob = blobManager.readBlob(blobInfo, getRepositoryName()); String fulltext = blob.getString(); map.put("binarytext", fulltext); } catch (IOException e) { throw new PropertyException("Cannot read fulltext blob for doc: " + id, e); } } } return map; }</code><technical_language>suggestion String key = map.get("binarytext"); if (fulltextDescriptor.getFulltextStoredInBlob() && key != null) {</technical_language>

Target:
public Map<String, String> getBinaryFulltext(Serializable id) { if (fulltextDescriptor.getFulltextDisabled()) { return null; } RowId rowId = new RowId(Model.FULLTEXT_TABLE_NAME, id); Map<String, String> map = mapper.getBinaryFulltext(rowId); String fulltext = map.get(BINARY_FULLTEXT_MAIN_KEY); if (fulltextDescriptor.getFulltextStoredInBlob() && fulltext != null) { DocumentBlobManager blobManager = Framework.getService(DocumentBlobManager.class); try { BlobInfo blobInfo = new BlobInfo(); blobInfo.key = fulltext; Blob blob = blobManager.readBlob(blobInfo, getRepositoryName()); fulltext = blob.getString(); map.put(BINARY_FULLTEXT_MAIN_KEY, fulltext); } catch (IOException e) { throw new PropertyException("Cannot read fulltext blob for doc: " + id, e); } } return map; }
Source:
<code><START> public boolean useBindVariables() { <END> return true; }</code><technical_language>visibility remain package-private</technical_language>

Target:
boolean useBindVariables() { return true; }
Source:
<code>public void tableNotAccessibleDoesNotError() throws Exception { <START> when(client.describe_keyspace("system_palantir")) <END> .thenReturn(new KsDef("system_palantir", "", ImmutableList.of())); DummyClientPool clientPool = new DummyClientPool(client); Supplier<Map<String, String>> hostnamesByIpSupplier = new HostnamesByIpSupplier(() -> clientPool); assertThatCode(hostnamesByIpSupplier::get).doesNotThrowAnyException(); assertThat(hostnamesByIpSupplier.get()).isEmpty(); }</code><technical_language>extract method</technical_language>

Target:
public void tableNotAccessibleDoesNotError() throws Exception { when(client.describe_keyspace("system_palantir")) .thenReturn(new KsDef("system_palantir", "", ImmutableList.of())); assertThatCode(hostnamesByIpSupplier::get).doesNotThrowAnyException(); assertThat(hostnamesByIpSupplier.get()).isEmpty(); }
Source:
<code>public void removeLock(String taskid, TaskLock taskLockToRemove) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(taskLockToRemove, "taskLockToRemove"); final Map<Long, TaskLock> taskLocks = getLocksWithIds(taskid); boolean removed = false; for (final Map.Entry<Long, TaskLock> taskLockWithId : taskLocks.entrySet()) { final long id = taskLockWithId.getKey(); final TaskLock taskLock = taskLockWithId.getValue(); if (taskLock.equals(taskLockToRemove)) { log.info("Deleting TaskLock with id[%d]: %s", id, taskLock); handler.removeLock(id); removed = true; } } if (!removed) { <START> log.error("Did not found any TaskLock [%s] to remove", taskLockToRemove); <END> } }</code><technical_language>> find</technical_language>

Target:
public void removeLock(String taskid, TaskLock taskLockToRemove) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(taskLockToRemove, "taskLockToRemove"); final Map<Long, TaskLock> taskLocks = getLocksWithIds(taskid); boolean removed = false; for (final Map.Entry<Long, TaskLock> taskLockWithId : taskLocks.entrySet()) { final long id = taskLockWithId.getKey(); final TaskLock taskLock = taskLockWithId.getValue(); if (taskLock.equals(taskLockToRemove)) { log.info("Deleting TaskLock with id[%d]: %s", id, taskLock); handler.removeLock(id); removed = true; } } if (!removed) { log.error("Did not find any TaskLock [%s] to remove", taskLockToRemove); } }
Source:
<code>public int length() throws IOException { <START> final ByteArrayOutputStream baos = new ByteArrayOutputStream(); <END> this.print(baos); return baos.size(); }</code><technical_language>@fabriciofx cactoo's LengthOf(Input) calculations for</technical_language>

Target:
public int length() throws IOException { return this.asString().length(); }