Posts

Showing posts with the label intellij-idea

IntelliJ IDEA - getClass().getResource(“…”) return null

IntelliJ IDEA - getClass().getResource(“…”) return null I'm using IntelliJ IDEA 13.1.5, I used to work with Eclipse. I'm working on JavaFX application, I try to load FXML file within my MainApp class using getClass().getResource(). I read the documentation and I try several idea, at the end I have null . This is the hierarchy : dz.bilaldjago.homekode.MainApp.java dz.bilaldjago.homekode.view.RootLayout.FXML This is the code snippet I used: FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("view/RootLayout.fxml")); I tried other solution such giving the url from the root and using the classLoader the result is the same. Any idea please possible duplicate of Java - class.getResource returns null – maja Apr 11 '15 at 18:23 5 Answers ...

IntelliJ IDEA tell Unnecessary 'Arrays.asList' call

IntelliJ IDEA tell Unnecessary 'Arrays.asList' call final SomeObjectType list = webserviceResponse.getArrayOfObjects(); if (list != null) { final List<SomeObjectType> responseList = Arrays.asList(list); for (final SomeObjectType prt : responseList) { // doing some factory conversion. } } Getting tip that Unnecessary 'Arrays.asList' call while converting array to list, why? link to image Can someone simply answer? what's list ? – Michel_T. Jun 29 at 10:22 list If IntelliJ means responseList = Collections.singletonList(list); then the compile time class is not an array but some Object. Michel_T has a point. – Joop Eggen Jun 29 at 10:27 ...