Skip to content

Javadoc inaccuracy in SpringApplicationBuilder.properties(Properties) #22962

@mjustin

Description

@mjustin

The method Javadocs for SpringApplicationBuilder.properties(Properties) are a bit inaccurate, due to an apparent copy/paste from SpringApplicationBuilder.properties(String... defaultProperties). This is the case in the latest 2.3.1, and has been for quite some time.

	/**
	 * Default properties for the environment in the form {@code key=value} or
	 * {@code key:value}.
	 * @param defaultProperties the properties to set.
	 * @return the current builder
	 */
	public SpringApplicationBuilder properties(Properties defaultProperties) {
		return properties(getMapFromProperties(defaultProperties));
	}

Since this is a Properties object, it uses the standard key/value map structure of that object type, and not the formatted key=value or key:value strings mentioned in the doc comment.

Presumably, it could have the same doc comment as the SpringApplicationBuilder.properties(Map<String, Object> defaults) version:

Default properties for the environment. Multiple calls to this method are cumulative.

On that note, I notice an inconsistency in the Javadocs between the three properties methods. "Multiple calls to this method are cumulative." is applicable to all three, but is only called out in the Map<String, Object> version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions