-
Notifications
You must be signed in to change notification settings - Fork 297
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
In kotlin, "Unresolved references of converter" error message should be clear #1172
Comments
@Mina-1316 Thanks for reporting! Could you add a code example for a broken entity class? TL;DR for me: as the annotation processor, or here kapt, runs before compiling it may trip over code that does not compile. Here a missing import. Try to reproduce and add a test case for this. |
@greenrobot-team Sorry for late response! this is my example code: import com.fasterxml.jackson.annotation.JsonIgnore
import io.objectbox.annotation.*
// Below import notation creates error not in compile time, which creates unrecognizeable error inside plugin
// This means, import of converter won't checked and reflected directly as I assume
// import org.example.common.entity.converter.persist.DeviceAvailabilityConverter
import org.example.common.enums.DeviceAvailability
@Entity
data class Device(
@JsonIgnore
@Id
var id: Long = 0,
@Convert(converter = DeviceAvailabilityConverter::class, dbType = Int::class)
var status: DeviceAvailability,
) {
} Stacktrace is same as I provided at start of this issue. |
Update: can reproduce! The stack trace occurs only when the import for the We should be able to modify the processor to catch and throw a more helpful exception in this case. Internal issue: |
Is there an existing issue?
Use case
In kotlin, when processing entity, Plugin won't check/validate imports of converter so when error message is occured, It's stacktrace is raw, unreadable and unrecognizedable.
for example: When on converter's type is not imported, stacktrace is:
Since user can't check the plugin's code directly, User can't understand why this error occured/which entity's reference is missing.
Proposed solution
Plugin can create an error message when converter's import won't received rather than raw error like
ClassCastException
It could be nice to say which entity created error, or which property.
Additional context
I know this is not a common situation that User breaks the import references, so It is ok to be not to hurry.
I didn't checked on Java, so Java's error message or behavior can be different.
My situation: Git messed up the package name and build broken
The text was updated successfully, but these errors were encountered: