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

Platform design creation fails if Java class already exists #1945

Closed
anssit opened this issue Nov 12, 2018 · 1 comment
Closed

Platform design creation fails if Java class already exists #1945

anssit opened this issue Nov 12, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@anssit
Copy link
Contributor

anssit commented Nov 12, 2018

Steps to reproduce

Create new platform design main-view.html in the base starter from vaadin.com/start. Choose to create a java file in the main package of the application (where MainView class already exists.)

Actual behavior

Cannot create file '/Users/anssit/_designerteam/projects/designer-test-data/flow-app/src/main/java/com/vaadin/starter/skeleton/MainView.java'. File already exists.
com.intellij.util.IncorrectOperationException: Cannot create file '/Users/anssit/_designerteam/projects/designer-test-data/flow-app/src/main/java/com/vaadin/starter/skeleton/MainView.java'. File already exists.
	at com.intellij.psi.impl.file.PsiDirectoryImpl.checkName(PsiDirectoryImpl.java:488)
	at com.intellij.psi.impl.file.PsiDirectoryImpl.checkAdd(PsiDirectoryImpl.java:477)
	at com.intellij.psi.impl.file.PsiJavaDirectoryImpl.checkAdd(PsiJavaDirectoryImpl.java:79)
	at com.intellij.psi.impl.file.PsiDirectoryImpl.add(PsiDirectoryImpl.java:411)
	at com.intellij.psi.impl.file.PsiJavaDirectoryImpl.add(PsiJavaDirectoryImpl.java:64)
	at com.vaadin.designer2.intellij.util.PsiUtil.createFile(PsiUtil.java:179)
	at com.vaadin.designer2.intellij.actions.flow.CreateFlowAction.createJavaCompanion(CreateFlowAction.java:168)
	at com.vaadin.designer2.intellij.actions.flow.CreateFlowAction.create(CreateFlowAction.java:134)
	at com.vaadin.designer2.intellij.actions.AbstractCreationAction$1.run(AbstractCreationAction.java:62)
	at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
	at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:108)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
	at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:103)
	at com.intellij.openapi.command.WriteCommandAction.access$000(WriteCommandAction.java:34)
	at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:85)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:723)
	at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:82)
	at com.vaadin.designer2.intellij.actions.AbstractCreationAction.showDialog(AbstractCreationAction.java:64)
	at com.vaadin.designer2.intellij.actions.AbstractCreationAction.showCreateDesignDialog(AbstractCreationAction.java:49)
	at com.vaadin.designer2.intellij.actions.flow.CreateFlowAction.actionPerformed(CreateFlowAction.java:100)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:191)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMenuDragMouseHandler.menuDragMouseReleased(BegMenuItemUI.java:560)
	at javax.swing.JMenuItem.fireMenuDragMouseReleased(JMenuItem.java:586)
	at javax.swing.JMenuItem.processMenuDragMouseEvent(JMenuItem.java:483)
	at javax.swing.JMenuItem.processMouseEvent(JMenuItem.java:429)
	at javax.swing.MenuSelectionManager.processMouseEvent(MenuSelectionManager.java:329)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:535)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Expected behavior

Wizard cannot be completed if the class already exists in that location.

IDE, Designer and OS version

Designer 4.0.0.beta1, at least IDEA. Check Eclipse too.

@anssit anssit added the bug label Nov 12, 2018
@anssit
Copy link
Contributor Author

anssit commented Nov 12, 2018

Not a problem in Eclipse.

@anssit anssit self-assigned this Nov 13, 2018
@szolo szolo added this to the 4.0.0.beta2 milestone Nov 22, 2018
@szolo szolo closed this as completed Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants