diff options
author | Michael Valenta | 2002-04-16 20:01:07 +0000 |
---|---|---|
committer | Michael Valenta | 2002-04-16 20:01:07 +0000 |
commit | e6638703f434c8d83c064301c723c4c12b3c830a (patch) | |
tree | 7c95e2432bd998fa7d1e7bded4009779fc21706c | |
parent | 97d9531ceff9158b3c56cada0eadf72e0060d755 (diff) | |
download | eclipse.platform.team-e6638703f434c8d83c064301c723c4c12b3c830a.tar.gz eclipse.platform.team-e6638703f434c8d83c064301c723c4c12b3c830a.tar.xz eclipse.platform.team-e6638703f434c8d83c064301c723c4c12b3c830a.zip |
12584: NPE in CVS preference page
2 files changed, 10 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java index fd6a8d58f..7d7ebdb5c 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java @@ -44,6 +44,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource; import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.IUserInfo; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; +import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.ui.wizards.UpdateWizard; import org.eclipse.ui.dialogs.PropertyPage; @@ -193,29 +194,25 @@ public class CVSPropertiesPage extends PropertyPage { private void initializeValues() { passwordChanged = false; + // Do some pre-checks to ensure we're in a good state provider = (CVSTeamProvider)RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()); if (provider == null) return; - CVSWorkspaceRoot cvsRoot = provider.getCVSWorkspaceRoot(); + ICVSFolder folder = cvsRoot.getLocalRoot(); + if (!folder.isCVSFolder()) return; + String[] methods = CVSProviderPlugin.getProvider().getSupportedConnectionMethods(); for (int i = 0; i < methods.length; i++) { methodType.add(methods[i]); } try { ICVSRepositoryLocation location = cvsRoot.getRemoteLocation(); + String method = location.getMethod().getName(); methodType.select(methodType.indexOf(method)); - info = location.getUserInfo(true); userText.setText(info.getUsername()); - } catch (TeamException e) { - handle(e); - } - passwordText.setText("*********"); //$NON-NLS-1$ - - try { - ICVSRemoteResource resource = cvsRoot.getRemoteResourceFor(project); - ICVSRepositoryLocation location = resource.getRepository(); + passwordText.setText("*********"); //$NON-NLS-1$ hostLabel.setText(location.getHost()); int port = location.getPort(); if (port == ICVSRepositoryLocation.USE_DEFAULT_PORT) { @@ -224,7 +221,9 @@ public class CVSPropertiesPage extends PropertyPage { portLabel.setText("" + port); //$NON-NLS-1$ } pathLabel.setText(location.getRootDirectory()); - moduleLabel.setText(resource.getRepositoryRelativePath()); + FolderSyncInfo syncInfo = folder.getFolderSyncInfo(); + if (syncInfo == null) return; + moduleLabel.setText(syncInfo.getRepository()); } catch (TeamException e) { handle(e); } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java index 85f04e3a4..13d89bf8a 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java @@ -199,8 +199,6 @@ public class UnmanageAction extends TeamAction { if(resources[i].getType()!=IResource.PROJECT) return false; RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject(), CVSProviderPlugin.getTypeId()); if (provider == null) return false; - ICVSFolder project = CVSWorkspaceRoot.getCVSFolderFor((IContainer)resources[i]); - if (!project.isCVSFolder()) return false; } return true; } |