auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void removeIncompatibleSeries(IChartTypeDefinition type) { Iterator<ChartSeries> iterator = fSeries.iterator(); while (iterator.hasNext()) { <START> ChartSeriesDialog series = (ChartSeriesDialog) checkNotNull(iterator.next()); <END> if (!type.checkIfXDescriptorValid(series.getX(), null) || !type.checkIfYDescriptorValid(series.getY(), null)) { Button button = series.getButton(); if (button != null) { button.dispose(); } iterator.remove(); } } }</code><technical_language>Remove checkNotNull</technical_language>

Target:
private void removeIncompatibleSeries(IChartTypeDefinition type) { Iterator<ChartSeries> iterator = fSelectedSeries.iterator(); while (iterator.hasNext()) { ChartSeriesDialog series = (ChartSeriesDialog) iterator.next(); if (!type.checkIfXDescriptorValid(series.getX(), null) || !type.checkIfYDescriptorValid(series.getY(), null)) { series.dispose(); iterator.remove(); } } }
Source:
<code>protected void onMeasure( int widthMeasureSpec, int heightMeasureSpec ) { measureChildren( widthMeasureSpec, heightMeasureSpec ); for( int i = 0; i < getChildCount(); i++ ) { View child = getChildAt( i ); if( child.getVisibility() != GONE ) { MarkerLayout.LayoutParams layoutParams = (MarkerLayout.LayoutParams) child.getLayoutParams(); int actualWidth = child.getMeasuredWidth(); int actualHeight = child.getMeasuredHeight(); float widthMultiplier = (layoutParams.anchorX == null) ? mAnchorX : layoutParams.anchorX; float heightMultiplier = (layoutParams.anchorY == null) ? mAnchorY : layoutParams.anchorY; float widthOffset = actualWidth * widthMultiplier; float heightOffset = actualHeight * heightMultiplier; <START> switch (layoutParams.typeAnchorX) { <END> case POS_ABSOLUTE_LEFT_TOP: widthOffset = widthMultiplier; break; case POS_ABSOLUTE_RIGHT_BOTTOM: widthOffset = widthMultiplier - actualWidth; break; } switch (layoutParams.typeAnchorY) { case POS_ABSOLUTE_LEFT_TOP: heightOffset = heightMultiplier; break; case POS_ABSOLUTE_RIGHT_BOTTOM: heightOffset = heightMultiplier - actualHeight; break; } int scaledX = FloatMathHelper.scale( layoutParams.x, mScale ); int scaledY = FloatMathHelper.scale( layoutParams.y, mScale ); layoutParams.mLeft = (int) (scaledX + widthOffset); layoutParams.mTop = (int) (scaledY + heightOffset); layoutParams.mRight = layoutParams.mLeft + actualWidth; layoutParams.mBottom = layoutParams.mTop + actualHeight; } } int availableWidth = MeasureSpec.getSize( widthMeasureSpec ); int availableHeight = MeasureSpec.getSize( heightMeasureSpec ); setMeasuredDimension( availableWidth, availableHeight ); }</code><technical_language>need recompute figured lines 148 149, add default case switch statements</technical_language>

Target:
protected void onMeasure( int widthMeasureSpec, int heightMeasureSpec ) { measureChildren( widthMeasureSpec, heightMeasureSpec ); for( int i = 0; i < getChildCount(); i++ ) { View child = getChildAt( i ); if( child.getVisibility() != GONE ) { MarkerLayout.LayoutParams layoutParams = (MarkerLayout.LayoutParams) child.getLayoutParams(); int actualWidth = child.getMeasuredWidth(); int actualHeight = child.getMeasuredHeight(); float widthMultiplier = (layoutParams.anchorX == null) ? mAnchorX : layoutParams.anchorX; float heightMultiplier = (layoutParams.anchorY == null) ? mAnchorY : layoutParams.anchorY; float widthOffset = actualWidth * widthMultiplier + layoutParams.absoluteAnchorX; float heightOffset = actualHeight * heightMultiplier + layoutParams.absoluteAnchorY; int scaledX = FloatMathHelper.scale( layoutParams.x, mScale ); int scaledY = FloatMathHelper.scale( layoutParams.y, mScale ); layoutParams.mLeft = (int) (scaledX + widthOffset); layoutParams.mTop = (int) (scaledY + heightOffset); layoutParams.mRight = layoutParams.mLeft + actualWidth; layoutParams.mBottom = layoutParams.mTop + actualHeight; } } int availableWidth = MeasureSpec.getSize( widthMeasureSpec ); int availableHeight = MeasureSpec.getSize( heightMeasureSpec ); setMeasuredDimension( availableWidth, availableHeight ); }
Source:
<code><START> public static void main(String[] args){ <END> String networkAddress = NetworkController.LOCALHOST; if (args.length > 0){ networkAddress = args[0]; } new Spectator(networkAddress, new TextView()); }</code><technical_language>provide a usage message if wrong. server.java</technical_language>

Target:
public static void main(String[] args){ String networkAddress = NetworkController.LOCALHOST; if (args.length == 1){ networkAddress = args[0]; } else { System.out.println("Usage: [<server-ip-address>]"); return; } new Spectator(networkAddress, new TextView()); }
Source:
<code>public PageControlSettingsUIBean() { try { String maxItemsPerPage = System.getProperty(MAX_ITEMS_PER_PAGE); if (maxItemsPerPage != null && Integer.parseInt(maxItemsPerPage) > 45) { <START> pageSizes = new SelectItem[] { new SelectItem("15", "15"), new SelectItem("30", "30"), <END> new SelectItem("45", "45"), new SelectItem(maxItemsPerPage, maxItemsPerPage) }; } } catch (NumberFormatException nfe) { } if (pageSizes == null) { pageSizes = new SelectItem[]{new SelectItem("15", "15"), new SelectItem("30", "30"), new SelectItem("45", "45")}; } }</code><technical_language>I I expect 15/30/45 scale max 1/4, 1/2 3/4 of max</technical_language>

Target:
public PageControlSettingsUIBean() { try { String maxItemsPerPage = System.getProperty(MAX_ITEMS_PER_PAGE); int maxItemsPerPageInt; if (maxItemsPerPage != null && (maxItemsPerPageInt = Integer.parseInt(maxItemsPerPage)) >= 45) { String tier0 = String.valueOf(Math.max(15, (int) (maxItemsPerPageInt * 0.25))); String tier1 = String.valueOf(Math.max(30, (int) (maxItemsPerPageInt * 0.50))); String tier2 = String.valueOf(Math.max(45, (int) (maxItemsPerPageInt * 0.75))); pageSizes = new SelectItem[] { new SelectItem(tier0, tier0), new SelectItem(tier1, tier1), new SelectItem(tier2, tier2), new SelectItem(maxItemsPerPage, maxItemsPerPage) }; } } catch (NumberFormatException nfe) { } if (pageSizes == null) { pageSizes = new SelectItem[]{new SelectItem("15", "15"), new SelectItem("30", "30"), new SelectItem("45", "45")}; } }
Source:
<code>public AttributeAxisIterator(ElementNode startNodeInfo) { this.startNodeInfo = startNodeInfo; this.iterator = startNodeInfo.node instanceof net.sourceforge.pmd.lang.ast.xpath.AttributeNode ? ((net.sourceforge.pmd.lang.ast.xpath.AttributeNode) startNodeInfo.node).getAttributeIterator() <START> : new net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator(startNodeInfo.node); <END> }</code><technical_language>I support here,</technical_language>

Target:
public AttributeAxisIterator(ElementNode startNodeInfo) { this.startNodeInfo = startNodeInfo; this.iterator = startNodeInfo.node.getXPathAttributesIterator(); }
Source:
<code>private void isValidEmail(CharSequence email) { <START> isValidEmail( email, "Expected a valid email for %1$s." ); <END> }</code><technical_language>Sounds a bit odd, "Expected %1$s a valid email"</technical_language>

Target:
private void isValidEmail(CharSequence email) { isValidEmail( email, "Expected %1$s to be a valid email." ); }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog alertDialog = (AlertDialog) super.onCreateDialog(savedInstanceState); RoboGuice.injectMembers(getContext(), this); et = new TextInputEditText(getContext()); til = new TextInputLayout(getContext()); til.addView(et); til.setHint(getContext().getString(R.string.email)); int paddingWidth = Math.round(getResources().getDimension(R.dimen.alert_dialog_padding_width)); int paddingHeight = Math.round(getResources().getDimension(R.dimen.alert_dialog_padding_height)); <START> til.setPadding(paddingWidth, paddingHeight, paddingWidth, paddingHeight); <END> alertDialog.setView(til); String email = getArguments().getString(EXTRA_LOGIN_EMAIL); if (email != null && !email.isEmpty()) { et.setText(email); } return alertDialog; }</code><technical_language>create a separate layout file</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog alertDialog = (AlertDialog) super.onCreateDialog(savedInstanceState); editText = new TextInputEditText(getContext()); textInputLayout = new TextInputLayout(getContext()); textInputLayout.addView(editText); textInputLayout.setHint(getContext().getString(R.string.email)); int paddingWidth = Math.round(getResources().getDimension(R.dimen.alert_dialog_padding_width)); int paddingHeight = Math.round(getResources().getDimension(R.dimen.alert_dialog_padding_height)); textInputLayout.setPadding(paddingWidth, paddingHeight, paddingWidth, paddingHeight); alertDialog.setView(textInputLayout); editText.setText(getArguments().getString(EXTRA_LOGIN_EMAIL)); return alertDialog; }
Source:
<code><START> public Object transform(Object o) throws SQLException { <END> if (o == null) { return null; } if (!(o instanceof java.math.BigDecimal)) { throw new UnsupportedOperationException(this.getClass().getSimpleName() + " cannot transform objects of type " + o.getClass().getName()); } java.math.BigDecimal bd = new java.math.BigDecimal(((java.math.BigDecimal) o).toString()); return bd; }</code><technical_language>BTW - statements in implementation throwing SQLException I remove throws clause (and related import tests)</technical_language>

Target:
public Object transform(Object o) { if (o == null) { return null; } if (!(o instanceof java.math.BigDecimal)) { throw new UnsupportedOperationException(this.getClass().getSimpleName() + " cannot transform objects of type " + o.getClass().getName()); } return new java.math.BigDecimal(((java.math.BigDecimal) o).toString()); }
Source:
<code>public BulkServiceImpl(BulkServiceDescriptor descriptor) { this.descriptor = descriptor; kvStore = Framework.getService(KeyValueService.class).getKeyValueStore(descriptor.kvStore); <START> logManager = Framework.getService(StreamService.class).getLogManager(descriptor.logConfig); <END> }</code><technical_language>Please store these, time needed. want store service-derived information in long-running components</technical_language>

Target:
public BulkServiceImpl(BulkServiceDescriptor descriptor) { this.descriptor = descriptor; }
Source:
<code>public I18nEmailMgtConfigServiceClient(String url, ConfigurationContext configContext) throws Exception { try { stub = new I18NEmailMgtConfigServiceStub(configContext, url + "I18nEmailMgtConfigService"); <START> } catch (java.lang.Exception e) { <END> handleException(e.getMessage(), e); } }</code><technical_language>package name of "Exception" is redundant. simply "Exception" instead</technical_language>

Target:
public I18nEmailMgtConfigServiceClient(String url, ConfigurationContext configContext) throws Exception { try { stub = new I18NEmailMgtConfigServiceStub(configContext, url + "I18nEmailMgtConfigService"); } catch (Exception e) { handleException(e.getMessage(), e); } }
Source:
<code>private void endTurn(GameBean game) throws GameException { boolean shouldUpdateNextMove = true; if (game.getStage().equals(GameStage.PREPARATION)) { Integer previousPreparationCycle = game.getPreparationCycle(); preparationStageUtil.updateGameStageToMain(game); preparationStageUtil.updateCurrentCycleInitialBuildingNumber(game); preparationStageUtil.updatePreparationCycle(game); Integer newPreparationCycle = game.getPreparationCycle(); boolean preparationFinished = newPreparationCycle == null && !game.getCurrentMove().equals(1); shouldUpdateNextMove = (preparationFinished || previousPreparationCycle.equals(newPreparationCycle)); } else { <START> game.setDiceThrown(false); <END> } if (shouldUpdateNextMove) { playUtil.updateNextMove(game); } }</code><technical_language>change in scope of this story</technical_language>

Target:
private void endTurn(GameBean game) throws GameException { switch (game.getStage()) { case PREPARATION: Integer previousPreparationCycle = game.getPreparationCycle(); preparationStageUtil.updateGameStageToMain(game); preparationStageUtil.updateCurrentCycleInitialBuildingNumber(game); preparationStageUtil.updatePreparationCycle(game); if (game.getPreparationCycle() == null || previousPreparationCycle.equals(game.getPreparationCycle())) { preparationStageUtil.updateNextMove(game); } break; case MAIN: mainStageUtil.resetDices(game); mainStageUtil.updateNextMove(game); break; } }
Source:
<code>private static boolean isPresent() { try { Class.forName("com.chikli.hudson.plugin.naginator.NaginatorScheduleAction"); return true; <START> } catch (Throwable ex) { <END> return false; } }</code><technical_language>ClassNotFoundException. Catching exceptions disposing miss unexpected exceptions</technical_language>

Target:
private static boolean isPresent() { try { Class.forName("com.chikli.hudson.plugin.naginator.NaginatorScheduleAction"); return true; } catch (ClassNotFoundException ex) { log.log(Level.FINEST, "Naginator not available. ", ex); return false; } }
Source:
<code>public boolean hasTier(String tier) { MinMaxPriorityQueue<ServerHolder> servers = historicals.get(tier); <START> return (servers != null) && !servers.isEmpty(); <END> }</code><technical_language>This logic flipped</technical_language>

Target:
public boolean hasTier(String tier) { NavigableSet<ServerHolder> servers = historicals.get(tier); return (servers != null) && !servers.isEmpty(); }
Source:
<code><START> public boolean isLicenseCC() { <END> if (!(TextUtils.isEmpty(license) && TextUtils.isEmpty(licenseShortName))) { if (license.startsWith("cc") || licenseShortName.toLowerCase().startsWith("cc")) { return true; } } return false; }</code><technical_language>Minor: adding a method returns empty string if input is a null string, emtptyIfNull()? this method becomes: public boolean isLicenseCC() { return emptyIfNull(license).toLowerCase().startsWith(CREATIVE_COMMONS_PREFIX) || emptyIfNull(licenseShortName).toLowerCase().startsWith(CREATIVE_COMMONS_PREFIX); }</technical_language>

Target:
public boolean isLicenseCC() { return StringUtil.emptyIfNull(license).toLowerCase().startsWith(CREATIVE_COMMONS_PREFIX) || StringUtil.emptyIfNull(licenseShortName).toLowerCase().startsWith(CREATIVE_COMMONS_PREFIX); }
Source:
<code>public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { int numOfMsqChoices = 0; List<String> msqChoices = new LinkedList<String>(); boolean msqOtherEnabled = false; <START> if (HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_MSQOTHEROPTIONFLAG) != null <END> && HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_MSQOTHEROPTIONFLAG).equals("on")) { msqOtherEnabled = true; } String generatedMsqOptions = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_GENERATEDOPTIONS); if (generatedMsqOptions.equals(FeedbackParticipantType.NONE.toString())) { String numMsqChoicesCreatedString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED); Assumption.assertNotNull("Null number of choice for MSQ", numMsqChoicesCreatedString); int numMsqChoicesCreated = Integer.parseInt(numMsqChoicesCreatedString); for(int i = 0; i < numMsqChoicesCreated; i++) { String msqChoice = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_MSQCHOICE + "-" + i); if(msqChoice != null && !msqChoice.trim().isEmpty()) { msqChoices.add(msqChoice); numOfMsqChoices++; } } this.setMsqQuestionDetails(numOfMsqChoices, msqChoices, msqOtherEnabled); } else { this.setMsqQuestionDetails(FeedbackParticipantType.valueOf(generatedMsqOptions)); } return true; }</code><technical_language>extract this a local variable for clarity</technical_language>

Target:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { int numOfMsqChoices = 0; List<String> msqChoices = new LinkedList<String>(); boolean msqOtherEnabled = false; String otherOptionFlag = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_MSQOTHEROPTIONFLAG); if (otherOptionFlag != null && otherOptionFlag.equals("on")) { msqOtherEnabled = true; } String generatedMsqOptions = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_GENERATEDOPTIONS); if (generatedMsqOptions.equals(FeedbackParticipantType.NONE.toString())) { String numMsqChoicesCreatedString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED); Assumption.assertNotNull("Null number of choice for MSQ", numMsqChoicesCreatedString); int numMsqChoicesCreated = Integer.parseInt(numMsqChoicesCreatedString); for(int i = 0; i < numMsqChoicesCreated; i++) { String msqChoice = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_MSQCHOICE + "-" + i); if(msqChoice != null && !msqChoice.trim().isEmpty()) { msqChoices.add(msqChoice); numOfMsqChoices++; } } this.setMsqQuestionDetails(numOfMsqChoices, msqChoices, msqOtherEnabled); } else { this.setMsqQuestionDetails(FeedbackParticipantType.valueOf(generatedMsqOptions)); } return true; }
Source:
<code>public V put(K key, V value) { V previousValue = super.put(key, logIfNull(value)); if (previousValue != null) { if (log.isWarnEnabled()) { log.warn("Detected duplicate map keys which are not allowed by Conjure", new IllegalArgumentException()); } assert false : "Duplicate values for the same key are not allowed by Conjure. Key '" <START> + key + "' values ['" + value + "', '" + previousValue + "']"; <END> } return previousValue; }</code><technical_language>performance nit: want pull logic if block out a separate method main put method bytecode is small JITed & inlined, while duplicate logging & assert is out-lined in separate slow path</technical_language>

Target:
public V put(K key, V value) { V previousValue = super.put(key, logIfNull(value)); if (previousValue != null) { onDuplicateKey(key, previousValue, value); } return previousValue; }
Source:
<code>private ValidationResult validateRangePart(String rangePart) { <START> rangePart.toLowerCase(); <END> boolean matches = MAC_ADDRESS_PATTERN.matcher(rangePart).matches(); if (!matches) { return new ValidationResult(false, "The range start/end is an invalid MAC address. " + rangePart + " should be in a format of AA:AA:AA:AA:AA:AA"); } else { return new ValidationResult(true); } }</code><technical_language>assignment ?? is importance case sensitivity</technical_language>

Target:
private ValidationResult validateRangePart(String rangePart) { boolean matches = MAC_ADDRESS_PATTERN.matcher(rangePart).matches(); if (!matches) { return new ValidationResult(false, "The range start/end is an invalid MAC address. " + rangePart + " should be in a format of AA:AA:AA:AA:AA:AA"); } else { return new ValidationResult(true); } }
Source:
<code><START> public static void setSecurityManager() { <END> URL resourceURL = CarbonBaseUtilsTest.class.getClassLoader().getResource(""); if (resourceURL != null) { String resourcePath = resourceURL.getPath(); resourcePath = resourcePath + "policy-test.policy"; System.setProperty("java.security.policy", resourcePath); System.setSecurityManager(new SecurityManager()); } }</code><technical_language>this is a static method</technical_language>

Target:
public void setSecurityManager() { URL resourceURL = CarbonBaseUtilsTest.class.getClassLoader().getResource(""); if (resourceURL != null) { String resourcePath = resourceURL.getPath(); resourcePath = resourcePath + "policy-test.policy"; System.setProperty("java.security.policy", resourcePath); System.setSecurityManager(new SecurityManager()); } }
Source:
<code><START> public ArrayInterface setBoolean(int index, boolean value) { <END> return setObject(index, value); }</code><technical_language>I return Array here</technical_language>

Target:
public Array setBoolean(int index, boolean value) { return setObject(index, value); }
Source:
<code>public void testPutAll() throws Exception { Store<Number, CharSequence> store = mock(Store.class); Ehcache<Number, CharSequence> ehcache = new Ehcache<Number, CharSequence>(cacheConfig, store); ehcache.init(); <START> <END> ehcache.put(100, "one hundred"); ehcache.put(101, "one hundred one"); ehcache.putAll(new HashMap<Number, CharSequence>() {{ put(1, "one"); put(2, "two"); put(3, "three"); }}.entrySet()); CacheStatistics stats = ehcache.getStatistics(); System.out.println(stats.getCachePuts()); verify(store).bulkCompute(argThat(hasItems(1, 2, 3)), any(Function.class)); }</code><technical_language>I stats deserve tests, hijacking some other ones. I suppose this is some experiment leftover forgot cleanup</technical_language>

Target:
public void testPutAll() throws Exception { Store<Number, CharSequence> store = mock(Store.class); Ehcache<Number, CharSequence> ehcache = new Ehcache<Number, CharSequence>(cacheConfig, store); ehcache.init(); ehcache.putAll(new HashMap<Number, CharSequence>() {{ put(1, "one"); put(2, "two"); put(3, "three"); }}.entrySet()); verify(store).bulkCompute(argThat(hasItems(1, 2, 3)), any(Function.class)); }
Source:
<code>private JSONObject getTableExtendedProperties(final String tableName) throws FalconException { JSONObject table = tablesMap.get(tableName); if (table == null) { throw new FalconException("JSON object tables not found in ADF request."); } try { JSONObject tableProperties = table.getJSONObject(ADFJsonConstants.ADF_REQUEST_PROPERTIES); if (tableProperties == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_PROPERTIES + " not found in ADF request."); } JSONObject tablesLocation = tableProperties.getJSONObject(ADFJsonConstants.ADF_REQUEST_LOCATION); if (tablesLocation == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_LOCATION + " not found in ADF request."); } JSONObject tableExtendedProperties = tablesLocation.getJSONObject(ADFJsonConstants. ADF_REQUEST_EXTENDED_PROPERTIES); if (tableExtendedProperties == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_EXTENDED_PROPERTIES + " not found in ADF request."); } return tableExtendedProperties; } catch (JSONException e) { <START> throw new FalconException("Error when parsing ADF JSON message: " + table, e); <END> } }</code><technical_language>change Error while parsing</technical_language>

Target:
private JSONObject getTableExtendedProperties(final String tableName) throws FalconException { JSONObject table = tablesMap.get(tableName); if (table == null) { throw new FalconException("JSON object table " + tableName + " not found in ADF request."); } try { JSONObject tableProperties = table.getJSONObject(ADFJsonConstants.ADF_REQUEST_PROPERTIES); if (tableProperties == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_PROPERTIES + " not found in ADF request."); } JSONObject tablesLocation = tableProperties.getJSONObject(ADFJsonConstants.ADF_REQUEST_LOCATION); if (tablesLocation == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_LOCATION + " not found in ADF request."); } JSONObject tableExtendedProperties = tablesLocation.getJSONObject(ADFJsonConstants. ADF_REQUEST_EXTENDED_PROPERTIES); if (tableExtendedProperties == null) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_EXTENDED_PROPERTIES + " not found in ADF request."); } return tableExtendedProperties; } catch (JSONException e) { throw new FalconException("Error while parsing ADF JSON message: " + table, e); } }
Source:
<code>Master setMaster(int numOfWorkers) { ArrayTransposeMaster master = new ArrayTransposeMaster(numOfWorkers); <START> return master; <END> }</code><technical_language>one-liner</technical_language>

Target:
Master setMaster(int numOfWorkers) { return new ArrayTransposeMaster(numOfWorkers); }
Source:
<code>private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ArrayList<ProcessingStep> steps = new ArrayList<>(); if (IArtifactDescriptor.TYPE_ZIP.equals(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE))) steps.add(new ZipVerifierStep()); Set<String> skipChecksums = DOWNLOAD_MD5_CHECKSUM_ENABLED ? <START> Collections.<String> <END> emptySet() : Collections.singleton(ChecksumUtilities.MD5); addChecksumVerifiers(descriptor, steps, skipChecksums, IArtifactDescriptor.DOWNLOAD_CHECKSUM); if (steps.isEmpty()) return destination; ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]); return handler.link(stepArray, destination, monitor); }</code><technical_language>needed Java 8</technical_language>

Target:
private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ArrayList<ProcessingStep> steps = new ArrayList<>(); if (IArtifactDescriptor.TYPE_ZIP.equals(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE))) steps.add(new ZipVerifierStep()); Set<String> skipChecksums = DOWNLOAD_MD5_CHECKSUM_ENABLED ? Collections.emptySet() : Collections.singleton(ChecksumUtilities.MD5); addChecksumVerifiers(descriptor, steps, skipChecksums, IArtifactDescriptor.DOWNLOAD_CHECKSUM); if (steps.isEmpty()) return destination; ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]); return handler.link(stepArray, destination, monitor); }
Source:
<code>public WifiInfo get(final String senseId) { <START> return getRemotely(senseId, Boolean.FALSE).get(); <END> }</code><technical_language>call .get() verifying WifiInfo is present</technical_language>

Target:
public Optional<WifiInfo> get(final String senseId) { final HashMap<String, AttributeValue> key = Maps.newHashMap(); key.put(SENSE_ATTRIBUTE_NAME, new AttributeValue().withS(senseId)); final GetItemRequest getItemRequest = new GetItemRequest() .withTableName(wifiTableName) .withKey(key); try { final GetItemResult getItemResult = dynamoDBClient.getItem(getItemRequest); final Map<String, AttributeValue> item = getItemResult.getItem(); return createWifiInfofromDynamoDBItem(item, senseId); } catch (AmazonServiceException ase) { LOGGER.error("Failed to get wifi info for {}", senseId); return Optional.absent(); } }
Source:
<code>public final T createOrReplace(T... items) { T itemToCreateOrReplace = getItem(); if (items.length > 1) { throw new IllegalArgumentException("Too many items to create."); } else if (items.length == 1) { itemToCreateOrReplace = items[0]; } if (itemToCreateOrReplace == null) { throw new IllegalArgumentException("Nothing to create."); } if (Utils.isNullOrEmpty(name)) { return withName(itemToCreateOrReplace.getMetadata().getName()).createOrReplace(itemToCreateOrReplace); } final CompletableFuture<T> future = new CompletableFuture<>(); <START> while (!future.isDone()) { <END> try { KubernetesResourceUtil.setResourceVersion(itemToCreateOrReplace, null); future.complete(create(itemToCreateOrReplace)); } catch (KubernetesClientException exception) { final T itemFromServer; if (exception.getCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) { itemFromServer = fromServer().get(); if (itemFromServer == null) { try { Thread.sleep(200); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } continue; } } else if (exception.getCode() != HttpURLConnection.HTTP_CONFLICT) { throw exception; } else { itemFromServer = fromServer().get(); } KubernetesResourceUtil.setResourceVersion(itemToCreateOrReplace, KubernetesResourceUtil.getResourceVersion(itemFromServer)); future.complete(replace(itemToCreateOrReplace)); } } return future.join(); }</code><technical_language>application infinite loop in case some server error is permanently (or for a long period) affecting server. add a a MAX_RETRIES limit check too</technical_language>

Target:
public final T createOrReplace(T... items) { T itemToCreateOrReplace = getItem(); if (items.length > 1) { throw new IllegalArgumentException("Too many items to create."); } else if (items.length == 1) { itemToCreateOrReplace = items[0]; } if (itemToCreateOrReplace == null) { throw new IllegalArgumentException("Nothing to create."); } if (Utils.isNullOrEmpty(name)) { return withName(itemToCreateOrReplace.getMetadata().getName()).createOrReplace(itemToCreateOrReplace); } T finalItemToCreateOrReplace = itemToCreateOrReplace; CreateOrReplaceHelper<T> createOrReplaceHelper = new CreateOrReplaceHelper<>( this::create, this::replace, m -> { try { return waitUntilCondition(Objects::nonNull, 1, TimeUnit.SECONDS); } catch (InterruptedException interruptedException) { interruptedException.printStackTrace(); } return null; }, m -> fromServer().get() ); return createOrReplaceHelper.createOrReplace(finalItemToCreateOrReplace); }
Source:
<code>protected TimeEvent createTimeEvent(TimeGraphEntry entry, ITimeGraphState state) { if (state.getValue() == Integer.MIN_VALUE) { return new NullTimeEvent(entry, state.getStartTime(), state.getDuration()); } <START> int value = ((int) state.getValue()); <END> String label = state.getLabel(); if (label != null) { return new NamedTimeEvent(entry, state.getStartTime(), state.getDuration(), value, label); } return new TimeEvent(entry, state.getStartTime(), state.getDuration(), value); }</code><technical_language>need modulo here, right</technical_language>

Target:
protected TimeEvent createTimeEvent(TimeGraphEntry entry, ITimeGraphState state) { if (state.getValue() == Integer.MIN_VALUE) { return new NullTimeEvent(entry, state.getStartTime(), state.getDuration()); } final int modulo = CallStackPresentationProvider.NUM_COLORS / 2; int value = ((int) state.getValue()) % modulo + modulo; String label = state.getLabel(); if (label != null) { return new NamedTimeEvent(entry, state.getStartTime(), state.getDuration(), value, label); } return new TimeEvent(entry, state.getStartTime(), state.getDuration(), value); }
Source:
<code>private boolean isCurrentNetworkSufficient(WifiInfo wifiInfo, List<ScanDetail> scanDetails) { WifiConfiguration network = mWifiConfigManager.getConfiguredNetwork(wifiInfo.getNetworkId()); if (network == null) { localLog("No current connected network."); return false; } else { localLog("Current connected network: " + network.SSID + " , ID: " + network.networkId); } if (network.ephemeral) { localLog("Current network is an ephemeral one."); return false; } if (WifiConfigurationUtil.isConfigForOpenNetwork(network)) { localLog("Current network is a open one."); return false; } int currentRssi = wifiInfo.getRssi(); if (wifiInfo.is24GHz()) { if (is5GHzNetworkAvailable(scanDetails)) { localLog("Current network is 2.4GHz. 5GHz networks available."); return false; } if (currentRssi < mThresholdQualifiedRssi24) { localLog("Current network band=2.4GHz, RSSI[" + currentRssi + "]-acceptable but not qualified."); return false; } } else if (wifiInfo.is5GHz()) { if (currentRssi < mThresholdQualifiedRssi5) { localLog("Current network band=5GHz, RSSI[" + currentRssi + "]-acceptable but not qualified."); return false; } } else { <START> Log.e(TAG, "We're on a wifi network that's neither 2.4 or 5GHz... aliens!"); <END> } return true; }</code><technical_language>return false;</technical_language>

Target:
private boolean isCurrentNetworkSufficient(WifiInfo wifiInfo, List<ScanDetail> scanDetails) { WifiConfiguration network = mWifiConfigManager.getConfiguredNetwork(wifiInfo.getNetworkId()); if (network == null) { localLog("No current connected network."); return false; } else { localLog("Current connected network: " + network.SSID + " , ID: " + network.networkId); } if (network.ephemeral) { localLog("Current network is an ephemeral one."); return false; } if (WifiConfigurationUtil.isConfigForOpenNetwork(network)) { localLog("Current network is a open one."); return false; } int currentRssi = wifiInfo.getRssi(); if (wifiInfo.is24GHz()) { if (is5GHzNetworkAvailable(scanDetails)) { localLog("Current network is 2.4GHz. 5GHz networks available."); return false; } if (currentRssi < mThresholdQualifiedRssi24) { localLog("Current network band=2.4GHz, RSSI[" + currentRssi + "]-acceptable but not qualified."); return false; } } else if (wifiInfo.is5GHz()) { if (currentRssi < mThresholdQualifiedRssi5) { localLog("Current network band=5GHz, RSSI[" + currentRssi + "]-acceptable but not qualified."); return false; } } else { Log.e(TAG, "We're on a wifi network that's neither 2.4 or 5GHz... aliens!"); return false; } return true; }
Source:
<code>public List<Event> findEventsByCorrelationUid(final String organisationIdentification, final String correlationUid) throws OsgpException { LOGGER.info("findEventsByCorrelationUid called with organisation {}}", organisationIdentification); this.domainHelperService.findOrganisation(organisationIdentification); <START> final List<ResponseData> meterResponseDataList = this.responseDataRepository <END> .findByCorrelationUid(correlationUid); final List<Event> events = new ArrayList<>(); final List<ResponseData> meterResponseDataToDeleteList = new ArrayList<>(); for (final ResponseData meterResponseData : meterResponseDataList) { final Serializable messageData = meterResponseData.getMessageData(); if (messageData instanceof EventMessagesResponse) { events.addAll(((EventMessagesResponse) messageData).getEvents()); meterResponseDataToDeleteList.add(meterResponseData); } else { if (messageData instanceof String) { throw new TechnicalException(ComponentType.UNKNOWN, (String) messageData); } LOGGER.info( "findEventsByCorrelationUid also found other type of meter response data: for correlation UID: {}", messageData.getClass().getName(), correlationUid); } } LOGGER.info("deleting MeterResponseData rows", meterResponseDataToDeleteList.size()); this.responseDataRepository.delete(meterResponseDataToDeleteList); LOGGER.info("returning a list containing events", events.size()); return events; }</code><technical_language>cleaner rename variable name renaming type? Besides, for a correlationUid response data record I think, odd put in a list</technical_language>

Target:
public List<Event> findEventsByCorrelationUid(final String organisationIdentification, final String correlationUid) throws OsgpException { LOGGER.info("findEventsByCorrelationUid called with organisation {}}", organisationIdentification); this.domainHelperService.findOrganisation(organisationIdentification); final ResponseData responseData = this.responseDataRepository.findByCorrelationUid(correlationUid); final List<Event> events = new ArrayList<>(); final Serializable messageData = responseData.getMessageData(); if (messageData instanceof EventMessagesResponse) { events.addAll(((EventMessagesResponse) messageData).getEvents()); LOGGER.info("deleting ResponseData for correlation uid {}.", correlationUid); this.responseDataRepository.delete(responseData); } else { if (messageData instanceof String) { throw new TechnicalException(ComponentType.UNKNOWN, (String) messageData); } LOGGER.info( "findEventsByCorrelationUid found other type of meter response data: for correlation UID: {}", messageData.getClass().getName(), correlationUid); } LOGGER.info("returning a list containing events", events.size()); return events; }
Source:
<code>public static FileUtils.FileCopyResult copyToFileAndClose(InputStream is, File file) throws IOException { file.getParentFile().mkdirs(); try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) { ByteStreams.copy(is, os); } finally { CloseQuietly.close(is); } <START> return FileUtils.FileCopyResult.buildResult(file.toPath()); <END> }</code><technical_language>I concerned addition of buildResult here, this single copy read data for copy for checksum, instead of before, expensive dealing large files performance regressions</technical_language>

Target:
public static long copyToFileAndClose(InputStream is, File file) throws IOException { file.getParentFile().mkdirs(); try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) { return ByteStreams.copy(is, os); } finally { CloseQuietly.close(is); } }
Source:
<code>public void testMaxRowsPerSegment() throws Exception { expectPublishedSegments(2); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); for (int i = 0; i < 2000; i++) { firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo-" + i, "met1", "1") ) ); } firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2000, task.getMetrics().processed()); Assert.assertEquals(0, task.getMetrics().thrownAway()); Assert.assertEquals(0, task.getMetrics().unparseable()); <START> Assert.assertEquals(2000, sumMetric(task, null, "met1").longValue()); <END> Assert.assertEquals(2000, sumMetric(task, null, "met1").longValue()); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Pair<Executor, Runnable> executorRunnablePair = handOffCallbacks.get( new SegmentDescriptor( publishedSegment.getInterval(), publishedSegment.getVersion(), publishedSegment.getShardSpec().getPartitionNum() ) ); Assert.assertNotNull( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, executorRunnablePair ); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }</code><technical_language>rows -> met1</technical_language>

Target:
public void testMaxRowsPerSegment() throws Exception { expectPublishedSegments(2); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); for (int i = 0; i < 2000; i++) { firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo-" + i, "met1", "1") ) ); } firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2000, task.getRowIngestionMeters().getProcessed()); Assert.assertEquals(0, task.getRowIngestionMeters().getThrownAway()); Assert.assertEquals(0, task.getRowIngestionMeters().getUnparseable()); Assert.assertEquals(2000, sumMetric(task, null, "rows").longValue()); Assert.assertEquals(2000, sumMetric(task, null, "met1").longValue()); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Pair<Executor, Runnable> executorRunnablePair = handOffCallbacks.get( new SegmentDescriptor( publishedSegment.getInterval(), publishedSegment.getVersion(), publishedSegment.getShardSpec().getPartitionNum() ) ); Assert.assertNotNull( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, executorRunnablePair ); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }
Source:
<code>public static Flowable<Long> rangeLong(long start, long count) { if (count < 0) { throw new IllegalArgumentException("count >= 0 required but it was " + count); } if (count == 0) { return empty(); } if (count == 1) { return just(start); } <START> if (start + (count - 1) > Long.MAX_VALUE) { <END> throw new IllegalArgumentException("Long overflow"); } return RxJavaPlugins.onAssembly(new FlowableRangeLong(start, count)); }</code><technical_language>is false. check if start + count - 1 flips negative</technical_language>

Target:
public static Flowable<Long> rangeLong(long start, long count) { if (count < 0) { throw new IllegalArgumentException("count >= 0 required but it was " + count); } if (count == 0) { return empty(); } if (count == 1) { return just(start); } long end = start + (count - 1); if (start > 0 && end < 0) { throw new IllegalArgumentException("Overflow! start + count is bigger than Long.MAX_VALUE"); } return RxJavaPlugins.onAssembly(new FlowableRangeLong(start, count)); }
Source:
<code>private void doSerialization(Element field, TemplateInput param) throws TemplateInputBadFormat { <START> field.addAttribute("name", param.getName()); <END> InputType type = param.getType(); if (type == null) { if (param.getStringValue() == null) { log.warn(param.getName() + " is null"); throw new TemplateInputBadFormat(); } else type = StringValue; } field.addAttribute("type", type.getValue()); if (param.isReadOnly()) field.addAttribute("readonly", "true"); if (param.isAutoLoop()) field.addAttribute("autoloop", "true"); if (param.getDesciption() != null) field.setText(param.getDesciption()); switch (type) { case StringValue: field.addAttribute("value", param.getStringValue()); break; case DateValue: SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT); field.addAttribute("value", dateFormat.format(param.getDateValue())); break; case BooleanValue: field.addAttribute("value", param.getBooleanValue().toString()); break; case MapValue: case ListValue: Map<String, TemplateInput> map = param.getMapValue(); for (String childParamName : map.keySet()) { TemplateInput childParam = map.get(childParamName); if (childParamName.equals(childParam.getName())) { log.warn("Child param in map and child param name doesn't match, get child param name as key: " + childParam.toString()); } Element subfield = field.addElement(fieldTag); doSerialization(subfield, childParam); } break; case DocumentProperty: case PictureProperty: case Content: field.addAttribute("source", param.getSource()); break; } }</code><technical_language>private methods please, hamper subclassing</technical_language>

Target:
protected void doSerialization(Element field, TemplateInput param) throws TemplateInputBadFormat { field.addAttribute("name", param.getName()); InputType type = param.getType(); if (type == null) { if (param.getStringValue() == null) { log.warn(param.getName() + " is null"); throw new TemplateInputBadFormat(); } else type = StringValue; } field.addAttribute("type", type.getValue()); if (param.isReadOnly()) { field.addAttribute("readonly", "true"); } if (param.isAutoLoop()) { field.addAttribute("autoloop", "true"); } if (param.getDesciption() != null) { field.setText(param.getDesciption()); } switch (type) { case StringValue: field.addAttribute("value", param.getStringValue()); break; case DateValue: SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT); field.addAttribute("value", dateFormat.format(param.getDateValue())); break; case BooleanValue: field.addAttribute("value", param.getBooleanValue().toString()); break; case MapValue: case ListValue: Map<String, TemplateInput> map = param.getMapValue(); for (String childParamName : map.keySet()) { TemplateInput childParam = map.get(childParamName); if (MapValue.equals(type) && childParamName.equals(childParam.getName())) { log.warn("Child param in map and child param name doesn't match, get child param name as key: " + childParam.toString()); } Element subfield = field.addElement(fieldTag); doSerialization(subfield, childParam); } break; case DocumentProperty: case PictureProperty: case Content: field.addAttribute("source", param.getSource()); break; } }
Source:
<code>private LocalTxQueueTransactionContext createLocalTxContext(LocalTxQueueTransactionJournal txLog, QueueProvider provider) throws InterruptedException { Lock lock = mock(Lock.class); <START> when(lock.tryLock(anyLong(), eq(TimeUnit.MILLISECONDS))).thenAnswer((Answer<Boolean>) invocationOnMock -> { <END> sleep(invocationOnMock.getArgument(0, Long.class) / 2); return true; }); return new LocalTxQueueTransactionContext(txLog, provider, lock); }</code><technical_language>static import</technical_language>

Target:
private LocalTxQueueTransactionContext createLocalTxContext(LocalTxQueueTransactionJournal txLog, QueueProvider provider) throws InterruptedException { Lock lock = mock(Lock.class); when(lock.tryLock(anyLong(), eq(MILLISECONDS))).thenAnswer((Answer<Boolean>) invocationOnMock -> { sleep(invocationOnMock.getArgument(0, Long.class) / 2); return true; }); return new LocalTxQueueTransactionContext(txLog, provider, lock); }
Source:
<code><START> public RestRequest createRestService(WsdlProject project, String URI) throws MalformedURLException { <END> return createRestService(project, URI, true); }</code><technical_language>createRestService returns RestRequest</technical_language>

Target:
public void createRestService(WsdlProject project, String URI) throws MalformedURLException { if (StringUtils.isNullOrEmpty(URI)) { return; } RestResource restResource = createResource(ModelCreationStrategy.CREATE_NEW_MODEL, project, URI); RestRequest restRequest = addNewRequest(addNewMethod(ModelCreationStrategy.CREATE_NEW_MODEL, restResource, RestRequestInterface.HttpMethod.GET)); copyParameters(extractParams(URI), restResource.getParams()); UISupport.select(restRequest); UISupport.showDesktopPanel(restRequest); }
Source:
<code>public void testSize() { final int max_size = CircularBuffer.MAX_SIZE; <START> for (int size = 0; size < max_size; size <<= 1) { <END> testSize(size); testSize(1 + size); if (0 == size) size = 1; } }</code><technical_language>MAX_SIZE</technical_language>

Target:
public void testSize() { testSize(0); testSize(1); testSize(2); final int max_size = MAX_SIZE >> 3; for (int size = 4; size < max_size; size <<= 1) { testSize(size - 1); testSize(size); testSize(size + 1); } }
Source:
<code>public void testBroadcast() throws Exception { <START> assumeTrue(!isMainRun()); <END> Topology topology = newTopology(); TStream<String> strings = topology.strings("1", "7", "19", "23", "57"); TStream<String> stringsP = strings.parallel(()->3, Routing.BROADCAST); TStream<ChannelAndSequence> withChannel = stringsP.map(stringTupleChannelSeqTransformer()); withChannel = withChannel.asType(ChannelAndSequence.class).endParallel(); TStream<String> result = StringStreams.toString(withChannel); Tester tester = topology.getTester(); Condition<Long> fifeteenTuples = tester.tupleCount(result, 15); Condition<List<String>> contents = tester.stringContentsUnordered(result, "CS:0:1", "CS:0:7", "CS:0:19", "CS:0:23", "CS:0:57", "CS:1:1", "CS:1:7", "CS:1:19", "CS:1:23", "CS:1:57", "CS:2:1", "CS:2:7", "CS:2:19", "CS:2:23", "CS:2:57"); this.getConfig().put(ContextProperties.KEEP_ARTIFACTS, true); complete(tester, allConditions(fifeteenTuples, contents), 10, TimeUnit.SECONDS); assertTrue("broadcast count: ", fifeteenTuples.valid()); assertTrue("broadcast contents: ", contents.valid()); }</code><technical_language>other tests checkUdpSupported, is this different</technical_language>

Target:
public void testBroadcast() throws Exception { checkUdpSupported(); Topology topology = newTopology(); TStream<String> strings = topology.strings("1", "7", "19", "23", "57"); TStream<String> stringsP = strings.parallel(()->3, Routing.BROADCAST); TStream<ChannelAndSequence> withChannel = stringsP.map(stringTupleChannelSeqTransformer()); withChannel = withChannel.asType(ChannelAndSequence.class).endParallel(); TStream<String> result = StringStreams.toString(withChannel); Tester tester = topology.getTester(); Condition<Long> fifeteenTuples = tester.tupleCount(result, 15); Condition<List<String>> contents = tester.stringContentsUnordered(result, "CS:0:1", "CS:0:7", "CS:0:19", "CS:0:23", "CS:0:57", "CS:1:1", "CS:1:7", "CS:1:19", "CS:1:23", "CS:1:57", "CS:2:1", "CS:2:7", "CS:2:19", "CS:2:23", "CS:2:57"); this.getConfig().put(ContextProperties.KEEP_ARTIFACTS, true); complete(tester, allConditions(fifeteenTuples, contents), 10, TimeUnit.SECONDS); assertTrue("broadcast count: ", fifeteenTuples.valid()); assertTrue("broadcast contents: ", contents.valid()); }
Source:
<code>protected Account(long containerCount, long objectCount, long bytesUsed, Map<String, String> metadata, Multimap<String, String> headers) { this.containerCount = containerCount; this.objectCount = objectCount; this.bytesUsed = bytesUsed; this.metadata = metadata == null ? ImmutableMap.<String, String> of() : checkNotNull(metadata, "metadata"); <START> this.headers = headers == null ? ImmutableMultimap.<String, String> of() : checkNotNull(headers, "headers"); <END> }</code><technical_language>need checkNotNull end (for of these)? ;-)</technical_language>

Target:
protected Account(long containerCount, long objectCount, long bytesUsed, Map<String, String> metadata, Multimap<String, String> headers) { this.containerCount = containerCount; this.objectCount = objectCount; this.bytesUsed = bytesUsed; this.metadata = metadata == null ? ImmutableMap.<String, String> of() : metadata; this.headers = headers == null ? ImmutableMultimap.<String, String> of() : headers; }