auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void fireStack(@Nonnull ItemStack stack) { final ITriggerable rpc = createServerRpcProxy(ITriggerable.class); rpc.trigger(); double yawr = Math.toRadians(currentYaw); double pitchr = Math.toRadians(currentPitch); <START> double barrel_length = 0.5; <END> double barrel_base_height = 0.3; double x = pos.getX() + 0.5 - Math.sin(yawr) * Math.cos(pitchr) * barrel_length; double y = pos.getY() + barrel_base_height + Math.sin(pitchr) * barrel_length; double z = pos.getZ() + 0.5 + Math.cos(yawr) * Math.cos(pitchr) * barrel_length; EntityItem item = new EntityItemProjectile(world, x, y, z, stack); item.setDefaultPickupDelay(); Vec3d motion = getMotion(); item.motionX = motion.x; item.motionY = motion.y; item.motionZ = motion.z; world.spawnEntity(item); playSoundAtBlock(OpenBlocks.Sounds.BLOCK_CANNON_ACTIVATE, 0.2f, 1.0f); }</code><technical_language>barrelLength</technical_language>

Target:
private void fireStack(@Nonnull ItemStack stack) { final ITriggerable rpc = createServerRpcProxy(ITriggerable.class); rpc.trigger(); double yawr = Math.toRadians(currentYaw); double pitchr = Math.toRadians(currentPitch); double barrelLength = 0.5; double barrelBaseHeight = 0.3; double x = pos.getX() + 0.5 - Math.sin(yawr) * Math.cos(pitchr) * barrelLength; double y = pos.getY() + barrelBaseHeight + Math.sin(pitchr) * barrelLength; double z = pos.getZ() + 0.5 + Math.cos(yawr) * Math.cos(pitchr) * barrelLength; EntityItem item = new EntityItemProjectile(world, x, y, z, stack); item.setDefaultPickupDelay(); Vec3d motion = getMotion(); item.motionX = motion.x; item.motionY = motion.y; item.motionZ = motion.z; world.spawnEntity(item); playSoundAtBlock(OpenBlocks.Sounds.BLOCK_CANNON_ACTIVATE, 0.2f, 1.0f); }
Source:
<code>public void onCreateButtonClicked() { ObservableList<Mod> selectedMods = modListView.getSelectionModel().getSelectedItems(); try { modService.overrideActivatedMods(modListView.getSelectionModel().getSelectedItems()); } catch (IOException e) { <START> logger.warn("Activated Mods could not be updated", e); <END> } Set<String> simMods = selectedMods.stream() .map(Mod::getUid) .collect(Collectors.toSet()); NewGameInfo newGameInfo = new NewGameInfo( titleTextField.getText(), Strings.emptyToNull(passwordTextField.getText()), featuredModListView.getSelectionModel().getSelectedItem(), mapListView.getSelectionModel().getSelectedItem().getFolderName(), simMods); gameService.hostGame(newGameInfo).exceptionally(throwable -> { logger.warn("Game could not be hosted", throwable); notificationService.addNotification( new ImmediateNotification( i18n.get("errorTitle"), i18n.get("game.create.failed"), Severity.WARN, throwable, Collections.singletonList(new ReportAction(i18n, reportingService, throwable)))); return null; }); onCloseButtonClicked(); }</code><technical_language>mods</technical_language>

Target:
public void onCreateButtonClicked() { ObservableList<Mod> selectedMods = modListView.getSelectionModel().getSelectedItems(); try { modService.overrideActivatedMods(modListView.getSelectionModel().getSelectedItems()); } catch (IOException e) { logger.warn("Activated mods could not be updated", e); } Set<String> simMods = selectedMods.stream() .map(Mod::getUid) .collect(Collectors.toSet()); NewGameInfo newGameInfo = new NewGameInfo( titleTextField.getText(), Strings.emptyToNull(passwordTextField.getText()), featuredModListView.getSelectionModel().getSelectedItem(), mapListView.getSelectionModel().getSelectedItem().getFolderName(), simMods); gameService.hostGame(newGameInfo).exceptionally(throwable -> { logger.warn("Game could not be hosted", throwable); notificationService.addNotification( new ImmediateNotification( i18n.get("errorTitle"), i18n.get("game.create.failed"), Severity.WARN, throwable, Collections.singletonList(new ReportAction(i18n, reportingService, throwable)))); return null; }); onCloseButtonClicked(); }
Source:
<code>private List<String> asList(String allValues) { <START> String tempAllValues = allValues; <END> List<String> valuesList = Collections.emptyList(); if (!StringUtils.isBlank(tempAllValues)) { tempAllValues = tempAllValues.trim().substring(1, tempAllValues.length() - 1); valuesList = Arrays.asList(tempAllValues.split("\\s*,\\s*")); } return valuesList; }</code><technical_language>declare a short-lived variable assignment happens, in if loop</technical_language>

Target:
private List<String> asList(String allValues) { List<String> valuesList = Collections.emptyList(); if (!StringUtils.isBlank(allValues)) { String tempAllValues = allValues.trim().substring(1, allValues.length() - 1); valuesList = Arrays.asList(tempAllValues.split("\\s*,\\s*")); } return valuesList; }
Source:
<code>public void onPageLoadError(Throwable caught) { if (!isAdded()) { return; } tocDrawer.closeDrawers(); updateProgressBar(false, true, 0); refreshView.setRefreshing(false); if (pageRefreshed) { pageRefreshed = false; FeedbackUtil.showError(getActivity(), caught); } hidePageContent(); errorView.setError(caught); errorView.setVisibility(View.VISIBLE); if (getActivity() != null) { refreshView.setEnabled(ThrowableUtil.isRetryable(getActivity(), caught)); } errorState = true; if <START> (getActivity() != <END> null && getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadError(caught); } }</code><technical_language>question here, getPageLoadCallbacks() != null</technical_language>

Target:
public void onPageLoadError(Throwable caught) { if (!isAdded()) { return; } tocDrawer.closeDrawers(); updateProgressBar(false, true, 0); refreshView.setRefreshing(false); if (pageRefreshed) { pageRefreshed = false; FeedbackUtil.showError(getActivity(), caught); } hidePageContent(); errorView.setError(caught); errorView.setVisibility(View.VISIBLE); if (getActivity() != null) { refreshView.setEnabled(ThrowableUtil.isRetryable(getActivity(), caught)); } errorState = true; if (getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadError(caught); } }
Source:
<code>public StubSearchWorkAssert matches(StubSearchWork expected) { StringBuilder builder = new StringBuilder( messageBase ); boolean hasAnyMismatch; boolean mismatch = checkForMismatch( builder, "resultType", expected.getResultType(), actual.getResultType() ); hasAnyMismatch = mismatch; mismatch = checkForMismatch( builder, "routingKeys", expected.getRoutingKeys(), actual.getRoutingKeys() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "timeout", expected.getTimeout(), actual.getTimeout() ); hasAnyMismatch = hasAnyMismatch || mismatch; <START> if ( expected.getTimeout() != null ) { <END> mismatch = checkForMismatch( builder, "timeUnit", expected.getTimeUnit(), actual.getTimeUnit() ); hasAnyMismatch = hasAnyMismatch || mismatch; } mismatch = checkForMismatch( builder, "offset", expected.getOffset(), actual.getOffset() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "limit", expected.getLimit(), actual.getLimit() ); hasAnyMismatch = hasAnyMismatch || mismatch; if ( hasAnyMismatch ) { Assert.fail( builder.toString() ); } return this; }</code><technical_language>This condition unnecessary? a unit a sense, expect unit match, of value</technical_language>

Target:
public StubSearchWorkAssert matches(StubSearchWork expected) { StringBuilder builder = new StringBuilder( messageBase ); boolean hasAnyMismatch; boolean mismatch = checkForMismatch( builder, "resultType", expected.getResultType(), actual.getResultType() ); hasAnyMismatch = mismatch; mismatch = checkForMismatch( builder, "routingKeys", expected.getRoutingKeys(), actual.getRoutingKeys() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "truncateAfterTimeout", expected.getTruncateAfterTimeout(), actual.getTruncateAfterTimeout() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "truncateAfterTimeUnit", expected.getTruncateAfterTimeUnit(), actual.getTruncateAfterTimeUnit() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "failAfterTimeout", expected.getFailAfterTimeout(), actual.getFailAfterTimeout() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "failAfterTimeUnit", expected.getFailAfterTimeUnit(), actual.getFailAfterTimeUnit() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "offset", expected.getOffset(), actual.getOffset() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "limit", expected.getLimit(), actual.getLimit() ); hasAnyMismatch = hasAnyMismatch || mismatch; if ( hasAnyMismatch ) { Assert.fail( builder.toString() ); } return this; }
Source:
<code>public String toString() { <START> return "[" + stream().map(Constraint::toString).sorted().collect(Collectors.joining(",")) + "]"; <END> }</code><technical_language>Minor: provide suffix prefix args Collectors.joining avoid adding brackets +</technical_language>

Target:
public String toString() { return stream().map(Constraint::toString).sorted().collect(Collectors.joining(",", "[", "]")); }
Source:
<code>HttpSolrServer getAutosuggestCore() { <START> return new HttpSolrServer("http:// localhost:8090/solr" + "/autosuggest"); <END> }</code><technical_language>Change solrBaseUrl</technical_language>

Target:
HttpSolrServer getAutosuggestCore() { return new HttpSolrServer(solrBaseUrl + "/autosuggest"); }
Source:
<code>public void verifyOnHistoryPage() { String url = driver.getCurrentUrl(); String[] urlParts = url.split("/"); <START> Assertion.assertEquals(urlParts[urlParts.length - 1], "History"); <END> PageObjectLogging.log("verifyOnHistoryPage", "verify that the url is the correct one for history page", true); }</code><technical_language>please consider Assertion.assertContains - is more readable</technical_language>

Target:
public void verifyOnHistoryPage() { String url = driver.getCurrentUrl(); Assertion.assertTrue(url.contains("/History")); PageObjectLogging.log("verifyOnHistoryPage", "the url is the correct one for history page", true); }
Source:
<code><START> private <K2, V2> Multimap<K2, V2> createFromEntries(Iterable<? extends Tuple2<? extends K2, ? extends V2>> entries) { <END> Map<K2, Traversable<V2>> back = emptyMapSupplier(); for (Tuple2<? extends K2, ? extends V2> entry : entries) { if (back.containsKey(entry._1)) { back = back.put(entry._1, (Traversable<V2>) containerType.add.apply(back.get(entry._1).get(), entry._2)); } else { back = back.put(entry._1, (Traversable<V2>) containerType.add.apply(emptyContainer.get(), entry._2)); } } return createFromMap(back); }</code><technical_language>I Tuple2 instead of ? extends Tuple2. For K2 V2 do need ? extends this method is private</technical_language>

Target:
private <K2, V2> Multimap<K2, V2> createFromEntries(Iterable<? extends Tuple2<? extends K2, ? extends V2>> entries) { Map<K2, Traversable<V2>> back = emptyMapSupplier(); for (Tuple2<? extends K2, ? extends V2> entry : entries) { if (back.containsKey(entry._1)) { back = back.put(entry._1, containerType.add(back.get(entry._1).get(), entry._2)); } else { back = back.put(entry._1, containerType.add(emptyContainer.get(), entry._2)); } } return createFromMap(back); }
Source:
<code>public boolean accept(Path path) { String filePathName = path.toString(); try { <START> FileSystem fileSystem = path.getFileSystem(new Configuration()); <END> if (fileSystem.exists(path) && fileSystem.isDirectory(path)) { return true; } } catch (IOException e) { throw new IllegalArgumentException(String.format("Error accessing path: %s.", path), e); } if (!useTimeFilter) { String fileName = path.getName(); Matcher matcher = regex.matcher(fileName); return matcher.matches(); } if (lastRead.equals("-1")) { String currentTime = sdf.format(prevHour); return filePathName.contains(currentTime); } Date fileDate; String filename = path.getName(); try { fileDate = sdf.parse(filename.substring(0, DATE_LENGTH)); } catch (Exception pe) { try { int startIndex = filename.indexOf(".") + 1; fileDate = sdf.parse(filename.substring(startIndex, startIndex + DATE_LENGTH)); } catch (Exception e) { LOG.warn("Couldn't parse file: " + filename); return false; } } return isWithinRange(fileDate); }</code><technical_language>this accept directory, directories match pattern. significant overhead</technical_language>

Target:
public boolean accept(Path path) { String filePathName = path.toString(); try { FileSystem fileSystem = path.getFileSystem(new Configuration()); FileStatus[] fileStatus = fileSystem.globStatus(path); if (fileSystem.isDirectory(path) && !filePathName.endsWith("/")) { filePathName += "/"; } if (fileStatus != null && fileSystem.isDirectory(path) && (fileSystem.getContentSummary(path).getDirectoryCount() > 1 || pattern.matcher(filePathName).find())) { return true; } } catch (IOException e) { throw new IllegalArgumentException(String.format("Input path %s does not exists. %s.", path.toString(), e.getMessage()), e); } if (!useTimeFilter) { Matcher matcher = regex.matcher(filePathName); return matcher.matches(); } if (lastRead.equals("-1")) { String currentTime = sdf.format(prevHour); return filePathName.contains(currentTime); } Date fileDate; String filename = path.getName(); try { fileDate = sdf.parse(filename.substring(0, DATE_LENGTH)); } catch (Exception pe) { try { int startIndex = filename.indexOf(".") + 1; fileDate = sdf.parse(filename.substring(startIndex, startIndex + DATE_LENGTH)); } catch (Exception e) { LOG.warn("Couldn't parse file: " + filename); return false; } } return isWithinRange(fileDate); }
Source:
<code>protected Predicate<DetailedS3Object> getDatePredicate() throws CommandException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } <START> String newer = this.filterParams.get(NEWERTHAN); <END> String older = this.filterParams.get(OLDERTHAN); if (Guard.isStringNullOrEmpty(newer) && Guard.isStringNullOrEmpty(older)) { return Predicates.notNull(); } final long newerThan = Guard.isStringNullOrEmpty(newer) ? 0L : new Date().getTime() - Utils.dateDiffToSeconds(newer) * 1000; final long olderThan = Guard.isStringNullOrEmpty(older) ? Long.MAX_VALUE : new Date().getTime() - Utils.dateDiffToSeconds(older) * 1000; return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getCreationDate().after(new Date(newerThan)) && input.getCreationDate().before(new Date(olderThan)); } }; }</code><technical_language>Missing final</technical_language>

Target:
private Predicate<DetailedS3Object> getDatePredicate() throws CommandException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } final String newer = this.filterParams.get(NEWERTHAN); final String older = this.filterParams.get(OLDERTHAN); if (Guard.isStringNullOrEmpty(newer) && Guard.isStringNullOrEmpty(older)) { return Predicates.notNull(); } final long newerThan = Guard.isStringNullOrEmpty(newer) ? 0L : new Date().getTime() - Utils.dateDiffToSeconds(newer) * MILLIS_PER_SECOND; final long olderThan = Guard.isStringNullOrEmpty(older) ? Long.MAX_VALUE : new Date().getTime() - Utils.dateDiffToSeconds(older) * MILLIS_PER_SECOND; return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getCreationDate().after(new Date(newerThan)) && input.getCreationDate().before(new Date(olderThan)); } }; }
Source:
<code><START> public ValidationResult validateNetworkInterfaces(VM vm) { <END> Map<String, VmNetworkInterface> interfaceNetworkMap = Entities.vmInterfacesByNetworkName(vm.getInterfaces()); Set<String> interfaceNetworkNames = interfaceNetworkMap.keySet(); List<Network> clusterNetworks = getNetworkDAO().getAllForCluster(vm.getVdsGroupId()); Set<String> clusterNetworksNames = Entities.objectNames(clusterNetworks); ValidationResult validationResult = isVmInterfacesConfigured(vm); if (!validationResult.isValid()) { return validationResult; } validationResult = isVmInterfacesAttachedToClusterNetworks(vm, clusterNetworksNames, interfaceNetworkNames); if (!validationResult.isValid()) { return validationResult; } validationResult = isVmInterfacesAttachedToVmNetworks(clusterNetworks, interfaceNetworkNames); if (!validationResult.isValid()) { return validationResult; } return ValidationResult.VALID; }</code><technical_language>I public method expects a VM a parameter, create a member of validator class instead of this class stateless? c'tor of RunVmValidator get a VM of validation executed. This a bit out of scope of this patch - i mind a patch added a follow patch this one</technical_language>

Target:
public ValidationResult validateNetworkInterfaces(VM vm) { Map<String, VmNetworkInterface> interfaceNetworkMap = Entities.vmInterfacesByNetworkName(vm.getInterfaces()); Set<String> interfaceNetworkNames = interfaceNetworkMap.keySet(); List<Network> clusterNetworks = getNetworkDao().getAllForCluster(vm.getVdsGroupId()); Set<String> clusterNetworksNames = Entities.objectNames(clusterNetworks); ValidationResult validationResult = isVmInterfacesConfigured(vm); if (!validationResult.isValid()) { return validationResult; } validationResult = isVmInterfacesAttachedToClusterNetworks(vm, clusterNetworksNames, interfaceNetworkNames); if (!validationResult.isValid()) { return validationResult; } validationResult = isVmInterfacesAttachedToVmNetworks(clusterNetworks, interfaceNetworkNames); if (!validationResult.isValid()) { return validationResult; } return ValidationResult.VALID; }
Source:
<code>private void doSeekCol(Cell cell) throws IOException { if (this.matcher.isUserScan() && !get && !useRowColBloom && seekToSameBlock <START> && bytesRead > switchToNextOnlyBytes) { <END> this.heap.next(); } else { seekOrSkipToNextColumn(cell); } }</code><technical_language>need "bytesRead > switchToNextOnlyBytes"? do directly</technical_language>

Target:
private void doSeekCol(Cell cell) throws IOException { if (switchToNextOnlyBytes > 0 && this.matcher.isUserScan() && !get && !useRowColBloom && seekToSameBlock && bytesRead > switchToNextOnlyBytes) { this.heap.next(); } else { seekOrSkipToNextColumn(cell); } }
Source:
<code>private void initToolbar(Toolbar toolbar) { if (DEBUG) Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); boolean isLight = ThemeHelper.isLightThemeSelected(getActivity()); toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); if (playlistDownloadCallback != null) { toolbar.setTitle(getResources().getString(R.string.download) + " (" + getResources().getString(R.string.playlist) + ")"); MenuItem menuItem = toolbar.getMenu().findItem(R.id.skip); menuItem.setVisible(true); <START> } else toolbar.setTitle(R.string.download_dialog_title); <END> toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); if (playlistDownloadCallback != null) { if (smartDownloadCheckbox.isChecked() && downloadSetting != null) { playlistDownloadCallback.accept(downloadSetting); } else { playlistDownloadCallback.accept(null); } } } else if (item.getItemId() == R.id.skip) { if (playlistDownloadCallback != null) { playlistDownloadCallback.accept(null); } } getDialog().dismiss(); return true; }); }</code><technical_language>Please add { }</technical_language>

Target:
private void initToolbar(Toolbar toolbar) { if (DEBUG) Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); boolean isLight = ThemeHelper.isLightThemeSelected(getActivity()); toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); if (playlistDownloadCallback != null) { toolbar.setTitle(getResources().getString(R.string.download) + " (" + getResources().getString(R.string.playlist) + ")"); MenuItem menuItem = toolbar.getMenu().findItem(R.id.skip); menuItem.setVisible(true); } else { toolbar.setTitle(R.string.download_dialog_title); } toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); } else if (item.getItemId() == R.id.skip) { if (playlistDownloadCallback != null) { playlistDownloadCallback.accept(null); } } getDialog().dismiss(); return true; }); }
Source:
<code>public ResponseEntity<Map<String, Object>> encryptionTooWeak() { Map<String, Object> body = new HashMap<String, Object>(); body.put("status", "INVALID"); <START> body.put("description", "Encryption method provided too weak"); <END> return new ResponseEntity<>(body, HttpStatus.NOT_FOUND); }</code><technical_language>I change text "The encryption algorithm is strong enough."</technical_language>

Target:
public ResponseEntity<Map<String, Object>> encryptionTooWeak() { Map<String, Object> body = new HashMap<String, Object>(); body.put("status", "INVALID"); body.put("description", "The encryption algorithm is not strong enough"); return new ResponseEntity<>(body, HttpStatus.NOT_FOUND); }
Source:
<code>private Optional<URL> getUrlForFile( File possibleFileInSrc) { try { return Optional.fromNullable( possibleFileInSrc.toURI().toURL() ); } catch(MalformedURLException malformedURLException) { logger.error("Error in dev mode while streaming files from src dir. ", malformedURLException); } <START> return null; <END> }</code><technical_language>return null is want... Optional.absent() possibly better</technical_language>

Target:
private Optional<URL> getUrlForFile( File possibleFileInSrc) { try { return Optional.fromNullable( possibleFileInSrc.toURI().toURL() ); } catch(MalformedURLException malformedURLException) { logger.error("Error in dev mode while streaming files from src dir. ", malformedURLException); } return Optional.absent(); }
Source:
<code>private void skipIfImageNotPresent() { <START> Image image = view.getComputeService().getImage(getImageId()); <END> if (image == null) { throw new SkipException("Image " + getImageId() + " not available. Skipping windows tests."); } }</code><technical_language>getImage call is cached (as opposed listImages one). get image in a @Before method once</technical_language>

Target:
private void skipIfImageNotPresent() { Image image = client.getImage(getImageId()); if (image == null) { throw new SkipException("Image " + getImageId() + " not available. Skipping windows tests."); } }
Source:
<code>public void run() { <START> jobs.forEach(Job::run); <END> }</code><technical_language>Hm, this differs suggested implementation a bit (<LINK_0> forEach: "Performs action for element of Iterable elements processed action throws exception." So, stopped if a job's run method throws a runtime excpetion (silently). This hard detect. logs a warning, continue next job. Do want lambdas stream modified this way</technical_language>

Target:
public void run() { jobs.forEach(j -> { try { j.run(); } catch (RuntimeException ex) { logger.warn("Job execution failed.", ex); } }); }
Source:
<code>public void setStrokeUom(Uom u) { if (pointSymbolizer == null) { System.out.println("Null pointSymbolizer"); } if(ps != null){ MarkGraphic mg = (MarkGraphic) pointSymbolizer.getGraphicCollection().getChildren().get(0); mg.getStroke().setUom(u); } else { System.out.println("Null ps. Trying another solution."); Stroke stroke = ((MarkGraphic) pointSymbolizer.getGraphicCollection().getGraphic(0)).getStroke(); if (stroke != null){ stroke.setUom(u); } else { <START> System.out.println("Null stroke"); <END> } } }</code><technical_language>please remove remaining calls System.out.println</technical_language>

Target:
public void setStrokeUom(Uom u) { if(ps != null) { MarkGraphic mg = (MarkGraphic) pointSymbolizer.getGraphicCollection().getChildren().get(0); mg.getStroke().setUom(u); } else { LOGGER.error("Cannot set the stroke UOM because the ps is null."); } }
Source:
<code>public CurrencyAmount recovery01( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { ArgChecker.notNull(cds, "cds"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(referenceDate, "referenceDate"); ArgChecker.notNull(refData, "refData"); if (!cds.getProtectionEndDate().isAfter(ratesProvider.getValuationDate())) { return CurrencyAmount.of(cds.getCurrency(), 0d); } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.getEffectiveStartDate(stepinDate); <START> recoveryRate(cds, ratesProvider); END> Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); double protectionFull = protectionFull(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate); return CurrencyAmount.of(cds.getCurrency(), -cds.getBuySell().normalize(cds.getNotional()) * protectionFull); }</code><technical_language>If this is called for validation, refactor out validation code a new method validateRecovery</technical_language>

Target:
public CurrencyAmount recovery01( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cds, ratesProvider)) { return CurrencyAmount.of(cds.getCurrency(), 0d); } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); validateRecoveryRates(cds, ratesProvider); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); double protectionFull = protectionFull(cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate); return CurrencyAmount.of(cds.getCurrency(), -cds.getBuySell().normalize(cds.getNotional()) * protectionFull); }
Source:
<code>public void verifyEvolveHoppedInSlot(String slotName, String nextProviderSrc) { <START> String nextProviderSlotCSS = String.format("div[id*=\'%s/%s\']", nextProviderSrc, slotName); <END> Assertion.assertTrue(checkIfElementOnPage(nextProviderSlotCSS)); PageObjectLogging.log("Evolve", "Evolve hopped to " + nextProviderSrc, true); }</code><technical_language>nitpick a bit ;) Consider camel-case: nextProviderSlotCss</technical_language>

Target:
public void verifyEvolveHoppedInSlot(String slotName, String nextProviderSrc) { String nextProviderSlotCss = String.format("div[id*=\'%s/%s\']", nextProviderSrc, slotName); Assertion.assertTrue(checkIfElementOnPage(nextProviderSlotCss)); PageObjectLogging.log("Evolve", "Evolve hopped to " + nextProviderSrc, true); }
Source:
<code>private void generateNewJobModel() { List<String> currentProcessors = zkUtils.getSortedActiveProcessors(); String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) <START> nextJMVersion = "1"; <END> else nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); log.info("pid=" + processorId + "generating new model. Version = " + nextJMVersion); StringBuilder sb = new StringBuilder(); List<Integer> containerIds = new ArrayList<>(); for (String processor : currentProcessors) { String zkProcessorId = keyBuilder.parseIdFromPath(processor); sb.append(zkProcessorId).append(","); containerIds.add(Integer.valueOf(zkProcessorId)); } log.info("generate new job model: processorsIds: " + sb.toString()); jobModelManager = JobModelManager$.MODULE$.getJobCoordinator(this.config, null, null, streamMetadataCache, null, containerIds); JobModel jobModel = jobModelManager.jobModel(); log.info("pid=" + processorId + "Generated jobModel: " + jobModel); zkUtils.publishJobModel(nextJMVersion, jobModel); log.info("pid=" + processorId + "published new JobModel ver=" + nextJMVersion + ";jm=" + jobModel); barrier.start(nextJMVersion, currentProcessors); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); log.info("pid=" + processorId + "published new JobModel ver=" + nextJMVersion); }</code><technical_language>I want add log.info in this case</technical_language>

Target:
private void generateNewJobModel() { List<String> currentProcessors = zkUtils.getSortedActiveProcessors(); String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) { log.info("pid=" + processorId + "generating first version of the model"); nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } log.info("pid=" + processorId + "generating new model. Version = " + nextJMVersion); StringBuilder sb = new StringBuilder(); List<Integer> containerIds = new ArrayList<>(); for (String processor : currentProcessors) { String zkProcessorId = keyBuilder.parseIdFromPath(processor); sb.append(zkProcessorId).append(","); containerIds.add(Integer.valueOf(zkProcessorId)); } log.info("generate new job model: processorsIds: " + sb.toString()); jobModelManager = JobModelManager$.MODULE$.getJobCoordinator(this.config, null, null, streamMetadataCache, null, containerIds); JobModel jobModel = jobModelManager.jobModel(); log.info("pid=" + processorId + "Generated jobModel: " + jobModel); zkUtils.publishJobModel(nextJMVersion, jobModel); log.info("pid=" + processorId + "published new JobModel ver=" + nextJMVersion + ";jm=" + jobModel); barrier.start(nextJMVersion, currentProcessors); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); log.info("pid=" + processorId + "published new JobModel ver=" + nextJMVersion); }
Source:
<code>public void updateMemoryUsage(long deltaUserMemoryInBytes, long deltaTotalMemoryInBytes) { <START> long currentUserMemoryValue = currentUserMemory.addAndGet(deltaUserMemoryInBytes); <END> long currentTotalMemoryValue = currentTotalMemory.addAndGet(deltaTotalMemoryInBytes); peakUserMemory.updateAndGet(currentPeakValue -> Math.max(currentUserMemoryValue, currentPeakValue)); peakTotalMemory.updateAndGet(currentPeakValue -> Math.max(currentTotalMemoryValue, currentPeakValue)); }</code><technical_language>currentXXMemoryValue is a weird name; inline variables. currentUserMemory.get() below</technical_language>

Target:
public void updateMemoryUsage(long deltaUserMemoryInBytes, long deltaTotalMemoryInBytes) { currentUserMemory.addAndGet(deltaUserMemoryInBytes); currentTotalMemory.addAndGet(deltaTotalMemoryInBytes); peakUserMemory.updateAndGet(currentPeakValue -> Math.max(currentUserMemory.get(), currentPeakValue)); peakTotalMemory.updateAndGet(currentPeakValue -> Math.max(currentTotalMemory.get(), currentPeakValue)); }
Source:
<code>public void registerAllMenuMusic() { Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:musicConfig"); for (ResourceUrn configUrn : configUrnList) { String urn = configUrn.toString(); Json musicJson = Assets.getJson(urn); JSONObject musicNode = musicJson.getJsonValue(); <START> for (Object o : musicNode.getJSONArray("menuMusic")) { <END> if (!(o instanceof String)) break; String music = (String) o; registerMusic(MENU_MUSIC_SET, urn.split(":")[0] + ":" + music); } } }</code><technical_language>Object o</technical_language>

Target:
public void registerAllMenuMusic() { Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:musicConfig"); for (ResourceUrn configUrn : configUrnList) { String urnString = configUrn.toString(); Json musicJson = Assets.getJson(urnString); JSONObject musicNode = musicJson.getJsonValue(); for (Object musicFileName : musicNode.getJSONArray("menuMusic")) { if (!(musicFileName instanceof String)) break; String music = (String) musicFileName; registerMusic(MENU_MUSIC_SET, urnString.split(":")[0] + ":" + music); } } }
Source:
<code><START> public boolean initialize() { <END> return initHelper(rootFile); }</code><technical_language>try public methods top. Method order is public, protected, package-private, private</technical_language>

Target:
public void initialize() throws IllegalStateException { initChildEntries(rootFile); serializer.store(rootFile.getName(), rootFile); }
Source:
<code>private ClusterNetworkModel getGlusterNetwork() { if (!isMultiCluster()) { <START> for (ClusterNetworkModel clusterNetworkManageModel : getItems()) { <END> if (clusterNetworkManageModel.isGlusterNetwork()) { return clusterNetworkManageModel; } } } return null; }</code><technical_language>reason iterate models time - iterate ClusterNetworkManageModel is populated, up-to-date reference gluster network (as is done for management network). If change this, reason !isMultiCluster() check - this return null in case this isMultiCluster() (not invocation sense in case)</technical_language>

Target:
private ClusterNetworkModel getGlusterNetwork() { return glusterNetwork; }
Source:
<code>private String modelToString(Model model, RDFFormat format, Context context) { <START> ByteArrayOutputStream o = new ByteArrayOutputStream(); <END> RDFWriter.create().source(baseTestData).format(format).base(base).context(context).output(o); String result = Bytes.bytes2string(o.toByteArray()); return result; }</code><technical_language>try-with-resources close later? Test I matter much</technical_language>

Target:
private String modelToString(Model model, RDFFormat format, Context context) { try(ByteArrayOutputStream o = new ByteArrayOutputStream()) { RDFWriter.create().source(baseTestData).format(format).base(base).context(context).output(o); String result = Bytes.bytes2string(o.toByteArray()); return result; } catch (IOException ex) { IO.exception(ex); return null;} }
Source:
<code>public boolean asBoolean() { <START> if (length != 1) <END> notBoolean(); return bytes[offset] == 'Y'; }</code><technical_language>Is this a sufficient check a boolean? notBoolean notChar meaningful other sanity checks (notDigit etc). thinking sanity checks add</technical_language>

Target:
public boolean asBoolean() { if (length != 1) notBoolean(); return bytes[offset] == YES; }
Source:
<code>public void testOldXSDNaming() { <START> testOldXSDNaming.expectMessage(Matchers.containsString("Found v5 XSD: '<LINK_1>'. Expected v6 XSD: '<LINK_0>'")); <END> testOldXSDNaming.expect(MappingException.class); DozerBeanMapper mapper = new DozerBeanMapper(Arrays.asList("non-strict/v5-xsd.xml")); mapper.getMappingMetadata(); }</code><technical_language>question styling. This line is long, I noticed long lines (>120 characters) Dozer code. Is planned adopt line length convention for project? IMO, lines longer 120 characters hard read, especially a laptop screen</technical_language>

Target:
public void testOldXSDNaming() { testOldXSDNaming.expectMessage(Matchers.containsString(message)); testOldXSDNaming.expect(MappingException.class); DozerBeanMapper mapper = new DozerBeanMapper(Arrays.asList("non-strict/v5-xsd.xml")); mapper.getMappingMetadata(); }
Source:
<code>public boolean apply(String serverId) { checkNotNull(serverId, "serverId"); logger.trace("looking for state on Server %s", serverId); final Server server = api.getServer(serverId); if (server == null) { throw new IllegalStateException(MessageFormat.format("Server {0} is not found", serverId)); } <START> return server.guest().vmTools().runningStatus().equals(VmTools.RunningStatus.RUNNING); <END> }</code><technical_language>vmTools field is nullable. Protect this a NPE</technical_language>

Target:
public boolean apply(String serverId) { checkNotNull(serverId, "serverId"); logger.trace("looking for state on Server %s", serverId); final Server server = api.getServer(serverId); if (server == null) { throw new IllegalStateException(MessageFormat.format("Server {0} is not found", serverId)); } final VmTools vmTools = server.guest().vmTools(); return vmTools != null && vmTools.runningStatus().equals(VmTools.RunningStatus.RUNNING); }
Source:
<code>private void processDirective(final Gff3Directive directive, final Object decodedResult) { switch (directive) { case VERSION3_DIRECTIVE: break; case SEQUENCE_REGION_DIRECTIVE: final SequenceRegion newRegion = (SequenceRegion) decodedResult; if (sequenceRegionMap.containsKey(newRegion.getContig())) { throw new TribbleException("directive for sequence-region " + newRegion.getContig() + " included more than once."); } sequenceRegionMap.put(newRegion.getContig(), newRegion); break; case FLUSH_DIRECTIVE: prepareToFlushFeatures(); break; case FASTA_DIRECTIVE: reachedFasta = true; break; default: <START> throw new IllegalArgumentException( "directive " + directive + " not handled by parser."); <END> } }</code><technical_language>This a TribbleException of some sort. want add a GffFormatException subtype similar in places file is invalid. other types of legal directives choose handle here, in case error message a bit more verbose clear</technical_language>

Target:
private void processDirective(final Gff3Directive directive, final Object decodedResult) { switch (directive) { case VERSION3_DIRECTIVE: break; case SEQUENCE_REGION_DIRECTIVE: final SequenceRegion newRegion = (SequenceRegion) decodedResult; if (sequenceRegionMap.containsKey(newRegion.getContig())) { throw new TribbleException("directive for sequence-region " + newRegion.getContig() + " included more than once."); } sequenceRegionMap.put(newRegion.getContig(), newRegion); break; case FLUSH_DIRECTIVE: prepareToFlushFeatures(); break; case FASTA_DIRECTIVE: reachedFasta = true; break; default: throw new IllegalArgumentException( "Directive " + directive + " has been added to Gff3Directive, but is not being handled by Gff3Codec::processDirective. This is a BUG."); } }
Source:
<code>public <START> @Nullable String <END> getRemoteBranchName() { return remoteBranchName; }</code><technical_language>Move a separate commit</technical_language>

Target:
public String getRemoteBranchName() { return remoteBranchName; }
Source:
<code>protected void initChannel(SocketChannel channel) throws Exception { channel.attr(Message.CODEC_REGISTRY_ATTRIBUTE_KEY).set(codecRegistry); ChannelPipeline pipeline = channel.pipeline(); if (sslOptions != null) { <START> InetSocketAddress addr = new InetSocketAddress(connection.address.getAddress(), connection.address.getPort()); <END> pipeline.addLast("ssl", sslOptions.newSSLHandler(channel, addr)); } pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); if (compressor != null) { pipeline.addLast("frameDecompressor", new Frame.Decompressor(compressor)); pipeline.addLast("frameCompressor", new Frame.Compressor(compressor)); } pipeline.addLast("messageDecoder", messageDecoder); pipeline.addLast("messageEncoder", messageEncoderFor(protocolVersion)); pipeline.addLast("idleStateHandler", idleStateHandler); pipeline.addLast("dispatcher", connection.dispatcher); nettyOptions.afterChannelInitialized(channel); }</code><technical_language>InetSocketAddress addr = connection.address</technical_language>

Target:
protected void initChannel(SocketChannel channel) throws Exception { channel.attr(Message.CODEC_REGISTRY_ATTRIBUTE_KEY).set(codecRegistry); ChannelPipeline pipeline = channel.pipeline(); if (sslOptions != null) { if (sslOptions instanceof AddressAwareSSLOptions) { pipeline.addLast("ssl", ((AddressAwareSSLOptions)sslOptions).newSSLHandler(channel, connection.address)); } else { pipeline.addLast("ssl", sslOptions.newSSLHandler(channel)); } } pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); if (compressor != null) { pipeline.addLast("frameDecompressor", new Frame.Decompressor(compressor)); pipeline.addLast("frameCompressor", new Frame.Compressor(compressor)); } pipeline.addLast("messageDecoder", messageDecoder); pipeline.addLast("messageEncoder", messageEncoderFor(protocolVersion)); pipeline.addLast("idleStateHandler", idleStateHandler); pipeline.addLast("dispatcher", connection.dispatcher); nettyOptions.afterChannelInitialized(channel); }
Source:
<code>public Response getConfigStatus(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language, @PathParam("thingUID") @ApiParam(value = "thing") String thingUID) throws IOException { ThingUID thingUIDObject = new ThingUID(thingUID); Thing thing = thingRegistry.get(thingUIDObject); if (null == thing) { <START> logger.info("Received HTTP PUT request for thing config status at '{}' for the unknown thing '{}'.", <END> uriInfo.getPath(), thingUID); return getThingNotFoundResponse(thingUID); } ConfigStatusInfo info = configStatusService.getConfigStatus(thingUID, LocaleUtil.getLocale(language)); if (info != null) { return Response.ok().entity(info.getConfigStatusMessages()).build(); } return Response.ok().entity(Collections.EMPTY_SET).build(); }</code><technical_language>"HTTP PUT request" a "HTTP GET request"</technical_language>

Target:
public Response getConfigStatus(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language, @PathParam("thingUID") @ApiParam(value = "thing") String thingUID) throws IOException { ThingUID thingUIDObject = new ThingUID(thingUID); Thing thing = thingRegistry.get(thingUIDObject); if (null == thing) { logger.info("Received HTTP GET request for thing config status at '{}' for the unknown thing '{}'.", uriInfo.getPath(), thingUID); return getThingNotFoundResponse(thingUID); } ConfigStatusInfo info = configStatusService.getConfigStatus(thingUID, LocaleUtil.getLocale(language)); if (info != null) { return Response.ok().entity(info.getConfigStatusMessages()).build(); } return Response.ok().entity(Collections.EMPTY_SET).build(); }
Source:
<code><START> public RealmEventStreamAsyncTask<DocumentT> watchAsync(final BsonValue... ids) { <END> return new RealmEventStreamAsyncTaskImpl<>(getNamespace().getFullName(), new RealmEventStreamAsyncTaskImpl.Executor<DocumentT>() { @Override public EventStream<DocumentT> run() throws IOException { return osMongoCollection.watch(ids); } }); }</code><technical_language>previous automatic argument conversion</technical_language>

Target:
public RealmEventStreamAsyncTask<DocumentT> watchAsync(final BsonValue... ids) { return new RealmEventStreamAsyncTaskImpl<>(getNamespace().getFullName(), new RealmEventStreamAsyncTaskImpl.Executor<DocumentT>() { @Override public EventStream<DocumentT> run() throws IOException { return osMongoCollection.watch(Arrays.asList(ids)); } }); }
Source:
<code>public void generateTempWpaSupplicantConf() throws KuraException { try { <START> String fileAsString = readResource("/src/main/resources/wifi/wpasupplicant.conf"); <END> File outputFile = new File(TMP_WPA_CONFIG_FILE); copyFile(fileAsString, outputFile); } catch (Exception e) { throw KuraException.internalError("Failed to generate wpa_supplicant.conf"); } }</code><technical_language>this file path extracted a constant</technical_language>

