diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata/src/org')
3 files changed, 8 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java index 05b0826cd..ffa7b3072 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java @@ -164,8 +164,10 @@ public class Collector<T> implements IQueryResult<T> { * * @return An unmodifiable collection of the collected objects */ - @SuppressWarnings("unchecked") public Set<T> toUnmodifiableSet() { - return collected == null ? Collections.EMPTY_SET : Collections.unmodifiableSet(collected); + if (collected == null) { + return Collections.emptySet(); + } + return Collections.unmodifiableSet(collected); } } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java index 6d1f6a58f..621838be4 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java @@ -52,8 +52,9 @@ public final class CompoundQueryable<T> extends IndexProvider<T> { * * @param queryables The collection of queryables to be combined */ - @SuppressWarnings("unchecked") CompoundQueryable(Collection<? extends IQueryable<T>> queryables) { + // don't suppress the warning as it will cause warnings in the official build + // see bug 423628. Write this without unchecked conversion. this(queryables.toArray(new IQueryable[queryables.size()])); } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java index 82123514c..3c68c1635 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java @@ -54,8 +54,9 @@ public class QueryUtil { * * @param queryables The collection of queryables to be combined */ - @SuppressWarnings("unchecked") public static <T> IQueryable<T> compoundQueryable(Collection<? extends IQueryable<T>> queryables) { + // don't suppress the warning as it will cause warnings in the official build + // see bug 423628. Write this without unchecked conversion. return new CompoundQueryable<T>(queryables.toArray(new IQueryable[queryables.size()])); } |