Sudden deprecated warnings
We're just now upgrading from 1.4.2 to 1.5, and I have a custom Swing component that extends javax.swing.plaf.basic.BasicComboBox, who in turn both extends javax.swing.JPopupMenu and implements javax.swing.plaf.basic.ComboPop.
public void show() has been deprecated in JPopupMenu (from Component) since jdk1.1 but is required in ComboPop (great thinking there, guys).
We're compiling with Ant 1.7, and are just now getting a deprecated warning. Two questions:
1) How can I tell the compiler that the public void show() method that I'm overriding is from ComboPop and not from Component?
2) Why would 1.5 start complaining now, when 1.4.2 didn't?
It's important that we get a clean output from our builds, otherwise QA needs a boat-load of paperwork (done by me) explaining each warning.
Thanks for the replies.
use javac -nowarn?Tried it - no luck. Besides, QA would b1tch-slap me for doing this globally.
Use @SuppressWarnings("deprecation")? I've never heard of this. Seeing the "@" made me think that it might be some sort of secret hidden javadoc thingy. So I tried it with no success. I could have (read: probably) did it incorrectly however.
Bribe the QA department? Might be my best course of action.
Similar Messages
-
Hi,
I wrote a class that extends HttpServerResponseWrapper and now I am getting these bogus deprecation warnings:
warning: [deprecation] setStatus(int,java.lang.String) in javax.servlet.http.HttpServletResponse has been deprecated
class CacheResponseWrapper extends HttpServletResponseWrapper
Thing is, I am not overriding or invoking setStatus() at all so what gives? Is this a bug in the javac compiler?
GiliIts not a bug. When implementing an interface, you get this warning if you don't declare the implementation of any deprecated methods declared in the interface as being deprecated in the implementation. HttpServletResponseWrapper doesn't declare its implementation of setStatus(int, String) as deprecated, so this is why you are seeing the warning. If you override the method and mark it as deprecated in your class, the warning will dissappear.
-
I'm working on a project using JBuilder, and some of our methods have been deprecated, but I don't get any deprecation warnings when I compile any of the classes that call the deprecated methods. I understand that it won't warn me when the class containing deprecated methods is compiled at the same time as the class calling them, but even when I compile one file at a time I get no deprecation warnings. I have verified that JBuilder is configured to show deprecations.
Anybody have any idea what I might be doing wrong?
Thanks,
SamI found this description:
http://java.sun.com/products/jdk/1.1/docs/guide/misc/deprecation/deprecation.html
With a note in the "What happens when an API is Deprecated" section. It says it will only suppress the warning if the class with the deprecated method is also compiled.
Maybe if you remove the source file and leave the class file it will work.. -
Enable Deprecation Warnings (again)
Hi,
i want to see deprecated warnings during the build withing bea workshop.
I posted this question already. The answer i got from BEA was not sufficient and i didnt get an answer on my reply on their answer ...
Please read this thread first:
http://forums.bea.com/bea/thread.jspa?threadID=200036242
Thanks,
Ralf SchumacherIt means you have attempted to use methods which are marked obsolete and might be removed in the future. Usually the compiler will tell you which methods were deprecated. To find out a alternative to use, consult the java docs for the api you are working on. Usually an alternative is listed.
I am trying to compile my program and i am getting
this kin*d of error
Warning #: 369 : There have been deprecation warnings.
Please consult the documentation for a better
alternative
Does any one knows wht it means, or where the error
come from, understanding the meaning of the error
message might help me to solve my problem........... -
Deprecation warnings in OVDIdentityStoreFactory
I am working in the Fusion Apps CRM development team and am investigating a couple of deprecation warnings in our code. The source of these warnings seems to be
a deprecated constant "RT_SUBSCRIBER_NAME" in oracle.security.idm.providers.ovd.OVDIdentityStoreFactory.
My problem is that I cannot find the javadoc or any other documentation for this class. I need to find out a substitute constant or some other mechanism to get rid of this bug.
Does anyone on these forums know where I can find this documentation?
thanks
ManiHow should we know?
You did not even tell us which jdev version you are using.
Please tell us which warnings you get and if you did you see them before or if they are just appear out of the blue sky.
Timo -
Revision: 9056
Author: [email protected]
Date: 2009-08-04 07:56:55 -0700 (Tue, 04 Aug 2009)
Log Message:
Cleaned up deprecated warnings in rpc build.
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: Yes, rpc.swc has been updated to use ResourceManager.
Code-level description of changes:
Moved ResourceBundle metadata to class level.
Removed messagingBundle and rpcBundle vars.
Added _resourceManager var.
Modified textOf() to use ResourceManager.getString().
Modified Paths:
flex/sdk/trunk/frameworks/projects/rpc/src/mx/utils/Translator.asThats good news.
-
Howto enable deprecated warnings?
Hi!
How can i enable deprecated warnings during the build process within workshop?
The deprecated warnings should also be shown in PageFlows (*.jpf) and Controls (*.jcs). Is this possible?
Best Regards,
Ralf Schumacher
Message was edited by [email protected] at Jul 26, 2004 4:34 AMYou can right click on the project and export the ant
build.xml. You can modify the build.xml to add a flag
for the javac or java according to the jdk you use
and also make sure to set the project to use the
exported ant build.xml file.I already did this. But the exported ant file is not very useful. The exported ant file contains only 2 targets: build and clean. BEA uses its own non documented "fat" build task to build and compile all files (all means all classes, controls, pageflows and jsp). This makes build with the bea workshop so slow ... because on every build all is recompiled, regardless if changed or not ...
Imho with javac (1.4) the default is to show deprecated warnings, a flag exists to suppress these warnings. What is BEA doing in there build task ... ???
So, how do i get the deprecated warnings within bea workshop???
Best Regard,
Ralf Schumacher -
Deprecated warnings while using XMLBeans
Greetings,
Using XMLBeans Builder in WorkShop 9.2 raises hundreds of deprecated warnings. It seems that the XMLBeans Builder generated code doesn't compile against ... XMLBeans itself ? It that possible ? Any workaround ?
Many thanks in advance,
NicolasHi Nicolas,
To highlight your issue:
"""...how could I compile, without any warnings, including deprecation
warnings, XMLBeans Builder generated code. After all, as it's name
clearly suggests, an XMLBeans Builder generates code to be compiled
against XMLBeans. It seems very strange that a product which generates
XMLBeans compliant code cannot compile this code without deprecation
warnings."""
I spent some time working with XMLBeans and unfortunately, what you want
(code without deprecation warnings) is actually something to make a
request of from the Apache XmlBeans folks. The code the XMLBeans Builder
generates is not any different from that which the Apache XmlBeans
project would generate when a schema is compiled via the 'scomp' tool.
Here's how you can see the cause of this outside of the Xmlbeans builder
tool or the Workshop IDE
1) go to http://xmlbeans.apache.org and download a binary distribution
2) unzip the binary distribution to a dir on your filesystem
3) copy your xsds to <unzip-dir>\xmlbeans-2.2.20\bin
4) cd to <unzip-dir>\xmlbeans-2.2.20\bin
5) run the following:
scomp -src srcOutputDir *.xsd
This will generate the src files from the xsd (similar to how the
XMLBeans Builder tool would) on your filesystem.
From there, browse to a .java file and view in your favorite text editor.
You'll see that the java code produced from the XMLBeans tool itself
produces code with @deprecated javadoc
e.g,
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream
Now to see this in the Workshop IDE, create a new J2EE Utility Project.
Make sure the XmlBeans->XmlBeans library facet is enabled.
Drag the contents of srcOutputDir (from above) to the src directory of
the J2EE Utility Project in the IDE window.
Upon successful rebuild of the srcs in the IDE, you'll be able to see
similar warnings from pure Apache XmlBeans related code.
If you really CANNOT have these deprecation warnings, your best bet may
be to email the Apache XmlBeans mailing list. At the very least they can
probably best explain why the deprecation is still left in the code.
The website for xmlbeans is:
http://xmlbeans.apache.org
and some helpful mailing lists can be found and queried from
http://xmlbeans.apache.org/community/index.html
Hope this helps,
-Jacobd
nicolas duminil wrote:
rfrost,
Many thanks for having taken the time to reply but ... you didn't get me. My point was not to disable compiler's deprecation warnings. I believe that it's very important to be aware that APIs you're using in your code is deprecated. This is certainly the reason which motivated the compiler's creators to provide an option able to signal deprecated calls in the code. Disabling this warnings doesn't provide any benefits, it is just hiding problems and the goal of a compiler is not to hide problems, but to hi
ghlight them. No, my point was simply to ask how could I compile, without any warnings, including deprecation warnings, XMLBeans Builder generated code. After all, as it's name clearly suggests, an XMLBeans Builder generates code to be compiled against XMLBeans. It seems very strange that a product which generates XMLBeans compliant code cannot compile this code without deprecation warnings. That's a big issue because a deprecation warning says to you: "Hey, you're using something you're not supposed to u
se any more". So, many thanks to you for having let me know how to disable compilation warnings, but this was not at all the point. The real point was how to use the XMLBeans Builder in order to generate XMLBeans code free of deprecation warnings. I understand you don't have the answer but, in this case, please don't feel obligated to reply.
Kind regards,
nicolas -
Hi
I am using 3.2.3 and when I set a JLabel's
label the code generated is label.setLabel
- can I get JDeveloper to generate setText
instead?
MarcIt means you have attempted to use methods which are marked obsolete and might be removed in the future. Usually the compiler will tell you which methods were deprecated. To find out a alternative to use, consult the java docs for the api you are working on. Usually an alternative is listed.
I am trying to compile my program and i am getting
this kin*d of error
Warning #: 369 : There have been deprecation warnings.
Please consult the documentation for a better
alternative
Does any one knows wht it means, or where the error
come from, understanding the meaning of the error
message might help me to solve my problem........... -
Revision: 4880
Author: [email protected]
Date: 2009-02-06 13:30:19 -0800 (Fri, 06 Feb 2009)
Log Message:
* Fixed deprecation warnings with AST generation and a Repeater RTE
caused by revision 4709.
tests Passed: checkintests, mxunit repeater, asc-tests
Needs QA: YES
Needs DOC: NO
Bug fixes: SDK-16288, SDK-18986
API Change: NO
Reviewer: Corey, Pete F.
Code-level description of changes:
asc/src/java/macromedia/asc/embedding/LintEvaluator.java
Added ignoreSynthesizedCode variable and setter.
Modified warning() to only skip synthetic code when
ignoreSynthesizedCode is false. This allows us to report
deprecation warnings when using AST generation with Mxml
documents.
compiler/src/java/flex2/compiler/as3/As3Compiler.java
Modified analyze4() to set the LintEvaluator's
ignoreSynthesizedCode flag to false.
compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
Added CLASS_REPEATER_DOT.
compiler/src/java/flex2/compiler/mxml/rep/init/VisualChildInitializer.java
Modified getAssignExpr() and generateAssignExpr() to code gen the
initializeRepeater() call. This required changing the return type
of generateAssignExpr() from ExpressionStatementNode to
StatementListNode.
compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java
Removed initializeRepeater() related code gen from
getDefinitionBody() and generatedDefinitionBody().
compiler/src/java/flex2/compiler/mxml/rep/init/EffectInitializer.java
compiler/src/java/flex2/compiler/mxml/rep/init/Initializer.java
compiler/src/java/flex2/compiler/mxml/rep/init/StyleInitializer.java
compiler/src/java/flex2/compiler/mxml/rep/init/EventInitializer.java
compiler/src/java/flex2/compiler/mxml/rep/init/NamedInitializer.java
compiler/src/java/flex2/compiler/mxml/rep/init/ArrayElementInitializer.java
compiler/src/java/flex2/compiler/mxml/rep/decl/InitializedPropertyDeclaration.java
compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
Updated to reflect change to generateAssignExpr() signature
required by VisualChildInitializer.
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-16288
http://bugs.adobe.com/jira/browse/SDK-18986
Modified Paths:
flex/sdk/branches/i10/modules/asc/src/java/macromedia/asc/embedding/LintEvaluator.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/as3/As3Compiler.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerat or.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.jav a
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/InitializedP ropertyDeclaration.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ArrayElement Initializer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/EffectInitia lizer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/EventInitial izer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/Initializer. java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/NamedInitial izer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/StyleInitial izer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitial izer.java
flex/sdk/branches/i10/modules/compiler/src/java/flex2/compiler/mxml/rep/init/VisualChildI nitializer.java -
How to avoid the following deprecated warnings
hi,
I use JAXB 2.0 and I get the following warnings
All the below API;s have been deprecated since JAXB 2.0, How can I avoid gettings these warnings.
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
warning: [deprecation] ERR_NOT_IDENTIFIABLE in com.sun.xml.bind.marshaller.Messages has been deprecated
warning: [deprecation] ERR_DANGLING_IDREF in com.sun.xml.bind.marshaller.Messages has been deprecated
warning: [deprecation] isValidating() in javax.xml.bind.Unmarshaller has been deprecated
warning: [deprecation] setValidating(boolean) in javax.xml.bind.Unmarshaller has been deprecated
warning: warning: [deprecation] parse(org.w3c.dom.Element,org.xml.sax.ContentHandler) in com.sun.xml.bind.unmarshaller.DOMScanner has been
warning: warning: [deprecation] parse(org.w3c.dom.Element,org.xml.sax.ContentHandler) in com.sun.xml.bind.unmarshaller.DOMScanner has been
warning: [deprecation] getProperty(java.lang.String) in javax.xml.bind.Validator has been deprecated
warning: [deprecation] setProperty(java.lang.String,java.lang.Object) in javax.xml.bind.Validator has been deprecated
warning: [deprecation] setEventHandler(javax.xml.bind.ValidationEventHandler) in javax.xml.bind.Validator has been deprecatedTimThe.., I disagree about the result of a bad design
comment. In simple cases it can be beneficial to
only require an object's constructor, then that
object's actions are self contained and its methods
can then be called from its own constructor. In the
right situations this can help to loosen coupling
between classes and increase encapsulation.I disagree with that. If your code depends on behaviour that is carried out by a constructor, you have a dependency on a concrete class, which is a nice quick way to tightly couple classes. You'd achieve looser coupling if the desired behaviour was inside a method, which was in turn declared on an interface -
[Solved] Deprecated warnings while updating linux
Today while updating linux to its 3.6.10-1 version I got these warnings.
>>> Updating module dependencies. Please wait ...
>>> Generating initial ramdisk, using mkinitcpio. Please wait...
==> Building image from preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 3.6.10-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
==> WARNING: Hook 'pata' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
==> WARNING: Hook 'scsi' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
==> WARNING: Hook 'sata' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
-> Running build hook: [filesystems]
-> Running build hook: [usbinput]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: 'fallback'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 3.6.10-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
==> WARNING: Hook 'pata' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
==> WARNING: Hook 'scsi' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
==> WARNING: Hook 'sata' is deprecated. Replace it with 'block' in your config
-> Running build hook: [block]
-> Running build hook: [filesystems]
-> Running build hook: [usbinput]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful
I'm already using only systemd . Where should I replace the hooks with block?
Last edited by tokoro (2012-12-15 19:28:16)Into the Pit wrote:
Have a look at your
/etc/mkinitcpio.conf.pacnew
and merge those files.
Thanks, that solved it. Last time I ignored a deprecated warning, it came back to haunt me. -
JAXB generated code gives deprecation warnings on compile
I have a schema that was previously had its binding generated using jwsdp 1.3. I recent;y made some minor changes to the schema and also upgraded to jwsdp 1.5. I made all the required changes to my environmental varibles on my system (acutal no other version of jwsdp was every installed on this box). xjc generates the code without issue:
xjc -p my.package myxsd.xsd
When I build my software using an ant script I get hundreds of warnings such as the following:
[javac] c:\sandbox\code\my\package\ObjectFactory.java:499: warning: com.sun.xml.bind.GrammarInfo in com.sun.xml.bind has been deprecated
Has anyone seen anything like this, or know what may cause such a problem? I have check all of the jars that my build file calls and they are of the correct version (this so called deprecated package exists in jaxb-impl.jar)
Any help would be appricated. Thnx.JAXB questions should be better directed to the users list of http://jaxb.dev.java.net/
you should subscribe to the 'users' mailing list, then post a question there.
Thank you! -
Can't get rid of Deprecated Warnings when implementing HttpSession
We are implementing HttpSession, for a mock object for testing. However, it has methods that access a deprecated class (HttpSessionContext). Although we mark our implementation of the method that accesses this class (getSessionContext) with the annotation @Deprecated, we still get two error messages as follows:
Warning:Warning:line (8)[deprecation] javax.servlet.http.HttpSessionContext in javax.servlet.http has been deprecated
One warning comes up on the import line for the interface HttpSessionContext, and one on the declaration of the getSessionContext method.
We are using Java 5, with the -deprecation flag.
Is there no way to get rid of these warning messages every time we compile? (We can't turn off the flag just for this one class, because we are compiling from within an IDE (IDEA) that doesn't seem to give us that option.)
Thanks.
Dan Cooperstock, Senior Software Developer, Quest Software
260 King St. E., Toronto ON Canada M5A 4L5
[email protected] 416-933-5165
With Quest Software, you get more ... more performance, more productivity, more value from your IT investments.
Visit www.quest.com to learn more.@SuppressWarnings("deprecation")
-
warning at:
this.setCursor(Cursor.WAIT_CURSOR);
this.setCursor(Cursor.DEFAULT_CURSOR);
what's the new method?This is where the APIs come in handy...
They'll tell you that setCurso is inherited from java.awt.frame, an d when you look at the method description it says it's replaced by Component.setCursor... so probably you'll need to take a look at JComponent and Component in the APIs to know what to do.
Good luck
Maybe you are looking for
-
Re: Column Name as Parameter in Oracle Procedure
Hi, I've successfully compiled the following procedure: CREATE OR REPLACE PROCEDURE CREATE_MEASURES_IND_RPT( pSTART_DT IN date , pEND_DT IN date , PGEO_DIMENSION_COL
-
My network disconnects when computer falls asleep???
I am working on Verizon Fios wireless network and my computer loses the network everytime the computer goes to sleep. The only time it works is when I do a full strt up. I have to switch over to to my airport express network after waking the computer
-
Can't access safari :(
I have a prob;em with my macbook pro; i can't access safari which means i can't get on any website!!!! what should i do ?? please help!!!!!!!!!!!!!!!!!!!!!
-
I have member names that I need to change in Planning 9.2. I know I can change the member names one by one in Planning, but that would take a long time. I have 350 members that I need to be changed from N1 - N350 to B1 - B350. Does anybody know a way
-
I have the mac with following specs I need to update the OS X 10.9.4. I tried OS X Mavericks 10.9.4 Update to install manually but it says "OS X update can't be installed on this disk This volume does not meet the requirements for this update." Pleas