Skip to content
Open
Show file tree
Hide file tree
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 @@ -169,13 +169,13 @@ private String checkPoolName(String name) throws FormException {
throw new FormException("Pool name must not be empty", "name");
}

if (Pattern.matches("\\w+", name)) {
return name.toUpperCase();
} else {
if (!Pattern.matches("\\w+", name)) {
throw new FormException(
"The name: \"" + name + "\" is invalid! It must not contain other than word characters!", "name"
"The name: \"" + name + "\" is invalid! It must not contain other than word characters!", "name"
);
}

return name;
}

private void checkPortNumbers(String ports) throws FormException {
Expand All @@ -190,7 +190,7 @@ public Pool[] getPools() {

public Pool getPoolByName(String poolName) throws PoolNotDefinedException {
for (Pool p : pools) {
if (p.name.toUpperCase().equals(poolName.toUpperCase())) {
if (p.name.equals(poolName)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a breaking change BTW. I think the author just wanted to have a case-insensitive comparison, so I would use http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#equalsIgnoreCase(java.lang.String)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For case-sensitive system i will be unable to use two variables different in registry.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But i can accept such limitation. Then comparison may really makes sense.

return p;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public abstract class PortType implements ExtensionPoint, Describable<PortType>,
public final String name;

protected PortType(String name) {
// to avoid platform difference issue in case sensitivity of environment variables,
// always use uppser case.
this.name = name.toUpperCase();
this.name = name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a breaking change as well. It should be managed by a system property IMO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin must just save what user entered and then pass to environment. Current behaviour absolutely not obvious. I'm configuring job, entering variable "my_port", pressing save, then build is broken because code decided to do upper case. And this is really breaking change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

managed by a system property IMO

Property can't care about slave systems. Passing as is without doing magic is the best behaviour imho.

}

/**
Expand Down