auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void checkNotAdvertisedWants(UploadPack up, List<ObjectId> notAdvertisedWants, Set<ObjectId> reachableFrom) throws IOException { ObjectReader reader = up.getRevWalk().getObjectReader(); try (RevWalk walk = new RevWalk(reader)) { <START> walk.setRetainBody(false); <END> List<RevObject> wantsAsObjs = objectIdsToRevObjects(walk, notAdvertisedWants); List<RevCommit> wantsAsCommits = wantsAsObjs.stream() .filter(obj -> obj instanceof RevCommit) .map(obj -> (RevCommit) obj) .collect(Collectors.toList()); boolean allWantsAreCommits = wantsAsObjs.size() == wantsAsCommits .size(); boolean repoHasBitmaps = reader.getBitmapIndex() != null; if (!allWantsAreCommits) { if (!repoHasBitmaps) { RevObject nonCommit = wantsAsObjs .stream() .filter(obj -> !(obj instanceof RevCommit)) .limit(1) .collect(Collectors.toList()).get(0); throw new WantNotValidException(nonCommit); } checkNotAdvertisedWantsUsingBitmap(reader, reader.getBitmapIndex(), notAdvertisedWants, reachableFrom); return; } ReachabilityChecker reachabilityChecker = walk .getReachabilityChecker(); List<RevCommit> starters = objectIdsToRevCommits(walk, reachableFrom); Optional<RevCommit> unreachable = reachabilityChecker .areAllReachable(wantsAsCommits, starters); if (unreachable.isPresent()) { throw new WantNotValidException(unreachable.get()); } } catch (MissingObjectException notFound) { throw new WantNotValidException(notFound.getObjectId(), notFound); } }</code><technical_language>unrelated change</technical_language>

Target:
private static void checkNotAdvertisedWants(UploadPack up, List<ObjectId> notAdvertisedWants, Set<ObjectId> reachableFrom) throws IOException { ObjectReader reader = up.getRevWalk().getObjectReader(); try (RevWalk walk = new RevWalk(reader)) { walk.setRetainBody(false); List<RevObject> wantsAsObjs = objectIdsToRevObjects(walk, notAdvertisedWants); List<RevCommit> wantsAsCommits = wantsAsObjs.stream() .filter(obj -> obj instanceof RevCommit) .map(obj -> (RevCommit) obj) .collect(Collectors.toList()); boolean allWantsAreCommits = wantsAsObjs.size() == wantsAsCommits .size(); boolean repoHasBitmaps = reader.getBitmapIndex() != null; if (!allWantsAreCommits) { if (!repoHasBitmaps) { RevObject nonCommit = wantsAsObjs .stream() .filter(obj -> !(obj instanceof RevCommit)) .limit(1) .collect(Collectors.toList()).get(0); throw new WantNotValidException(nonCommit); } checkNotAdvertisedWantsUsingBitmap(reader, reader.getBitmapIndex(), notAdvertisedWants, reachableFrom); return; } ReachabilityChecker reachabilityChecker = walk .createReachabilityChecker(); List<RevCommit> starters = objectIdsToRevCommits(walk, reachableFrom); Optional<RevCommit> unreachable = reachabilityChecker .areAllReachable(wantsAsCommits, starters); if (unreachable.isPresent()) { throw new WantNotValidException(unreachable.get()); } } catch (MissingObjectException notFound) { throw new WantNotValidException(notFound.getObjectId(), notFound); } }
Source:
<code>public HTTPArgument(String name, String value, boolean alreadyEncoded, String contentEncoding) { setAlwaysEncoded(true); if (alreadyEncoded) { try { if(log.isDebugEnabled()) { <START> log.debug("Decoding name, calling URLDecoder.decode with '"+name+"' and contentEncoding:"+EncoderCache.URL_ARGUMENT_ENCODING); <END> } URLCodec urlCodec = new URLCodec(contentEncoding); name = urlCodec.decode(name, EncoderCache.URL_ARGUMENT_ENCODING); if(log.isDebugEnabled()) { log.debug("Decoding value, calling URLDecoder.decode with '"+value+"' and contentEncoding:"+contentEncoding); } value = urlCodec.decode(value, contentEncoding); } catch (UnsupportedEncodingException e) { log.error(contentEncoding + " encoding not supported!"); throw new Error(e.toString(), e); } catch (DecoderException e) { log.error(contentEncoding + " exception in decoder!"); throw new IllegalArgumentException(e.toString(), e); } } setName(name); setValue(value); setMetaData("="); }</code><technical_language>do need this change</technical_language>

Target:
public HTTPArgument(String name, String value, boolean alreadyEncoded, String contentEncoding) { setAlwaysEncoded(true); if (alreadyEncoded) { try { if(log.isDebugEnabled()) { log.debug("Decoding name, calling URLDecoder.decode with '{}' and contentEncoding: '{}'", name, EncoderCache.URL_ARGUMENT_ENCODING); } URLCodec urlCodec = new URLCodec(contentEncoding); name = urlCodec.decode(name, EncoderCache.URL_ARGUMENT_ENCODING); if(log.isDebugEnabled()) { log.debug("Decoding value, calling URLDecoder.decode with '{}' and contentEncoding: '{}'", value, contentEncoding); } value = urlCodec.decode(value, contentEncoding); } catch (UnsupportedEncodingException e) { log.error("{} encoding not supported!", contentEncoding); throw new Error(e.toString(), e); } catch (DecoderException e) { throw new IllegalArgumentException(e.toString(), e); } } setName(name); setValue(value); setMetaData("="); }
Source:
<code>public void testMaximize() throws Exception { final SWTBotShell shell = bot.shell("shell4"); final int originalwidth = 400, originalheight = 400; UIThreadRunnable.syncExec(display, new VoidResult() { @Override public void run() { <START> shell.widget.setSize(originalwidth, originalheight); <END> } }); shell.maximize(true); assertThat(getWidth(shell), greaterThan(originalwidth)); assertThat(getHeight(shell), greaterThan(originalheight)); shell.maximize(false); assertThat(getWidth(shell), lessThanOrEqualTo(originalwidth)); assertThat(getHeight(shell), lessThanOrEqualTo(originalheight)); }</code><technical_language>sure, this effect if shell is maximized minimized? Do need not</technical_language>

Target:
public void testMaximize() throws Exception { final SWTBotShell shell = bot.shell("shell4"); final int originalwidth = 400, originalheight = 400; UIThreadRunnable.syncExec(display, new VoidResult() { @Override public void run() { shell.widget.setSize(originalwidth, originalheight); } }); assertEquals("Initial width", originalwidth, getWidth(shell)); assertEquals("Initial height", originalheight, getHeight(shell)); shell.maximize(true); assertThat(getWidth(shell), greaterThan(originalwidth)); assertThat(getHeight(shell), greaterThan(originalheight)); shell.maximize(false); assertThat(getWidth(shell), lessThanOrEqualTo(originalwidth)); assertThat(getHeight(shell), lessThanOrEqualTo(originalheight)); }
Source:
<code>synchronized RequestFuture<Map<String,ByteBuffer>> sendHeartbeatRequest() { log.debug("Sending Heartbeat request to coordinator {}", coordinator); HeartbeatRequest.Builder requestBuilder = new HeartbeatRequest.Builder(new HeartbeatRequestData() .setGroupId(rebalanceConfig.groupId) .setMemberId(this.generation.memberId) .setGroupInstanceId(this.rebalanceConfig.groupInstanceId.orElse(null)) .setGenerationId(this.generation.generationId) <START> .setUserData(getHeartbeatData()) <END> ); return client.send(coordinator, requestBuilder) .compose(new HeartbeatResponseHandler()); }</code><technical_language>some changes in HeartbeatRequest included</technical_language>

Target:
synchronized RequestFuture<Void> sendHeartbeatRequest() { log.debug("Sending Heartbeat request to coordinator {}", coordinator); HeartbeatRequest.Builder requestBuilder = new HeartbeatRequest.Builder(new HeartbeatRequestData() .setGroupId(rebalanceConfig.groupId) .setMemberId(this.generation.memberId) .setGroupInstanceId(this.rebalanceConfig.groupInstanceId.orElse(null)) .setGenerationId(this.generation.generationId) .setUserData(HeartbeatUserData.serializeOneUserData(getHeartbeatData())) ); return client.send(coordinator, requestBuilder) .compose(new HeartbeatResponseHandler()); }
Source:
<code>public static <T extends Comparable<? super T>> T combineAnnotationValues(final List<T> values) { Utils.nonEmpty(values); final int size = values.size(); if ( size == 1 ) { return values.get(0); } else { <START> final ArrayList<T> sorted = new ArrayList<>(values); <END> Collections.sort(sorted); return sorted.get(size / 2); } }</code><technical_language>final List<T> sorted = ..</technical_language>

Target:
private static <T extends Comparable<? super T>> T combineAnnotationValues(final List<T> values) { Utils.nonEmpty(values); final int size = values.size(); if ( size == 1 ) { return values.get(0); } else { final List<T> sorted = values.stream().sorted().collect(Collectors.toList()); return sorted.get(size / 2); } }
Source:
<code>private AddIntegerTrainer(final ParameterWorker<Integer, Integer, Integer> parameterWorker, @Parameter(Parameters.Iterations.class) final int numIterations, @Parameter(Parameters.MiniBatchSize.class) final int miniBatchSize, @Parameter(ExampleParameters.DeltaValue.class) final int delta, @Parameter(ExampleParameters.NumKeys.class) final int numberOfKeys, @Parameter(ExampleParameters.NumWorkers.class) final int numberOfWorkers, @Parameter(ExampleParameters.ComputeTimeMs.class) final long computeTime, @Parameter(ExampleParameters.NumTrainingData.class) final int numTrainingData, final MetricsMsgSender<WorkerMetrics> metricsMsgSender) { this.parameterWorker = parameterWorker; this.delta = delta; this.numberOfKeys = numberOfKeys; this.computeTime = computeTime; <START> final int numMiniBatches = (numTrainingData + miniBatchSize - 1) / miniBatchSize; <END> this.expectedResult = delta * numberOfWorkers * numIterations * numMiniBatches; LOG.log(Level.INFO, "delta:{0}, numWorkers:{1}, numIterations:{2}, numTrainingData:{3}, numMiniBatches:{4}", new Object[]{delta, numberOfWorkers, numIterations, numTrainingData, numMiniBatches}); this.metricsMsgSender = metricsMsgSender; this.computeTracer = new Tracer(); }</code><technical_language>following, is more intuitive I think..? final int numMiniBatches = numTrainingData / miniBatchSize + (numTrainingData % miniBatchSize != 0 ? 1 : 0);</technical_language>

Target:
private AddIntegerTrainer(final ParameterWorker<Integer, Integer, Integer> parameterWorker, @Parameter(Parameters.Iterations.class) final int numIterations, @Parameter(Parameters.MiniBatchSize.class) final int miniBatchSize, @Parameter(ExampleParameters.DeltaValue.class) final int delta, @Parameter(ExampleParameters.NumKeys.class) final int numberOfKeys, @Parameter(ExampleParameters.NumWorkers.class) final int numberOfWorkers, @Parameter(ExampleParameters.ComputeTimeMs.class) final long computeTime, @Parameter(ExampleParameters.NumTrainingData.class) final int numTrainingData, final MetricsMsgSender<WorkerMetrics> metricsMsgSender) { this.parameterWorker = parameterWorker; this.delta = delta; this.numberOfKeys = numberOfKeys; this.computeTime = computeTime; final int numMiniBatches = numTrainingData / miniBatchSize + (numTrainingData % miniBatchSize != 0 ? 1 : 0); this.expectedResult = delta * numberOfWorkers * numIterations * numMiniBatches; LOG.log(Level.INFO, "delta:{0}, numWorkers:{1}, numIterations:{2}, numTrainingData:{3}, numMiniBatches:{4}", new Object[]{delta, numberOfWorkers, numIterations, numTrainingData, numMiniBatches}); this.metricsMsgSender = metricsMsgSender; this.computeTracer = new Tracer(); }
Source:
<code>private String printStats(Http.Request request) throws JsonProcessingException { Map<String, String[]> stringMap = request.body() .asFormUrlEncoded(); Map<String, Object> map = ImmutableMap.of( "Result", "ok", "GetParams", request.queryString(), <START> "PostParams", stringMap == null ? "null" : stringMap, <END> "Headers", request.getHeaders().toMap() ); return new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(map); }</code><technical_language>"null" is correct default here? emptyMap() null? type object string</technical_language>

Target:
private String printStats(Http.Request request) throws JsonProcessingException { Map<String, String[]> stringMap = request.body() .asFormUrlEncoded(); Map<String, Object> map = ImmutableMap.of( "Result", "ok", "GetParams", request.queryString(), "PostParams", stringMap == null ? Collections.emptyMap() : stringMap, "Headers", request.getHeaders().toMap() ); return new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(map); }
Source:
<code>public void init(Map<String, Serializable> args) throws Exception { if (args.containsKey("ftpHostname")) { ftpHostname = args.get("ftpHostname").toString(); } if (args.containsKey("ftpPort")) { try { ftpPort = Integer.parseInt(args.get("ftpPort").toString()); } catch (NumberFormatException e) { } } if (args.containsKey("ftpExtractArchive")) { ftpExtractArchive = Boolean.parseBoolean(args.get("ftpExtractArchive").toString()); } if (args.containsKey("ftpLocalFilePath")) { ftpLocalFilePath = args.get("ftpLocalFilePath") == null ? "" : args.get("ftpLocalFilePath").toString(); } if (args.containsKey("ftpRemoteFilePath")) { ftpRemoteFilePath = args.get("ftpRemoteFilePath").toString(); } if (args.containsKey("ftpMode")) { ftpMode = args.get("ftpMode").toString(); } ftpUsername = getThirdPartyCredential("FTP_USERNAME"); ftpPassword = getThirdPartyCredential("FTP_PASSWORD"); if (ftpUsername == null || ftpPassword == null) { <START> throw new Exception("You first need to add your ftp username and password (FTP_USERNAME, FTP_PASSWORD) to the third party credentials"); <END> } }</code><technical_language>IllegalArgumentException</technical_language>

Target:
public void init(Map<String, Serializable> args) throws Exception { if (args.containsKey("ftpHostname")) { ftpHostname = args.get("ftpHostname").toString(); } if (args.containsKey("ftpPort")) { try { ftpPort = Integer.parseInt(args.get("ftpPort").toString()); } catch (NumberFormatException e) { } } if (args.containsKey("ftpExtractArchive")) { ftpExtractArchive = Boolean.parseBoolean(args.get("ftpExtractArchive").toString()); } if (args.containsKey(FTP_LOCAL_FILE_PATH)) { ftpLocalFilePath = args.get(FTP_LOCAL_FILE_PATH) == null ? "" : args.get(FTP_LOCAL_FILE_PATH).toString(); } if (args.containsKey("ftpRemoteFilePath")) { ftpRemoteFilePath = args.get("ftpRemoteFilePath").toString(); } if (args.containsKey("ftpMode")) { ftpMode = args.get("ftpMode").toString(); } ftpUsername = getThirdPartyCredential("FTP_USERNAME"); ftpPassword = getThirdPartyCredential("FTP_PASSWORD"); if (ftpUsername == null || ftpPassword == null) { throw new IllegalArgumentException("You first need to add your ftp username and password (FTP_USERNAME, FTP_PASSWORD) to the third party credentials"); } }
Source:
<code>public static ItemStack insert(Block node, Block target, ItemStack stack, int index) { if (!matchesFilter(node, stack, index)) return stack; DirtyChestMenu menu = getChestMenu(target); if (menu == null) { if (BlockUtils.hasInventory(target)) { BlockState state = target.getState(); if (state instanceof InventoryHolder) { return insertIntoVanillaInventory(stack, ((InventoryHolder) state).getInventory()); } } return stack; } ItemStackWrapper wrapper = new ItemStackWrapper(stack); for (int slot : menu.getPreset().getSlotsAccessedByItemTransport(menu, ItemTransportFlow.INSERT, stack)) { ItemStack itemInSlot = menu.getItemInSlot(slot); if (itemInSlot == null) { menu.replaceExistingItem(slot, stack); return null; } <START> int inSlotMaxSize = itemInSlot.getType().getMaxStackSize(); <END> int inSlotAmount = itemInSlot.getAmount(); if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false) && inSlotAmount < inSlotMaxSize) { int amount = inSlotAmount + stack.getAmount(); itemInSlot.setAmount(Math.max(amount, inSlotMaxSize)); if (amount > inSlotMaxSize) { stack.setAmount(amount - inSlotMaxSize); } else { stack = null; } menu.replaceExistingItem(slot, itemInSlot); return stack; } } return stack; }</code><technical_language>maxSize a more name for this variable here. "inSlotMaxSize" is unpleasant read</technical_language>

Target:
public static ItemStack insert(Block node, Block target, ItemStack stack, int index) { if (!matchesFilter(node, stack, index)) return stack; DirtyChestMenu menu = getChestMenu(target); if (menu == null) { if (BlockUtils.hasInventory(target)) { BlockState state = target.getState(); if (state instanceof InventoryHolder) { return insertIntoVanillaInventory(stack, ((InventoryHolder) state).getInventory()); } } return stack; } ItemStackWrapper wrapper = new ItemStackWrapper(stack); for (int slot : menu.getPreset().getSlotsAccessedByItemTransport(menu, ItemTransportFlow.INSERT, stack)) { ItemStack itemInSlot = menu.getItemInSlot(slot); if (itemInSlot == null) { menu.replaceExistingItem(slot, stack); return null; } int maxStackSize = itemInSlot.getType().getMaxStackSize(); int currentAmount = itemInSlot.getAmount(); if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false) && currentAmount < maxStackSize) { int amount = currentAmount + stack.getAmount(); itemInSlot.setAmount(Math.min(amount, maxStackSize)); if (amount > maxStackSize) { stack.setAmount(amount - maxStackSize); } else { stack = null; } menu.replaceExistingItem(slot, itemInSlot); return stack; } } return stack; }
Source:
<code>public void testGenotypePhenotypeSearchFeaturePagingAll() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setFeature("KIT *wild"); request.setPageSize(1); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response).isNotNull(); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations().size()).isEqualTo(1); <START> for(int i = 0 ; i < 3 ; i++) { <END> String previous_id = response.getAssociations().get(0).getId() ; request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setFeature("KIT *wild"); request.setPageSize(1); request.setPageToken(response.getNextPageToken()); response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response.getAssociations().size()).isEqualTo(1); assertThat(previous_id).isNotEqualTo(response.getAssociations().get(0).getId()) ; assertThat(response.getNextPageToken()).isNotNull(); } }</code><technical_language>is this looping 3 times? special 3</technical_language>

Target:
public void testGenotypePhenotypeSearchFeaturePagingAll() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setFeature(TestData.FEATURE_NAME); request.setPageSize(1); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations().size()).isEqualTo(1); while(response.getNextPageToken() != null) { System.err.println(response.getNextPageToken()) ; String previous_id = response.getAssociations().get(0).getId() ; request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setFeature(TestData.FEATURE_NAME); request.setPageSize(1); request.setPageToken(response.getNextPageToken()); response = client.genotypePhenotype.searchGenotypePhenotype(request); if (response.getNextPageToken() != null ) { assertThat(response.getAssociations()).isNotEmpty(); assertThat(previous_id).isNotEqualTo(response.getAssociations().get(0).getId()); } } }
Source:
<code>public void swaptionStandard() { double prIrs1Std = IRS_R_1.accept(PRDC, MULTICURVE_STD); MultipleCurrencyAmount pvIrs1Std = IRS_R_1.accept(PVDC, MULTICURVE_STD); MultipleCurrencyAmount pvSwpt1StdSabr = SWPT_R_L_1.accept(PVSSC, MULTICURVE_STD_SABR); MultipleCurrencyAmount pvSwpt1StdNorm = SWPT_R_L_1.accept(PVNSC, MULTICURVE_STD_NORMAL); MultipleCurrencyParameterSensitivity pvcsIrs1Std = MQSBDC.fromInstrument(IRS_R_1, MULTICURVE_STD, BLOCK_STD).multipliedBy(BP1); MultipleCurrencyParameterSensitivity pvcsSwpt1StdSabr = MQSBSSC.fromInstrument(SWPT_R_L_1, MULTICURVE_STD_SABR, BLOCK_STD).multipliedBy(BP1); MultipleCurrencyParameterSensitivity pvcsSwpt1StdNorm = MQSBNSC.fromInstrument(SWPT_R_L_1, MULTICURVE_STD_NORMAL, BLOCK_STD).multipliedBy(BP1); double ivSwpt1StdSabr = METHOD_SWPT_SABR.impliedVolatility(SWPT_R_L_1, MULTICURVE_STD_SABR); double ivSwpt1StdNorm = METHOD_SWPT_NORMAL.impliedVolatility(SWPT_R_L_1, MULTICURVE_STD_NORMAL); PresentValueSABRSensitivityDataBundle pvvsSwpt1StdSabr = SWPT_R_L_1.accept(PVSSSSC, MULTICURVE_STD_SABR); PresentValueSwaptionSurfaceSensitivity pvvsSwpt1StdNorm = METHOD_SWPT_NORMAL.presentValueVolatilitySensitivity(SWPT_R_L_2, MULTICURVE_STD_NORMAL); <START> int t = 0; <END> }</code><technical_language>Remove this variable</technical_language>

Target:
public void swaptionStandard() { double prIrs1Std = IRS_R_1.accept(PRDC, MULTICURVE_STD); MultipleCurrencyAmount pvIrs1Std = IRS_R_1.accept(PVDC, MULTICURVE_STD); MultipleCurrencyAmount pvSwpt1StdSabr = SWPT_R_L_1.accept(PVSSC, MULTICURVE_STD_SABR); MultipleCurrencyAmount pvSwpt1StdNorm = SWPT_R_L_1.accept(PVNSC, MULTICURVE_STD_NORMAL); MultipleCurrencyParameterSensitivity pvcsIrs1Std = MQSBDC.fromInstrument(IRS_R_1, MULTICURVE_STD, BLOCK_STD).multipliedBy(BP1); MultipleCurrencyParameterSensitivity pvcsSwpt1StdSabr = MQSBSSC.fromInstrument(SWPT_R_L_1, MULTICURVE_STD_SABR, BLOCK_STD).multipliedBy(BP1); MultipleCurrencyParameterSensitivity pvcsSwpt1StdNorm = MQSBNSC.fromInstrument(SWPT_R_L_1, MULTICURVE_STD_NORMAL, BLOCK_STD).multipliedBy(BP1); double ivSwpt1StdSabr = METHOD_SWPT_SABR.impliedVolatility(SWPT_R_L_1, MULTICURVE_STD_SABR); double ivSwpt1StdNorm = METHOD_SWPT_NORMAL.impliedVolatility(SWPT_R_L_1, MULTICURVE_STD_NORMAL); PresentValueSABRSensitivityDataBundle pvvsSwpt1StdSabr = SWPT_R_L_1.accept(PVSSSSC, MULTICURVE_STD_SABR); PresentValueSwaptionSurfaceSensitivity pvvsSwpt1StdNorm = METHOD_SWPT_NORMAL.presentValueVolatilitySensitivity(SWPT_R_L_2, MULTICURVE_STD_NORMAL); }
Source:
<code>public Map<String, String> getUnresolvedGenericInformation() { Set<Entry<String, String>> entries = this.unresolvedGenericInformation.entrySet(); <START> Map<String, String> result = new HashMap<>(entries.size()); <END> for (Entry<String, String> entry : entries) { result.put(entry.getKey(), entry.getValue()); } return result; }</code><technical_language>LinkedHashMap</technical_language>

Target:
public Map<String, String> getUnresolvedGenericInformation() { Set<Entry<String, String>> entries = this.unresolvedGenericInformation.entrySet(); Map<String, String> result = new LinkedHashMap<>(entries.size()); for (Entry<String, String> entry : entries) { result.put(entry.getKey(), entry.getValue()); } return result; }
Source:
<code>public VersionTypeValidation validateWorkflowSet(String initialPath, String contents, Map<String, Pair<String, GenericFileType>> indexedFiles) { Map<String, String> validationMessageObject = new HashMap<>(); Yaml yaml = new Yaml(); List<String> files; boolean isValid = true; try { <START> Map<String, Object> map = yaml.load(contents); <END> Map<String, Object> serviceObject = (Map<String, Object>)map.get("service"); if (serviceObject == null) { validationMessageObject.put(initialPath, "Service key does not exist."); isValid = false; } else { files = (List<String>)serviceObject.get("files"); if (files == null) { validationMessageObject.put(initialPath, "Files key does not exist."); isValid = false; } } } catch (YAMLException | ClassCastException ex) { validationMessageObject.put(initialPath, ex.getMessage()); isValid = false; } VersionTypeValidation validation = new VersionTypeValidation(isValid, validationMessageObject); return validation; }</code><technical_language>define a class for this; I done in branch. this is fine</technical_language>

Target:
public VersionTypeValidation validateWorkflowSet(String initialPath, String contents, Map<String, Pair<String, GenericFileType>> indexedFiles) { Map<String, String> validationMessageObject = new HashMap<>(); Yaml yaml = new Yaml(); List<String> files; boolean isValid = true; try { Map<String, Object> map = yaml.load(contents); Map<String, Object> serviceObject = (Map<String, Object>)map.get("service"); if (serviceObject == null) { validationMessageObject.put(initialPath, "The key 'service' does not exist."); isValid = false; } else { files = (List<String>)serviceObject.get("files"); if (files == null) { validationMessageObject.put(initialPath, "The key 'files' does not exist."); isValid = false; } } } catch (YAMLException | ClassCastException ex) { validationMessageObject.put(initialPath, ex.getMessage()); isValid = false; } VersionTypeValidation validation = new VersionTypeValidation(isValid, validationMessageObject); return validation; }
Source:
<code>public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, String loginHint, PromptBehavior prompt, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_5); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); <START> <END> createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); }</code><technical_language>nit: extra line</technical_language>

Target:
public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, String loginHint, PromptBehavior prompt, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_5); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } }
Source:
<code>private static Intent createBaseIntent(Context context) { <START> Intent intent = new Intent(context, CustomTabsManagerActivity.class); return intent; <END> }</code><technical_language>suggestion return new Intent(context, CustomTabsManagerActivity.class);</technical_language>

Target:
private static Intent createBaseIntent(Context context) { return new Intent(context, CustomTabsManagerActivity.class); }
Source:
<code>public void testMaxIdleRemovedOnAccess() throws InterruptedException, IOException { RemoteCacheManager client0 = client(0); <START> RemoteCache<String, String> cache0 = client0.getCache(); <END> String key = "someKey"; byte[] marshalledKey = client0.getMarshaller().objectToByteBuffer(key); Object keyStorage = cache(0).getAdvancedCache().getValueDataConversion().toStorage(marshalledKey); assertNull(cache0.put(key, "value1", -1, TimeUnit.SECONDS, 100, TimeUnit.MILLISECONDS)); for (Cache cache : caches()) { DataContainer dataContainer = cache.getAdvancedCache().getDataContainer(); assertNotNull(dataContainer.peek(keyStorage)); } Thread.sleep(150); assertNull(cache0.get(key)); for (Cache cache : caches()) { DataContainer dataContainer = cache.getAdvancedCache().getDataContainer(); assertNull(dataContainer.peek(keyStorage)); } }</code><technical_language>Please rename remoteCache0, close cache(0)</technical_language>

Target:
public void testMaxIdleRemovedOnAccess() throws InterruptedException, IOException { RemoteCacheManager client0 = client(0); RemoteCache<String, String> remoteCache0 = client0.getCache(); String key = "someKey"; byte[] marshalledKey = client0.getMarshaller().objectToByteBuffer(key); Object keyStorage = cache(0).getAdvancedCache().getValueDataConversion().toStorage(marshalledKey); assertNull(remoteCache0.put(key, "value1", -1, TimeUnit.MILLISECONDS, 100, TimeUnit.MILLISECONDS)); for (Cache cache : caches()) { DataContainer dataContainer = cache.getAdvancedCache().getDataContainer(); assertNotNull(dataContainer.peek(keyStorage)); } incrementAllTimeServices(150, TimeUnit.MILLISECONDS); assertNull(remoteCache0.get(key)); for (Cache cache : caches()) { DataContainer dataContainer = cache.getAdvancedCache().getDataContainer(); assertNull(dataContainer.peek(keyStorage)); } }
Source:
<code>protected Identifier loadFromDb(String identifier) throws DotDataException, DotStateException { if (identifier == null) { throw new DotStateException("identifier is null"); } DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id = ?"); dc.addParam(identifier); List<Identifier> results = null; try { results = ConvertToPOJOUtil.convertDotConnectMapToIdentifier(dc.loadResults()); } catch (ParseException e) { throw new DotDataException(e); } <START> if (results != null && results.size() > 0){ <END> return results.get(0); } return null; }</code><technical_language>use: return (results != null && results.size() > 0)?results.get(0):null;</technical_language>

Target:
protected Identifier loadFromDb(String identifier) throws DotDataException, DotStateException { if (identifier == null) { throw new DotStateException("identifier is null"); } DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id = ?"); dc.addParam(identifier); List<Identifier> results = null; try { results = ConvertToPOJOUtil.convertDotConnectMapToIdentifier(dc.loadResults()); } catch (ParseException e) { throw new DotDataException(e); } return (results != null && !results.isEmpty())?results.get(0):null; }
Source:
<code>public ImportWrapper(String fullname, String name, Node node, Class<?> type, boolean isStaticDemand) { this(fullname, name, node, isStaticDemand); if (type != null) { for (Method m : type.getMethods()) { allDemands.add(m.getName()); } for (Field f : type.getFields()) { allDemands.add(f.getName()); } int requiredMod = Modifier.STATIC; for (Field f : type.getDeclaredFields()) { <START> if ((f.getModifiers() & requiredMod) == requiredMod) { <END> allDemands.add(f.getName()); } } } }</code><technical_language>Modifier.isStatic(f.getModifiers()) instead</technical_language>

Target:
public ImportWrapper(String fullname, String name, Node node, Class<?> type, boolean isStaticDemand) { this(fullname, name, node, isStaticDemand); if (type != null) { for (Method m : type.getMethods()) { allDemands.add(m.getName()); } for (Field f : type.getFields()) { allDemands.add(f.getName()); } for (Field f : type.getDeclaredFields()) { if (Modifier.isStatic(f.getModifiers())) { allDemands.add(f.getName()); } } } }
Source:
<code>public SubscriptionMetrics loadMetrics(TopicName topicName, String subscriptionName) { String rateMetric = metricPath(topicName, subscriptionName); String timeouts = metricPathTimeouts(topicName, subscriptionName); String otherErrors = metricPathOtherErrors(topicName, subscriptionName); GraphiteMetrics metrics = graphiteClient.readMetrics(rateMetric); List<String> httpStatusCodes = allHttpStatusCodeClasses() .map(code -> metricPathHttpStatuses(topicName, subscriptionName, code)) <START> .map(m -> graphiteClient.readMetrics(m) <END> .metricValue(m)) .collect(Collectors.toList()); return SubscriptionMetrics.Builder.subscriptionMetrics() .withRate(metrics.metricValue(rateMetric)) .withDelivered(sharedCounter.getValue(zookeeperPaths.subscriptionMetricPath(topicName, subscriptionName, "delivered"))) .withDiscarded(sharedCounter.getValue(zookeeperPaths.subscriptionMetricPath(topicName, subscriptionName, "discarded"))) .withInflight(distributedCounter.getValue( zookeeperPaths.consumersPath(), zookeeperPaths.subscriptionMetricPathWithoutBasePath(topicName, subscriptionName, "inflight") )) .withHttpStatusCodesM1(httpStatusCodes) .withTimeoutsM1(graphiteClient.readMetrics(timeouts).metricValue(timeouts)) .withOtherErrorsM1(graphiteClient.readMetrics(otherErrors).metricValue(otherErrors)) .build(); }</code><technical_language>added 7 additional request graphite. GraphiteClient allows read metrics in request</technical_language>

Target:
public SubscriptionMetrics loadMetrics(TopicName topicName, String subscriptionName) { String rateMetric = metricPath(topicName, subscriptionName); String timeouts = metricPathTimeouts(topicName, subscriptionName); String otherErrors = metricPathOtherErrors(topicName, subscriptionName); String codes2xxPath = metricPathHttpStatuses(topicName, subscriptionName, "2xx"); String codes4xxPath = metricPathHttpStatuses(topicName, subscriptionName, "4xx"); String codes5xxPath = metricPathHttpStatuses(topicName, subscriptionName, "5xx"); GraphiteMetrics metrics = graphiteClient.readMetrics(codes2xxPath, codes4xxPath, codes5xxPath, rateMetric, timeouts, otherErrors); return SubscriptionMetrics.Builder.subscriptionMetrics() .withRate(metrics.metricValue(rateMetric)) .withDelivered(sharedCounter.getValue(zookeeperPaths.subscriptionMetricPath(topicName, subscriptionName, "delivered"))) .withDiscarded(sharedCounter.getValue(zookeeperPaths.subscriptionMetricPath(topicName, subscriptionName, "discarded"))) .withInflight(distributedCounter.getValue( zookeeperPaths.consumersPath(), zookeeperPaths.subscriptionMetricPathWithoutBasePath(topicName, subscriptionName, "inflight") )) .withCodes2xx(metrics.metricValue(codes2xxPath)) .withCodes4xx(metrics.metricValue(codes4xxPath)) .withCodes5xx(metrics.metricValue(codes5xxPath)) .withTimeouts(metrics.metricValue(timeouts)) .withOtherErrors(metrics.metricValue(otherErrors)) .build(); }
Source:
<code>public void timeUnitNullFail() throws Exception { <START> Timed<Integer> t1 = new Timed<Integer>(1, 5, null); <END> }</code><technical_language>t1 shows unused variable, please remove assignment</technical_language>

Target:
public void timeUnitNullFail() throws Exception { new Timed<Integer>(1, 5, null); }
Source:
<code>public void createParticipantNoExternalIdAddedDoesNothing() { BridgeUtils.setRequestContext(new RequestContext.Builder().build()); when(accountDao.constructAccount(STUDY, EMAIL, PHONE, null, PASSWORD)).thenReturn(account); StudyParticipant participant = withParticipant().withExternalId(null).build(); participantService.createParticipant(STUDY, participant, false); verify(accountDao).constructAccount(STUDY, EMAIL, PHONE, null, PASSWORD); <START> verify(accountDao).createAccount(eq(STUDY), eq(account), any()); <END> }</code><technical_language>this call assignExternalId()? verify it? in following: * createParticipantExternalIdAddedUpdatesExternalId() * updateParticipantNoExternalIdsOneAddedUpdates() * updateParticipantAsResearcherNoExternalIdsOneAddedUpdates() * updateParticipantAsResearcherExternalIdsExistNoneMatchOneAddedUpdates() * researcherCanChangeExternalIdOnUpdate()</technical_language>

Target:
public void createParticipantNoExternalIdAddedDoesNothing() { BridgeUtils.setRequestContext(new RequestContext.Builder().build()); when(accountDao.constructAccount(STUDY, EMAIL, PHONE, null, PASSWORD)).thenReturn(account); StudyParticipant participant = withParticipant().withExternalId(null).build(); participantService.createParticipant(STUDY, participant, false); verify(accountDao).constructAccount(STUDY, EMAIL, PHONE, null, PASSWORD); verify(accountDao).createAccount(eq(STUDY), eq(account), any()); verify(externalIdService).commitAssignExternalId(null); }
Source:
<code>private static <T> LoadingCache<ClassLoader, LoadingCache<String, T>> makeParentCache(final CacheFunction<T> function) { return CacheBuilder.newBuilder().weakKeys().build(new CacheLoader<ClassLoader,LoadingCache<String, T>>() { @Override public LoadingCache<String, T> load(final ClassLoader parentLoader) { return CacheBuilder.newBuilder(). expireAfterWrite(15, TimeUnit.MINUTES).build(new CacheLoader<String, T>() { @Override public T load(String name) { Thread t = Thread.currentThread(); String origName = t.getName(); t.setName(origName + " loading " + name); long start = System.nanoTime(); try { return function.compute(parentLoader, name); } finally { t.setName(origName); long ms = (System.nanoTime() - start) / 1000000; if (ms > 250) { <START> LOGGER.log(Level.DEBUG, "took {0}ms to load/not load {1} from {2}", new Object[] {ms, name, parentLoader}); <END> } } } }); } }); }</code><technical_language>level. I suppose meant FINE something</technical_language>

Target:
private static <T> LoadingCache<ClassLoader, LoadingCache<String, T>> makeParentCache(final CacheFunction<T> function) { return CacheBuilder.newBuilder().weakKeys().build(new CacheLoader<ClassLoader,LoadingCache<String, T>>() { @Override public LoadingCache<String, T> load(final ClassLoader parentLoader) { return CacheBuilder.newBuilder(). expireAfterWrite(15, TimeUnit.MINUTES).build(new CacheLoader<String, T>() { @Override public T load(String name) { Thread t = Thread.currentThread(); String origName = t.getName(); t.setName(origName + " loading " + name); long start = System.nanoTime(); try { return function.compute(parentLoader, name); } finally { t.setName(origName); long ms = (System.nanoTime() - start) / 1000000; if (ms > 250) { LOGGER.log(Level.FINE, "took {0}ms to load/not load {1} from {2}", new Object[] {ms, name, parentLoader}); } } } }); } }); }
Source:
<code>protected void reIndexGeometry(HashMap<String,UpdatedTerrainPatch> updated, boolean useVariableLod) { UpdatedTerrainPatch utp = updated.get(getName()); if (utp != null && utp.isReIndexNeeded() ) { int pow = (int) Math.pow(2, utp.getNewLod()); boolean left = utp.getLeftLod() > utp.getNewLod(); boolean top = utp.getTopLod() > utp.getNewLod(); boolean right = utp.getRightLod() > utp.getNewLod(); boolean bottom = utp.getBottomLod() > utp.getNewLod(); IndexBuffer idxB; if (useVariableLod) idxB = geomap.writeIndexArrayLodVariable(pow, (int) Math.pow(2, utp.getRightLod()), (int) Math.pow(2, utp.getTopLod()), (int) Math.pow(2, utp.getLeftLod()), (int) Math.pow(2, utp.getBottomLod()), totalSize); else idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize); Buffer b; if (idxB.getBuffer() instanceof IntBuffer) <START> b = idxB.getBuffer(); else b = idxB.getBuffer(); <END> utp.setNewIndexBuffer(b); } }</code><technical_language>here. try prevent Byte Long Buffers purpose? is this a mistake</technical_language>

Target:
protected void reIndexGeometry(HashMap<String,UpdatedTerrainPatch> updated, boolean useVariableLod) { UpdatedTerrainPatch utp = updated.get(getName()); if (utp != null && utp.isReIndexNeeded() ) { int pow = (int) Math.pow(2, utp.getNewLod()); boolean left = utp.getLeftLod() > utp.getNewLod(); boolean top = utp.getTopLod() > utp.getNewLod(); boolean right = utp.getRightLod() > utp.getNewLod(); boolean bottom = utp.getBottomLod() > utp.getNewLod(); IndexBuffer idxB; if (useVariableLod) idxB = geomap.writeIndexArrayLodVariable(pow, (int) Math.pow(2, utp.getRightLod()), (int) Math.pow(2, utp.getTopLod()), (int) Math.pow(2, utp.getLeftLod()), (int) Math.pow(2, utp.getBottomLod()), totalSize); else idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize); Buffer b = idxB.getBuffer(); utp.setNewIndexBuffer(b); } }
Source:
<code>public final List<? extends Action> getAllActions() { List<Action> _actions = getActions(); boolean adding = false; <START> synchronized (Actionable.class) { <END> if (factoryCache == null) { @SuppressWarnings("rawtypes") final ExtensionList<TransientActionFactory> allFactories = ExtensionList.lookup(TransientActionFactory.class); factoryCache = CacheBuilder.newBuilder().build(new CacheLoader<Class<? extends Actionable>, Collection<? extends TransientActionFactory<?>>>() { @Override public Collection<? extends TransientActionFactory<?>> load(Class<? extends Actionable> implType) throws Exception { List<TransientActionFactory<?>> factories = new ArrayList<>(); for (TransientActionFactory<?> taf : allFactories) { if (taf.type().isAssignableFrom(implType)) { factories.add(taf); } } return factories; } }); allFactories.addListener(new ExtensionListListener() { @Override public void onChange() { factoryCache.invalidateAll(); } }); } } for (TransientActionFactory<?> taf : factoryCache.getUnchecked(getClass())) { Collection<? extends Action> additions; try { additions = createFor(taf); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Could not load actions from " + taf + " for " + this, e); continue; } if (!additions.isEmpty()) { if (!adding) { adding = true; _actions = new ArrayList<>(_actions); } _actions.addAll(additions); } } return Collections.unmodifiableList(_actions); }</code><technical_language>synchronizing single getAllActions call this single class. Instant lock contention place. Synchronize this.getClass() I think. If avoid synchronization should, though. Edit: coffee is kicking in misunderstood -- intent is synchronize this specific class, actionable if though, neither</technical_language>

Target:
public final List<? extends Action> getAllActions() { List<Action> _actions = getActions(); boolean adding = false; for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), Action.class)) { Collection<? extends Action> additions = createFor(taf); if (!additions.isEmpty()) { if (!adding) { adding = true; _actions = new ArrayList<>(_actions); } _actions.addAll(additions); } } return Collections.unmodifiableList(_actions); }
Source:
<code><START> public void testLoadClassException() throws Exception { <END> TemporaryFolder folder = new TemporaryFolder(); folder.create(); libFile = folder.newFile("libFile"); bootstrap.addFileUrl(libFile); bootstrap.addClassPathEntries(); ClassLoader cl = new URLClassLoader(classpath.toArray(new URL[classpath.size()])); assertNotNull(cl); cl.loadClass("simple.test.class"); }</code><technical_language>throws exception scenario ? java doc is complete. fixed other methods too</technical_language>

Target:
public void testLoadClassException() throws Exception { ClassLoader cl = new URLClassLoader(new URL[0]); assertNotNull(cl); cl.loadClass("simple.test.class"); }
Source:
<code>public EnumMap<IMetadata.LogUnitMetadataType, Object> getMetadataMap() { <START> return ICorfuPayload.enumMapFromBuffer(serializedMetadataMap, LogUnitMetadataType.class); <END> }</code><technical_language>deserialize a metadataMap single time need it? gonna a huge performance impact</technical_language>

Target:
public EnumMap<LogUnitMetadataType, Object> getMetadataMap() { if (metadataMap == null) { throw new NullPointerException("MetaData Map is null"); } return metadataMap; }
Source:
<code><START> public void performSingleTenantMultipleUserQueueTestCase() { <END> int sendMessageCount = 200; int runTime = 40; int expectedMessageCount = 200; AndesClient adminReceivingClient = new AndesClient("receive", "127.0.0.1:5672", "topic:topictenant1.com/durableTenantTopic", "100", "false", Integer.toString(runTime), Integer.toString(expectedMessageCount), "1", "listener=true,ackMode=1,durable=true,subscriptionID=multitenant1,delayBetweenMsg=0,unsubscribeAfter=" + expectedMessageCount, "", "admin!topictenant1.com", "admin"); adminReceivingClient.startWorking(); AndesClient tenant1SendingClient = new AndesClient("send", "127.0.0.1:5672", "topic:topictenant1.com/durableTenantTopic", "100", "false", Integer.toString(runTime), Integer.toString(sendMessageCount), "1", "ackMode=1,delayBetweenMsg=0,stopAfter=" + sendMessageCount, "","topictenantuser1!topictenant1.com", "topictenantuser1"); tenant1SendingClient.startWorking(); boolean adminReceiveSuccess = AndesClientUtils.waitUntilMessagesAreReceived(adminReceivingClient, expectedMessageCount, runTime); boolean tenant1SendSuccess = AndesClientUtils.getIfSenderIsSuccess(tenant1SendingClient, sendMessageCount); Assert.assertTrue(tenant1SendSuccess, "Sending failed for tenant 1 user 1."); Assert.assertEquals(expectedMessageCount,adminReceivingClient.getReceivedTopicMessagecount()); Assert.assertTrue(adminReceiveSuccess, "Message receiving failed for durable topic subscriber of tenant 1."); }</code><technical_language>Lets explain here</technical_language>

