The original problem raised in
JENKINS-18629 is that if a Descriptor defines a custom logic in the newInstance method, such logic doesn't take effect when the object appears in the middle of data-binding a tree of objects.
The original fix that had caused the mess tried to fix this by having Stapler call into newInstance method, instead of instantiating @DataBoundConstructor directly like it did before.
Instead, I propose we deprecate Descriptor.newInstance(StaplerRequest,JSONObject) method, then define an interface in Stapler that allows an object to nominate its own replacement, much like how readReplace() method works in Java Serialization.
This allows likes of GithubProjectProperty (see above) to return null, and encourage likes of this and this to be eliminated going forward.
Gradle class, which is mentioned in the initial description of
JENKINS-18629, overrides the newInstance method just to manipulate the JSON tree structure to flatten some of the intermediates objects. This is best handled by introducing the inline attribute to the radioBlock tag much like the attribute of the same name in the optionalBlock tag.