auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String convertListToString(ModelNode modelNode) { <START> StringBuffer sb = new StringBuffer(); <END> String[] ss = strip(modelNode.asString().trim(), '[', ']').split(","); boolean first = true; for (String s : ss) { if (first) { first = false; } else { sb.append(","); } sb.append(strip(s.trim(), '"', '"')); } return sb.toString(); }</code><technical_language>StringBuffer is a bit 90s (all methods synchronized), StringBuilder instead</technical_language>

Target:
private String convertListToString(ModelNode modelNode) { StringBuilder sb = new StringBuilder(); boolean first = true; for (ModelNode value : modelNode.asList()) { if (first) { first = false; } else { sb.append(","); } sb.append(value.asString()); } return sb.toString(); }
Source:
<code>private void handleCVSException(CVSException ex) { IStatus status = ex.getStatus(); List toShow = new ArrayList(); IStatus children[] = status.getChildren(); boolean may = true; for (int i = 0; i < children.length; i++) { if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER || children[i].getCode() == CVSStatus.PROTOCOL_ERROR || children[i].getCode() == CVSStatus.ERROR_LINE) { toShow.add(children[i]); if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER) may = false; } } if (toShow.size() > 0) { String msg = may ? CVSUIMessages.DiffOperation_ThePatchMayNotContainAllTheChanges : CVSUIMessages.DiffOperation_ThePatchDoesNotContainAllTheChanges; StatusAdapter adapter = new StatusAdapter( new MultiStatus( CVSProviderPlugin.ID, CVSStatus.SERVER_ERROR, <START> (IStatus[]) toShow.toArray(new IStatus[0]), <END> CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch, null)); adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg); StatusManager.getManager().handle(adapter, StatusManager.SHOW | StatusManager.NONE); } }</code><technical_language>array passed param size/length of toShow.size()</technical_language>

Target:
private void handleCVSException(CVSException ex) { IStatus status = ex.getStatus(); List toShow = new ArrayList(); IStatus children[] = status.getChildren(); boolean may = true; for (int i = 0; i < children.length; i++) { if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER || children[i].getCode() == CVSStatus.PROTOCOL_ERROR || children[i].getCode() == CVSStatus.ERROR_LINE) { toShow.add(children[i]); if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER) may = false; } } if (toShow.size() > 0) { String msg = may ? CVSUIMessages.DiffOperation_ThePatchMayNotContainAllTheChanges : CVSUIMessages.DiffOperation_ThePatchDoesNotContainAllTheChanges; StatusAdapter adapter = new StatusAdapter( new MultiStatus( CVSProviderPlugin.ID, CVSStatus.SERVER_ERROR, (IStatus[]) toShow.toArray(new IStatus[toShow.size()]), CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch, null)); adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg); StatusManager.getManager().handle(adapter, StatusManager.SHOW | StatusManager.NONE); } }
Source:
<code>public Blob call(Blob blob, String targetExt, String commandName) { CommandLineExecutorService cles = Framework.getService(CommandLineExecutorService.class); CommandAvailability availability = cles.getCommandAvailability(commandName); if (!availability.isAvailable()) { return null; } try { makeFiles(blob, targetExt); callImageMagick(); Blob targetBlob = Blobs.createBlob(targetFile); targetBlob.setFilename(getFilename(blob, targetExt)); Framework.trackFile(targetFile, targetBlob); return targetBlob; } catch (CommandNotAvailable | CommandException | IOException e) { <START> log.error(() -> String.format("ImageMagick failed on command: %s", commandName), e); <END> return null; } finally { if (tmpFile != null) { try { Files.delete(tmpFile.toPath()); } catch (IOException e) { log.error(() -> String.format( "Unable to delete temporary file when calling ImageMagick command: %s", commandName), e); } } } }</code><technical_language>Simpler: log.error("ImageMagick failed command: {}", () -> commandName, e) below. for error log, point in gain a millisecond, original fine</technical_language>

Target:
public Blob call(Blob blob, String targetExt, String commandName) { CommandLineExecutorService cles = Framework.getService(CommandLineExecutorService.class); CommandAvailability availability = cles.getCommandAvailability(commandName); if (!availability.isAvailable()) { return null; } try { makeFiles(blob, targetExt); callImageMagick(); Blob targetBlob = Blobs.createBlob(targetFile); targetBlob.setFilename(getFilename(blob, targetExt)); return targetBlob; } catch (CommandNotAvailable | CommandException | IOException e) { log.error("ImageMagick failed on command: {}", commandName, e); return null; } finally { if (tmpFile != null) { try { Files.delete(tmpFile.toPath()); } catch (IOException e) { log.error("Unable to delete temporary file when calling ImageMagick command: {}", commandName, e); } } } }
Source:
<code>public void testAutoChart() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFChart chart = ppt.createChart(); slide.addChart(chart); <START> assertNotNull(chart); <END> ppt.close(); }</code><technical_language>I checked returned chart slide.addChart is expect be, i.e. original chart passed argument</technical_language>

Target:
public void testAutoChart() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFChart chart = ppt.createChart(); assertNotNull(chart); slide.addChart(chart); assertEquals(XSLFRelation.CHART.getContentType(), chart.getPackagePart().getContentType()); String partName = slide.getRelationPartById("rId2").getDocumentPart().getPackagePart().getPartName().getName(); assertEquals(partName, chart.getPackagePart().getPartName().getName()); ppt.close(); }
Source:
<code>public static long widthBucket(@SqlType(StandardTypes.DOUBLE) double operand, @SqlType("array(double)") Block bins) { int numberOfBins = bins.getPositionCount(); checkCondition(numberOfBins > 0, INVALID_FUNCTION_ARGUMENT, "Bins cannot be an empty array"); checkCondition(!isNaN(operand), INVALID_FUNCTION_ARGUMENT, "Operand cannot be NaN"); int lower = 0; int upper = numberOfBins; int index; double bin; while (lower < upper) { if (DOUBLE.getDouble(bins, lower) > DOUBLE.getDouble(bins, upper - 1)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Bin values are not sorted in ascending order"); } index = (lower + upper) / 2; bin = DOUBLE.getDouble(bins, index); <START> checkCondition(isFinite(bin), INVALID_FUNCTION_ARGUMENT, "Bin value must be finite, got %s", bin); <END> if (operand < bin) { upper = index; } else { lower = index + 1; } } return lower; }</code><technical_language>This performance issues due boxing</technical_language>

Target:
public static long widthBucket(@SqlType(StandardTypes.DOUBLE) double operand, @SqlType("array(double)") Block bins) { int numberOfBins = bins.getPositionCount(); checkCondition(numberOfBins > 0, INVALID_FUNCTION_ARGUMENT, "Bins cannot be an empty array"); checkCondition(!isNaN(operand), INVALID_FUNCTION_ARGUMENT, "Operand cannot be NaN"); int lower = 0; int upper = numberOfBins; int index; double bin; while (lower < upper) { if (DOUBLE.getDouble(bins, lower) > DOUBLE.getDouble(bins, upper - 1)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Bin values are not sorted in ascending order"); } index = (lower + upper) / 2; bin = DOUBLE.getDouble(bins, index); if (!isFinite(bin)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Bin value must be finite, got " + bin); } if (operand < bin) { upper = index; } else { lower = index + 1; } } return lower; }
Source:
<code>public void testUnicastSerialDataReceiveSubscribedReceive() throws Exception { dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, receivePacket); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_NOT_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).serialDataReceived(XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); <START> <END> assertEquals(XBEE_64BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }</code><technical_language>Add a check verify broadcastSerialDataReceived method called</technical_language>

Target:
public void testUnicastSerialDataReceiveSubscribedReceive() throws Exception { dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, receivePacket); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_NOT_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).serialDataReceived(XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); Mockito.verify(receiveSerialDataListener, Mockito.never()).broadcastSerialDataReceived(Mockito.anyString(), (byte[])Mockito.any()); assertEquals(XBEE_64BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }
Source:
<code>void editAccounts(Collection<String> accountNames) throws IOException, InterruptedException { Path accountJsonPath = Files.createTempFile("account-update-", ".json"); JSONArray accountsToEdit = new JSONArray(); accountNames.stream() .map(accountName -> accountService.getAccountByName(accountName).toJson(false)) .forEach(accountsToEdit::put); try (BufferedWriter writer = Files.newBufferedWriter(accountJsonPath)) { accountsToEdit.write(writer, 2, 0); } ToolUtils.editFile(accountJsonPath); System.out.println("The following account metadata will be uploaded:"); try (Stream<String> lines = Files.lines(accountJsonPath)) { lines.forEach(System.out::println); } if (ToolUtils.yesNoPrompt("Do you want to update these accounts?")) { updateAccountsFromFile(accountJsonPath.toAbsolutePath().toString()); } else { System.out.println("Not updating any accounts"); } <START> } <END></code><technical_language>delete temp file here? want leave for editing</technical_language>

Target:
void editAccounts(Collection<String> accountNames) throws IOException, InterruptedException { Path accountJsonPath = Files.createTempFile("account-update-", ".json"); JSONArray accountsToEdit = new JSONArray(); accountNames.stream() .map(accountName -> Optional.ofNullable(accountService.getAccountByName(accountName)) .orElseThrow(() -> new IllegalArgumentException("Could not find account: " + accountName)) .toJson(false)) .forEach(accountsToEdit::put); try (BufferedWriter writer = Files.newBufferedWriter(accountJsonPath)) { accountsToEdit.write(writer, 2, 0); } ToolUtils.editFile(accountJsonPath); System.out.println("The following account metadata will be uploaded:"); try (Stream<String> lines = Files.lines(accountJsonPath)) { lines.forEach(System.out::println); } if (ToolUtils.yesNoPrompt("Do you want to update these accounts?")) { updateAccountsFromFile(accountJsonPath.toAbsolutePath().toString()); } else { System.out.println("Not updating any accounts"); } Files.delete(accountJsonPath); }
Source:
<code>public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response); <START> if(HEALTH_PATH.equals(contextPath)) { <END> osw.write(RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } osw.flush(); osw.close(); response.flush(); response.close(); t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); response.writeTo(os); os.close(); } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }</code><technical_language>Missing space if</technical_language>

Target:
public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response); if ("/-/healthy".equals(contextPath)) { osw.write(HEALTHY_RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } osw.flush(); osw.close(); response.flush(); response.close(); t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); response.writeTo(os); os.close(); } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }
Source:
<code>@Override public void parseArguments(CommandArgIterator argIter) { PropertySubCommandsList subcommand = PropertySubCommandsList.parse(argIter.nextArg("Expected property action.")); if (subcommand == null) <START> throw new IllegalArgumentException("Expected correct metadata action."); <END> delegate = subcommand.command(); delegate.parseArguments(argIter); }</code><technical_language>misleading exception message</technical_language>

Target:
@Override public void parseArguments(CommandArgIterator argIter) { PropertySubCommandsList subcommand = PropertySubCommandsList.parse(argIter.nextArg("Expected property action.")); if (subcommand == null) throw new IllegalArgumentException("Expected correct property action."); delegate = subcommand.command(); delegate.parseArguments(argIter); }
Source:
<code>public void storeAuthTokenResponse(@NonNull AuthResponse response, @NonNull AuthBackend backend) { pref.put(PrefManager.Key.AUTH_JSON, gson.toJson(response)); <START> pref.put(PrefManager.Key.SEGMENT_KEY_BACKEND, eventKeyFromAuthBackend(backend)); <END> }</code><technical_language>change name of constant SEGMENT_KEY_BACKEND ANALYTICS_KEY_BACKEND? actual key need changed remove backwards-compatibility, clearer</technical_language>

Target:
public void storeAuthTokenResponse(@NonNull AuthResponse response, @NonNull AuthBackend backend) { pref.put(PrefManager.Key.AUTH_JSON, gson.toJson(response)); pref.put(PrefManager.Key.ANALYTICS_KEY_BACKEND, analyticsTokenFromAuthBackend(backend)); }
Source:
<code>public void onNext(T t) { ReferenceCountUtil.retain(t); state.bufferedSubject.onNext(t); <START> if (state.casTimeoutScheduled() && state.state == 0) { END> timeoutScheduler.subscribe(new Action1<Long>() { @Override public void call(Long aLong) { disposeIfNotSubscribed(); } }); } }</code><technical_language>I safer do state.state == STATES.UNSUBSCRIBED.ordinal() This smells a race (as state changed concurrently) state change SUBSCRIBED/DISPOSED UNSUBSCRIBE safe</technical_language>

Target:
public void onNext(T t) { ReferenceCountUtil.retain(t); state.bufferedSubject.onNext(t); if (state.casTimeoutScheduled() && state.state == State.STATES.UNSUBSCRIBED.ordinal()) { timeoutScheduler.subscribe(new Action1<Long>() { @Override public void call(Long aLong) { disposeIfNotSubscribed(); } }); } }
Source:
<code>public void testStopAtNonRetryableException() { final int retries = 10; final int notRetry = 3; final AtomicInteger atomicInteger = new AtomicInteger(0); final String notRetryExceptionMsg = "Non-retryable exception"; CompletableFuture<Boolean> retryFuture = FutureUtils.retry( () -> CompletableFuture.supplyAsync( () -> { if (atomicInteger.incrementAndGet() == notRetry) { throw new CompletionException(new FlinkRuntimeException(notRetryExceptionMsg)); } else { throw new CompletionException(new FlinkException("Test exception")); } }, TestingUtils.defaultExecutor()), retries, throwable -> ExceptionUtils.findThrowable(throwable, FlinkException.class).isPresent(), TestingUtils.defaultExecutor()); try { retryFuture.get(); fail("Exception should be thrown."); } catch (Exception ex) { <START> assertThat(ExceptionUtils.findThrowableWithMessage(ex, notRetryExceptionMsg).isPresent(), is(true)); <END> } assertThat(atomicInteger.get(), is(notRetry)); }</code><technical_language>written assertThat(ex, FlinkMatchers.containsCause(expectedException)) expectedException = new FlinkRuntimeException(notRetryExceptionMsg)</technical_language>

Target:
public void testStopAtNonRetryableException() { final int retries = 10; final int notRetry = 3; final AtomicInteger atomicInteger = new AtomicInteger(0); final FlinkRuntimeException nonRetryableException = new FlinkRuntimeException("Non-retryable exception"); CompletableFuture<Boolean> retryFuture = FutureUtils.retry( () -> CompletableFuture.supplyAsync( () -> { if (atomicInteger.incrementAndGet() == notRetry) { throw new CompletionException(nonRetryableException); } else { throw new CompletionException(new FlinkException("Test exception")); } }, TestingUtils.defaultExecutor()), retries, throwable -> ExceptionUtils.findThrowable(throwable, FlinkException.class).isPresent(), TestingUtils.defaultExecutor()); try { retryFuture.get(); fail("Exception should be thrown."); } catch (Exception ex) { assertThat(ex, FlinkMatchers.containsCause(nonRetryableException)); } assertThat(atomicInteger.get(), is(notRetry)); }
Source:
<code>public FormClass getParameterFormClass() { EnumType cardinalityType = (EnumType) EnumType.TYPE_CLASS.createType(); cardinalityType.getValues().add(new EnumItem(ResourceId.valueOf("single"), "Single")); cardinalityType.getValues().add(new EnumItem(ResourceId.valueOf("multiple"), "Multiple")); EnumType kindType = (EnumType) EnumType.TYPE_CLASS.createType(); kindType.getValues().add(new EnumItem(ResourceId.valueOf(Kind.ATTACHMENT.name()), "Attachment")); kindType.getValues().add(new EnumItem(ResourceId.valueOf(Kind.IMAGE.name()), "Image")); FormClass formClass = new FormClass(ResourceIdPrefixType.TYPE.id("image")); formClass.addElement(new FormField(ResourceId.valueOf("cardinality")) .setType(cardinalityType) .setLabel("Cardinality") <START> .setDescription("Determines whether users can add a single image, or multiple images") <END> ); formClass.addElement(new FormField(ResourceId.valueOf("kind")) .setType(kindType) .setLabel("Type") .setDescription("Determines type of attachment (image or file)") .setVisible(false) ); return formClass; }</code><technical_language>user-readable strings internationalized</technical_language>

Target:
public FormClass getParameterFormClass() { EnumType cardinalityType = (EnumType) EnumType.TYPE_CLASS.createType(); cardinalityType.getValues().add(new EnumItem(ResourceId.valueOf("single"), I18N.CONSTANTS.single())); cardinalityType.getValues().add(new EnumItem(ResourceId.valueOf("multiple"), I18N.CONSTANTS.multiple())); EnumType kindType = (EnumType) EnumType.TYPE_CLASS.createType(); kindType.getValues().add(new EnumItem(ResourceId.valueOf(Kind.ATTACHMENT.name()), I18N.CONSTANTS.attachment())); kindType.getValues().add(new EnumItem(ResourceId.valueOf(Kind.IMAGE.name()), I18N.CONSTANTS.image())); FormClass formClass = new FormClass(ResourceIdPrefixType.TYPE.id("image")); formClass.addElement(new FormField(ResourceId.valueOf("kind")) .setType(kindType) .setLabel(I18N.CONSTANTS.type()) .setDescription(I18N.CONSTANTS.attachmentTypeDescription()) .setVisible(false) ); return formClass; }
Source:
<code>public CommcareMetadataJson getMetadata() { if (metadata != null) { return metadata; } else if (serializedMetadata != null) { deserializeMetadata(); return metadata; } <START> return null; <END> }</code><technical_language>return statement</technical_language>

Target:
public CommcareMetadataJson getMetadata() { return metadata; }
Source:
<code>public void whenSchemaHasRefToSchemaWithOneOfItShouldHaveAnUnknownModelAssociated() throws Exception { InputStream jsonSchemaStream = getClass().getClassLoader().getResourceAsStream("jsonSchema/jsonSchemaWithRefToOneOf.json"); String jsonSchemaString = convertStreamToString(jsonSchemaStream); MetaDataModel metaDataModel = modelFactory.buildModel(jsonSchemaString); Assert.assertThat(metaDataModel, CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); DefaultStructuredMetadataModel model = (DefaultStructuredMetadataModel) metaDataModel; <START> Assert.assertThat(model.getFields().size(), CoreMatchers.is(1)); <END> Assert.assertThat(model.getFields().get(0).getName(), CoreMatchers.is("additionalInformation")); Assert.assertThat(model.getFields().get(0).getMetaDataModel().getDataType(), CoreMatchers.is(DataType.UNKNOWN)); Assert.assertThat(model.getFields().get(0).getMetaDataModel(), CoreMatchers.instanceOf(UnknownMetaDataModel.class)); }</code><technical_language>IsCollectionWithSize matcher</technical_language>

Target:
public void whenSchemaHasRefToSchemaWithOneOfItShouldHaveAnUnknownModelAssociated() throws Exception { InputStream jsonSchemaStream = getClass().getClassLoader().getResourceAsStream("jsonSchema/jsonSchemaWithRefToOneOf.json"); String jsonSchemaString = convertStreamToString(jsonSchemaStream); MetaDataModel metaDataModel = modelFactory.buildModel(jsonSchemaString); Assert.assertThat(metaDataModel, CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); DefaultStructuredMetadataModel model = (DefaultStructuredMetadataModel) metaDataModel; Assert.assertThat(model.getFields(), IsCollectionWithSize.hasSize(1)); Assert.assertThat(model.getFields().get(0).getName(), CoreMatchers.is("additionalInformation")); Assert.assertThat(model.getFields().get(0).getMetaDataModel().getDataType(), CoreMatchers.is(DataType.UNKNOWN)); Assert.assertThat(model.getFields().get(0).getMetaDataModel(), CoreMatchers.instanceOf(UnknownMetaDataModel.class)); }
Source:
<code>private int decodeRun(final Tree tree) throws IOException { int total = 0; Node n = tree.root; while (true) { boolean bit = readBit(); n = n.walk(bit); if (n == null) { throw new IOException("Unknown code in Huffman RLE stream"); } if (n.isLeaf) { total += n.value; if (n.value < 64) { <START> if (n.value < 0) { <END> return columns; } return total; } else { n = tree.root; } } } }</code><technical_language>testing this n.value < 64 branch? 0 is < 64 anyway..</technical_language>

Target:
private int decodeRun(final Tree tree) throws IOException { int total = 0; Node n = tree.root; while (true) { boolean bit = readBit(); n = n.walk(bit); if (n == null) { throw new IOException("Unknown code in Huffman RLE stream"); } if (n.isLeaf) { total += n.value; if (n.value >= 64) { n = tree.root; } else if (n.value >= 0) { return total; } else { return columns; } } } }
Source:
<code>private void addQueryParams(final Request request) { if (dateCreated != null) { request.addQueryParam("DateCreated", dateCreated.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_TIME_FORMAT))); } else { <START> if (dateCreatedBefore != null || dateCreatedAfter != null) { <END> request.addQueryDateTimeRange("DateCreated", dateCreatedBefore, dateCreatedAfter); } } if (callSid != null) { request.addQueryParam("CallSid", callSid); } if (conferenceSid != null) { request.addQueryParam("ConferenceSid", conferenceSid); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } }</code><technical_language>nit: Combine else if</technical_language>

Target:
private void addQueryParams(final Request request) { if (dateCreated != null) { request.addQueryParam("DateCreated", dateCreated.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_TIME_FORMAT))); } else if (dateCreatedAfter != null || dateCreatedBefore != null) { request.addQueryDateTimeRange("DateCreated", dateCreatedAfter, dateCreatedBefore); } if (callSid != null) { request.addQueryParam("CallSid", callSid); } if (conferenceSid != null) { request.addQueryParam("ConferenceSid", conferenceSid); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } }
Source:
<code>private void shutdown(Lifecycle lifecycle) { try { lifecycle.stop(); } catch (Throwable t) { <START> log.warn(t, "Exception when stopping druid lifecycle"); <END> } finally { System.exit(1); } }</code><technical_language>This feels error log i</technical_language>

Target:
private void shutdown(Lifecycle lifecycle) { try { lifecycle.stop(); } catch (Throwable t) { log.error(t, "Exception when stopping druid lifecycle"); } finally { System.exit(1); } }
Source:
<code>public HybridCacheProvider( @JacksonInject @Named("l1") CacheProvider level1, @JacksonInject @Named("l2") CacheProvider level2 ) { Preconditions.checkNotNull(level1, "l1 cache not specified for hybrid cache"); Preconditions.checkNotNull(level2, "l2 cache not specified for hybrid cache"); this.level1 = level1; <START> this.level2 = level2; <END> }</code><technical_language>nit: do this.level1 = Preconditions.checkNotNull(level1, "l1 cache for hybrid cache"); this.level2 = Preconditions.checkNotNull(level2, "l2 cache for hybrid cache");</technical_language>

Target:
public HybridCacheProvider( @JacksonInject @Named("l1") CacheProvider level1, @JacksonInject @Named("l2") CacheProvider level2 ) { this.level1 = Preconditions.checkNotNull(level1, "l1 cache not specified for hybrid cache"); this.level2 = Preconditions.checkNotNull(level2, "l2 cache not specified for hybrid cache"); }
Source:
<code>static DocumentResultCollection<RecognizeEntitiesResult> getExpectedBatchNamedEntities() { <START> NamedEntity namedEntity1 = new NamedEntity("Seattle", "Location", null, 26, 7, 0.80624294281005859); <END> NamedEntity namedEntity2 = new NamedEntity("last week", "DateTime", "DateRange", 34, 9, 0.8); NamedEntity namedEntity3 = new NamedEntity("Microsoft", "Organization", null, 10, 9, 0.99983596801757812); List<NamedEntity> namedEntityList1 = Arrays.asList(namedEntity1, namedEntity2); List<NamedEntity> namedEntityList2 = Collections.singletonList(namedEntity3); TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(44, 1); TextDocumentStatistics textDocumentStatistics2 = new TextDocumentStatistics(20, 1); RecognizeEntitiesResult recognizeEntitiesResult1 = new RecognizeEntitiesResult("0", textDocumentStatistics1, null, namedEntityList1); RecognizeEntitiesResult recognizeEntitiesResult2 = new RecognizeEntitiesResult("1", textDocumentStatistics2, null, namedEntityList2); TextDocumentBatchStatistics textDocumentBatchStatistics = new TextDocumentBatchStatistics(2, 2, 0, 2); List<RecognizeEntitiesResult> recognizeEntitiesResultList = Arrays.asList(recognizeEntitiesResult1, recognizeEntitiesResult2); return new DocumentResultCollection<>(recognizeEntitiesResultList, DEFAULT_MODEL_VERSION, textDocumentBatchStatistics); }</code><technical_language>remove score equal comparison. Currently. nightly live test failed of it. <LINK_0></technical_language>

Target:
static DocumentResultCollection<RecognizeEntitiesResult> getExpectedBatchNamedEntities() { NamedEntity namedEntity1 = new NamedEntity("Seattle", "Location", null, 26, 7, 0.0); NamedEntity namedEntity2 = new NamedEntity("last week", "DateTime", "DateRange", 34, 9, 0.0); NamedEntity namedEntity3 = new NamedEntity("Microsoft", "Organization", null, 10, 9, 0.0); List<NamedEntity> namedEntityList1 = Arrays.asList(namedEntity1, namedEntity2); List<NamedEntity> namedEntityList2 = Collections.singletonList(namedEntity3); TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(44, 1); TextDocumentStatistics textDocumentStatistics2 = new TextDocumentStatistics(20, 1); RecognizeEntitiesResult recognizeEntitiesResult1 = new RecognizeEntitiesResult("0", textDocumentStatistics1, null, namedEntityList1); RecognizeEntitiesResult recognizeEntitiesResult2 = new RecognizeEntitiesResult("1", textDocumentStatistics2, null, namedEntityList2); TextDocumentBatchStatistics textDocumentBatchStatistics = new TextDocumentBatchStatistics(2, 2, 0, 2); List<RecognizeEntitiesResult> recognizeEntitiesResultList = Arrays.asList(recognizeEntitiesResult1, recognizeEntitiesResult2); return new DocumentResultCollection<>(recognizeEntitiesResultList, DEFAULT_MODEL_VERSION, textDocumentBatchStatistics); }
Source:
<code>TransactionsSearchDto getTransactionsSearchDto(final String transactionDbId, final String seedLotDbId, final String germplasmDbId) { final TransactionsSearchDto searchDTO = new TransactionsSearchDto(); if(!StringUtils.isEmpty(transactionDbId)) { searchDTO.setTransactionIds(Collections.singletonList(Integer.valueOf(transactionDbId))); } if(!StringUtils.isEmpty(germplasmDbId)) { searchDTO.setGids(Collections.singletonList(Integer.valueOf(germplasmDbId))); } if(!StringUtils.isEmpty(seedLotDbId)) { searchDTO.setLotUUIDs(Collections.singletonList(seedLotDbId)); } <START> searchDTO.setLotStatus(0); <END> return searchDTO; }</code><technical_language>LotStatus.ACTIVE.getIntValue()</technical_language>

Target:
TransactionsSearchDto getTransactionsSearchDto(final String transactionDbId, final String seedLotDbId, final String germplasmDbId) { final TransactionsSearchDto searchDTO = new TransactionsSearchDto(); if(!StringUtils.isEmpty(transactionDbId)) { searchDTO.setTransactionIds(Collections.singletonList(Integer.valueOf(transactionDbId))); } if(!StringUtils.isEmpty(germplasmDbId)) { searchDTO.setGids(Collections.singletonList(Integer.valueOf(germplasmDbId))); } if(!StringUtils.isEmpty(seedLotDbId)) { searchDTO.setLotUUIDs(Collections.singletonList(seedLotDbId)); } searchDTO.setLotStatus(LotStatus.ACTIVE.getIntValue()); return searchDTO; }
Source:
<code>public String generateSubscriptionKeyFieldsHash(final SubscriptionBase subscription) { final Hasher hasher = Hashing.murmur3_128() .newHasher() .putString(subscription.getOwningApplication(), UTF_8) .putString(subscription.getConsumerGroup(), UTF_8); subscription.getEventTypes() .stream() <START> .sorted() <END> .forEach(et -> hasher.putString(et, UTF_8)); return hasher.hash().toString(); }</code><technical_language>sorted ? :)</technical_language>

Target:
public String generateSubscriptionKeyFieldsHash(final SubscriptionBase subscription) { final Hasher hasher = Hashing.md5() .newHasher() .putString(subscription.getOwningApplication(), UTF_8) .putString(subscription.getConsumerGroup(), UTF_8); subscription.getEventTypes() .stream() .sorted() .forEach(et -> hasher.putString(et, UTF_8)); return hasher.hash().toString(); }
Source:
<code>public List<Court> GetAllCourts() { <START> List<Court> courts = courtDAO.getAllCourts(); <END> return courts; }</code><technical_language>Another redundant variable</technical_language>

Target:
public List<Court> GetAllCourts() { return courtDAO.getAllCourts(); }
Source:
<code>public void checkCount(DetailAST ast) { if (checking && maxAllowed != null && count > maxAllowed) { <START> if (context.isVoidContext) { <END> log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY_VOID, count, maxAllowed); } else { log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY, count, maxAllowed); } } }</code><technical_language>here, please isVoidContext instead of context.isVoidContext</technical_language>

Target:
public void checkCount(DetailAST ast) { if (checking && maxAllowed != null && count > maxAllowed) { if (isVoidContext) { log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY_VOID, count, maxAllowed); } else { log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY, count, maxAllowed); } } }
Source:
<code>protected void assertResultEquals(String message, Change expected, ChangeInfo actual) { <START> assertEquals(message, expected.getId().get(), (int) actual._number); <END> }</code><technical_language>Unnecessary cast</technical_language>

Target:
protected void assertResultEquals(String message, Change expected, ChangeInfo actual) { assertEquals(message, expected.getId().get(), actual._number); }
Source:
<code>public SpaceReference getNodeSpaceRef() { if (nodeSpaceRef.isPresent()) { <START> return new SpaceReference(nodeSpaceRef.get().clone()); <END> } return null; }</code><technical_language>please ModelUtils.cloneReference(...)</technical_language>

Target:
public Optional<SpaceReference> getNodeSpaceRef() { if (nodeSpaceRef.isPresent()) { return Optional.of(ModelUtils.cloneReference(nodeSpaceRef.get(), SpaceReference.class)); } return Optional.absent(); }
Source:
<code>private Date getDateFromDiskDescription(Map<String, Object> map) { try { if (map.get(OvfInfoFileConstants.LastUpdated) != null) { return new SimpleDateFormat(OvfParser.formatStrFromDiskDescription).parse(map.get(OvfInfoFileConstants.LastUpdated) <START> .toString()); <END> } else { log.info("LastUpdate Date is not initialized in the OVF_STORE disk."); } } catch (java.text.ParseException e) { log.errorFormat("LastUpdate Date could not be parsed from disk desscription. Exception: {0}", e); } return null; }</code><technical_language>"OvfParser.formatStrFromDiskDescription).parse(map.get(Ov fInfoFileConstants.LastUpdated))" is duplicated - please extract a local variable</technical_language>

Target:
private Date getDateFromDiskDescription(Map<String, Object> map) { try { if (getLastUpdate(map) != null) { return new SimpleDateFormat(OvfParser.formatStrFromDiskDescription).parse(getLastUpdate(map).toString()); } else { log.info("LastUpdate Date is not initialized in the OVF_STORE disk."); } } catch (java.text.ParseException e) { log.errorFormat("LastUpdate Date could not be parsed from disk desscription. Exception: {0}", e); } return null; }
Source:
<code>private Answer executeRequest(ImplementVspCommand cmd) { try { isNuageVspElementLoaded(); boolean success = _nuageVspElementClient.implement(cmd.getNetworkId(), cmd.getNetworkDomainUuid(), cmd.getNetworkUuid(), cmd.getNetworkName(), cmd.getVpcOrSubnetUuid(), cmd.isL2Network(), cmd.isL3Network(), cmd.isVpc(), cmd.isShared(), cmd.getDomainTemplateName(), cmd.isFirewallServiceSupported(), cmd.getDnsServers(), cmd.getIngressFirewallRules(), cmd.getEgressFirewallRules(), cmd.getAcsFipUuid(), cmd.isEgressDefaultPolicy()); return new ImplementVspAnswer(cmd, success, "Implemented network in VSP " + cmd.getNetworkUuid()); <START> } catch (Exception e) { <END> s_logger.error("Failure during " + cmd, e); return new ImplementVspAnswer(cmd, e); } }</code><technical_language>unchecked checked exceptions caught? catching expected checked exceptions, allow unchecked exceptions simply bubble out</technical_language>

Target:
private Answer executeRequest(ImplementVspCommand cmd) { try { isNuageVspElementLoaded(); boolean success = _nuageVspElementClient.implement(cmd.getNetworkId(), cmd.getNetworkDomainUuid(), cmd.getNetworkUuid(), cmd.getNetworkName(), cmd.getVpcOrSubnetUuid(), cmd.isL2Network(), cmd.isL3Network(), cmd.isVpc(), cmd.isShared(), cmd.getDomainTemplateName(), cmd.isFirewallServiceSupported(), cmd.getDnsServers(), cmd.getIngressFirewallRules(), cmd.getEgressFirewallRules(), cmd.getAcsFipUuid(), cmd.isEgressDefaultPolicy()); return new Answer(cmd, success, "Implemented network " + cmd.getNetworkUuid() + " on Nuage VSD " + _hostName); } catch (ExecutionException | ConfigurationException e) { s_logger.error("Failure during " + cmd + " on Nuage VSD " + _hostName, e); return new Answer(cmd, e); } }
Source:
<code>public void initialize() { super.initialize(); sensors.add(new DS2401(sensorIds.get(0), this)); <START> refreshInterval = 10 * 1000; <END> validConfig = true; updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE); }</code><technical_language>this overwrites user config</technical_language>

Target:
public void initialize() { Configuration configuration = getConfig(); Map<String, String> properties = editProperties(); if (!super.configure()) { return; } if (getThing().getStatus() == ThingStatus.OFFLINE) { return; } if (!properties.containsKey(PROPERTY_MODELID)) { scheduler.execute(() -> { updateSensorProperties(); }); } sensors.add(new DS2401(sensorIds.get(0), this)); if (configuration.get(CONFIG_REFRESH) == null) { refreshInterval = 10 * 1000; } validConfig = true; updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE); }
Source:
<code>public boolean removeAttribute(PerunSession sess, Resource resource, Member member, AttributeDefinition attribute) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM member_resource_attr_values WHERE attr_id=? AND member_id=? AND resource_id=?", attribute.getId(), member.getId(), resource.getId())) { <START> log.debug("Attribute value was removed from member on resource {}" + resource, attribute, member); <END> return true; } return false; } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }</code><technical_language>Technically usefull full objects in message, in this case relay previous (correct) present in passed AttributeDefinition (which, in a fact, lacks value). rephrasing message this help: Attribute for removed member resource {}. pass attribute name member resource objects. is inconsistency dot this kind of messages</technical_language>

Target:
public boolean removeAttribute(PerunSession sess, Resource resource, Member member, AttributeDefinition attribute) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM member_resource_attr_values WHERE attr_id=? AND member_id=? AND resource_id=?", attribute.getId(), member.getId(), resource.getId())) { log.debug("Attribute value for was removed from member on resource {}.", attribute.getName(), member, resource); return true; } return false; } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code>private void visitMultilineComment(Token token) { String value = token.getValue(); int startStringContent; if (value.endsWith("'''")) { startStringContent = value.indexOf("'''") + 3; } else { startStringContent = value.indexOf("\"\"\"") + 3; } int endStringContent = value.length() - 3; String text = value.substring(startStringContent, endStringContent); text = text.trim(); if (!isEmpty(text) && isTextParsedAsCode(text)) { <START> addIssue(new AstNode(token), MESSAGE); <END> } }</code><technical_language>@vilchik-elena define addIssue(Token, String)</technical_language>

Target:
private void visitMultilineComment(Token token) { String value = token.getValue(); int startStringContent; if (value.endsWith("'''")) { startStringContent = value.indexOf("'''") + 3; } else { startStringContent = value.indexOf("\"\"\"") + 3; } int endStringContent = value.length() - 3; String text = value.substring(startStringContent, endStringContent); text = text.trim(); if (!isEmpty(text) && isTextParsedAsCode(text)) { addIssue(token, MESSAGE); } }
Source:
<code>public void getFactNameAlias() { if (query.matches("(.*)where(.*)")) { String joinString = query.substring(query.indexOf("from"), query.indexOf("where")); String[] keys = joinString.split(" "); factTable = keys[1]; factAlias = keys[2]; } else if (query.matches("(.*)group by(.*)")) { String joinString = query.substring(query.indexOf("from"), query.indexOf("group by")); String[] keys = joinString.split(" "); factTable = keys[1]; factAlias = keys[2]; LOG.info("Input query missing where clause"); } else if (query.matches("(.*)order by(.*)")) { String joinString = query.substring(query.indexOf("from"), query.indexOf("order by")); String[] keys = joinString.split(" "); factTable = keys[1]; factAlias = keys[2]; LOG.info("Input query missing where clause and group by clause"); } else { <START> LOG.info("Input query missing where, group by and order by clause"); <END> } }</code><technical_language>get aliases in this case</technical_language>

Target:
public void getFactNameAlias() { Pattern p = Pattern.compile("from(.*)"); Matcher m = p.matcher(query.toLowerCase()); if (m.find()) { String fromClause = m.group(1); String[] keys = fromClause.split(" "); factTable = keys[1]; factAlias = keys[2]; } }
Source:
<code>public IndexEntry next() { if (cursor < 0 || cursor > numberOfEntries) { throw new NoSuchElementException(); } try { StoreKey key = getKeyAt(mmap, cursor); mmap.get(valueBuf); return new IndexEntry(key, new IndexValue(startOffset.getName(), ByteBuffer.wrap(valueBuf), getVersion())); } catch (Exception e) { String message = "Failed to read index entry at " + cursor; <START> logger.error(message, e); <END> throw new IllegalStateException(message, e); } finally { cursor++; } }</code><technical_language>If this exception thrown is caught logged caller already, remove log messages prevent double logging</technical_language>

Target:
public IndexEntry next() { if (cursor < 0 || cursor >= numberOfEntries) { throw new NoSuchElementException(); } try { StoreKey key = getKeyAt(mmap, cursor); mmap.get(valueBuf); return new IndexEntry(key, new IndexValue(startOffset.getName(), ByteBuffer.wrap(valueBuf), getVersion())); } catch (Exception e) { throw new IllegalStateException( "Failed to read index entry at " + cursor + " in index segment file " + indexFile.getAbsolutePath(), e); } finally { cursor++; } }
Source:
<code><START> public void setMinimum(String minimum) { <END> if (minimum != null) { minimum = (LenientLimit.COMPUTE ? BigDecimal.ONE : new BigDecimal(minimum).subtract(LenientLimit.OFFSET)).toPlainString(); } super.setMinimum(minimum); }</code><technical_language>do need account for error handling negative numbers some large numbers? I realize valid typos happen</technical_language>

Target:
public void setMinimum(String minimum) { if (minimum != null) { minimum = (LenientLimit.COMPUTE ? LenientLimit.ONE : new BigDecimal(minimum).subtract(LenientLimit.OFFSET)).toPlainString(); } super.setMinimum(minimum); }
Source:
<code>public static ServiceConfigTypeAmbariToOriginalPattern findByAmbariConfType(String ambariConfType) { for (ServiceConfigTypeAmbariToOriginalPattern value : values()) { if (value.ambariConfType.equals(ambariConfType)) { return value; } } <START> return null; <END> }</code><technical_language>return null? If error situation, throw exception? If is exceptional case handle properly, return Optional instead</technical_language>

Target:
public static Optional<ServiceConfigTypeAmbariToOriginalPattern> findByAmbariConfType(String ambariConfType) { for (ServiceConfigTypeAmbariToOriginalPattern value : values()) { if (value.ambariConfType.equals(ambariConfType)) { return Optional.of(value); } } return Optional.empty(); }
Source:
<code>public void onPostUploaded(PostStore.OnPostUploaded event) { final PostModel post = event.post; SiteModel site = getSelectedSite(); <START> if (isAdded() && event.post != null && event.post.getLocalSiteId() == site.getId()) { <END> UploadUtils.onPostUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), event, site, mDispatcher); } }</code><technical_language>getSelectedSite() is @Nullable, need null check calling site.getId() in this case</technical_language>

Target:
public void onPostUploaded(PostStore.OnPostUploaded event) { final PostModel post = event.post; if (isAdded() && event.post != null) { SiteModel site = getSelectedSite(); if (site != null) { if (event.post.getLocalSiteId() == site.getId()) { UploadUtils.onPostUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), event, site, mDispatcher); } } } }
Source:
<code>public AnalysisJobMetadata getMetadataProperties() { AnalysisJobMetadata jobMetadata = _engine.getJobMetadataFromJobFile(_tenantContext, _file) ; <START> return jobMetadata ; <END> }</code><technical_language>then: return Collections.emptyMap();</technical_language>

Target:
public Map<String, String> getMetadataProperties() { return Collections.emptyMap(); }
Source:
<code><T> Ref<T> getOrLoadRef(DfsStreamKey key, RefLoader<T> loader) throws IOException { int slot = slot(key, 0); HashEntry e1 = table.get(slot); Ref<T> ref = scanRef(e1, key, 0); if (ref != null) { getStat(statHit, key).incrementAndGet(); return ref; } ReentrantLock regionLock = <START> lockRef(key); <END> long lockStart = System.currentTimeMillis(); regionLock.lock(); try { HashEntry e2 = table.get(slot); if (e2 != e1) { ref = scanRef(e2, key, 0); if (ref != null) { getStat(statHit, key).incrementAndGet(); return ref; } } if (refLockWaitTime != null) { refLockWaitTime.accept( Long.valueOf(System.currentTimeMillis() - lockStart)); } getStat(statMiss, key).incrementAndGet(); ref = loader.load(); reserveSpace(ref.size, key); for (;;) { HashEntry n = new HashEntry(clean(e2), ref); if (table.compareAndSet(slot, e2, n)) break; e2 = table.get(slot); } addToClock(ref, 0); } finally { regionLock.unlock(); } return ref; }</code><technical_language>this called refLock, getRefLock, lockForRef, similar? clearer regionLock locked this line</technical_language>

Target:
<T> Ref<T> getOrLoadRef(DfsStreamKey key, RefLoader<T> loader) throws IOException { int slot = slot(key, 0); HashEntry e1 = table.get(slot); Ref<T> ref = scanRef(e1, key, 0); if (ref != null) { getStat(statHit, key).incrementAndGet(); return ref; } ReentrantLock regionLock = lockForRef(key); long lockStart = System.currentTimeMillis(); regionLock.lock(); try { HashEntry e2 = table.get(slot); if (e2 != e1) { ref = scanRef(e2, key, 0); if (ref != null) { getStat(statHit, key).incrementAndGet(); return ref; } } if (refLockWaitTime != null) { refLockWaitTime.accept( Long.valueOf(System.currentTimeMillis() - lockStart)); } getStat(statMiss, key).incrementAndGet(); ref = loader.load(); ref.hot = true; reserveSpace(ref.size, key); for (;;) { HashEntry n = new HashEntry(clean(e2), ref); if (table.compareAndSet(slot, e2, n)) { break; } e2 = table.get(slot); } addToClock(ref, 0); } finally { regionLock.unlock(); } return ref; }
Source:
<code>protected Control createDialogArea(Composite parent) { GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(parent); Label label = new Label(parent, SWT.NONE); <START> label.setText("Please remove everything which should not be sent to the server."); <END> GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.FILL).grab(true, false).applyTo(label); editText = new StyledText(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); editText.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); editText.setAlwaysShowScrollBars(false); editText.setText(value); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(SIZE_HINT_WIDTH, SIZE_HINT_HEIGHT).grab(true, true) .applyTo(editText); return parent; }</code><technical_language>Please remove irrelevant sensitive data</technical_language>

Target:
protected Control createDialogArea(Composite parent) { GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(parent); Label label = new Label(parent, SWT.NONE); label.setText("Please remove any irrelevant or sensitive data."); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.FILL).grab(true, false).applyTo(label); editText = new StyledText(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); editText.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); editText.setAlwaysShowScrollBars(false); editText.setText(value); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(SIZE_HINT_WIDTH, SIZE_HINT_HEIGHT).grab(true, true) .applyTo(editText); return parent; }
Source:
<code>private void addInvalidation(Data key) { if (!mapContainer.hasInvalidationListener()) { return; } if (invalidationKeys == null) { <START> invalidationKeys = new ArrayList<>(loadingSequence.size() / 2); <END> } invalidationKeys.add(key); }</code><technical_language>Minor: this is importance, initial capacity account presence of expirationTime items</technical_language>

Target:
private void addInvalidation(Data key) { if (!mapContainer.hasInvalidationListener()) { return; } if (invalidationKeys == null) { if (includesExpirationTime) { invalidationKeys = new ArrayList<>(loadingSequence.size() / 3); } else { invalidationKeys = new ArrayList<>(loadingSequence.size() / 2); } } invalidationKeys.add(key); }