FWDekker/intellij-randomness

Add ability to generate UUID

ok3141 opened this issue · 6 comments

All I want to get is UUID.randomUUID().toString().

Thank you for the suggestions! I will work on a few more features and bug fixes before I make a release. Once I've uploaded the release, JetBrains will need approximately three days to review the update, but after that you should receive a popup in your IDE to update the plugin.

I'll leave a message here once the release has been uploaded to JetBrains.

I have uploaded the release to JetBrains. If you can't wait for JetBrains to approve the update, you can download the update on this repo's release page.

Thanks for new release. I've installed it from .zip and get this error while generating String:

(I've opened String Settings, and then this problem disappeared)

null
java.lang.NullPointerException
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1548)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.fwdekker.randomness.string.Alphabet.concatenate(Alphabet.java:52)
	at com.fwdekker.randomness.string.StringInsertAction.generateCharacter(StringInsertAction.java:64)
	at com.fwdekker.randomness.string.StringInsertAction.generateString(StringInsertAction.java:50)
	at com.fwdekker.randomness.DataInsertAction.lambda$null$0(DataInsertAction.java:51)
	at java.util.ArrayList.forEach(ArrayList.java:1251)
	at com.fwdekker.randomness.DataInsertAction.lambda$actionPerformed$1(DataInsertAction.java:47)
	at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252)
	at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234)
	at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
	at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1003)
	at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170)
	at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119)
	at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212)
	at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168)
	at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151)
	at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254)
	at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:241)
	at com.fwdekker.randomness.DataInsertAction.actionPerformed(DataInsertAction.java:58)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.performAction(PopupFactoryImpl.java:966)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.performAction(PopupFactoryImpl.java:956)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.lambda$onChosen$0(PopupFactoryImpl.java:950)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
	at com.intellij.ui.popup.AbstractPopup.lambda$null$7(AbstractPopup.java:1431)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	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)

Another issue (minor) is related to UUID. It generates UUID without quotes.
It's not a problem for single UUID, but it also omit quotes for UUID array.

Thank you for the feedback. The quotations should be easy to fix, but I'll have to look into that stacktrace. I think it is because your string settings were set to the "Uppercase" option which was removed in v1.6.0.

I have uploaded v1.6.1 to JetBrains and this repo's releases page. This version will allow you to add quotation marks around UUIDs. While the exception you showed has not been fixed (yet), it should not occur again for you because you have updated your string settings since v1.6.0.