From 6d5f5275c8d23e3a1592e6993c585634b8bde602 Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Wed, 5 Nov 2025 03:47:19 +0000 Subject: [PATCH] Perform clean code of team/bundles/org.eclipse.compare --- .../compare/EditionSelectionDialog.java | 19 +++++++++++++++++++ .../org/eclipse/compare/IStreamMerger.java | 4 ++++ .../CompareWithOtherResourceAction.java | 2 ++ 3 files changed, 25 insertions(+) diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java index 9d70bbe589f..4d749396440 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java @@ -237,6 +237,7 @@ public int hashCode() { * @param parent if not null the new dialog stays on top of this parent shell * @param bundle ResourceBundle to configure the dialog */ + @Deprecated public EditionSelectionDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); } @@ -268,6 +269,7 @@ public void setStatusMessage(String message) { * @param contextId the help context id. * @since 3.2 */ + @Deprecated @Override public void setHelpContextId(String contextId) { super.setHelpContextId(contextId); @@ -279,6 +281,7 @@ public void setHelpContextId(String contextId) { * @param titleArgument an optional argument for the edition pane's title * @since 2.0 */ + @Deprecated public void setEditionTitleArgument(String titleArgument) { fTitleArg= titleArgument; } @@ -289,6 +292,7 @@ public void setEditionTitleArgument(String titleArgument) { * @param titleImage an optional image for the edition pane's title * @since 2.0 */ + @Deprecated public void setEditionTitleImage(Image titleImage) { fTitleImage= titleImage; } @@ -305,6 +309,7 @@ public void setEditionTitleImage(Image titleImage) { * it is an ITypedElement returned from IStructureCreator.locate(path, item) * @since 2.0 */ + @Deprecated public ITypedElement selectPreviousEdition(final ITypedElement target, ITypedElement[] inputEditions, Object ppath) { Assert.isNotNull(target); fTargetPair= new Pair(null, target); @@ -380,6 +385,7 @@ public ITypedElement selectPreviousEdition(final ITypedElement target, ITypedEle * if path was null; otherwise * it is an ITypedElement returned from IStructureCreator.locate(path, item) */ + @Deprecated public ITypedElement selectEdition(final ITypedElement target, ITypedElement[] inputEditions, Object ppath) { Assert.isNotNull(target); @@ -544,6 +550,7 @@ private Pair createPair(IStructureCreator sc, Object path, ITypedElement input) * @param hide if true identical entries are hidden; otherwise they are shown. * @since 2.0 */ + @Deprecated public void setHideIdenticalEntries(boolean hide) { fHideIdentical= hide; } @@ -554,6 +561,7 @@ public void setHideIdenticalEntries(boolean hide) { * @param isRight if true target is shown on right hand side. * @since 2.0 */ + @Deprecated public void setTargetIsRight(boolean isRight) { fTargetIsRight= isRight; } @@ -565,6 +573,7 @@ public void setTargetIsRight(boolean isRight) { * @param addMode if true dialog is in 'add' mode. * @since 2.0 */ + @Deprecated public void setAddMode(boolean addMode) { fAddMode= addMode; fMultiSelect= addMode; @@ -577,6 +586,7 @@ public void setAddMode(boolean addMode) { * @param compareMode if true dialog is in 'add' mode. * @since 2.0 */ + @Deprecated public void setCompareMode(boolean compareMode) { fCompareMode= compareMode; fStructureCompare= fCompareMode && !fAddMode; @@ -593,6 +603,7 @@ public void setCompareMode(boolean compareMode) { * * @return the last specified target or a subsection thereof. */ + @Deprecated public ITypedElement getTarget() { return fTargetPair.getItem(); } @@ -604,6 +615,7 @@ public ITypedElement getTarget() { * @return the selected editions as an array. * @since 2.1 */ + @Deprecated public ITypedElement[] getSelection() { ArrayList result= new ArrayList<>(); if (fMemberSelection != null) { @@ -635,6 +647,7 @@ public ITypedElement[] getSelection() { * @param item if a path has been specified in selectEdition a sub element of the given target; otherwise the same as target * @return a label the target side of a compare viewer */ + @Deprecated protected String getTargetLabel(ITypedElement target, ITypedElement item) { String format= null; if (target instanceof ResourceNode) { @@ -680,6 +693,7 @@ private boolean hasVariable(String string) { * @param item if a path has been specified in selectEdition a sub element of the given selectedEdition; otherwise the same as selectedEdition * @return a label for the edition side of a compare viewer */ + @Deprecated protected String getEditionLabel(ITypedElement selectedEdition, ITypedElement item) { String format= null; if (selectedEdition instanceof ResourceNode) { @@ -721,6 +735,7 @@ protected String getEditionLabel(ITypedElement selectedEdition, ITypedElement it * @return a label of a node in the edition tree viewer * @since 2.0 */ + @Deprecated protected String getShortEditionLabel(ITypedElement edition, ITypedElement item, Date date) { String format= null; if (edition instanceof ResourceNode) { @@ -752,6 +767,7 @@ protected String getShortEditionLabel(ITypedElement edition, ITypedElement item, * @return a label the edition side of a compare viewer * @since 2.0 */ + @Deprecated protected Image getEditionImage(ITypedElement selectedEdition, ITypedElement item) { if (selectedEdition instanceof ResourceNode) { return selectedEdition.getImage(); @@ -769,6 +785,7 @@ protected Image getEditionImage(ITypedElement selectedEdition, ITypedElement ite return null; } + @Deprecated @Override protected synchronized Control createDialogArea(Composite parent2) { @@ -905,6 +922,7 @@ protected Viewer getViewer(Viewer oldViewer, Object input) { return parent; } + @Deprecated @Override protected void createButtonsForButtonBar(Composite parent) { String buttonLabel= Utilities.getString(fBundle, "buttonLabel", IDialogConstants.OK_LABEL); //$NON-NLS-1$ @@ -923,6 +941,7 @@ protected void createButtonsForButtonBar(Composite parent) { * Overidden to disable dismiss on double click in compare mode. * @since 2.0 */ + @Deprecated @Override protected void okPressed() { if (fCompareMode) { diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java index 6c2c622ea0f..70fa80fcad3 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java @@ -35,16 +35,19 @@ public interface IStreamMerger { /** * Indicates the successful completion of the merge operation (value IStatus.OK) */ + @Deprecated public static final int OK= IStatus.OK; /** * Indicates that a change conflict prevented the merge from successful completion (value 1) */ + @Deprecated public static final int CONFLICT= 1; /** * Status code describing an internal error (value 2) */ + @Deprecated public static final int INTERNAL_ERROR= 2; /** @@ -65,6 +68,7 @@ public interface IStreamMerger { * @param monitor reports progress of the merge operation * @return returns the completion status of the operation */ + @Deprecated IStatus merge(OutputStream output, String outputEncoding, InputStream ancestor, String ancestorEncoding, InputStream target, String targetEncoding, diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java index a523d7d5611..28d442a4943 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java @@ -26,6 +26,7 @@ @Deprecated public class CompareWithOtherResourceAction extends CompareAction { + @Deprecated @Override public void run(ISelection selection) { // Show CompareWithOtherResourceDialog which return resources to compare @@ -34,6 +35,7 @@ public void run(ISelection selection) { super.run(selection); } + @Deprecated @Override protected boolean isEnabled(ISelection selection) { int selectionSize = 0;