auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ApiQuotaInfo updateApiQuotaInfoInGui(ApiQuotaInfo apiQuotaInfo) { uiManager.updateApiQuotaInfo(apiQuotaInfo); <START> return apiQuotaInfo; <END> }</code><technical_language>Is necessary return parameter</technical_language>

Target:
public void updateApiQuotaInfoInGui(ApiQuotaInfo apiQuotaInfo) { uiManager.updateApiQuotaInfo(apiQuotaInfo); }
Source:
<code>private void updateNonPutOverheadMetrics(long microsWritingToTargetedSweepQueue, long microsForWrites, long microsForCommitStage) { long nonPutOverhead = microsForCommitStage - microsForWrites - microsWritingToTargetedSweepQueue; <START> getTimer("nonPutOverhead").update(nonPutOverhead, TimeUnit.MILLISECONDS); <END> getHistogram("nonPutOverheadMillionths").update( Math.round((1_000_000. * nonPutOverhead) / microsForCommitStage)); }</code><technical_language>I this is in micros of inputs calculation in micros</technical_language>

Target:
private void updateNonPutOverheadMetrics(long microsWritingToTargetedSweepQueue, long microsForWrites, long microsForCommitStage) { long nonPutOverhead = microsForCommitStage - microsForWrites - microsWritingToTargetedSweepQueue; getTimer("nonPutOverhead").update(nonPutOverhead, TimeUnit.MICROSECONDS); getHistogram("nonPutOverheadMillionths").update( Math.round((1_000_000. * nonPutOverhead) / microsForCommitStage)); }
Source:
<code><START> public synchronized UsersSshPairImpl get(String owner, String service, String name) throws NotFoundException { <END> final Optional<UsersSshPairImpl> any = find(owner, service, name); if (any.isPresent()) { return any.get(); } throw new NotFoundException(format("Ssh pair with service '%s' and name '%s' was not found.", name, service)); }</code><technical_language>need getter synchronized, @skabashnyuk I right</technical_language>

Target:
public SshPairImpl get(String owner, String service, String name) throws NotFoundException { lock.readLock().lock(); try { final Optional<SshPairImpl> any = find(owner, service, name); if (any.isPresent()) { return any.get(); } throw new NotFoundException(format("Ssh pair with service '%s' and name '%s' was not found.", service, name)); } finally { lock.readLock().unlock(); } }
Source:
<code>private void reportFormExit() { TimedStatsTracker.registerExitForm(getCurrentFormTitle()); <START> } <END></code><technical_language>Do care if form completed not? I reportFormExit is called if form completed saved</technical_language>

Target:
private void reportFormExit() { TimedStatsTracker.registerExitForm(getCurrentFormID()); }
Source:
<code>protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap bmp = null; try { InputStream in = new java.net.URL(urldisplay).openStream(); bmp = BitmapFactory.decodeStream(in); } catch (Exception e) { <START> Log.e("Error", e.getMessage()); <END> e.printStackTrace(); } return bmp; }</code><technical_language>a tag, class.getName()</technical_language>

Target:
protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap bmp = null; try { InputStream in = new java.net.URL(urldisplay).openStream(); bmp = BitmapFactory.decodeStream(in); } catch (Exception e) { Log.e(DownloadImageTask.class.getName(), "Error fetching bitmap", e); e.printStackTrace(); } return bmp; }
Source:
<code>private void selectedKeyChanged() { String key = (String) getSelectedKey().getEntity(); List<GlusterVolumeOptionInfo> options = (List<GlusterVolumeOptionInfo>) getKeyList().getItems(); GlusterVolumeOptionInfo selectedOption = null; for (GlusterVolumeOptionInfo option : options) { if (option.getKey().equals(key.trim())) { selectedOption = option; break; } } if (selectedOption != null) { <START> if (selectedOption.getDescription().equals("(null)")) END> { getDescription().setEntity(null); } else { getDescription().setEntity(selectedOption.getDescription()); } if (getIsNew()) { if (selectedOption.getDefaultValue().equals("(null)")) { getValue().setEntity(null); } else { getValue().setEntity(selectedOption.getDefaultValue()); } } } else if (getIsNew()) { getDescription().setEntity(null); getValue().setEntity(null); } }</code><technical_language>I prefer refactor "(null)" a constant, change NULL_CONST.equals(....getDesc())), 'getDesc()..' null</technical_language>

Target:
private void selectedKeyChanged() { String key = (String) getSelectedKey().getEntity(); List<GlusterVolumeOptionInfo> options = (List<GlusterVolumeOptionInfo>) getKeyList().getItems(); GlusterVolumeOptionInfo selectedOption = null; for (GlusterVolumeOptionInfo option : options) { if (option.getKey().equals(key.trim())) { selectedOption = option; break; } } if (selectedOption != null) { if (selectedOption.getDescription() == null || selectedOption.getDescription().equals(NULL_CONST)) { getDescription().setEntity(null); } else { getDescription().setEntity(selectedOption.getDescription()); } if (getIsNew()) { if (selectedOption.getDefaultValue() == null || selectedOption.getDefaultValue().equals(NULL_CONST)) { getValue().setEntity(null); } else { getValue().setEntity(selectedOption.getDefaultValue()); } } } else if (getIsNew()) { getDescription().setEntity(null); getValue().setEntity(null); } }
Source:
<code>public void unloadCube(int cubeX, int cubeY, int cubeZ) { if (cubeIsNearSpawn(cubeX, cubeY, cubeZ)) { return; } if (dependencyManager.isRequired(cubeX, cubeY, cubeZ)) { <START> return; <END> } this.cubesToUnload.add(AddressTools.getAddress(cubeX, cubeY, cubeZ)); }</code><technical_language>this memory leaks? enough of caused implementing unloading force generated cubes (and a hack generate vanilla terrain). Unloading cubes is done PlayerCubeMap, I care cubes called unload for</technical_language>

