diff options
author | Wim Jongman | 2018-07-03 20:11:52 +0000 |
---|---|---|
committer | Wim Jongman | 2018-07-03 20:11:52 +0000 |
commit | 4717ca4ba5d08c710ca304e2e1985b9514ec66e8 (patch) | |
tree | dc90717b1c1fa33bc7f12176417ca445c7f1b864 | |
parent | 8d480345cf488ac8790cb085de8e8fb15edb0ebe (diff) | |
download | eclipse.platform.ua-4717ca4ba5d08c710ca304e2e1985b9514ec66e8.tar.gz eclipse.platform.ua-4717ca4ba5d08c710ca304e2e1985b9514ec66e8.tar.xz eclipse.platform.ua-4717ca4ba5d08c710ca304e2e1985b9514ec66e8.zip |
Bug 535169: [Tips] Tips hashCode/equals should be finalI20180710-2000I20180709-2000
* made hashCode and equals final
* added some javadoc notes
* updated manifest and pom to 1.0.0
Change-Id: Ic78279f3c59ce4040aaf3488f253199549d40931
Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
-rw-r--r-- | org.eclipse.tips.core/src/org/eclipse/tips/core/Tip.java | 13 | ||||
-rw-r--r-- | org.eclipse.tips.ide/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | org.eclipse.tips.ide/pom.xml | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/Tip.java b/org.eclipse.tips.core/src/org/eclipse/tips/core/Tip.java index ec887af97..bcdc1b9f8 100644 --- a/org.eclipse.tips.core/src/org/eclipse/tips/core/Tip.java +++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/Tip.java @@ -52,20 +52,25 @@ public abstract class Tip { } /** - * Return the publish date of the tip. The UI could decide to server newer tips - * first. + * Return the publish date of the tip. The UI could decide to serve newer tips + * first. Note that this date is used to calculate the hash code of the Tip so + * it should return the same value for the same tip. * * @return the date this tip was published which may not be null. */ public abstract Date getCreationDate(); /** + * Returns a meaningful short description of the tip. The description is used in + * calculation of the hash code so once it is set for the tip, it may not + * change. + * * @return the subject which may not be null. */ public abstract String getSubject(); @Override - public int hashCode() { + public final int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); @@ -75,7 +80,7 @@ public abstract class Tip { } @Override - public boolean equals(Object obj) { + public final boolean equals(Object obj) { if (this == obj) { return true; } diff --git a/org.eclipse.tips.ide/META-INF/MANIFEST.MF b/org.eclipse.tips.ide/META-INF/MANIFEST.MF index f60e67ebb..863b569b6 100644 --- a/org.eclipse.tips.ide/META-INF/MANIFEST.MF +++ b/org.eclipse.tips.ide/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.tips.ide;singleton:=true -Bundle-Version: 0.1.100.qualifier +Bundle-Version: 1.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.108.0", org.eclipse.core.runtime;bundle-version="3.12.0", diff --git a/org.eclipse.tips.ide/pom.xml b/org.eclipse.tips.ide/pom.xml index 42fac55d3..3db3be5b3 100644 --- a/org.eclipse.tips.ide/pom.xml +++ b/org.eclipse.tips.ide/pom.xml @@ -20,6 +20,6 @@ </parent> <groupId>org.eclipse.ui</groupId> <artifactId>org.eclipse.tips.ide</artifactId> - <version>0.1.100-SNAPSHOT</version> + <version>1.0.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> |