question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@Consistency annotation results in Kotlin compilation error [DATACASS-797]

See original GitHub issue

Gautam Jolly opened DATACASS-797 and commented

Compilation of a Kotlin function, that is annotated with @Consistency, results in compilation error “An annotation argument must be a compile-time constant”. Note that fhis feature worked well in spring-data-cassandra-2.1.X.

@Consistency(DefaultConsistencyLevel.QUORUM)
fun doSomething()

The equivalent Java code works just fine:

@Consistency(DefaultConsistencyLevel.QUORUM)
public void doSomething();

Affects: 3.0.3 (Neumann SR3)

Attachments:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
spring-projects-issuescommented, Dec 31, 2020

Gautam Jolly commented

To workaround this issue:

  1. We created an annotation, which is meta-annotated with \@Consistency, in Java
@Documented
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Consistency(DefaultConsistencyLevel.QUORUM)
public @interface QuorumConsistency {}
  1. Applied the newly created annotation to the Kotlin function
@QuorumConsistency //@Consistency(DefaultConsistencyLevel.QUORUM)
fun doSomething()
0reactions
spring-projects-issuescommented, Dec 31, 2020

Mark Paluch commented

According to the Cassandra driver team, they intend to address the issue on their side. Closing this ticket until further notice

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opt-in requirements | Kotlin
To opt in to using an API in a module, compile it with the argument -opt-in , specifying the fully qualified name of...
Read more >
A failure occurred while executing org.jetbrains.kotlin.gradle ...
I have identified, This is because of the annotation @Database. If I removed this annotation, the error don't appear, but Room is not...
Read more >
Handling Nullability in Android 11 and Beyond
The @Nullable annotation ensures that when using the result of getCurrentName in a Kotlin file, you can't dereference it without a null check....
Read more >
Room - Android Developers
annotationProcessor "androidx.room:room-compiler:$room_version" ... Optionally, for non-Android libraries (i.e. Java or Kotlin only Gradle modules) you can ...
Read more >
All About Opt-In Annotations - zsmb.co
OptIn . Usages of these are verified by the Kotlin compiler, which produces warnings and errors around them as needed. In most cases,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found