Target:
public void unloadCube(int cubeX, int cubeY, int cubeZ) { if (cubeIsNearSpawn(cubeX, cubeY, cubeZ)) { return; } if (dependencyManager.isRequired(new CubeCoords(cubeX, cubeY, cubeZ))) { return; } this.cubesToUnload.add(AddressTools.getAddress(cubeX, cubeY, cubeZ)); }
Source:
<code>public Void visitFilter(FilterNode node, Void context) { <START> String expression = isExpression(node.getPredicate()) ? node.getPredicate().toString() : formatter.formatRowExpression(node.getPredicate()); <END> printNode(node, "Filter", expression, NODE_COLORS.get(NodeType.FILTER)); return node.getSource().accept(this, context); }</code><technical_language>GraphvizPrinter (and other plan printer) expect Expression. isExpression here, fix tests if failing</technical_language>

Target:
public Void visitFilter(FilterNode node, Void context) { String expression = formatter.formatRowExpression(node.getPredicate()); printNode(node, "Filter", expression, NODE_COLORS.get(NodeType.FILTER)); return node.getSource().accept(this, context); }
Source:
<code>protected synchronized ExitStatus run(OptionSet options) throws Exception { String text = StringUtils .collectionToDelimitedString(options.nonOptionArguments(), " "); <START> System.out.println(URLEncoder.encode(text, "UTF-8")); <END> return ExitStatus.OK; }</code><technical_language>encoding option</technical_language>

Target:
protected synchronized ExitStatus run(OptionSet options) throws Exception { String charset = "UTF-8"; if(options.has(charsetOption)){ charset = options.valueOf(charsetOption); } String text = StringUtils .collectionToDelimitedString(options.nonOptionArguments(), " "); try { Charset.forName(charset); String outText = URLEncoder.encode(text, charset); System.out.println(outText); return ExitStatus.OK; } catch (UnsupportedCharsetException e){ System.out.println("Unsupported Character Set"); return ExitStatus.ERROR; } }
Source:
<code>public static AutomaticHardwareIdSpec parseId(String hardwareId) { AutomaticHardwareIdSpec spec = new AutomaticHardwareIdSpec(); String hardwareSpec = hardwareId.substring(10); Map<String, String> specValues = Splitter.on(';') .trimResults() .omitEmptyStrings() .withKeyValueSeparator('=') .split(hardwareSpec); if (!specValues.containsKey("ram") || !specValues.containsKey("cores")) { <START> throw new IllegalArgumentException(String.format("Omitted keys on hardwareId: %s", hardwareId)); <END> } spec.ram = Integer.parseInt(specValues.get("ram")); spec.cores = Double.parseDouble(specValues.get("cores")); return spec; }</code><technical_language>Give feedback is missing</technical_language>

Target:
public static AutomaticHardwareIdSpec parseId(String hardwareId) { AutomaticHardwareIdSpec spec = new AutomaticHardwareIdSpec(); String hardwareSpec = hardwareId.substring(10); Map<String, String> specValues = Splitter.on(';') .trimResults() .omitEmptyStrings() .withKeyValueSeparator('=') .split(hardwareSpec); if (!specValues.containsKey("ram") || !specValues.containsKey("cores")) { throw new IllegalArgumentException(String.format("Omitted keys on hardwareId: %s. Please set number " + "of cores and ram amount.", hardwareId)); } spec.ram = Integer.parseInt(specValues.get("ram")); spec.cores = Double.parseDouble(specValues.get("cores")); return spec; }
Source:
<code><START> private static double[] calculateTargetFactors(final ReadCountCollection readCounts) { <END> final double[] result = new double[readCounts.targets().size()]; final RealMatrix counts = readCounts.counts(); final Median medianCalculator = new Median(); for (int i = 0; i < result.length; i++) { result[i] = medianCalculator.evaluate(counts.getRow(i)); } return result; }</code><technical_language>much, extract methods for arrays of row medians column medians a matrix</technical_language>

Target:
private static double[] calculateTargetFactors(final ReadCountCollection readCounts) { return MatrixSummaryUtils.getRowMedians(readCounts.counts()); }
Source:
<code>public void MercuryCuratedNavigationTest_005_redirectToExistingArticle() { ArticleContent content = new ArticleContent(); String redirect = WikiTextContent.REDIRECT + WikiTextContent.LINK_PREFIX + MercurySubpages.CC_REDIRECT_DESTINATION + WikiTextContent.LINK_POSTFIX; <START> content.push(redirect, MercurySubpages.CC_REDIRECT_SOURCE_1); <END> ArticlePageObject article = new ArticlePageObject(driver); article.openCuratedMainPage(wikiURL, MercurySubpages.CC_REDIRECT_SOURCE_1); Assertion.assertEqualsIgnoreCase(article.getArticleTitle(), MercurySubpages.CC_REDIRECT_DESTINATION); }</code><technical_language>is operation this variable, please use: new ArticleContent().push(redirect, MercurySubpages.CC_REDIRECT_SOURCE_1);</technical_language>

Target:
public void MercuryCuratedNavigationTest_005_redirectToExistingArticle() { ArticlePageObject article = new ArticlePageObject(driver); String redirect = WikiTextContent.REDIRECT + WikiTextContent.INTERNAL_LINK_OPENING + MercurySubpages.CC_REDIRECT_DESTINATION + WikiTextContent.INTERNAL_LINK_CLOSING; new ArticleContent().push(redirect, MercurySubpages.CC_REDIRECT_SOURCE_1); article.openCuratedMainPage(wikiURL, MercurySubpages.CC_REDIRECT_SOURCE_1); Assertion.assertEqualsIgnoreCase(article.getArticleTitle(), MercurySubpages.CC_REDIRECT_DESTINATION); }
Source:
<code><START> static Duration largestOf(Duration... durations) { <END> Duration largest = Duration.ZERO; for (Duration duration : durations) { if (duration.compareTo(largest) > 0) { largest = duration; } } return largest; }</code><technical_language>Arrays.stream(durations).max()</technical_language>

Target:
static Duration largestOf(Duration... durations) { return Arrays.stream(durations).max(Duration::compareTo).orElse(Duration.ZERO); }
Source:
<code>public void cleanup() { <START> networkProviderWidget.cleanup(); fenceAgentsEditor.cleanup(); proxySourceEditor.cleanup(); <END> driver.cleanup(); }</code><technical_language>fields covered autogenerated driver.cleanup() method? (Since fields implement HasCleanup interface)</technical_language>

Target:
public void cleanup() { driver.cleanup(); }
Source:
<code>public AllSSTableOpStatus performCleanup(final ColumnFamilyStore cfStore, int jobs) throws InterruptedException, ExecutionException { assert !cfStore.isIndex(); Keyspace keyspace = cfStore.keyspace; if (!StorageService.instance.isJoined()) { logger.info("Cleanup cannot run before a node has joined the ring"); return AllSSTableOpStatus.ABORTED; } <START> final Collection<Range<Token>> ranges = StorageService.instance.getLocalReplicas(keyspace.getName()).asRangeSet(); <END> final boolean hasIndexes = cfStore.indexManager.hasIndexes(); return parallelAllSSTableOperation(cfStore, new OneSSTableOperation() { @Override public Iterable<SSTableReader> filterSSTables(LifecycleTransaction transaction) { List<SSTableReader> sortedSSTables = Lists.newArrayList(transaction.originals()); Collections.sort(sortedSSTables, SSTableReader.sizeComparator); return sortedSSTables; } @Override public void execute(LifecycleTransaction txn) throws IOException { CleanupStrategy cleanupStrategy = CleanupStrategy.get(cfStore, ranges, FBUtilities.nowInSeconds()); doCleanupOne(cfStore, txn, cleanupStrategy, ranges, hasIndexes); } }, jobs, OperationType.CLEANUP); }</code><technical_language>This a Collection2.transform version. iterated</technical_language>

Target:
public AllSSTableOpStatus performCleanup(final ColumnFamilyStore cfStore, int jobs) throws InterruptedException, ExecutionException { assert !cfStore.isIndex(); Keyspace keyspace = cfStore.keyspace; if (!StorageService.instance.isJoined()) { logger.info("Cleanup cannot run before a node has joined the ring"); return AllSSTableOpStatus.ABORTED; } final Collection<Range<Token>> ranges = StorageService.instance.getLocalReplicas(keyspace.getName()).asUnmodifiableRangeCollection(); final boolean hasIndexes = cfStore.indexManager.hasIndexes(); return parallelAllSSTableOperation(cfStore, new OneSSTableOperation() { @Override public Iterable<SSTableReader> filterSSTables(LifecycleTransaction transaction) { List<SSTableReader> sortedSSTables = Lists.newArrayList(transaction.originals()); Collections.sort(sortedSSTables, SSTableReader.sizeComparator); return sortedSSTables; } @Override public void execute(LifecycleTransaction txn) throws IOException { CleanupStrategy cleanupStrategy = CleanupStrategy.get(cfStore, ranges, FBUtilities.nowInSeconds()); doCleanupOne(cfStore, txn, cleanupStrategy, ranges, hasIndexes); } }, jobs, OperationType.CLEANUP); }
Source:
<code>public void testListing() throws DDFException { List<String> buckets = manager.listBuckets(); LOG.info("========== buckets =========="); assert(buckets.contains("jing-bucket")); LOG.info("========== jing-bucket/testFolder/ =========="); List<String> keys = manager.listFiles("jing-bucket/testFolder/"); assert (keys.size() > 1); assert (keys.contains("testFolder/(-_*')!.@&:,$=+?;#.csv")); LOG.info("========== jing-bucket/testFolder/a.json =========="); keys = manager.listFiles("jing-bucket", "testFolder/a.json"); assert (keys.size()==1); keys = manager.listFiles("adatao-sample-data/test/extra/format/mixed-csv-tsv"); assert keys.size() > 1; keys = manager.listFiles("jing-bucket", "testFolder/(-_*')!.@&:,$=+?;#.csv"); assert (keys.size() == 1); keys = manager.listFiles("jing-bucket", "non-exist"); <START> assert keys.size() == 0; <END> }</code><technical_language>Really, this throw error, e.g: file system -> PyClient git:(master) ls "Asdasda" ls: Asdasda: file directory</technical_language>

Target:
public void testListing() throws DDFException { List<String> buckets = manager.listBuckets(); LOG.info("========== buckets =========="); assert(buckets.contains("jing-bucket")); LOG.info("========== jing-bucket/testFolder/ =========="); List<String> keys = manager.listFiles("jing-bucket/testFolder/"); assert (keys.size() > 1); assert (keys.contains("testFolder/(-_*')!.@&:,$=+?;#.csv")); LOG.info("========== jing-bucket/testFolder/a.json =========="); keys = manager.listFiles("jing-bucket", "testFolder/a.json"); assert (keys.size()==1); keys = manager.listFiles("adatao-sample-data/test/extra/format/mixed-csv-tsv"); assert keys.size() > 1; keys = manager.listFiles("jing-bucket", "testFolder/(-_*')!.@&:,$=+?;#.csv"); assert (keys.size() == 1); try { keys = manager.listFiles("jing-bucket", "non-exist"); assert (false); } catch (DDFException e) { assert (e.getMessage().equals("java.io.FileNotFoundException: File does not exist")); } }
Source:
<code>public String toString() { <START> return String.format("%s(%s) = %s", extractionFn, dimension, value); <END> }</code><technical_language>nit: this prettier-printed if do do dim = val extractionFn is null</technical_language>

Target:
public String toString() { if (extractionFn != null) { return String.format("%s(%s) = %s", extractionFn, dimension, value); } else { return String.format("%s = %s", dimension, value); } }
Source:
<code>public void sendNowSync(Log eventLog) { <START> sendNowSync(eventLog); <END> }</code><technical_language>This is throwing a StackOverflowException if invoked. sendNow(event)</technical_language>

Target:
public void sendNowSync(Log eventLog) { sendNow(eventLog); }
Source:
<code>public void containsTest() throws Exception { final boolean CASE_SENSITIVE = true; final boolean CASE_INSENSITIVE = false; iface.go(testPage); final WebDriverElement writingDiv = iface.getWebDriverElement(Strategy.ID, "writingDiv"); Assert.assertTrue(writingDiv.contains("Click button", CASE_SENSITIVE)); Assert.assertTrue(writingDiv.contains("cLiCk BuTtOn", CASE_INSENSITIVE)); Assert.assertTrue(writingDiv.contains("Click button", CASE_INSENSITIVE)); Assert.assertFalse(writingDiv.contains("cLiCk BuTtOn", CASE_SENSITIVE)); Assert.assertFalse(writingDiv.contains("Doesn't contain this", CASE_SENSITIVE)); <START> Assert.assertFalse(writingDiv.contains("Doesn't contain this", CASE_SENSITIVE)); <END> }</code><technical_language>Line 123 124 same. Line 124 CASE_INSENSITIVE</technical_language>

Target:
public void containsTest() throws Exception { final boolean CASE_SENSITIVE = true; final boolean CASE_INSENSITIVE = false; iface.go(testPage); final WebDriverElement writingDiv = $("#clickToHideDiv"); Assert.assertTrue(writingDiv.contains("Click button", CASE_SENSITIVE)); Assert.assertTrue(writingDiv.contains("cLiCk BuTtOn", CASE_INSENSITIVE)); Assert.assertTrue(writingDiv.contains("Click button", CASE_INSENSITIVE)); Assert.assertFalse(writingDiv.contains("cLiCk BuTtOn", CASE_SENSITIVE)); Assert.assertFalse(writingDiv.contains("Doesn't contain this", CASE_SENSITIVE)); Assert.assertFalse(writingDiv.contains("Doesn't contain this", CASE_INSENSITIVE)); }
Source:
<code>private void buildFixtureMethods() { MethodInfo cleanupMethod = createMethod(Identifiers.CLEANUP_METHOD, MethodKind.CLEANUP); if (cleanupMethod != null) spec.addCleanupMethod(cleanupMethod); MethodInfo cleanupSpecMethod = createMethod(Identifiers.CLEANUP_SPEC_METHOD, MethodKind.CLEANUP_SPEC); if (cleanupSpecMethod != null) spec.addCleanupSpecMethod(cleanupSpecMethod); <START> if (isJunit4SupportAvailable()) { <END> for (Method method : clazz.getDeclaredMethods()) { if (method.isAnnotationPresent(JUnit4LegacyUtil.BEFORE_ANNOTATION)) { spec.addSetupMethod(createJUnitFixtureMethod(method, MethodKind.SETUP, JUnit4LegacyUtil.BEFORE_ANNOTATION)); } if (method.isAnnotationPresent(JUnit4LegacyUtil.AFTER_ANNOTATION)) { spec.addCleanupMethod(createJUnitFixtureMethod(method, MethodKind.CLEANUP, JUnit4LegacyUtil.AFTER_ANNOTATION)); } if (method.isAnnotationPresent(JUnit4LegacyUtil.BEFORE_CLASS_ANNOTATION)) { spec.addSetupSpecMethod(createJUnitFixtureMethod(method, MethodKind.SETUP_SPEC, JUnit4LegacyUtil.BEFORE_CLASS_ANNOTATION)); } if (method.isAnnotationPresent(JUnit4LegacyUtil.AFTER_CLASS_ANNOTATION)) { spec.addCleanupSpecMethod(createJUnitFixtureMethod(method, MethodKind.CLEANUP_SPEC, JUnit4LegacyUtil.AFTER_CLASS_ANNOTATION)); } } } MethodInfo setupMethod = createMethod(Identifiers.SETUP_METHOD, MethodKind.SETUP); if (setupMethod != null) spec.addSetupMethod(setupMethod); MethodInfo setupSpecMethod = createMethod(Identifiers.SETUP_SPEC_METHOD, MethodKind.SETUP_SPEC); if (setupSpecMethod != null) spec.addSetupSpecMethod(setupSpecMethod); }</code><technical_language>I this done a global extension in spock-junit4</technical_language>

Target:
private void buildFixtureMethods() { MethodInfo cleanupMethod = createMethod(Identifiers.CLEANUP_METHOD, MethodKind.CLEANUP); if (cleanupMethod != null) spec.addCleanupMethod(cleanupMethod); MethodInfo cleanupSpecMethod = createMethod(Identifiers.CLEANUP_SPEC_METHOD, MethodKind.CLEANUP_SPEC); if (cleanupSpecMethod != null) spec.addCleanupSpecMethod(cleanupSpecMethod); MethodInfo setupMethod = createMethod(Identifiers.SETUP_METHOD, MethodKind.SETUP); if (setupMethod != null) spec.addSetupMethod(setupMethod); MethodInfo setupSpecMethod = createMethod(Identifiers.SETUP_SPEC_METHOD, MethodKind.SETUP_SPEC); if (setupSpecMethod != null) spec.addSetupSpecMethod(setupSpecMethod); }
Source:
<code>public static String getImageUuid(String image, StorageService storageService) { validateImageUuid(image); DockerImage dockerImage = DockerImage.parse(image); if (dockerImage == null) { throw new ValidationErrorException(ValidationErrorCodes.INVALID_REFERENCE, InstanceConstants.FIELD_IMAGE_UUID); } String fullImageName = dockerImage.getFullName(); String registry = dockerImage.getServer(); if (!fullImageName.startsWith(registry)) { String defaultRegistry = DEFAULT_REGISTRY.get(); if (image.contains(registry)) { fullImageName = registry + "/" + fullImageName; } else if (!StringUtils.isBlank(defaultRegistry) && !StringUtils.isEmpty(defaultRegistry)) { fullImageName = defaultRegistry + "/" + fullImageName; } } if (image.startsWith(DockerImage.KIND_PREFIX)) { fullImageName = DockerImage.KIND_PREFIX + fullImageName; } if (image.startsWith("sim:") && !fullImageName.startsWith("sim:")) { fullImageName = "sim:" + fullImageName; <START> } <END> if (!storageService.isValidUUID(fullImageName.toString())) { throw new ValidationErrorException(ValidationErrorCodes.INVALID_REFERENCE, InstanceConstants.FIELD_IMAGE_UUID); } return fullImageName; }</code><technical_language>I understand need this change. Do tests fail it</technical_language>

Target:
public static String getImageUuid(String image, StorageService storageService) { validateImageUuid(image); DockerImage dockerImage = DockerImage.parse(image); if (dockerImage == null) { throw new ValidationErrorException(ValidationErrorCodes.INVALID_REFERENCE, InstanceConstants.FIELD_IMAGE_UUID); } String fullImageName = dockerImage.getFullName(); String registry = dockerImage.getServer(); if (!fullImageName.startsWith(registry)) { String defaultRegistry = DEFAULT_REGISTRY.get(); if (image.contains(registry)) { fullImageName = registry + "/" + fullImageName; } else if (!StringUtils.isBlank(defaultRegistry) && !StringUtils.isEmpty(defaultRegistry)) { fullImageName = defaultRegistry + "/" + fullImageName; } } if (image.startsWith(DockerImage.KIND_PREFIX)) { fullImageName = DockerImage.KIND_PREFIX + fullImageName; } if (image.startsWith(DockerImage.SIM_PREFIX) && !fullImageName.startsWith(DockerImage.SIM_PREFIX)) { fullImageName = DockerImage.SIM_PREFIX + fullImageName; } if (!storageService.isValidUUID(fullImageName.toString())) { throw new ValidationErrorException(ValidationErrorCodes.INVALID_REFERENCE, InstanceConstants.FIELD_IMAGE_UUID); } return fullImageName; }
Source:
<code>private void initAuthInfo() { <START> if (isBackdoor()) { <END> authType = AuthType.ALL_ACCESS; userInfo = new UserInfo(getRequestParamValue(Const.ParamsNames.USER_ID)); userInfo.isAdmin = true; userInfo.isStudent = true; userInfo.isInstructor = true; return; } userInfo = gateKeeper.getCurrentUser(); authType = userInfo == null ? AuthType.PUBLIC : AuthType.LOGGED_IN; String userParam = getRequestParamValue(Const.ParamsNames.USER_ID); if (userInfo != null && userParam != null) { if (userInfo.isAdmin) { userInfo = gateKeeper.getMasqueradeUser(userParam); authType = AuthType.MASQUERADE; } else if (!userInfo.id.equals(userParam)) { throw new UnauthorizedAccessException("User " + userInfo.id + " is trying to masquerade as " + userParam + " without admin permission."); } } }</code><technical_language>This change is longer necessary, I</technical_language>

Target:
private void initAuthInfo() { if (Config.BACKDOOR_KEY.equals(req.getHeader("Backdoor-Key"))) { authType = AuthType.ALL_ACCESS; userInfo = new UserInfo(getRequestParamValue(Const.ParamsNames.USER_ID)); userInfo.isAdmin = true; userInfo.isStudent = true; userInfo.isInstructor = true; return; } userInfo = gateKeeper.getCurrentUser(); authType = userInfo == null ? AuthType.PUBLIC : AuthType.LOGGED_IN; String userParam = getRequestParamValue(Const.ParamsNames.USER_ID); if (userInfo != null && userParam != null) { if (userInfo.isAdmin) { userInfo = gateKeeper.getMasqueradeUser(userParam); authType = AuthType.MASQUERADE; } else if (!userInfo.id.equals(userParam)) { throw new UnauthorizedAccessException("User " + userInfo.id + " is trying to masquerade as " + userParam + " without admin permission."); } } }
Source:
<code>private Function<SearchContext, WebElement> getSearchingFunction(By by) { <START> return input -> { <END> try { return input.findElement(by); } catch (NoSuchElementException e) { return null; } }; }</code><technical_language>return (input) -> ... is more readable</technical_language>

Target:
private Function<SearchContext, Optional<WebElement>> getSearchingFunction(By by) { return input -> { try { return Optional.of(input.findElement(by)); } catch (NoSuchElementException e) { return Optional.empty(); } }; }
Source:
<code>public Collection<?> getChildren(Object object) { Conflict conflict = (Conflict)object; EList<Diff> differences = conflict.getDifferences(); <START> Collection<Diff> filteredDifferences = Sets.newHashSet(); <END> for (Diff diff : differences) { boolean subdiff = false; for (Diff diffParent : differences) { if (!diff.equals(diffParent) && Iterables.contains(getSubDiffs.apply(diffParent), diff)) { subdiff = true; break; } } if (!subdiff) { filteredDifferences.add(diff); } } return filteredDifferences; }</code><technical_language>main purpose of this collection is for iteration, a LinkedHashSet</technical_language>

Target:
public Collection<?> getChildren(Object object) { Conflict conflict = (Conflict)object; EList<Diff> differences = conflict.getDifferences(); Collection<Diff> filteredDifferences = Sets.newLinkedHashSet(); for (Diff diff : differences) { boolean subdiff = false; for (Diff diffParent : differences) { if (!diff.equals(diffParent) && Iterables.contains(getSubDiffs.apply(diffParent), diff)) { subdiff = true; break; } } if (!subdiff) { filteredDifferences.add(diff); } } return filteredDifferences; }
Source:
<code>protected void setActionMessageParameters() { <START> addCanDoActionMessage(VdcBllMessages.VAR__ACTION__START_VOLUME_PROFILE); <END> addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); }</code><technical_language>"TYPE" describes target of action, "ACTION" describe action performed i.e. I a name for this enum is VAR__ACTION__START_PROFILE (excluding _VOLUME_)</technical_language>

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__START_PROFILE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); }
Source:
<code>public void print(PrintStream out) { if (nodeResultList.isEmpty()) return; List<Row> rows = new ArrayList<>(); for (CacheDistributionNode node : nodeResultList) { for (CacheDistributionGroup group : node.getGroups()) { for (CacheDistributionPartition partition : group.getPartitions()) { final Row row = new Row(); row.setGroupId(group.getGroupId()); row.setGroupName(group.getGroupName()); row.setPartition(partition.getPartition()); row.setNodeId(node.getNodeId()); row.setPrimary(partition.isPrimary()); row.setState(partition.getState()); row.setUpdateCounter(partition.getUpdateCounter()); row.setSize(partition.getSize()); row.setAddresses(node.getAddresses()); row.setUserAttributes(node.getUserAttributes()); rows.add(row); } <START> <END> } } rows.sort(null); StringBuilder userAttributesName=new StringBuilder(); if (!rows.isEmpty() && rows.get(0).userAttributes!=null){ for (String userAttribute:rows.get(0).userAttributes.keySet()){ userAttributesName.append(','); if (userAttribute!=null) userAttributesName.append(userAttribute); } } out.println("[groupId,partition,nodeId,primary,state,updateCounter,partitionSize,nodeAddresses"+userAttributesName+"]"); int oldGroupId = 0; for (Row row : rows) { if (oldGroupId != row.groupId) { out.println("[next group: id=" + row.groupId + ", name=" + row.groupName + ']'); oldGroupId = row.getGroupId(); } row.print(out); } }</code><technical_language>needed empty line</technical_language>

