apache / apache/beam

Invert JavaNature configuration

Open
#18,838 0 comments 0 reactions 0 assignees View on GitHub
build gradle improvement P3
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

Today the applyJavaNature method demonstrates a significant programming and build config anti-pattern: one giant method with unclear/no spec and some flags to tweak what it does, that can only really be understood by reading its full code.

Instead, best practice would be to separate the functionality controlled by each flag into a block that a module can call. It is not wrong to pass configuration parameters, but in this case that's not really what is going on.

Since the flags are "on by default" and serve to suppress things like findbugs, this just means breaking out the findbugs into a separate bit. We can always also have a convenience three-liner that calls the basics, calls findbugs, etc.

Imported from Jira [BEAM-4103](https://issues.apache.org/jira/browse/BEAM-4103). Original Jira may contain additional context.
Reported by: kenn.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.