auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<String> dbTablePK(DatabaseMetaData meta, String tableName) throws OrmException, SQLException { <START> ResultSet cols = meta.getPrimaryKeys(null, null, tableName.toUpperCase()); <END> Map<Short, String> seqToName = new HashMap<>(); while (cols.next()) { seqToName.put(cols.getShort("KEY_SEQ"), cols.getString("COLUMN_NAME")); } List<String> pk = new ArrayList<>(); for (short i = 1; i <= seqToName.size(); i++) { pk.add(seqToName.get(i).toUpperCase()); } return pk; }</code><technical_language>I need close this ResultSet. access Statement created it, rely closing Statement auto-close ResultSet. JDBC is rusty. I wrong. years of gwtorm hide database. :)</technical_language>

Target:
private List<String> dbTablePK(DatabaseMetaData meta, String tableName) throws OrmException, SQLException { ResultSet cols = meta.getPrimaryKeys(null, null, tableName.toUpperCase()); try { Map<Short, String> seqToName = new TreeMap<>(); while (cols.next()) { seqToName.put(cols.getShort("KEY_SEQ"), cols.getString("COLUMN_NAME")); } List<String> pk = new ArrayList<>(seqToName.size()); for (String name : seqToName.values()) { pk.add(name.toUpperCase(Locale.US)); } return pk; } finally { cols.close(); } }
Source:
<code><START> private RootBeanDefinition createBeanDefinition() { <END> RootBeanDefinition beanDefinition = new RootBeanDefinition("com.acme.MyRepository"); ConstructorArgumentValues constructorArgumentValues = new ConstructorArgumentValues(); constructorArgumentValues.addGenericArgumentValue(MyRepository.class); beanDefinition.setConstructorArgumentValues(constructorArgumentValues); return beanDefinition; }</code><technical_language>Static</technical_language>

Target:
private static RootBeanDefinition createBeanDefinition() { RootBeanDefinition beanDefinition = new RootBeanDefinition("com.acme.MyRepository"); ConstructorArgumentValues constructorArgumentValues = new ConstructorArgumentValues(); constructorArgumentValues.addGenericArgumentValue(MyRepository.class); beanDefinition.setConstructorArgumentValues(constructorArgumentValues); return beanDefinition; }
Source:
<code>protected void innerDraw(GC gc) { Rectangle bounds = getBounds(); gc.fillRoundRectangle(bounds.x, bounds.y, bounds.width, bounds.height, fArc, fArc); RGBAColor backgroundColor = getBackgroundColor(); <START> if (fLabel != null && !fLabel.isEmpty() && bounds.width > bounds.height && backgroundColor != null) { gc.setForeground(Utils.getDistinctColor(RGBAUtil.fromRGBAColor(backgroundColor).rgb)); Utils.drawText(gc, fLabel, bounds.x, bounds.y, bounds.width, bounds.height, true, true); } <END> }</code><technical_language>label drawn border</technical_language>

Target:
protected void innerDraw(GC gc) { Rectangle bounds = getBounds(); gc.fillRoundRectangle(bounds.x, bounds.y, bounds.width, bounds.height, fArc, fArc); }
Source:
<code>private static void addUsbControllers(VmBase vm, int numOfControllers) { for (int index = 0; index < numOfControllers; index++) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.CONTROLLER, VmDeviceType.USB, getUsbControllerSpecParams(EHCI_MODEL, 1, index), true, false, ""); for (int companionIndex = 1; companionIndex <= COMPANION_USB_CONTROLLERS; companionIndex++) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.CONTROLLER, VmDeviceType.USB, getUsbControllerSpecParams(UHCI_MODEL, companionIndex, index), true, false, <START> ""); <END> } } }</code><technical_language>please remove alias setting (should encapsulated in addManagedDevice</technical_language>

Target:
private static void addUsbControllers(VmBase vm, int numOfControllers) { for (int index = 0; index < numOfControllers; index++) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.CONTROLLER, VmDeviceType.USB, getUsbControllerSpecParams(EHCI_MODEL, 1, index), true, false); for (int companionIndex = 1; companionIndex <= COMPANION_USB_CONTROLLERS; companionIndex++) { VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.CONTROLLER, VmDeviceType.USB, getUsbControllerSpecParams(UHCI_MODEL, companionIndex, index), true, false); } } }
Source:
<code>public void setUpZap() throws Exception { super.setUpZap(); Path xmlDir = Files.createDirectories(Paths.get(Constant.getZapHome(), "xml")); Path testFile = xmlDir.resolve("application_errors.xml"); String content = "<?xml version=\"1.0\" standalone=\"no\"?>\n" + "<!-- \n" + "UnitTest File\n" + "-->\n" + "<Patterns>\n" + " <Pattern type=\"string\">Microsoft OLE DB Provider for ODBC Drivers</Pattern>\n" + " <Pattern type=\"regex\">(?i)Line\\s\\d+:\\sIncorrect\\ssyntax\\snear\\s'[^']*'</Pattern>\n" + "</Patterns>"; <START> Files.write(testFile, content.getBytes()); <END> }</code><technical_language>get bytes StandardCharsets.UTF_8 (that's read file)</technical_language>

Target:
public void setUpZap() throws Exception { super.setUpZap(); Path xmlDir = Files.createDirectories(Paths.get(Constant.getZapHome(), "xml")); Path testFile = xmlDir.resolve("application_errors.xml"); String content = "<?xml version=\"1.0\" standalone=\"no\"?>\n" + "<!-- \n" + "UnitTest File\n" + "-->\n" + "<Patterns>\n" + " <Pattern type=\"string\">Microsoft OLE DB Provider for ODBC Drivers</Pattern>\n" + " <Pattern type=\"regex\">(?i)Line\\s\\d+:\\sIncorrect\\ssyntax\\snear\\s'[^']*'</Pattern>\n" + "</Patterns>"; Files.write(testFile, content.getBytes(StandardCharsets.UTF_8)); }
Source:
<code>public void run() { isLeaked = true; final StackTraceElement[] stackTrace = exception.getStackTrace(); final StackTraceElement[] trace = new StackTraceElement[stackTrace.length - 5]; System.arraycopy(stackTrace, 5, trace, 0, trace.length); exception.setStackTrace(trace); <START> LOGGER.warn("Connection leak detection triggered for from thread {}, stack trace follows", connectionName, threadName, exception); <END> }</code><technical_language>Change "from thread" "on thread"</technical_language>

Target:
public void run() { isLeaked = true; final StackTraceElement[] stackTrace = exception.getStackTrace(); final StackTraceElement[] trace = new StackTraceElement[stackTrace.length - 5]; System.arraycopy(stackTrace, 5, trace, 0, trace.length); exception.setStackTrace(trace); LOGGER.warn("Connection leak detection triggered for on thread {}, stack trace follows", connectionName, threadName, exception); }
Source:
<code>public QueryResult executeQuery(Query query, Transaction transaction) { SqlTransaction sqlTransaction = (SqlTransaction) transaction; String connectionName = query.getTable().getDbConnectionName(); DataSource dataSource = getDataSource(connectionName); SQLDialect dialect = getSQLDialect(connectionName); sqlTransaction.initializeTransaction(dataSource, dialect); SQLQuery sql = toSQL(query, dialect); String queryString = sql.toString(); QueryResult.QueryResultBuilder resultBuilder = QueryResult.builder(); NamedParamPreparedStatement stmt; Pagination pagination = query.getPagination(); if (pagination != null) { <START> queryString = appendOffsetLimit(queryString, dialect, pagination.getOffset(), pagination.getLimit()); <END> if (pagination.returnPageTotals()) { resultBuilder.pageTotals(getPageTotal(query, sql, sqlTransaction)); } } log.debug("SQL Query: " + queryString); stmt = sqlTransaction.initializeStatement(queryString); supplyFilterQueryParameters(query, stmt); ResultSet resultSet = new TimedFunction<>(() -> { try { return stmt.executeQuery(); } catch (SQLException e) { throw new IllegalStateException(e); } }, "Running Query: " + queryString ).get(); resultBuilder.data(new EntityHydrator(resultSet, query, getMetadataDictionary()).hydrate()); return resultBuilder.build(); }</code><technical_language>adding offset limit directly, I feel this functionality (appending offset & limit string) move SQLQueryConstructor</technical_language>

Target:
public QueryResult executeQuery(Query query, Transaction transaction) { SqlTransaction sqlTransaction = (SqlTransaction) transaction; String connectionName = query.getTable().getDbConnectionName(); ConnectionDetails details = getConnectionDetails(connectionName); DataSource dataSource = details.getDataSource(); SQLDialect dialect = details.getDialect(); SQLQuery sql = toSQL(query, dialect); String queryString = sql.toString(); QueryResult.QueryResultBuilder resultBuilder = QueryResult.builder(); NamedParamPreparedStatement stmt; Pagination pagination = query.getPagination(); if (returnPageTotals(pagination)) { resultBuilder.pageTotals(getPageTotal(query, sql, sqlTransaction)); } log.debug("SQL Query: " + queryString); stmt = sqlTransaction.initializeStatement(queryString, dataSource); supplyFilterQueryParameters(query, stmt); ResultSet resultSet = runQuery(stmt, queryString, Function.identity()); resultBuilder.data(new EntityHydrator(resultSet, query, getMetadataDictionary()).hydrate()); return resultBuilder.build(); }
Source:
<code>public InputKind(String relpath, Class inputClass) { this( <START> relpath, <END> inputClass, relpath.contains("data/inputs") ? relpath.substring(relpath.indexOf("data/inputs") + 12) : relpath ); }</code><technical_language>Nit: Unnecessary extra level of indentation</technical_language>

Target:
private InputKind(String relpath, Class inputClass) { this( relpath, inputClass, relpath ); }
Source:
<code>public void onMatch(RelOptRuleCall call) { SetOp setOp = call.rel(0); JoinState setOpState = RelDistributionUtils.isSetOpSP(setOp.getInputs()); RelDistribution newDistribution = RelDistributions.SINGLETON.with( setOpState.getLiteral(), setOpState.isSP()); List<RelNode> inputs; if (!setOpState.isSP() && setOpState.getLiteral() == null) { <START> inputs = Lists.newArrayList(); <END> setOp.getInputs() .stream() .forEach(node -> { RelDistribution dist = node.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE); if (!dist.getIsSP() && dist.getPartitionEqualValue() == null && RelDistribution.Type.SINGLETON != dist.getType()) { VoltLogicalExchange exchange = new VoltLogicalExchange(node.getCluster(), node.getTraitSet(), node, dist); inputs.add(exchange); } else { inputs.add(node); } }); } else { inputs = setOp.getInputs(); } SetOp newSetOp = setOp.copy(setOp.getTraitSet().replace(newDistribution), inputs); call.transformTo(newSetOp); }</code><technical_language>minor: .collect() stream combine a single statement</technical_language>

Target:
public void onMatch(RelOptRuleCall call) { SetOp setOp = call.rel(0); JoinState setOpState = RelDistributionUtils.isSetOpSP(setOp.getInputs()); RelDistribution newDistribution = RelDistributions.SINGLETON.with( setOpState.getLiteral(), setOpState.isSP()); boolean isMP = !setOpState.isSP() && setOpState.getLiteral() == null; List<RelNode> inputs = setOp.getInputs() .stream() .map(node -> { RelDistribution dist = node.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE); boolean needExchange = isMP && RelDistribution.Type.SINGLETON != dist.getType(); if (needExchange) { VoltLogicalExchange exchange = new VoltLogicalExchange(node.getCluster(), node.getTraitSet(), node, dist); return exchange; } else { return node; } }) .collect(Collectors.toList()); SetOp newSetOp = setOp.copy(setOp.getTraitSet().replace(newDistribution), inputs); call.transformTo(newSetOp); }
Source:
<code>private PBDSegment<M> addSegment(PBDSegment<M> tail, long startId, M extraHeader) throws IOException { long curId = (startId == PBDSegment.INVALID_ID) ? ((tail == null) ? 1 : tail.segmentId() + 1) : startId; String fname = getSegmentFileName(curId); PBDSegment<M> newSegment = initializeNewSegment(curId, new VoltFile(m_path, fname), "an offer", extraHeader); m_segments.put(newSegment.segmentId(), newSegment); if (m_retentionPolicy != null) { <START> m_retentionPolicy.newSegmentAdded(); m_retentionPolicy.bytesAdded(newSegment.m_file.length()); <END> } return newSegment; }</code><technical_language>newSegmentAdded length user call methods</technical_language>

Target:
private PBDSegment<M> addSegment(PBDSegment<M> tail, long startId, M extraHeader) throws IOException { long curId = (startId == PBDSegment.INVALID_ID) ? ((tail == null) ? 1 : tail.segmentId() + 1) : startId; String fname = getSegmentFileName(curId); PBDSegment<M> newSegment = initializeNewSegment(curId, new VoltFile(m_path, fname), "an offer", extraHeader); m_segments.put(newSegment.segmentId(), newSegment); if (m_retentionPolicy != null) { m_retentionPolicy.newSegmentAdded(newSegment.m_file.length()); } return newSegment; }
Source:
<code>public static CheckAndMutate toCheckAndMutate(ClientProtos.Condition condition, List<Mutation> mutations) throws IOException { assert mutations.size() > 0; byte[] row = condition.getRow().toByteArray(); CheckAndMutate.Builder builder = CheckAndMutate.newBuilder(row); Filter filter = condition.hasFilter() ? ProtobufUtil.toFilter(condition.getFilter()) : null; if (filter != null) { builder.ifMatches(filter); } else { builder.ifMatches(condition.getFamily().toByteArray(), condition.getQualifier().toByteArray(), CompareOperator.valueOf(condition.getCompareType().name()), ProtobufUtil.toComparator(condition.getComparator()).getValue()); } TimeRange timeRange = condition.hasTimeRange() ? ProtobufUtil.toTimeRange(condition.getTimeRange()) : TimeRange.allTime(); builder.timeRange(timeRange); try { if (mutations.size() == 1) { <START> if (mutations.get(0) instanceof Put) { <END> return builder.build((Put) mutations.get(0)); } else if (mutations.get(0) instanceof Delete) { return builder.build((Delete) mutations.get(0)); } else { throw new DoNotRetryIOException("Unsupported mutate type: " + mutations.get(0) .getClass().getSimpleName().toUpperCase()); } } else { return builder.build(new RowMutations(mutations.get(0).getRow()).add(mutations)); } } catch (IllegalArgumentException e) { throw new DoNotRetryIOException(e.getMessage()); } }</code><technical_language>nit: Mutation m = mutations.get(0) m for rest of this block</technical_language>

Target:
public static CheckAndMutate toCheckAndMutate(ClientProtos.Condition condition, List<Mutation> mutations) throws IOException { assert mutations.size() > 0; byte[] row = condition.getRow().toByteArray(); CheckAndMutate.Builder builder = CheckAndMutate.newBuilder(row); Filter filter = condition.hasFilter() ? ProtobufUtil.toFilter(condition.getFilter()) : null; if (filter != null) { builder.ifMatches(filter); } else { builder.ifMatches(condition.getFamily().toByteArray(), condition.getQualifier().toByteArray(), CompareOperator.valueOf(condition.getCompareType().name()), ProtobufUtil.toComparator(condition.getComparator()).getValue()); } TimeRange timeRange = condition.hasTimeRange() ? ProtobufUtil.toTimeRange(condition.getTimeRange()) : TimeRange.allTime(); builder.timeRange(timeRange); try { if (mutations.size() == 1) { Mutation m = mutations.get(0); if (m instanceof Put) { return builder.build((Put) m); } else if (m instanceof Delete) { return builder.build((Delete) m); } else { throw new DoNotRetryIOException("Unsupported mutate type: " + mutations.get(0) .getClass().getSimpleName().toUpperCase()); } } else { return builder.build(new RowMutations(mutations.get(0).getRow()).add(mutations)); } } catch (IllegalArgumentException e) { throw new DoNotRetryIOException(e.getMessage()); } }
Source:
<code>private static List<UsagePermission> buildPermissions() { List<UsagePermission> ps = new ArrayList<>(); for (KubernetesCloud kubernetesCloud : getUsageRestrictedKubernetesClouds()) { UsagePermission p = new UsagePermission(); String name = kubernetesCloud.name; p.setName(name); <START> p.setGranted(false); <END> p.setInherited(false); ps.add(p); } return ps; }</code><technical_language>necessary, a boolean is false default</technical_language>

Target:
private static List<UsagePermission> buildPermissions() { List<UsagePermission> ps = new ArrayList<>(); for (KubernetesCloud kubernetesCloud : getUsageRestrictedKubernetesClouds()) { UsagePermission p = new UsagePermission(); p.setName(kubernetesCloud.name); ps.add(p); } return ps; }
Source:
<code>private static ColumnStatistics createPartitionColumnStatistics( HiveColumnHandle column, Type type, List<HivePartition> partitions, Map<String, PartitionStatistics> statistics, double averageRowsPerPartition, double rowCount) { <START> Set<HivePartition> emptyPartitions = partitions.stream() <END> .filter(partition -> getPartitionRowCount(partition.getPartitionId(), statistics).orElse(averageRowsPerPartition) == 0) .collect(toImmutableSet()); return ColumnStatistics.builder() .setDistinctValuesCount(Estimate.of(calculateDistinctPartitionKeys(column, partitions, emptyPartitions))) .setNullsFraction(Estimate.of(calculateNullsFractionForPartitioningKey(column, partitions, statistics, averageRowsPerPartition, rowCount))) .setRange(calculateRangeForPartitioningKey(column, type, partitions, emptyPartitions)) .setDataSize(calculateDataSizeForPartitioningKey(column, type, partitions, statistics, averageRowsPerPartition)) .build(); }</code><technical_language>create a set of non-empty partitions via: List<HivePartition> nonEmptyPartitions = partitions.stream() .filter(partition -> getPartitionRowCount(partition.getPartitionId(), statistics).orElse(averageRowsPerPartition) != 0) .collect(toImmutableList()); pass list calculateDistinctPartitionKeys calculateRangeForPartitioningKey</technical_language>

Target:
private static ColumnStatistics createPartitionColumnStatistics( HiveColumnHandle column, Type type, List<HivePartition> partitions, Map<String, PartitionStatistics> statistics, double averageRowsPerPartition, double rowCount) { List<HivePartition> nonEmptyPartitions = partitions.stream() .filter(partition -> getPartitionRowCount(partition.getPartitionId(), statistics).orElse(averageRowsPerPartition) != 0) .collect(toImmutableList()); return ColumnStatistics.builder() .setDistinctValuesCount(Estimate.of(calculateDistinctPartitionKeys(column, nonEmptyPartitions))) .setNullsFraction(Estimate.of(calculateNullsFractionForPartitioningKey(column, partitions, statistics, averageRowsPerPartition, rowCount))) .setRange(calculateRangeForPartitioningKey(column, type, nonEmptyPartitions)) .setDataSize(calculateDataSizeForPartitioningKey(column, type, partitions, statistics, averageRowsPerPartition)) .build(); }
Source:
<code><START> private void warnIfShortMessageSmallerThanErrorMessage(AbstractPatternRule rule) { <END> if (rule instanceof PatternRule) { int sizeOfShortMessage = ((PatternRule) rule).getShortMessage().length(); int sizeOfErrorMessage = ((PatternRule) rule).getMessage().length(); if (sizeOfShortMessage >= sizeOfErrorMessage) { System.err.println("Warning: The content of <short> should be smaller than the content of" + " <message>). Language: " + rule.language.getName() + ". Rule: " + rule.getId()); } } }</code><technical_language>function name warnIfShortMessageSmallerThanErrorMessage misleading me. warnIfShortMessageLongerThanErrorMessage checkIfShortMessageSmallerThanErrorMessage</technical_language>

Target:
private void warnIfShortMessageSmallerThanErrorMessage(AbstractPatternRule rule) { if (rule instanceof PatternRule) { int sizeOfShortMessage = ((PatternRule) rule).getShortMessage().length(); int sizeOfErrorMessage = ((PatternRule) rule).getMessage().length(); if (sizeOfShortMessage >= sizeOfErrorMessage) { System.err.println("Warning: The content of <short> should be smaller than the content of" + " <message>. Language: " + rule.language.getName() + ". Rule: " + rule.getId()); } } }
Source:
<code>public void testCreate() { StorageAccountApi storageApi = api.getStorageAccountApi(getResourceGroupName()); StorageService storageAccount = storageApi.get(getStorageServiceName()); String blob = storageAccount.storageServiceProperties().primaryEndpoints().get("blob"); String id = "/subscriptions/" + subscriptionid + "/resourceGroups/" + getResourceGroupName() + "/providers/" + "Microsoft.Compute/virtualMachines/" + getName(); VirtualMachine vm = api().create(getName(), id, getName(), LOCATION, getProperties(blob, nicName)); assertTrue(!vm.name().isEmpty()); String status = "Creating"; int stopCounter = 0; while (status.equals("Creating")) { try { Thread.sleep(120 * 1000); } catch (InterruptedException e) { e.printStackTrace(); } vm = api().get(getName()); status = vm.properties().provisioningState(); stopCounter++; if (stopCounter == 15) break; <START> } <END> status = vm.properties().provisioningState(); assertTrue(!status.equals("Creating")); assertTrue(!status.equals("Failed")); }</code><technical_language>before, jclouds Predictes2.retry construct, if sense create a predicate injectable for reuse. AzureComputeHttpApiModule is a good place declare reusable predicates</technical_language>

Target:
public void testCreate(){ StorageAccountApi storageApi = api.getStorageAccountApi(getResourceGroupName()); StorageService storageAccount = storageApi.get(getStorageServiceName()); String blob = storageAccount.storageServiceProperties().primaryEndpoints().get("blob"); VirtualMachine vm = api().create(getName(), LOCATION, getProperties(blob, nicName)); assertTrue(!vm.name().isEmpty()); boolean jobDone = Predicates2.retry(new Predicate<String>() { @Override public boolean apply(String name) { return !api().get(name).properties().provisioningState().equals("Creating"); } }, 60 * 20 * 1000).apply(getName()); assertTrue(jobDone, "create operation did not complete in the configured timeout"); String status = api().get(vmName).properties().provisioningState(); assertTrue(!status.equals("Creating")); assertTrue(!status.equals("Failed")); }
Source:
<code>public PredicateASTFactoryData(Predicate predicate, List<KiePMMLOutputField> outputFields, List<KiePMMLDroolsRule> rules, String parentPath, String currentRule, Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { this.predicate = predicate; this.outputFields = outputFields; this.rules = rules; this.parentPath = parentPath; this.currentRule = currentRule; <START> this.fieldTypeMap = fieldTypeMap; <END> }</code><technical_language>If want prevent external classes alter map create a new instance in getter</technical_language>

Target:
public PredicateASTFactoryData(Predicate predicate, List<KiePMMLOutputField> outputFields, List<KiePMMLDroolsRule> rules, String parentPath, String currentRule, Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { this.predicate = predicate; this.outputFields = outputFields != null ? Collections.unmodifiableList(outputFields) : Collections.emptyList(); this.rules = rules; this.parentPath = parentPath; this.currentRule = currentRule; this.fieldTypeMap = fieldTypeMap != null ? Collections.unmodifiableMap(fieldTypeMap) : Collections.emptyMap(); }
Source:
<code>public int getMultipleAssignmentsIndex(StructureTreeNode treeNode) { <START> if (Objects.nonNull(treeNode.getDataObject()) && treeNode.getDataObject() instanceof View <END> && Objects.nonNull(((View) treeNode.getDataObject()).getMediaUnit())) { return severalAssignments.indexOf(((View) treeNode.getDataObject()).getMediaUnit()); } return -1; }</code><technical_language>suggestion if (treeNode.getDataObject() instanceof View instanceof checks null</technical_language>

Target:
public int getMultipleAssignmentsIndex(StructureTreeNode treeNode) { if (treeNode.getDataObject() instanceof View && Objects.nonNull(((View) treeNode.getDataObject()).getMediaUnit())) { return severalAssignments.indexOf(((View) treeNode.getDataObject()).getMediaUnit()); } return -1; }
Source:
<code>PagedFlux<IncidentRootCause> listIncidentRootCauses( String detectionConfigurationId, String incidentId, Context context) { AnomalyIncident anomalyIncident = new AnomalyIncident(); IncidentHelper.setId(anomalyIncident, incidentId); <START> IncidentHelper.setDetectionConfigurationId(anomalyIncident, detectionConfigurationId); <END> try { return new PagedFlux<>(() -> listIncidentRootCausesInternal(anomalyIncident, context), null); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(logger, ex)); } }</code><technical_language>sense do a null check for params in this method well? Today if a user calls listIncidentRootCases(null, incidentId,..) error throw is incident.detectionConfigurationId is required null</technical_language>

Target:
PagedFlux<IncidentRootCause> listIncidentRootCauses( String detectionConfigurationId, String incidentId, Context context) { try { Objects.requireNonNull(detectionConfigurationId, "'detectionConfigurationId' is required."); Objects.requireNonNull(incidentId, "'incidentId' is required."); AnomalyIncident anomalyIncident = new AnomalyIncident(); IncidentHelper.setId(anomalyIncident, incidentId); IncidentHelper.setDetectionConfigurationId(anomalyIncident, detectionConfigurationId); return new PagedFlux<>(() -> listIncidentRootCausesInternal(anomalyIncident, context), null); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(logger, ex)); } }
Source:
<code>private void showMultiplePrompts(final OSInAppMessage inAppMessage, final List<OSInAppMessagePrompt> prompts) { for (OSInAppMessagePrompt prompt : prompts) { if (!prompt.hasPrompted()) { currentPrompt = prompt; break; } } if (currentPrompt != null) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "IAM prompt to handle: " + currentPrompt.toString()); currentPrompt.setPrompted(true); currentPrompt.handlePrompt(new OneSignal.OSPromptActionCompletionCallback() { @Override public void completed(@Nullable String messageTitle, @Nullable String message, boolean accepted) { currentPrompt = null; OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "IAM prompt to handle finished accepted: " + accepted); <START> if (inAppMessage.isPreview && messageTitle!= null && message != null) <END> showInformativeAlert(messageTitle, message, inAppMessage, prompts); else showMultiplePrompts(inAppMessage, prompts); } }); } else { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "No IAM prompt to handle, dismiss message: " + inAppMessage.messageId); messageWasDismissed(inAppMessage); } }</code><technical_language>Add a space messageTitle!= null messageTitle != null</technical_language>

Target:
private void showMultiplePrompts(final OSInAppMessage inAppMessage, final List<OSInAppMessagePrompt> prompts) { for (OSInAppMessagePrompt prompt : prompts) { if (!prompt.hasPrompted()) { currentPrompt = prompt; break; } } if (currentPrompt != null) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "IAM prompt to handle: " + currentPrompt.toString()); currentPrompt.setPrompted(true); currentPrompt.handlePrompt(new OneSignal.OSPromptActionCompletionCallback() { @Override public void onCompleted(OneSignal.PromptActionResult result) { currentPrompt = null; OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "IAM prompt to handle finished with result: " + result); if (inAppMessage.isPreview && result == OneSignal.PromptActionResult.LOCATION_PERMISSIONS_MISSING_MANIFEST) showAlertDialogMessage(inAppMessage, prompts); else showMultiplePrompts(inAppMessage, prompts); } }); } else { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "No IAM prompt to handle, dismiss message: " + inAppMessage.messageId); messageWasDismissed(inAppMessage); } }
Source:
<code>public static void main(String[] args) throws Exception { final ManagedChannel channel = new ManagedChannel() { @Override public <RequestT, ResponseT> ClientCall<RequestT, ResponseT> newCall( MethodDescriptor<RequestT, ResponseT> methodDescriptor, CallOptions callOptions) { return null; } @Override public String authority() { return null; } @Override public ManagedChannel shutdown() { return null; } @Override public boolean isShutdown() { return false; } @Override public boolean isTerminated() { return false; } @Override public ManagedChannel shutdownNow() { return null; } @Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { return false; } }; int threads = 100; int concurrent = 400; final ChannelPool cp = new ChannelPool( Collections.<HeaderInterceptor>emptyList(), new ChannelPool.ChannelFactory() { @Override public ManagedChannel create() throws IOException { return channel; } }); cp.ensureChannelCount(40); ExecutorService es = Executors.newFixedThreadPool(threads); Callable<Void> runnable = new Callable<Void>() { @Override public Void call() throws Exception { long start = System.nanoTime(); for (int i = 0; i < TEST_COUNT; i++) { cp.newCall(null, null); } long diff = System.nanoTime() - start; <START> double naonPerRow = diff / TEST_COUNT; <END> System.out.println(String.format("took %d ms. %.0f", diff / 1_000_000, naonPerRow)); return null; } }; runnable.call(); for (int j = 0; j < concurrent; j++) { es.submit(runnable); } es.shutdown(); es.awaitTermination(1000, TimeUnit.SECONDS); }</code><technical_language>spelling</technical_language>

Target:
public static void main(String[] args) throws Exception { final ManagedChannel channel = new ManagedChannel() { @Override public <RequestT, ResponseT> ClientCall<RequestT, ResponseT> newCall( MethodDescriptor<RequestT, ResponseT> methodDescriptor, CallOptions callOptions) { return null; } @Override public String authority() { return null; } @Override public ManagedChannel shutdown() { return null; } @Override public boolean isShutdown() { return false; } @Override public boolean isTerminated() { return false; } @Override public ManagedChannel shutdownNow() { return null; } @Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { return false; } }; int threads = 100; int concurrent = 400; final ChannelPool cp = new ChannelPool( Collections.<HeaderInterceptor>emptyList(), new ChannelPool.ChannelFactory() { @Override public ManagedChannel create() throws IOException { return channel; } }); cp.ensureChannelCount(40); ExecutorService es = Executors.newFixedThreadPool(threads); Callable<Void> runnable = new Callable<Void>() { @Override public Void call() throws Exception { long start = System.nanoTime(); for (int i = 0; i < TEST_COUNT; i++) { cp.newCall(null, null); } long diff = System.nanoTime() - start; double nanosPerRow = diff / TEST_COUNT; System.out.println(String.format("took %d ms. %.0f", diff / 1_000_000, nanosPerRow)); return null; } }; runnable.call(); for (int j = 0; j < concurrent; j++) { es.submit(runnable); } es.shutdown(); es.awaitTermination(1000, TimeUnit.SECONDS); }
Source:
<code>public void addSubnet(ExternalSubnet subnet) { String err = "cannot add subnet to an unmanaged external network provider"; <START> log.error(err); <END> throw new EngineException(EngineError.PROVIDER_FAILURE, err); }</code><technical_language>log.error("Cannot add subnet unmanaged external network provider {}", provider.getName()));</technical_language>

Target:
public void addSubnet(ExternalSubnet subnet) { String err = String.format("Cannot add subnet to an unmanaged external network provider %s", provider.getName()); log.error(err); throw new EngineException(EngineError.PROVIDER_FAILURE, err); }
Source:
<code>public static Set<DistributionModuleGroup> getModuleGroups() { Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(new DistributionModuleGroup(CDH5120Constant.SPARK2_MODULE_GROUP.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.SPARK_MRREQUIRED_MODULE_GROUP.getModuleName(), true, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.HDFS_MODULE_GROUP_SPARK2_2.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.HDFS_MODULE_GROUP_COMMON.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.MAPREDUCE_MODULE_GROUP.getModuleName(), false, condition)); <START> ComponentCondition conditionUseNavigator = new SimpleComponentCondition(new BasicExpression( <END> SparkBatchConstant.USE_CLOUDERA_NAVIGATOR)); hs.add(new DistributionModuleGroup(CDH5120Constant.TALEND_CLOUDERA_CDH_5_12_NAVIGATOR.getModuleName(), true, conditionUseNavigator)); return hs; }</code><technical_language>add navigator's dependencies this is supported</technical_language>

Target:
public static Set<DistributionModuleGroup> getModuleGroups() { Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(new DistributionModuleGroup(CDH5120Constant.SPARK2_MODULE_GROUP.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.SPARK_MRREQUIRED_MODULE_GROUP.getModuleName(), true, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.HDFS_MODULE_GROUP_SPARK2_2.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.HDFS_MODULE_GROUP_COMMON.getModuleName(), false, condition)); hs.add(new DistributionModuleGroup(CDH5120Constant.MAPREDUCE_MODULE_GROUP.getModuleName(), false, condition)); END_CLOUDERA_CDH_5_12_NAVIGATOR.getModuleName(), return hs; }
Source:
<code>@Bean @Lazy ArmeriaServerConfigurator uiServerConfigurator( IndexSwitchingService indexSwitchingService) throws IOException { HttpService indexService = indexHtml.isReadable() ? indexSwitchingService : indexSwitchingService.lensIndex; ServerCacheControl maxAgeYear = new ServerCacheControlBuilder().maxAgeSeconds(TimeUnit.DAYS.toSeconds(365)).build(); Service<HttpRequest, HttpResponse> uiFileService = HttpFileServiceBuilder.forClassPath("zipkin-ui").cacheControl(maxAgeYear).build() .orElse( HttpFileServiceBuilder.forClassPath("zipkin-lens").cacheControl(maxAgeYear).build()); String config = writeConfig(ui); return sb -> { <START> sb.service("/zipkin/config.json", HttpFileBuilder.of(HttpData.of(UTF_8, config)) <END> .cacheControl(new ServerCacheControlBuilder().maxAgeSeconds(600).build()) .contentType(MediaType.JSON_UTF_8) .build() .asService()); sb.serviceUnder("/zipkin/", uiFileService); sb.service("/zipkin/", indexService) .service("/zipkin/index.html", indexService) .service("/zipkin/traces/{id}", indexService) .service("/zipkin/dependency", indexService) .service("/zipkin/traceViewer", indexService); sb.service("/favicon.ico", new RedirectService(HttpStatus.FOUND, "/zipkin/favicon.ico")) .service("/", new RedirectService(HttpStatus.FOUND, "/zipkin/")) .service("/zipkin", new RedirectService(HttpStatus.FOUND, "/zipkin/")); }; }</code><technical_language>ofUtf8 method</technical_language>

Target:
@Bean @Lazy ArmeriaServerConfigurator uiServerConfigurator( IndexSwitchingService indexSwitchingService) throws IOException { HttpService indexService = indexHtml.isReadable() ? indexSwitchingService : indexSwitchingService.lensIndex; ServerCacheControl maxAgeYear = new ServerCacheControlBuilder().maxAgeSeconds(TimeUnit.DAYS.toSeconds(365)).build(); Service<HttpRequest, HttpResponse> uiFileService = HttpFileServiceBuilder.forClassPath("zipkin-ui").cacheControl(maxAgeYear).build() .orElse( HttpFileServiceBuilder.forClassPath("zipkin-lens").cacheControl(maxAgeYear).build()); String config = writeConfig(ui); return sb -> { sb.service("/zipkin/config.json", HttpFileBuilder.of(HttpData.ofUtf8(config)) .cacheControl(new ServerCacheControlBuilder().maxAgeSeconds(600).build()) .contentType(MediaType.JSON_UTF_8) .build() .asService()); sb.serviceUnder("/zipkin/", uiFileService); sb.service("/zipkin/", indexService) .service("/zipkin/index.html", indexService) .service("/zipkin/traces/{id}", indexService) .service("/zipkin/dependency", indexService) .service("/zipkin/traceViewer", indexService); sb.service("/favicon.ico", new RedirectService(HttpStatus.FOUND, "/zipkin/favicon.ico")) .service("/", new RedirectService(HttpStatus.FOUND, "/zipkin/")) .service("/zipkin", new RedirectService(HttpStatus.FOUND, "/zipkin/")); }; }
Source:
<code>public RsVelocity(final String folder, final InputStream template, final Scalar<Map<String, Object>> params) { super( <START> new RsOf( <END> () -> new RsEmpty().head(), () -> RsVelocity.render(folder, template, params.get()) ) ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
public RsVelocity(final String folder, final InputStream template, final Scalar<Map<String, Object>> params) { super( new ResponseOf( () -> new RsEmpty().head(), () -> RsVelocity.render(folder, template, params.get()) ) ); }
Source:
<code>public void trim(Long trimMark) { <START> if (Address.isAddress(trimMark)) { <END> long numAddressesToTrim = addressMap.rankLong(trimMark); if (numAddressesToTrim <= NO_ADDRESSES) { return; } List<Long> addressesToTrim = new ArrayList<>(); LongIterator it = addressMap.getLongIterator(); for (int i = 0; i < numAddressesToTrim; i++) { addressesToTrim.add(it.next()); } if (!addressesToTrim.isEmpty()) { removeAddresses(addressesToTrim); } } }</code><technical_language>please invert if condition</technical_language>

Target:
public void trim(Long trimMark) { if (!Address.isAddress(trimMark)) { return; } long numAddressesToTrim = addressMap.rankLong(trimMark); if (numAddressesToTrim <= NO_ADDRESSES) { return; } List<Long> addressesToTrim = new ArrayList<>(); LongIterator it = addressMap.getLongIterator(); for (int i = 0; i < numAddressesToTrim; i++) { addressesToTrim.add(it.next()); } if (!addressesToTrim.isEmpty()) { removeAddresses(addressesToTrim); } }
Source:
<code>public void undeploy() { <START> List<AssertionError> errors = Lists.newArrayList(); <END> undeploy(errors); if (errors.size() > 0) { fail(format("Failed to undeploy job %s %s - %s", job.getId(), job.toString(), errors.get(0))); } }</code><technical_language>final</technical_language>

Target:
public void undeploy() { final List<AssertionError> errors = Lists.newArrayList(); undeploy(errors); if (errors.size() > 0) { fail(format("Failed to undeploy job %s - %s", getJobDescription(job), errors.get(0))); } }
Source:
<code>private CompletableFuture<Void> visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { boolean statisticsEnabled = getStatisticsEnabled(command); if (!statisticsEnabled || !ctx.isOriginLocal()) return ctx.continueInvocation(); long start = timeService.time(); return ctx.onReturn((ctx1, command1, rv, throwable) -> { <START> long intervalMilliseconds = timeService.timeDuration(start, TimeUnit.MILLISECONDS); <END> if (rv == null) { missTimes.add(intervalMilliseconds); misses.increment(); } else { hitTimes.add(intervalMilliseconds); hits.increment(); } return null; }); }</code><technical_language>ReturnHandler invoke a thread? wondering if stats reliable now..</technical_language>

Target:
private CompletableFuture<Void> visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { boolean statisticsEnabled = getStatisticsEnabled(command); if (!statisticsEnabled || !ctx.isOriginLocal()) return ctx.continueInvocation(); long start = timeService.time(); return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { long intervalMilliseconds = timeService.timeDuration(start, TimeUnit.MILLISECONDS); if (rv == null) { missTimes.add(intervalMilliseconds); misses.increment(); } else { hitTimes.add(intervalMilliseconds); hits.increment(); } return null; }); }
Source:
<code>public ChannelBuilder withKind(ChannelKind kind) { <START> this.kind = kind; <END> return this; }</code><technical_language>I @sjka intentions I agree this removed... ... a discussion in another topic / Kai argued rely correct usage WRT nullness annotations for code is called party (e.g. binding developers etc.)? So, if trust ESH framework developers annotations classes correctly, want</technical_language>

Target:
public ChannelBuilder withKind(ChannelKind kind) { if (kind == null) { throw new IllegalArgumentException("kind must not be null"); } this.kind = kind; return this; }
Source:
<code>private SecretKey pbkdf2DerivedKeyForPassword(String password, byte[] salt, int iterations, int length) throws NoSuchAlgorithmException, InvalidKeySpecException { if (length < 1) { throw new IllegalArgumentException("Length must greater than 0"); } if (password == null || password.length() < 1) { throw new IllegalArgumentException("Length must greater than 0"); } if (salt == null || salt.length < 1) { throw new IllegalArgumentException("Length must greater than 0"); } if (iterations < 1) { throw new IllegalArgumentException("Length must greater than 0"); <START> } <END> SecretKeyFactory pbkdf2Factory; if (Build.VERSION.SDK_INT >= 19) { pbkdf2Factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1And8bit"); } else { pbkdf2Factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); } PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, length * BYTES_TO_BITS); return pbkdf2Factory.generateSecret(keySpec); }</code><technical_language>Correct error messages</technical_language>

Target:
private SecretKey pbkdf2DerivedKeyForPassword(String password, byte[] salt, int iterations, int length) throws NoSuchAlgorithmException, InvalidKeySpecException { if (length < 1) { throw new IllegalArgumentException("length must greater than 0"); } if (password == null || password.length() < 1) { throw new IllegalArgumentException("password must not be null or empty String"); } if (salt == null || salt.length < 1) { throw new IllegalArgumentException("salt must not be null or empty byte array"); } if (iterations < 1) { throw new IllegalArgumentException("iterations must greater than 0"); } SecretKeyFactory pbkdf2Factory; if (Build.VERSION.SDK_INT >= 19) { pbkdf2Factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1And8bit"); } else { pbkdf2Factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); } PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, length * BYTES_TO_BITS); return pbkdf2Factory.generateSecret(keySpec); }
Source:
<code>private RefactoringStatus checkParameterNamesInRippleMethods() throws JavaModelException { RefactoringStatus result= new RefactoringStatus(); Set<String> newParameterNames= getNewParameterNamesList(); for (IMethod <START> fRippleMethod : <END> fRippleMethods) { for (String paramName : fRippleMethod.getParameterNames()) { if (newParameterNames.contains(paramName)) { String[] args= new String[]{JavaElementUtil.createMethodSignature(fRippleMethod), BasicElementLabels.getJavaElementName(paramName)}; String msg= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_already_has, args); RefactoringStatusContext context= JavaStatusContext.create(fRippleMethod.getCompilationUnit(), fRippleMethod.getNameRange()); result.addError(msg, context); } } } return result; }</code><technical_language>rename rippleMethod</technical_language>

Target:
private RefactoringStatus checkParameterNamesInRippleMethods() throws JavaModelException { RefactoringStatus result= new RefactoringStatus(); Set<String> newParameterNames= getNewParameterNamesList(); for (IMethod rippleMethod : fRippleMethods) { for (String paramName : rippleMethod.getParameterNames()) { if (newParameterNames.contains(paramName)) { String[] args= new String[]{JavaElementUtil.createMethodSignature(rippleMethod), BasicElementLabels.getJavaElementName(paramName)}; String msg= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_already_has, args); RefactoringStatusContext context= JavaStatusContext.create(rippleMethod.getCompilationUnit(), rippleMethod.getNameRange()); result.addError(msg, context); } } } return result; }
Source:
<code>public CoordinatorConfig(Properties config) { _config = config; _properties = new VerifiableProperties(config); _cluster = _properties.getString(CONFIG_CLUSTER); _zkAddress = _properties.getString(CONFIG_ZK_ADDRESS); _zkSessionTimeout = _properties.getInt(CONFIG_ZK_SESSION_TIMEOUT, ZkClient.DEFAULT_SESSION_TIMEOUT); _zkConnectionTimeout = _properties.getInt(CONFIG_ZK_CONNECTION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT); _retryIntervalMs = _properties.getInt(CONFIG_RETRY_INTERVAL, 1000 ); _heartbeatPeriodMs = _properties.getLong(CONFIG_HEARTBEAT_PERIOD_MS, Duration.ofMinutes(1).toMillis()); _debounceTimerMs = _properties.getLong(CONFIG_DEBOUNCE_TIMER_MS, Duration.ofSeconds(30).toMillis()); _defaultTransportProviderName = _properties.getString(CONFIG_DEFAULT_TRANSPORT_PROVIDER, ""); _zkCleanUpOrphanConnectorTask = _properties.getBoolean(CONFIG_ZK_CLEANUP_ORPHAN_CONNECTOR_TASK, false); <START> <END> }</code><technical_language>nit: delete empty line</technical_language>

Target:
public CoordinatorConfig(Properties config) { _config = config; _properties = new VerifiableProperties(config); _cluster = _properties.getString(CONFIG_CLUSTER); _zkAddress = _properties.getString(CONFIG_ZK_ADDRESS); _zkSessionTimeout = _properties.getInt(CONFIG_ZK_SESSION_TIMEOUT, ZkClient.DEFAULT_SESSION_TIMEOUT); _zkConnectionTimeout = _properties.getInt(CONFIG_ZK_CONNECTION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT); _retryIntervalMs = _properties.getInt(CONFIG_RETRY_INTERVAL, 1000 ); _heartbeatPeriodMs = _properties.getLong(CONFIG_HEARTBEAT_PERIOD_MS, Duration.ofMinutes(1).toMillis()); _debounceTimerMs = _properties.getLong(CONFIG_DEBOUNCE_TIMER_MS, Duration.ofSeconds(30).toMillis()); _defaultTransportProviderName = _properties.getString(CONFIG_DEFAULT_TRANSPORT_PROVIDER, ""); _zkCleanUpOrphanConnectorTask = _properties.getBoolean(CONFIG_ZK_CLEANUP_ORPHAN_CONNECTOR_TASK, false); _zkCleanUpOrphanConnectorTaskLock = _properties.getBoolean(CONFIG_ZK_CLEANUP_ORPHAN_CONNECTOR_TASK_LOCK, false); }
Source:
<code>public boolean isRunning() { <START> return isStarted(); <END> }</code><technical_language>a thought is contract for running fully started? Camel a state called .. starting is phase do startup. I assume running is startup stuff running</technical_language>

Target:
public boolean isRunning() { return !isStopping() && !isStopped(); }
Source:
<code>public FakeVdsmInit(String configPath) throws Exception { if (configPath == null){ URL propertiesFileURL = this.getClass().getResource("/config.properties"); configPath = propertiesFileURL.getPath(); } final Map<String, String> paramMap = new HashMap<String, String>(); Properties properties = new Properties(); properties.load(new FileInputStream(new File(configPath))); for (String s: properties.stringPropertyNames()){ paramMap.put(s, (String) properties.get(s)); } AppConfig appConfig = AppConfig.getInstance(); appConfig.init(paramMap); System.setProperty("logDir", appConfig.getLogDir()); final TaskProcessor taskProcessor = TaskProcessor.getInstance(); taskProcessor.init(); JsonRpcServer server = new JsonRpcServer(appConfig.getJsonHost(), appConfig.getJsonPort(), appConfig.isEncrypted()); server.start(); <START> while (true) { Thread.sleep(1000); } <END> }</code><technical_language>a daemon get rid of this</technical_language>

Target:
public FakeVdsmInit(String configPath) throws Exception { if (configPath == null){ URL propertiesFileURL = this.getClass().getResource("/config.properties"); configPath = propertiesFileURL.getPath(); } final Map<String, String> paramMap = new HashMap<String, String>(); Properties properties = new Properties(); properties.load(new FileInputStream(new File(configPath))); for (String s: properties.stringPropertyNames()){ paramMap.put(s, (String) properties.get(s)); } AppConfig appConfig = AppConfig.getInstance(); appConfig.init(paramMap); System.setProperty("logDir", appConfig.getLogDir()); final TaskProcessor taskProcessor = TaskProcessor.getInstance(); taskProcessor.init(); JsonRpcServer.initMonitoring(); JsonRpcServer server = new JsonRpcServer(appConfig.getJsonHost(), appConfig.getJsonPort(), appConfig.isEncrypted()); server.setDaemon(true); server.run(); while (true) { Thread.sleep(100); } }
Source:
<code>private JScrollPane getScrollPane() { if (proxiesScrollPane == null) { <START> proxiesScrollPane = new JScrollPane(); <END> proxiesScrollPane.setViewportView(getProxiesOptionsPanel()); } return proxiesScrollPane; }</code><technical_language>requires some more changes suggest adding panel instead of table (as scrollable matter size of dialogue)</technical_language>

Target:
private JScrollPane getScrollPane() { if (proxiesScrollPane == null) { proxiesScrollPane = new JScrollPane(); proxiesScrollPane.setBorder(BorderFactory.createEmptyBorder()); proxiesScrollPane.setViewportView(getScrollPanel()); } return proxiesScrollPane; }