Target:
public void print(PrintStream out) { if (nodeResList.isEmpty()) return; List<Row> rows = new ArrayList<>(); for (CacheDistributionNode node : nodeResList) { for (CacheDistributionGroup group : node.getGroups()) { for (CacheDistributionPartition partition : group.getPartitions()) { final Row row = new Row(); row.setGroupId(group.getGroupId()); row.setGroupName(group.getGroupName()); row.setPartition(partition.getPartition()); row.setNodeId(node.getNodeId()); row.setPrimary(partition.isPrimary()); row.setState(partition.getState()); row.setUpdateCounter(partition.getUpdateCounter()); row.setSize(partition.getSize()); row.setAddresses(node.getAddresses()); row.setUserAttributes(node.getUserAttributes()); rows.add(row); } } } rows.sort(null); StringBuilder userAttrsName = new StringBuilder(); if (!rows.isEmpty() && rows.get(0).userAttrs != null) { for (String userAttribute : rows.get(0).userAttrs.keySet()) { userAttrsName.append(','); if (userAttribute != null) userAttrsName.append(userAttribute); } } out.println("[groupId,partition,nodeId,primary,state,updateCounter,partitionSize,nodeAddresses" + userAttrsName + "]"); int oldGrpId = 0; for (Row row : rows) { if (oldGrpId != row.grpId) { out.println("[next group: id=" + row.grpId + ", name=" + row.grpName + ']'); oldGrpId = row.getGroupId(); } row.print(out); } }
Source:
<code>public Response trigger( @PathParam("application") String applicationName, @PathParam("entity") String entityIdOrName, @PathParam("effector") String effectorName, @Valid final Map<String, String> parameters ) { final Application application = getApplicationOr404(manager.registry(), applicationName); final EntityLocal entity = getEntityOr404(application, entityIdOrName); final Effector<?> effector = entity.getEffectors().get(effectorName); executorService.submit(new Runnable() { @Override public void run() { <START> entity.invoke(effector, parameters); <END> } }); return Response.status(Response.Status.ACCEPTED).build(); }</code><technical_language>Wrap in try-catch guarantee exceptions get logged? I expect Brooklyn's entity.invoke log though..</technical_language>

Target:
public Response trigger( @PathParam("application") String applicationName, @PathParam("entity") String entityIdOrName, @PathParam("effector") String effectorName, @Valid final Map<String, String> parameters ) { final Application application = getApplicationOr404(manager.registry(), applicationName); final EntityLocal entity = getEntityOr404(application, entityIdOrName); final Effector<?> effector = entity.getEffectors().get(effectorName); if (effector == null) { throw notFound("Entity '%s' has no effector with name '%s'", entityIdOrName, effectorName); } executorService.submit(new Runnable() { @Override public void run() { try { entity.invoke(effector, parameters); } catch (Exception e) { LOG.error(e, "Failed while invoking effector"); throw Throwables.propagate(e); } } }); return Response.status(Response.Status.ACCEPTED).build(); }
Source:
<code>public String getAttribute(Attribute attribute) { if (attribute == null) { return null; } <START> if (attribute.startsWith("max_fuse_ticks") && entity.getBukkitEntity() instanceof Creeper) { <END> return new Element(((Creeper) entity.getBukkitEntity()).getMaxFuseTicks()) .getAttribute(attribute.fulfill(1)); } return null; }</code><technical_language>unneeded check</technical_language>

Target:
public String getAttribute(Attribute attribute) { if (attribute == null) { return null; } if (attribute.startsWith("max_fuse_ticks")) { return new Element(((Creeper) entity.getBukkitEntity()).getMaxFuseTicks()) .getAttribute(attribute.fulfill(1)); } return null; }
Source:
<code>public String getUserAgent() { try { return ZulipApp.USER_AGENT <START> + "-" <END> + getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (NameNotFoundException e) { ZLog.logException(e); return ZulipApp.USER_AGENT + "-unknown"; } }</code><technical_language>This stay a /. User agents in form software/version</technical_language>

Target:
public String getUserAgent() { try { return ZulipApp.USER_AGENT + "/" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (NameNotFoundException e) { ZLog.logException(e); return ZulipApp.USER_AGENT + "/unknown"; } }
Source:
<code>public Flux<Frame> receive() { return in.receive().map(buf -> { buf.retain(); CompositeByteBuf composite = context.channel().alloc().compositeBuffer(); ByteBuf length = Unpooled.wrappedBuffer(new byte[3]); FrameHeaderFlyweight.encodeLength(length, 0, buf.readableBytes()); <START> composite.addComponents(true, length, buf); <END> return Frame.from(composite); }); }</code><technical_language>buf.retain() is put here</technical_language>

Target:
public Flux<Frame> receive() { return in.receive().map(buf -> { CompositeByteBuf composite = context.channel().alloc().compositeBuffer(); ByteBuf length = wrappedBuffer(new byte[FRAME_LENGTH_SIZE]); FrameHeaderFlyweight.encodeLength(length, 0, buf.readableBytes()); composite.addComponents(true, length, buf.retain()); return Frame.from(composite); }); }
Source:
<code>public void testInvalidNotificationBadge() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); <START> intent.putExtra("mp_bdgcnt", "0"); <END> mpPushSpy.createNotification(intent); verify(builderSpy, never()).setNumber(any(Integer.class)); }</code><technical_language>unclear this is invalid 0 is valid a string. recommend a bit more specific potentially tests if invalid clear expectations are</technical_language>

Target:
public void testInvalidNotificationBadge() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_bdgcnt", 0); mpPushSpy.createNotification(intent); verify(builderSpy, never()).setNumber(any(Integer.class)); }
Source:
<code><START> private void init() { <END> if (this.environment.containsProperty(FRACTION_DIGITS)) { this.fraction_digits = this.environment.getProperty(FRACTION_DIGITS, Integer.class); } }</code><technical_language>False positive, called Spring</technical_language>

Target:
private void init() { if (this.environment.containsProperty(FRACTION_DIGITS)) { this.fractionDigits = this.environment.getProperty(FRACTION_DIGITS, Integer.class); } }
Source:
<code>public void toggleJoypad(Key key, boolean state) { <START> if (key.name == MojamComponent.instance.keys.joy_click.name) { <END> MouseButtons mb = MojamComponent.instance.mouseButtons; MojamComponent.instance.mouseButtons.nextState[1] = (!mb.nextState2[1])?state:mb.nextState[1]; return; } key.nextState = (!key.nextState2)?state:key.nextState; }</code><technical_language>key.name.equals( ... ); ? I get confused checking equality immutable objects</technical_language>

Target:
public void toggleJoypad(Key key, boolean state) { if (key.name.equals(MojamComponent.instance.keys.joy_click.name)) { MouseButtons mb = MojamComponent.instance.mouseButtons; MojamComponent.instance.mouseButtons.nextState[1] = (!mb.nextState2[1])?state:mb.nextState[1]; return; } key.nextState = (!key.nextState2)?state:key.nextState; }
Source:
<code>public static String formatIPAddressForURI(InetAddress inet){ if(inet == null){ <START> throw new NullPointerException(); <END> } if(inet instanceof Inet4Address){ return inet.getHostAddress(); } else if (inet instanceof Inet6Address){ return '[' + formatAddress(inet) + ']'; } else { return inet.getHostAddress(); } }</code><technical_language>else final call here, I throwing NPE's. I assert sufficient here. throw IllegalArgumentException</technical_language>

Target:
public static String formatIPAddressForURI(InetAddress inet){ if(inet == null){ throw new IllegalArgumentException(); } if(inet instanceof Inet4Address){ return inet.getHostAddress(); } else if (inet instanceof Inet6Address){ return '[' + formatAddress(inet) + ']'; } else { return inet.getHostAddress(); } }
Source:
<code>private void appendGMFEdgeLabels(Edge edge, StringBuilder sb) { sb.append("\nLabels of edge:\n"); for (Object child : edge.getChildren()) { if (child instanceof Node) { Node node = (Node) child; if (new ViewQuery(node).isForEdgeNameEditPart() && <START> (node).getLayoutConstraint() <END> instanceof Location) { Location location = (Location) (node).getLayoutConstraint(); int type = SiriusVisualIDRegistry.getVisualID((node).getType()); if (type == DEdgeBeginNameEditPart.VISUAL_ID) { sb.append("\nBegin label: ").append(((DEdge) node.getElement()).getBeginLabel()).append(", "); sb.append(" (x: "); sb.append(location.getX()); sb.append(", y: "); sb.append(location.getY()); sb.append(')'); } else if (type == DEdgeNameEditPart.VISUAL_ID) { sb.append("\nCenter label: ").append(((DEdge) node.getElement()).getName()).append(", "); sb.append(" (x: "); sb.append(location.getX()); sb.append(", y: "); sb.append(location.getY()); sb.append(')'); } else if (type == DEdgeEndNameEditPart.VISUAL_ID) { sb.append("\nEnd label: ").append(((DEdge) node.getElement()).getEndLabel()).append(", "); sb.append(" (x: "); sb.append(location.getX()); sb.append(", y: "); sb.append(location.getY()); sb.append(')'); } } } } }</code><technical_language>I thought get a warning for useful parenthesis</technical_language>

Target:
private void appendGMFEdgeLabels(Edge edge, StringBuilder sb) { sb.append("\nLabels of edge:\n"); for (Object child : edge.getChildren()) { if (child instanceof Node) { Node node = (Node) child; if (new ViewQuery(node).isForEdgeNameEditPart() && node.getLayoutConstraint() instanceof Location) { Location location = (Location) (node).getLayoutConstraint(); int type = SiriusVisualIDRegistry.getVisualID(node.getType()); if (type == DEdgeBeginNameEditPart.VISUAL_ID) { appendLabelLocation(sb, "Begin label", ((DEdge) node.getElement()).getBeginLabel(), location); } else if (type == DEdgeNameEditPart.VISUAL_ID) { appendLabelLocation(sb, "Center label", ((DEdge) node.getElement()).getName(), location); } else if (type == DEdgeEndNameEditPart.VISUAL_ID) { appendLabelLocation(sb, "End label", ((DEdge) node.getElement()).getEndLabel(), location); } } } } }
Source:
<code>private Set<BasicAuthorizerRoleSimplifiedPermissions> getRolesForUserWithSimplifiedPermissions( BasicAuthorizerUser user, Map<String, BasicAuthorizerRole> roleMap ) { Set<BasicAuthorizerRoleSimplifiedPermissions> roles = new HashSet<>(); for (String roleName : user.getRoles()) { BasicAuthorizerRole role = roleMap.get(roleName); if (role == null) { <START> log.error("User [%s] had role [%s], but role was not found.", user.getName(), roleName); <END> } else { BasicAuthorizerRoleSimplifiedPermissions roleWithSimplifiedPermissions = new BasicAuthorizerRoleSimplifiedPermissions( role.getName(), null, BasicAuthorizerRoleSimplifiedPermissions.convertPermissions(role.getPermissions()) ); roles.add(roleWithSimplifiedPermissions); } } return roles; }</code><technical_language>nit: suggestion log.error("User [%s] role [%s], role object found.", user.getName(), roleName);</technical_language>

Target:
private Set<BasicAuthorizerRoleSimplifiedPermissions> getRolesForUserWithSimplifiedPermissions( BasicAuthorizerUser user, Map<String, BasicAuthorizerRole> roleMap ) { Set<BasicAuthorizerRoleSimplifiedPermissions> roles = new HashSet<>(); for (String roleName : user.getRoles()) { BasicAuthorizerRole role = roleMap.get(roleName); if (role == null) { log.error("User [%s] had role [%s], but role object was not found.", user.getName(), roleName); } else { BasicAuthorizerRoleSimplifiedPermissions roleWithSimplifiedPermissions = new BasicAuthorizerRoleSimplifiedPermissions( role.getName(), null, BasicAuthorizerRoleSimplifiedPermissions.convertPermissions(role.getPermissions()) ); roles.add(roleWithSimplifiedPermissions); } } return roles; }
Source:
<code>public int getPropagationConditions(int idx) { <START> if (fast) { <END> return IntEventType.instantiation(); } return IntEventType.boundAndInst(); }</code><technical_language>remove fast attribute</technical_language>

