diff options
author | Krzysztof Daniel | 2013-12-10 10:27:39 +0000 |
---|---|---|
committer | Krzysztof Daniel | 2013-12-10 10:27:39 +0000 |
commit | ac04b8c07dd5eab87eeb337bdbea929d6e1dd247 (patch) | |
tree | 52f588b1eba9b9203b9bf539b6d52ed861810723 /bundles/org.eclipse.equinox.p2.ui.importexport | |
parent | a2344e5ad39e041ee5e822d8bddc4a71bdcd3c03 (diff) | |
download | rt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.tar.gz rt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.tar.xz rt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.zip |
bug 423628 - False positives warnings in the official build.I20131211-0800I20131210-2000I20131210-0800
False positives are caused by projects settings being different than
build settings. Typical example is that project is configured to warn
about local variable hiding a field, and suppression is added, but the
regular releng build is not configured to warn, and it finds unnecessary
suppression.
I have did following things:
* fixed warnings that I was able to fix (renamed variables, added
generics, comments, etc, etc).
* reduced the number of warnings in tests
* commented warnings that must not be suppresed in the workspace unless
we want "Unnecessary @SuppressWarnings" at build time.
Change-Id: Iab2c962e5c331eab170b5f6e08d9bb29d05f0cc4
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.importexport')
3 files changed, 15 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java index 18f37352e..d53653568 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java @@ -15,7 +15,7 @@ import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.equinox.p2.metadata.IInstallableUnit; -public class IUDetail implements IAdaptable{ +public class IUDetail implements IAdaptable { private final IInstallableUnit iu; private final List<URI> referredRepo; @@ -33,7 +33,10 @@ public class IUDetail implements IAdaptable{ return referredRepo; } - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + // don't suppress this warning as it will cause build-time warning + // see bug 423628. This should be possible to fix once + // the entire hierarchy starts using generics + public Object getAdapter(Class adapter) { if (IInstallableUnit.class.equals(adapter)) return iu; return null; @@ -44,7 +47,7 @@ public class IUDetail implements IAdaptable{ if (this == obj) return true; if (obj instanceof IUDetail) { - if (iu.equals(((IUDetail)obj).getIU())) + if (iu.equals(((IUDetail) obj).getIU())) return true; } return false; diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java index 787afb824..f06dddec1 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java @@ -155,13 +155,17 @@ public abstract class AbstractPage extends WizardPage implements Listener { ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel; String e1p = tableProvider.getColumnText(e1, getSortColumn()); String e2p = tableProvider.getColumnText(e2, getSortColumn()); - @SuppressWarnings("unchecked") + // don't suppress this warning as it will cause build-time warning + // see bug 423628. This should be possible to fix once + // SWT/JFace adopt generics int result = getComparator().compare(e1p, e2p); // Secondary column sort if (result == 0) { e1p = tableProvider.getColumnText(e1, lastSortColumn); e2p = tableProvider.getColumnText(e2, lastSortColumn); - @SuppressWarnings("unchecked") + // don't suppress this warning as it will cause build-time warning + // see bug 423628. This should be possible to fix once + // SWT/JFace adopt generics int result2 = getComparator().compare(e1p, e2p); return lastAscending ? result2 : (-1) * result2; } diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java index 5796aafa4..9bc7fe3b1 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java @@ -438,7 +438,9 @@ public class ImportPage extends AbstractImportPage implements ISelectableIUsPage }
if (sub2.isCanceled())
throw new InterruptedException();
- @SuppressWarnings("unchecked")
+ // don't suppress this warning as it will cause build-time warning
+ // see bug 423628. Find a way to change the code to not produce
+ // the warning.
Set<IInstallableUnit> result = new CompoundQueryable<IInstallableUnit>(repos.toArray(new IRepository[repos.size()])).query(QueryUtil.createIUQuery(feature.getIU().getId(), new VersionRange(feature.getIU().getVersion(), true, null, false)), sub2.newChild(100)).toSet();
List<IUDetail> existingFeatures = new ArrayList<IUDetail>(result.size());
for (IInstallableUnit iu : result) {
|