Community
Participate
Working Groups
Hi, Eclipse version doesn't report deprecation warning for use of deprecated code like JTable.createScrollPaneForTable(aTable) ... But the 'Check overriding and implementing methods' is working ! Config: WinXP SP1 J2SDK 1.4.2_05 (1.4.2_04 and 1.4.2_03 as well) Eclipse 3.0 No special configuration or plugins. See bug #48623 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=48623> Newsgroup : http://www.eclipse.org/newsportal/article.php? group=eclipse.tools.jdt&id=%3Cccanv0%242ql%241%40eclipse.org%3E
Cannot reproduce. A warning is reported once deprecation is set to warning. import javax.swing.JTable; public class X { public static void main(String[] args) { JTable.createScrollPaneForTable(null); } } --> The method createScrollPaneForTable(JTable) from the type JTable is deprecated Please export your preferences and attach them to this defect.
This report is against the AJDT product, but no AspectJ/AJDT version has been specified. And "AJDT" is first in the product list on the submission page... Could the reporter please verify whether this problem occurred with the JDT Java compiler or with the AJDT AspectJ compiler? Philippe: if it's against JDT I assume that you'll reassign it.
Yes .... you'll right it's about JDT and not AJDT ! Sorry for misunderstanding :/
Created attachment 12971 [details] Preference export
Moving to AJDT (unsure whether it is AJDT or AspectJ).
Philippe: In Comment #3 Yoann indicates that this is a JDT bug report, not AspectJ/AJDT. I have moved it to JDT Core and assigned it to you.
Your settings indicate you did not enable the deprecation diagnosis. In prefs, set 'Usage of deprecated API' to WARNING.
It was already activated .... it's activated by default ... So I set 'Usage of deprecated API' to ERROR (see attached files for screenshot and re-exported preferences file) ! Could you tell me which key in preferences is missing that allow you to say that the wasn't set (maybe by importing a correct preferences file it works)
Created attachment 13042 [details] Preference file - Usage of deprecated API = ERROR
Created attachment 13043 [details] Screenshot of compiler preference tab
You're right, there is no entry for setting assigned to their defaults. The entry I was looking for is: /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.deprecatio n Anyway, now that we are sure the compiler is correctly set, suspicion goes against the JRE libraries. Would it work better if you did switch to a different JDK (for compiling against) ?
I have already tried with 1.4.2_03 and 1.4.2_04 and no deprecation warning appears. (So which JDK are you using ?) Here a sample class and the command-line cmpilation output : CLASS -------- import javax.swing.JTable; public class Deprecation { static public void main(String[] args) { JTable.createScrollPaneForTable(null) ; } } // end of class OUTPUT --------- C:\dev\projects\samples\src>javac Deprecation.java Note: Deprecation.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. C:\dev\projects\samples\src>javac -deprecation Deprecation.java Deprecation.java:8: warning: createScrollPaneForTable(javax.swing.JTable) in jav ax.swing.JTable has been deprecated JTable.createScrollPaneForTable(null) ; ^ 1 warning
This is the same example I did try (comment #1). It works fine against 1.4.2_04.
Ok .... I re-tried with M9 and JDK 1.4.2_04 (all combination) and you're right, no deprecation warnings !! Is there a problem I have ANT_HOME, JAVA_HOME and PATH environment variables set ?? I change status to INVALID, so if you could just help me to find a way ... thx
Are you using the Ant adapter or the plain IDE ?
I will investigate. I'd like to know if you are using the compiler through an ant task or inside the IDE. Thanks.
I'm using the plain IDE .... nothing else.
Created attachment 13063 [details] System configuration summary Removing environment variables don't change anything ! Maybe a real problem on my workstation (see attached file from menu 'Help>About Eclipse Platform>Configuration details')
You are using a JRE (C:\Program Files\Java\j2re1.4.2_05). I read somewhere that this was a problem (I cannot recall where I read this). Try to use the corresponding JDK. I will check both. Let me know if switching to a JDK 1.4.2_05 solved your problem.
See http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg10469.html
THAT'S IT !!! ;) thanks all for interest and helping me.
I reopen it. As long as I don't have a good explanation why it is working with the SDK and not with the JRE, I don't consider this as fixed.
I will investigate the behavior using the JRE as soon as I get it.
The only explanation I have in this case is that the method JTable.createScrollPaneForTable(JTable) is not tagged as deprecated in the JRE and it is tagged as deprecated in the SDK. We retrieve the deprecation information from the Deprecated attribute located in the method info. This must be different! I will provide you a small tool to check that on your side since I don't have the JRE. I only have the SDK. Would you run such tool to help us closing this PR?
Created attachment 13169 [details] Tool to run Run this tool on the two rt.jar file. Here is the way to call it for the SDK: C:\>java -cp tool.jar test69315.CheckDeprecatedAttribute C:\jdks\jdk1.4.2_05\jre\lib\rt.jar I exported a subset of the classes. I hard coded the method name and the class name. You should get something like: The method JTable.createScrollPaneForTable(JTable) is deprecated or: The method JTable.createScrollPaneForTable(JTable) is not deprecated For the SDK I have "is deprecated". This was the expected result. If you get "is not deprecated" for the rt.jar in the JRE, this is a packaging problem with the JRE and the problem should be reported to Sun. My guess is that because the JRE is not intended to be used to compile code, all deprecation attributes have been removed in order to make the rt.jar smaller. Could you please add a note to this PR once you got the result?
You're right ... Running tool on SDK JRE : ------------------------- java -cp tool.jar test69315.CheckDeprecatedAttribute C:\jdks\j2sdk1.4.2_05 \jre\lib\rt.jar The method JTable.createScrollPaneForTable(JTable) is deprecated Running tool on standard JRE : ------------------------------ java -cp tool.jar test69315.CheckDeprecatedAttribute "C:\Program Files\Java\j2re1.4.2_05\lib\rt.jar" The method JTable.createScrollPaneForTable(JTable) is not deprecated Just for my information, what's the issue ?
Thanks. This confirms what I guessed. The JRE rt.jar doesn't contain any deprecated attribute. This is the attribute used to find out if a field/a method/a type is deprecated or not. Because the JRE is not done to be used to compile code, these attributes are useless. So there is nothing we can do about it. Please compile your code against libraries from a SDK not a JRE. Closing as INVALID since this is not a bug and there is nothing we can do to fix this issue. If you have further questions, let me know. Thanks for your help.