auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isWifiCallingAvailable() { if (mImsMmTelMgr != null) { return <START> mImsMmTelMgr.isCapable(MmTelCapabilities.CAPABILITY_TYPE_VOICE, <END> ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN) || mImsMmTelMgr.isCapable(MmTelCapabilities.CAPABILITY_TYPE_VIDEO, ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN); } return false; }</code><technical_language>isCapable a slightly thing... isCapable return WiFi calling is capable for current subscription (i.e. if user enabled carrier configs enabled), isAvailable return registered IMS WiFi calling is available. Is this for case? want wifi calling icon shown if registered</technical_language>

Target:
private boolean isWifiCallingAvailable() { return (mImsRegisteredRadioTech == AccessNetworkConstants.TRANSPORT_TYPE_WLAN) && (mMmTelCapabilities.isCapable(MmTelCapabilities.CAPABILITY_TYPE_VOICE) || mMmTelCapabilities.isCapable(MmTelCapabilities.CAPABILITY_TYPE_VIDEO)); }
Source:
<code>private static FactorComparator<Executor> getLstDispatchedTimeComparator(int weight){ return FactorComparator.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>(){ @Override public int compare(Executor o1, Executor o2) { Statistics stat1 = o1.getExecutorStats(); Statistics stat2 = o2.getExecutorStats(); <START> Integer result = 0; <END> if (statisticsObjectCheck(stat1,stat2,LSTDISPATCHED_COMPARATOR_NAME,result)){ return result; } if (null == stat1.getLastDispatchedTime() && null == stat1.getLastDispatchedTime()){ logger.info(String.format("%s : stats from both side doesn't contain last dispatched time info.", LSTDISPATCHED_COMPARATOR_NAME)); return 0; } if (null == stat2.getLastDispatchedTime()){ logger.info(String.format("%s : choosing left side as right doesn't contain last dispatched time info.", LSTDISPATCHED_COMPARATOR_NAME)); return 1; } if (null == stat1.getLastDispatchedTime()){ logger.info(String.format("%s : choosing right side as left doesn't contain last dispatched time info.", LSTDISPATCHED_COMPARATOR_NAME)); return -1; } return ((Date)stat2.getLastDispatchedTime()).compareTo(stat1.getLastDispatchedTime()); }}); }</code><technical_language>this int avoid auto-boxing</technical_language>

Target:
private static FactorComparator<Executor> getLstDispatchedTimeComparator(int weight){ return FactorComparator.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>(){ @Override public int compare(Executor o1, Executor o2) { ExecutorInfo stat1 = o1.getExecutorInfo(); ExecutorInfo stat2 = o2.getExecutorInfo(); int result = 0; if (statisticsObjectCheck(stat1,stat2,LSTDISPATCHED_COMPARATOR_NAME,result)){ return result; } return ((Long)stat2.getLastDispatchedTime()).compareTo(stat1.getLastDispatchedTime()); }}); }
Source:
<code>public String getDescription() { return <START> "Input <END> Library " + inputLibrary.getInputVDir().getLocation().getDescription(); }</code><technical_language>small cap - Input usefull</technical_language>

Target:
public String getDescription() { return "library " + inputLibrary.getInputVDir().getLocation().getDescription(); }
Source:
<code>protected void tick(Block block, boolean craftLast) { <START> if (!craftLast) { if (BlockStorage.getLocationInfo(block.getLocation(), "enabled").equals("false")) return; <END> } if (ChargableBlock.getCharge(block) < getEnergyConsumption()) return; String input = getSerializedInput(block, craftLast); testInputAgainstRecipes(block, input); }</code><technical_language>Please merge statements connector</technical_language>

Target:
protected void tick(Block block, boolean craftLast) { if (!craftLast && BlockStorage.getLocationInfo(block.getLocation(), "enabled").equals("false")) return; if (ChargableBlock.getCharge(block) < getEnergyConsumption()) return; String input = getSerializedInput(block, craftLast); testInputAgainstRecipes(block, input); }
Source:
<code>public void testMappingOneWay() { final AdministrativeStatusType type1 = AdministrativeStatusType.UNDEFINED; final AdministrativeStatusType type2 = AdministrativeStatusType.OFF; <START> final AdministrativeStatusType type3 = AdministrativeStatusType.ON; <END> final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType type1Mapped = this.mapperFactory .getMapperFacade() .map(type1, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType type2Mapped = this.mapperFactory .getMapperFacade() .map(type2, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType type3Mapped = this.mapperFactory .getMapperFacade() .map(type3, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); assertNotNull(type1Mapped); assertNotNull(type2Mapped); assertNotNull(type3Mapped); assertEquals(type1.value(), type1Mapped.value()); assertEquals(type2.value(), type2Mapped.value()); assertEquals(type3.value(), type3Mapped.value()); }</code><technical_language>type1, type2 type3. AdministrativeStatusType.UNDEFINED, AdministrativeStatusType.OFF AdministrativeStatusType.ON</technical_language>

Target:
public void testMappingOneWay() { final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType undefined = this.configurationMapper .map(AdministrativeStatusType.UNDEFINED, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType off = this.configurationMapper .map(AdministrativeStatusType.OFF, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType on = this.configurationMapper .map(AdministrativeStatusType.ON, com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.AdministrativeStatusType.class); assertNotNull(undefined); assertNotNull(off); assertNotNull(on); assertEquals(AdministrativeStatusType.UNDEFINED.value(), undefined.value()); assertEquals(AdministrativeStatusType.OFF.value(), off.value()); assertEquals(AdministrativeStatusType.ON.value(), on.value()); }
Source:
<code>private Locale determineLocale(final HttpServletRequest request) { Locale locale = LocaleUtils.getLocaleFromString(request.getParameter(LOCALE)); <START> if (null == locale) { END> locale = getLocaleFromCookies(request.getCookies()); } if (null == locale) { locale = request.getLocale(); } if (null == locale) { locale = Locale.US; } log.debug("Filter determined locale to be: " + locale.toLanguageTag()); return locale; }</code><technical_language>Minor thing: please "something <operator> null" convention</technical_language>

Target:
private Locale determineLocale(final HttpServletRequest request) { Locale locale = LocaleUtils.getLocaleFromString(request.getParameter(LOCALE)); if (locale == null) { locale = getLocaleFromCookies(request.getCookies()); } if (locale == null) { locale = request.getLocale(); } if (locale == null) { locale = Locale.US; } log.debug("Filter determined locale to be: " + locale.toLanguageTag()); return locale; }
Source:
<code><START> boolean contains(int x, int y) { <END> return false; }</code><technical_language>merge this, extenders of this class LineContentAnnotation LineHeaderAnnotation clickable. perceived a functional regression those. Is this a big issue in opinion? I personally fine it, this is new code I adopters following, current adopters do work CodeMining layer more annotation one. said, do figure out implementation work in basic cases, x >= fx && y >= fY && y <= fY + fViewer.getTextWidget().getLineHeight(position.getOffset()) && x <= fx + gc.stringExtent(getText());</technical_language>

Target:
boolean contains(int x, int y) { StyledText styledText= getTextWidget(); GC gc= null; try { gc= new GC(styledText); return x >= fX && y >= fY && y <= fY + styledText.getLineHeight(position.getOffset()) && x <= fX + gc.stringExtent(getText()).x + 2 * gc.getFontMetrics().getAverageCharacterWidth(); } finally { if (gc != null) { gc.dispose(); } } }
Source:
<code>public int bitIndex(final String key, final int offsetInBits, final int lengthInBits, final String other, final int otherOffsetInBits, final int otherLengthInBits) { boolean allNull = true; if (offsetInBits % LENGTH != 0 || otherOffsetInBits % LENGTH != 0 || lengthInBits % LENGTH != 0 || otherLengthInBits % LENGTH != 0) { throw new IllegalArgumentException("The offsets and lengths must be at Character boundaries"); } final int beginIndex1 = offsetInBits / LENGTH; final int beginIndex2 = otherOffsetInBits / LENGTH; final int endIndex1 = beginIndex1 + lengthInBits / LENGTH; final int endIndex2 = beginIndex2 + otherLengthInBits / LENGTH; final int length = Math.max(endIndex1, endIndex2); char k = 0, f = 0; for(int i = 0; i < length; i++) { final int index1 = beginIndex1 + i; final int index2 = beginIndex2 + i; if (index1 >= endIndex1) { k = 0; } else { k = key.charAt(index1); if (k == 0) { throw new IllegalArgumentException("Don't support '\\u0000' in the key."); <START> } <END> } if (other == null || index2 >= endIndex2) { f = 0; } else { f = other.charAt(index2); } if (k != f) { final int x = k ^ f; return i * LENGTH + Integer.numberOfLeadingZeros(x) - LENGTH; } if (k != 0) { allNull = false; } } if (allNull) { return KeyAnalyzer.NULL_BIT_KEY; } return KeyAnalyzer.EQUAL_BIT_KEY; }</code><technical_language>A message "Character '\\u0000' is supported in key."</technical_language>

Target:
public int bitIndex(final String key, final int offsetInBits, final int lengthInBits, final String other, final int otherOffsetInBits, final int otherLengthInBits) { boolean allNull = true; if (offsetInBits % LENGTH != 0 || otherOffsetInBits % LENGTH != 0 || lengthInBits % LENGTH != 0 || otherLengthInBits % LENGTH != 0) { throw new IllegalArgumentException("The offsets and lengths must be at Character boundaries"); } final int beginIndex1 = offsetInBits / LENGTH; final int beginIndex2 = otherOffsetInBits / LENGTH; final int endIndex1 = beginIndex1 + lengthInBits / LENGTH; final int endIndex2 = beginIndex2 + otherLengthInBits / LENGTH; final int length = Math.max(endIndex1, endIndex2); char k = 0, f = 0; for(int i = 0; i < length; i++) { final int index1 = beginIndex1 + i; final int index2 = beginIndex2 + i; if (index1 >= endIndex1) { k = 0; } else { k = key.charAt(index1); if (k == 0) { throw new IllegalArgumentException("Character '\\u0000' is not supported in the key."); } } if (other == null || index2 >= endIndex2) { f = 0; } else { f = other.charAt(index2); } if (k != f) { final int x = k ^ f; return i * LENGTH + Integer.numberOfLeadingZeros(x) - LENGTH; } if (k != 0) { allNull = false; } } if (allNull) { return KeyAnalyzer.NULL_BIT_KEY; } return KeyAnalyzer.EQUAL_BIT_KEY; }
Source:
<code>public static Boolean getBoolean(String val) { <START> if (val == null || val.trim().length() == 0) { <END> return false; } try { return Boolean.valueOf(val); } catch (IllegalArgumentException e) { return false; } }</code><technical_language>this condition is redundant. valueOf returns false for values</technical_language>

Target:
public static Boolean getBoolean(String val) { return Boolean.valueOf(val); }
Source:
<code>protected static String getPath(String uri) { String path = null; int index = uri.indexOf(':'); if (index != -1) { index = uri.indexOf(':', index + 1); if (index != -1) { path = uri.substring(index + 1); index = path.indexOf('?'); if (index != -1) { path = path.substring(0, index); } path = path.replaceAll(":", ""); try { path = URLDecoder.decode(path, "UTF-8"); } catch (UnsupportedEncodingException e) { <START> LOG.error("Failed to decode URL path '" + path + "'", e); <END> } } } return path; }</code><technical_language>Dont log ERROR is user do. Log a DEBUG in error message this exception is ignored</technical_language>

Target:
protected static String getPath(String uri) { String path = null; int index = uri.indexOf(':'); if (index != -1) { index = uri.indexOf(':', index + 1); if (index != -1) { path = uri.substring(index + 1); index = path.indexOf('?'); if (index != -1) { path = path.substring(0, index); } path = path.replaceAll(":", ""); try { path = URLDecoder.decode(path, "UTF-8"); } catch (UnsupportedEncodingException e) { LOG.debug("Failed to decode URL path '" + path + "', ignoring exception", e); } } } return path; }
Source:
<code>public SyncSpanningTree(String rootNode) { this(); <START> setRootNode(rootNode); <END> }</code><technical_language>this method is overridable, I this is a good idea</technical_language>

Target:
public SyncSpanningTree(String rootNode) { this(); fRootNode = rootNode; }
Source:
<code>public RibbonResponse execute(final RibbonRequest request, IClientConfig configOverride) throws IOException { final Request.Options options; if (configOverride != null) { options = new Request.Options( configOverride.get(CommonClientConfigKey.ConnectTimeout, this.connectTimeout), (configOverride.get(CommonClientConfigKey.ReadTimeout, this.readTimeout))); } else { options = new Request.Options(this.connectTimeout, this.readTimeout); } LoadBalancedRetryPolicy retryPolicy = loadBalancedRetryPolicyFactory.create(this.getClientName(), this); <START> retryTemplate.setRetryPolicy(retryPolicy == null ? new NeverRetryPolicy() <END> : new InterceptorRetryPolicy(request.toHttpRequest(), retryPolicy, this, this.getClientName())); return retryTemplate.execute(new RetryCallback<RibbonResponse, IOException>() { @Override public RibbonResponse doWithRetry(RetryContext retryContext) throws IOException { Request feignRequest = null; if(retryContext instanceof LoadBalancedRetryContext) { ServiceInstance service = ((LoadBalancedRetryContext)retryContext).getServiceInstance(); if(service != null) { feignRequest = ((RibbonRequest)request.replaceUri(reconstructURIWithServer(new Server(service.getHost(), service.getPort()), request.getUri()))).toRequest(); } } if(feignRequest == null) { feignRequest = request.toRequest(); } Response response = request.client().execute(feignRequest, options); return new RibbonResponse(request.getUri(), response); } }); }</code><technical_language>this done once</technical_language>

Target:
public RibbonResponse execute(final RibbonRequest request, IClientConfig configOverride) throws IOException { final Request.Options options; if (configOverride != null) { options = new Request.Options( configOverride.get(CommonClientConfigKey.ConnectTimeout, this.connectTimeout), (configOverride.get(CommonClientConfigKey.ReadTimeout, this.readTimeout))); } else { options = new Request.Options(this.connectTimeout, this.readTimeout); } LoadBalancedRetryPolicy retryPolicy = loadBalancedRetryPolicyFactory.create(this.getClientName(), this); RetryTemplate retryTemplate = new RetryTemplate(); retryTemplate.setRetryPolicy(retryPolicy == null ? new NeverRetryPolicy() : new FeignRetryPolicy(request.toHttpRequest(), retryPolicy, this, this.getClientName())); return retryTemplate.execute(new RetryCallback<RibbonResponse, IOException>() { @Override public RibbonResponse doWithRetry(RetryContext retryContext) throws IOException { Request feignRequest = null; if(retryContext instanceof LoadBalancedRetryContext) { ServiceInstance service = ((LoadBalancedRetryContext)retryContext).getServiceInstance(); if(service != null) { feignRequest = ((RibbonRequest)request.replaceUri(reconstructURIWithServer(new Server(service.getHost(), service.getPort()), request.getUri()))).toRequest(); } } if(feignRequest == null) { feignRequest = request.toRequest(); } Response response = request.client().execute(feignRequest, options); return new RibbonResponse(request.getUri(), response); } }); }
Source:
<code>public void transform(StructuredRecord structuredRecord, Emitter<KeyValue<Text, Text>> emitter) throws Exception { <START> batchConfig.validateKeyField(structuredRecord.getSchema()); <END> batchConfig.validateInputFieldsDataType(structuredRecord.getSchema()); if (structuredRecord.get(batchConfig.getKeyField()) == null) { return; } emitter.emit(new KeyValue<Text, Text>(new Text(GSON.toJson(structuredRecord.getSchema(), SCHEMA_TYPE)), new Text(StructuredRecordStringConverter.toJsonString(structuredRecord)))); }</code><technical_language>store structuredRecord reuse calling multiple times</technical_language>

Target:
public void transform(StructuredRecord structuredRecord, Emitter<KeyValue<Text, Text>> emitter) throws Exception { Schema recordSchema = structuredRecord.getSchema(); batchConfig.validateKeyField(recordSchema); batchConfig.validateInputFieldsDataType(recordSchema); if (structuredRecord.get(batchConfig.getKeyField()) == null) { metrics.count("invalid", 1); return; } emitter.emit(new KeyValue<Text, Text>((new Text(GSON.toJson(recordSchema, SCHEMA_TYPE))), new Text(StructuredRecordStringConverter.toJsonString(structuredRecord)))); }
Source:
<code>public VideoFrameReleaseTimeHelper(Context context) { this(getDefaultDisplayRefreshRate(context)); <START> this.context = context; <END> registerDisplayListener(); }</code><technical_language>context.getApplicationContext() ensure class leak shorter lived contexts passed (it's fine hold application context, expected for long process remains alive)</technical_language>

Target:
public VideoFrameReleaseTimeHelper(Context context) { this.context = context.getApplicationContext(); defaultDisplayListener = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ? new DefaultDisplayListener(context) : null; useDefaultDisplayVsync = true; vsyncSampler = VSyncSampler.getInstance(); }
Source:
<code>private static ByteRange buildByteRange(String rangeHeaderValue) throws RestServiceException { if (!rangeHeaderValue.startsWith(BYTE_RANGE_PREFIX)) { throw new RestServiceException("Invalid byte range syntax; does not start with '" + BYTE_RANGE_PREFIX + "'", RestServiceErrorCode.InvalidArgs); } try { int hyphenIndex = rangeHeaderValue.indexOf('-', BYTE_RANGE_PREFIX.length()); String startOffsetStr = rangeHeaderValue.substring(BYTE_RANGE_PREFIX.length(), hyphenIndex); String endOffsetStr = rangeHeaderValue.substring(hyphenIndex + 1); if (startOffsetStr.isEmpty()) { <START> return ByteRange.fromLastNBytes(Long.parseLong(endOffsetStr)); <END> } else if (endOffsetStr.isEmpty()) { return ByteRange.fromStartOffset(Long.parseLong(startOffsetStr)); } else { return ByteRange.fromOffsetRange(Long.parseLong(startOffsetStr), Long.parseLong(endOffsetStr)); } } catch (Exception e) { throw new RestServiceException( "Valid byte range could not be parsed from Range header value: " + rangeHeaderValue, RestServiceErrorCode.InvalidArgs); } }</code><technical_language>return end of function instead of multiple return paths</technical_language>

Target:
private static ByteRange buildByteRange(String rangeHeaderValue) throws RestServiceException { if (!rangeHeaderValue.startsWith(BYTE_RANGE_PREFIX)) { throw new RestServiceException("Invalid byte range syntax; does not start with '" + BYTE_RANGE_PREFIX + "'", RestServiceErrorCode.InvalidArgs); } ByteRange range; try { int hyphenIndex = rangeHeaderValue.indexOf('-', BYTE_RANGE_PREFIX.length()); String startOffsetStr = rangeHeaderValue.substring(BYTE_RANGE_PREFIX.length(), hyphenIndex); String endOffsetStr = rangeHeaderValue.substring(hyphenIndex + 1); if (startOffsetStr.isEmpty()) { range = ByteRange.fromLastNBytes(Long.parseLong(endOffsetStr)); } else if (endOffsetStr.isEmpty()) { range = ByteRange.fromStartOffset(Long.parseLong(startOffsetStr)); } else { range = ByteRange.fromOffsetRange(Long.parseLong(startOffsetStr), Long.parseLong(endOffsetStr)); } } catch (Exception e) { throw new RestServiceException( "Valid byte range could not be parsed from Range header value: " + rangeHeaderValue, RestServiceErrorCode.InvalidArgs); } return range; }
Source:
<code>private static List<Method> getDefaultMethods(Class<?> clazz) { <START> List<Method> result = null; <END> for (Class<?> ifc : clazz.getInterfaces()) { for (Method ifcMethod : ifc.getMethods()) { if (!Modifier.isAbstract(ifcMethod.getModifiers())) { if (result == null) { result = new LinkedList<Method>(); } result.add(ifcMethod); } } } return result; }</code><technical_language>I prefer empty list instead of null</technical_language>

Target:
private static List<Method> getDefaultMethods(Class<?> clazz) { List<Method> result = new LinkedList<Method>(); for (Class<?> ifc : clazz.getInterfaces()) { for (Method ifcMethod : ifc.getMethods()) { if (!Modifier.isAbstract(ifcMethod.getModifiers())) { result.add(ifcMethod); } } } return result; }
Source:
<code>protected void executeQueryCommand() { switch (getParameters().getOsRepositoryVerb()) { case GetOsNames: setReturnValue(osRepository.getOsNames()); break; case GetUniqueOsNames: setReturnValue(osRepository.getUniqueOsNames()); break; case GetOsIds: setReturnValue(osRepository.getOsIds()); break; case GetLinuxOss: setReturnValue(osRepository.getLinuxOss()); break; case GetWindowsOss: setReturnValue(osRepository.getWindowsOss()); break; case GetMaxOsRam: setReturnValue(osRepository.getMaximumRam(getParameters().getOsId(), getParameters().getVersion())); break; case GetMinimumOsRam: setReturnValue(osRepository.getMinimumRam(getParameters().getOsId(), getParameters().getVersion())); break; <START> case HasSpiceSupportMatrix: <END> setReturnValue(osRepository.spiceSupportMatrix()); break; case GetNetworkDevices: setReturnValue(osRepository.getNetworkDevices(getParameters().getOsId(), getParameters().getVersion())); break; } }</code><technical_language>please rename GetSpiceSupportMatrix instead of HasSpice..</technical_language>

Target:
protected void executeQueryCommand() { switch (getParameters().getOsRepositoryVerb()) { case GetOsNames: setReturnValue(osRepository.getOsNames()); break; case GetUniqueOsNames: setReturnValue(osRepository.getUniqueOsNames()); break; case GetOsIds: setReturnValue(osRepository.getOsIds()); break; case GetLinuxOss: setReturnValue(osRepository.getLinuxOss()); break; case GetWindowsOss: setReturnValue(osRepository.getWindowsOss()); break; case GetMaxOsRam: setReturnValue(osRepository.getMaximumRam(getParameters().getOsId(), getParameters().getVersion())); break; case GetMinimumOsRam: setReturnValue(osRepository.getMinimumRam(getParameters().getOsId(), getParameters().getVersion())); break; case GetSpiceSupportMatrix: setReturnValue(osRepository.getSpiceSupportMatrix()); break; case GetNetworkDevices: setReturnValue(osRepository.getNetworkDevices(getParameters().getOsId(), getParameters().getVersion())); break; } }
Source:
<code>public synchronized Map<String, SummaryStatistics> addAdditionalResult( long startMs, long endMs) throws IOException { Map<String, SummaryStatistics> summaryStatistics = new HashMap<>(); Map<String, MethodStatistics> nameStatistics = processMethodProfiles(startMs, endMs, javaAgentInput -> { <START> if (javaAgentInput.getIsttfb()) { <END> return javaAgentInput.getMethod(); } return null; }); if (!nameStatistics.isEmpty()) { for (Map.Entry<String, MethodStatistics> entry : nameStatistics.entrySet()) { summaryStatistics.put( entry.getKey(), toSummaryStatistics(entry.getValue())); } } return summaryStatistics; }</code><technical_language>If class renamed, this profileInput</technical_language>

Target:
public synchronized Map<String, SummaryStatistics> addAdditionalResult( long startMs, long endMs) throws IOException { Map<String, SummaryStatistics> summaryStatistics = new HashMap<>(); Map<String, MethodStatistics> nameStatistics = processMethodProfiles(startMs, endMs, profileInput -> { if (profileInput.getIsttfb()) { return profileInput.getMethod(); } return null; }); if (!nameStatistics.isEmpty()) { for (Map.Entry<String, MethodStatistics> entry : nameStatistics.entrySet()) { summaryStatistics.put( entry.getKey(), toSummaryStatistics(entry.getValue())); } } return summaryStatistics; }
Source:
<code>public void gerrit_has_review_flags_checked_after_jenkins_set_them() { assumeTrue(new File(GerritTriggerEnv.get().getUserHome(),".netrc").exists()); try { Thread.sleep(1000); } catch (InterruptedException e1) { } GerritTriggerNewServer newServer = new GerritTriggerNewServer(jenkins); newServer.saveNewTestServerConfigIfNone(); GerritTriggerServer server = new GerritTriggerServer(jenkins); server.saveTestServerConfig(); String jobName = this.getClass().getCanonicalName(); jenkins.jobs.create(FreeStyleJob.class, jobName); GerritTriggerJob job = new GerritTriggerJob(jenkins, jobName); job.saveTestJobConfig(); try { String changeId = pushChangeForReview(jobName); sleep(10000); String rev = readJson(curl(changeId)); logCurlHttpCodeIssues(rev); getLabelValueFromJSON(rev, "Verified", 1); getLabelValueFromJSON(rev, "Code-Review", 1); <START> <END> } catch(InterruptedException|IOException e) { fail(e.getMessage()); } }</code><technical_language>Extra empty line</technical_language>

Target:
public void gerrit_has_review_flags_checked_after_jenkins_set_them() { assumeTrue(new File(GerritTriggerEnv.get().getUserHome(),".netrc").exists()); GerritTriggerNewServer newServer = new GerritTriggerNewServer(jenkins); newServer.saveNewTestServerConfigIfNone(); GerritTriggerServer server = new GerritTriggerServer(jenkins); server.saveTestServerConfig(); String jobName = this.getClass().getCanonicalName(); jenkins.jobs.create(FreeStyleJob.class, jobName); GerritTriggerJob job = new GerritTriggerJob(jenkins, jobName); job.saveTestJobConfig(); try { String changeId = pushChangeForReview(jobName); sleep(10000); String rev = readJson(curl(changeId)); logCurlHttpCodeIssues(rev); checkLabelValueFromJSON(rev, "Verified"); checkLabelValueFromJSON(rev, "Code-Review"); } catch(InterruptedException|IOException e) { fail(e.getMessage()); } }
Source:
<code>protected boolean fetchNext() { try { <START> if ( seeker.next() ) <END> { return next( seeker.get().key().entityId ); } else { ensureCursorClosed(); return false; } } catch ( IOException e ) { throw new UncheckedIOException( e ); } }</code><technical_language>this throw exception in case: iterator.fetchNext() return false call fetchNext right</technical_language>

Target:
protected boolean fetchNext() { try { if ( !closed && seeker.next() ) { return next( seeker.get().key().entityId ); } else { ensureCursorClosed(); return false; } } catch ( IOException e ) { throw new UncheckedIOException( e ); } }
Source:
<code>public void onPlayerUpdate(LivingEvent.LivingUpdateEvent event, EntityPlayer player, @Nonnull ItemStack armorStack, EntityEquipmentSlot slot) { if (ChargableUtility.hasPower(player, 1)) { PlayerData data = player.getCapability(EsteemedInnovation.PLAYER_DATA, null); if (data.getLastMotions() == null) { data.setLastMotions(Pair.of(player.posX, player.posZ)); } double lastX = data.getLastMotions().getLeft(); double lastZ = data.getLastMotions().getRight(); if ((player.moveForward > 0.0F) && (lastX != player.posX || lastZ != player.posZ) && player.onGround && !player.isInWater()) { ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); <START> player.moveRelative(0F, 1F, 0.075F, 0.0F); END> if (!chestStack.getTagCompound().hasKey("TicksUntilSteamDrain")) { chestStack.getTagCompound().setInteger("TicksUntilSteamDrain", 2); } if (chestStack.getTagCompound().getInteger("TicksUntilSteamDrain") <= 0) { ChargableUtility.drainSteam(chestStack, Config.runAssistConsumption, player); } } } }</code><technical_language>This shortened 0F for code style purposes</technical_language>

Target:
public void onPlayerUpdate(LivingEvent.LivingUpdateEvent event, EntityPlayer player, @Nonnull ItemStack armorStack, EntityEquipmentSlot slot) { if (ChargableUtility.hasPower(player, 1)) { PlayerData data = player.getCapability(EsteemedInnovation.PLAYER_DATA, null); if (data.getLastMotions() == null) { data.setLastMotions(Pair.of(player.posX, player.posZ)); } double lastX = data.getLastMotions().getLeft(); double lastZ = data.getLastMotions().getRight(); if ((player.moveForward > 0.0F) && (lastX != player.posX || lastZ != player.posZ) && player.onGround && !player.isInWater()) { ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); player.moveRelative(0F, 1F, 0.075F, 0F); if (!chestStack.getTagCompound().hasKey("TicksUntilSteamDrain")) { chestStack.getTagCompound().setInteger("TicksUntilSteamDrain", 2); } if (chestStack.getTagCompound().getInteger("TicksUntilSteamDrain") <= 0) { ChargableUtility.drainSteam(chestStack, ArmorModule.runAssistConsumption, player); } } } }
Source:
<code>public Color getColor() { <START> return Color.ofRgb(colorValue); <END> }</code><technical_language>cached initialized in a field</technical_language>

Target:
public Color getColor() { return color; }
Source:
<code>public static DataSource azureSql( String name, String sqlConnectionString, String tableOrViewName, String description, DataChangeDetectionPolicy changeDetectionPolicy, DataDeletionDetectionPolicy deletionDetectionPolicy) { <START> return new DataSource() <END> .setName(name) .setType(DataSourceType.AZURE_SQL) .setCredentials(new DataSourceCredentials().setConnectionString(sqlConnectionString)) .setContainer(new DataContainer().setName(tableOrViewName)) .setDescription(description) .setDataDeletionDetectionPolicy(deletionDetectionPolicy) .setDataChangeDetectionPolicy(changeDetectionPolicy); }</code><technical_language>nit: I feel parameter variables in order add object</technical_language>

Target:
public static DataSource azureSql( String name, String sqlConnectionString, String tableOrViewName, String description, DataChangeDetectionPolicy changeDetectionPolicy, DataDeletionDetectionPolicy deletionDetectionPolicy) { if (CoreUtils.isNullOrEmpty(name)) { throw new IllegalArgumentException("name cannot be null or empty"); } if (CoreUtils.isNullOrEmpty(sqlConnectionString)) { throw new IllegalArgumentException("sqlConnectionString cannot be null or empty"); } if (CoreUtils.isNullOrEmpty(tableOrViewName)) { throw new IllegalArgumentException("tableOrViewName cannot be null or empty"); } return new DataSource() .setName(name) .setType(DataSourceType.AZURE_SQL) .setCredentials(new DataSourceCredentials().setConnectionString(sqlConnectionString)) .setContainer(new DataContainer().setName(tableOrViewName)) .setDescription(description) .setDataChangeDetectionPolicy(changeDetectionPolicy) .setDataDeletionDetectionPolicy(deletionDetectionPolicy); }
Source:
<code>public List<MeasureDto> selectByComponentsAndMetrics(DbSession dbSession, List<String> componentUuids, List<Integer> metricIds) { <START> return executeLargeInputs(componentUuids, components -> mapper(dbSession).selectByComponentsAndProjectsAndMetrics(components, metricIds)); <END> }</code><technical_language>remark: I prefer replace components c componentUuids components confusing. name partition, list</technical_language>

Target:
public List<MeasureDto> selectByComponentsAndMetrics(DbSession dbSession, List<String> componentUuids, List<Integer> metricIds) { return executeLargeInputs(componentUuids, partitionComponentUuids -> mapper(dbSession).selectByComponentsAndMetrics(partitionComponentUuids, metricIds)); }
Source:
<code>private void registerAggregateMetrics() { SlidingTimeWindowReservoir reservoir = new SlidingTimeWindowReservoir(1, TimeUnit.DAYS); Histogram slidingWeek = new Histogram(reservoir); <START> String deletes = MetricRegistry.name(SweepMetrics.class, "totalDeletes"); <END> registerMetricIfNotExists(deletes, slidingWeek); }</code><technical_language>in metric name this is deletes day. want pull out separate method for reuse</technical_language>

Target:
private void registerAggregateMetrics() { forAllMetrics(TableAndAggregateMetric::registerAggregateMetric); }
Source:
<code>private void restoreItems(final ArrayList<IndexedItem> with){ Intent chooserIntent = new Intent(getActivity(), DirectoryChooserActivity.class); chooserIntent.putExtra(DirectoryChooserActivity.EXTRA_NEW_DIR_NAME, "DirChooserSample"); <START> ((HomeActivity)getActivity()).setRequestedActivity(true); <END> startActivityForResult(chooserIntent, REQUEST_DIRECTORY); }</code><technical_language>tabs spaces</technical_language>

Target:
private void restoreItems(final ArrayList<IndexedItem> with) { Intent chooserIntent = new Intent(getActivity(), DirectoryChooserActivity.class); chooserIntent.putExtra(DirectoryChooserActivity.EXTRA_NEW_DIR_NAME, "Export"); ((HomeActivity) getActivity()).setRequestedActivity(true); startActivityForResult(chooserIntent, REQUEST_DIRECTORY); }
Source:
<code>public void prepareRun(BatchAggregatorContext context) throws Exception { super.prepareRun(context); validate(context.getInputSchema(), conf.getFields(), context.getFailureCollector()); context.getFailureCollector().getOrThrowException(); if (conf.getFields() == null) { context.record(TransformLineageRecorderUtils.generateOneToOnes( <START> TransformLineageRecorderUtils.getFields(context.getInputSchema()), <END> "distinctAggregator", "Removed duplicates in input records.")); } else { context.record(TransformLineageRecorderUtils.generateOneToOnes( Lists.newArrayList(conf.getFields()), "distinctAggregator", "Removed duplicates in input records.")); } }</code><technical_language>create this field List<String> fields = conf.getFields() == null ? ... : ... avoid if else block</technical_language>

Target:
public void prepareRun(BatchAggregatorContext context) throws Exception { super.prepareRun(context); validate(context.getInputSchema(), conf.getFields(), context.getFailureCollector()); context.getFailureCollector().getOrThrowException(); List<String> fields = conf.getFields() == null ? TransformLineageRecorderUtils.getFields(context.getInputSchema()) : Lists.newArrayList(conf.getFields()); context.record(TransformLineageRecorderUtils.generateOneToOnes(fields, "distinctAggregator", "Removed duplicates in input records.")); }
Source:
<code>public void execute(IProgressMonitor monitor) throws CoreException { try { if (!repository.isFeature()) { throw new WrongGitFlowStateException( CoreText.FeatureRebaseOperation_notOnAFeatureBranch); } RebaseOperation op = new RebaseOperation( repository.getRepository(), repository.getRepository() .getRef(repository.getDevelopFull())); op.execute(null); operationResult = op.getResult(); <START> } catch (WrongGitFlowStateException e) { throw new CoreException(error(e.getMessage(), e)); } catch (IOException e) { throw new CoreException(error(e.getMessage(), e)); } <END> }</code><technical_language>multi-catch</technical_language>

Target:
public void execute(IProgressMonitor monitor) throws CoreException { try { if (!repository.isFeature()) { throw new WrongGitFlowStateException( CoreText.FeatureRebaseOperation_notOnAFeatureBranch); } RebaseOperation op = new RebaseOperation( repository.getRepository(), repository.getRepository() .getRef(repository.getDevelopFull())); op.execute(null); operationResult = op.getResult(); } catch (WrongGitFlowStateException | IOException e) { throw new CoreException(error(e.getMessage(), e)); } }
Source:
<code>public List<ExternalSubnet> getAllSubnets(ProviderNetwork network) { return <START> null; <END> }</code><technical_language>empty list</technical_language>

Target:
public List<ExternalSubnet> getAllSubnets(ProviderNetwork network) { return Collections.emptyList(); }
Source:
<code>public PrefetchedLoadingLookupFactory( @JsonProperty("dataFetcher") PrefetchableFetcher prefetchableFetcher, @JsonProperty("loadingCacheSpec") LoadingCache<String, String> loadingCache, @JsonProperty("reverseLoadingCacheSpec") LoadingCache<String, List<String>> reverseLoadingCache ) { <START> super(prefetchableFetcher, loadingCache, reverseLoadingCache, new PrefetchedLoadingLookup(prefetchableFetcher,loadingCache,reverseLoadingCache)); <END> }</code><technical_language>this instead of super</technical_language>

Target:
public PrefetchedLoadingLookupFactory( @JsonProperty("dataFetcher") PrefetchableFetcher prefetchableFetcher, @JsonProperty("loadingCacheSpec") LoadingCache<String, String> loadingCache, @JsonProperty("reverseLoadingCacheSpec") LoadingCache<String, List<String>> reverseLoadingCache ) { this(prefetchableFetcher, loadingCache, reverseLoadingCache, new PrefetchedLoadingLookup(prefetchableFetcher,loadingCache,reverseLoadingCache)); }
Source:
<code>private void discoverGlobalFaultData(FaultMessage faultMessage) { if (m_recovering) { org.voltdb.VoltDB.crashLocalVoltDB( "Aborting recovery due to a remote node (" + CoreUtils.hsIdToString(faultMessage.failedSite) + ") failure. Retry again.", false, null); } <START> if (VoltDB.instance().rejoining()) { <END> VoltDB.crashLocalVoltDB("Another node failed before this node could finish rejoining. " + "As a result, the rejoin operation has been canceled. Please try again."); } Set<Long> unknownFaultedHosts = new TreeSet<>(); Map<Long, Long> initiatorSafeInitPoint = m_meshArbiter.reconfigureOnFault(m_hsIds, faultMessage, unknownFaultedHosts); ImmutableSet<Long> failedSites = ImmutableSet.copyOf(initiatorSafeInitPoint.keySet()); if (initiatorSafeInitPoint.isEmpty() && unknownFaultedHosts.isEmpty()) { return; } ImmutableSet.Builder<Integer> failedHosts = ImmutableSet.builder(); for (long hsId: failedSites) { failedHosts.add(CoreUtils.getHostIdFromHSId(hsId)); } for (long hsId : unknownFaultedHosts) { failedHosts.add(CoreUtils.getHostIdFromHSId(hsId)); } m_failedHostsCallback.disconnect(failedHosts.build()); if (!initiatorSafeInitPoint.isEmpty()) { handleSiteFaults(failedSites, initiatorSafeInitPoint); } m_hsIds.removeAll(failedSites); }</code><technical_language>This violates assumption of voltcore of dependencies cluster state (i.e. VoltCore able stand own)</technical_language>

Target:
private void discoverGlobalFaultData(FaultMessage faultMessage) { if (m_recovering) { org.voltdb.VoltDB.crashLocalVoltDB( "Aborting recovery due to a remote node (" + CoreUtils.hsIdToString(faultMessage.failedSite) + ") failure. Retry again.", false, null); } m_failedHostsCallback.disconnect(null); Set<Long> unknownFaultedHosts = new TreeSet<>(); Map<Long, Long> initiatorSafeInitPoint = m_meshArbiter.reconfigureOnFault(m_hsIds, faultMessage, unknownFaultedHosts); ImmutableSet<Long> failedSites = ImmutableSet.copyOf(initiatorSafeInitPoint.keySet()); if (initiatorSafeInitPoint.isEmpty() && unknownFaultedHosts.isEmpty()) { return; } ImmutableSet.Builder<Integer> failedHosts = ImmutableSet.builder(); for (long hsId: failedSites) { failedHosts.add(CoreUtils.getHostIdFromHSId(hsId)); } for (long hsId : unknownFaultedHosts) { failedHosts.add(CoreUtils.getHostIdFromHSId(hsId)); } m_failedHostsCallback.disconnect(failedHosts.build()); if (!initiatorSafeInitPoint.isEmpty()) { handleSiteFaults(failedSites, initiatorSafeInitPoint); } m_hsIds.removeAll(failedSites); }
Source:
<code>private PathTransferResult doPathTransfer( Transfer transfer, ArtifactStore tgt, PathsPromoteRequest request ) throws IndyWorkflowException { long begin = System.currentTimeMillis(); final String path = transfer.getPath(); PathTransferResult result = new PathTransferResult( path ); if ( !transfer.exists() ) { <START> String msg = String.format( "Failed to promote: %s. Source file not exists.", transfer ); <END> result.error = msg; return result; } Transfer target = contentManager.getTransfer( tgt, path, UPLOAD ); if ( target != null && target.exists() ) { if ( request.isFailWhenExists() ) { String msg = String.format( "Failed to promote: %s. Target: %s. Target file already exists.", transfer, request.getTarget() ); result.error = msg; } else { result.skipped = true; } return result; } try (InputStream stream = transfer.openInputStream( true )) { contentManager.store( tgt, path, stream, UPLOAD, new EventMetadata().set( IGNORE_READONLY, true ) ); } catch ( final IOException e ) { String msg = String.format( "Failed to promote: %s. Error: %s", transfer, e.getMessage() ); result.error = msg; logger.error( msg, e ); } logger.info( "Promotion transfer completed, target: {}, path: {}, timeInMillSeconds: {}", tgt.getKey(), path, timeInMillSeconds( begin ) ); return result; }</code><technical_language>log too. control promotion result, good messages in logs debug if is confusing</technical_language>

Target:
private PathTransferResult doPathTransfer( Transfer transfer, ArtifactStore tgt, PathsPromoteRequest request ) throws IndyWorkflowException { long begin = System.currentTimeMillis(); final String path = transfer.getPath(); PathTransferResult result = new PathTransferResult( path ); if ( !transfer.exists() ) { String msg = String.format( "Failed to promote: %s. Source file not exists.", transfer ); logger.info( msg ); result.error = msg; return result; } Transfer target = contentManager.getTransfer( tgt, path, UPLOAD ); if ( target != null && target.exists() ) { if ( request.isFailWhenExists() ) { String msg = String.format( "Failed to promote: %s. Target: %s. Target file already exists.", transfer, request.getTarget() ); logger.info( msg ); result.error = msg; } else { result.skipped = true; } return result; } try (InputStream stream = transfer.openInputStream( true )) { contentManager.store( tgt, path, stream, UPLOAD, new EventMetadata().set( IGNORE_READONLY, true ) ); } catch ( final IOException e ) { String msg = String.format( "Failed to promote: %s. Error: %s", transfer, e.getMessage() ); result.error = msg; logger.error( msg, e ); } logger.info( "Promotion transfer completed, target: {}, path: {}, timeInMillSeconds: {}", tgt.getKey(), path, timeInMillSeconds( begin ) ); return result; }
Source:
<code>private void assertSTGeometries(String wkt, String... expected) { <START> assertFunction(String.format("transform(ST_Geometries(ST_GeometryFromText('%s')), x -> ST_AsText(x))", wkt), new ArrayType(VARCHAR), ImmutableList.copyOf(expected)); <END> }</code><technical_language>Unrelated change</technical_language>

Target:
private void assertSTGeometries(String wkt, String... expected) { assertFunction(String.format("transform(ST_Geometries(ST_GeometryFromText('%s')), x -> ST_ASText(x))", wkt), new ArrayType(VARCHAR), ImmutableList.copyOf(expected)); }
Source:
<code>public Sequence<Result<TimeBoundaryResultValue>> run( final Query<Result<TimeBoundaryResultValue>> input, final Map<String, Object> responseContext ) { if (!(input instanceof TimeBoundaryQuery)) { throw new ISE("Got a [%s] which isn't a %s", input.getClass(), TimeBoundaryQuery.class); } final TimeBoundaryQuery legacyQuery = (TimeBoundaryQuery) input; return new BaseSequence<>( new BaseSequence.IteratorMaker<Result<TimeBoundaryResultValue>, Iterator<Result<TimeBoundaryResultValue>>>() { @Override public Iterator<Result<TimeBoundaryResultValue>> make() { if (adapter == null) { throw new ISE( "Null storage adapter found. Probably trying to issue a query against a segment being memory unmapped." ); } final DateTime minTime; final DateTime maxTime; if (legacyQuery.getDimensionsFilter() != null) { minTime = getTimeBoundary(adapter, legacyQuery, false); <START> maxTime = getTimeBoundary(adapter, legacyQuery, true); <END> } else { minTime = legacyQuery.getBound().equalsIgnoreCase(TimeBoundaryQuery.MAX_TIME) ? null : adapter.getMinTime(); maxTime = legacyQuery.getBound().equalsIgnoreCase(TimeBoundaryQuery.MIN_TIME) ? null : adapter.getMaxTime(); } return legacyQuery.buildResult( adapter.getInterval().getStart(), minTime, maxTime ).iterator(); } @Override public void cleanup(Iterator<Result<TimeBoundaryResultValue>> toClean) { } } ); }</code><technical_language>If minTime is null (nothing matched filter) avoid checking maxTime</technical_language>

Target:
public Sequence<Result<TimeBoundaryResultValue>> run( final Query<Result<TimeBoundaryResultValue>> input, final Map<String, Object> responseContext ) { if (!(input instanceof TimeBoundaryQuery)) { throw new ISE("Got a [%s] which isn't a %s", input.getClass(), TimeBoundaryQuery.class); } final TimeBoundaryQuery legacyQuery = (TimeBoundaryQuery) input; return new BaseSequence<>( new BaseSequence.IteratorMaker<Result<TimeBoundaryResultValue>, Iterator<Result<TimeBoundaryResultValue>>>() { @Override public Iterator<Result<TimeBoundaryResultValue>> make() { if (adapter == null) { throw new ISE( "Null storage adapter found. Probably trying to issue a query against a segment being memory unmapped." ); } final DateTime minTime; final DateTime maxTime; if (legacyQuery.getDimensionsFilter() != null) { minTime = getTimeBoundary(adapter, legacyQuery, false); if (minTime == null) { maxTime = null; } else { maxTime = getTimeBoundary(adapter, legacyQuery, true); } } else { minTime = legacyQuery.getBound().equalsIgnoreCase(TimeBoundaryQuery.MAX_TIME) ? null : adapter.getMinTime(); maxTime = legacyQuery.getBound().equalsIgnoreCase(TimeBoundaryQuery.MIN_TIME) ? null : adapter.getMaxTime(); } return legacyQuery.buildResult( adapter.getInterval().getStart(), minTime, maxTime ).iterator(); } @Override public void cleanup(Iterator<Result<TimeBoundaryResultValue>> toClean) { } } ); }
Source:
<code>private void fetchAndWriteLineage(Set<String> entityIds, FileWriter fw, ClientConfig config) throws IOException { HttpURLConnection connection = createHttpConnection(config, entityIds); InputStream stream = connection.getInputStream(); ObjectMapper mapper = new ObjectMapper(); <START> mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); <END> mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true); ArrayList entities = (ArrayList) mapper.readValue(stream, Object.class); Iterator it = entities.iterator(); while (it.hasNext()) { Map<String, Object> m = (Map<String, Object>) it.next(); String id = (String) m.get("id"); Map<String, Object> children = (Map<String, Object>) m.get("children"); if (children != null) { for (Map.Entry<String, Object> entry : children.entrySet()) { ArrayList<String> childrenIds = (ArrayList<String>) entry.getValue(); for (String childId : childrenIds) { fw.write(String.format("%s, %s, %s%n", id, childId, entry.getKey())); } } } } IOUtils.close(connection); }</code><technical_language>Do need this config</technical_language>

Target:
private void fetchAndWriteLineage(Set<String> entityIds, FileWriter fw, ClientConfig config) throws IOException { HttpURLConnection connection = createHttpConnection(config, entityIds); try { InputStream stream = connection.getInputStream(); ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true); Collection<Map<String, Object>> entities = mapper.readValue(stream, new TypeReference<Collection<Map<String, Object>>>() {}); for (Map<String, Object> m : entities) { String id = (String) m.get("id"); Map<String, Object> children = (Map<String, Object>) m.get("children"); if (children != null) { Collection<String> childrenIds; for (Map.Entry<String, Object> entry : children.entrySet()) { childrenIds = (Collection<String>) entry.getValue(); for (String childId : childrenIds) { fw.write(String.format("%s, %s, %s%n", id, childId, entry.getKey())); } } } } } catch (IOException ioe) { Throwables.propagate(ioe); } finally { IOUtils.close(connection); } }
Source:
<code>public void testInterruptedExceptionIsPassedThrough() throws Exception { InterruptedException thrown = new InterruptedException(); RemoteOptions options = Options.getDefaults(RemoteOptions.class); <START> options.remoteRetryMaxAttempts = 0; <END> RemoteRetrier retrier = new RemoteRetrier(options, (e) -> true, retryService, Retrier.ALLOW_ALL_CALLS); try { retrier.execute(() -> { throw thrown; }); fail(); } catch (InterruptedException expected) { assertThat(expected).isSameAs(thrown); } }</code><technical_language>s/remoteRetryMaxAttempts/remoteMaxRetryAttempts/</technical_language>

Target:
public void testInterruptedExceptionIsPassedThrough() throws Exception { InterruptedException thrown = new InterruptedException(); RemoteOptions options = Options.getDefaults(RemoteOptions.class); options.remoteMaxRetryAttempts = 0; RemoteRetrier retrier = new RemoteRetrier(options, (e) -> true, retryService, Retrier.ALLOW_ALL_CALLS); try { retrier.execute(() -> { throw thrown; }); fail(); } catch (InterruptedException expected) { assertThat(expected).isSameAs(thrown); } }