Skip to content

Use of Nullable on a statement puts the annotation on its own line #442

Closed
@snicoll

Description

@snicoll

This is a follow-up issue on the nullability support. I am using 0.0.45.

Consider the following (silly) example:

private @Nullable Object[] doSomething(int length) {
	@Nullable Object[] args = new Object[length];
	for (int i = 0; i < length; i++) {
		args[i] = (i % 2 == 0) ? Boolean.TRUE : null;
	}
	return args;
}

If I ask to reformat, this does:

private @Nullable Object[] doSomething(int length) {
	@Nullable
	Object[] args = new Object[length];
	for (int i = 0; i < length; i++) {
		args[i] = (i % 2 == 0) ? Boolean.TRUE : null;
	}
	return args;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions