Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-01-06 11:03:46 -0500
committerMichael Keppler2019-01-06 11:03:46 -0500
commit2cfc23d2a6aaf2c47bb90782e06d8bff28947061 (patch)
treedb3ec86c3b5e1c904b4cd3ac331811d238f5db58
parentf36f2823a3549000f182bffe9c49a9483cf8de41 (diff)
downloadegit-github-2cfc23d2a6aaf2c47bb90782e06d8bff28947061.tar.gz
egit-github-2cfc23d2a6aaf2c47bb90782e06d8bff28947061.tar.xz
egit-github-2cfc23d2a6aaf2c47bb90782e06d8bff28947061.zip
Silence all discouraged access warnings in Java code
All the references to internal classes or fields have been implemented on purpose and there are no better APIs available. Let us therefore silence all the "discouraged access" warnings. We will notice changes in future versions of the dependencies rather by deprecation warnings or by compiler failures. Change-Id: Ib7af041b1e8ac0f0dba5c45fda6ef93188674bb3 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java1
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestConnector.java1
-rwxr-xr-xorg.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskRepositoryImportWizard.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CreateGistJob.java3
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentPart.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java6
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java8
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java7
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueLabelAttributeEditor.java16
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java5
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java7
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java1
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositorySettingsPage.java5
17 files changed, 60 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
index 0055864c..e93e3ced 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
@@ -59,6 +59,7 @@ import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession;
/**
* GitHub issue repository connector.
*/
+@SuppressWarnings("restriction")
public class IssueConnector extends RepositoryConnector {
/**
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestConnector.java
index 6ff999f0..7aecec05 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestConnector.java
@@ -46,6 +46,7 @@ import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession;
/**
* GitHub pull request connector.
*/
+@SuppressWarnings("restriction")
public class PullRequestConnector extends RepositoryConnector {
/**
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
index e450f25c..706759c3 100755
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
@@ -48,6 +48,7 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
/**
* {@link IImportWizard} for cloning GitHub repositories.
*/
+@SuppressWarnings("restriction")
public class RepositoryImportWizard extends Wizard implements IImportWizard {
private final RepositorySearchWizardPage repositorySearchWizardPage = new RepositorySearchWizardPage();
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskRepositoryImportWizard.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskRepositoryImportWizard.java
index 17368550..40616f43 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskRepositoryImportWizard.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskRepositoryImportWizard.java
@@ -37,6 +37,7 @@ import org.eclipse.ui.internal.WorkbenchImages;
*
* @author Kevin Sawicki (kevin@github.com)
*/
+@SuppressWarnings("restriction")
public class TaskRepositoryImportWizard extends Wizard implements IImportWizard {
private CredentialsWizardPage credentialsPage;
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CreateGistJob.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CreateGistJob.java
index c368bbbd..f0030a86 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CreateGistJob.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CreateGistJob.java
@@ -32,6 +32,7 @@ import org.eclipse.ui.PlatformUI;
/**
* Create Gist job class
*/
+@SuppressWarnings("restriction")
public class CreateGistJob extends Job {
private String title;
@@ -61,7 +62,6 @@ public class CreateGistJob extends Job {
}
@Override
- @SuppressWarnings("restriction")
protected IStatus run(IProgressMonitor monitor) {
try {
Gist gist = new Gist().setPublic(isPublic);
@@ -72,6 +72,7 @@ public class CreateGistJob extends Job {
final Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
GistNotificationPopup popup = new GistNotificationPopup(
display, created, title, repository);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentPart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentPart.java
index 9ed959e7..82e26477 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentPart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentPart.java
@@ -71,6 +71,7 @@ import org.eclipse.ui.forms.widgets.Section;
* Gist editor attachment part. Modeled after {@link TaskEditorAttachmentPart}
* but with less columns.
*/
+@SuppressWarnings("restriction")
public class GistAttachmentPart extends AbstractTaskEditorPart {
private static final String ID_POPUP_MENU = "org.eclipse.mylyn.tasks.ui.editor.menu.attachments"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
index aa64c1d2..2e3feac2 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
@@ -51,6 +51,7 @@ import org.eclipse.ui.PlatformUI;
* AttachmentTableLabelProvider directly. Unfortunately, that class changed
* in non-compatible ways with Mylyn Tasks 3.23.0.
*/
+@SuppressWarnings("restriction")
public class GistAttachmentTableLabelProvider extends ColumnLabelProvider {
private final AttachmentSizeFormatter sizeFormatter = AttachmentSizeFormatter.getInstance();
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
index 9ce51915..c0112fd5 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
@@ -37,6 +37,7 @@ import org.eclipse.ui.dialogs.SelectionDialog;
/**
* Dialog to select a Gist task repository
*/
+@SuppressWarnings("restriction")
public class GistConnectorSelectionDialog extends SelectionDialog {
private final Collection<TaskRepository> repos;
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java
index 918fc1b6..9827a5a7 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java
@@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Text;
/**
* Gist repository query page class.
*/
+@SuppressWarnings("restriction")
public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
private Text titleText;
@@ -59,6 +60,7 @@ public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
/**
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite displayArea = new Composite(parent, SWT.NONE);
initializeDialogUnits(displayArea);
@@ -69,6 +71,7 @@ public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
ModifyListener completeListener = new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
setPageComplete(isPageComplete());
}
@@ -119,6 +122,7 @@ public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage#getQueryTitle()
*/
+ @Override
public String getQueryTitle() {
return titleText != null ? titleText.getText() : null;
}
@@ -126,6 +130,7 @@ public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage#isPageComplete()
*/
+ @Override
public boolean isPageComplete() {
boolean complete = inSearchContainer() ? true : super.isPageComplete();
if (complete)
@@ -136,6 +141,7 @@ public class GistRepositoryQueryPage extends AbstractRepositoryQueryPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage#applyTo(org.eclipse.mylyn.tasks.core.IRepositoryQuery)
*/
+ @Override
public void applyTo(IRepositoryQuery query) {
query.setSummary(getQueryTitle());
query.setAttribute(IGistQueryConstants.USER, userText.getText().trim());
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java
index bedfbb29..c589f00d 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java
@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Composite;
*
* @author Kevin Sawicki (kevin@github.com)
*/
+@SuppressWarnings("restriction")
public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
@@ -56,6 +57,7 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#getConnectorKind()
*/
+ @Override
public String getConnectorKind() {
return GistConnector.KIND;
}
@@ -63,6 +65,7 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#createAdditionalControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createAdditionalControls(Composite parent) {
if (repository == null) {
setUrl(URL);
@@ -74,6 +77,7 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#isValidUrl(java.lang.String)
*/
+ @Override
protected boolean isValidUrl(String url) {
if (url.startsWith("http://") || url.startsWith("https://")) //$NON-NLS-1$ //$NON-NLS-2$
try {
@@ -89,9 +93,11 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#getValidator(org.eclipse.mylyn.tasks.core.TaskRepository)
*/
+ @Override
protected Validator getValidator(final TaskRepository repository) {
return new Validator() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
monitor.beginTask(
Messages.GistRepositorySettingsPage_TaskValidating, 100);
@@ -127,6 +133,7 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#applyTo(org.eclipse.mylyn.tasks.core.TaskRepository)
*/
+ @Override
public void applyTo(TaskRepository repository) {
repository.setProperty(IRepositoryConstants.PROPERTY_CATEGORY,
TaskRepository.CATEGORY_REVIEW);
@@ -136,6 +143,7 @@ public class GistRepositorySettingsPage extends AbstractRepositorySettingsPage {
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#canValidate()
*/
+ @Override
public boolean canValidate() {
return isPageComplete()
&& (getMessage() == null || getMessageType() != IMessageProvider.ERROR);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
index b86ad9b6..109a3e30 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
@@ -33,6 +33,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter;
/**
* Gist task editor page class
*/
+@SuppressWarnings("restriction")
public class GistTaskEditorPage extends AbstractTaskEditorPage {
/**
@@ -63,6 +64,7 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
/**
* @see org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage#fillToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
public void fillToolBar(IToolBarManager toolBarManager) {
super.fillToolBar(toolBarManager);
addCloneAction(toolBarManager);
@@ -71,6 +73,7 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
/**
* @see org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage#createPartDescriptors()
*/
+ @Override
protected Set<TaskEditorPartDescriptor> createPartDescriptors() {
Set<TaskEditorPartDescriptor> partDescriptors = super
.createPartDescriptors();
@@ -87,6 +90,7 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
if (!getModel().getTaskData().isNew()) {
partDescriptors.add(new TaskEditorPartDescriptor(ID_PART_SUMMARY) {
+ @Override
public AbstractTaskEditorPart createPart() {
return new IssueSummaryPart(GistAttribute.AUTHOR_GRAVATAR
.getMetadata().getId(), null);
@@ -95,6 +99,7 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
partDescriptors.add(new TaskEditorPartDescriptor(
ID_PART_ATTACHMENTS) {
+ @Override
public AbstractTaskEditorPart createPart() {
return new GistAttachmentPart();
}
@@ -102,9 +107,11 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
}
partDescriptors.add(new TaskEditorPartDescriptor(ID_PART_ACTIONS) {
+ @Override
public AbstractTaskEditorPart createPart() {
return new TaskEditorActionPart() {
+ @Override
protected void addAttachContextButton(
Composite buttonComposite, FormToolkit toolkit) {
// Prohibit context button since Gists don't support
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
index ba24e14d..e34cd266 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
@@ -51,6 +51,7 @@ import org.eclipse.ui.progress.IProgressConstants2;
* GitHub issue task editor attribute part that display labels and milestone
* attribute editors.
*/
+@SuppressWarnings("restriction")
public class IssueAttributePart extends AbstractTaskEditorSection {
private List<AbstractAttributeEditor> attributeEditors;
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueLabelAttributeEditor.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueLabelAttributeEditor.java
index ff167e51..a6787b96 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueLabelAttributeEditor.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueLabelAttributeEditor.java
@@ -52,6 +52,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Editor part for viewing an issue's labels.
*/
+@SuppressWarnings("restriction")
public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
/**
@@ -71,12 +72,14 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
IAction.AS_PUSH_BUTTON);
}
+ @Override
public void run() {
InputDialog dialog = new InputDialog(getControl().getShell(),
Messages.IssueLabelAttributeEditor_TitleNewLabel,
Messages.IssueLabelAttributeEditor_DescriptionNewLabel,
"", new IInputValidator() { //$NON-NLS-1$
+ @Override
public String isValid(String newText) {
if (newText == null || newText.trim().length() == 0)
return Messages.IssueLabelAttributeEditor_MessageEnterName;
@@ -104,6 +107,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
this.label = label;
}
+ @Override
public void run() {
if (getTaskAttribute().getValues().contains(label)) {
getTaskAttribute().removeValue(label);
@@ -121,6 +125,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
setImageDescriptor(GitHubImages.DESC_GITHUB_ISSUE_LABEL);
}
+ @Override
public void run() {
if (!getTaskAttribute().getValues().contains(getText())) {
getTaskAttribute().addValue(getText());
@@ -133,10 +138,11 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
private Composite displayArea;
private boolean layout = false;
private Composite labelsArea;
- private List<CLabel> labelControls = new LinkedList<CLabel>();
+ private List<CLabel> labelControls = new LinkedList<>();
private FormToolkit toolkit;
private Comparator<String> labelComparator = new Comparator<String>() {
+ @Override
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
@@ -159,7 +165,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
Image labelImage = GitHubImages
.get(GitHubImages.GITHUB_ISSUE_LABEL_OBJ);
- List<String> labels = new LinkedList<String>(getTaskAttribute()
+ List<String> labels = new LinkedList<>(getTaskAttribute()
.getValues());
Collections.sort(labels, this.labelComparator);
if (!labels.isEmpty())
@@ -169,6 +175,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(new RemoveLabelAction(label));
}
@@ -199,6 +206,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
* @see org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor#createControl(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.forms.widgets.FormToolkit)
*/
+ @Override
public void createControl(Composite parent, FormToolkit toolkit) {
this.toolkit = toolkit;
displayArea = toolkit.createComposite(parent);
@@ -216,10 +224,11 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(new NewLabelAction());
manager.add(new Separator());
- List<String> labels = new LinkedList<String>(getTaskAttribute()
+ List<String> labels = new LinkedList<>(getTaskAttribute()
.getOptions().values());
labels.removeAll(getTaskAttribute().getValues());
for (String label : labels)
@@ -230,6 +239,7 @@ public class IssueLabelAttributeEditor extends AbstractAttributeEditor {
final Menu menu = manager.createContextMenu(displayArea);
addItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Rectangle toolItemBounds = addItem.getBounds();
Point location = toolbar.toDisplay(toolItemBounds.x,
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
index d14a93d3..5e01c87b 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
@@ -42,6 +42,7 @@ import org.eclipse.swt.widgets.Composite;
/**
* GitHub connector specific extensions.
*/
+@SuppressWarnings("restriction")
public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage {
private boolean syncLabel = true;
@@ -100,6 +101,7 @@ public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage
serverUrlCombo.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
editingUrl = true;
try {
@@ -113,6 +115,7 @@ public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage
repositoryLabelEditor.getTextControl(compositeContainer)
.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (!editingUrl)
syncLabel = false;
@@ -179,6 +182,7 @@ public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#applyTo(org.eclipse.mylyn.tasks.core.TaskRepository)
*/
+ @Override
public void applyTo(TaskRepository repository) {
repository.setProperty(IRepositoryConstants.PROPERTY_CATEGORY,
TaskRepository.CATEGORY_BUGS);
@@ -188,6 +192,7 @@ public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#canValidate()
*/
+ @Override
public boolean canValidate() {
return isPageComplete()
&& (getMessage() == null || getMessageType() != IMessageProvider.ERROR);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
index fe862f6f..f786839b 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
@@ -34,6 +34,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
* Issue summary task editor part modeled after {@link TaskEditorSummaryPart}
* but displaying reporter and assignee avatar images.
*/
+@SuppressWarnings("restriction")
public class IssueSummaryPart extends AbstractTaskEditorPart {
/**
@@ -49,7 +50,7 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
/**
* Create issue summary part
- *
+ *
* @param reporterAvatarId
* @param assigneeAvatarId
*/
@@ -150,10 +151,11 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
/**
* Create control
- *
+ *
* @param parent
* @param toolkit
*/
+ @Override
public void createControl(Composite parent, FormToolkit toolkit) {
Composite composite = toolkit.createComposite(parent);
GridLayout layout = EditorUtil.createSectionClientLayout();
@@ -232,6 +234,7 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
/**
* @see org.eclipse.ui.forms.AbstractFormPart#setFocus()
*/
+ @Override
public void setFocus() {
if (summaryEditor != null)
summaryEditor.getControl().setFocus();
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
index f4fedef9..58aaa2b7 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
@@ -64,6 +64,7 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* Task editor section to view commits attached to a pull request
*/
+@SuppressWarnings("restriction")
public class CommitAttributePart extends AbstractTaskEditorSection {
private CommandContributionItem fetchCommits;
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositorySettingsPage.java
index c8f788cc..0b8ea9ca 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositorySettingsPage.java
@@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Composite;
/**
* Pull request task repository settings page.
*/
+@SuppressWarnings("restriction")
public class PullRequestRepositorySettingsPage extends
HttpRepositorySettingsPage {
@@ -92,6 +93,7 @@ public class PullRequestRepositorySettingsPage extends
serverUrlCombo.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
editingUrl = true;
try {
@@ -105,6 +107,7 @@ public class PullRequestRepositorySettingsPage extends
repositoryLabelEditor.getTextControl(compositeContainer)
.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (!editingUrl)
syncLabel = false;
@@ -159,12 +162,14 @@ public class PullRequestRepositorySettingsPage extends
/**
* @see org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage#applyTo(org.eclipse.mylyn.tasks.core.TaskRepository)
*/
+ @Override
public void applyTo(TaskRepository repository) {
repository.setProperty(IRepositoryConstants.PROPERTY_CATEGORY,
TaskRepository.CATEGORY_REVIEW);
super.applyTo(repository);
}
+ @Override
public String getRepositoryUrl() {
return PullRequestConnector.appendPulls(super.getRepositoryUrl());
}

Back to the top