2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-26 00:37:10 -07:00

Migrated syntax to Java 8+

This commit is contained in:
Erik C. Thauvin 2023-09-15 05:02:50 -07:00
parent 6d082c1bac
commit e69f4fe554
5 changed files with 21 additions and 23 deletions

View file

@ -132,11 +132,9 @@ public class BldBuild extends AbstractRife2Build {
f.perms(0755); f.perms(0755);
}); });
}); });
b.dir("lib", l -> { b.dir("lib", l -> l.file("bld-wrapper.jar", f -> f.move(path(tmp, "lib", "bld", "bld-wrapper.jar"))));
l.file("bld-wrapper.jar", f -> f.move(path(tmp, "lib", "bld", "bld-wrapper.jar")));
}); });
}); t.dir("lib", DirBuilder::delete);
t.dir("lib", l -> l.delete());
}); });
zipBldOperation zipBldOperation

View file

@ -89,8 +89,7 @@ public class Xml2MavenMetadata extends Xml2Data implements MavenMetadata {
public void endDocument() public void endDocument()
throws SAXException { throws SAXException {
// determine latest stable version by removing pre-release qualifiers // determine latest stable version by removing pre-release qualifiers
var filtered_versions = new TreeSet<VersionNumber>(); var filtered_versions = new TreeSet<>(versions_.stream()
filtered_versions.addAll(versions_.stream()
.filter(v -> { .filter(v -> {
if (v.qualifier() == null) return true; if (v.qualifier() == null) return true;
var q = v.qualifier().toLowerCase(); var q = v.qualifier().toLowerCase();

View file

@ -364,10 +364,10 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
public T fromArguments(List<String> arguments) { public T fromArguments(List<String> arguments) {
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
if (arguments.size() > 0) { if (!arguments.isEmpty()) {
package_name = arguments.remove(0); package_name = arguments.remove(0);
} }
if (arguments.size() > 0) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
} }
if ((package_name == null || project_name == null) && System.console() == null) { if ((package_name == null || project_name == null) && System.console() == null) {

View file

@ -27,13 +27,13 @@ public class CreateOperation {
String type = null; String type = null;
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
if (arguments.size() > 0) { if (!arguments.isEmpty()) {
type = arguments.remove(0); type = arguments.remove(0);
} }
if (arguments.size() > 0) { if (!arguments.isEmpty()) {
package_name = arguments.remove(0); package_name = arguments.remove(0);
} }
if (arguments.size() > 0) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
} }
if ((type == null || package_name == null || project_name == null) && System.console() == null) { if ((type == null || package_name == null || project_name == null) && System.console() == null) {

View file

@ -94,6 +94,7 @@ public class JarOperation extends AbstractOperation<JarOperation> {
// don't use putAll since Attributes does an instanceof check // don't use putAll since Attributes does an instanceof check
// on the map being passed in, causing it to fail if it's not // on the map being passed in, causing it to fail if it's not
// and instance of Attributes // and instance of Attributes
//noinspection UseBulkOperation
attributes.put(entry.getKey(), entry.getValue()); attributes.put(entry.getKey(), entry.getValue());
// ^^^ READ above, don't use putAll // ^^^ READ above, don't use putAll
} }