Target:
public void performSingleTenantMultipleUserQueueTestCase() { int sendMessageCount = 200; int runTime = 40; int expectedMessageCount = 200; AndesClient adminReceivingClient = new AndesClient("receive", "127.0.0.1:5672", "topic:topictenant1.com/durableTenantTopic", "100", "false", Integer.toString(runTime), Integer.toString(expectedMessageCount), "1", "listener=true,ackMode=1,durable=true,subscriptionID=multitenant1,delayBetweenMsg=0,unsubscribeAfter=" + expectedMessageCount, "", "admin!topictenant1.com", "admin"); adminReceivingClient.startWorking(); AndesClient tenant1SendingClient = new AndesClient("send", "127.0.0.1:5672", "topic:topictenant1.com/durableTenantTopic", "100", "false", Integer.toString(runTime), Integer.toString(sendMessageCount), "1", "ackMode=1,delayBetweenMsg=0,stopAfter=" + sendMessageCount, "", "topictenantuser1!topictenant1.com", "topictenantuser1"); tenant1SendingClient.startWorking(); boolean adminReceiveSuccess = AndesClientUtils.waitUntilMessagesAreReceived(adminReceivingClient, expectedMessageCount, runTime); boolean tenant1SendSuccess = AndesClientUtils.getIfSenderIsSuccess(tenant1SendingClient, sendMessageCount); Assert.assertTrue(tenant1SendSuccess, "Sending failed for tenant 1 user 1."); Assert.assertEquals(adminReceivingClient.getReceivedTopicMessagecount(), expectedMessageCount); Assert.assertTrue(adminReceiveSuccess, "Message receiving failed for durable topic subscriber of tenant 1. Received Message Count : " + adminReceivingClient.getReceivedTopicMessagecount()); }
Source:
<code>public String toString() { <START> return String.format("%f, %d, %d", value, g, delta); <END> }</code><technical_language>pulling upstream changes here</technical_language>

Target:
public String toString() { return String.format("%d, %d, %d", value, g, delta); }
Source:
<code>private ConnectionPoolImpl<Jedis> startConnectionPool(String appName, JedisConnectionFactory connFactory, ConnectionPoolConfigurationImpl cpConfig, ConnectionPoolMonitor cpMonitor) { final ConnectionPoolImpl<Jedis> pool = new ConnectionPoolImpl<Jedis>(connFactory, cpConfig, cpMonitor); try { Logger.info("Starting connection pool for app " + appName); <START> Logger.info("Starting connection pool for app " + appName); <END> pool.start().get(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { pool.shutdown(); } })); } catch (NoAvailableHostsException e) { if (cpConfig.getFailOnStartupIfNoHosts()) { throw new RuntimeException(e); } Logger.warn("UNABLE TO START CONNECTION POOL -- IDLING"); pool.idle(); } catch (Exception e) { throw new RuntimeException(e); } return pool; }</code><technical_language>Is this a repetition of line above</technical_language>

Target:
private ConnectionPoolImpl<Jedis> startConnectionPool(String appName, JedisConnectionFactory connFactory, ConnectionPoolConfigurationImpl cpConfig, ConnectionPoolMonitor cpMonitor) { final ConnectionPoolImpl<Jedis> pool = new ConnectionPoolImpl<Jedis>(connFactory, cpConfig, cpMonitor); try { Logger.info("Starting connection pool for app " + appName); pool.start().get(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { pool.shutdown(); } })); } catch (NoAvailableHostsException e) { if (cpConfig.getFailOnStartupIfNoHosts()) { throw new RuntimeException(e); } Logger.warn("UNABLE TO START CONNECTION POOL -- IDLING"); pool.idle(); } catch (Exception e) { throw new RuntimeException(e); } return pool; }