Skip to content
Merged
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
@@ -1,5 +1,8 @@
package io.ebean.enhance.ant;

import java.util.ArrayList;
import java.util.List;

import io.ebean.enhance.Transformer;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
Expand Down Expand Up @@ -55,12 +58,14 @@ public void execute() throws BuildException {
* Combine the packages into the transformArgs to filter enhanced classes via PackageFilter.
*/
static String combine(String packages, String transformArgs) {
StringBuilder args = new StringBuilder();
args.append("packages=").append(packages.replace("**", ""));
List<String> args = new ArrayList<>();
if (packages != null && !packages.isEmpty()) {
args.add("packages=" + packages.replace("**", ""));
}
if (transformArgs != null && !transformArgs.isEmpty()) {
args.append(',').append(transformArgs);
args.add(transformArgs);
}
return args.toString();
return String.join(";", args);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public boolean detectQueryBeanEnhancement(String className) {
* known libraries JDBC drivers etc can be skipped.
*/
public boolean isIgnoreClass(String className) {
if (packageFilter != null && packageFilter.ignore(className)) {
return true;
if (packageFilter != null) {
return packageFilter.ignore(className);
}
return ignoreClassHelper.isIgnoreClass(className);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AntEnhanceTaskTest {
@Test
void combine() {
String result = AntEnhanceTask.combine("com/one/**, com/two/**", "debug=1");
assertThat(result).isEqualTo("packages=com/one/, com/two/,debug=1");
assertThat(result).isEqualTo("packages=com/one/, com/two/;debug=1");
}

@Test
Expand Down