Rename toString_() and notify_() methods #237
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi!237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "stop-renaming-object-methods"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Until now, Java-GI automatically renamed methods with the same name as methods in
java.lang.Object. The reason for this is that default methods in Java interfaces are not allowed to override methods in Object. There were two places where this caused a compile error:g_icon_to_stringg_socket_connectable_to_stringWith the automatic renaming, these methods were available in Java-GI as
Icon.toString_()andSocketConnectable.toString_(). However, the methodg_object_notifywas impacted too, and it was available in Java-GI asGObject.notify_().I could have changed the automatic renaming to exclude
g_object_notifybut I decided to revert this entirely, and add manually rename the twoto_stringmethods in Gio with metadata.This is the result:
org.gnome.gio.Icon.toString_()is now available asserializeToString()org.gnome.gio.SocketConnectable.toString_()is now available asformatAsString()org.gnome.gobject.GObject.notify_()is now available asnotify()