Bug 562797 - Resolve compile warnings in JarRsrcLoader
Summary: Resolve compile warnings in JarRsrcLoader
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-04 16:50 EDT by Karsten Thoms CLA
Modified: 2024-04-16 14:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2020-05-04 16:50:38 EDT
In the console I see that the script build_jar-in-jar-loader.xml is invoked. As it compiles JarRsrcLoader and this has some compile warnings, these are shown in the console:

------------------------------------------------------------------

Buildfile: /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/scripts/build_jar-in-jar-loader.xml

properties:

init:

clean:
      [delete] Deleting: /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar-in-jar-loader.zip

jar-in-jar-loader_zip:
       [mkdir] Created dir: /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/temp.folder/jar-in-jar-loader.zip.bin
       [javac] Compiling 5 source files to /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/temp.folder/jar-in-jar-loader.zip.bin
       [javac] ----------
       [javac] 1. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 59)
       [javac] 	Class c = Class.forName(mi.rsrcMainClass, true, jceClassLoader);
       [javac] 	^^^^^
       [javac] Class is a raw type. References to generic type Class<T> should be parameterized
       [javac] ----------
       [javac] 2. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 60)
       [javac] 	Method main = c.getMethod(JIJConstants.MAIN_METHOD_NAME, args.getClass());
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] Type safety: The method getMethod(String, Class...) belongs to the raw type Class. References to generic type Class<T> should be parameterized
       [javac] ----------
       [javac] 3. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 61)
       [javac] 	main.invoke((Object) null, args);
       [javac] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] Type String[] of the last argument to method invoke(Object, Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.
       [javac] ----------
       [javac] 4. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 80)
       [javac] 	Enumeration resEnum;
       [javac] 	^^^^^^^^^^^
       [javac] Enumeration is a raw type. References to generic type Enumeration<E> should be parameterized
       [javac] ----------
       [javac] 5. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 117)
       [javac] 	List result = new ArrayList();
       [javac] 	^^^^
       [javac] List is a raw type. References to generic type List<E> should be parameterized
       [javac] ----------
       [javac] 6. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 117)
       [javac] 	List result = new ArrayList();
       [javac] 	                  ^^^^^^^^^
       [javac] ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized
       [javac] ----------
       [javac] 7. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 124)
       [javac] 	result.add(line.substring(firstPos, lastPos));
       [javac] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized
       [javac] ----------
       [javac] 8. WARNING in /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar in jar loader/org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader.java (at line 128)
       [javac] 	return (String[]) result.toArray(new String[result.size()]);
       [javac] 	                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] Type safety: The method toArray(Object[]) belongs to the raw type List. References to generic type List<E> should be parameterized
       [javac] ----------
       [javac] 8 problems (8 warnings)
         [zip] Building zip: /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/jar-in-jar-loader.zip
      [delete] Deleting directory /Users/thoms/git/eclipse/eclipse.jdt.ui/org.eclipse.jdt.ui/temp.folder

build:
BUILD SUCCESSFUL
Total time: 495 milliseconds
Comment 1 Eclipse Genie CLA 2020-05-04 17:13:26 EDT
New Gerrit change created: https://git.eclipse.org/r/162011
Comment 2 Stephan Herrmann CLA 2020-05-05 08:16:30 EDT
The warnings were introduced by the upgrade to 1.6 for the jar-in-jar-loader (https://git.eclipse.org/r/#/c/144674/).

I suggest you actually fix only those existing warnings :)

If you want to migrate to 1.8 (as done in https://git.eclipse.org/r/#/c/162011/1/) this must be discussed here (at that point the bug would no longer be 'trivial'), and as the jenkins failures indicate, being runnable on 1.6 is actually part of the contract :)
Comment 3 Karsten Thoms CLA 2020-05-05 09:01:40 EDT
(In reply to Stephan Herrmann from comment #2)
> The warnings were introduced by the upgrade to 1.6 for the jar-in-jar-loader
> (https://git.eclipse.org/r/#/c/144674/).
> 
> I suggest you actually fix only those existing warnings :)
> 
> If you want to migrate to 1.8 (as done in
> https://git.eclipse.org/r/#/c/162011/1/) this must be discussed here (at
> that point the bug would no longer be 'trivial'), and as the jenkins
> failures indicate, being runnable on 1.6 is actually part of the contract :)

Thanks Stephan, good to know. The reason why I changed to 1.8 is that try-with-resources is not available in 1.6. But I can fix the warnings of course without using them.
Comment 4 Eclipse Genie CLA 2022-04-26 15:23:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2024-04-16 14:28:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.