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

Fix save(Iterable) #160

Merged
merged 3 commits into from
Apr 26, 2020
Merged

Fix save(Iterable) #160

merged 3 commits into from
Apr 26, 2020

Conversation

usr42
Copy link
Contributor

@usr42 usr42 commented Jul 11, 2018

This PR fixes #143

Before the fix it could happen, that save(iterable) calls save(Object)
in CrudRepositorySupport instead. This resulted in following exception:

com.mmnaseri.utils.spring.data.error.DataOperationExecutionException: Method call resulted in internal error: public java.lang.Object com.mmnaseri.utils.spring.data.repository.CrudRepositorySupport.save(java.lang.Object)
    at com.mmnaseri.utils.spring.data.domain.impl.MethodInvocationDataStoreOperation.execute(MethodInvocationDataStoreOperation.java:42)
    at com.mmnaseri.utils.spring.data.proxy.impl.DataOperationInvocationHandler.invoke(DataOperationInvocationHandler.java:83)
    at com.sun.proxy.$Proxy5.save(Unknown Source)
    at com.mmnaseri.utils.spring.data.dsl.factory.RepositoryFactoryBuilderTest.testSaveIterable(RepositoryFactoryBuilderTest.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:746)
    at org.testng.TestRunner.run(TestRunner.java:600)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
    at org.testng.SuiteRunner.run(SuiteRunner.java:268)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
    at org.testng.TestNG.runSuites(TestNG.java:1104)
    at org.testng.TestNG.run(TestNG.java:1076)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: java.lang.IllegalStateException: Cannot find property `id` on type `class java.util.Arrays$ArrayList`

Before the fix it could happen, that save(iterable) calls save(Object)
in CrudRepositorySupport instead. This resulted in following exception:

com.mmnaseri.utils.spring.data.error.DataOperationExecutionException: Method call resulted in internal error: public java.lang.Object com.mmnaseri.utils.spring.data.repository.CrudRepositorySupport.save(java.lang.Object)
    at com.mmnaseri.utils.spring.data.domain.impl.MethodInvocationDataStoreOperation.execute(MethodInvocationDataStoreOperation.java:42)
    at com.mmnaseri.utils.spring.data.proxy.impl.DataOperationInvocationHandler.invoke(DataOperationInvocationHandler.java:83)
    at com.sun.proxy.$Proxy5.save(Unknown Source)
    at com.mmnaseri.utils.spring.data.dsl.factory.RepositoryFactoryBuilderTest.testSaveIterable(RepositoryFactoryBuilderTest.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:746)
    at org.testng.TestRunner.run(TestRunner.java:600)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
    at org.testng.SuiteRunner.run(SuiteRunner.java:268)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
    at org.testng.TestNG.runSuites(TestNG.java:1104)
    at org.testng.TestNG.run(TestNG.java:1076)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: java.lang.IllegalStateException: Cannot find property `id` on type `class java.util.Arrays$ArrayList`
@coveralls
Copy link

coveralls commented Jul 11, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling bec6ae1 on usr42:fix_save_iterable into 23363d2 on mmnaseri:development.

@usr42
Copy link
Contributor Author

usr42 commented Jul 16, 2018

@mmnaseri Do you need something else for the PR?
Or do you need other support? I'm willing to support maintaining the repo, if you are interested.

@mmnaseri
Copy link
Owner

@usr42 I added you as a contributor. If you reach out to me at mmnaseri@programmer.net I can tell you about the deployment lifecycle and how I manage it.

Also, I just realized that the TravisCI integration might start to break after GH deprecates its "Services and Integrations" feature in favor of web hooks.

@mmnaseri mmnaseri merged commit fac5511 into mmnaseri:development Apr 26, 2020
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

Successfully merging this pull request may close these issues.

Method signature mapping is not deterministic
3 participants