Target:
public int getPropagationConditions(int idx) { return IntEventType.boundAndInst(); }
Source:
<code>private static View createToastView(Context context, CharSequence message) { View toastView = LayoutInflater.from(context).inflate(R.layout.toast, null, false); QuranSettings settings = QuranSettings.getInstance(context); Drawable tintedBackground = createTintedBackground(context, settings.isNightMode()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { toastView.setBackground(tintedBackground); } else { toastView.setBackgroundDrawable(tintedBackground); } <START> TextView textView = toastView.findViewById(android.R.id.message); <END> textView.setTextColor(getTextColor(context, settings)); textView.setText(message); return toastView; }</code><technical_language>play safe do if null in case Samsung devices do odd</technical_language>

Target:
private static View createToastView(Context context, CharSequence message) { View toastView = LayoutInflater.from(context).inflate(R.layout.toast, null, false); boolean nightMode = QuranSettings.getInstance(context).isNightMode(); Drawable tintedBackground = createTintedBackground(context, nightMode); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { toastView.setBackground(tintedBackground); } else { toastView.setBackgroundDrawable(tintedBackground); } TextView textView = toastView.findViewById(R.id.message); textView.setTextColor(getTextColor(context, nightMode)); textView.setText(message); return toastView; }
Source:
<code>public void init(MapBackedPreferences preferences) { INSTANCE.preferences = preferences; emptyNode = preferences.node("emptyNode"); buildIdToUnameLookup(); buildBackCompatMapping(); validateTree(); if (log.isDebugEnabled()) { <START> log.debug("Osinfo Repository:\n {}", toString()); <END> } }</code><technical_language>please drop space \n</technical_language>

Target:
public void init(MapBackedPreferences preferences) { INSTANCE.preferences = preferences; emptyNode = preferences.node("emptyNode"); buildIdToUnameLookup(); buildBackCompatMapping(); validateTree(); if (log.isDebugEnabled()) { log.debug("Osinfo Repository:\n{}", this); } }
Source:
<code>public LoginCredential getLoginCredentialByActivationKey(String activationKey) { String key = Security.encodeString(activationKey); <START> LoginCredential loginCred = (LoginCredential) sessionFactory.getCurrentSession().createCriteria(LoginCredential.class).add(Restrictions.like("activationKey", key, MatchMode.START)).uniqueResult(); <END> if(loginCred != null) { String[] credTokens = loginCred.getActivationKey().split(":"); if(credTokens[0].equals(key) && (System.currentTimeMillis() <= Long.parseLong(credTokens[1]) )){ return loginCred; } } return null; }</code><technical_language>format code, is this line long</technical_language>

Target:
public LoginCredential getLoginCredentialByActivationKey(String activationKey) { String key = Security.encodeString(activationKey); LoginCredential loginCred = (LoginCredential) sessionFactory.getCurrentSession().createCriteria(LoginCredential.class) .add(Restrictions.like("activationKey", key, MatchMode.START)).uniqueResult(); if(loginCred != null) { String[] credTokens = loginCred.getActivationKey().split(":"); if(credTokens[0].equals(key)){ return loginCred; } } return null; }
Source:
<code>private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(partitionId); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, <START> routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism, false); <END> correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationException(e); } }</code><technical_language>dont want shuffle replicas for put</technical_language>

Target:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(partitionId); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationException(e); } }
Source:
<code>public void upload() throws IOException { String bucketName = getBucketName(); String key = getKey(); File file = getFile(); String kmsKeyId = getKmsKeyId(); if (bucketName == null) { throw new GradleException("bucketName is not specified"); } if (key == null) { throw new GradleException("key is not specified"); } if (file == null) { throw new GradleException("file is not specified"); } <START> if (file.isFile()) { <END> throw new GradleException("file must be regular file"); } AmazonS3PluginExtension ext = getProject().getExtensions().getByType(AmazonS3PluginExtension.class); AmazonS3 s3 = ext.getClient(); ObjectMetadata metadata = existingObjectMetadata(); if (metadata == null || (isOverwrite() || metadata.getETag().equals(md5()))) { getLogger().info("uploading... " + bucketName + "/" + key); if (kmsKeyId == null) { putObject(bucketName, key, file, s3); } else { putObjectWithKmsSupport(bucketName, key, file, kmsKeyId, s3); } getLogger().info("upload completed: " + ((AmazonS3Client) s3).getResourceUrl(bucketName, key)); } else { getLogger().info("s3://{}/{} already exists with matching md5 sum -- skipped", bucketName, key); } setResourceUrl(s3.getUrl(bucketName, key).toString()); }</code><technical_language>this condition is inverted</technical_language>

Target:
public void upload() throws IOException { String bucketName = getBucketName(); String key = getKey(); File file = getFile(); String kmsKeyId = getKmsKeyId(); if (bucketName == null) { throw new GradleException("bucketName is not specified"); } if (key == null) { throw new GradleException("key is not specified"); } if (file == null) { throw new GradleException("file is not specified"); } if (file.isFile() == false) { throw new GradleException("file must be regular file"); } AmazonS3PluginExtension ext = getProject().getExtensions().getByType(AmazonS3PluginExtension.class); AmazonS3 s3 = ext.getClient(); ObjectMetadata metadata = existingObjectMetadata(); if (metadata == null || (isOverwrite() || metadata.getETag().equals(md5()) == false)) { getLogger().info("uploading... " + bucketName + "/" + key); if (kmsKeyId == null) { putObject(bucketName, key, file, s3); } else { putObjectWithKmsSupport(bucketName, key, file, kmsKeyId, s3); } getLogger().info("upload completed: " + ((AmazonS3Client) s3).getResourceUrl(bucketName, key)); } else { getLogger().info("s3://{}/{} already exists with matching md5 sum -- skipped", bucketName, key); } setResourceUrl(s3.getUrl(bucketName, key).toString()); }
Source:
<code>public AirConditioner login() throws Exception { try { connect(); getToken(); loginWithToken(); } catch (Exception e) { <START> logger.debug("Disconnecting... with exception: " + e.toString()); <END> disconnect(); throw e; } return this; }</code><technical_language>Please change parameterized logging: logger.debug("Disconnecting... exception: {}", e.toString());</technical_language>

Target:
public AirConditioner login() throws Exception { try { connect(); getToken(); loginWithToken(); } catch (Exception e) { logger.debug("Disconnecting... with exception: {}", e.toString()); disconnect(); throw e; } return this; }