diff options
author | Carsten Hammer | 2020-11-01 13:14:32 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-02-11 11:33:58 +0000 |
commit | ea67d55742fa800507e68358a5c0fcc476401628 (patch) | |
tree | 15cd487a243f57b414e98737f757d2b212100d33 | |
parent | d220a195a3e12fb2cb679f96aa7d190970c1d0df (diff) | |
download | rt.equinox.p2-ea67d55742fa800507e68358a5c0fcc476401628.tar.gz rt.equinox.p2-ea67d55742fa800507e68358a5c0fcc476401628.tar.xz rt.equinox.p2-ea67d55742fa800507e68358a5c0fcc476401628.zip |
Bug: Repeated conditional test inY20210211-1200I20210211-1810
org.eclipse.equinox.spi.p2.publisher.PublisherHelper.fromOSGiVersion(Version)
The code contains a conditional test is performed twice, one right after
the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is
intended to be something else (e.g., x == 0 || y == 0).
Rank: Scary (6), confidence: High
Pattern: RpC_REPEATED_CONDITIONAL_TEST
Type: RpC, Category: CORRECTNESS (Correctness)
Change-Id: I9d5f1d8c05859048fc66c131d6672e1ab962a7a2
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java | 2 |
1 files changed, 1 insertions, 1 deletions
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 1af645601..d62b50b90 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 @@ -224,7 +224,7 @@ public class PublisherHelper { if (version == null) { return Version.MAX_VERSION; } - if (version.getMajor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE) { + if (version.getMajor() == Integer.MAX_VALUE && version.getMinor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE) { return Version.MAX_VERSION; } return Version.createOSGi(version.getMajor(), version.getMinor(), version.getMicro(), version.getQualifier()); |