Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Annotation duplicates #231

Open
ghost opened this issue Aug 8, 2017 · 4 comments
Open

Annotation duplicates #231

ghost opened this issue Aug 8, 2017 · 4 comments
Milestone

Comments

@ghost
Copy link

ghost commented Aug 8, 2017

my getClassAnnotations see as

case 6566:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 6567:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6576:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 6758:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6851:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6954:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6973:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 6974:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6975:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 7016:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 7017:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 7018:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 7020:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 7022:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 

I not found solution for detect duplicates in kotlin. Best solution if create function for any unique case, and re-use in other, size function will be 10x smaller.
Also same case for getFieldAnnotations. I think always annotations use multiply.

@ghost ghost added this to the 0.6.7 milestone Aug 8, 2017
@soywiz
Copy link
Member

soywiz commented Aug 8, 2017

Do you mean to reuse cases like this?

case 6566:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 
case 6567:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6576:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 

-->

case 6567:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(false)); 
case 6566, 6576:return JA_L.T1("[Ljava/lang/annotation/Annotation;", (new my.context.annotations.Bean_Impl_()).my_context_annotations_Bean_Impl_init__Z_V(true)); 

@ghost
Copy link
Author

ghost commented Aug 8, 2017

yes, right

@soywiz
Copy link
Member

soywiz commented Aug 8, 2017

We can have a HashMap of the annotations linked to a case or something. Kotlin data class implement hashCode and equals to compare them and use in maps. I can check it.

@ghost
Copy link
Author

ghost commented Aug 8, 2017

Will be great, i try today linked result with starting point, but lose =) For me need more learning kotlin =)

@ghost ghost modified the milestones: 0.6.8, 0.6.7 Aug 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant