Skip to content

MOE Sync 2019-12-23 #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2019
Merged
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
Expand Up @@ -3546,26 +3546,27 @@ private boolean hasTrailingToken(Input input, List<? extends Tree> nodes, String

/**
* Can a local with a set of modifiers be declared with horizontal annotations? This is currently
* true if there is at most one marker annotation, and no others.
* true if there is at most one parameterless annotation, and no others.
*
* @param modifiers the list of {@link ModifiersTree}s
* @return whether the local can be declared with horizontal annotations
*/
private Direction canLocalHaveHorizontalAnnotations(ModifiersTree modifiers) {
int markerAnnotations = 0;
int parameterlessAnnotations = 0;
for (AnnotationTree annotation : modifiers.getAnnotations()) {
if (annotation.getArguments().isEmpty()) {
markerAnnotations++;
parameterlessAnnotations++;
}
}
return markerAnnotations <= 1 && markerAnnotations == modifiers.getAnnotations().size()
return parameterlessAnnotations <= 1
&& parameterlessAnnotations == modifiers.getAnnotations().size()
? Direction.HORIZONTAL
: Direction.VERTICAL;
}

/**
* Should a field with a set of modifiers be declared with horizontal annotations? This is
* currently true if all annotations are marker annotations.
* currently true if all annotations are parameterless annotations.
*/
private Direction fieldAnnotationDirection(ModifiersTree modifiers) {
for (AnnotationTree annotation : modifiers.getAnnotations()) {
Expand Down