Closed Android-s14 closed 8 years ago
@Android-s14 interesting. Thanks for reporting. Will try to reproduce and mark it as bug.
The same problem occurs for methods run from junit test.
Annotation annotation = frodoJoinPoint.getAnnotation(RxLogObservable.class);
annotation is always null
@dbacinski thanks. I marked this as a bug. It is gonna be fixed within the next release very soon :)
I have reproduced it in the sample app, here is a failing test: https://github.com/dbacinski/frodo/commit/75c2b1b59668badc6441c26e3f898d9210666c0f
Changing annotations retention to RUNTIME fixes NPE: https://github.com/dbacinski/frodo/commit/fb6eed2900c7e6d0c0c944c2f5231267be01c976
@dbacinski awesome! Will look into the PR asap.
Had a similar crash, possibly the same issue:
Caused by: java.lang.NullPointerException
at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)
Code:
@RxLogObservable
public Observable<Pair<UserTotal, List<ActiveCompetition>>> loadActiveCompetitions() {
Works on Android 6, crash was on 4.4.4
@android10 any update?
Hi, when I rolled back to 0.8.1, got rid of Scopes and I stop getting such an error
@ayanyev good point, problem is due to accesing Scope stored in Annotation in runtime.
Sorry guys. I have been out for a while. @dbacinski will review your PR by the end of the week.
will be fixed in next version - 0.8.3
@android10 any plans to release a new version with the fix? Thank you.
@Android-s14 yes! by the end of next week there is gonna be a release :). I have to add some tests and another fix and I'm done.
@android10 Don't want to rush you... Same problem here...
There is an open PR for this, feel free to review as well: https://github.com/android10/frodo/pull/18
@dbacinski @Rainer-Lang @Android-s14 still cannot reproduce this problem.
I added more samples to reproduce the problem and by both Observable.just(null)
and Observable<Void>
and everything seems to be fine:
D Frodo => [@Observable#doNothing -> onSubscribe()]
D Frodo => [@Observable#doNothing -> onCompleted()]
D Frodo => [@Observable#doNothing -> onTerminate()]
D Frodo => [@Observable#doNothing -> @Emitted -> 0 elements :: @Time -> 0 ms]
D Frodo => [@Observable#doNothing -> :: @ObserveOn -> main]
D Frodo => [@Observable#doNothing -> onUnsubscribe()]
D Frodo => [@Observable#doSomething -> onSubscribe()]
D Frodo => [@Observable#doSomething -> onNext() -> null]
D Frodo => [@Observable#doSomething -> onCompleted()]
D Frodo => [@Observable#doSomething -> onTerminate()]
D Frodo => [@Observable#doSomething -> @Emitted -> 1 element :: @Time -> 0 ms]
D Frodo => [@Observable#doSomething -> @SubscribeOn -> RxNewThreadScheduler-5 :: @ObserveOn -> main]
D Frodo => [@Observable#doSomething -> onUnsubscribe()]
D Frodo => [@Observable#sendNull -> onSubscribe()]
D Frodo => [@Observable#sendNull -> onNext() -> null]
D Frodo => [@Observable#sendNull -> onCompleted()]
D Frodo => [@Observable#sendNull -> onTerminate()]
D Frodo => [@Observable#sendNull -> @Emitted -> 1 element :: @Time -> 0 ms]
D Frodo => [@Observable#sendNull -> @SubscribeOn -> RxNewThreadScheduler-6 :: @ObserveOn -> main]
D Frodo => [@Observable#sendNull -> onUnsubscribe()]
Here is the commit: https://github.com/android10/frodo/commit/e281739cea7577d8143858b371627252535f4808
@android10 did you try to run this test: https://github.com/dbacinski/frodo/commit/75c2b1b59668badc6441c26e3f898d9210666c0f
@dbacinski this is the failing line?
numbers.toList().toBlocking().single()
Can you provide the stack trace? I'm afraid this could be a robolectric issue...Not sure.
By the way what you are mentioning, works to me. Actually I added an example: https://github.com/android10/frodo/commit/8b6e094387ff4b287bad22c26deeb66a7b211c9b
Here is the output:
D Frodo => [@Observable :: @InClass -> ObservableSample :: @Method -> moreNumbers()]
D Frodo => [@Observable#moreNumbers -> onSubscribe()]
D Frodo => [@Observable#moreNumbers -> onNext() -> 1]
D Frodo => [@Observable#moreNumbers -> onNext() -> 2]
D Frodo => [@Observable#moreNumbers -> onNext() -> 3]
D Frodo => [@Observable#moreNumbers -> onNext() -> 4]
D Frodo => [@Observable#moreNumbers -> onCompleted()]
D Frodo => [@Observable#moreNumbers -> onTerminate()]
D Frodo => [@Observable#moreNumbers -> @Emitted -> 4 elements :: @Time -> 0 ms]
D Frodo => [@Observable#moreNumbers -> @SubscribeOn -> main :: @ObserveOn -> main]
D Frodo => [@Observable#moreNumbers -> onUnsubscribe()]
Caught this exception:
Happened for a method with the following signature: