forked from GradleUp/shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace static final String fields public / remove getters
Omitting the visibility modifier creates a Groovy _property_ [1], which is composed by: * a _private_ backing field * a public getter * (+ setter if the property is not `final`) It is unlikely to be an intended design as it makes access to those fields awkward from statically typed languages `ShadowBasePlugin.getCONFIGURATION_NAME()`. This commit replaces such _properties_ with _public fields_ only. This is a backward incompatible change as this removes public getters. Here is what the generated class looked liked before this commit (7.0.0): ``` $ javap -p -c -constants ShadowBasePlugin.class Compiled from "ShadowBasePlugin.groovy" public class com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin implements org.gradle.api.Plugin<org.gradle.api.Project>, groovy.lang.GroovyObject { private static final java.lang.String EXTENSION_NAME = "shadow"; private static final java.lang.String CONFIGURATION_NAME = "shadow"; [...] public static java.lang.String getEXTENSION_NAME(); Code: 0: getstatic GradleUp#86 // Field EXTENSION_NAME:Ljava/lang/String; 3: areturn public static java.lang.String getCONFIGURATION_NAME(); Code: 0: getstatic GradleUp#111 // Field CONFIGURATION_NAME:Ljava/lang/String; 3: areturn ``` [1] https://groovy-lang.org/objectorientation.html#properties
- Loading branch information
Showing
8 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters