Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix samplejava compilation error and migrate non-deprecated methods #75

Merged

Conversation

VelikovPetar
Copy link

Part 1 (commit: 680c838)

There is currently a compile-time error in the samplejava project in the ImgurAttachmentFactory.java:
error: ImgurAttachmentFactory is not abstract and does not override abstract method createViewHolder(Message,MessageListListeners,ViewGroup) in AttachmentFactory

The problem origin is that the interface AttachmentFactory has default implementations for its methods, however those are not recognised when the interface is implemented by a java class, and an implementation must be provided for all such methods.

There was already an existing workaround for this case: Use the BaseAttachmentFactory abstract class as a base, instead of directly implementing the AttachmentFactory -> extending this class solves the issue and we don't need to provide an implementation for all methods.

Part 2 (commit: 3cdeb97)

Additionally, the ImgurAttachmentFactory was still using the now deprecated method: createViewHolder(message: Message, listeners: MessageListListenerContainer?, parent: ViewGroup): InnerAttachmentViewHolder. This method is now replaced with the new createViewHolder(message: Message, listeners: MessageListListeners?, parent: ViewGroup): InnerAttachmentViewHolder

@JcMinarro JcMinarro merged commit 7a69f5e into main Sep 24, 2024
2 checks passed
@JcMinarro JcMinarro deleted the bugfix/fix_java_sample_error_and_use_non_deprecated_methods branch September 24, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants