auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setAccount_RealName(int accountIndex) { AccountObject userObject = mAccountList.get(accountIndex - 1); long id = userObject.getId(); <START> String userNmae = userObject.getUsername(); <END> String password = userObject.getPassword(); String mail = userObject.getEmail(); String nickName = Account_NAME + "NEW_" + id; AccountInfo user = new AccountInfo(); user.id = id; user.userName = userNmae; user.nickName = nickName; user.password = password; user.email = mail; user.enable = true; mAccountList.set(accountIndex - 1, mAccountHelper.updateAccount(user)); }</code><technical_language>username</technical_language>

Target:
public void setAccount_RealName(int accountIndex) { AccountObject userObject = mAccountList.get(accountIndex - 1); long id = userObject.getId(); String username = userObject.getUsername(); String password = userObject.getPassword(); String mail = userObject.getEmail(); String nickname = Account_NAME + "NEW_" + id; AccountInfo user = new AccountInfo(); user.id = id; user.userName = username; user.nickName = nickname; user.password = password; user.email = mail; user.enable = true; mAccountList.set(accountIndex - 1, mAccountHelper.updateAccount(user)); }
Source:
<code>public void shouldProvisionEnvironmentVariablesSorted() throws InfrastructureException { List<EnvVar> preExistingEnvironment = new ArrayList<>(); preExistingEnvironment.add(new EnvVar(PRE_EXISTING_VAR, PRE_EXISTING_VAR_VALUE, null)); testContainer.setEnv(preExistingEnvironment); machine.getEnv().put(PRE_EXISTING_VAR, PRE_EXISTING_VAR_NEW_VALUE); machine.getEnv().put(A_VAR, A_VAL); machine.getEnv().put(B_VAR, B_VAL); machine.getEnv().put(C_VAR, C_VAL); EnvVarsConverter converter = new EnvVarsConverter(); converter.provision(environment, identity); EnvVar expectedA = new EnvVar(A_VAR, A_VAL, null); EnvVar expectedB = new EnvVar(B_VAR, B_VAL, null); EnvVar expectedC = new EnvVar(C_VAR, C_VAL, null); EnvVar expectedPreExisting = new EnvVar(PRE_EXISTING_VAR, PRE_EXISTING_VAR_NEW_VALUE, null); assertEquals(4, testContainer.getEnv().size()); assertEquals(expectedB, testContainer.getEnv().get(0)); <START> assertEquals(expectedC, testContainer.getEnv().get(1)); <END> assertEquals(expectedA, testContainer.getEnv().get(2)); assertEquals(expectedPreExisting, testContainer.getEnv().get(3)); }</code><technical_language>is assertEqualsNoOrder for cases. check arrays, convert lists arrays list.toArray(). This change much, test a bit more concise</technical_language>

Target:
public void shouldProvisionEnvironmentVariablesSorted() throws InfrastructureException { List<EnvVar> preExistingEnvironment = new ArrayList<>(); preExistingEnvironment.add(new EnvVar(PRE_EXISTING_VAR, PRE_EXISTING_VAR_VALUE, null)); testContainer.setEnv(preExistingEnvironment); machine.getEnv().put(PRE_EXISTING_VAR, PRE_EXISTING_VAR_NEW_VALUE); machine.getEnv().put(A_VAR, A_VAL); machine.getEnv().put(B_VAR, B_VAL); machine.getEnv().put(C_VAR, C_VAL); EnvVarsConverter converter = new EnvVarsConverter(); converter.provision(environment, identity); EnvVar expectedA = new EnvVar(A_VAR, A_VAL, null); EnvVar expectedB = new EnvVar(B_VAR, B_VAL, null); EnvVar expectedC = new EnvVar(C_VAR, C_VAL, null); EnvVar expectedPreExisting = new EnvVar(PRE_EXISTING_VAR, PRE_EXISTING_VAR_NEW_VALUE, null); List<EnvVar> expectedOrder = asList(expectedB, expectedC, expectedA, expectedPreExisting); assertEquals(4, testContainer.getEnv().size()); assertEquals(expectedOrder, testContainer.getEnv()); }
Source:
<code>public void runCommand(String[] args) throws Exception { if (args.length == 0) { this.showDocumentation(); return; } Object[] ss = new String[args.length - 1]; System.arraycopy(args, 1, ss, 0, args.length - 1); boolean foundMethod = false; boolean incorrectParams = false; Method[] mList = type.getMethods(); for (Method m : mList) { if (Modifier.isStatic(m.getModifiers())) { if (m.getName().equals(args[0])) { foundMethod = true; if (ss.length != m.getParameterTypes().length) { incorrectParams = true; <START> } else { <END> incorrectParams = false; Object o = m.invoke(null, ss); if (o != null) { logger.info(o.toString()); } } } if (foundMethod && !incorrectParams) break; } } if (!foundMethod) { logger.info("Unable to find " + args[0]); this.showDocumentation(); String nearest = getNearestCommand(mList, args[0]); logger.info("Did you mean: " + nearest); } else if (incorrectParams) { logger.info("Invalid usage of " + args[0]); int i = 1; for (Method elem : type.getMethods()) { if (Modifier.isStatic(elem.getModifiers())) { if (elem.isAnnotationPresent(CommandIgnore.class)) continue; if (elem.getName().equals(args[0])) { printMethodSignature(i, elem); i++; } } } } }</code><technical_language>leave System.out</technical_language>

