Skip to content

Conversation

Copy link

Copilot AI commented Nov 28, 2025

Kotlin data class Model uses default parameter values, which are inaccessible from Java. Java callers were required to provide all 5 constructor parameters.

Changes

  • Added @JvmOverloads annotation to Model constructor to generate overloaded constructors for Java

Usage from Java (now works)

// Before: required all parameters
new Model(R.drawable.icon, R.id.dest, 0, R.string.text, R.string.count);

// After: can use any subset
new Model(R.drawable.icon);
new Model(R.drawable.icon, R.id.dest);
new Model(R.drawable.icon, R.id.dest, 0, R.string.text);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.6-bin/afr5mpiioh2wthjmwnkmdsd5w/gradle-8.6/lib/gradle-launcher-8.6.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.6-bin/afr5mpiioh2wthjmwnkmdsd5w/gradle-8.6/lib/agents/gradle-instrumentation-agent-8.6.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.6 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Model Issue in Java</issue_title>
<issue_description>There is an error for using model in java.
I have added the kotlin dependency to make it work still it is not working. </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: sanket-simform <65167856+sanket-simform@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix model issue in Java due to dependency Add @JvmOverloads to Model class for Java interoperability Nov 28, 2025
Copilot AI requested a review from sanket-simform November 28, 2025 05:18
Copilot finished work on behalf of sanket-simform November 28, 2025 05:18
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.

Model Issue in Java

2 participants