Upgrade to spring-javaformat 0.0.6
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,9 +51,9 @@ public class SpringApplicationLauncher {
|
||||
/**
|
||||
* Launches the application created using the given {@code sources}. The application
|
||||
* is launched with the given {@code args}.
|
||||
* @param sources The sources for the application
|
||||
* @param args The args for the application
|
||||
* @return The application's {@code ApplicationContext}
|
||||
* @param sources the sources for the application
|
||||
* @param args the args for the application
|
||||
* @return the application's {@code ApplicationContext}
|
||||
* @throws Exception if the launch fails
|
||||
*/
|
||||
public Object launch(Object[] sources, String[] args) throws Exception {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SpringApplicationWebApplicationInitializer
|
||||
|
||||
private Manifest getManifest(ServletContext servletContext) throws IOException {
|
||||
InputStream stream = servletContext.getResourceAsStream("/META-INF/MANIFEST.MF");
|
||||
Manifest manifest = (stream != null ? new Manifest(stream) : null);
|
||||
Manifest manifest = (stream != null) ? new Manifest(stream) : null;
|
||||
return manifest;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,7 +29,7 @@ public interface CommandFactory {
|
||||
|
||||
/**
|
||||
* Returns the CLI {@link Command}s.
|
||||
* @return The commands
|
||||
* @return the commands
|
||||
*/
|
||||
Collection<Command> getCommands();
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ public class CommandRunner implements Iterable<Command> {
|
||||
ExitStatus result = run(argsWithoutDebugFlags);
|
||||
// The caller will hang up if it gets a non-zero status
|
||||
if (result != null && result.isHangup()) {
|
||||
return (result.getCode() > 0 ? result.getCode() : 0);
|
||||
return (result.getCode() > 0) ? result.getCode() : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ public class CommandRunner implements Iterable<Command> {
|
||||
}
|
||||
|
||||
protected boolean errorMessage(String message) {
|
||||
Log.error(message != null ? message : "Unexpected error");
|
||||
Log.error((message != null) ? message : "Unexpected error");
|
||||
return message != null;
|
||||
}
|
||||
|
||||
@@ -280,8 +280,8 @@ public class CommandRunner implements Iterable<Command> {
|
||||
String usageHelp = command.getUsageHelp();
|
||||
String description = command.getDescription();
|
||||
Log.info(String.format("%n %1$s %2$-15s%n %3$s", command.getName(),
|
||||
(usageHelp != null ? usageHelp : ""),
|
||||
(description != null ? description : "")));
|
||||
(usageHelp != null) ? usageHelp : "",
|
||||
(description != null) ? description : ""));
|
||||
}
|
||||
}
|
||||
Log.info("");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,7 +30,7 @@ public class HelpExample {
|
||||
|
||||
/**
|
||||
* Create a new {@link HelpExample} instance.
|
||||
* @param description The description (in the form "to ....")
|
||||
* @param description the description (in the form "to ....")
|
||||
* @param example the example
|
||||
*/
|
||||
public HelpExample(String description, String example) {
|
||||
|
||||
@@ -239,7 +239,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
|
||||
private String commaDelimitedClassNames(Class<?>[] classes) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < classes.length; i++) {
|
||||
builder.append(i != 0 ? "," : "");
|
||||
builder.append((i != 0) ? "," : "");
|
||||
builder.append(classes[i].getName());
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
@@ -107,7 +107,7 @@ public class HelpCommand extends AbstractCommand {
|
||||
}
|
||||
Collection<HelpExample> examples = command.getExamples();
|
||||
if (examples != null) {
|
||||
Log.info(examples.size() != 1 ? "examples:" : "example:");
|
||||
Log.info((examples.size() != 1) ? "examples:" : "example:");
|
||||
Log.info("");
|
||||
for (HelpExample example : examples) {
|
||||
Log.info(" " + example.getDescription() + ":");
|
||||
|
||||
@@ -45,7 +45,7 @@ public class HintCommand extends AbstractCommand {
|
||||
@Override
|
||||
public ExitStatus run(String... args) throws Exception {
|
||||
try {
|
||||
int index = (args.length != 0 ? Integer.valueOf(args[0]) - 1 : 0);
|
||||
int index = (args.length != 0) ? Integer.valueOf(args[0]) - 1 : 0;
|
||||
List<String> arguments = new ArrayList<String>(args.length);
|
||||
for (int i = 2; i < args.length; i++) {
|
||||
arguments.add(args[i]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -241,7 +241,7 @@ class InitializrService {
|
||||
private String getContent(HttpEntity entity) throws IOException {
|
||||
ContentType contentType = ContentType.getOrDefault(entity);
|
||||
Charset charset = contentType.getCharset();
|
||||
charset = (charset != null ? charset : UTF_8);
|
||||
charset = (charset != null) ? charset : UTF_8;
|
||||
byte[] content = FileCopyUtils.copyToByteArray(entity.getContent());
|
||||
return new String(content, charset);
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ class ProjectGenerationRequest {
|
||||
}
|
||||
if (this.output != null) {
|
||||
int i = this.output.lastIndexOf('.');
|
||||
return (i != -1 ? this.output.substring(0, i) : this.output);
|
||||
return (i != -1) ? this.output.substring(0, i) : this.output;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -46,8 +46,8 @@ class ProjectGenerator {
|
||||
public void generateProject(ProjectGenerationRequest request, boolean force)
|
||||
throws IOException {
|
||||
ProjectGenerationResponse response = this.initializrService.generate(request);
|
||||
String fileName = (request.getOutput() != null ? request.getOutput()
|
||||
: response.getFileName());
|
||||
String fileName = (request.getOutput() != null) ? request.getOutput()
|
||||
: response.getFileName();
|
||||
if (shouldExtract(request, response)) {
|
||||
if (isZipArchive(response)) {
|
||||
extractProject(response, request.getOutput(), force);
|
||||
@@ -101,8 +101,8 @@ class ProjectGenerator {
|
||||
|
||||
private void extractProject(ProjectGenerationResponse entity, String output,
|
||||
boolean overwrite) throws IOException {
|
||||
File outputFolder = (output != null ? new File(output)
|
||||
: new File(System.getProperty("user.dir")));
|
||||
File outputFolder = (output != null) ? new File(output)
|
||||
: new File(System.getProperty("user.dir"));
|
||||
if (!outputFolder.exists()) {
|
||||
outputFolder.mkdirs();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,8 +31,8 @@ interface DependencyResolver {
|
||||
/**
|
||||
* Resolves the given {@code artifactIdentifiers}, typically in the form
|
||||
* "group:artifact:version", and their dependencies.
|
||||
* @param artifactIdentifiers The artifacts to resolve
|
||||
* @return The {@code File}s for the resolved artifacts
|
||||
* @param artifactIdentifiers the artifacts to resolve
|
||||
* @return the {@code File}s for the resolved artifacts
|
||||
* @throws Exception if dependency resolution fails
|
||||
*/
|
||||
List<File> resolve(List<String> artifactIdentifiers) throws Exception;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -59,7 +59,7 @@ public class InstallCommand extends OptionParsingCommand {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
String message = ex.getMessage();
|
||||
Log.error(message != null ? message : ex.getClass().toString());
|
||||
Log.error((message != null) ? message : ex.getClass().toString());
|
||||
}
|
||||
return ExitStatus.OK;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -75,7 +75,7 @@ public class UninstallCommand extends OptionParsingCommand {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
String message = ex.getMessage();
|
||||
Log.error(message != null ? message : ex.getClass().toString());
|
||||
Log.error((message != null) ? message : ex.getClass().toString());
|
||||
}
|
||||
return ExitStatus.OK;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,8 @@ public class OptionHandler {
|
||||
OptionHelpAdapter(OptionDescriptor descriptor) {
|
||||
this.options = new LinkedHashSet<String>();
|
||||
for (String option : descriptor.options()) {
|
||||
this.options.add((option.length() != 1 ? "--" : "-") + option);
|
||||
String prefix = (option.length() != 1) ? "--" : "-";
|
||||
this.options.add(prefix + option);
|
||||
}
|
||||
if (this.options.contains("--cp")) {
|
||||
this.options.remove("--cp");
|
||||
|
||||
@@ -129,7 +129,7 @@ public class CommandCompleter extends StringsCompleter {
|
||||
OptionHelpLine(OptionHelp optionHelp) {
|
||||
StringBuilder options = new StringBuilder();
|
||||
for (String option : optionHelp.getOptions()) {
|
||||
options.append(options.length() != 0 ? ", " : "");
|
||||
options.append((options.length() != 0) ? ", " : "");
|
||||
options.append(option);
|
||||
}
|
||||
this.options = options.toString();
|
||||
|
||||
@@ -145,7 +145,7 @@ public class Shell {
|
||||
|
||||
private void printBanner() {
|
||||
String version = getClass().getPackage().getImplementationVersion();
|
||||
version = (version != null ? " (v" + version + ")" : "");
|
||||
version = (version != null) ? " (v" + version + ")" : "";
|
||||
System.out.println(ansi("Spring Boot", Code.BOLD).append(version, Code.FAINT));
|
||||
System.out.println(ansi("Hit TAB to complete. Type 'help' and hit "
|
||||
+ "RETURN for help, and 'exit' to quit."));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -185,7 +185,7 @@ public class DependencyCustomizer {
|
||||
* Add dependencies and all of their dependencies. The group ID and version of the
|
||||
* dependencies are resolved from the modules using the customizer's
|
||||
* {@link ArtifactCoordinatesResolver}.
|
||||
* @param modules The module IDs
|
||||
* @param modules the module IDs
|
||||
* @return this {@link DependencyCustomizer} for continued use
|
||||
*/
|
||||
public DependencyCustomizer add(String... modules) {
|
||||
@@ -199,7 +199,7 @@ public class DependencyCustomizer {
|
||||
* Add a single dependency and, optionally, all of its dependencies. The group ID and
|
||||
* version of the dependency are resolved from the module using the customizer's
|
||||
* {@link ArtifactCoordinatesResolver}.
|
||||
* @param module The module ID
|
||||
* @param module the module ID
|
||||
* @param transitive {@code true} if the transitive dependencies should also be added,
|
||||
* otherwise {@code false}.
|
||||
* @return this {@link DependencyCustomizer} for continued use
|
||||
@@ -212,9 +212,9 @@ public class DependencyCustomizer {
|
||||
* Add a single dependency with the specified classifier and type and, optionally, all
|
||||
* of its dependencies. The group ID and version of the dependency are resolved from
|
||||
* the module by using the customizer's {@link ArtifactCoordinatesResolver}.
|
||||
* @param module The module ID
|
||||
* @param classifier The classifier, may be {@code null}
|
||||
* @param type The type, may be {@code null}
|
||||
* @param module the module ID
|
||||
* @param classifier the classifier, may be {@code null}
|
||||
* @param type the type, may be {@code null}
|
||||
* @param transitive {@code true} if the transitive dependencies should also be added,
|
||||
* otherwise {@code false}.
|
||||
* @return this {@link DependencyCustomizer} for continued use
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
|
||||
InputStream resourceStream = super.getResourceAsStream(name);
|
||||
if (resourceStream == null) {
|
||||
byte[] bytes = this.classResources.get(name);
|
||||
resourceStream = (bytes != null ? new ByteArrayInputStream(bytes) : null);
|
||||
resourceStream = (bytes != null) ? new ByteArrayInputStream(bytes) : null;
|
||||
}
|
||||
return resourceStream;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -77,7 +77,7 @@ public class ResolveDependencyCoordinatesTransformation
|
||||
Expression expression = annotation.getMember("value");
|
||||
if (expression instanceof ConstantExpression) {
|
||||
Object value = ((ConstantExpression) expression).getValue();
|
||||
return (value instanceof String ? (String) value : null);
|
||||
return (value instanceof String) ? (String) value : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,24 +31,24 @@ public interface ArtifactCoordinatesResolver {
|
||||
/**
|
||||
* Gets the group id of the artifact identified by the given {@code module}. Returns
|
||||
* {@code null} if the artifact is unknown to the resolver.
|
||||
* @param module The id of the module
|
||||
* @return The group id of the module
|
||||
* @param module the id of the module
|
||||
* @return the group id of the module
|
||||
*/
|
||||
String getGroupId(String module);
|
||||
|
||||
/**
|
||||
* Gets the artifact id of the artifact identified by the given {@code module}.
|
||||
* Returns {@code null} if the artifact is unknown to the resolver.
|
||||
* @param module The id of the module
|
||||
* @return The artifact id of the module
|
||||
* @param module the id of the module
|
||||
* @return the artifact id of the module
|
||||
*/
|
||||
String getArtifactId(String module);
|
||||
|
||||
/**
|
||||
* Gets the version of the artifact identified by the given {@code module}. Returns
|
||||
* {@code null} if the artifact is unknown to the resolver.
|
||||
* @param module The id of the module
|
||||
* @return The version of the module
|
||||
* @param module the id of the module
|
||||
* @return the version of the module
|
||||
*/
|
||||
String getVersion(String module);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -98,22 +98,6 @@ public final class Dependency {
|
||||
return this.exclusions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.groupId + ":" + this.artifactId + ":" + this.version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + this.groupId.hashCode();
|
||||
result = prime * result + this.artifactId.hashCode();
|
||||
result = prime * result + this.version.hashCode();
|
||||
result = prime * result + this.exclusions.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
@@ -134,6 +118,22 @@ public final class Dependency {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + this.groupId.hashCode();
|
||||
result = prime * result + this.artifactId.hashCode();
|
||||
result = prime * result + this.version.hashCode();
|
||||
result = prime * result + this.exclusions.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.groupId + ":" + this.artifactId + ":" + this.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* A dependency exclusion.
|
||||
*/
|
||||
@@ -166,16 +166,6 @@ public final class Dependency {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.groupId + ":" + this.artifactId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.groupId.hashCode() * 31 + this.artifactId.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
@@ -194,6 +184,16 @@ public final class Dependency {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.groupId.hashCode() * 31 + this.artifactId.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.groupId + ":" + this.artifactId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,7 @@ public interface DependencyManagement {
|
||||
|
||||
/**
|
||||
* Finds the managed dependency with the given {@code artifactId}.
|
||||
* @param artifactId The artifact ID of the dependency to find
|
||||
* @param artifactId the artifact ID of the dependency to find
|
||||
* @return the dependency, or {@code null}
|
||||
*/
|
||||
Dependency find(String artifactId);
|
||||
|
||||
@@ -42,13 +42,13 @@ public class DependencyManagementArtifactCoordinatesResolver
|
||||
@Override
|
||||
public String getGroupId(String artifactId) {
|
||||
Dependency dependency = find(artifactId);
|
||||
return (dependency != null ? dependency.getGroupId() : null);
|
||||
return (dependency != null) ? dependency.getGroupId() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArtifactId(String id) {
|
||||
Dependency dependency = find(id);
|
||||
return (dependency != null ? dependency.getArtifactId() : null);
|
||||
return (dependency != null) ? dependency.getArtifactId() : null;
|
||||
}
|
||||
|
||||
private Dependency find(String id) {
|
||||
@@ -69,7 +69,7 @@ public class DependencyManagementArtifactCoordinatesResolver
|
||||
@Override
|
||||
public String getVersion(String module) {
|
||||
Dependency dependency = find(module);
|
||||
return (dependency != null ? dependency.getVersion() : null);
|
||||
return (dependency != null) ? dependency.getVersion() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class AetherGrapeEngine implements GrapeEngine {
|
||||
|
||||
private boolean isTransitive(Map<?, ?> dependencyMap) {
|
||||
Boolean transitive = (Boolean) dependencyMap.get("transitive");
|
||||
return (transitive != null ? transitive : true);
|
||||
return (transitive != null) ? transitive : true;
|
||||
}
|
||||
|
||||
private List<Dependency> getDependencies(DependencyResult dependencyResult) {
|
||||
@@ -231,7 +231,7 @@ public class AetherGrapeEngine implements GrapeEngine {
|
||||
|
||||
private GroovyClassLoader getClassLoader(Map args) {
|
||||
GroovyClassLoader classLoader = (GroovyClassLoader) args.get("classLoader");
|
||||
return (classLoader != null ? classLoader : this.classLoader);
|
||||
return (classLoader != null) ? classLoader : this.classLoader;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,9 +51,9 @@ public class DefaultRepositorySystemSessionAutoConfiguration
|
||||
ProxySelector existing = session.getProxySelector();
|
||||
if (existing == null || !(existing instanceof CompositeProxySelector)) {
|
||||
JreProxySelector fallback = new JreProxySelector();
|
||||
ProxySelector selector = (existing != null
|
||||
ProxySelector selector = (existing != null)
|
||||
? new CompositeProxySelector(Arrays.asList(existing, fallback))
|
||||
: fallback);
|
||||
: fallback;
|
||||
session.setProxySelector(selector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DependencyResolutionContext {
|
||||
dependency = this.managedDependencyByGroupAndArtifact
|
||||
.get(getIdentifier(groupId, artifactId));
|
||||
}
|
||||
return (dependency != null ? dependency.getArtifact().getVersion() : null);
|
||||
return (dependency != null) ? dependency.getArtifact().getVersion() : null;
|
||||
}
|
||||
|
||||
public List<Dependency> getManagedDependencies() {
|
||||
@@ -104,10 +104,10 @@ public class DependencyResolutionContext {
|
||||
this.managedDependencyByGroupAndArtifact.put(getIdentifier(aetherDependency),
|
||||
aetherDependency);
|
||||
}
|
||||
this.dependencyManagement = (this.dependencyManagement != null
|
||||
this.dependencyManagement = (this.dependencyManagement != null)
|
||||
? new CompositeDependencyManagement(dependencyManagement,
|
||||
this.dependencyManagement)
|
||||
: dependencyManagement);
|
||||
: dependencyManagement;
|
||||
this.artifactCoordinatesResolver = new DependencyManagementArtifactCoordinatesResolver(
|
||||
this.dependencyManagement);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ public class DependencyResolutionFailedException extends RuntimeException {
|
||||
/**
|
||||
* Creates a new {@code DependencyResolutionFailedException} with the given
|
||||
* {@code cause}.
|
||||
* @param cause The cause of the resolution failure
|
||||
* @param cause the cause of the resolution failure
|
||||
*/
|
||||
public DependencyResolutionFailedException(Throwable cause) {
|
||||
super(cause);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,8 +35,8 @@ public final class RepositoryConfiguration {
|
||||
|
||||
/**
|
||||
* Creates a new {@code RepositoryConfiguration} instance.
|
||||
* @param name The name of the repository
|
||||
* @param uri The uri of the repository
|
||||
* @param name the name of the repository
|
||||
* @param uri the uri of the repository
|
||||
* @param snapshotsEnabled {@code true} if the repository should enable access to
|
||||
* snapshots, {@code false} otherwise
|
||||
*/
|
||||
@@ -54,12 +54,6 @@ public final class RepositoryConfiguration {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RepositoryConfiguration [name=" + this.name + ", uri=" + this.uri
|
||||
+ ", snapshotsEnabled=" + this.snapshotsEnabled + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the URI of the repository.
|
||||
* @return the repository URI
|
||||
@@ -76,11 +70,6 @@ public final class RepositoryConfiguration {
|
||||
return this.snapshotsEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(this.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
@@ -96,4 +85,15 @@ public final class RepositoryConfiguration {
|
||||
return ObjectUtils.nullSafeEquals(this.name, other.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(this.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RepositoryConfiguration [name=" + this.name + ", uri=" + this.uri
|
||||
+ ", snapshotsEnabled=" + this.snapshotsEnabled + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -151,8 +151,9 @@ public class MavenSettings {
|
||||
PrintWriter printer = new PrintWriter(message);
|
||||
printer.println("Failed to determine active profiles:");
|
||||
for (ModelProblemCollectorRequest problem : problemCollector.getProblems()) {
|
||||
printer.println(" " + problem.getMessage() + (problem.getLocation() != null
|
||||
? " at " + problem.getLocation() : ""));
|
||||
String location = (problem.getLocation() != null)
|
||||
? " at " + problem.getLocation() : "";
|
||||
printer.println(" " + problem.getMessage() + location);
|
||||
if (problem.getException() != null) {
|
||||
printer.println(indentStackTrace(problem.getException(), " "));
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ public abstract class AbstractHttpClientMockTests {
|
||||
CloseableHttpResponse response = mock(CloseableHttpResponse.class);
|
||||
mockHttpEntity(response, request.content, request.contentType);
|
||||
mockStatus(response, 200);
|
||||
String header = (request.fileName != null
|
||||
? contentDispositionValue(request.fileName) : null);
|
||||
String header = (request.fileName != null)
|
||||
? contentDispositionValue(request.fileName) : null;
|
||||
mockHttpHeader(response, "Content-Disposition", header);
|
||||
given(this.http.execute(argThat(getForNonMetadata()))).willReturn(response);
|
||||
}
|
||||
@@ -120,8 +120,8 @@ public abstract class AbstractHttpClientMockTests {
|
||||
try {
|
||||
HttpEntity entity = mock(HttpEntity.class);
|
||||
given(entity.getContent()).willReturn(new ByteArrayInputStream(content));
|
||||
Header contentTypeHeader = (contentType != null
|
||||
? new BasicHeader("Content-Type", contentType) : null);
|
||||
Header contentTypeHeader = (contentType != null)
|
||||
? new BasicHeader("Content-Type", contentType) : null;
|
||||
given(entity.getContentType()).willReturn(contentTypeHeader);
|
||||
given(response.getEntity()).willReturn(entity);
|
||||
return entity;
|
||||
@@ -139,7 +139,7 @@ public abstract class AbstractHttpClientMockTests {
|
||||
|
||||
protected void mockHttpHeader(CloseableHttpResponse response, String headerName,
|
||||
String value) {
|
||||
Header header = (value != null ? new BasicHeader(headerName, value) : null);
|
||||
Header header = (value != null) ? new BasicHeader(headerName, value) : null;
|
||||
given(response.getFirstHeader(headerName)).willReturn(header);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -233,8 +233,8 @@ public class ProjectGenerationRequestTests {
|
||||
}
|
||||
|
||||
public void setBuildAndFormat(String build, String format) {
|
||||
this.request.setBuild(build != null ? build : "maven");
|
||||
this.request.setFormat(format != null ? format : "project");
|
||||
this.request.setBuild((build != null) ? build : "maven");
|
||||
this.request.setFormat((format != null) ? format : "project");
|
||||
this.request.setDetectType(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user