Target:
public void runCommand(String[] args) throws Exception { if (args.length == 0) { this.showDocumentation(); return; } Object[] ss = new String[args.length - 1]; System.arraycopy(args, 1, ss, 0, args.length - 1); boolean foundMethod = false; boolean incorrectParams = false; Method[] mList = type.getMethods(); for (Method m : mList) { if (Modifier.isStatic(m.getModifiers())) { if (m.getName().equals(args[0])) { foundMethod = true; if (ss.length != m.getParameterTypes().length) { incorrectParams = true; } else { incorrectParams = false; Object o = m.invoke(null, ss); if (o != null) { System.out.println(o.toString()); } } } if (foundMethod && !incorrectParams) break; } } if (!foundMethod) { System.out.println("Unable to find " + args[0]); this.showDocumentation(); String nearest = getNearestCommand(mList, args[0]); System.out.println("Did you mean: " + nearest); } else if (incorrectParams) { System.out.println("Invalid usage of " + args[0]); int i = 1; for (Method elem : type.getMethods()) { if (Modifier.isStatic(elem.getModifiers())) { if (elem.isAnnotationPresent(CommandIgnore.class)) continue; if (elem.getName().equals(args[0])) { printMethodSignature(i, elem); i++; } } } } }
Source:
<code>public QueryRunner<Result<SearchResultValue>> preMergeQueryDecoration(final QueryRunner<Result<SearchResultValue>> runner) { return new SearchThresholdAdjustingQueryRunner( intervalChunkingQueryRunnerDecorator.decorate( new QueryRunner<Result<SearchResultValue>>() { @Override public Sequence<Result<SearchResultValue>> run( Query<Result<SearchResultValue>> query, Map<String, Object> responseContext ) { if (!(query instanceof SearchQuery)) { <START> return runner.run(query, responseContext); <END> } else { SearchQuery searchQuery = (SearchQuery) query; if (searchQuery.getDimensionsFilter() != null) { searchQuery = searchQuery.withDimFilter(searchQuery.getDimensionsFilter().optimize()); } return runner.run(searchQuery, responseContext); } } } , this), config ); }</code><technical_language>throw exception this happen</technical_language>

Target:
public QueryRunner<Result<SearchResultValue>> preMergeQueryDecoration(final QueryRunner<Result<SearchResultValue>> runner) { return new SearchThresholdAdjustingQueryRunner( intervalChunkingQueryRunnerDecorator.decorate( new QueryRunner<Result<SearchResultValue>>() { @Override public Sequence<Result<SearchResultValue>> run( Query<Result<SearchResultValue>> query, Map<String, Object> responseContext ) { SearchQuery searchQuery = (SearchQuery) query; if (searchQuery.getDimensionsFilter() != null) { searchQuery = searchQuery.withDimFilter(searchQuery.getDimensionsFilter().optimize()); } return runner.run(searchQuery, responseContext); } } , this), config ); }
Source:
<code>public static Set<Mapping> fromMappingsPrism(MappingsPrism mappingsAnnotation, ExecutableElement method, FormattingMessager messager, Types typeUtils) { Set<Mapping> mappings = new LinkedHashSet<>(); for ( MappingPrism mappingPrism : mappingsAnnotation.value() ) { Mapping mapping = fromMappingPrism( mappingPrism, method, messager, typeUtils ); if ( mapping != null ) { <START> if ( !mappings.add( mapping ) ) { <END> messager.printMessage( method, Message.PROPERTYMAPPING_DUPLICATE_TARGETS, mappingPrism.target() ); } } } return mappings; }</code><technical_language>for making more clear do if ( mappings.contains(mapping) ) { ... } else { mappings.add( mapping ); } need read return of add means. I is easier read this</technical_language>

Target:
public static Set<Mapping> fromMappingsPrism(MappingsPrism mappingsAnnotation, ExecutableElement method, FormattingMessager messager, Types typeUtils) { Set<Mapping> mappings = new LinkedHashSet<>(); for ( MappingPrism mappingPrism : mappingsAnnotation.value() ) { Mapping mapping = fromMappingPrism( mappingPrism, method, messager, typeUtils ); if ( mapping != null ) { if ( mappings.contains( mapping ) ) { messager.printMessage( method, Message.PROPERTYMAPPING_DUPLICATE_TARGETS, mappingPrism.target() ); } else { mappings.add( mapping ); } } } return mappings; }
Source:
<code>private int minimizeCrossingsWithCounter(final GraphInfoHolder gData) { boolean isForwardSweep = random.nextBoolean(); <START> if (!gData.lGraph().hasProperty(InternalProperties.FIRST_TRY_WITH_INITIAL_ORDER) <END> || gData.lGraph().getProperty(LayeredOptions.PRESERVE_ORDER) == OrderingStrategy.NONE) { gData.crossMinimizer().setFirstLayerOrder(gData.currentNodeOrder(), isForwardSweep); } else { isForwardSweep = true; gData.lGraph().setProperty(InternalProperties.FIRST_TRY_WITH_INITIAL_ORDER, null); } sweepReducingCrossings(gData, isForwardSweep, true); int crossingsInGraph = countCurrentNumberOfCrossings(gData); int oldNumberOfCrossings; do { setCurrentlyBestNodeOrders(); if (crossingsInGraph == 0) { return 0; } isForwardSweep = !isForwardSweep; oldNumberOfCrossings = crossingsInGraph; sweepReducingCrossings(gData, isForwardSweep, false); crossingsInGraph = countCurrentNumberOfCrossings(gData); } while (oldNumberOfCrossings > crossingsInGraph); return oldNumberOfCrossings; }</code><technical_language>suggest add a default of false explicitly check property here: !gData.lGraph().getProperty(InternalProperties.FIRST_TRY_WITH_INITIAL_ORDER)</technical_language>

Target:
private int minimizeCrossingsWithCounter(final GraphInfoHolder gData) { boolean isForwardSweep = random.nextBoolean(); if (!gData.lGraph().getProperty(InternalProperties.FIRST_TRY_WITH_INITIAL_ORDER) || gData.lGraph().getProperty(LayeredOptions.CONSIDER_MODEL_ORDER) == OrderingStrategy.NONE) { gData.crossMinimizer().setFirstLayerOrder(gData.currentNodeOrder(), isForwardSweep); } else { isForwardSweep = true; } sweepReducingCrossings(gData, isForwardSweep, true); gData.lGraph().setProperty(InternalProperties.FIRST_TRY_WITH_INITIAL_ORDER, false); int crossingsInGraph = countCurrentNumberOfCrossings(gData); int oldNumberOfCrossings; do { setCurrentlyBestNodeOrders(); if (crossingsInGraph == 0) { return 0; } isForwardSweep = !isForwardSweep; oldNumberOfCrossings = crossingsInGraph; sweepReducingCrossings(gData, isForwardSweep, false); crossingsInGraph = countCurrentNumberOfCrossings(gData); } while (oldNumberOfCrossings > crossingsInGraph); return oldNumberOfCrossings; }
Source:
<code><START> public boolean isTypeSupported(Class<T> clazz) { <END> if (String.class.isAssignableFrom(clazz) || Integer.class.isAssignableFrom(clazz) || Boolean.class.isAssignableFrom(clazz)) { return true; } return false; }</code><technical_language>this protected, do want allow call this class</technical_language>

Target:
protected boolean isTypeSupported(Class<T> clazz) { if (String.class.isAssignableFrom(clazz) || Integer.class.isAssignableFrom(clazz) || Boolean.class.isAssignableFrom(clazz)) { return true; } return false; }
Source:
<code><START> public int visit(Object element, Object parent, int depth) { <END> int minDepth = depth; if (isVisited(element)) { if(getVisitedDepth(element) > 0 ) { isCyclic = true; } return getVisitedDepth(element); } setVisited(element, depth); beginVisit(element, parent, depth ); Iterator itr = getElementLinks(element); if (itr != null) { while (itr.hasNext()) { int childDepth = visit(itr.next(), element, depth + 1); minDepth = ((childDepth < minDepth) && (childDepth > -1)) ? childDepth : minDepth; linkCount++; } } setVisited(element, -1); endVisit(element, parent, depth, minDepth); return (minDepth < depth) ? minDepth : depth; }</code><technical_language>is this required</technical_language>

Target:
private int visit(Object element, Object parent, int depth) { int minDepth = depth; if (isVisited(element)) { if(getVisitedDepth(element) > 0 ) { isCyclic = true; } return getVisitedDepth(element); } setVisited(element, depth); beginVisit(element, parent, depth ); Iterator itr = getElementLinks(element); if (itr != null) { while (itr.hasNext()) { int childDepth = visit(itr.next(), element, depth + 1); minDepth = ((childDepth < minDepth) && (childDepth > -1)) ? childDepth : minDepth; linkCount++; } } setVisited(element, -1); endVisit(element, parent, depth, minDepth); return (minDepth < depth) ? minDepth : depth; }
Source:
<code>public void realmObject_emittedOnSubscribe() { realm.beginTransaction(); final AllJavaTypes obj = realm.createObject(AllJavaTypes.class, 42); realm.commitTransaction(); subscription = obj.<AllJavaTypes>asFlowable().subscribe(rxObject -> { assertTrue(rxObject.isFrozen()); <START> assertNotEquals(rxObject, obj); END> assertEquals(rxObject.getFieldId(), obj.getFieldId()); looperThread.testComplete(); }); }</code><technical_language>some moment be, if reference ObjKey version ID?. RealmResults allowed equal frozen RealmResults <LINK_0></technical_language>

Target:
public void realmObject_emittedOnSubscribe() { realm.beginTransaction(); final AllJavaTypes obj = realm.createObject(AllJavaTypes.class, 42); realm.commitTransaction(); subscription = obj.<AllJavaTypes>asFlowable().subscribe(rxObject -> { assertTrue(rxObject.isFrozen()); assertNotEquals(rxObject, obj); assertEquals(rxObject.getFieldId(), obj.getFieldId()); disposeSuccessfulTest(realm); }); }
Source:
<code>protected void markSectionAsSpecial(Map<String, Boolean> isSectionSpecialMappings, Map<String, List<String>> specialSectionsInSectionGroups, int sectionGroupIndex, String sectionToMark) { String sectionGroupParamName = Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionGroupIndex; specialSectionsInSectionGroups.putIfAbsent(sectionGroupParamName, new ArrayList<String>()); <START> specialSectionsInSectionGroups.get(sectionGroupParamName).add(sectionToMark); <END> isSectionSpecialMappings.put(sectionToMark, true); }</code><technical_language>combine computeIfAbsent</technical_language>

Target:
protected void markSectionAsSpecial(Map<String, Boolean> isSectionSpecialMappings, Map<String, List<String>> specialSectionsInSectionGroups, int sectionGroupIndex, String sectionToMark) { String sectionGroupParamName = Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionGroupIndex; specialSectionsInSectionGroups.computeIfAbsent(sectionGroupParamName, string -> new ArrayList<>()) .add(sectionToMark); isSectionSpecialMappings.put(sectionToMark, true); }
Source:
<code>private boolean isAttributeValueMatching(Attribute entityAttribute, String value) throws InternalErrorException { boolean shouldBeAccepted = true; if(entityAttribute.getValue() == null) { if(value!=null && !value.isEmpty()) { shouldBeAccepted = false; } } else { if (entityAttribute.getValue() instanceof String) { <START> String attrValue = (String) entityAttribute.getValue(); <END> if (!attrValue.equals(value)) { shouldBeAccepted = false; } } else if (entityAttribute.getValue() instanceof Integer) { Integer attrValue = (Integer) entityAttribute.getValue(); Integer valueInInteger = Integer.valueOf(value); if (attrValue.intValue() != valueInInteger.intValue()) { shouldBeAccepted = false; } } else { throw new InternalErrorException("Core attribute: " + entityAttribute + " is not type of String or Integer!"); } } return shouldBeAccepted; }</code><technical_language>"entityAttribute.valueAsString()"</technical_language>

Target:
private boolean isAttributeValueMatching(Attribute entityAttribute, String value) throws InternalErrorException { boolean shouldBeAccepted = true; if(entityAttribute.getValue() == null) { if(value!=null && !value.isEmpty()) { shouldBeAccepted = false; } } else { if (entityAttribute.getValue() instanceof String) { String attrValue = entityAttribute.valueAsString(); if (!attrValue.equals(value)) { shouldBeAccepted = false; } } else if (entityAttribute.getValue() instanceof Integer) { Integer attrValue = entityAttribute.valueAsInteger(); Integer valueInInteger = Integer.valueOf(value); if (attrValue.intValue() != valueInInteger.intValue()) { shouldBeAccepted = false; } } else { throw new InternalErrorException("Core attribute: " + entityAttribute + " is not type of String or Integer!"); } } return shouldBeAccepted; }
Source:
<code>public <V> BlockState with(final Property<V> property, final V value) { BlockState result = states.get(property, value); <START> return result == null ? this : result; <END> }</code><technical_language>While here, replace this states.row(property).getOrDefault(value, this) I think</technical_language>

