Skip to content
Advertisement

Tag: intellij-idea

Sorround highlighted word with symbol Android Studio

If I have a word highlighted in android studio, is there any shortcut to surround that word with symbols e.g quotation marks or brackets? E.G From John to “John” or Mary to (Mary) Am aware of only Ctrl + Alt + T which surrounds the word with some functions and expressions from the options. Answer It’s a configuration that should

Automatically replacing with var using IntelliJ

I’m migrating some pre Java 10 code and I’m wondering if IntelliJ offers a way to automatically refactor the code to replace the variable declarations that uses the actual type with var wherever it’s possible. The code is full of stuff like: And I would prefer: I already looked in IntelliJ’s settings (Code Style/Inspections) and couldn’t find anything. Answer Go

Cannot invoke ” ” because array is null

I need to add information about 2 actors such as their name, address and age and have done so without arrays easily but it’s necessary, I keep getting the error “Cannot invoke “TestActor.setName(String)” because “actors[0]” is null at TestMain.main(TestMain.java:5)” This is just a test main I’m using to test it ”’ And this is the actor class I’m using that

Java file outside of source root intelliJ

I have cloned a spring boot project from GitLab having multiple branches in IntelliJ. I checkout to the branch in which I want to work. But I am getting “Java file outside of source root” on all the files. Please suggest what I am doing wrong. I just installed IntelliJ and it’s the first project that I am importing. Answer

Intellij Turning Characters into actual Symbols

I noticed with the new IntelliJ update, that it turns symbols like >= into the actual math greater than or equal to sign, along with arrows (->) and things like that. How do i turn this feature off and just get the raw characters. Thank you Answer It seems like whatever font you are using supports ligatures, and IntelliJ is

How to hide variables from Java’s JDI?

I am instrumenting some classes and introducing some new local variables. Now, when the user places a breakpoint in the code, and execution is stopped, the newly introduced local variables can be seen inside Intellij IDEA’s debugger window. How can I hide them? UPDATE: I will have to somehow remove debug info from the instrumented code, but not sure how

Hide “var” type preview in new IntelliJ 2020.2

I just updated to IntelliJ 2020.2 and while some things are good some thing are bad.. When using the Java var feature IntelliJ now shows the type of it right next to the variable name which is completely useless to me and the only reason one uses var at all, because the type is already obvious. Displays in IntelliJ 2020.2

Advertisement