Elhussein-Hamed / PostmanToRetrofit2-v2

Convert postman collection to Retrofit2 java code
MIT License
3 stars 0 forks source link

Exception when Post request is without a body in Postman collection #4

Closed Elhussein-Hamed closed 1 year ago

Elhussein-Hamed commented 1 year ago

Reported issue: PluginId: com.hamed.PostmanToRetrofit2v2 Plugin name: Postman To Retrofit2 V2 Plugin version: 1.4.1 IDEA build: AI-203.7717.56.2031.7678000

Stacktrace:

null
java.lang.NullPointerException
at com.hamed.postmantoretrofit2v2.Model.addFieldParams(Model.java:166)
at com.hamed.postmantoretrofit2v2.Model.getMethod(Model.java:158)
at com.hamed.postmantoretrofit2v2.Model.constructRetrofitAnnotatedMethods(Model.java:81)
at com.hamed.postmantoretrofit2v2.Model.constructRetrofitAnnotatedMethods(Model.java:76)
at com.hamed.postmantoretrofit2v2.Model.constructRetrofitAnnotatedMethods(Model.java:76)
at com.hamed.postmantoretrofit2v2.Model.constructRetrofitAnnotatedMethods(Model.java:76)
at com.hamed.postmantoretrofit2v2.Model.constructRetrofitAnnotatedMethods(Model.java:76)
at com.hamed.postmantoretrofit2v2.Model.generateRxJavaCode(Model.java:42)
at com.hamed.postmantoretrofit2v2.forms.JsonDialog.onOK(JsonDialog.java:111)
at com.hamed.postmantoretrofit2v2.forms.JsonDialog.lambda$new$0(JsonDialog.java:69)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at java.desktop/java.awt.Component.processEvent(Component.java:6417)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:911)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:840)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:762)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:828)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
at java.desktop/java.awt.Component.show(Component.java:1732)
at java.desktop/java.awt.Component.setVisible(Component.java:1679)
at java.desktop/java.awt.Window.setVisible(Window.java:1032)
at java.desktop/java.awt.Dialog.setVisible(Dialog.java:998)
at com.hamed.postmantoretrofit2v2.Retrofit2Generator.actionPerformed(Retrofit2Generator.java:23)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:281)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:275)
at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:223)
at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:213)
at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$2(ActionPopupStep.java:207)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
at com.intellij.ui.popup.AbstractPopup.lambda$dispose$16(AbstractPopup.java:1467)
at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:88)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2194)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:188)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:173)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1463)
at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:158)
at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:329)
at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:304)
at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:138)
at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:168)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:142)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:130)
at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:261)
at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:446)
at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:418)
at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:359)
at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:272)
at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:376)
at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:356)
at com.intellij.ui.popup.PopupDispatcher.dispatchKeyEvent(PopupDispatcher.java:112)
at com.intellij.ui.popup.PopupDispatcher.dispatch(PopupDispatcher.java:148)
at com.intellij.ide.IdePopupManager.dispatch(IdePopupManager.java:93)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:810)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:828)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Reporter: PostmanToRetrofit2 V2 plugin error reporter

After some investigation, this seems to happen when a Post HTTP request in the Postman collection doesn't have a body.

Elhussein-Hamed commented 1 year ago

Fixed in v1.4.2