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
Tag: intellij-idea
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
Hibernate mapping between different database and domain model
I have created a domain and database model. The domain model is for a rest api. The both have similar components like product, category, customer, retailer, etc… But if you take a closer look at both models. You can see some differences. For example, you can see that in the database model the retailer has multiple products. But in the
In java, is there a way to examine how an object is still reachable from garbage collection root?
The codebase is somewhat complex, so I was wondering if there was a tool to examine an object at runtime and determine how the JVM still sees this object as reachable. In particular, there’s one object type that I would only expect to be one instance of at a time throughout the life of the app (new ones can be
Error in java calculator programme “Field ‘(button)’ may be ‘final’ [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question I am creating gui calculator in Java I am using IDEA programme runs
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