Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-05-04 19:46:21 +0000
committerSusan Franklin2009-05-04 19:46:21 +0000
commit659af512a734f82021d5d7a4cc6a7080d0b9b425 (patch)
tree8cb19eab3b06253495cec6523a0651c180f24dde /bundles
parent2d6a420615875b2defe986e00657c68d548b4701 (diff)
downloadrt.equinox.p2-659af512a734f82021d5d7a4cc6a7080d0b9b425.tar.gz
rt.equinox.p2-659af512a734f82021d5d7a4cc6a7080d0b9b425.tar.xz
rt.equinox.p2-659af512a734f82021d5d7a4cc6a7080d0b9b425.zip
Bug 274607 - [ui] Install New Software - trailing spaces in URL should be ignored
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositorySelectionGroup.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositorySelectionGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositorySelectionGroup.java
index b028e0b59..b2e194fa2 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositorySelectionGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositorySelectionGroup.java
@@ -155,7 +155,7 @@ public class RepositorySelectionGroup {
public void modifyText(ModifyEvent event) {
URI location = null;
IStatus status = null;
- String text = repoCombo.getText();
+ String text = repoCombo.getText().trim();
int index = getComboIndex(text);
// only validate text that doesn't match existing text in combo
if (index < 0) {
@@ -440,6 +440,8 @@ public class RepositorySelectionGroup {
}
int getComboIndex(String repoText) {
+ // Callers have typically done this already, but just in case
+ repoText = repoText.trim();
// First look for exact match to the combo string.
// This includes the name, etc.
if (repoText.length() > 0) {
@@ -501,7 +503,7 @@ public class RepositorySelectionGroup {
*/
void addRepository(boolean alwaysPrompt) {
final RepositoryManipulator manipulator = policy.getRepositoryManipulator();
- final String selectedRepo = repoCombo.getText();
+ final String selectedRepo = repoCombo.getText().trim();
int selectionIndex = getComboIndex(selectedRepo);
final boolean isNewText = selectionIndex < 0;
// If we are adding something already in the combo, just
@@ -564,7 +566,7 @@ public class RepositorySelectionGroup {
}
public ProvisioningContext getProvisioningContext() {
- int siteSel = getComboIndex(repoCombo.getText());
+ int siteSel = getComboIndex(repoCombo.getText().trim());
if (siteSel < 0 || siteSel == INDEX_SITE_ALL || siteSel == INDEX_SITE_NONE)
return new ProvisioningContext();
URI[] locals = getLocalSites();
@@ -592,7 +594,7 @@ public class RepositorySelectionGroup {
if (repoCombo.getListVisible()) {
selection = repoCombo.getSelectionIndex();
} else {
- selection = getComboIndex(repoCombo.getText());
+ selection = getComboIndex(repoCombo.getText().trim());
}
int localIndex = getLocalSites().length == 0 ? repoCombo.getItemCount() : repoCombo.getItemCount() - 1;
if (comboRepos == null || selection < 0) {

Back to the top