diff options
author | Alexander Kurtakov | 2017-10-07 07:57:23 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-10-07 07:57:23 +0000 |
commit | 34c6572d9f379cb3689c2cf63a9c2710cdc91e22 (patch) | |
tree | d7ce5f791d87971ff2e5d1e7f23d6adebd162c33 | |
parent | 1e3d1d9f4b44ab85107c36f097b9019a0cbd0f45 (diff) | |
download | rt.equinox.p2-34c6572d9f379cb3689c2cf63a9c2710cdc91e22.tar.gz rt.equinox.p2-34c6572d9f379cb3689c2cf63a9c2710cdc91e22.tar.xz rt.equinox.p2-34c6572d9f379cb3689c2cf63a9c2710cdc91e22.zip |
Bug 525709 - Cleanup publisher bundle
* Add missing Override annotations.
* Move away from deprecated descriptor methods without progress monitor
* Rename variables to not hide members from parent.
* Add mising non-nls
* Enable save actions to prevent warnings from popping up again.
Change-Id: I47b165fd2e841e072735a4e9ef371920090930c2
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
9 files changed, 39 insertions, 17 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.core.prefs index 8b432ed13..8cc680d40 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.core.prefs @@ -24,6 +24,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 +org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -93,6 +94,7 @@ org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning diff --git a/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.ui.prefs index 014501b61..38446e943 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.ui.prefs +++ b/bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.ui.prefs @@ -1,4 +1,3 @@ -#Sun Sep 23 11:57:54 EDT 2007 eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_core @@ -12,22 +11,29 @@ sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false sp_cleanup.add_missing_nls_tags=false sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=false sp_cleanup.always_use_this_for_non_static_field_access=false sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false sp_cleanup.make_private_fields_final=true -sp_cleanup.make_variable_declarations_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true @@ -35,12 +41,13 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class= sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false @@ -48,8 +55,10 @@ sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false sp_cleanup.use_blocks=false sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=false sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractAdvice.java index d12288b14..8f184a768 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractAdvice.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractAdvice.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Code 9 and others. All rights reserved. This + * Copyright (c) 2008, 2017 Code 9 and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -14,6 +14,7 @@ import org.eclipse.equinox.p2.metadata.VersionRange; public class AbstractAdvice implements IPublisherAdvice { + @Override public boolean isApplicable(String configSpec, boolean includeDefault, String id, Version version) { return matchConfig(configSpec, includeDefault) && matchId(id) && matchVersion(version); } diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java index 5fc2480a2..71288480a 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2008, 2017 Code 9 and others. All rights reserved. This + * Copyright (c) 2008, 2017 Code 9 and others. + * All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -446,7 +447,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction { // if all we are doing is indexing things then add the descriptor and get on with it if ((publisherInfo.getArtifactOptions() & IPublisherInfo.A_PUBLISH) == 0) { - destination.addDescriptor(descriptor); + destination.addDescriptor(descriptor, new NullProgressMonitor()); return; } @@ -454,7 +455,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction { if (destination instanceof IFileArtifactRepository) { File descriptorFile = ((IFileArtifactRepository) destination).getArtifactFile(descriptor); if (inclusion.equals(descriptorFile)) { - destination.addDescriptor(descriptor); + destination.addDescriptor(descriptor, new NullProgressMonitor()); return; } } @@ -491,7 +492,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction { return; // if all we are doing is indexing things then add the descriptor and get on with it if ((publisherInfo.getArtifactOptions() & IPublisherInfo.A_PUBLISH) == 0) { - destination.addDescriptor(descriptor); + destination.addDescriptor(descriptor, new NullProgressMonitor()); return; } diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java index 68bded5ce..eec1a2b49 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java @@ -189,11 +189,11 @@ public class Publisher { class ArtifactProcess implements IRunnableWithProgress { private final IPublisherAction[] actions; - private final IPublisherInfo info; + private final IPublisherInfo publisherInfo; private IStatus result = null; public ArtifactProcess(IPublisherAction[] actions, IPublisherInfo info) { - this.info = info; + this.publisherInfo = info; this.actions = actions; } @@ -205,7 +205,7 @@ public class Publisher { result = Status.CANCEL_STATUS; return; } - IStatus status = actions[i].perform(info, results, monitor); + IStatus status = actions[i].perform(publisherInfo, results, monitor); finalStatus.merge(status); monitor.worked(1); } diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java index 7d637306d..90d851655 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 EclipseSource and others. All rights reserved. This + * Copyright (c) 2009, 2017 EclipseSource and others. + * All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -26,6 +27,7 @@ public class QueryableFilterAdvice implements IFilterAdvice { this.queryable = queryable; } + @Override public IMatchExpression<IInstallableUnit> getFilter(String id, Version version, boolean exact) { IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id, version); IQueryResult<IInstallableUnit> result = queryable.query(query, null); @@ -41,6 +43,7 @@ public class QueryableFilterAdvice implements IFilterAdvice { return null; } + @Override public boolean isApplicable(String configSpec, boolean includeDefault, String id, Version version) { return true; } diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootFilesAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootFilesAdvice.java index 2a904e693..cfd0c5f94 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootFilesAdvice.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootFilesAdvice.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2008 Code 9 and others. All rights reserved. This + * Copyright (c) 2008, 2017 Code 9 and others. + * All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -25,18 +26,22 @@ public class RootFilesAdvice extends AbstractAdvice implements IRootFilesAdvice this.configSpec = configSpec; } + @Override public File getRoot() { return root; } + @Override protected String getConfigSpec() { return configSpec; } + @Override public File[] getExcludedFiles() { return excludedFiles; } + @Override public File[] getIncludedFiles() { return includedFiles; } diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUResultFilterAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUResultFilterAdvice.java index 8b25e1184..ac116da4b 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUResultFilterAdvice.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUResultFilterAdvice.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Code 9 and others. All rights reserved. This + * Copyright (c) 2008, 2017 Code 9 and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -23,6 +23,7 @@ public class RootIUResultFilterAdvice extends AbstractAdvice implements IRootIUA this.query = query; } + @Override public Collection<IInstallableUnit> getChildren(IPublisherResult result) { Collection<IInstallableUnit> value = result.getIUs(null, IPublisherResult.ROOT); if (query == null) diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java index 10c6ce315..7e462e735 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java @@ -119,7 +119,7 @@ public class PublisherHelper { } catch (IOException e) { // don't care if failed to compute checksum // TODO provide message? - LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "", e)); + LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "", e)); //$NON-NLS-1$ } } } |