Target:
public void generateTempWpaSupplicantConf() throws KuraException { try { String fileAsString = readResource(WPA_SUPPLICANT_CONF_RESOURCE); File outputFile = new File(TMP_WPA_CONFIG_FILE); copyFile(fileAsString, outputFile); } catch (Exception e) { throw KuraException.internalError("Failed to generate wpa_supplicant.conf"); } }
Source:
<code>public static boolean isTestModeEnabled(Context context, Network network) { ConnectivityManager connectManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkCapabilities <START> networkCapabilities = <END> connectManager.getNetworkCapabilities(network); return networkCapabilities.hasCapability(NETWORK_CAPABILITY_TRANSPORT_TEST); }</code><technical_language>this null? If so, end throwing exception here. matter else crash eventually? binding a socket network</technical_language>

Target:
public static boolean isTestModeEnabled(Context context, Network network) { ConnectivityManager connectManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkCapabilities networkCapabilities = connectManager.getNetworkCapabilities(network); if (networkCapabilities == null) { return false; } return networkCapabilities.hasCapability(NETWORK_CAPABILITY_TRANSPORT_TEST); }
Source:
<code>public void write(JsonGenerator jg, DocumentModel enriched) throws IOException { <START> jg.writeStringField("shouldnot", "bethere"); <END> throw new IOException("Simulated exception for test purpose"); }</code><technical_language>simulate a failure incomplete content I do jg.writeFieldName("justfieldname"); jg.flush() result is invalid</technical_language>

Target:
public void write(JsonGenerator jg, DocumentModel enriched) throws IOException { jg.writeFieldName("justAFieldName"); jg.flush(); throw new IOException("Simulated exception for test purpose"); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { chain.doFilter(request, response); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; final boolean esSync = Boolean.parseBoolean(httpRequest.getHeader(ES_SYNC_FLAG)) <START> || Boolean.parseBoolean(httpRequest.getHeader(ES_SYNC_FLAG.replace("-", "_"))); <END> if (!esSync) { chain.doFilter(request, response); return; } ElasticSearchInlineListener.useSyncIndexing.set(true); try { chain.doFilter(request, response); } finally { ElasticSearchInlineListener.useSyncIndexing.set(false); } }</code><technical_language>prefer a constant ES_SYNC_FLAG_COMPAT = "nx_es_sync" helps grep code</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { chain.doFilter(request, response); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; final boolean esSync = Boolean.parseBoolean(httpRequest.getHeader(ES_SYNC_FLAG)) || Boolean.parseBoolean(httpRequest.getHeader(ES_SYNC_FLAG_COMPAT)); if (!esSync) { chain.doFilter(request, response); return; } ElasticSearchInlineListener.useSyncIndexing.set(true); try { chain.doFilter(request, response); } finally { ElasticSearchInlineListener.useSyncIndexing.set(false); } }
Source:
<code>public void dump() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry: loadedEntries.values()) { if (entry.extension != null) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); log.info(String.format( "Instance name: '%1$s', Extension name: '%2$s', Version: '%3$s', License: '%4$s', Home: '%5$s', Author '%6$s', File: '%7$s'", emptyIfNull(context.get(ExtensionProperties.NAME)), emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), <START> emptyIfNull(entry.file) <END> ) ); } } log.info("End of enabled extensions list"); }</code><technical_language>getFileName</technical_language>

Target:
public void dump() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry : activatedEntries.values()) { if (entry.extension != null) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); log.info(String.format( "Instance name: '%1$s', Extension name: '%2$s', Version: '%3$s', License: '%4$s', Home: '%5$s', Author '%6$s', File: '%7$s'", emptyIfNull(context.get(ExtensionProperties.NAME)), emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(getFileName(entry.file)) ) ); } } log.info("End of enabled extensions list"); }