uschindler commented on a change in pull request #567:
URL: https://github.com/apache/lucene/pull/567#discussion_r775124955



##########
File path: 
lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java
##########
@@ -19,18 +19,19 @@
 
 import java.awt.Image;
 import javax.swing.ImageIcon;
+import org.apache.lucene.luke.app.desktop.LukeMain;
 
 /** Image utilities */
 public class ImageUtils {
 
-  private static final String IMAGE_BASE_DIR = 
"org/apache/lucene/luke/app/desktop/img/";
+  private static final String IMAGE_BASE_DIR = "img/";
 
   public static ImageIcon createImageIcon(String name, int width, int height) {
     return createImageIcon(name, "", width, height);
   }
 
   public static ImageIcon createImageIcon(String name, String description, int 
width, int height) {
-    java.net.URL imgURL = 
ImageUtils.class.getClassLoader().getResource(IMAGE_BASE_DIR + name);
+    java.net.URL imgURL = LukeMain.class.getResource(IMAGE_BASE_DIR + name);

Review comment:
       Yes, I just did not want to do this in this issue.
   
   Although it's not an issue here because a module can always access its own 
resources (this is why it is caller sensitive, what the whole issue is about). 
It is only problematic with getClassLoader() as there everything is hidden.
   
   As a general rule (and: I agree with you) resources should always be in same 
package like the class that looks them up.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to