-
Notifications
You must be signed in to change notification settings - Fork 24
Changed rest calls thread #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aarnapant-sap
wants to merge
1
commit into
abapGit:master
Choose a base branch
from
aarnapant-sap:fix/switch-branch-rest-call
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,13 +17,15 @@ | |
| import org.eclipse.core.runtime.NullProgressMonitor; | ||
| import org.eclipse.jface.dialogs.DialogPage; | ||
| import org.eclipse.jface.dialogs.IPageChangingListener; | ||
| import org.eclipse.jface.dialogs.MessageDialog; | ||
| import org.eclipse.jface.dialogs.PageChangingEvent; | ||
| import org.eclipse.jface.operation.IRunnableWithProgress; | ||
| import org.eclipse.jface.wizard.IWizardContainer; | ||
| import org.eclipse.jface.wizard.Wizard; | ||
| import org.eclipse.jface.wizard.WizardDialog; | ||
| import org.eclipse.jface.wizard.WizardPage; | ||
| import org.eclipse.osgi.util.NLS; | ||
| import org.eclipse.ui.PlatformUI; | ||
| import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
|
|
||
| import com.sap.adt.tools.core.model.adtcore.IAdtObjectReference; | ||
|
|
@@ -71,10 +73,10 @@ private void getRepositoryAccessMode() { | |
|
|
||
| public void getPackageRef(String packageName, IProgressMonitor monitor) throws PackageRefNotFoundException { | ||
| if (this.packageServiceUI.packageExists(AbapGitWizardSwitchBranch.this.destination, packageName, monitor)) { | ||
| List<IAdtObjectReference> packageRefs = this.packageServiceUI.find(AbapGitWizardSwitchBranch.this.destination, packageName, monitor); | ||
| List<IAdtObjectReference> packageRefs = this.packageServiceUI.find(AbapGitWizardSwitchBranch.this.destination, packageName, | ||
| monitor); | ||
| AbapGitWizardSwitchBranch.this.cloneData.packageRef = packageRefs.stream().findFirst().orElse(null); | ||
| } | ||
| else { | ||
| } else { | ||
| String error = NLS.bind(Messages.AbapGitWizardSwitch_branch_package_ref_not_found_error, this.selRepoData.getPackage()); | ||
| throw new PackageRefNotFoundException(error); | ||
| } | ||
|
|
@@ -83,9 +85,25 @@ public void getPackageRef(String packageName, IProgressMonitor monitor) throws P | |
| public void getPackageAndRepoType() throws PackageRefNotFoundException { | ||
| String packageName = AbapGitWizardSwitchBranch.this.selRepoData.getPackage(); | ||
| //get package refs | ||
| getPackageRef(packageName, new NullProgressMonitor()); | ||
| // fetches repository access mode | ||
| getRepositoryAccessMode(); | ||
| try { | ||
| PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() { | ||
|
|
||
| @Override | ||
| public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { | ||
| try { | ||
| getPackageRef(packageName, new NullProgressMonitor()); | ||
| // fetches repository access mode | ||
| getRepositoryAccessMode(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In communication log I checked that there are two calls made to get the externalrepoInfo. |
||
| } catch (PackageRefNotFoundException e) { | ||
| throw new InvocationTargetException(e); | ||
| } | ||
| } | ||
| }); | ||
| } catch (InvocationTargetException | InterruptedException e) { | ||
| MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), | ||
| Messages.AbapGitWizardSwitch_branch_wizard_title, e.getCause().getMessage()); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| @Override | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the package check fails and results in an exception, the wizard still tries to open and fails currently in the Credentials page.
Either we need to somehow stop opening of the wizard if there is an exception or continue have this call in main thread.