Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce kafka docker version constraint #1493

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,26 @@ public void stop() {
class Version implements Comparable<Version> {

private String version;
private boolean comparable = true;

public final String get() {
return this.version;
}

public final boolean isComparable() {
return this.comparable;
}

public Version(String version) {
if (version == null) throw new IllegalArgumentException("Version can not be null");
if (!version.matches("[0-9]+(\\.[0-9]+)*"))
throw new IllegalArgumentException("Invalid version format");
if (!version.matches("[0-9]+(\\.[0-9]+)*")) this.comparable = false;
this.version = version;
}

@Override
public int compareTo(Version that) {
if (that == null) return 1;
if (!this.comparable || !that.isComparable()) return 1;
String[] thisParts = this.get().split("\\.");
String[] thatParts = that.get().split("\\.");
int length = Math.max(thisParts.length, thatParts.length);
Expand Down