GROOVY-11237: Support static interface methods#2001
Merged
paulk-asert merged 1 commit intoapache:masterfrom Nov 29, 2023
Merged
GROOVY-11237: Support static interface methods#2001paulk-asert merged 1 commit intoapache:masterfrom
paulk-asert merged 1 commit intoapache:masterfrom
Conversation
eric-milles
reviewed
Nov 28, 2023
Member
eric-milles
left a comment
There was a problem hiding this comment.
Also JavaStubGenerator needs to write "static". And if you support non-public static methods, the visibility modifier.
private void printMethod(final PrintWriter out, final ClassNode classNode, final MethodNode methodNode) {
if (methodNode.isStaticConstructor()) return;
if (methodNode.isPrivate() || !Utilities.isJavaIdentifier(methodNode.getName())) return;
if (methodNode.isSynthetic() && (methodNode.getName().equals("$getStaticMetaClass"))) return;
printAnnotations(out, methodNode);
if (!isInterfaceOrTrait(classNode)) {
int modifiers = methodNode.getModifiers();
if (classNode.isEnum()) modifiers &= ~Opcodes.ACC_ABSTRACT;
else if (isDefaultTraitImpl(methodNode)) modifiers ^= Opcodes.ACC_ABSTRACT;
if (methodNode.isSyntheticPublic() && hasPackageScopeXform(methodNode, PackageScopeTarget.METHODS)) modifiers &= ~Opcodes.ACC_PUBLIC;
printModifiers(out, modifiers);
} else if (methodNode.isDefault()) {
out.print("default ");
} else if (methodNode.isStatic()) { // ADDED
out.print("static ");
}
Member
|
With static method support so close at hand, did you think of re-rolling 5.0.0-alpha-3? |
Member
|
I have all these changes together locally if you'd like me to push a branch or commit. |
Contributor
Author
Let's go with the current release and shoot for another before the end of the year. |
2091aa0 to
9987f31
Compare
Contributor
Author
I've included some of them with tweaks. I'll merge when ready but feel free to amend further if needed. |
9987f31 to
c3c7ec3
Compare
c3c7ec3 to
44dbaba
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.