Skip to content
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

Parameters of type ObjectId with null value are changed to non-null upon invocation #744

Open
tiddman opened this issue Jun 28, 2016 · 4 comments

Comments

@tiddman
Copy link

tiddman commented Jun 28, 2016

I have a method with this signature:

void fetchSince(FeedMeta feedMeta, ObjectId since, Promise<List<Position>> promise);

and am invoking it like this:

fetchSince(feedMeta, null, promise);

When invoked, the 2nd parameter is not null, it's an ObjectId such as "57728ed86cf58c9c45dfca95". The stack is below.

I suspect that in the Qbit method invocation internals, the null parameter is getting swizzled to the result of "new ObjectId()" which is a non-null value. A workaround is to pass the value by string.

at com.revelfire.poc.service.FetchServiceImpl.fetchSince(FetchServiceImpl.java:123)
at io.advantageous.boon.core.reflection.impl.MethodAccessImpl.invoke(MethodAccessImpl.java:329)
at io.advantageous.boon.core.reflection.impl.MethodAccessImpl.invokeDynamic(MethodAccessImpl.java:316)
at io.advantageous.qbit.boon.service.impl.MapAndInvokeDynamic.mapArgsAsyncHandlersAndInvoke(MapAndInvokeDynamic.java:52)
at io.advantageous.qbit.boon.service.impl.BoonServiceMethodCallHandler.mapArgsAsyncHandlersAndInvoke(BoonServiceMethodCallHandler.java:101)
at io.advantageous.qbit.boon.service.impl.BoonServiceMethodCallHandler.invokeByName(BoonServiceMethodCallHandler.java:335)
at io.advantageous.qbit.boon.service.impl.BoonServiceMethodCallHandler.receiveMethodCall(BoonServiceMethodCallHandler.java:88)
at io.advantageous.qbit.service.impl.BaseServiceQueueImpl.doHandleMethodCall(BaseServiceQueueImpl.java:232)
at io.advantageous.qbit.service.impl.BaseServiceQueueImpl.access$000(BaseServiceQueueImpl.java:85)
at io.advantageous.qbit.service.impl.BaseServiceQueueImpl$3.receive(BaseServiceQueueImpl.java:447)
at io.advantageous.qbit.service.impl.BaseServiceQueueImpl$3.receive(BaseServiceQueueImpl.java:434)
at io.advantageous.qbit.queue.impl.BasicReceiveQueueManager.manageQueue(BasicReceiveQueueManager.java:94)
at io.advantageous.qbit.queue.impl.BasicReceiveQueueManager$$Lambda$16/361571968.run(Unknown Source)
at io.advantageous.qbit.concurrent.ScheduledThreadContext.lambda$start$30(ScheduledThreadContext.java:89)
at io.advantageous.qbit.concurrent.ScheduledThreadContext$$Lambda$11/257608164.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
@RichardHightower
Copy link
Member

I think you are right. I could track this down and pass the null.
Generally, the service layers does not like nulls.

@revelfire
Copy link

Can we use Void like Vertx does?

@revelfire
Copy link

Actually no I guess not it's about value not type sorry stupid comment.

@RichardHightower
Copy link
Member

How are you invoking it? WebSocket? ServiceQueue? or ServiceBundle? Can you create a small test case that reproduces this?

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

No branches or pull requests

3 participants