| | |
| | | import static org.opends.messages.ToolMessages.ERR_BUILDVERSION_MALFORMED; |
| | | import static org.opends.messages.ToolMessages.ERR_BUILDVERSION_MISMATCH; |
| | | import static org.opends.server.config.ConfigConstants.CONFIG_DIR_NAME; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | |
| | | } |
| | | finally |
| | | { |
| | | if (reader != null) |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } |
| | | catch (final Exception e) |
| | | { |
| | | // Ignore. |
| | | } |
| | | } |
| | | closeSilently(reader); |
| | | } |
| | | } |
| | | |
| | |
| | | this.rev = rev; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int compareTo(final BuildVersion version) |
| | | { |
| | | if (major == version.major) |
| | |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean equals(final Object obj) |
| | | { |
| | | if (this == obj) |
| | |
| | | else if (obj instanceof BuildVersion) |
| | | { |
| | | final BuildVersion other = (BuildVersion) obj; |
| | | return (major == other.major) && (minor == other.minor) |
| | | && (point == other.point) && (rev == other.rev); |
| | | return major == other.major && minor == other.minor |
| | | && point == other.point && rev == other.rev; |
| | | } |
| | | else |
| | | { |
| | |
| | | return rev; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int hashCode() |
| | | { |
| | | return Arrays.hashCode(new int[] { major, minor, point, (int) (rev >>> 32), |
| | | (int) (rev & 0xFFFFL) }); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String toString() |
| | | { |
| | | final StringBuilder builder = new StringBuilder(); |