diff options
author | Carsten Hammer | 2020-11-01 13:01:25 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-08-13 06:07:23 +0000 |
commit | e77d48765fbefbc8a6144325a9ec1a54bafeeec3 (patch) | |
tree | 615889fbb133974593468d524b38e8f623ae2c71 | |
parent | d042db1fee4a4f7a927cfce82da7030d29807aae (diff) | |
download | rt.equinox.p2-e77d48765fbefbc8a6144325a9ec1a54bafeeec3.tar.gz rt.equinox.p2-e77d48765fbefbc8a6144325a9ec1a54bafeeec3.tar.xz rt.equinox.p2-e77d48765fbefbc8a6144325a9ec1a54bafeeec3.zip |
Bug: Useless condition: it's known that timestamps.length != 0 at this
point
This condition always produces the same result as the value of the
involved variable that was narrowed before. Probably something else was
meant or the condition can be removed.
Rank: Troubling (14), confidence: High
Pattern: UC_USELESS_CONDITION
Type: UC, Category: STYLE (Dodgy code)
Change-Id: Ie18b3a775021ea7c964eb93d53b1cebf9baa64a9
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/171579
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java index 3bbbc48e6..f016c9408 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java @@ -905,7 +905,7 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService { return false; } - long currentTimestamp = (timestamps.length == 0) ? -1 : timestamps[timestamps.length - 1]; + long currentTimestamp = timestamps[timestamps.length - 1]; if (profile.getTimestamp() != currentTimestamp) { if (DebugHelper.DEBUG_PROFILE_REGISTRY) DebugHelper.debug(PROFILE_REGISTRY, "check timestamp: expected " + profile.getTimestamp() + " but was " + currentTimestamp); //$NON-NLS-1$ //$NON-NLS-2$ |