Target:
public <V> BlockState with(final Property<V> property, final V value) { return states.row(property).getOrDefault(value, this); }
Source:
<code>private static void writeParam(JsonWriter writer, WebService.Param param) { writer.beginObject(); writer.prop("key", param.key()); writer.prop("description", param.description()); writer.prop("since", param.since()); writer.prop("required", param.isRequired()); writer.prop("internal", param.isInternal()); writer.prop("defaultValue", param.defaultValue()); writer.prop("exampleValue", param.exampleValue()); writer.prop("deprecatedSince", param.deprecatedSince()); writer.prop("deprecatedKey", param.deprecatedKey()); writer.prop("deprecatedKeySince", param.deprecatedKeySince()); writer.prop("maxValuesAllowed", param.maxValuesAllowed()); Set<String> possibleValues = param.possibleValues(); if (possibleValues != null) { writer.name("possibleValues").beginArray().values(possibleValues).endArray(); } <START> Integer maximumLength = param.maximumLength(); <END> if (maximumLength != null) { writer.prop("maximumLength", maximumLength); } writer.endObject(); }</code><technical_language>setNullable</technical_language>

Target:
private static void writeParam(JsonWriter writer, WebService.Param param) { writer.beginObject(); writer.prop("key", param.key()); writer.prop("description", param.description()); writer.prop("since", param.since()); writer.prop("required", param.isRequired()); writer.prop("internal", param.isInternal()); writer.prop("defaultValue", param.defaultValue()); writer.prop("exampleValue", param.exampleValue()); writer.prop("deprecatedSince", param.deprecatedSince()); writer.prop("deprecatedKey", param.deprecatedKey()); writer.prop("deprecatedKeySince", param.deprecatedKeySince()); writer.prop("maxValuesAllowed", param.maxValuesAllowed()); ofNullable(param.possibleValues()).ifPresent(possibleValues -> writer.name("possibleValues").beginArray().values(possibleValues).endArray()); ofNullable(param.maximumLength()).ifPresent(maximumLength -> writer.prop("maximumLength", maximumLength)); ofNullable(param.maximumValue()).ifPresent(maximumValue -> writer.prop("maximumValue", maximumValue)); writer.endObject(); }
Source:
<code>public void testAccountBuilder() throws JSONException { AccountBuilder accountBuilder = new AccountBuilder(refAccountId, refAccountName, refAccountStatus, null); Account accountByBuilder = accountBuilder.build(); <START> assertAccountAgainstReference(accountByBuilder, false, false, LATEST_CONTAINER_JSON_VERSION); <END> List<Container> containers = new ArrayList<>(); for (int i = 0; i < CONTAINER_COUNT; i++) { Container container = Container.fromJson(v2ContainerJsonList.get(i), refAccountId); containers.add(container); accountBuilder.addOrUpdateContainer(container); } accountByBuilder = accountBuilder.build(); assertAccountAgainstReference(accountByBuilder, true, true, LATEST_CONTAINER_JSON_VERSION); accountBuilder = new AccountBuilder(accountByBuilder); Account account2ByBuilder = accountBuilder.build(); assertAccountAgainstReference(account2ByBuilder, true, true, LATEST_CONTAINER_JSON_VERSION); }</code><technical_language>I this(test method) tested for container schema version V1</technical_language>

Target:
public void testAccountBuilder() throws JSONException { AccountBuilder accountBuilder = new AccountBuilder(refAccountId, refAccountName, refAccountStatus, null); Account accountByBuilder = accountBuilder.build(); assertAccountAgainstReference(accountByBuilder, false, false); List<Container> containers = new ArrayList<>(); for (int i = 0; i < CONTAINER_COUNT; i++) { Container container = Container.fromJson(containerJsonList.get(i), refAccountId); containers.add(container); accountBuilder.addOrUpdateContainer(container); } accountByBuilder = accountBuilder.build(); assertAccountAgainstReference(accountByBuilder, true, true); accountBuilder = new AccountBuilder(accountByBuilder); Account account2ByBuilder = accountBuilder.build(); assertAccountAgainstReference(account2ByBuilder, true, true); }
Source:
<code>public int getFreeThreadCount() { <START> return executor.getMaxThreads() + executor.getIdleThreads() - executor.getThreads(); <END> }</code><technical_language>is obvious. thx</technical_language>

Target:
public int getFreeThreadCount() { return (executor.getMaxThreads() - executor.getThreads()) + executor.getIdleThreads() ; }
Source:
<code>public void testHorizontalAlignment() { <START> m_label.setHorizontalAlignmentFromScout(-1); <END> String text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"left\"")); m_label.setHorizontalAlignmentFromScout(0); text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"center\"")); m_label.setHorizontalAlignmentFromScout(1); text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"right\"")); }</code><technical_language>SwingConstants.LEFT, etc</technical_language>

Target:
public void testHorizontalAlignment() { m_label.setHorizontalAlignmentFromScout(LABEL_HORIZONTAL_ALIGNMENT_LEFT); String text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"left\"")); m_label.setHorizontalAlignmentFromScout(LABEL_HORIZONTAL_ALIGNMENT_CENTER); text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"center\"")); m_label.setHorizontalAlignmentFromScout(LABEL_HORIZONTAL_ALIGNMENT_RIGHT); text = ((JTextPane) m_label.getSwingField()).getText(); assertTrue(text.contains("align=\"right\"")); }
Source:
<code>public long countEvents(AuditEvent eventTemplate, Calendar fromTime, Calendar toTime) { try { Session session = this.sessionFactory.getSessionFactory().openSession(); Criteria c = session.createCriteria(AuditEvent.class); if (eventTemplate != null) { c.add(Example.create(eventTemplate)); } setTimeInterval(c, fromTime, toTime); c.setProjection(Projections.rowCount()); <START> <END> @SuppressWarnings("rawtypes") List foundEntries = c.list(); if (foundEntries != null && !foundEntries.isEmpty()) { long rowCount = (long) foundEntries.get(0); return rowCount; } return 0; } catch (HibernateException ex) { this.logger.error("Failed to count audit event documents: {}", ex.getMessage(), ex); return -1; } }</code><technical_language>code duplication, this delegate method above</technical_language>

Target:
public long countEvents(AuditEvent eventTemplate, Calendar fromTime, Calendar toTime) { try { Session session = this.sessionFactory.getSessionFactory().openSession(); Criteria c = session.createCriteria(AuditEvent.class); if (eventTemplate != null) { c.add(Example.create(eventTemplate)); } setTimeInterval(c, fromTime, toTime); c.setProjection(Projections.rowCount()); @SuppressWarnings("rawtypes") List foundEntries = c.list(); if (foundEntries != null && !foundEntries.isEmpty()) { return (long) foundEntries.get(0); } return 0; } catch (HibernateException ex) { this.logger.error("Failed to count audit event documents: {}", ex.getMessage(), ex); return -1; } }
Source:
<code>private <T extends Item> List<T> executeQuery(final KeySetQuery query, final Class<T> itemClass) { final ItemConfiguration itemConfiguration = getItemConfiguration(itemClass); final String tableName = databaseSchemaHolder.schemaName() + "." + itemConfiguration.tableName(); final List<List<ItemId>> split_ids = split(new ArrayList<ItemId>(query.itemIds()), 100); final List<T> fetchedItems = new ArrayList<T>(); for (final List<ItemId> ids : split_ids) { final TableKeysAndAttributes keys = new TableKeysAndAttributes(tableName); for (final ItemId id : ids) { keys.addPrimaryKey(getPrimaryKey(id, itemConfiguration)); } BatchGetItemOutcome outcome = dynamoDBClient.batchGetItem(keys); do { final List<com.amazonaws.services.dynamodbv2.document.Item> items = outcome.getTableItems().get( tableName); for (final com.amazonaws.services.dynamodbv2.document.Item item : items) { fetchedItems.add(stringToItem(item.toJSON(), itemClass)); } final Map<String, KeysAndAttributes> unprocessedKeys = outcome.getUnprocessedKeys(); if (outcome.getUnprocessedKeys().size() == 0) { logger.debug("No unprocessed keys found"); } else { logger.debug("Retrieving the unprocessed keys"); <START> outcome = dynamoDBClient.batchGetItemUnprocessed(unprocessedKeys); <END> } } while (outcome.getUnprocessedKeys().size() > 0); } return fetchedItems; }</code><technical_language>if this results in zero unprocessed keys? items</technical_language>

Target:
private <T extends Item> List<T> executeQuery(final KeySetQuery query, final Class<T> itemClass) { final ItemConfiguration itemConfiguration = getItemConfiguration(itemClass); final String tableName = databaseSchemaHolder.schemaName() + "." + itemConfiguration.tableName(); final List<List<ItemId>> split_ids = split(new ArrayList<ItemId>(query.itemIds()), 100); final List<T> fetchedItems = new ArrayList<T>(); for (final List<ItemId> ids : split_ids) { final TableKeysAndAttributes keys = new TableKeysAndAttributes(tableName); for (final ItemId id : ids) { keys.addPrimaryKey(getPrimaryKey(id, itemConfiguration)); } processBatchRead(dynamoDBClient.batchGetItem(keys), fetchedItems, tableName, itemClass); } return fetchedItems; }
Source:
<code>public HttpRequest filter(HttpRequest request) throws HttpException { Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null"); <START> if (currentCreds.identity == null || currentCreds.identity.contains(":")) { <END> throw new AuthorizationException(String.format("Credential %s does not match format of integers and characters only", currentCreds.identity)); } return request.toBuilder().addHeader("X-Service-Key", currentCreds.identity).build(); }</code><technical_language>this ':' check? If alphanumeric characters allowed, a regexp more sense validate identity</technical_language>

Target:
public HttpRequest filter(HttpRequest request) throws HttpException { Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null"); if (currentCreds.identity == null) { throw new AuthorizationException("Credentials identity can not be null"); } return request.toBuilder().addHeader("X-Service-Key", currentCreds.identity).build(); }
Source:
<code><START> private void trimNonResidentQueue() { <END> Entry<V> e; int maxQueue2Size = nonResidentQueueSize * (mapSize - queue2Size); if (maxQueue2Size >= 0) { while (queue2Size > maxQueue2Size) { e = queue2.queuePrev; WeakReference<V> reference = e.reference; if (reference != null && reference.get() != null) { break; } int hash = getHash(e.key); remove(e.key, hash); } } }</code><technical_language>This method default visibility too</technical_language>

Target:
void trimNonResidentQueue() { int residentCount = mapSize - queue2Size; int maxQueue2SizeHigh = nonResidentQueueSizeHigh * residentCount; int maxQueue2Size = nonResidentQueueSize * residentCount; while (queue2Size > maxQueue2Size) { Entry<V> e = queue2.queuePrev; if (queue2Size <= maxQueue2SizeHigh) { WeakReference<V> reference = e.reference; if (reference != null && reference.get() != null) { break; } } int hash = getHash(e.key); remove(e.key, hash); } }
Source:
<code>public void testEntryAddedEventListener(DBMSType dbmsType, DBMSConnection dbmsConnection, DBMSProcessor dbmsProcessor) throws Exception { <START> System.out.println("dbmstype" + dbmsType); <END> setUp(dbmsConnection); BibEntry expectedEntry = getBibEntryExample(1); BibEntry furtherEntry = getBibEntryExample(1); bibDatabase.insertEntry(expectedEntry); bibDatabase.insertEntry(furtherEntry, EntryEventSource.SHARED); List<BibEntry> actualEntries = dbmsProcessor.getSharedEntries(); assertEquals(1, actualEntries.size()); assertEquals(expectedEntry, actualEntries.get(0)); clear(dbmsConnection); }</code><technical_language>removed</technical_language>

Target:
public void testEntryAddedEventListener(DBMSType dbmsType, DBMSConnection dbmsConnection, DBMSProcessor dbmsProcessor) throws Exception { setUp(dbmsConnection); BibEntry expectedEntry = getBibEntryExample(1); BibEntry furtherEntry = getBibEntryExample(1); bibDatabase.insertEntry(expectedEntry); bibDatabase.insertEntry(furtherEntry, EntriesEventSource.SHARED); List<BibEntry> actualEntries = dbmsProcessor.getSharedEntries(); assertEquals(1, actualEntries.size()); assertEquals(expectedEntry, actualEntries.get(0)); clear(dbmsConnection); }
Source:
<code>public MultipartContent() { <START> this("__END_OF_PART__" + java.util.UUID.randomUUID().toString() + "__"); <END> }</code><technical_language>Is a reason import java.util.UUID? e.g a conflict a similarly named class</technical_language>

Target:
public MultipartContent() { this("__END_OF_PART__" + UUID.randomUUID().toString() + "__"); }
Source:
<code>public Ban.Builder from(Ban ban) { reset(); this.banType = ban.getType(); if (this.banType.equals(BanTypes.PROFILE)) { this.profile = ((Ban.Profile) ban).getProfile(); } else { this.address = ((Ban.Ip) ban).getAddress(); } <START> this.reason = ban.getReason().orElseGet(null); <END> this.start = ban.getCreationDate(); this.end = ban.getExpirationDate().orElse(null); this.source = ban.getBanSource().orElse(null); return this; }</code><technical_language>orElse(null)</technical_language>

Target:
public Ban.Builder from(Ban ban) { reset(); this.banType = ban.getType(); if (this.banType.equals(BanTypes.PROFILE)) { this.profile = ((Ban.Profile) ban).getProfile(); } else { this.address = ((Ban.Ip) ban).getAddress(); } this.reason = ban.getReason().orElse(null); this.start = ban.getCreationDate(); this.end = ban.getExpirationDate().orElse(null); this.source = ban.getBanSource().orElse(null); return this; }
Source:
<code>public static TypeStrategy nullable(TypeStrategy initialStrategy) { return callContext -> { <START> Optional<DataType> initialType = initialStrategy.inferType(callContext); <END> return initialType.map(type -> { boolean isNullableArgument = callContext.getArgumentDataTypes() .stream() .anyMatch(dataType -> dataType.getLogicalType().isNullable()); if (isNullableArgument) { return type.nullable(); } else { return type.notNull(); } } ); }; }</code><technical_language>nit: I coding convension of calling this initialDataType logical types initalType. this is I in other type classes</technical_language>

Target:
public static TypeStrategy nullable(TypeStrategy initialStrategy) { return callContext -> { Optional<DataType> initialDataType = initialStrategy.inferType(callContext); return initialDataType.map(inferredDataType -> { boolean isNullableArgument = callContext.getArgumentDataTypes() .stream() .anyMatch(dataType -> dataType.getLogicalType().isNullable()); if (isNullableArgument) { return inferredDataType.nullable(); } else { return inferredDataType.notNull(); } } ); }; }
Source:
<code>public MappingModelExpressable getExpressionType() { SqlSelection first = selectClause.getSqlSelections().get(0); <START> return ( (SqlSelectionImpl) first ).getWrappedSqlExpression().getExpressionType(); <END> }</code><technical_language>more sense</technical_language>

Target:
public MappingModelExpressable getExpressionType() { SqlSelection first = selectClause.getSqlSelections().get(0); return first.getExpressionType(); }
Source:
<code>public void testDownsampleTransformMetricIsAllNull() { Transform downsampleTransform = new DownsampleTransform(); Map<Long, String> datapoints_1 = new HashMap<Long, String>(); <START> Metric metric_1 = new Metric(TEST_SCOPE + "1", TEST_METRIC); <END> metric_1.setDatapoints(datapoints_1); List<Metric> metrics = new ArrayList<Metric>(); metrics.add(metric_1); List<String> constants = new ArrayList<String>(); constants.add("3s-count"); Map<Long, String> expected_1 = new HashMap<Long, String>(); List<Metric> result = downsampleTransform.transform(metrics, constants); assertEquals(result.size(), 1); assertEquals(expected_1, result.get(0).getDatapoints()); }</code><technical_language>@aertoria change variable names in test method _1</technical_language>

Target:
public void testDownsampleTransformMetricIsAllNull() { Transform downsampleTransform = new DownsampleTransform(); Map<Long, String> datapoints = new HashMap<Long, String>(); Metric metric = new Metric(TEST_SCOPE + "1", TEST_METRIC); metric.setDatapoints(datapoints); List<Metric> metrics = new ArrayList<Metric>(); metrics.add(metric); List<String> constants = new ArrayList<String>(); constants.add("3s-count"); Map<Long, String> expected = new HashMap<Long, String>(); List<Metric> result = downsampleTransform.transform(metrics, constants); assertEquals(result.size(), 1); assertEquals(expected, result.get(0).getDatapoints()); }
Source:
<code>private void setServersInPoolTo(Set<InetSocketAddress> desiredServers) { Set<InetSocketAddress> serversToRemove = Sets.newHashSet(); Set<InetSocketAddress> serversToAdd = Sets.newHashSet(); Set<InetSocketAddress> cachedServers = getCachedServers(); serversToAdd.addAll(Sets.difference(desiredServers, cachedServers)); serversToRemove.addAll(Sets.difference(cachedServers, desiredServers)); serversToAdd.forEach(cassandra::addPool); serversToRemove.forEach(cassandra::removePool); if (!(serversToAdd.isEmpty() && serversToRemove.isEmpty())) { sanityCheckRingConsistency(); cassandra.refreshTokenRangesAndGetServers(); } <START> log.info("Cassandra pool refresh added hosts {}, removed hosts {}.", <END> SafeArg.of("serversToAdd", CassandraLogHelper.collectionOfHosts(serversToAdd)), SafeArg.of("serversToRemove", CassandraLogHelper.collectionOfHosts(serversToRemove))); }</code><technical_language>nit: valuable is empty refresh line? a refresh INFO a refresh DEBUG</technical_language>

Target:
private void setServersInPoolTo(Set<InetSocketAddress> desiredServers) { Set<InetSocketAddress> serversToRemove = Sets.newHashSet(); Set<InetSocketAddress> serversToAdd = Sets.newHashSet(); Set<InetSocketAddress> cachedServers = getCachedServers(); serversToAdd.addAll(Sets.difference(desiredServers, cachedServers)); serversToRemove.addAll(Sets.difference(cachedServers, desiredServers)); serversToAdd.forEach(cassandra::addPool); serversToRemove.forEach(cassandra::removePool); if (!(serversToAdd.isEmpty() && serversToRemove.isEmpty())) { sanityCheckRingConsistency(); cassandra.refreshTokenRangesAndGetServers(); } logRefreshedHosts(serversToAdd, serversToRemove); }
Source:
<code>public boolean connect(AccessPoint accessPoint, String password) throws TimeoutException, XBeeException { if (accessPoint == null) throw new NullPointerException("Access point cannot be null."); setParameter("ID", accessPoint.getSSID().getBytes()); setParameter("EE", new byte[]{(byte)accessPoint.getEncryptionType().getID()}); <START> if (password != null) <END> setParameter("PK", password.getBytes()); long deadLine = System.currentTimeMillis() + wifiReceiveTimeout; while (System.currentTimeMillis() < deadLine) { sleep(100); byte[] status = getParameter("AI"); if (status == null || status.length < 1) continue; if (status[0] == 0) return true; } return false; }</code><technical_language>check encryption for access point requires password? if (password != null && accessPoint.getEncryptionType != WiFiEncryptionType.NONE)</technical_language>

Target:
public boolean connect(AccessPoint accessPoint, String password) throws TimeoutException, XBeeException { if (accessPoint == null) throw new NullPointerException("Access point cannot be null."); setParameter("ID", accessPoint.getSSID().getBytes()); setParameter("EE", new byte[]{(byte)accessPoint.getEncryptionType().getID()}); if (password != null && accessPoint.getEncryptionType() != WiFiEncryptionType.NONE) setParameter("PK", password.getBytes()); long deadLine = System.currentTimeMillis() + wifiReceiveTimeout; while (System.currentTimeMillis() < deadLine) { sleep(100); byte[] status = getParameter("AI"); if (status == null || status.length < 1) continue; if (status[0] == 0) return true; } return false; }
Source:
<code>public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { final List<ConnectorIssue> issues = Lists.newArrayList(); final List<String> packagesCopy = Lists.newArrayList(defaultPackages); final File dir = fileSystem.baseDir(); Collection<File> directories = FileUtils.listFilesAndDirs(dir, new NotFileFilter(TrueFileFilter.INSTANCE), DirectoryFileFilter.DIRECTORY); Iterable<File> suites = Iterables.filter(directories, HAS_VALID_TEST_PACKAGE); for (File suite : suites) { <START> String suiteName = StringUtils.substringAfterLast(suite.getPath(), "/"); <END> if (defaultPackages.contains(suiteName)) { packagesCopy.remove(suiteName); } } if (packagesCopy.size() > 0) { for (String noSuite : packagesCopy) { issues.add(new ConnectorIssue(KEY, String.format("%s test suite directory doesn't exist.", WordUtils.capitalize(noSuite)))); } } return issues; }</code><technical_language>suite.name() simpleName, retrieves name absolute path. This is substringAfterLast... function</technical_language>

Target:
public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { final List<ConnectorIssue> issues = Lists.newArrayList(); final File dir = fileSystem.baseDir(); Collection<File> directories = FileUtils.listFilesAndDirs(dir, new NotFileFilter(TrueFileFilter.INSTANCE), DirectoryFileFilter.DIRECTORY); Iterable<File> suites = Iterables.filter(directories, HAS_VALID_TEST_PACKAGE); for (final String suite : packages) { if (!Iterables.any(suites, getPredicateForSuite(suite))) { issues.add(new ConnectorIssue(KEY, String.format("%s test suite directory doesn't exist.", WordUtils.capitalize(suite)))); } } return issues; }
Source:
<code>public Menu(Executor ex) { running = false; exec = ex; JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); <START> GridBagConstraints gbc = new GridBagConstraints(); <END> panel.setBackground(Color.black); gbc.gridx = 0; gbc.gridy = 0; gbc.insets = new Insets(0, 0, 50, 0); BufferedImage biTitle = SpriteSheet.getInstance().grabImage(172, 8, 231, 157); JLabel title = new JLabel(new ImageIcon(biTitle)); panel.add(title, gbc); btnNewGame = new JButton("New Game"); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy = 1; gbc.insets = new Insets(0, 50, 5, 50); panel.add(btnNewGame, gbc); btnStatistics = new JButton("Highscores"); gbc.gridy = 2; panel.add(btnStatistics, gbc); btnQuit = new JButton("Quit Game"); gbc.gridy = 3; panel.add(btnQuit, gbc); CardWindow.getInstance().addCard(panel, "MENUCARD"); }</code><technical_language>change this constraints (as I for transition screen)</technical_language>

Target:
public Menu(Executor ex) { running = false; exec = ex; JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); panel.setBackground(Color.black); constraints.gridx = 0; constraints.gridy = 0; constraints.insets = new Insets(0, 0, 50, 0); BufferedImage biTitle = SpriteSheet.getInstance().grabImage(172, 8, 231, 157); JLabel title = new JLabel(new ImageIcon(biTitle)); panel.add(title, constraints); btnNewGame = new JButton("New Game"); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridy = 1; constraints.insets = new Insets(0, 50, 5, 50); panel.add(btnNewGame, constraints); btnStatistics = new JButton("Highscores"); constraints.gridy = 2; panel.add(btnStatistics, constraints); btnQuit = new JButton("Quit Game"); constraints.gridy = 3; panel.add(btnQuit, constraints); CardWindow.getInstance().addCard(panel, "MENUCARD"); }
Source:
<code>protected AuditMessageType getParticipantObjectIdentificationForRequest( ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, AuditMessageType auditMsg) { auditMsg = getPatientParticipantObjectIdentification(request, auditMsg); auditMsg = getSubmissionSetParticipantObjectIdentification(request, auditMsg); <START> return auditMsg; <END> }</code><technical_language>Instead of assign return, return statement</technical_language>

Target:
protected AuditMessageType getParticipantObjectIdentificationForRequest( ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, AuditMessageType auditMsg) { getPatientParticipantObjectIdentification(request, auditMsg); getSubmissionSetParticipantObjectIdentification(request, auditMsg); return auditMsg; }
Source:
<code>public static void subqueryRestriction(RelNode relNode) { if(relNode instanceof HiveAggregate) { HiveAggregate aggregate = (HiveAggregate)relNode; if(!aggregate.getAggCallList().isEmpty() && aggregate.getGroupSet().isEmpty()) { throw new CalciteSubqueryRuntimeException("Subquery rewrite: Aggregate without group by is not allowed"); } } else if(relNode instanceof HiveProject || relNode instanceof HiveFilter) { subqueryRestriction(relNode.getInput(0)); } else { <START> return; <END> } }</code><technical_language>This is needed</technical_language>

Target:
public static void subqueryRestriction(RelNode relNode) { if (relNode instanceof HiveAggregate) { HiveAggregate aggregate = (HiveAggregate) relNode; if (!aggregate.getAggCallList().isEmpty() && aggregate.getGroupSet().isEmpty()) { throw new CalciteSubqueryRuntimeException( "Subquery rewrite: Aggregate without group by is not allowed"); } } else if (relNode instanceof HiveProject || relNode instanceof HiveFilter) { subqueryRestriction(relNode.getInput(0)); } }
Source:
<code>protected void parsePayload(ParsableByteArray data, long timeUs) { int packetType = data.readUnsignedByte(); <START> if (audioFormat != AUDIO_FORMAT_AAC || packetType == AAC_PACKET_TYPE_AAC_RAW) { <END> int bytes = data.bytesLeft(); output.sampleData(data, bytes); output.sampleMetadata(timeUs, C.BUFFER_FLAG_KEY_FRAME, bytes, 0, null); } else if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) { byte[] audioSpecifiConfig = new byte[data.bytesLeft()]; data.readBytes(audioSpecifiConfig, 0, audioSpecifiConfig.length); Pair<Integer, Integer> audioParams = CodecSpecificDataUtil.parseAacAudioSpecificConfig( audioSpecifiConfig); Format format = Format.createAudioSampleFormat(null, MimeTypes.AUDIO_AAC, null, Format.NO_VALUE, Format.NO_VALUE, audioParams.second, audioParams.first, Collections.singletonList(audioSpecifiConfig), null, 0, null); output.format(format); hasOutputFormat = true; } }</code><technical_language>swapped if/else order around? more natural blocks outputting formats outputting samples. put order again</technical_language>

Target:
protected void parsePayload(ParsableByteArray data, long timeUs) { int packetType = data.readUnsignedByte(); if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) { byte[] audioSpecifiConfig = new byte[data.bytesLeft()]; data.readBytes(audioSpecifiConfig, 0, audioSpecifiConfig.length); Pair<Integer, Integer> audioParams = CodecSpecificDataUtil.parseAacAudioSpecificConfig( audioSpecifiConfig); Format format = Format.createAudioSampleFormat(null, MimeTypes.AUDIO_AAC, null, Format.NO_VALUE, Format.NO_VALUE, audioParams.second, audioParams.first, Collections.singletonList(audioSpecifiConfig), null, 0, null); output.format(format); hasOutputFormat = true; } else if (audioFormat != AUDIO_FORMAT_AAC || packetType == AAC_PACKET_TYPE_AAC_RAW) { int bytes = data.bytesLeft(); output.sampleData(data, bytes); output.sampleMetadata(timeUs, C.BUFFER_FLAG_KEY_FRAME, bytes, 0, null); } }
Source:
<code>public TriggerResult onProcessingTime(long timestamp, W window, TriggerContext ctx) throws Exception { this.nestedTrigger.onProcessingTime(timestamp, window, ctx); if (shouldClearAtTimeout) { this.clear(window, ctx); } <START> return TriggerResult.FIRE; <END> }</code><technical_language>I return FIRE_AND_PURGE for if nested trigger returns "purge". do think</technical_language>

Target:
public TriggerResult onProcessingTime(long timestamp, W window, TriggerContext ctx) throws Exception { TriggerResult triggerResult = this.nestedTrigger.onProcessingTime(timestamp, window, ctx); if (shouldClearOnTimeout) { this.clear(window, ctx); } return triggerResult.isPurge() ? TriggerResult.FIRE_AND_PURGE : TriggerResult.FIRE; }
Source:
<code>public void run() { while (sleepWhileRunning(getDelayWithJitter())) { int today = getDateOfToday(); if (today > lastDate) { <START> lastId = Optional.of(ActiveUserCache.INITIAL_ID); <END> } if (lastId.isPresent()) { try { doPeriodicWork(today); } catch (Throwable t) { logger.warn("error in active user count: ", t); } } else { logger.debug("run: no work available"); } } synchronized (this) { finished = true; notifyAll(); } }</code><technical_language>This difficult for figure out. "lastId" is for is determine a scan table completed. sense name more that. this needs class-level scope, returned work method</technical_language>

Target:
public void run() { int lastDate = INITIAL_DATE; boolean doMoreWork = true; while (sleepWhileRunning(getDelayWithJitter())) { int today = getDateOfToday(); if (today > lastDate) { lastDate = today; doMoreWork = true; } if (doMoreWork) { try { doMoreWork = doPeriodicWork(today); } catch (Throwable t) { logger.warn("error in active user count: ", t); } } else { logger.debug("run: no work available"); } } synchronized (this) { finished = true; notifyAll(); } }
Source:
<code>protected void launch(ImmutableList.Builder<String> argsBuilder) { String args = Joiner.on(" ").join(argsBuilder.build()); List<String> commands = new LinkedList<String>(); <START> commands.add(String.format("%s/bin/mongod %s > out.log 2> err.log < /dev/null", getExpandedInstallDir(), args)); <END> newScript(LAUNCHING) .setFlag(SshTool.PROP_CONNECT_TIMEOUT, Duration.TEN_SECONDS.toMilliseconds()) .updateTaskAndFailOnNonZeroResultCode() .body.append(commands).execute(); }</code><technical_language>worth changing stdout/err redirections append files overwrite logs create-user script</technical_language>

Target:
protected void launch(ImmutableList.Builder<String> argsBuilder) { String args = Joiner.on(" ").join(argsBuilder.build()); String command = String.format("%s/bin/mongod %s >> out.log 2>> err.log < /dev/null", getExpandedInstallDir(), args); newScript(LAUNCHING) .setFlag(SshTool.PROP_CONNECT_TIMEOUT, Duration.TEN_SECONDS.toMilliseconds()) .updateTaskAndFailOnNonZeroResultCode() .body.append(command).execute(); }
Source:
<code>public void setupCaching(boolean cachingEnabled) throws IOException { if (cachingEnabled) { <START> setResourceDownloadProperty("cacheEnabled", "True"); <END> } else { setResourceDownloadProperty("cacheEnabled", "False"); } }</code><technical_language>Replace this for similar setResourceDownloadProperty("cacheEnabled", Boolean.toString(cachingEnabled);</technical_language>

Target:
public void setupCaching(boolean cachingEnabled) throws IOException { setResourceDownloadProperty("cacheEnabled", Boolean.toString(cachingEnabled)); }