auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ContextMenu setupContextMenu() { markAsReadUnreadMenuItem.setOnAction(e -> { String menuItemText = markAsReadUnreadMenuItem.getText(); if (menuItemText.equals(markAsReadMenuItemText)) { markAsRead(); } else if (menuItemText.equals(markAsUnreadMenuItemText)) { markAsUnread(); } }); changeLabelsMenuItem.setText(changeLabelsMenuItemText); changeLabelsMenuItem.setOnAction(e -> { changeLabels(); }); markAllBelowAsReadMenuItem.setText(markAllAsReadMenuItemText); markAllBelowAsReadMenuItem.setOnAction(e -> { markAllItemsBelow(IS_READ); }); markAllBelowAsUnreadMenuItem.setText(markAllAsUnreadMenuItemText); markAllBelowAsUnreadMenuItem.setOnAction(e -> { markAllItemsBelow(!IS_READ); }); contextMenu.getItems().addAll(markAsReadUnreadMenuItem, markAllBelowAsReadMenuItem, markAllBelowAsUnreadMenuItem, changeLabelsMenuItem); contextMenu.setOnShowing(e -> updateContextMenu(contextMenu)); listView.setContextMenu(contextMenu); return contextMenu; }

Target:
private ContextMenu setupContextMenu() { markAsReadUnreadMenuItem.setOnAction(e -> { String menuItemText = markAsReadUnreadMenuItem.getText(); if (menuItemText.equals(markAsReadMenuItemText)) { markAsRead(); } else if (menuItemText.equals(markAsUnreadMenuItemText)) { markAsUnread(); } }); changeLabelsMenuItem.setText(changeLabelsMenuItemText); changeLabelsMenuItem.setOnAction(e -> { changeLabels(); }); markAllBelowAsReadMenuItem.setText(markAllAsReadMenuItemText); markAllBelowAsReadMenuItem.setOnAction(e -> { markAllBelowAsRead(); }); markAllBelowAsUnreadMenuItem.setText(markAllAsUnreadMenuItemText); markAllBelowAsUnreadMenuItem.setOnAction(e -> { markAllBelowAsUnread(); }); contextMenu.getItems().addAll(markAsReadUnreadMenuItem, markAllBelowAsReadMenuItem, markAllBelowAsUnreadMenuItem, changeLabelsMenuItem); contextMenu.setOnShowing(e -> updateContextMenu(contextMenu)); listView.setContextMenu(contextMenu); return contextMenu; }
Source:
public boolean didImageTrigger(String imageNameTag) { if (!haveTriggersFired() || imageNameTag == null) return false; ModelNode causes = get(DEPLOYMENTCONFIG_CAUSES); for (ModelNode cause : causes.asList()) { String type = asString(cause, TYPE); if (type.equalsIgnoreCase(IMAGE_CHANGE)) { String triggerName = asString(cause, IMAGE_TRIGGER_FROM_NAME); DockerImageURI uri = new DockerImageURI(triggerName); if (imageNameTag.equals(uri.getNameAndTag())) return true; } } return false; }

Target:
public boolean didImageTrigger(String imageNameTag) { if (!haveTriggersFired() || imageNameTag == null) return false; ModelNode causes = get(DEPLOYMENTCONFIG_CAUSES); if (causes.getType() == ModelType.UNDEFINED || causes.getType() != ModelType.LIST) return false; for (ModelNode cause : causes.asList()) { String type = asString(cause, TYPE); if (type.equalsIgnoreCase(IMAGE_CHANGE)) { String triggerName = asString(cause, IMAGE_TRIGGER_FROM_NAME); DockerImageURI uri = new DockerImageURI(triggerName); if (imageNameTag.equals(uri.getNameAndTag())) return true; } } return false; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } SegmentMetadataQuery that = (SegmentMetadataQuery) o; if (merge != that.merge) { return false; } if (toInclude != null ? !toInclude.equals(that.toInclude) : that.toInclude != null) { return false; } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } SegmentMetadataQuery that = (SegmentMetadataQuery) o; if (merge != that.merge) { return false; } if (usingDefaultInterval != that.usingDefaultInterval) { return false; } return !(toInclude != null ? !toInclude.equals(that.toInclude) : that.toInclude != null); }
Source:
public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String value = item.getValue(); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); if (ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color)) { return Color.class; } ResourceUrl url = ResourceUrl.parse(value); if (item.isAttr()) { item.setValue(value); ItemResourceValue resourceValue = (ItemResourceValue) mySelectedStyle.getConfiguration().getResourceResolver().findResValue(value, false); if (resourceValue == null ) { LOG.error("Unable to resolve " + value); return null; } item = new EditedStyleItem(resourceValue, mySelectedStyle); value = item.getValue(); url = ResourceUrl.parse(value); } ResourceType urlType = null; if (url != null) { urlType = url.type; } if (urlType == ResourceType.COLOR || (value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } if (column == 1) { if (urlType == ResourceType.STYLE) { return ThemeEditorStyle.class; } if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || ((value.equals("true") || value.equals("false")) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }

Target:
public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); ResourceValue resourceValue = mySelectedStyle.getConfiguration().getResourceResolver().resolveResValue(item.getItemResourceValue()); if (resourceValue == null) { LOG.error("Unable to resolve " + item.getValue()); return null; } ResourceType urlType = resourceValue.getResourceType(); if (urlType == ResourceType.STYLE && column == 1) { return ThemeEditorStyle.class; } if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } String value = resourceValue.getValue(); if (value == null) { return String.class; } if (urlType == ResourceType.COLOR || (value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (column == 1) { if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || ((value.equals("true") || value.equals("false")) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }
Source:
private String replaceLocaleWithUSLocale(String originalString, Locale locale) { return originalString.replaceAll("/"+ locale.toLanguageTag().replaceAll("-", "\\\\-") + "|/" + locale.toString(), "/" + Locale.US.toLanguageTag()); }

Target:
private String replaceLocaleWithUSLocale(String originalString, Locale locale) { String regex = "/"+ locale.toLanguageTag().replaceAll("-", "\\\\-") + "|/" + locale.toString(); return originalString.replaceAll(regex, "/" + Locale.US.toLanguageTag()); }
Source:
public List<SQLUniqueConstraint> getUniqueConstraints(String db_name, String tbl_name) throws MetaException { try { return getUniqueConstraintsInternal(db_name, tbl_name, true, true); } catch (NoSuchObjectException e) { throw new MetaException(e.getMessage()); } }

Target:
public List<SQLUniqueConstraint> getUniqueConstraints(String db_name, String tbl_name) throws MetaException { try { return getUniqueConstraintsInternal(db_name, tbl_name, true, true); } catch (NoSuchObjectException e) { throw new MetaException(ExceptionUtils.getStackTrace(e)); } }
Source:
private void tryUpdateCache(String currentVersion) throws Exception { boolean updatedCacheSuccessfully = false; VersionedCache newVersionedCache = null; try { newVersionedCache = cacheGenerator.generateCache(namespace, this, currentVersion, CacheScheduler.this ); if (newVersionedCache != null) { CacheState previousCacheState = swapCacheState(newVersionedCache); if (previousCacheState != NoCache.ENTRY_CLOSED) { updatedCacheSuccessfully = true; if (previousCacheState instanceof VersionedCache && !(newVersionedCache).incremental) { ((VersionedCache) previousCacheState).close(); } log.debug("%s: the cache was successfully updated", this); } else { newVersionedCache.close(); log.debug("%s was closed while the cache was being updated, discarding the update", this); } } else { log.debug("%s: Version `%s` not updated, the cache is not updated", this, currentVersion); } } catch (Throwable t) { try { if (newVersionedCache != null && !updatedCacheSuccessfully) { newVersionedCache.close(); } log.error(t, "Failed to update %s", this); } catch (Exception e) { t.addSuppressed(e); } if (Thread.currentThread().isInterrupted() || t instanceof InterruptedException || t instanceof Error) { throw t; } } }

Target:
private void tryUpdateCache(String currentVersion) throws Exception { boolean updatedCacheSuccessfully = false; VersionedCache newVersionedCache = null; try { newVersionedCache = cacheGenerator.generateCache(namespace, this, currentVersion, CacheScheduler.this ); if (newVersionedCache != null) { CacheState previousCacheState = swapCacheState(newVersionedCache); if (previousCacheState != NoCache.ENTRY_CLOSED) { updatedCacheSuccessfully = true; if (previousCacheState instanceof VersionedCache) { ((VersionedCache) previousCacheState).close(); } log.debug("%s: the cache was successfully updated", this); } else { newVersionedCache.close(); log.debug("%s was closed while the cache was being updated, discarding the update", this); } } else { log.debug("%s: Version `%s` not updated, the cache is not updated", this, currentVersion); } } catch (Throwable t) { try { if (newVersionedCache != null && !updatedCacheSuccessfully) { newVersionedCache.close(); } log.error(t, "Failed to update %s", this); } catch (Exception e) { t.addSuppressed(e); } if (Thread.currentThread().isInterrupted() || t instanceof InterruptedException || t instanceof Error) { throw t; } } }
Source:
public void regenerateCertificatesOf(String productId, boolean lazy) { if (lazy) { poolCurator.markCertificatesDirtyForProductId(productId); } else { List<Pool> poolsForProduct = this.listAvailableEntitlementPools(null, null, null, productId, new Date(), false, false, new PoolFilterBuilder(), null, false, false) .getPageData(); for (Pool pool : poolsForProduct) { regenerateCertificatesOf(pool.getEntitlements(), lazy); } } }

Target:
public void regenerateCertificatesOf(String productId, boolean lazy) { if (lazy) { poolCurator.markCertificatesDirtyForProductId(productId); } else { List<Pool> poolsForProduct = this.listAvailableEntitlementPools(null, null, null, productId, new Date(), false, false, new PoolFilterBuilder(), null, false, false) .getPageData(); for (Pool pool : poolsForProduct) { regenerateCertificatesOf(pool.getEntitlements(), false); } } }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL.toString())); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new DisableDepthTest()); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); initMainDirectionalLight(); displayResolutionDependentFBOs.subscribe(this); }

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL.toString())); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new DisableDepthTest()); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); initMainDirectionalLight(); }
Source:
public int reOpenChannel(Integer channelId, String newSecWebSocketKey, boolean followRedirects, boolean useSessionState) throws IllegalArgumentException, RequestOutOfScopeException, IOException { WebSocketProxy connectionToEstablish = getWebSocketProxy(channelId); HandshakeConfig handshakeConfig; try { handshakeConfig = connectionToEstablish.getHandShakeConfig(); }catch (IllegalArgumentException e){ throw e; } handshakeConfig.setFollowRedirects(followRedirects); handshakeConfig.setUseSessionState(useSessionState); if(newSecWebSocketKey != null){ HttpHandshakeBuilder.setWebSocketKey(handshakeConfig.getHttpMessage().getRequestHeader(), newSecWebSocketKey); }else{ HttpHandshakeBuilder.setGeneratedWebSocketKey(handshakeConfig.getHttpMessage().getRequestHeader()); } WebSocketProxy newWebSocketConnection = connectionToEstablish.reEstablishConnection(handshakeConfig); addHistoryReference(handshakeConfig.getHttpMessage(), newWebSocketConnection); return newWebSocketConnection != null ? newWebSocketConnection.getChannelId() : -1; }

Target:
public int reOpenChannel(Integer channelId, String newSecWebSocketKey, boolean followRedirects, boolean useSessionState) throws RequestOutOfScopeException, IOException { WebSocketProxy connectionToEstablish = getWebSocketProxy(channelId); HandshakeConfig handshakeConfig; handshakeConfig = connectionToEstablish.getHandShakeConfig(); handshakeConfig.setFollowRedirects(followRedirects); handshakeConfig.setUseSessionState(useSessionState); if(newSecWebSocketKey != null){ HttpHandshakeBuilder.setWebSocketKey(handshakeConfig.getHttpMessage().getRequestHeader(), newSecWebSocketKey); }else{ HttpHandshakeBuilder.setGeneratedWebSocketKey(handshakeConfig.getHttpMessage().getRequestHeader()); } WebSocketProxy newWebSocketConnection = connectionToEstablish.reEstablishConnection(handshakeConfig); addHistoryReference(handshakeConfig.getHttpMessage(), newWebSocketConnection); return newWebSocketConnection != null ? newWebSocketConnection.getChannelId() : -1; }
Source:
public void filterTextFieldTest() { doubleClick("#dummy/dummy_col0_filterTextField"); push(KeyCode.BACK_SPACE); type("(is:open OR is:closed)"); push(KeyCode.ENTER); }

Target:
public void filterTextFieldTest() { doubleClick("#dummy/dummy_col0_filterTextField"); push(KeyCode.BACK_SPACE); type("is:open OR is:closed"); push(KeyCode.ENTER); FilterTextField filterTextField = find("#dummy/dummy_col0_filterTextField"); filterTextField.clear(); click("#dummy/dummy_col0_filterTextField"); type("!@#$%^&*( ) { } :?"); assertEquals("!@#$%^&*( ) { } :?", filterTextField.getText()); }
Source:
private Void updatePropertiesFile() { String etcDir = getProperty(KARAF_ETC); String systemPropertyFilename = etcDir + File.separator + SYSTEM_PROPERTIES_FILE; File systemPropertiesFile = new File(systemPropertyFilename); try { Properties systemDotProperties = new Properties(systemPropertiesFile); systemDotProperties.setProperty(SOLR_PASSWORD_PROPERTY_NAME, newPasswordWrappedEncrypted); systemDotProperties.save(); passwordSavedSuccessfully = true; String msg = String.format( "Updated encrypted Solr password in properties file %s.", systemPropertyFilename); SecurityLogger.audit(msg); LOGGER.info(msg); } catch (IOException e) { String msgFail = String.format( "Exception while writing to %s. Solr password was changed, but new password was not saved.", systemPropertyFilename); LOGGER.error(msgFail); SecurityLogger.audit(msgFail); } return null; }

Target:
private Void updatePropertiesFile() { String etcDir = getProperty(KARAF_ETC); String systemPropertyFilename = etcDir + File.separator + SYSTEM_PROPERTIES_FILE; File systemPropertiesFile = new File(systemPropertyFilename); try { Properties systemDotProperties = new Properties(systemPropertiesFile); systemDotProperties.setProperty(SOLR_PASSWORD_PROPERTY_NAME, newPasswordWrappedEncrypted); systemDotProperties.save(); passwordSavedSuccessfully = true; String msg = String.format( "Updated encrypted Solr password in properties file %s.", systemPropertyFilename); SecurityLogger.audit(msg); LOGGER.info(msg); } catch (IOException e) { String msgFail = String.format( "Exception while writing to %s. Solr password was changed, but new password was not saved. The application cannot communicate with Solr until the password is restored.", systemPropertyFilename); LOGGER.error(msgFail); SecurityLogger.audit(msgFail); } return null; }
Source:
public Map<String, Object> currentState() { return null; }

Target:
public Map<String, Object> currentState() { return new HashMap<>(); }
Source:
private PollingContext(PollResponse<T> activationResponse, PollResponse<T> latestResponse, Map<String, String> map) { this.activationResponse = Objects.requireNonNull(activationResponse, "'activationResponse' cannot be null."); this.latestResponse = Objects.requireNonNull(latestResponse, "'latestResponse' cannot be null."); this.map = map; }

Target:
private PollingContext(PollResponse<T> activationResponse, PollResponse<T> latestResponse, Map<String, String> map) { this.activationResponse = Objects.requireNonNull(activationResponse, "'activationResponse' cannot be null."); this.latestResponse = Objects.requireNonNull(latestResponse, "'latestResponse' cannot be null."); this.map = Objects.requireNonNull(map, "'map' cannot be null."); }
Source:
private static int checkResponseCode(String responseCode, String method){ if ("403".equalsIgnoreCase(responseCode)) { Log.w(TAG, "CommonSense" + method + "refused! Response: forbidden!"); return -3; } else if ("201".equalsIgnoreCase(responseCode)) { Log.e(TAG, "CommonSense" + method + "created! Response: " + responseCode); return -2; } else if (!"200".equalsIgnoreCase(responseCode)) { Log.w(TAG, "CommonSense" + method + "failed! Response: " + responseCode); return -1; } else { Log.e(TAG, "CommonSense" + method + "OK! "); return 0; } }

Target:
private static int checkResponseCode(String responseCode, String method){ if ("403".equalsIgnoreCase(responseCode)) { Log.w(TAG, "CommonSense" + method + "refused! Response: forbidden!"); return -2; } else if ("201".equalsIgnoreCase(responseCode)) { Log.e(TAG, "CommonSense" + method + "created! Response: " + responseCode); return 1; } else if (!"200".equalsIgnoreCase(responseCode)) { Log.w(TAG, "CommonSense" + method + "failed! Response: " + responseCode); return -1; } else { Log.e(TAG, "CommonSense" + method + "OK! "); return 0; } }
Source:
public void checkoutBranch(@ScriptParameter(defaultValue = NULL) Object repository, @ScriptParameter(defaultValue = NULL) final String branchName) { try { Ref branchRef = ((Repository) repository).findRef(branchName); BranchOperationUI.checkout((Repository) repository, branchRef.getName()).start(); } catch (IOException e) { Activator.logError("Failed to checkout branch " + branchName, e); } }

Target:
public void checkoutBranch(@ScriptParameter(defaultValue = NULL) Object repository, @ScriptParameter(defaultValue = NULL) final String branchName) { try { final Ref branchRef = ((Repository) repository).findRef(branchName); BranchOperationUI.checkout((Repository) repository, branchRef.getName()).start(); } catch (final IOException e) { Logger.error(PLUGIN_ID, "Failed to checkout branch " + branchName, e); } }
Source:
private String createMacAddress(String value) { StringBuilder builder = new StringBuilder(); for (int j = 0; j < value.length(); j += 2) { String group = value.substring(j, j + 2); if (j == 0) { if (StringUtils.contains(MAC_ADDRESS_MULTICAST_MSB, group.charAt(1))) { return null; } } builder.append(group); builder.append(":"); } builder.deleteCharAt(builder.length() - 1); return builder.toString(); }

Target:
private String createMacAddress(String value) { StringBuilder builder = new StringBuilder(); for (int j = 0; j < value.length(); j += 2) { String group = value.substring(j, j + 2); if (j == 0 && StringUtils.contains(MAC_ADDRESS_MULTICAST_LSB, group.charAt(1))) { return null; } builder.append(group); if (j + 2 < value.length()) { builder.append(":"); } } return builder.toString(); }
Source:
protected String visitSimpleCaseExpression(SimpleCaseExpression node, @Nullable List<Expression> parameters) { ArrayList<String> parts = new ArrayList<>(); parts.add("CASE"); parts.add(node.getOperand().accept(this, parameters)); for (WhenClause whenClause : node.getWhenClauses()) { parts.add(whenClause.accept(this, parameters)); } if (node.getDefaultValue() != null) { parts.add("ELSE"); parts.add(node.getDefaultValue().accept(this, parameters)); } parts.add("END"); return "(" + Lists2.joinOn(" ", parts, x -> x) + ")"; }

Target:
protected String visitSimpleCaseExpression(SimpleCaseExpression node, @Nullable List<Expression> parameters) { var parts = new StringJoiner(" ", "(", ")"); parts.add("CASE"); parts.add(node.getOperand().accept(this, parameters)); for (WhenClause whenClause : node.getWhenClauses()) { parts.add(whenClause.accept(this, parameters)); } if (node.getDefaultValue() != null) { parts.add("ELSE"); parts.add(node.getDefaultValue().accept(this, parameters)); } parts.add("END"); return parts.toString(); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); if (!m_compTasks.isEmpty()){ for (Pair<CompleteTransactionTask, Boolean> pair : m_compTasks.values()) builder.append("CompleteTransactionTasks: " + pair); builder.append("\n"); } if (m_fragTask != null) { builder.append("FragmentTask: " + m_fragTask); } return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); if (!m_compTasks.isEmpty()){ builder.append("CompleteTransactionTasks: "); for (Pair<CompleteTransactionTask, Boolean> pair : m_compTasks.values()) { builder.append("\n" + pair); } } if (m_fragTask != null) { builder.append("\nFragmentTask: " + m_fragTask); } return builder.toString(); }
Source:
private Map<String, DbParameterAccessor> readIntoParams(String objname, String query) throws SQLException { DbParameterAccessorsMapBuilder params = new DbParameterAccessorsMapBuilder(); objname = objname.replaceAll("[^a-zA-Z0-9_.#]", ""); String[] qualifiers = objname.split("\\."); String bracketedName = ""; for (int i = 0; i < qualifiers.length; i++) { if (i > 0) { bracketedName += "."; } bracketedName += "[" + qualifiers[i] + "]"; } try (PreparedStatement dc = currentConnection.prepareStatement(query)) { dc.setString(1, bracketedName); ResultSet rs = dc.executeQuery(); while (rs.next()) { String paramName = defaultIfNull(rs.getString(1), ""); params.add(paramName, getParameterDirection(rs.getInt(4), paramName), getSqlType(rs.getString(2)), getJavaClass(rs.getString(2))); } } return params.toMap(); }

Target:
private Map<String, DbParameterAccessor> readIntoParams(String objname, String query) throws SQLException { DbParameterAccessorsMapBuilder params = new DbParameterAccessorsMapBuilder(); objname = objname.replaceAll("[^a-zA-Z0-9_.#]", ""); String bracketedName = enquoteAndJoin(objname.split("\\."), ".", "[", "]"); try (PreparedStatement dc = currentConnection.prepareStatement(query)) { dc.setString(1, bracketedName); ResultSet rs = dc.executeQuery(); while (rs.next()) { String paramName = defaultIfNull(rs.getString(1), ""); params.add(paramName, getParameterDirection(rs.getInt(4), paramName), getSqlType(rs.getString(2)), getJavaClass(rs.getString(2))); } } return params.toMap(); }
Source:
public void testFindAssociatedNotLinkedFilesSuccess() throws Exception { when(databaseContext.getFileDirectoriesAsPaths(any())).thenReturn(Collections.singletonList(path.getParent())); when(externalFileTypes.getExternalFileTypeSelection()).thenReturn(new TreeSet<>(ExternalFileTypes.getDefaultExternalFileTypes())); List<LinkedFile> expected = Collections.singletonList(new LinkedFile("", "CiteKey.pdf", "")); AutoSetFileLinksUtil util = new AutoSetFileLinksUtil(databaseContext, fileDirPrefs, autoLinkPrefs, externalFileTypes); List<LinkedFile> actual = util.findAssociatedNotLinkedFiles(entry); assertEquals(expected, actual); }

Target:
public void testFindAssociatedNotLinkedFilesSuccess() throws Exception { when(databaseContext.getFileDirectoriesAsPaths(any())).thenReturn(Collections.singletonList(path.getParent())); List<LinkedFile> expected = Collections.singletonList(new LinkedFile("", "CiteKey.pdf", "")); AutoSetFileLinksUtil util = new AutoSetFileLinksUtil(databaseContext, fileDirPrefs, autoLinkPrefs, externalFileTypes); List<LinkedFile> actual = util.findAssociatedNotLinkedFiles(entry); assertEquals(expected, actual); }
Source:
public abstract Ref getRef(String name) throws IOException; @Nullable public final Ref findRef(String name) throws IOException { String[] names = new String[SEARCH_PATH.length]; for (int i = 0; i < SEARCH_PATH.length; i++) { names[i] = SEARCH_PATH[i] + name; } return firstExactRef(names); }

Target:
public final Ref getRef(String name) throws IOException { return findRef(name); }
Source:
public void verifyUserLoggedIn(final String userName) { changeImplicitWait(250, TimeUnit.MILLISECONDS); try { if (driver.findElements(By.cssSelector("#PreviewFrame")).size() > 0) { driver.switchTo().frame("PreviewFrame"); } waitFor.until(new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { if (driver.findElement(By.tagName("body")).getAttribute("class") .contains("skin-monobook")) { return driver.findElements( By.cssSelector(loggedInUserSelectorMonobook.replace("%userName%", userName.replace(" ", "_")))).size() > 0; } else if (driver.findElement(By.tagName("body")).getAttribute("class") .contains("ember-application")) { return true; } else { return driver.findElements( By.cssSelector(LOGGED_IN_USER_SELECTOR_VENUS.replace("%userName%", userName))) .size() > 0; } } catch (StaleElementReferenceException e) { return false; } } }); } finally { restoreDeaultImplicitWait(); driver.switchTo().defaultContent(); } PageObjectLogging.log("verifyUserLoggedIn", "user " + userName + " logged in", true); }

Target:
public void verifyUserLoggedIn(final String userName) { changeImplicitWait(250, TimeUnit.MILLISECONDS); try { if (driver.findElements(By.cssSelector("#PreviewFrame")).size() > 0) { driver.switchTo().frame("PreviewFrame"); } waitFor.until(new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { if (driver.findElement(By.tagName("body")).getAttribute("class") .contains("skin-monobook")) { return driver.findElements( By.cssSelector(loggedInUserSelectorMonobook.replace("%userName%", userName.replace(" ", "_")))).size() > 0; } else { return driver.findElements( By.cssSelector(LOGGED_IN_USER_SELECTOR_VENUS.replace("%userName%", userName))) .size() > 0; } } catch (StaleElementReferenceException e) { return false; } } }); } finally { restoreDeaultImplicitWait(); driver.switchTo().defaultContent(); } PageObjectLogging.log("verifyUserLoggedIn", "user " + userName + " logged in", true); }
Source:
private void print(String classification, String msg, Location location) { ViolationMessage violationMessage = ViolationMessage.EMPTY; try { violationMessage = new ViolationMessage(this.inputFile.getCanonicalPath(), location.line, location.column, classification, msg); } catch (IOException e) { System.err.println("Error in getting canonical path of input file: " + e.getMessage()); } this.msgBuffer.put(violationMessage.toString(), violationMessage); }

Target:
private void print(String classification, String msg, Location location) { ViolationMessage violationMessage = new ViolationMessage(location.line, location.column, classification, msg); try { violationMessage.setFilePath(this.inputFile.getCanonicalPath()); } catch (IOException e) { System.err.println("Error in getting canonical path of input file: " + e.getMessage()); } this.msgBuffer.put(violationMessage.toString(), violationMessage); }
Source:
public int complete(CommandContext ctx, String buffer, int cursor, List<String> candidates) { int offset = 0; if(ctx.getArgumentsString() != null) { offset = ctx.getArgumentsString().length(); buffer = ctx.getArgumentsString() + buffer; } final int result = doComplete(ctx, buffer, cursor, candidates); if(result < 0) { return result; } return result - offset + countTrailingSpaces(buffer, cursor); }

Target:
public int complete(CommandContext ctx, String buffer, int cursor, List<String> candidates) { int offset = 0; if(ctx.getArgumentsString() != null) { offset = ctx.getArgumentsString().length(); buffer = ctx.getArgumentsString() + buffer; } final int result = doComplete(ctx, buffer, cursor, candidates); if(result < 0) { return result; } return result - offset; }
Source:
public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3)) { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V3); SessionBindingQueryResponseMessage_V3 response = (SessionBindingQueryResponseMessage_V3) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), response.isAutoCreateJmsTopics()); } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2)) { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V2); SessionBindingQueryResponseMessage_V2 response = (SessionBindingQueryResponseMessage_V2) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), false); } else { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP); SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false); } }

Target:
public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3, getServerVersion())) { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V3); SessionBindingQueryResponseMessage_V3 response = (SessionBindingQueryResponseMessage_V3) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), response.isAutoCreateJmsTopics()); } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2, getServerVersion())) { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V2); SessionBindingQueryResponseMessage_V2 response = (SessionBindingQueryResponseMessage_V2) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), false); } else { Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP); SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) packet; return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false); } }
Source:
private boolean enrichMapDataObjectsToInputColumnsByName(List<ConfiguredPropertyDescriptor> inputColProperties, ProcessStatelessInput input) { if(inputColProperties.isEmpty()) { return false; } if(input.data.isArray()) { for(JsonNode item: input.data) { if(!item.isObject()) { return false; } } } else if(input.data.isObject()) { } else { return false; } JsonNodeFactory json = Serializator.getJacksonObjectMapper().getNodeFactory(); if(input.data.isArray()) { int i = 0; for(JsonNode item: input.data) { ((ArrayNode)input.data).set(i++, mapDataObjectToInputColumnsByName(item, inputColProperties)); } } else { input.data = json.arrayNode().add(mapDataObjectToInputColumnsByName(input.data, inputColProperties)); } if(input.configuration == null) { input.configuration = new ComponentConfiguration(); } int i = 1; for(ConfiguredPropertyDescriptor inputCol: inputColProperties) { String colName = "c" + i++; input.configuration.getProperties().put(inputCol.getName(), json.textNode(colName)); input.configuration.getColumns().add(json.textNode(colName)); } return true; }

Target:
private boolean enrichMapDataObjectsToInputColumnsByName(List<ConfiguredPropertyDescriptor> inputColProperties, ProcessStatelessInput input) { if (inputColProperties.isEmpty()) { return false; } if (input.data.isArray()) { for (JsonNode item: input.data) { if (!item.isObject()) { return false; } } } else if (input.data.isObject()) { } else { return false; } final JsonNodeFactory json = Serializator.getJacksonObjectMapper().getNodeFactory(); if (input.data.isArray()) { final ArrayNode inputData = (ArrayNode)input.data; for (int i = 0; i < inputData.size(); i++) { inputData.set(i++, mapDataObjectToInputColumnsByName(inputData.get(i), inputColProperties)); } } else { input.data = json.arrayNode().add(mapDataObjectToInputColumnsByName(input.data, inputColProperties)); } if (input.configuration == null) { input.configuration = new ComponentConfiguration(); } for (int i = 0; i < inputColProperties.size(); i++) { final String colName = "c" + (i + 1); input.configuration.getProperties().put(inputColProperties.get(i).getName(), json.textNode(colName)); input.configuration.getColumns().add(json.textNode(colName)); } return true; }
Source:
protected PatchLineComment execute(GerritClient client, IProgressMonitor monitor) throws GerritException { return client.saveDraft(getPatchKey(), getMessage(), getLine(), getSide(), getParentUuid(), monitor, getUuid()); }

Target:
protected PatchLineComment execute(GerritClient client, IProgressMonitor monitor) throws GerritException { return client.saveDraft(getPatchKey(), getMessage(), getLine(), getSide(), getParentUuid(), getUuid(), monitor); }
Source:
public Result apply(TableScanNode tableScan, Captures captures, Context context) { Map<ColumnHandle, List<SubfieldPath>> subfields = tableScan.getPrunedSubfieldPaths() .entrySet().stream().collect(toImmutableMap( e -> tableScan.getAssignments().get(e.getKey()), Map.Entry::getValue)); if (subfields.isEmpty()) { return Result.empty(); } Map<ColumnHandle, ColumnHandle> prunedColumns = metadata.pushdownSubfieldPruning(context.getSession(), tableScan.getTable(), subfields); if (prunedColumns.isEmpty()) { return Result.empty(); } Map<Symbol, ColumnHandle> newAssignments = tableScan.getAssignments() .entrySet() .stream() .collect(toImmutableMap(Map.Entry::getKey, e -> prunedColumns.getOrDefault(e.getValue(), e.getValue()))); TableScanNode newTableScanNode = new TableScanNode( tableScan.getId(), tableScan.getTable(), tableScan.getOutputSymbols(), newAssignments, tableScan.getLayout(), tableScan.getCurrentConstraint(), tableScan.getEnforcedConstraint(), ImmutableMap.of()); return Result.ofPlanNode(newTableScanNode); }

Target:
public Result apply(TableScanNode tableScan, Captures captures, Context context) { Map<ColumnHandle, List<Subfield>> subfields = tableScan.getRequiredSubfieldPaths().entrySet().stream() .collect(toImmutableMap(e -> tableScan.getAssignments().get(e.getKey()), Map.Entry::getValue)); Map<ColumnHandle, ColumnHandle> prunedColumns = metadata.pushdownSubfieldPruning(context.getSession(), tableScan.getTable(), subfields); if (prunedColumns.isEmpty()) { return Result.empty(); } Map<Symbol, ColumnHandle> newAssignments = tableScan.getAssignments().entrySet().stream() .collect(toImmutableMap(Map.Entry::getKey, e -> prunedColumns.getOrDefault(e.getValue(), e.getValue()))); TableScanNode newTableScanNode = new TableScanNode( tableScan.getId(), tableScan.getTable(), tableScan.getOutputSymbols(), newAssignments, tableScan.getCurrentConstraint(), tableScan.getEnforcedConstraint(), tableScan.isTemporaryTable(), ImmutableMap.of()); return Result.ofPlanNode(newTableScanNode); }
Source:
private void createDimensions() throws JAXBException, IOException { DimensionTable dim = (DimensionTable)readFromXML("dim_table.xml"); XStorageTables storageTables = (XStorageTables)readFromXML("dim1-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table.xml and dim1-storage-tables.xml failed"); retCode = 1; } } dim = (DimensionTable)readFromXML("dim_table2.xml"); storageTables = (XStorageTables)readFromXML("dim2-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table2.xml and dim2-storage-tables.xml failed"); retCode = 1; } } dim = (DimensionTable)readFromXML("dim_table3.xml"); storageTables = (XStorageTables)readFromXML("dim3-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table.xml and dim1-storage-tables.xml failed"); retCode = 1; } } }

Target:
private void createDimensions() throws JAXBException, IOException { DimensionTable dim = (DimensionTable)readFromXML("dim_table.xml"); XStorageTables storageTables = (XStorageTables)readFromXML("dim1-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table.xml and dim1-storage-tables.xml failed"); retCode = 1; } } dim = (DimensionTable)readFromXML("dim_table2.xml"); storageTables = (XStorageTables)readFromXML("dim2-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table2.xml and dim2-storage-tables.xml failed"); retCode = 1; } } dim = (DimensionTable)readFromXML("dim_table3.xml"); storageTables = (XStorageTables)readFromXML("dim3-storage-tables.xml"); if (dim != null && storageTables != null) { result = metaClient.createDimensionTable(dim, storageTables); if (result.getStatus().equals(APIResult.Status.FAILED)) { System.out.println("Creating dim table from: dim_table3.xml and dim3-storage-tables.xml failed"); retCode = 1; } } }
Source:
public AssertingPartyDetails build() { if (this.signingMethodAlgorithms.isEmpty()) { this.signingMethodAlgorithms.add(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256); } List<String> signingMethodAlgorithmsCopy = new ArrayList(this.signingMethodAlgorithms); this.signingMethodAlgorithms.clear(); return new AssertingPartyDetails(this.entityId, this.wantAuthnRequestsSigned, this.verificationX509Credentials, this.encryptionX509Credentials, this.singleSignOnServiceLocation, this.singleSignOnServiceBinding, signingMethodAlgorithmsCopy); }

Target:
public AssertingPartyDetails build() { List<String> signingMethodAlgorithmsCopy = this.signingMethodAlgorithms.isEmpty() ? Arrays.asList(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256) : Collections.unmodifiableList(this.signingMethodAlgorithms); return new AssertingPartyDetails(this.entityId, this.wantAuthnRequestsSigned, this.verificationX509Credentials, this.encryptionX509Credentials, this.singleSignOnServiceLocation, this.singleSignOnServiceBinding, signingMethodAlgorithmsCopy); }
Source:
public <T> T deserialize(org.apache.qpid.proton.message.Message message, Class<T> clazz) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(clazz, "'clazz' cannot be null."); if (clazz == ServiceBusProperties.class) { return deserializeManagementResponse(message, clazz); } else if (clazz == Message.class) { return (T) deserializeEventData(message); } else { throw logger.logExceptionAsError(new IllegalArgumentException( "Deserialization only supports ServiceBusProperties.")); } }

Target:
public <T> T deserialize(org.apache.qpid.proton.message.Message message, Class<T> clazz) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(clazz, "'clazz' cannot be null."); if (clazz == ServiceBusReceivedMessage.class) { return (T) deserializeMessage(message); } else { throw logger.logExceptionAsError(new IllegalArgumentException( "Deserialization only supports ServiceBusReceivedMessage.")); } }
Source:
public static double theoreticalSensitivity(final double[] depthDistribution, final double[] qualityDistribution, final int sampleSize, final double logOddsThreshold, final double alleleFraction) { if (alleleFraction > 1.0 || alleleFraction < 0.0) { throw new PicardException("Allele fractions must be between 0 and 1."); } double sensitivity = 0.0; for (int k = 0; k < depthDistribution.length; k++) { if (k % 100 == 0) { log.info("Calculting sensitivity for allele fraction " + alleleFraction + " at depth " + k + " of " + depthDistribution.length); } sensitivity += sensitivityAtConstantDepth(k, qualityDistribution, logOddsThreshold, sampleSize, alleleFraction) * depthDistribution[k]; } return sensitivity; }

Target:
public static double theoreticalSensitivity(final double[] depthDistribution, final double[] qualityDistribution, final int sampleSize, final double logOddsThreshold, final double alleleFraction) { if (alleleFraction > 1.0 || alleleFraction < 0.0) { throw new PicardException("Allele fractions must be between 0 and 1."); } final double depthBinWidth = 0.01; double sensitivity = 0.0; int k = 0; double right = sensitivityAtConstantDepth(k, qualityDistribution, logOddsThreshold, sampleSize, alleleFraction); while (k < depthDistribution.length) { double width = 0.0; while (width < depthBinWidth && k < depthDistribution.length) { width += depthDistribution[k]; k++; } double left = right; right = sensitivityAtConstantDepth(k, qualityDistribution, logOddsThreshold, sampleSize, alleleFraction); sensitivity += width * (left + right) / 2.0; } return sensitivity; }
Source:
public ParametersMap put(Parameter param, Object value) { if (value == null || (value instanceof String && "".equals((String) value))) { remove(param); } else { if (!isAssignableFrom(param.getJavaType(), value.getClass())) { throw new InvalidParameterValueException(param.getName(), param.getJavaType(), value.getClass()); } paramsMap.put(param, (Serializable) value); } return this; }

Target:
public ParametersMap put(Parameter param, Object value) { if (value == null) { remove(param); } else { if (!isAssignableFrom(param.getJavaType(), value.getClass())) { throw new InvalidParameterValueException(param.getName(), param.getJavaType(), value.getClass()); } paramsMap.put(param, (Serializable) value); } return this; }
Source:
public void schedule(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs, String platform) { MultiValueMap<String, Object> values = new LinkedMultiValueMap<>(); values.add("scheduleName", scheduleName); values.add("properties", DeploymentPropertiesUtils.format(taskProperties)); values.add("taskDefinitionName", taskDefinitionName); values.add("arguments", commandLineArgs); if(platform != null) { values.add("platform", platform); } restTemplate.postForObject(schedulesLink.getHref(), values, Long.class); }

Target:
public void schedule(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs, String platform) { MultiValueMap<String, Object> values = new LinkedMultiValueMap<>(); values.add("scheduleName", scheduleName); values.add("properties", DeploymentPropertiesUtils.format(taskProperties)); values.add("taskDefinitionName", taskDefinitionName); String commandLineArgValue = new String(); boolean isFirst = true; for(String command : commandLineArgs) { if(isFirst) { isFirst = false; } else { commandLineArgValue += " "; } commandLineArgValue += command; } values.add("arguments", commandLineArgValue); if(StringUtils.hasText(platform)) { values.add("platform", platform); } restTemplate.postForObject(schedulesLink.getHref(), values, Long.class); }
Source:
private void writeSystemInfo() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } final String product = Config.getValue(ConfigValues.OriginType); final String manufacturer = OriginType.valueOf(product) == OriginType.OVIRT ? "oVirt" : "Red Hat"; writer.writeStartElement("sysinfo"); writer.writeAttributeString("type", "smbios"); writer.writeStartElement("system"); writeEntryElement("manufacturer", manufacturer); writeEntryElement("product", "KVM"); writeEntryElement("version", "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"); writeEntryElement("family", "Red Hat Enterprise Linux"); writeEntryElement("sku", "OS-VERSION:"); writeEntryElement("serial", "HOST-SERIAL:"); writeEntryElement("uuid", vm.getId().toString()); writer.writeEndElement(); writer.writeStartElement("baseBoard"); writeEntryElement("manufacturer", manufacturer); writeEntryElement("product", "RHEL-AV"); writeEntryElement("version", "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"); writeEntryElement("serial", "HOST-SERIAL:"); writer.writeEndElement(); writer.writeStartElement("chassis"); writeEntryElement("manufacturer", manufacturer); writeEntryElement("product", "KVM"); writeEntryElement("version", "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"); writer.writeEndElement(); writer.writeStartElement("processor"); writeEntryElement("manufacturer", manufacturer); writeEntryElement("product", "KVM"); writeEntryElement("version", "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"); writer.writeEndElement(); writer.writeEndElement(); }

Target:
private void writeSystemInfo() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } final String product = Config.getValue(ConfigValues.OriginType); final String manufacturer = OriginType.valueOf(product) == OriginType.OVIRT ? "oVirt" : "Red Hat"; final boolean needsBaseBoard = OriginType.valueOf(product) == OriginType.RHEV; final String productName = OriginType.valueOf(product) == OriginType.OVIRT ? "oVirt" : "RHV"; writer.writeStartElement("sysinfo"); writer.writeAttributeString("type", "smbios"); writer.writeStartElement("system"); writeEntryElement("manufacturer", manufacturer); writeEntryElement("product", productName); writeEntryElement("version", vm.getClusterCompatibilityVersion().toString()); writeEntryElement("family", "Red Hat Enterprise Linux"); writeEntryElement("sku", Config.getValue(ConfigValues.SkuToAVLevel, vm.getCompatibilityVersion().toString())); writeEntryElement("serial", "HOST-SERIAL:"); writeEntryElement("uuid", vm.getId().toString()); writer.writeEndElement(); if (needsBaseBoard) { writer.writeStartElement("baseBoard"); writeEntryElement("manufacturer", "Red Hat"); writeEntryElement("product", "RHEL-AV"); writer.writeEndElement(); } writer.writeEndElement(); }
Source:
public void setMuteReason (String reason) { if (reason.equals("")) { config.removeProperty ("muteReason"); muteReason = null; } else { muteReason = reason; config.setProperty ("muteReason", reason); } config.save(); }

Target:
public void setMuteReason(String reason) { if (reason == null) { config.removeProperty("muteReason"); muteReason = null; } else { muteReason = reason; config.setProperty("muteReason", reason); } config.save(); }
Source:
protected List<URL> listBundleComponents(Bundle bundle) { String list = getComponentsList(bundle); String name = bundle.getSymbolicName(); log.debug("PartialBundle: " + name + " components: " + list); if (list == null) { return null; } return Collections.list(new StringTokenizer(list, ", \t\n\r\f")) .stream() .map(s -> bundle.getEntry((String) s)) .filter(Objects::nonNull) .collect(Collectors.toList()); }

Target:
protected Stream<URL> listBundleComponents(Bundle bundle) { String list = OSGiRuntimeService.getComponentsList(bundle); String name = bundle.getSymbolicName(); log.debug("PartialBundle: " + name + " components: " + list); if (list == null) { return null; } return Arrays.stream(list.split("[, \t\n\r\f]")).map(s -> bundle.getEntry((String) s)).filter(Objects::nonNull); }